apexcharts 6.3.0 → 6.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.
Files changed (106) hide show
  1. package/dist/apexcharts.common.js +2 -2
  2. package/dist/apexcharts.esm.js +769 -117
  3. package/dist/apexcharts.js +769 -117
  4. package/dist/apexcharts.min.js +2 -2
  5. package/dist/apexcharts.ssr.common.js +2 -2
  6. package/dist/apexcharts.ssr.esm.js +769 -117
  7. package/dist/area.common.js +2 -2
  8. package/dist/area.esm.js +3 -3
  9. package/dist/bar.common.js +2 -2
  10. package/dist/bar.esm.js +208 -109
  11. package/dist/boxPlot.common.js +2 -2
  12. package/dist/boxPlot.esm.js +208 -109
  13. package/dist/bubble.common.js +2 -2
  14. package/dist/bubble.esm.js +3 -3
  15. package/dist/candlestick.common.js +2 -2
  16. package/dist/candlestick.esm.js +208 -109
  17. package/dist/column.common.js +2 -2
  18. package/dist/column.esm.js +208 -109
  19. package/dist/core.common.js +2 -2
  20. package/dist/core.esm.js +372 -62
  21. package/dist/donut.common.js +1 -1
  22. package/dist/donut.esm.js +1 -1
  23. package/dist/features/all.common.js +2 -2
  24. package/dist/features/all.esm.js +282 -9
  25. package/dist/features/annotations.common.js +1 -1
  26. package/dist/features/annotations.esm.js +1 -1
  27. package/dist/features/context-menu.common.js +1 -1
  28. package/dist/features/context-menu.esm.js +1 -1
  29. package/dist/features/drilldown.common.js +1 -1
  30. package/dist/features/drilldown.esm.js +1 -1
  31. package/dist/features/exports.common.js +1 -1
  32. package/dist/features/exports.esm.js +1 -1
  33. package/dist/features/facet.common.js +1 -1
  34. package/dist/features/facet.esm.js +1 -1
  35. package/dist/features/history.common.js +1 -1
  36. package/dist/features/history.esm.js +1 -1
  37. package/dist/features/ink.common.js +1 -1
  38. package/dist/features/ink.esm.js +1 -1
  39. package/dist/features/keyboard.common.js +1 -1
  40. package/dist/features/keyboard.esm.js +1 -1
  41. package/dist/features/legend.common.js +1 -1
  42. package/dist/features/legend.esm.js +1 -1
  43. package/dist/features/link.common.js +1 -1
  44. package/dist/features/link.esm.js +1 -1
  45. package/dist/features/marks.common.js +1 -1
  46. package/dist/features/marks.esm.js +1 -1
  47. package/dist/features/measure.common.js +1 -1
  48. package/dist/features/measure.esm.js +1 -1
  49. package/dist/features/morph.common.js +1 -1
  50. package/dist/features/morph.esm.js +1 -1
  51. package/dist/features/perspectives.common.js +1 -1
  52. package/dist/features/perspectives.esm.js +1 -1
  53. package/dist/features/renderer-canvas.common.js +2 -2
  54. package/dist/features/renderer-canvas.esm.js +280 -7
  55. package/dist/features/storyboard.common.js +1 -1
  56. package/dist/features/storyboard.esm.js +1 -1
  57. package/dist/features/toolbar.common.js +1 -1
  58. package/dist/features/toolbar.esm.js +1 -1
  59. package/dist/features/weave.common.js +1 -1
  60. package/dist/features/weave.esm.js +1 -1
  61. package/dist/heatmap.common.js +2 -2
  62. package/dist/heatmap.esm.js +79 -41
  63. package/dist/line.common.js +2 -2
  64. package/dist/line.esm.js +3 -3
  65. package/dist/pie.common.js +1 -1
  66. package/dist/pie.esm.js +1 -1
  67. package/dist/polarArea.common.js +1 -1
  68. package/dist/polarArea.esm.js +1 -1
  69. package/dist/radar.common.js +1 -1
  70. package/dist/radar.esm.js +1 -1
  71. package/dist/radialBar.common.js +1 -1
  72. package/dist/radialBar.esm.js +1 -1
  73. package/dist/rangeArea.common.js +2 -2
  74. package/dist/rangeArea.esm.js +3 -3
  75. package/dist/rangeBar.common.js +2 -2
  76. package/dist/rangeBar.esm.js +208 -109
  77. package/dist/scatter.common.js +2 -2
  78. package/dist/scatter.esm.js +3 -3
  79. package/dist/treemap.common.js +1 -1
  80. package/dist/treemap.esm.js +1 -1
  81. package/dist/violin.common.js +2 -2
  82. package/dist/violin.esm.js +208 -109
  83. package/package.json +1 -1
  84. package/src/apexcharts.js +7 -0
  85. package/src/charts/Bar.js +38 -6
  86. package/src/charts/HeatMap.js +126 -55
  87. package/src/charts/common/bar/DataLabels.js +16 -0
  88. package/src/modules/Data.js +14 -2
  89. package/src/modules/Filters.js +34 -6
  90. package/src/modules/Graphics.js +4 -4
  91. package/src/modules/Series.js +6 -0
  92. package/src/modules/animations/AxisTransition.js +57 -15
  93. package/src/modules/animations/DataLabelTransition.js +235 -0
  94. package/src/modules/animations/LengthTransition.js +15 -2
  95. package/src/modules/axes/YAxis.js +21 -1
  96. package/src/modules/settings/Defaults.js +12 -1
  97. package/src/modules/settings/Options.js +16 -0
  98. package/src/modules/tooltip/Intersect.js +145 -32
  99. package/src/modules/tooltip/Labels.js +9 -0
  100. package/src/modules/tooltip/Tooltip.js +28 -7
  101. package/src/renderers/Renderer.js +8 -2
  102. package/src/renderers/canvas/CanvasCompositor.js +100 -1
  103. package/src/renderers/canvas/CanvasGraphics.js +184 -0
  104. package/src/renderers/canvas/CanvasRenderer.js +46 -6
  105. package/src/types/internal.d.ts +8 -0
  106. package/types/apexcharts.d.ts +30 -0
package/dist/bar.esm.js CHANGED
@@ -18,7 +18,7 @@ var __spreadValues = (a, b) => {
18
18
  };
19
19
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
20
  /*!
21
- * ApexCharts v6.3.0
21
+ * ApexCharts v6.4.0
22
22
  * (c) 2018-2026 ApexCharts
23
23
  */
24
24
  import * as _core from "apexcharts/core";
@@ -26,6 +26,172 @@ import _core__default from "apexcharts/core";
26
26
  import { default as default2 } from "apexcharts/core";
27
27
  const Graphics = _core.__apex_Graphics;
28
28
  const DataLabels = _core.__apex_DataLabels;
29
+ const BrowserAPIs = _core.__apex_BrowserAPIs_BrowserAPIs;
30
+ const Environment = _core.__apex_Environment_Environment;
31
+ function lengthTransitionEnabled(w) {
32
+ var _a;
33
+ const anim = w.config.chart.animations;
34
+ if (!anim || anim.enabled === false) return false;
35
+ if (!anim.dynamicAnimation || anim.dynamicAnimation.enabled === false) {
36
+ return false;
37
+ }
38
+ const largeThreshold = (_a = anim.largeDatasetThreshold) != null ? _a : 0;
39
+ if (largeThreshold > 0 && w.globals.dataPoints > largeThreshold) return false;
40
+ return !!(Environment.isBrowser() && w.globals.dataChanged && w.globals.shouldAnimate);
41
+ }
42
+ function datumKey(w, realIndex, j) {
43
+ var _a, _b, _c, _d;
44
+ if ((_a = w.axisFlags) == null ? void 0 : _a.isXNumeric) {
45
+ const sx = (_c = (_b = w.seriesData) == null ? void 0 : _b.seriesX) == null ? void 0 : _c[realIndex];
46
+ if (sx && sx.length && sx[j] != null) return "x:" + sx[j];
47
+ }
48
+ const lbl = (_d = w.globals.labels) == null ? void 0 : _d[j];
49
+ if (lbl != null && String(lbl) !== "") {
50
+ return "c:" + (Array.isArray(lbl) ? lbl.join(" ") : String(lbl));
51
+ }
52
+ return "j:" + j;
53
+ }
54
+ function frameDatumKey(frame, realIndex, j) {
55
+ var _a, _b;
56
+ if (frame.isXNumeric) {
57
+ const sx = (_a = frame.seriesX) == null ? void 0 : _a[realIndex];
58
+ if (sx && sx.length && sx[j] != null) return "x:" + sx[j];
59
+ }
60
+ const lbl = (_b = frame.labels) == null ? void 0 : _b[j];
61
+ if (lbl != null && String(lbl) !== "") {
62
+ return "c:" + (Array.isArray(lbl) ? lbl.join(" ") : String(lbl));
63
+ }
64
+ return "j:" + j;
65
+ }
66
+ function joinKeys(oldKeys, newKeys) {
67
+ const oldIndex = /* @__PURE__ */ new Map();
68
+ oldKeys.forEach((k, i) => {
69
+ if (!oldIndex.has(k)) oldIndex.set(k, i);
70
+ });
71
+ const toOld = new Array(newKeys.length);
72
+ const usedOld = /* @__PURE__ */ new Set();
73
+ let prev = -1;
74
+ let ordered = true;
75
+ let identity = oldKeys.length === newKeys.length;
76
+ newKeys.forEach((k, i) => {
77
+ const oi = oldIndex.has(k) && !usedOld.has(oldIndex.get(k)) ? oldIndex.get(k) : -1;
78
+ toOld[i] = oi;
79
+ if (oi !== -1) {
80
+ usedOld.add(oi);
81
+ if (oi < prev) ordered = false;
82
+ prev = oi;
83
+ }
84
+ if (oi !== i) identity = false;
85
+ });
86
+ const exits = [];
87
+ for (let i = 0; i < oldKeys.length; i++) {
88
+ if (!usedOld.has(i)) exits.push(i);
89
+ }
90
+ return { toOld, exits, ordered, changed: !identity };
91
+ }
92
+ function uniquifyKeys(keys) {
93
+ const seen = /* @__PURE__ */ new Map();
94
+ return keys.map((k) => {
95
+ const count = seen.get(k) || 0;
96
+ seen.set(k, count + 1);
97
+ return count === 0 ? k : `${k}#${count}`;
98
+ });
99
+ }
100
+ function seriesJoin(w, realIndex, includeIdentity = false, allowReorder = false) {
101
+ var _a, _b;
102
+ if (!lengthTransitionEnabled(w)) return null;
103
+ const frame = w.globals.prevStreamFrame;
104
+ if (!frame) return null;
105
+ const oldY = (_a = frame.seriesY) == null ? void 0 : _a[realIndex];
106
+ const newY = (_b = w.seriesData.series) == null ? void 0 : _b[realIndex];
107
+ if (!Array.isArray(oldY) || !Array.isArray(newY)) return null;
108
+ if (!oldY.length || !newY.length) return null;
109
+ const oldKeys = uniquifyKeys(
110
+ oldY.map((_, j) => frameDatumKey(frame, realIndex, j))
111
+ );
112
+ const newKeys = uniquifyKeys(newY.map((_, j) => datumKey(w, realIndex, j)));
113
+ const join = joinKeys(oldKeys, newKeys);
114
+ if (!join.ordered && !allowReorder) return null;
115
+ if (!join.changed && !includeIdentity) return null;
116
+ return { join, oldKeys, newKeys };
117
+ }
118
+ function firstMove(d) {
119
+ const m = /^M\s*([+-]?[\d.eE]+)[\s,]+([+-]?[\d.eE]+)/.exec(d || "");
120
+ if (!m) return null;
121
+ const x = parseFloat(m[1]);
122
+ const y = parseFloat(m[2]);
123
+ return isFinite(x) && isFinite(y) ? { x, y } : null;
124
+ }
125
+ function renderBarExitGhosts({
126
+ w,
127
+ elSeries,
128
+ record,
129
+ newKeys,
130
+ isHorizontal,
131
+ speed
132
+ }) {
133
+ var _a;
134
+ if (!lengthTransitionEnabled(w)) return;
135
+ if (!record || !Array.isArray(record.paths) || !(elSeries == null ? void 0 : elSeries.node)) return;
136
+ const newKeySet = new Set(newKeys);
137
+ const exits = record.paths.filter(
138
+ (p) => p && p.d && p.key != null && !newKeySet.has(p.key)
139
+ );
140
+ if (!exits.length) return;
141
+ const graphics = new Graphics(w);
142
+ const fallbackFill = (_a = w.globals.colors) == null ? void 0 : _a[parseInt(String(record.realIndex), 10)];
143
+ exits.forEach((p) => {
144
+ let fill = p.fill || fallbackFill || "#c8c8c8";
145
+ if (String(fill).indexOf("url(") === 0) fill = fallbackFill || "#c8c8c8";
146
+ const ghost = graphics.drawPath({
147
+ d: p.d,
148
+ stroke: "none",
149
+ strokeWidth: 0,
150
+ fill,
151
+ fillOpacity: 1,
152
+ classes: "apexcharts-bar-ghost"
153
+ });
154
+ const node = ghost.node;
155
+ node.setAttribute("pointer-events", "none");
156
+ ghost.attr(
157
+ "clip-path",
158
+ `url(#gridRectBarMask${w.globals.cuid})`
159
+ );
160
+ elSeries.node.insertBefore(node, elSeries.node.firstChild);
161
+ const start = firstMove(p.d);
162
+ let origin = isHorizontal ? "left center" : "center bottom";
163
+ try {
164
+ const bb = node.getBBox();
165
+ if (start && bb) {
166
+ if (isHorizontal) {
167
+ origin = Math.abs(start.x - bb.x) <= Math.abs(start.x - (bb.x + bb.width)) ? "left center" : "right center";
168
+ } else {
169
+ origin = Math.abs(start.y - (bb.y + bb.height)) <= Math.abs(start.y - bb.y) ? "center bottom" : "center top";
170
+ }
171
+ }
172
+ } catch (_) {
173
+ }
174
+ const style = node.style;
175
+ style.transformBox = "fill-box";
176
+ style.transformOrigin = origin;
177
+ const duration = Math.max(1, speed || 1);
178
+ const startAt = performance.now();
179
+ const step = (now) => {
180
+ if (w.globals.isDestroyed || !node.parentNode) return;
181
+ const t = Math.max(0, Math.min(1, (now - startAt) / duration));
182
+ const eased = 1 - Math.pow(1 - t, 3);
183
+ const scale = 1 - eased;
184
+ style.transform = isHorizontal ? `scaleX(${scale})` : `scaleY(${scale})`;
185
+ style.opacity = String(1 - eased);
186
+ if (t < 1) {
187
+ BrowserAPIs.requestAnimationFrame(step);
188
+ } else {
189
+ node.parentNode.removeChild(node);
190
+ }
191
+ };
192
+ BrowserAPIs.requestAnimationFrame(step);
193
+ });
194
+ }
29
195
  class BarDataLabels {
30
196
  /**
31
197
  * @param {import('../../../charts/Bar').default} barCtx
@@ -476,6 +642,7 @@ class BarDataLabels {
476
642
  barWidth,
477
643
  dataLabelsConfig
478
644
  }) {
645
+ var _a, _b;
479
646
  const w = this.w;
480
647
  let rotate = "rotate(0)";
481
648
  if (w.config.plotOptions.bar.dataLabels.orientation === "vertical")
@@ -490,6 +657,17 @@ class BarDataLabels {
490
657
  class: "apexcharts-data-labels",
491
658
  transform: rotate
492
659
  });
660
+ const dlCfg = w.config.dataLabels;
661
+ if (((_a = dlCfg.animate) == null ? void 0 : _a.enabled) || ((_b = dlCfg.countUp) == null ? void 0 : _b.enabled)) {
662
+ elDataLabelsWrap.node.setAttribute(
663
+ "data:dlKey",
664
+ `${i}::${datumKey(w, i, j)}`
665
+ );
666
+ elDataLabelsWrap.node.setAttribute("data:dlJ", String(j));
667
+ if (typeof val === "number" && isFinite(val)) {
668
+ elDataLabelsWrap.node.setAttribute("data:dlVal", String(val));
669
+ }
670
+ }
493
671
  let text = "";
494
672
  if (typeof val !== "undefined") {
495
673
  text = formatter(val, __spreadProps(__spreadValues({}, w), {
@@ -1414,108 +1592,6 @@ class Helpers {
1414
1592
  const CoreUtils = _core.__apex_CoreUtils;
1415
1593
  const Filters = _core.__apex_Filters;
1416
1594
  const computeStagger = _core.__apex_Animations_computeStagger;
1417
- const BrowserAPIs = _core.__apex_BrowserAPIs_BrowserAPIs;
1418
- const Environment = _core.__apex_Environment_Environment;
1419
- function lengthTransitionEnabled(w) {
1420
- var _a;
1421
- const anim = w.config.chart.animations;
1422
- if (!anim || anim.enabled === false) return false;
1423
- if (!anim.dynamicAnimation || anim.dynamicAnimation.enabled === false) {
1424
- return false;
1425
- }
1426
- const largeThreshold = (_a = anim.largeDatasetThreshold) != null ? _a : 0;
1427
- if (largeThreshold > 0 && w.globals.dataPoints > largeThreshold) return false;
1428
- return !!(Environment.isBrowser() && w.globals.dataChanged && w.globals.shouldAnimate);
1429
- }
1430
- function datumKey(w, realIndex, j) {
1431
- var _a, _b, _c, _d;
1432
- if ((_a = w.axisFlags) == null ? void 0 : _a.isXNumeric) {
1433
- const sx = (_c = (_b = w.seriesData) == null ? void 0 : _b.seriesX) == null ? void 0 : _c[realIndex];
1434
- if (sx && sx.length && sx[j] != null) return "x:" + sx[j];
1435
- }
1436
- const lbl = (_d = w.globals.labels) == null ? void 0 : _d[j];
1437
- if (lbl != null && String(lbl) !== "") {
1438
- return "c:" + (Array.isArray(lbl) ? lbl.join(" ") : String(lbl));
1439
- }
1440
- return "j:" + j;
1441
- }
1442
- function firstMove(d) {
1443
- const m = /^M\s*([+-]?[\d.eE]+)[\s,]+([+-]?[\d.eE]+)/.exec(d || "");
1444
- if (!m) return null;
1445
- const x = parseFloat(m[1]);
1446
- const y = parseFloat(m[2]);
1447
- return isFinite(x) && isFinite(y) ? { x, y } : null;
1448
- }
1449
- function renderBarExitGhosts({
1450
- w,
1451
- elSeries,
1452
- record,
1453
- newKeys,
1454
- isHorizontal,
1455
- speed
1456
- }) {
1457
- var _a;
1458
- if (!lengthTransitionEnabled(w)) return;
1459
- if (!record || !Array.isArray(record.paths) || !(elSeries == null ? void 0 : elSeries.node)) return;
1460
- const newKeySet = new Set(newKeys);
1461
- const exits = record.paths.filter(
1462
- (p) => p && p.d && p.key != null && !newKeySet.has(p.key)
1463
- );
1464
- if (!exits.length) return;
1465
- const graphics = new Graphics(w);
1466
- const fallbackFill = (_a = w.globals.colors) == null ? void 0 : _a[parseInt(String(record.realIndex), 10)];
1467
- exits.forEach((p) => {
1468
- let fill = p.fill || fallbackFill || "#c8c8c8";
1469
- if (String(fill).indexOf("url(") === 0) fill = fallbackFill || "#c8c8c8";
1470
- const ghost = graphics.drawPath({
1471
- d: p.d,
1472
- stroke: "none",
1473
- strokeWidth: 0,
1474
- fill,
1475
- fillOpacity: 1,
1476
- classes: "apexcharts-bar-ghost"
1477
- });
1478
- const node = ghost.node;
1479
- node.setAttribute("pointer-events", "none");
1480
- ghost.attr(
1481
- "clip-path",
1482
- `url(#gridRectBarMask${w.globals.cuid})`
1483
- );
1484
- elSeries.node.insertBefore(node, elSeries.node.firstChild);
1485
- const start = firstMove(p.d);
1486
- let origin = isHorizontal ? "left center" : "center bottom";
1487
- try {
1488
- const bb = node.getBBox();
1489
- if (start && bb) {
1490
- if (isHorizontal) {
1491
- origin = Math.abs(start.x - bb.x) <= Math.abs(start.x - (bb.x + bb.width)) ? "left center" : "right center";
1492
- } else {
1493
- origin = Math.abs(start.y - (bb.y + bb.height)) <= Math.abs(start.y - bb.y) ? "center bottom" : "center top";
1494
- }
1495
- }
1496
- } catch (_) {
1497
- }
1498
- const style = node.style;
1499
- style.transformBox = "fill-box";
1500
- style.transformOrigin = origin;
1501
- const duration = Math.max(1, speed || 1);
1502
- const startAt = performance.now();
1503
- const step = (now) => {
1504
- if (w.globals.isDestroyed || !node.parentNode) return;
1505
- const t = Math.max(0, Math.min(1, (now - startAt) / duration));
1506
- const eased = 1 - Math.pow(1 - t, 3);
1507
- const scale = 1 - eased;
1508
- style.transform = isHorizontal ? `scaleX(${scale})` : `scaleY(${scale})`;
1509
- style.opacity = String(1 - eased);
1510
- if (t < 1) {
1511
- BrowserAPIs.requestAnimationFrame(step);
1512
- } else {
1513
- node.parentNode.removeChild(node);
1514
- }
1515
- };
1516
- BrowserAPIs.requestAnimationFrame(step);
1517
- });
1518
- }
1519
1595
  function seriesEmitter(ctx, graphics) {
1520
1596
  const r = ctx && ctx.renderer;
1521
1597
  return r && r.kind && r.kind !== "svg" ? r : graphics;
@@ -1559,6 +1635,7 @@ class Bar {
1559
1635
  this.pathArr = [];
1560
1636
  this._prevKeyed = null;
1561
1637
  this._ltCache = null;
1638
+ this._layoutShiftCache = null;
1562
1639
  this.series = [];
1563
1640
  this.elSeries = null;
1564
1641
  this.visibleI = 0;
@@ -1587,7 +1664,7 @@ class Bar {
1587
1664
  * @return {Element} element which is supplied to parent chart draw method for appending
1588
1665
  **/
1589
1666
  draw(series, seriesIndex) {
1590
- var _a, _b;
1667
+ var _a, _b, _c;
1591
1668
  const w = this.w;
1592
1669
  const graphics = new Graphics(this.w);
1593
1670
  const coreUtils = new CoreUtils(this.w);
@@ -1661,8 +1738,10 @@ class Bar {
1661
1738
  el: elDataLabelsWrap.node,
1662
1739
  // On a layout-changing update the labels must stay hidden through the
1663
1740
  // reflow morph (the updateOptions flow otherwise reveals them at
1664
- // frame 0, where they float over sliding bars).
1665
- holdUntilComplete: this.isLengthTransition(realIndex)
1741
+ // frame 0, where they float over sliding bars). When dataLabels.animate
1742
+ // is on the labels instead RIDE the morph (see DataLabelTransition), so
1743
+ // keep them visible: holding would hide the very motion we want to show.
1744
+ holdUntilComplete: !((_a = w.config.dataLabels.animate) == null ? void 0 : _a.enabled) && this.isLengthTransition(realIndex)
1666
1745
  });
1667
1746
  elDataLabelsWrap.node.classList.add("apexcharts-element-hidden");
1668
1747
  const elGoalsMarkers = graphics.group({
@@ -1715,9 +1794,9 @@ class Bar {
1715
1794
  j,
1716
1795
  realIndex
1717
1796
  );
1718
- if (this.isFunnel && !this.isPyramid && this.barOptions.isFunnel3d && ((_a = w.config.plotOptions.funnel) == null ? void 0 : _a.shape) !== "trapezoid" && this.pathArr.length && j > 0) {
1797
+ if (this.isFunnel && !this.isPyramid && this.barOptions.isFunnel3d && ((_b = w.config.plotOptions.funnel) == null ? void 0 : _b.shape) !== "trapezoid" && this.pathArr.length && j > 0) {
1719
1798
  const barShadow = this.barHelpers.drawBarShadow({
1720
- color: typeof pathFill.color === "string" && ((_b = pathFill.color) == null ? void 0 : _b.indexOf("url")) === -1 ? pathFill.color : Utils.hexToRgba(w.globals.colors[i]),
1799
+ color: typeof pathFill.color === "string" && ((_c = pathFill.color) == null ? void 0 : _c.indexOf("url")) === -1 ? pathFill.color : Utils.hexToRgba(w.globals.colors[i]),
1721
1800
  prevPaths: this.pathArr[this.pathArr.length - 1],
1722
1801
  currPaths: paths,
1723
1802
  realIndex,
@@ -1889,7 +1968,7 @@ class Bar {
1889
1968
  }
1890
1969
  const animCfg = w.config.chart.animations;
1891
1970
  const gradCfg = animCfg.animateGradually;
1892
- const staggerEnabled = gradCfg && gradCfg.enabled !== false && !(w.globals.dataChanged && this.isLengthTransition(realIndex));
1971
+ const staggerEnabled = gradCfg && gradCfg.enabled !== false && !(w.globals.dataChanged && this.isLayoutShift(realIndex));
1893
1972
  let delay = 0;
1894
1973
  if (staggerEnabled) {
1895
1974
  const totalBars = w.globals.dataPoints || 1;
@@ -2303,6 +2382,26 @@ class Bar {
2303
2382
  this._ltCache[realIndex] = result;
2304
2383
  return result;
2305
2384
  }
2385
+ /**
2386
+ * Whether this update moves survivors to new slots: a length change
2387
+ * (enter/exit, via isLengthTransition) OR a pure reorder (a "bar chart race"
2388
+ * swap, same datum set in a new order). Used to drop the per-bar stagger so
2389
+ * all bars slide on one shared clock, staying locked to the axis/data labels.
2390
+ * Broader than isLengthTransition, which is deliberately enter/exit-only
2391
+ * (exit ghosts / baseline enters must not fire on a plain reorder).
2392
+ * @param {number} realIndex
2393
+ */
2394
+ isLayoutShift(realIndex) {
2395
+ if (this.isLengthTransition(realIndex)) return true;
2396
+ if (!this._layoutShiftCache) this._layoutShiftCache = {};
2397
+ if (this._layoutShiftCache[realIndex] !== void 0) {
2398
+ return this._layoutShiftCache[realIndex];
2399
+ }
2400
+ const sj = seriesJoin(this.w, realIndex, true, true);
2401
+ const result = !!(sj && sj.join.changed);
2402
+ this._layoutShiftCache[realIndex] = result;
2403
+ return result;
2404
+ }
2306
2405
  /**
2307
2406
  * Resolve `pathFrom` for a bar on data update, joining old and new datums
2308
2407
  * by KEY (category label / x value) so survivors keep their identity across
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * ApexCharts v6.3.0
2
+ * ApexCharts v6.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,i=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable,o=(e,s,a)=>s in e?t(e,s,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[s]=a,l=(t,e)=>{for(var s in e||(e={}))i.call(e,s)&&o(t,s,e[s]);if(a)for(var s of a(e))r.call(e,s)&&o(t,s,e[s]);return t},n=(t,a)=>e(t,s(a));Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const h=require("apexcharts/core");function d(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 c=d(h),b=c.__apex_CoreUtils,g=c.__apex_Graphics,u=c.__apex_DataLabels;class p{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){const{x:e,y:s,y1:a,y2:i,i:r,j:o,realIndex:h,columnGroupIndex:d,series:c,barHeight:b,barWidth:u,barXPosition:p,barYPosition:x,visibleSeries:f}=t,y=this.w,m=new g(this.barCtx.w),v=Array.isArray(this.barCtx.strokeWidth)?this.barCtx.strokeWidth[h]:this.barCtx.strokeWidth;let C,w;y.axisFlags.isXNumeric&&!y.globals.isBarHorizontal?(C=e+u*(f+1),w=s+b*(f+1)-v):(C=e+u*f,w=s+b*f);let P=null,L=null,I=e,k=s,H={};const W=y.config.dataLabels,A=this.barCtx.barOptions.dataLabels,D=this.barCtx.barOptions.dataLabels.total;void 0!==x&&(this.barCtx.isRangeBar||this.barCtx.isPyramid)&&(w=x,k=x),void 0!==p&&this.barCtx.isVerticalGroupedRangeBar&&(C=p,I=p);const O=W.offsetX,R=W.offsetY;let X={width:0,height:0};if(y.config.dataLabels.enabled){const t=y.seriesData.series[r][o];X=m.getTextRects(y.config.dataLabels.formatter?y.config.dataLabels.formatter(t,n(l({},y),{seriesIndex:r,dataPointIndex:o,w:y})):y.formatters.yLabelFormatters[0](t),parseFloat(W.style.fontSize).toString())}const F={x:e,y:s,i:r,j:o,realIndex:h,columnGroupIndex:d,bcx:C,bcy:w,barHeight:b,barWidth:u,textRects:X,strokeWidth:v,dataLabelsX:I,dataLabelsY:k,dataLabelsConfig:W,barDataLabelsConfig:A,barTotalDataLabelsConfig:D,offX:O,offY:R};return H=this.barCtx.isHorizontal?this.calculateBarsDataLabelsPosition(F):this.calculateColumnsDataLabelsPosition(F),P=this.drawCalculatedDataLabels({x:H.dataLabelsX,y:H.dataLabelsY,val:this.barCtx.isRangeBar?[a,i]:"100%"===y.config.chart.stackType?c[h][o]:y.seriesData.series[h][o],i:h,j:o,barWidth:u,barHeight:b,textRects:X,dataLabelsConfig:W}),y.config.chart.stacked&&D.enabled&&(L=this.drawTotalDataLabels({x:H.totalDataLabelsX,y:H.totalDataLabelsY,barWidth:u,barHeight:b,realIndex:h,textAnchor:H.totalDataLabelsAnchor,val:this.getStackedTotalDataLabel({realIndex:h,j:o}),dataLabelsConfig:W,barTotalDataLabelsConfig:D})),{dataLabelsPos:H,dataLabels:P,totalDataLabels:L}}getStackedTotalDataLabel({realIndex:t,j:e}){const s=this.w;let a=this.barCtx.stackedSeriesTotals[e];return this.totalFormatter&&(a=this.totalFormatter(a,n(l({},s),{seriesIndex:t,dataPointIndex:e,w:s}))),a}calculateColumnsDataLabelsPosition(t){const e=this.w;let s,a,{i:i,j:r,realIndex:o,y:l,bcx:n,barWidth:h,barHeight:d,textRects:c,dataLabelsX:b,dataLabelsY:u,dataLabelsConfig:p,barDataLabelsConfig:x,barTotalDataLabelsConfig:f,strokeWidth:y,offX:m,offY:v}=t;const C=n;d=Math.abs(d);const w="vertical"===e.config.plotOptions.bar.dataLabels.orientation,{zeroEncounters:P}=this.barCtx.barHelpers.getZeroValueEncounters({i:i,j:r});n-=y/2;const L=e.layout.gridWidth/e.globals.dataPoints;if(this.barCtx.isVerticalGroupedRangeBar?b+=h/2:(b=e.axisFlags.isXNumeric?n-h/2+m:n-L+h/2+m,!e.config.chart.stacked&&P>0&&e.config.plotOptions.bar.hideZeroBarsWhenGrouped&&(b-=h*P)),w){const t=2;b=b+c.height/2-y/2-t}const I=e.seriesData.series[i][r]<0;let k=l;switch(this.barCtx.isReversed&&(k=l+(I?d:-d)),x.position){case"center":u=w?I?k-d/2+v:k+d/2-v:I?k-d/2+c.height/2+v:k+d/2+c.height/2-v;break;case"bottom":u=w?I?k-d+v:k+d-v:I?k-d+c.height+y+v:k+d-c.height/2+y-v;break;case"top":u=w?I?k+v:k-v:I?k-c.height/2-v:k+c.height+v}let H=k;if(e.labelData.seriesGroups.forEach(t=>{var e;null==(e=this.barCtx[t.join(",")])||e.prevY.forEach(t=>{H=I?Math.max(t[r],H):Math.min(t[r],H)})}),this.barCtx.lastActiveBarSerieIndex===o&&f.enabled){const t=18,i=new g(this.barCtx.w).getTextRects(this.getStackedTotalDataLabel({realIndex:o,j:r}),p.fontSize);s=I?H-i.height/2-v-f.offsetY+t:H+i.height+v+f.offsetY-t;const l=L;a=C+(e.axisFlags.isXNumeric?-h*e.globals.barGroups.length/2:e.globals.barGroups.length*h/2-(e.globals.barGroups.length-1)*h-l)+f.offsetX}return e.config.chart.stacked||(u<0?u=0+y:u+c.height/3>e.layout.gridHeight&&(u=e.layout.gridHeight-y)),{bcx:n,bcy:l,dataLabelsX:b,dataLabelsY:u,totalDataLabelsX:a,totalDataLabelsY:s,totalDataLabelsAnchor:"middle"}}calculateBarsDataLabelsPosition(t){var e;const s=this.w;let{x:a,i:i,j:r,realIndex:o,bcy:l,barHeight:n,barWidth:h,textRects:d,dataLabelsX:c,strokeWidth:b,dataLabelsConfig:u,barDataLabelsConfig:p,barTotalDataLabelsConfig:x,offX:f,offY:y}=t;const m=s.layout.gridHeight/s.globals.dataPoints,{zeroEncounters:v}=this.barCtx.barHelpers.getZeroValueEncounters({i:i,j:r});let C,w,P;if(h=Math.abs(h),this.barCtx.isPyramid){C=l+n/2+y-(null!=(e=d.centerOffset)?e:0)}else C=l-(this.barCtx.isRangeBar?0:m)+n/2+d.height/2+y-3;!s.config.chart.stacked&&v>0&&s.config.plotOptions.bar.hideZeroBarsWhenGrouped&&(C-=n*v);let L="start";const I=s.seriesData.series[i][r]<0;let k=a;if(this.barCtx.isReversed&&(k=a+(I?-h:h),L=I?"start":"end"),this.barCtx.isPyramid)c=s.layout.gridWidth/2+f;else switch(p.position){case"center":c=I?k+h/2-f:Math.max(d.width/2,k-h/2)+f;break;case"bottom":c=I?k+h-b-f:k-h+b+f;break;case"top":c=I?k-b-f:k-b+f}let H=k;if(s.labelData.seriesGroups.forEach(t=>{var e;null==(e=this.barCtx[t.join(",")])||e.prevX.forEach(t=>{H=I?Math.min(t[r],H):Math.max(t[r],H)})}),this.barCtx.lastActiveBarSerieIndex===o&&x.enabled){const t=new g(this.barCtx.w).getTextRects(this.getStackedTotalDataLabel({realIndex:o,j:r}),u.fontSize);I?(w=H-b-f-x.offsetX,L="end"):w=H+f+x.offsetX+(this.barCtx.isReversed?-(h+b):b),P=C-d.height/2+t.height/2+x.offsetY+b,s.globals.barGroups.length>1&&(P-=s.globals.barGroups.length/2*(n/2))}return s.config.chart.stacked||("start"===u.textAnchor?c-d.width<0?c=I?d.width+b:b:c+d.width>s.layout.gridWidth&&(c=I?s.layout.gridWidth-b:s.layout.gridWidth-d.width-b):"middle"===u.textAnchor?c-d.width/2<0?c=d.width/2+b:c+d.width/2>s.layout.gridWidth&&(c=s.layout.gridWidth-d.width/2-b):"end"===u.textAnchor&&(c<1?c=d.width+b:c+1>s.layout.gridWidth&&(c=s.layout.gridWidth-d.width-b))),{bcx:a,bcy:l,dataLabelsX:c,dataLabelsY:C,totalDataLabelsX:w,totalDataLabelsY:P,totalDataLabelsAnchor:L}}drawCalculatedDataLabels({x:t,y:e,val:s,i:a,j:i,textRects:r,barHeight:o,barWidth:h,dataLabelsConfig:d}){const c=this.w;let b="rotate(0)";"vertical"===c.config.plotOptions.bar.dataLabels.orientation&&(b=`rotate(-90, ${t}, ${e})`);const p=new u(this.barCtx.w,this.barCtx.ctx),x=new g(this.barCtx.w),f=d.formatter;let y=null;const m=c.globals.collapsedSeriesIndices.indexOf(a)>-1;if(d.enabled&&!m){y=x.group({class:"apexcharts-data-labels",transform:b});let g="";void 0!==s&&(g=f(s,n(l({},c),{seriesIndex:a,dataPointIndex:i,w:c}))),!s&&c.config.plotOptions.bar.hideZeroBarsWhenGrouped&&(g="");const u=c.seriesData.series[a][i]<0,m=c.config.plotOptions.bar.dataLabels.position;if("vertical"===c.config.plotOptions.bar.dataLabels.orientation&&("top"===m&&(d.textAnchor=u?"end":"start"),"center"===m&&(d.textAnchor="middle"),"bottom"===m&&(d.textAnchor=u?"end":"start")),this.barCtx.isRangeBar&&this.barCtx.barOptions.dataLabels.hideOverflowingLabels){h<x.getTextRects(g,parseFloat(d.style.fontSize).toString()).width&&(g="")}c.config.chart.stacked&&this.barCtx.barOptions.dataLabels.hideOverflowingLabels&&(this.barCtx.isHorizontal?r.width/1.6>Math.abs(h)&&(g=""):r.height/1.6>Math.abs(o)&&(g=""));const v=l({},d);this.barCtx.isHorizontal&&s<0&&("start"===d.textAnchor?v.textAnchor="end":"end"===d.textAnchor&&(v.textAnchor="start")),p.plotDataLabelsText({x:t,y:e,text:g,i:a,j:i,parent:y,dataLabelsConfig:v,alwaysDrawDataLabel:!0,offsetCorrection:!0})}return y}drawTotalDataLabels({x:t,y:e,val:s,realIndex:a,textAnchor:i,barTotalDataLabelsConfig:r}){const o=new g(this.barCtx.w);let l;return r.enabled&&void 0!==t&&void 0!==e&&this.barCtx.lastActiveBarSerieIndex===a&&(l=o.drawText({x:t,y:e,foreColor:r.style.color,text:s,textAnchor:i,fontFamily:r.style.fontFamily,fontSize:r.style.fontSize,fontWeight:r.style.fontWeight})),l}}const x=c.__apex_Series,f=c.__apex_Fill,y=c.__apex_Utils;class m{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),y.isSafari()&&(this.arrBorderRadius=this.arrBorderRadius.map(t=>t.map(t=>"none"))),0===this.barCtx.seriesLen&&(this.barCtx.seriesLen=1),this.barCtx.zeroSerieses=[],e.globals.comboCharts||this.checkZeroSeries({series:t})}initialPositions(t){const e=this.w;let s,a,i,r,o,l,n,h,d=e.globals.dataPoints;this.barCtx.isRangeBar&&(d=e.labelData.labels.length);let c=this.barCtx.seriesLen;if(e.config.plotOptions.bar.rangeBarGroupRows&&(c=1),this.barCtx.isHorizontal)i=e.layout.gridHeight/d,o=i/c,e.axisFlags.isXNumeric&&(i=e.layout.gridHeight/this.barCtx.totalItems,o=i/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=(i-o*this.barCtx.seriesLen)/2;else{if(r=e.layout.gridWidth/this.barCtx.visibleItems,e.config.xaxis.convertedCatToNumeric&&(r=e.layout.gridWidth/e.globals.dataPoints),l=r/c*parseInt(this.barCtx.barOptions.columnWidth,10)/100,e.axisFlags.isXNumeric){const t=this.barCtx.xRatio;e.globals.minXDiff&&.5!==e.globals.minXDiff&&e.globals.minXDiff/t>0&&(r=e.globals.minXDiff/t),l=r/c*parseInt(this.barCtx.barOptions.columnWidth,10)/100,l<1&&(l=1)}if(-1===String(this.barCtx.barOptions.columnWidth).indexOf("%")&&(l=parseInt(this.barCtx.barOptions.columnWidth,10)),n=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:l}).x}else s=e.globals.padHorizontal+y.noExponents(r-l*this.barCtx.seriesLen)/2}return e.globals.barHeight=o,e.globals.barWidth=l,{x:s,y:a,yDivision:i,xDivision:r,barHeight:o,barWidth:l,zeroH:n,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 i,r,o,l;const n=this.w,h=new f(this.barCtx.w);let d=null;const c=this.barCtx.barOptions.distributed?s:e;let b=!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&&(d=a.color,b=!0)})}return{color:h.fillPath({seriesNumber:this.barCtx.barOptions.distributed?c:a,dataPointIndex:s,color:d,value:t[e][s],fillConfig:null==(i=n.config.series[e].data[s])?void 0:i.fill,fillType:(null==(o=null==(r=n.config.series[e].data[s])?void 0:r.fill)?void 0:o.type)?null==(l=n.config.series[e].data[s])?void 0:l.fill.type:Array.isArray(n.config.fill.type)?n.config.fill.type[a]:n.config.fill.type}),useRangeColor:b}}getStrokeWidth(t,e,s){let a=0;const i=this.w;return void 0===this.barCtx.series[t][e]||null===this.barCtx.series[t][e]||"bar"===i.config.chart.type&&!this.barCtx.series[t][e]?this.barCtx.isNullValue=!0:this.barCtx.isNullValue=!1,i.config.stroke.show&&(this.barCtx.isNullValue||(a=Array.isArray(this.barCtx.strokeWidth)?this.barCtx.strokeWidth[s]:this.barCtx.strokeWidth)),a}createBorderRadiusArr(t){var e;const s=this.w,a=!this.w.config.chart.stacked||s.config.plotOptions.bar.borderRadius<=0,i=t.length,r=0|(null==(e=t[0])?void 0:e.length),o=Array.from({length:i},()=>Array(r).fill(a?"top":"none"));if(a)return o;const l=this.w.config.chart.type;for(let e=0;e<r;e++){const s=[],a=[];let n=0;for(let r=0;r<i;r++){const i=t[r][e];i>0?(s.push(r),n++):i<0&&(a.push(r),n++)}if(s.length>0&&0===a.length)if(1===s.length)o[s[0]][e]="bar"===l&&1===r?"top":"both";else{const t=s[0],a=s[s.length-1];for(const i of s)o[i][e]=i===t?"bar"===l&&1===r?"top":"bottom":i===a?"top":"none"}else if(a.length>0&&0===s.length)if(1===a.length)o[a[0]][e]="both";else{const t=Math.max(...a),s=Math.min(...a);for(const i of a)o[i][e]=i===t?"bottom":i===s?"top":"none"}else if(s.length>0&&a.length>0){const t=s[s.length-1];for(const a of s)o[a][e]=a===t?"top":"none";const i=Math.max(...a);for(const t of a)o[t][e]=t===i?"bottom":"none"}else if(1===n){o[s[0]||a[0]][e]="both"}}return o}barBackground({j:t,i:e,x1:s,x2:a,y1:i,y2:r,elSeries:o}){const l=this.w,n=new g(this.barCtx.w),h=new x(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=n.drawRect(void 0!==s?s:0,void 0!==i?i:0,void 0!==a?a:l.layout.gridWidth,void 0!==r?r:l.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:i,isReversed:r,series:o,seriesGroup:l,realIndex:n,i:h,j:d,w:c}){var b,u,p;const x=new g(this.barCtx.w);(i=Array.isArray(i)?i[n]:i)||(i=0);let f=t,y=e;(null==(b=c.config.series[n].data[d])?void 0:b.columnWidthOffset)&&(y=e-c.config.series[n].data[d].columnWidthOffset/2,f=t+c.config.series[n].data[d].columnWidthOffset);const m=i/2,v=y+m,C=y+f-m,w=(o[h][d]>=0?1:-1)*(r?-1:1);s+=.001-m*w,a+=.001+m*w;const P=x.line(C,s),L="around"===c.config.plotOptions.bar.borderRadiusApplication||"both"===this.arrBorderRadius[n][d]?" Z":" z";let I=x.move(v,s)+x.line(v,a)+x.line(C,a)+P+L;"none"!==this.arrBorderRadius[n][d]&&(I=x.roundPathCorners(I,c.config.plotOptions.bar.borderRadius));let k=null;const H=null==(p=null==(u=this.barCtx.ctx)?void 0:u.morphTypeChange)?void 0:p.getInitialPathFor(n,d);if(H?k=H:c.globals.previousPaths.length>0&&(k=this.barCtx.getPreviousPath(n,d,I)),null==k&&(k=x.move(v,s)+x.line(v,s)+P+P+P+P+P+x.line(v,s)+L),c.config.chart.stacked){let t=this.barCtx;t=this.barCtx[l],t.yArrj.push(a-m*w),t.yArrjF.push(Math.abs(s-a+i*w)),t.yArrjVal.push(this.barCtx.series[h][d])}return{pathTo:I,pathFrom:k}}getFunnelTrapezoidPaths({barYPosition:t,barHeight:e,series:s,i:a,j:i,realIndex:r,strokeWidth:o,w:l}){var n,h;const d=new g(this.barCtx.w),c=l.layout.gridWidth/2,b=t=>Math.abs(t/this.barCtx.invertedYRatio)/2,u=b(s[a][i]),p=i===s[a].length-1,x="taper"===l.config.plotOptions.funnel.lastShape?"taper":"flat";let f;f=p?"taper"===x?0:u:b(s[a][i+1]);const y=o/2,m=t+y,v=t+e-y,C=c-u,w=c+u,P=c-f,L=c+f,I=d.move(C,m)+d.line(w,m)+d.line(L,v)+d.line(P,v)+" Z";let k=null;const H=null==(h=null==(n=this.barCtx.ctx)?void 0:n.morphTypeChange)?void 0:h.getInitialPathFor(r,i);return H?k=H:l.globals.previousPaths.length>0&&(k=this.barCtx.getPreviousPath(r,i,I)),null==k&&(k=d.move(c,m)+d.line(c,m)+d.line(c,v)+d.line(c,v)+" Z"),{pathTo:I,pathFrom:k,x:w,x1:C,barXPosition:c}}computePyramidLayout(t){const e=this.w,s=e.layout.gridHeight,a=e.layout.gridWidth,i=t.map(t=>Math.abs(Number(t)||0)),r=i.reduce((t,e)=>t+e,0);if(0===r||s<=0)return i.map(()=>({y:0,height:0,topHalf:0,bottomHalf:0}));const o=a/2;let l=0;const n=[];for(let t=0;t<i.length;t++){const e=l/r;l+=i[t];const a=l/r,h=e*s,d=a*s;n.push({y:h,height:d-h,topHalf:e*o,bottomHalf:a*o})}return n}getPyramidPaths({barYPosition:t,barHeight:e,topHalf:s,bottomHalf:a,realIndex:i,j:r,strokeWidth:o,w:l}){var n,h;const d=new g(this.barCtx.w),c=l.layout.gridWidth/2,b=o/2,u=t+b,p=t+e-b,x=c-s,f=c+s,y=c-a,m=c+a,v=d.move(x,u)+d.line(f,u)+d.line(m,p)+d.line(y,p)+" Z";let C=null;const w=null==(h=null==(n=this.barCtx.ctx)?void 0:n.morphTypeChange)?void 0:h.getInitialPathFor(i,r);return w?C=w:l.globals.previousPaths.length>0&&(C=this.barCtx.getPreviousPath(i,r,v)),null==C&&(C=d.move(c,u)+d.line(c,u)+d.line(c,p)+d.line(c,p)+" Z"),{pathTo:v,pathFrom:C,x:f,x1:x,barXPosition:c}}getBarpaths({barYPosition:t,barHeight:e,x1:s,x2:a,strokeWidth:i,isReversed:r,series:o,seriesGroup:l,realIndex:n,i:h,j:d,w:c}){var b,u,p;const x=new g(this.barCtx.w);(i=Array.isArray(i)?i[n]:i)||(i=0);let f=t,y=e;(null==(b=c.config.series[n].data[d])?void 0:b.barHeightOffset)&&(f=t-c.config.series[n].data[d].barHeightOffset/2,y=e+c.config.series[n].data[d].barHeightOffset);const m=i/2,v=f+m,C=f+y-m,w=(o[h][d]>=0?1:-1)*(r?-1:1);s+=.001+m*w,a+=.001-m*w;const P=this.barCtx.isFunnel,L=P?(s+a)/2:s,I=x.line(s,C),k="around"===c.config.plotOptions.bar.borderRadiusApplication||"both"===this.arrBorderRadius[n][d]?" Z":" z";let H=x.move(s,v)+x.line(a,v)+x.line(a,C)+I+k;"none"!==this.arrBorderRadius[n][d]&&(H=x.roundPathCorners(H,c.config.plotOptions.bar.borderRadius));let W=null;const A=null==(p=null==(u=this.barCtx.ctx)?void 0:u.morphTypeChange)?void 0:p.getInitialPathFor(n,d);if(A?W=A:c.globals.previousPaths.length>0&&(W=this.barCtx.getPreviousPath(n,d,H)),null==W){const t=P?x.line(L,C):I;W=x.move(L,v)+x.line(L,v)+t+t+t+t+t+x.line(L,v)+k}if(c.config.chart.stacked){let t=this.barCtx;t=this.barCtx[l],t.xArrj.push(a+m*w),t.xArrjF.push(Math.abs(s-a-i*w)),t.xArrjVal.push(this.barCtx.series[h][d])}return{pathTo:H,pathFrom:W}}checkZeroSeries({series:t}){const e=this.w;for(let s=0;s<t.length;s++){let a=0;for(let i=0;i<t[e.globals.maxValsInArrayIndex].length;i++)a+=t[s][i];0===a&&this.barCtx.zeroSerieses.push(s)}}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 i=a?e:null;return null!=t&&(i=e-t/this.barCtx.yRatio[s]+2*(this.barCtx.isReversed?t/this.barCtx.yRatio[s]:0)),i}getGoalValues(t,e,s,a,i,r){const o=this.w,h=[],d=(a,i)=>{h.push({[t]:"x"===t?this.getXForValue(a,e,!1):this.getYForValue(a,s,r,!1),attrs:i})};if(o.seriesData.seriesGoals[a]&&o.seriesData.seriesGoals[a][i]&&Array.isArray(o.seriesData.seriesGoals[a][i])&&o.seriesData.seriesGoals[a][i].forEach(t=>{d(t.value,t)}),this.barCtx.barOptions.isDumbbell&&o.rangeData.seriesRange.length){const e=this.barCtx.barOptions.dumbbellColors?this.barCtx.barOptions.dumbbellColors:o.globals.colors,s={strokeHeight:"x"===t?0:o.globals.markers.size[a],strokeWidth:"x"===t?o.globals.markers.size[a]:0,strokeDashArray:0,strokeLineCap:"round",strokeColor:Array.isArray(e[a])?e[a][0]:e[a]};d(o.rangeData.seriesRangeStart[a][i],s),d(o.rangeData.seriesRangeEnd[a][i],n(l({},s),{strokeColor:Array.isArray(e[a])?e[a][1]:e[a]}))}return h}drawGoalLine({barXPosition:t,barYPosition:e,goalX:s,goalY:a,barWidth:i,barHeight:r}){if(!(Array.isArray(s)&&s.length>0||Array.isArray(a)&&a.length>0))return null;const o=new g(this.barCtx.w),l=o.group({className:"apexcharts-bar-goals-groups"});l.node.classList.add("apexcharts-element-hidden"),this.barCtx.w.globals.delayedElements.push({el:l.node}),l.attr("clip-path",`url(#gridRectMarkerMask${this.barCtx.w.globals.cuid})`);let n=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:r/2,a=e+s+r/2;n=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),l.add(n)}}):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:i/2,a=t+s+i/2;n=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),l.add(n)}}),l}drawBarShadow({prevPaths:t,currPaths:e,color:s,realIndex:a,j:i}){const r=this.w,{x:o,x1:l,barYPosition:n}=t,{x:h,x1:d,barYPosition:c}=e,b=n+e.barHeight,u=new g(this.barCtx.w),p=new y,x=u.move(l,b)+u.line(o,b)+u.line(h,c)+u.line(d,c)+u.line(l,b)+("around"===r.config.plotOptions.bar.borderRadiusApplication||"both"===this.arrBorderRadius[a][i]?" Z":" z");return u.drawPath({d:x,fill:p.shadeColor(.5,y.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 i=0,r=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&&i++,s<t&&0===o&&r++}),{nonZeroColumns:i,zeroEncounters:r}}getGroupIndex(t){const e=this.w,s=e.labelData.seriesGroups.findIndex(s=>s.indexOf(e.seriesData.seriesNames[t])>-1),a=this.barCtx.columnGroupIndices;let i=a.indexOf(s);return i<0&&(a.push(s),i=a.length-1),{groupIndex:s,columnGroupIndex:i}}}const v=c.__apex_Filters,C=c.__apex_Animations_computeStagger,w=c.__apex_BrowserAPIs_BrowserAPIs,P=c.__apex_Environment_Environment;function L(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)&&!!(P.isBrowser()&&t.globals.dataChanged&&t.globals.shouldAnimate)}function I(t,e,s){var a,i,r,o;if(null==(a=t.axisFlags)?void 0:a.isXNumeric){const a=null==(r=null==(i=t.seriesData)?void 0:i.seriesX)?void 0:r[e];if(a&&a.length&&null!=a[s])return"x:"+a[s]}const l=null==(o=t.globals.labels)?void 0:o[s];return null!=l&&""!==String(l)?"c:"+(Array.isArray(l)?l.join(" "):String(l)):"j:"+s}function k({w:t,elSeries:e,record:s,newKeys:a,isHorizontal:i,speed:r}){var o;if(!L(t))return;if(!s||!Array.isArray(s.paths)||!(null==e?void 0:e.node))return;const l=new Set(a),n=s.paths.filter(t=>t&&t.d&&null!=t.key&&!l.has(t.key));if(!n.length)return;const h=new g(t),d=null==(o=t.globals.colors)?void 0:o[parseInt(String(s.realIndex),10)];n.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"}),l=o.node;l.setAttribute("pointer-events","none"),o.attr("clip-path",`url(#gridRectBarMask${t.globals.cuid})`),e.node.insertBefore(l,e.node.firstChild);const n=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=i?"left center":"center bottom";try{const t=l.getBBox();n&&t&&(c=i?Math.abs(n.x-t.x)<=Math.abs(n.x-(t.x+t.width))?"left center":"right center":Math.abs(n.y-(t.y+t.height))<=Math.abs(n.y-t.y)?"center bottom":"center top")}catch(t){}const b=l.style;b.transformBox="fill-box",b.transformOrigin=c;const g=Math.max(1,r||1),u=performance.now(),p=e=>{if(t.globals.isDestroyed||!l.parentNode)return;const s=Math.max(0,Math.min(1,(e-u)/g)),a=1-Math.pow(1-s,3),r=1-a;b.transform=i?`scaleX(${r})`:`scaleY(${r})`,b.opacity=String(1-a),s<1?w.requestAnimationFrame(p):l.parentNode.removeChild(l)};w.requestAnimationFrame(p)})}class H{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.series=[],this.elSeries=null,this.visibleI=0,this.isReversed=!1;const a=new x(this.w);this.lastActiveBarSerieIndex=a.getActiveConfigSeriesIndex("desc",["bar","column"]),this.columnGroupIndices=[];const i=a.getBarSeriesIndices(),r=new b(this.w);this.stackedSeriesTotals=r.getStackedSeriesTotals(this.w.config.series.map((t,e)=>-1===i.indexOf(e)?e:-1).filter(t=>-1!==t)),this.barHelpers=new m(this)}draw(t,e){var s,a;const i=this.w,r=new g(this.w),o=new b(this.w);t=o.getLogSeries(t),this.series=t,this.yRatio=o.getLogYRatios(this.yRatio),this.barHelpers.initVariables(t);const h=r.group({class:"apexcharts-bar-series apexcharts-plot-series"});i.config.dataLabels.enabled&&(this.totalItems,this.barOptions.dataLabels.maxItems);for(let o=0,d=0;o<t.length;o++,d++){let c,b;const g=[],u=[],p=i.globals.comboCharts?e[o]:o,{columnGroupIndex:f}=this.barHelpers.getGroupIndex(p),m=r.group({class:"apexcharts-series",rel:o+1,seriesName:y.escapeString(i.seriesData.seriesNames[p]),"data:realIndex":p});x.addCollapsedClassToSeries(this.w,m,p),t[o].length>0&&(this.visibleI=this.visibleI+1),this.yRatio.length>1&&(this.yaxisIndex=i.globals.seriesYAxisReverseMap[p],this.translationsIndex=p);const C=this.translationsIndex;this.isReversed=i.config.yaxis[this.yaxisIndex]&&i.config.yaxis[this.yaxisIndex].reversed,this.isPyramid&&(this.pyramidLayout=this.barHelpers.computePyramidLayout(t[o]));const w=this.barHelpers.initialPositions(p),{y:P,yDivision:L,zeroW:H,x:W,xDivision:A,zeroH:D}=w;let O=w.barHeight,R=w.barWidth;b=P,c=W,this.isHorizontal||u.push(c+(null!=R?R:0)/2);const X=r.group({class:"apexcharts-datalabels","data:realIndex":p});i.globals.delayedElements.push({el:X.node,holdUntilComplete:this.isLengthTransition(p)}),X.node.classList.add("apexcharts-element-hidden");const F=r.group({class:"apexcharts-bar-goals-markers"}),S=r.group({class:"apexcharts-bar-shadows"});i.globals.delayedElements.push({el:S.node}),S.node.classList.add("apexcharts-element-hidden");for(let e=0;e<t[o].length;e++){const r=this.barHelpers.getStrokeWidth(o,e,p);let h=null;const x={indexes:{i:o,j:e,realIndex:p,translationsIndex:C,bc:d},x:c,y:b,strokeWidth:r,elSeries:m};this.isHorizontal?(h=this.drawBarPaths(n(l({},x),{barHeight:O,zeroW:H,yDivision:L})),R=this.series[o][e]/this.invertedYRatio):(h=this.drawColumnPaths(n(l({},x),{xDivision:A,barWidth:R,zeroH:D})),O=this.series[o][e]/this.yRatio[C]);const w=this.barHelpers.getPathFillColor(t,o,e,p);if(this.isFunnel&&!this.isPyramid&&this.barOptions.isFunnel3d&&"trapezoid"!==(null==(s=i.config.plotOptions.funnel)?void 0:s.shape)&&this.pathArr.length&&e>0){const t=this.barHelpers.drawBarShadow({color:"string"==typeof w.color&&-1===(null==(a=w.color)?void 0:a.indexOf("url"))?w.color:y.hexToRgba(i.globals.colors[o]),prevPaths:this.pathArr[this.pathArr.length-1],currPaths:h,realIndex:p,j:e});if(S.add(t),i.config.chart.dropShadow.enabled){new v(this.w).dropShadow(t,i.config.chart.dropShadow,p)}}this.pathArr.push(h);const P=this.barHelpers.drawGoalLine({barXPosition:h.barXPosition,barYPosition:h.barYPosition,goalX:h.goalX,goalY:h.goalY,barHeight:O,barWidth:R});P&&F.add(P),b=h.y,c=h.x,e>0&&u.push(c+(null!=R?R:0)/2),g.push(b),this.renderSeries(n(l({realIndex:p,pathFill:w.color},w.useRangeColor?{lineFill:w.color}:{}),{j:e,i:o,columnGroupIndex:f,pathFrom:h.pathFrom,pathTo:h.pathTo,strokeWidth:r,elSeries:m,x:c,y:b,series:t,barHeight:Math.abs(h.barHeight?h.barHeight:O),barWidth:Math.abs(h.barWidth?h.barWidth:R),elDataLabelsWrap:X,elGoalsMarkers:F,elBarShadows:S,visibleSeries:this.visibleI,type:"bar"}))}if(i.globals.seriesXvalues[p]=u,i.globals.seriesYvalues[p]=g,i.globals.previousPaths.length>0){const e=[];for(let s=0;s<t[o].length;s++)e.push(I(i,p,s));k({w:i,elSeries:m,record:this._prevRecord(p),newKeys:e,isHorizontal:this.isHorizontal,speed:i.config.chart.animations.dynamicAnimation.speed})}h.add(m)}return h}renderSeries({realIndex:t,pathFill:e,lineFill:s,j:a,i:i,columnGroupIndex:r,pathFrom:o,pathTo:l,strokeWidth:n,elSeries:h,x:d,y:c,y1:b,y2:u,series:x,barHeight:f,barWidth:y,barXPosition:m,barYPosition:w,elDataLabelsWrap:P,elGoalsMarkers:L,elBarShadows:k,visibleSeries:H,type:W,classes:A}){var D;const O=this.w,R=new g(this.w,this.ctx),X=function(t,e){const s=t&&t.renderer;return s&&s.kind&&"svg"!==s.kind?s:e}(this.ctx,R);let F=!1;if(h._bindingsDelegated||(h._bindingsDelegated=!0,R.setupEventDelegation(h,`.apexcharts-${W}-area`)),!s){let e=function(t){const e=O.config.stroke.colors;let s;return Array.isArray(e)&&e.length>0&&(s=e[t],s||(s=""),"function"==typeof s)?s({value:O.seriesData.series[t][a],dataPointIndex:a,w:O}):s};const i="function"==typeof O.globals.stroke.colors[t]?e(t):O.globals.stroke.colors[t];s=this.barOptions.distributed?O.globals.stroke.colors[a]:i}const S=new p(this).handleBarDataLabels({x:d,y:c,y1:b,y2:u,i:i,j:a,series:x,realIndex:t,columnGroupIndex:r,barHeight:f,barWidth:y,barXPosition:m,barYPosition:w,visibleSeries:H});O.globals.isBarHorizontal||(S.dataLabelsPos.dataLabelsX+Math.max(y,O.globals.barPadForNumericAxis)<0||S.dataLabelsPos.dataLabelsX-Math.max(y,O.globals.barPadForNumericAxis)>O.layout.gridWidth)&&(F=!0),O.config.series[i].data[a]&&O.config.series[i].data[a].strokeColor&&(s=O.config.series[i].data[a].strokeColor),this.isNullValue&&(e="none");const B=O.config.chart.animations,Y=B.animateGradually;let j=0;if(Y&&!1!==Y.enabled&&!(O.globals.dataChanged&&this.isLengthTransition(t))){const t=O.globals.dataPoints||1,e=Y.delay||0,s=Math.min(e,.5*B.speed/Math.max(1,t));let r=C({style:"sequential",index:a,baseDelay:s});O.config.chart.stacked&&(r+=i*s*.5);j=r/(e||1)}if(!F){const r=!0===(null==(D=this.ctx.morphTypeChange)?void 0:D.isActive())?this.ctx.morphTypeChange.getSpeed():O.config.chart.animations.dynamicAnimation.speed,d=X.renderPaths({i:i,j:a,realIndex:t,pathFrom:o,pathTo:l,stroke:s,strokeWidth:n,strokeLineCap:O.config.stroke.lineCap,fill:e,animationDelay:j,initialSpeed:O.config.chart.animations.speed,dataChangeSpeed:r,className:`apexcharts-${W}-area ${A}`,chartType:W,bindEventsOnPaths:!1});d.attr("clip-path",`url(#gridRectBarMask${O.globals.cuid})`);const c=O.config.forecastDataPoints;c.count>0&&a>=O.globals.dataPoints-c.count&&(d.node.setAttribute("stroke-dasharray",c.dashArray),d.node.setAttribute("stroke-width",c.strokeWidth),d.node.setAttribute("fill-opacity",c.fillOpacity)),void 0!==b&&void 0!==u&&(d.attr("data-range-y1",b),d.attr("data-range-y2",u));new v(this.w).setSelectionFilter(d,t,a),h.add(d),d.attr({cy:S.dataLabelsPos.bcy,cx:S.dataLabelsPos.bcx,j:a,val:O.seriesData.series[i][a],barHeight:f,barWidth:y,"data:pathKey":I(O,t,a)}),"canvas"===X.kind&&(O.globals.barCanvasCoords||(O.globals.barCanvasCoords={}),O.globals.barCanvasCoords[t]||(O.globals.barCanvasCoords[t]={}),O.globals.barCanvasCoords[t][a]={cx:S.dataLabelsPos.bcx,cy:S.dataLabelsPos.bcy,barWidth:y}),null!==S.dataLabels&&P.add(S.dataLabels),S.totalDataLabels&&P.add(S.totalDataLabels),h.add(P),L&&h.add(L),k&&h.add(k)}return h}drawBarPaths({indexes:t,barHeight:e,strokeWidth:s,zeroW:a,x:i,y:r,yDivision:o,elSeries:l}){const n=this.w,h=t.i,d=t.j;let c;if(n.axisFlags.isXNumeric)c=(r=(n.seriesData.seriesX[h][d]-n.globals.minX)/this.invertedXRatio-e)+e*this.visibleI;else if(n.config.plotOptions.bar.hideZeroBarsWhenGrouped){const{nonZeroColumns:t,zeroEncounters:s}=this.barHelpers.getZeroValueEncounters({i:h,j:d});t>0&&(e=this.seriesLen*e/t),c=r+e*this.visibleI,c-=e*s}else c=r+e*this.visibleI;const b=this.isFunnel&&"trapezoid"===n.config.plotOptions.funnel.shape,g=this.isPyramid&&this.pyramidLayout?this.pyramidLayout[d]:null,u=!!g;if(g)c=g.y,e=g.height;else if(this.isFunnel&&!b){const t=null!=a?a:0;a=t-(this.barHelpers.getXForValue(this.series[h][d],t)-t)/2}let p;return i=this.barHelpers.getXForValue(this.series[h][d],null!=a?a:0),p=g?this.barHelpers.getPyramidPaths({barYPosition:c,barHeight:e,topHalf:g.topHalf,bottomHalf:g.bottomHalf,realIndex:t.realIndex,j:d,strokeWidth:s,w:n}):b?this.barHelpers.getFunnelTrapezoidPaths({barYPosition:c,barHeight:e,series:this.series,i:h,j:d,realIndex:t.realIndex,strokeWidth:s,w:n}):this.barHelpers.getBarpaths({barYPosition:c,barHeight:e,x1:a,x2:i,strokeWidth:s,isReversed:this.isReversed,series:this.series,realIndex:t.realIndex,i:h,j:d,w:n}),(b||u)&&(a=p.x1,i=p.x),n.axisFlags.isXNumeric||u||(r+=o),u&&(r=c),this.barHelpers.barBackground({j:d,i:h,y1:c-e*this.visibleI,y2:e*this.seriesLen,elSeries:l}),{pathTo:p.pathTo,pathFrom:p.pathFrom,x1:a,x:i,y:r,goalX:this.barHelpers.getGoalValues("x",a,null,h,d,0),barYPosition:c,barHeight:e}}drawColumnPaths({indexes:t,x:e,y:s,xDivision:a,barWidth:i,zeroH:r,strokeWidth:o,elSeries:l}){const n=this.w,h=t.realIndex,d=t.translationsIndex,c=t.i,b=t.j,g=t.bc;let u;if(n.axisFlags.isXNumeric){const t=this.getBarXForNumericXAxis({x:e,j:b,realIndex:h,barWidth:i});e=t.x,u=t.barXPosition}else if(n.config.plotOptions.bar.hideZeroBarsWhenGrouped){const{nonZeroColumns:t,zeroEncounters:s}=this.barHelpers.getZeroValueEncounters({i:c,j:b});t>0&&(i=this.seriesLen*i/t),u=e+i*this.visibleI,u-=i*s}else u=e+i*this.visibleI;s=this.barHelpers.getYForValue(this.series[c][b],r,d);const p=this.barHelpers.getColumnPaths({barXPosition:u,barWidth:i,y1:r,y2:s,strokeWidth:o,isReversed:this.isReversed,series:this.series,realIndex:h,i:c,j:b,w:n});return n.axisFlags.isXNumeric||(e+=a),this.barHelpers.barBackground({bc:g,j:b,i:c,x1:u-o/2-i*this.visibleI,x2:i*this.seriesLen+o/2,elSeries:l}),{pathTo:p.pathTo,pathFrom:p.pathFrom,x:e,y:s,goalY:this.barHelpers.getGoalValues("y",null,r,c,b,d),barXPosition:u,barWidth:i}}getBarXForNumericXAxis({x:t,barWidth:e,realIndex:s,j:a}){const i=this.w;let r=s;return i.seriesData.seriesX[s].length||(r=i.globals.maxValsInArrayIndex),y.isNumber(i.seriesData.seriesX[r][a])&&(t=(i.seriesData.seriesX[r][a]-i.globals.minX)/this.xRatio-e*this.seriesLen/2),{barXPosition:t+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 i=e.globals.previousPaths[a];i.paths&&i.paths.length>0&&parseInt(i.realIndex,10)===parseInt(String(t),10)&&(s=i)}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 i=!1;if(L(a)&&a.globals.previousPaths.length>0){const r=this._prevRecord(t),o=null!=(s=null==(e=a.seriesData.series[t])?void 0:e.length)?s:0;if(r)if(r.paths.length!==o)i=!0;else{const e=this._prevKeyedPaths(t);if(e)for(let s=0;s<o;s++)if(!e.has(I(a,t,s))){i=!0;break}}else i=o>0}return this._ltCache[t]=i,i}getPreviousPath(t,e,s){const a=this.w,i=this._prevRecord(t);if(!i)return L(a)?null:s;let r=null,o=!1;const l=this._prevKeyedPaths(t);if(l){const s=l.get(I(a,t,e));s?r=s.d:o=!0}else void 0!==i.paths[e]?r=i.paths[e].d:o=!0;return r&&H.pathCommandCount(r)===H.pathCommandCount(s)?r:o&&L(a)?null:s}static pathCommandCount(t){if(!t)return 0;const e=t.match(/[A-Za-z]/g);return e?e.length:0}}function W({w:t,points:e,seedA:s,seedB:a,center:i,halfExtent:r,alongFn:o,isHorizontal:l,options:n,clampAt:h}){const d=n;if(!d||!1===d.show)return[];if(!e||!e.length)return[];const c=d.maxPoints||3e3,b=e.length>c?Math.ceil(e.length/c):1,g=null!=d.size?d.size:2.5,u=r*(null!=d.jitter?d.jitter:.5),p=!1!==d.constrainToViolin&&"function"==typeof h,x="square"===d.shape,f=d.colorScale,y=f&&Array.isArray(f.colors)&&f.colors.length>0,m=y?Math.max(2,f.steps||24):1,v=y&&null!=f.min?f.min:t.globals.minY,C=(y&&null!=f.max?f.max:t.globals.maxY)-v||1,w=y?new Array(m).fill(""):[""];for(let t=0;t<e.length;t+=b){const r=e[t],n=o(r);let d=2*(R(7919*s+100003*a+t)-.5)*u;if(p){const t=h(r);d>t&&(d=t),d<-t&&(d=-t)}const c=l?n:i+d,b=l?i+d:n,f=x?F(c,b,g):X(c,b,g);if(y){let t=(r-v)/C;t<0&&(t=0),t>1&&(t=1),w[Math.round(t*(m-1))]+=f}else w[0]+=f}if(!y)return w[0]?[{fill:null,d:w[0]}]:[];const P=[];for(let t=0;t<m;t++)w[t]&&P.push({fill:O(f.colors,t/(m-1)),d:w[t]});return P}function A({graphics:t,w:e,elSeries:s,pointsByCat:a,options:i,distributed:r,realIndex:o,wrapClass:l,pointClass:n}){if(!i||!1===i.show||!a.length)return;const h=null!=i.opacity?i.opacity:.9,d=null!=i.strokeColor?i.strokeColor:"#fff",c=null!=i.strokeWidth?i.strokeWidth:1,b=e.config.chart.animations.enabled&&!e.globals.resized&&!e.globals.dataChanged,g=t.group({class:b?`${l} apexcharts-element-hidden`:l});b&&e.globals.delayedElements.push({el:g.node}),a.forEach(({groups:s,j:a})=>{const l=r?e.globals.colors[a]:e.globals.colors[o],b=i.fillColor,u="series"===b?l:"series-dark"===b?D(l,.45):b||D(l,.45);s.forEach(s=>{const i=t.drawPath({d:s.d,fill:null!=s.fill?s.fill:u,stroke:c>0?d:"none",strokeWidth:c,fillOpacity:h,classes:n});i.attr("data:realIndex",o),i.attr("j",a),i.attr("clip-path",`url(#gridRectBarMask${e.globals.cuid})`),i.node.style.pointerEvents="none",g.add(i)})}),s.add(g)}function D(t,e){const s=y.parseHex(t);if(!s)return t;const a=Math.max(0,1-e);return`rgb(${Math.round(s[0]*a)},${Math.round(s[1]*a)},${Math.round(s[2]*a)})`}function O(t,e){if(!t.length)return"#000";if(1===t.length)return t[0];const s=Math.max(0,Math.min(1,e))*(t.length-1),a=Math.floor(s),i=s-a,r=y.parseHex(t[a])||[0,0,0],o=y.parseHex(t[Math.min(a+1,t.length-1)])||r,l=(t,e)=>Math.round(t+(e-t)*i);return`rgb(${l(r[0],o[0])},${l(r[1],o[1])},${l(r[2],o[2])})`}function R(t){let e=(2654435769^t)>>>0;return e=Math.imul(e^e>>>16,73244475),e=Math.imul(e^e>>>16,73244475),((e^e>>>16)>>>0)/4294967296}function X(t,e,s){return`M ${t-s} ${e} a ${s} ${s} 0 1 0 ${2*s} 0 a ${s} ${s} 0 1 0 ${-2*s} 0 `}function F(t,e,s){return`M ${t-s} ${e-s} h ${2*s} v ${2*s} h ${-2*s} z `}class S extends H{draw(t,e,s){var a;const i=this.w,r=new g(this.w),o=i.globals.comboCharts?e:i.config.chart.type,h=new f(this.w);this.candlestickOptions=this.w.config.plotOptions.candlestick,this.boxOptions=this.w.config.plotOptions.boxPlot,this.isHorizontal=i.config.plotOptions.bar.horizontal,this.isOHLC=this.candlestickOptions&&"ohlc"===this.candlestickOptions.type,this.coreUtils=new b(this.w),t=this.coreUtils.getLogSeries(t),this.series=t,this.yRatio=this.coreUtils.getLogYRatios(this.yRatio),this.barHelpers.initVariables(t);const d=r.group({class:`apexcharts-${o}-series apexcharts-plot-series`});for(let e=0;e<t.length;e++){let o,c;this.isBoxPlot="boxPlot"===i.config.chart.type||"boxPlot"===i.config.series[e].type;const b=[],g=[],u=i.globals.comboCharts?s[e]:e,{columnGroupIndex:p}=this.barHelpers.getGroupIndex(u),f=r.group({class:"apexcharts-series",seriesName:y.escapeString(i.seriesData.seriesNames[u]),rel:e+1,"data:realIndex":u});x.addCollapsedClassToSeries(this.w,f,u),t[e].length>0&&(this.visibleI=this.visibleI+1);let m=0;this.yRatio.length>1&&(this.yaxisIndex=i.globals.seriesYAxisReverseMap[u][0],m=u);const v=this.barHelpers.initialPositions(u),{y:C,barHeight:w,yDivision:P,zeroW:L,x:I,barWidth:k,xDivision:H,zeroH:D}=v;c=C,o=I,g.push(o+(null!=k?k:0)/2);const O=r.group({class:"apexcharts-datalabels","data:realIndex":u}),R=r.group({class:"apexcharts-bar-goals-markers"}),X=this.isBoxPlot?this.boxOptions.points:null,F=[],S=i.layout.gridWidth,B=null!=k?k:0;for(let s=0;s<i.globals.dataPoints;s++){const r=this.barHelpers.getStrokeWidth(e,s,u);let d=null;const x={indexes:{i:e,j:s,realIndex:u,translationsIndex:m},x:o,y:c,strokeWidth:r,elSeries:f};if(d=this.isHorizontal?this.drawHorizontalBoxPaths(n(l({},x),{yDivision:P,barHeight:w,zeroW:L})):this.drawVerticalBoxPaths(n(l({},x),{xDivision:H,barWidth:k,zeroH:D,cullBounds:{lo:-B,hi:S+B}})),c=d.y,o=d.x,s>0&&g.push(o+(null!=k?k:0)/2),b.push(c),d.culled)continue;const y=this.barHelpers.drawGoalLine({barXPosition:d.barXPosition,barYPosition:d.barYPosition,goalX:d.goalX,goalY:d.goalY,barHeight:w,barWidth:k});if(y&&R.add(y),d.pathTo.forEach((a,l)=>{const n=!this.isBoxPlot&&this.candlestickOptions.wick.useFillColor?d.color[l]:i.globals.stroke.colors[e],b=h.fillPath({seriesNumber:u,dataPointIndex:s,color:d.color[l],value:t[e][s]});this.renderSeries({realIndex:u,pathFill:b,lineFill:n,j:s,i:e,pathFrom:d.pathFrom,pathTo:a,strokeWidth:r,elSeries:f,x:o,y:c,series:t,columnGroupIndex:p,barHeight:w,barWidth:k,elDataLabelsWrap:O,elGoalsMarkers:R,visibleSeries:this.visibleI,type:i.config.chart.type})}),X&&!1!==X.show){const t=null==(a=i.candleData.seriesBoxPoints[u])?void 0:a[s];if(t&&t.length){const e=t=>this.coreUtils.getLogValAtSeriesIndex(t,u);let a,r,o;if(this.isHorizontal){const t=this.invertedYRatio,s=null!=w?w:0,i=null!=L?L:0;a=d.barYPosition+s/2,r=s/2,o=s=>i+e(s)/t}else{const t=this.yRatio[m],s=null!=k?k:0,i=null!=D?D:0;a=d.barXPosition+s/2,r=s/2,o=s=>i-e(s)/t}const l=W({w:i,points:t,seedA:u,seedB:s,center:a,halfExtent:r,alongFn:o,isHorizontal:this.isHorizontal,options:X});l.length&&F.push({groups:l,j:s})}}}X&&A({graphics:r,w:i,elSeries:f,pointsByCat:F,options:X,distributed:i.config.plotOptions.bar.distributed,realIndex:u,wrapClass:"apexcharts-boxPlot-points-wrap",pointClass:"apexcharts-boxPlot-points"}),i.globals.seriesXvalues[u]=g,i.globals.seriesYvalues[u]=b,d.add(f)}return d}drawVerticalBoxPaths({indexes:t,x:e,xDivision:s,barWidth:a,zeroH:i,strokeWidth:r,cullBounds:o=null}){var l,n;const h=this.w,d=new g(this.w),c=t.i,b=t.j,{colors:u}=h.config.plotOptions.candlestick,{colors:p}=this.boxOptions,x=t.realIndex,f=t=>Array.isArray(t)?t[x]:t,y=f(u.upward),m=f(u.downward),v=this.yRatio[t.translationsIndex],C=this.getOHLCValue(x,b);let w=i,P=i,L=C.o<C.c?[y]:[m];this.isBoxPlot&&(L=[f(p.lower),f(p.upper)]);let I=Math.min(C.o,C.c),k=Math.max(C.o,C.c),H=C.m;h.axisFlags.isXNumeric&&(e=(h.seriesData.seriesX[x][b]-h.globals.minX)/this.xRatio-a/2);const W=e+a*this.visibleI;if(void 0===(null==(l=this.series[c])?void 0:l[b])||null===(null==(n=this.series[c])?void 0:n[b])?(I=i,k=i):(I=i-I/v,k=i-k/v,w=i-C.h/v,P=i-C.l/v,H=i-C.m/v),o&&(W+a<o.lo||W>o.hi))return{pathTo:null,pathFrom:null,x:h.axisFlags.isXNumeric?e:e+s,y:k,barXPosition:W,color:L,culled:!0};let A;if(this.isOHLC){const t=W+a/2,e=i-C.o/v,s=i-C.c/v;A=[d.move(t,w)+d.line(t,P)+d.move(t,e)+d.line(W,e)+d.move(t,s)+d.line(W+a,s)]}else A=this.isBoxPlot?[d.move(W,I)+d.line(W+a/2,I)+d.line(W+a/2,w)+d.line(W+a/4,w)+d.line(W+a-a/4,w)+d.line(W+a/2,w)+d.line(W+a/2,I)+d.line(W+a,I)+d.line(W+a,H)+d.line(W,H)+d.line(W,I+r/2),d.move(W,H)+d.line(W+a,H)+d.line(W+a,k)+d.line(W+a/2,k)+d.line(W+a/2,P)+d.line(W+a-a/4,P)+d.line(W+a/4,P)+d.line(W+a/2,P)+d.line(W+a/2,k)+d.line(W,k)+d.line(W,H)+"z"]:[d.move(W,k)+d.line(W+a/2,k)+d.line(W+a/2,w)+d.line(W+a/2,k)+d.line(W+a,k)+d.line(W+a,I)+d.line(W+a/2,I)+d.line(W+a/2,P)+d.line(W+a/2,I)+d.line(W,I)+d.line(W,k-r/2)];let D=null;return h.globals.previousPaths.length>0&&(D=this.getPreviousPath(x,b,A[0])),null==D&&(D=d.move(W+a/2,I)+d.move(W,I)),h.axisFlags.isXNumeric||(e+=s),{pathTo:A,pathFrom:D,x:e,y:k,goalY:this.barHelpers.getGoalValues("y",null,i,c,b,t.translationsIndex),barXPosition:W,color:L}}drawHorizontalBoxPaths({indexes:t,y:e,yDivision:s,barHeight:a,zeroW:i,strokeWidth:r}){var o,l;const n=this.w,h=new g(this.w),d=t.i,c=t.j,b=t.realIndex,{colors:u}=n.config.plotOptions.candlestick,{colors:p}=this.boxOptions,x=t=>Array.isArray(t)?t[b]:t,f=this.invertedYRatio,y=this.getOHLCValue(b,c);let m=y.o<y.c?[x(u.upward)]:[x(u.downward)];this.isBoxPlot&&(m=[x(p.lower),x(p.upper)]);let v=i,C=i,w=Math.min(y.o,y.c),P=Math.max(y.o,y.c),L=y.m;n.axisFlags.isXNumeric&&(e=(n.seriesData.seriesX[b][c]-n.globals.minX)/this.invertedXRatio-a/2);const I=e+a*this.visibleI;void 0===(null==(o=this.series[d])?void 0:o[c])||null===(null==(l=this.series[d])?void 0:l[c])?(w=i,P=i):(w=i+w/f,P=i+P/f,v=i+y.h/f,C=i+y.l/f,L=i+y.m/f);const k=[h.move(w,I)+h.line(w,I+a/2)+h.line(v,I+a/2)+h.line(v,I+a/2-a/4)+h.line(v,I+a/2+a/4)+h.line(v,I+a/2)+h.line(w,I+a/2)+h.line(w,I+a)+h.line(L,I+a)+h.line(L,I)+h.line(w+r/2,I),h.move(L,I)+h.line(L,I+a)+h.line(P,I+a)+h.line(P,I+a/2)+h.line(C,I+a/2)+h.line(C,I+a-a/4)+h.line(C,I+a/4)+h.line(C,I+a/2)+h.line(P,I+a/2)+h.line(P,I)+h.line(L,I)+"z"];let H=null;return n.globals.previousPaths.length>0&&(H=this.getPreviousPath(b,c,k[0])),null==H&&(H=h.move(w,I+a/2)+h.move(w,I)),n.axisFlags.isXNumeric||(e+=s),{pathTo:k,pathFrom:H,x:P,y:e,goalX:this.barHelpers.getGoalValues("x",i,null,d,c,0),barYPosition:I,color:m}}getOHLCValue(t,e){const s=this.w,a=this.coreUtils,i=s=>s[t]&&null!=s[t][e]?a.getLogValAtSeriesIndex(s[t][e],t):0,r=i(s.candleData.seriesCandleH),o=i(s.candleData.seriesCandleO),l=i(s.candleData.seriesCandleM),n=i(s.candleData.seriesCandleC),h=i(s.candleData.seriesCandleL);return{o:this.isBoxPlot?r:o,h:this.isBoxPlot?o:r,m:l,l:this.isBoxPlot?n:h,c:this.isBoxPlot?h:n}}}h.use({candlestick:S,boxPlot:S}),exports.default=h;
5
+ "use strict";var t=Object.defineProperty,e=Object.defineProperties,s=Object.getOwnPropertyDescriptors,a=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable,o=(e,s,a)=>s in e?t(e,s,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[s]=a,l=(t,e)=>{for(var s in e||(e={}))i.call(e,s)&&o(t,s,e[s]);if(a)for(var s of a(e))r.call(e,s)&&o(t,s,e[s]);return t},n=(t,a)=>e(t,s(a));Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const h=require("apexcharts/core");function d(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 c=d(h),b=c.__apex_CoreUtils,g=c.__apex_Graphics,u=c.__apex_DataLabels,p=c.__apex_BrowserAPIs_BrowserAPIs,x=c.__apex_Environment_Environment;function f(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)&&!!(x.isBrowser()&&t.globals.dataChanged&&t.globals.shouldAnimate)}function y(t,e,s){var a,i,r,o;if(null==(a=t.axisFlags)?void 0:a.isXNumeric){const a=null==(r=null==(i=t.seriesData)?void 0:i.seriesX)?void 0:r[e];if(a&&a.length&&null!=a[s])return"x:"+a[s]}const l=null==(o=t.globals.labels)?void 0:o[s];return null!=l&&""!==String(l)?"c:"+(Array.isArray(l)?l.join(" "):String(l)):"j:"+s}function m(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 v(t,e,s=!1,a=!1){var i,r;if(!f(t))return null;const o=t.globals.prevStreamFrame;if(!o)return null;const l=null==(i=o.seriesY)?void 0:i[e],n=null==(r=t.seriesData.series)?void 0:r[e];if(!Array.isArray(l)||!Array.isArray(n))return null;if(!l.length||!n.length)return null;const h=m(l.map((t,s)=>function(t,e,s){var a,i;if(t.isXNumeric){const i=null==(a=t.seriesX)?void 0:a[e];if(i&&i.length&&null!=i[s])return"x:"+i[s]}const r=null==(i=t.labels)?void 0:i[s];return null!=r&&""!==String(r)?"c:"+(Array.isArray(r)?r.join(" "):String(r)):"j:"+s}(o,e,s))),d=m(n.map((s,a)=>y(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),i=new Set;let r=-1,o=!0,l=t.length===e.length;e.forEach((t,e)=>{const n=s.has(t)&&!i.has(s.get(t))?s.get(t):-1;a[e]=n,-1!==n&&(i.add(n),n<r&&(o=!1),r=n),n!==e&&(l=!1)});const n=[];for(let e=0;e<t.length;e++)i.has(e)||n.push(e);return{toOld:a,exits:n,ordered:o,changed:!l}}(h,d);return(c.ordered||a)&&(c.changed||s)?{join:c,oldKeys:h,newKeys:d}:null}function C({w:t,elSeries:e,record:s,newKeys:a,isHorizontal:i,speed:r}){var o;if(!f(t))return;if(!s||!Array.isArray(s.paths)||!(null==e?void 0:e.node))return;const l=new Set(a),n=s.paths.filter(t=>t&&t.d&&null!=t.key&&!l.has(t.key));if(!n.length)return;const h=new g(t),d=null==(o=t.globals.colors)?void 0:o[parseInt(String(s.realIndex),10)];n.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"}),l=o.node;l.setAttribute("pointer-events","none"),o.attr("clip-path",`url(#gridRectBarMask${t.globals.cuid})`),e.node.insertBefore(l,e.node.firstChild);const n=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=i?"left center":"center bottom";try{const t=l.getBBox();n&&t&&(c=i?Math.abs(n.x-t.x)<=Math.abs(n.x-(t.x+t.width))?"left center":"right center":Math.abs(n.y-(t.y+t.height))<=Math.abs(n.y-t.y)?"center bottom":"center top")}catch(t){}const b=l.style;b.transformBox="fill-box",b.transformOrigin=c;const g=Math.max(1,r||1),u=performance.now(),x=e=>{if(t.globals.isDestroyed||!l.parentNode)return;const s=Math.max(0,Math.min(1,(e-u)/g)),a=1-Math.pow(1-s,3),r=1-a;b.transform=i?`scaleX(${r})`:`scaleY(${r})`,b.opacity=String(1-a),s<1?p.requestAnimationFrame(x):l.parentNode.removeChild(l)};p.requestAnimationFrame(x)})}class w{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){const{x:e,y:s,y1:a,y2:i,i:r,j:o,realIndex:h,columnGroupIndex:d,series:c,barHeight:b,barWidth:u,barXPosition:p,barYPosition:x,visibleSeries:f}=t,y=this.w,m=new g(this.barCtx.w),v=Array.isArray(this.barCtx.strokeWidth)?this.barCtx.strokeWidth[h]:this.barCtx.strokeWidth;let C,w;y.axisFlags.isXNumeric&&!y.globals.isBarHorizontal?(C=e+u*(f+1),w=s+b*(f+1)-v):(C=e+u*f,w=s+b*f);let P=null,L=null,I=e,k=s,H={};const A=y.config.dataLabels,W=this.barCtx.barOptions.dataLabels,D=this.barCtx.barOptions.dataLabels.total;void 0!==x&&(this.barCtx.isRangeBar||this.barCtx.isPyramid)&&(w=x,k=x),void 0!==p&&this.barCtx.isVerticalGroupedRangeBar&&(C=p,I=p);const O=A.offsetX,R=A.offsetY;let S={width:0,height:0};if(y.config.dataLabels.enabled){const t=y.seriesData.series[r][o];S=m.getTextRects(y.config.dataLabels.formatter?y.config.dataLabels.formatter(t,n(l({},y),{seriesIndex:r,dataPointIndex:o,w:y})):y.formatters.yLabelFormatters[0](t),parseFloat(A.style.fontSize).toString())}const X={x:e,y:s,i:r,j:o,realIndex:h,columnGroupIndex:d,bcx:C,bcy:w,barHeight:b,barWidth:u,textRects:S,strokeWidth:v,dataLabelsX:I,dataLabelsY:k,dataLabelsConfig:A,barDataLabelsConfig:W,barTotalDataLabelsConfig:D,offX:O,offY:R};return H=this.barCtx.isHorizontal?this.calculateBarsDataLabelsPosition(X):this.calculateColumnsDataLabelsPosition(X),P=this.drawCalculatedDataLabels({x:H.dataLabelsX,y:H.dataLabelsY,val:this.barCtx.isRangeBar?[a,i]:"100%"===y.config.chart.stackType?c[h][o]:y.seriesData.series[h][o],i:h,j:o,barWidth:u,barHeight:b,textRects:S,dataLabelsConfig:A}),y.config.chart.stacked&&D.enabled&&(L=this.drawTotalDataLabels({x:H.totalDataLabelsX,y:H.totalDataLabelsY,barWidth:u,barHeight:b,realIndex:h,textAnchor:H.totalDataLabelsAnchor,val:this.getStackedTotalDataLabel({realIndex:h,j:o}),dataLabelsConfig:A,barTotalDataLabelsConfig:D})),{dataLabelsPos:H,dataLabels:P,totalDataLabels:L}}getStackedTotalDataLabel({realIndex:t,j:e}){const s=this.w;let a=this.barCtx.stackedSeriesTotals[e];return this.totalFormatter&&(a=this.totalFormatter(a,n(l({},s),{seriesIndex:t,dataPointIndex:e,w:s}))),a}calculateColumnsDataLabelsPosition(t){const e=this.w;let s,a,{i:i,j:r,realIndex:o,y:l,bcx:n,barWidth:h,barHeight:d,textRects:c,dataLabelsX:b,dataLabelsY:u,dataLabelsConfig:p,barDataLabelsConfig:x,barTotalDataLabelsConfig:f,strokeWidth:y,offX:m,offY:v}=t;const C=n;d=Math.abs(d);const w="vertical"===e.config.plotOptions.bar.dataLabels.orientation,{zeroEncounters:P}=this.barCtx.barHelpers.getZeroValueEncounters({i:i,j:r});n-=y/2;const L=e.layout.gridWidth/e.globals.dataPoints;if(this.barCtx.isVerticalGroupedRangeBar?b+=h/2:(b=e.axisFlags.isXNumeric?n-h/2+m:n-L+h/2+m,!e.config.chart.stacked&&P>0&&e.config.plotOptions.bar.hideZeroBarsWhenGrouped&&(b-=h*P)),w){const t=2;b=b+c.height/2-y/2-t}const I=e.seriesData.series[i][r]<0;let k=l;switch(this.barCtx.isReversed&&(k=l+(I?d:-d)),x.position){case"center":u=w?I?k-d/2+v:k+d/2-v:I?k-d/2+c.height/2+v:k+d/2+c.height/2-v;break;case"bottom":u=w?I?k-d+v:k+d-v:I?k-d+c.height+y+v:k+d-c.height/2+y-v;break;case"top":u=w?I?k+v:k-v:I?k-c.height/2-v:k+c.height+v}let H=k;if(e.labelData.seriesGroups.forEach(t=>{var e;null==(e=this.barCtx[t.join(",")])||e.prevY.forEach(t=>{H=I?Math.max(t[r],H):Math.min(t[r],H)})}),this.barCtx.lastActiveBarSerieIndex===o&&f.enabled){const t=18,i=new g(this.barCtx.w).getTextRects(this.getStackedTotalDataLabel({realIndex:o,j:r}),p.fontSize);s=I?H-i.height/2-v-f.offsetY+t:H+i.height+v+f.offsetY-t;const l=L;a=C+(e.axisFlags.isXNumeric?-h*e.globals.barGroups.length/2:e.globals.barGroups.length*h/2-(e.globals.barGroups.length-1)*h-l)+f.offsetX}return e.config.chart.stacked||(u<0?u=0+y:u+c.height/3>e.layout.gridHeight&&(u=e.layout.gridHeight-y)),{bcx:n,bcy:l,dataLabelsX:b,dataLabelsY:u,totalDataLabelsX:a,totalDataLabelsY:s,totalDataLabelsAnchor:"middle"}}calculateBarsDataLabelsPosition(t){var e;const s=this.w;let{x:a,i:i,j:r,realIndex:o,bcy:l,barHeight:n,barWidth:h,textRects:d,dataLabelsX:c,strokeWidth:b,dataLabelsConfig:u,barDataLabelsConfig:p,barTotalDataLabelsConfig:x,offX:f,offY:y}=t;const m=s.layout.gridHeight/s.globals.dataPoints,{zeroEncounters:v}=this.barCtx.barHelpers.getZeroValueEncounters({i:i,j:r});let C,w,P;if(h=Math.abs(h),this.barCtx.isPyramid){C=l+n/2+y-(null!=(e=d.centerOffset)?e:0)}else C=l-(this.barCtx.isRangeBar?0:m)+n/2+d.height/2+y-3;!s.config.chart.stacked&&v>0&&s.config.plotOptions.bar.hideZeroBarsWhenGrouped&&(C-=n*v);let L="start";const I=s.seriesData.series[i][r]<0;let k=a;if(this.barCtx.isReversed&&(k=a+(I?-h:h),L=I?"start":"end"),this.barCtx.isPyramid)c=s.layout.gridWidth/2+f;else switch(p.position){case"center":c=I?k+h/2-f:Math.max(d.width/2,k-h/2)+f;break;case"bottom":c=I?k+h-b-f:k-h+b+f;break;case"top":c=I?k-b-f:k-b+f}let H=k;if(s.labelData.seriesGroups.forEach(t=>{var e;null==(e=this.barCtx[t.join(",")])||e.prevX.forEach(t=>{H=I?Math.min(t[r],H):Math.max(t[r],H)})}),this.barCtx.lastActiveBarSerieIndex===o&&x.enabled){const t=new g(this.barCtx.w).getTextRects(this.getStackedTotalDataLabel({realIndex:o,j:r}),u.fontSize);I?(w=H-b-f-x.offsetX,L="end"):w=H+f+x.offsetX+(this.barCtx.isReversed?-(h+b):b),P=C-d.height/2+t.height/2+x.offsetY+b,s.globals.barGroups.length>1&&(P-=s.globals.barGroups.length/2*(n/2))}return s.config.chart.stacked||("start"===u.textAnchor?c-d.width<0?c=I?d.width+b:b:c+d.width>s.layout.gridWidth&&(c=I?s.layout.gridWidth-b:s.layout.gridWidth-d.width-b):"middle"===u.textAnchor?c-d.width/2<0?c=d.width/2+b:c+d.width/2>s.layout.gridWidth&&(c=s.layout.gridWidth-d.width/2-b):"end"===u.textAnchor&&(c<1?c=d.width+b:c+1>s.layout.gridWidth&&(c=s.layout.gridWidth-d.width-b))),{bcx:a,bcy:l,dataLabelsX:c,dataLabelsY:C,totalDataLabelsX:w,totalDataLabelsY:P,totalDataLabelsAnchor:L}}drawCalculatedDataLabels({x:t,y:e,val:s,i:a,j:i,textRects:r,barHeight:o,barWidth:h,dataLabelsConfig:d}){var c,b;const p=this.w;let x="rotate(0)";"vertical"===p.config.plotOptions.bar.dataLabels.orientation&&(x=`rotate(-90, ${t}, ${e})`);const f=new u(this.barCtx.w,this.barCtx.ctx),m=new g(this.barCtx.w),v=d.formatter;let C=null;const w=p.globals.collapsedSeriesIndices.indexOf(a)>-1;if(d.enabled&&!w){C=m.group({class:"apexcharts-data-labels",transform:x});const g=p.config.dataLabels;((null==(c=g.animate)?void 0:c.enabled)||(null==(b=g.countUp)?void 0:b.enabled))&&(C.node.setAttribute("data:dlKey",`${a}::${y(p,a,i)}`),C.node.setAttribute("data:dlJ",String(i)),"number"==typeof s&&isFinite(s)&&C.node.setAttribute("data:dlVal",String(s)));let u="";void 0!==s&&(u=v(s,n(l({},p),{seriesIndex:a,dataPointIndex:i,w:p}))),!s&&p.config.plotOptions.bar.hideZeroBarsWhenGrouped&&(u="");const w=p.seriesData.series[a][i]<0,P=p.config.plotOptions.bar.dataLabels.position;if("vertical"===p.config.plotOptions.bar.dataLabels.orientation&&("top"===P&&(d.textAnchor=w?"end":"start"),"center"===P&&(d.textAnchor="middle"),"bottom"===P&&(d.textAnchor=w?"end":"start")),this.barCtx.isRangeBar&&this.barCtx.barOptions.dataLabels.hideOverflowingLabels){h<m.getTextRects(u,parseFloat(d.style.fontSize).toString()).width&&(u="")}p.config.chart.stacked&&this.barCtx.barOptions.dataLabels.hideOverflowingLabels&&(this.barCtx.isHorizontal?r.width/1.6>Math.abs(h)&&(u=""):r.height/1.6>Math.abs(o)&&(u=""));const L=l({},d);this.barCtx.isHorizontal&&s<0&&("start"===d.textAnchor?L.textAnchor="end":"end"===d.textAnchor&&(L.textAnchor="start")),f.plotDataLabelsText({x:t,y:e,text:u,i:a,j:i,parent:C,dataLabelsConfig:L,alwaysDrawDataLabel:!0,offsetCorrection:!0})}return C}drawTotalDataLabels({x:t,y:e,val:s,realIndex:a,textAnchor:i,barTotalDataLabelsConfig:r}){const o=new g(this.barCtx.w);let l;return r.enabled&&void 0!==t&&void 0!==e&&this.barCtx.lastActiveBarSerieIndex===a&&(l=o.drawText({x:t,y:e,foreColor:r.style.color,text:s,textAnchor:i,fontFamily:r.style.fontFamily,fontSize:r.style.fontSize,fontWeight:r.style.fontWeight})),l}}const P=c.__apex_Series,L=c.__apex_Fill,I=c.__apex_Utils;class k{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),I.isSafari()&&(this.arrBorderRadius=this.arrBorderRadius.map(t=>t.map(t=>"none"))),0===this.barCtx.seriesLen&&(this.barCtx.seriesLen=1),this.barCtx.zeroSerieses=[],e.globals.comboCharts||this.checkZeroSeries({series:t})}initialPositions(t){const e=this.w;let s,a,i,r,o,l,n,h,d=e.globals.dataPoints;this.barCtx.isRangeBar&&(d=e.labelData.labels.length);let c=this.barCtx.seriesLen;if(e.config.plotOptions.bar.rangeBarGroupRows&&(c=1),this.barCtx.isHorizontal)i=e.layout.gridHeight/d,o=i/c,e.axisFlags.isXNumeric&&(i=e.layout.gridHeight/this.barCtx.totalItems,o=i/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=(i-o*this.barCtx.seriesLen)/2;else{if(r=e.layout.gridWidth/this.barCtx.visibleItems,e.config.xaxis.convertedCatToNumeric&&(r=e.layout.gridWidth/e.globals.dataPoints),l=r/c*parseInt(this.barCtx.barOptions.columnWidth,10)/100,e.axisFlags.isXNumeric){const t=this.barCtx.xRatio;e.globals.minXDiff&&.5!==e.globals.minXDiff&&e.globals.minXDiff/t>0&&(r=e.globals.minXDiff/t),l=r/c*parseInt(this.barCtx.barOptions.columnWidth,10)/100,l<1&&(l=1)}if(-1===String(this.barCtx.barOptions.columnWidth).indexOf("%")&&(l=parseInt(this.barCtx.barOptions.columnWidth,10)),n=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:l}).x}else s=e.globals.padHorizontal+I.noExponents(r-l*this.barCtx.seriesLen)/2}return e.globals.barHeight=o,e.globals.barWidth=l,{x:s,y:a,yDivision:i,xDivision:r,barHeight:o,barWidth:l,zeroH:n,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 i,r,o,l;const n=this.w,h=new L(this.barCtx.w);let d=null;const c=this.barCtx.barOptions.distributed?s:e;let b=!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&&(d=a.color,b=!0)})}return{color:h.fillPath({seriesNumber:this.barCtx.barOptions.distributed?c:a,dataPointIndex:s,color:d,value:t[e][s],fillConfig:null==(i=n.config.series[e].data[s])?void 0:i.fill,fillType:(null==(o=null==(r=n.config.series[e].data[s])?void 0:r.fill)?void 0:o.type)?null==(l=n.config.series[e].data[s])?void 0:l.fill.type:Array.isArray(n.config.fill.type)?n.config.fill.type[a]:n.config.fill.type}),useRangeColor:b}}getStrokeWidth(t,e,s){let a=0;const i=this.w;return void 0===this.barCtx.series[t][e]||null===this.barCtx.series[t][e]||"bar"===i.config.chart.type&&!this.barCtx.series[t][e]?this.barCtx.isNullValue=!0:this.barCtx.isNullValue=!1,i.config.stroke.show&&(this.barCtx.isNullValue||(a=Array.isArray(this.barCtx.strokeWidth)?this.barCtx.strokeWidth[s]:this.barCtx.strokeWidth)),a}createBorderRadiusArr(t){var e;const s=this.w,a=!this.w.config.chart.stacked||s.config.plotOptions.bar.borderRadius<=0,i=t.length,r=0|(null==(e=t[0])?void 0:e.length),o=Array.from({length:i},()=>Array(r).fill(a?"top":"none"));if(a)return o;const l=this.w.config.chart.type;for(let e=0;e<r;e++){const s=[],a=[];let n=0;for(let r=0;r<i;r++){const i=t[r][e];i>0?(s.push(r),n++):i<0&&(a.push(r),n++)}if(s.length>0&&0===a.length)if(1===s.length)o[s[0]][e]="bar"===l&&1===r?"top":"both";else{const t=s[0],a=s[s.length-1];for(const i of s)o[i][e]=i===t?"bar"===l&&1===r?"top":"bottom":i===a?"top":"none"}else if(a.length>0&&0===s.length)if(1===a.length)o[a[0]][e]="both";else{const t=Math.max(...a),s=Math.min(...a);for(const i of a)o[i][e]=i===t?"bottom":i===s?"top":"none"}else if(s.length>0&&a.length>0){const t=s[s.length-1];for(const a of s)o[a][e]=a===t?"top":"none";const i=Math.max(...a);for(const t of a)o[t][e]=t===i?"bottom":"none"}else if(1===n){o[s[0]||a[0]][e]="both"}}return o}barBackground({j:t,i:e,x1:s,x2:a,y1:i,y2:r,elSeries:o}){const l=this.w,n=new g(this.barCtx.w),h=new P(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=n.drawRect(void 0!==s?s:0,void 0!==i?i:0,void 0!==a?a:l.layout.gridWidth,void 0!==r?r:l.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:i,isReversed:r,series:o,seriesGroup:l,realIndex:n,i:h,j:d,w:c}){var b,u,p;const x=new g(this.barCtx.w);(i=Array.isArray(i)?i[n]:i)||(i=0);let f=t,y=e;(null==(b=c.config.series[n].data[d])?void 0:b.columnWidthOffset)&&(y=e-c.config.series[n].data[d].columnWidthOffset/2,f=t+c.config.series[n].data[d].columnWidthOffset);const m=i/2,v=y+m,C=y+f-m,w=(o[h][d]>=0?1:-1)*(r?-1:1);s+=.001-m*w,a+=.001+m*w;const P=x.line(C,s),L="around"===c.config.plotOptions.bar.borderRadiusApplication||"both"===this.arrBorderRadius[n][d]?" Z":" z";let I=x.move(v,s)+x.line(v,a)+x.line(C,a)+P+L;"none"!==this.arrBorderRadius[n][d]&&(I=x.roundPathCorners(I,c.config.plotOptions.bar.borderRadius));let k=null;const H=null==(p=null==(u=this.barCtx.ctx)?void 0:u.morphTypeChange)?void 0:p.getInitialPathFor(n,d);if(H?k=H:c.globals.previousPaths.length>0&&(k=this.barCtx.getPreviousPath(n,d,I)),null==k&&(k=x.move(v,s)+x.line(v,s)+P+P+P+P+P+x.line(v,s)+L),c.config.chart.stacked){let t=this.barCtx;t=this.barCtx[l],t.yArrj.push(a-m*w),t.yArrjF.push(Math.abs(s-a+i*w)),t.yArrjVal.push(this.barCtx.series[h][d])}return{pathTo:I,pathFrom:k}}getFunnelTrapezoidPaths({barYPosition:t,barHeight:e,series:s,i:a,j:i,realIndex:r,strokeWidth:o,w:l}){var n,h;const d=new g(this.barCtx.w),c=l.layout.gridWidth/2,b=t=>Math.abs(t/this.barCtx.invertedYRatio)/2,u=b(s[a][i]),p=i===s[a].length-1,x="taper"===l.config.plotOptions.funnel.lastShape?"taper":"flat";let f;f=p?"taper"===x?0:u:b(s[a][i+1]);const y=o/2,m=t+y,v=t+e-y,C=c-u,w=c+u,P=c-f,L=c+f,I=d.move(C,m)+d.line(w,m)+d.line(L,v)+d.line(P,v)+" Z";let k=null;const H=null==(h=null==(n=this.barCtx.ctx)?void 0:n.morphTypeChange)?void 0:h.getInitialPathFor(r,i);return H?k=H:l.globals.previousPaths.length>0&&(k=this.barCtx.getPreviousPath(r,i,I)),null==k&&(k=d.move(c,m)+d.line(c,m)+d.line(c,v)+d.line(c,v)+" Z"),{pathTo:I,pathFrom:k,x:w,x1:C,barXPosition:c}}computePyramidLayout(t){const e=this.w,s=e.layout.gridHeight,a=e.layout.gridWidth,i=t.map(t=>Math.abs(Number(t)||0)),r=i.reduce((t,e)=>t+e,0);if(0===r||s<=0)return i.map(()=>({y:0,height:0,topHalf:0,bottomHalf:0}));const o=a/2;let l=0;const n=[];for(let t=0;t<i.length;t++){const e=l/r;l+=i[t];const a=l/r,h=e*s,d=a*s;n.push({y:h,height:d-h,topHalf:e*o,bottomHalf:a*o})}return n}getPyramidPaths({barYPosition:t,barHeight:e,topHalf:s,bottomHalf:a,realIndex:i,j:r,strokeWidth:o,w:l}){var n,h;const d=new g(this.barCtx.w),c=l.layout.gridWidth/2,b=o/2,u=t+b,p=t+e-b,x=c-s,f=c+s,y=c-a,m=c+a,v=d.move(x,u)+d.line(f,u)+d.line(m,p)+d.line(y,p)+" Z";let C=null;const w=null==(h=null==(n=this.barCtx.ctx)?void 0:n.morphTypeChange)?void 0:h.getInitialPathFor(i,r);return w?C=w:l.globals.previousPaths.length>0&&(C=this.barCtx.getPreviousPath(i,r,v)),null==C&&(C=d.move(c,u)+d.line(c,u)+d.line(c,p)+d.line(c,p)+" Z"),{pathTo:v,pathFrom:C,x:f,x1:x,barXPosition:c}}getBarpaths({barYPosition:t,barHeight:e,x1:s,x2:a,strokeWidth:i,isReversed:r,series:o,seriesGroup:l,realIndex:n,i:h,j:d,w:c}){var b,u,p;const x=new g(this.barCtx.w);(i=Array.isArray(i)?i[n]:i)||(i=0);let f=t,y=e;(null==(b=c.config.series[n].data[d])?void 0:b.barHeightOffset)&&(f=t-c.config.series[n].data[d].barHeightOffset/2,y=e+c.config.series[n].data[d].barHeightOffset);const m=i/2,v=f+m,C=f+y-m,w=(o[h][d]>=0?1:-1)*(r?-1:1);s+=.001+m*w,a+=.001-m*w;const P=this.barCtx.isFunnel,L=P?(s+a)/2:s,I=x.line(s,C),k="around"===c.config.plotOptions.bar.borderRadiusApplication||"both"===this.arrBorderRadius[n][d]?" Z":" z";let H=x.move(s,v)+x.line(a,v)+x.line(a,C)+I+k;"none"!==this.arrBorderRadius[n][d]&&(H=x.roundPathCorners(H,c.config.plotOptions.bar.borderRadius));let A=null;const W=null==(p=null==(u=this.barCtx.ctx)?void 0:u.morphTypeChange)?void 0:p.getInitialPathFor(n,d);if(W?A=W:c.globals.previousPaths.length>0&&(A=this.barCtx.getPreviousPath(n,d,H)),null==A){const t=P?x.line(L,C):I;A=x.move(L,v)+x.line(L,v)+t+t+t+t+t+x.line(L,v)+k}if(c.config.chart.stacked){let t=this.barCtx;t=this.barCtx[l],t.xArrj.push(a+m*w),t.xArrjF.push(Math.abs(s-a-i*w)),t.xArrjVal.push(this.barCtx.series[h][d])}return{pathTo:H,pathFrom:A}}checkZeroSeries({series:t}){const e=this.w;for(let s=0;s<t.length;s++){let a=0;for(let i=0;i<t[e.globals.maxValsInArrayIndex].length;i++)a+=t[s][i];0===a&&this.barCtx.zeroSerieses.push(s)}}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 i=a?e:null;return null!=t&&(i=e-t/this.barCtx.yRatio[s]+2*(this.barCtx.isReversed?t/this.barCtx.yRatio[s]:0)),i}getGoalValues(t,e,s,a,i,r){const o=this.w,h=[],d=(a,i)=>{h.push({[t]:"x"===t?this.getXForValue(a,e,!1):this.getYForValue(a,s,r,!1),attrs:i})};if(o.seriesData.seriesGoals[a]&&o.seriesData.seriesGoals[a][i]&&Array.isArray(o.seriesData.seriesGoals[a][i])&&o.seriesData.seriesGoals[a][i].forEach(t=>{d(t.value,t)}),this.barCtx.barOptions.isDumbbell&&o.rangeData.seriesRange.length){const e=this.barCtx.barOptions.dumbbellColors?this.barCtx.barOptions.dumbbellColors:o.globals.colors,s={strokeHeight:"x"===t?0:o.globals.markers.size[a],strokeWidth:"x"===t?o.globals.markers.size[a]:0,strokeDashArray:0,strokeLineCap:"round",strokeColor:Array.isArray(e[a])?e[a][0]:e[a]};d(o.rangeData.seriesRangeStart[a][i],s),d(o.rangeData.seriesRangeEnd[a][i],n(l({},s),{strokeColor:Array.isArray(e[a])?e[a][1]:e[a]}))}return h}drawGoalLine({barXPosition:t,barYPosition:e,goalX:s,goalY:a,barWidth:i,barHeight:r}){if(!(Array.isArray(s)&&s.length>0||Array.isArray(a)&&a.length>0))return null;const o=new g(this.barCtx.w),l=o.group({className:"apexcharts-bar-goals-groups"});l.node.classList.add("apexcharts-element-hidden"),this.barCtx.w.globals.delayedElements.push({el:l.node}),l.attr("clip-path",`url(#gridRectMarkerMask${this.barCtx.w.globals.cuid})`);let n=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:r/2,a=e+s+r/2;n=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),l.add(n)}}):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:i/2,a=t+s+i/2;n=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),l.add(n)}}),l}drawBarShadow({prevPaths:t,currPaths:e,color:s,realIndex:a,j:i}){const r=this.w,{x:o,x1:l,barYPosition:n}=t,{x:h,x1:d,barYPosition:c}=e,b=n+e.barHeight,u=new g(this.barCtx.w),p=new I,x=u.move(l,b)+u.line(o,b)+u.line(h,c)+u.line(d,c)+u.line(l,b)+("around"===r.config.plotOptions.bar.borderRadiusApplication||"both"===this.arrBorderRadius[a][i]?" Z":" z");return u.drawPath({d:x,fill:p.shadeColor(.5,I.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 i=0,r=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&&i++,s<t&&0===o&&r++}),{nonZeroColumns:i,zeroEncounters:r}}getGroupIndex(t){const e=this.w,s=e.labelData.seriesGroups.findIndex(s=>s.indexOf(e.seriesData.seriesNames[t])>-1),a=this.barCtx.columnGroupIndices;let i=a.indexOf(s);return i<0&&(a.push(s),i=a.length-1),{groupIndex:s,columnGroupIndex:i}}}const H=c.__apex_Filters,A=c.__apex_Animations_computeStagger;class W{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.series=[],this.elSeries=null,this.visibleI=0,this.isReversed=!1;const a=new P(this.w);this.lastActiveBarSerieIndex=a.getActiveConfigSeriesIndex("desc",["bar","column"]),this.columnGroupIndices=[];const i=a.getBarSeriesIndices(),r=new b(this.w);this.stackedSeriesTotals=r.getStackedSeriesTotals(this.w.config.series.map((t,e)=>-1===i.indexOf(e)?e:-1).filter(t=>-1!==t)),this.barHelpers=new k(this)}draw(t,e){var s,a,i;const r=this.w,o=new g(this.w),h=new b(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"});r.config.dataLabels.enabled&&(this.totalItems,this.barOptions.dataLabels.maxItems);for(let h=0,c=0;h<t.length;h++,c++){let b,g;const u=[],p=[],x=r.globals.comboCharts?e[h]:h,{columnGroupIndex:f}=this.barHelpers.getGroupIndex(x),m=o.group({class:"apexcharts-series",rel:h+1,seriesName:I.escapeString(r.seriesData.seriesNames[x]),"data:realIndex":x});P.addCollapsedClassToSeries(this.w,m,x),t[h].length>0&&(this.visibleI=this.visibleI+1),this.yRatio.length>1&&(this.yaxisIndex=r.globals.seriesYAxisReverseMap[x],this.translationsIndex=x);const v=this.translationsIndex;this.isReversed=r.config.yaxis[this.yaxisIndex]&&r.config.yaxis[this.yaxisIndex].reversed,this.isPyramid&&(this.pyramidLayout=this.barHelpers.computePyramidLayout(t[h]));const w=this.barHelpers.initialPositions(x),{y:L,yDivision:k,zeroW:A,x:W,xDivision:D,zeroH:O}=w;let R=w.barHeight,S=w.barWidth;g=L,b=W,this.isHorizontal||p.push(b+(null!=S?S:0)/2);const X=o.group({class:"apexcharts-datalabels","data:realIndex":x});r.globals.delayedElements.push({el:X.node,holdUntilComplete:!(null==(s=r.config.dataLabels.animate)?void 0:s.enabled)&&this.isLengthTransition(x)}),X.node.classList.add("apexcharts-element-hidden");const F=o.group({class:"apexcharts-bar-goals-markers"}),B=o.group({class:"apexcharts-bar-shadows"});r.globals.delayedElements.push({el:B.node}),B.node.classList.add("apexcharts-element-hidden");for(let e=0;e<t[h].length;e++){const s=this.barHelpers.getStrokeWidth(h,e,x);let o=null;const d={indexes:{i:h,j:e,realIndex:x,translationsIndex:v,bc:c},x:b,y:g,strokeWidth:s,elSeries:m};this.isHorizontal?(o=this.drawBarPaths(n(l({},d),{barHeight:R,zeroW:A,yDivision:k})),S=this.series[h][e]/this.invertedYRatio):(o=this.drawColumnPaths(n(l({},d),{xDivision:D,barWidth:S,zeroH:O})),R=this.series[h][e]/this.yRatio[v]);const y=this.barHelpers.getPathFillColor(t,h,e,x);if(this.isFunnel&&!this.isPyramid&&this.barOptions.isFunnel3d&&"trapezoid"!==(null==(a=r.config.plotOptions.funnel)?void 0:a.shape)&&this.pathArr.length&&e>0){const t=this.barHelpers.drawBarShadow({color:"string"==typeof y.color&&-1===(null==(i=y.color)?void 0:i.indexOf("url"))?y.color:I.hexToRgba(r.globals.colors[h]),prevPaths:this.pathArr[this.pathArr.length-1],currPaths:o,realIndex:x,j:e});if(B.add(t),r.config.chart.dropShadow.enabled){new H(this.w).dropShadow(t,r.config.chart.dropShadow,x)}}this.pathArr.push(o);const C=this.barHelpers.drawGoalLine({barXPosition:o.barXPosition,barYPosition:o.barYPosition,goalX:o.goalX,goalY:o.goalY,barHeight:R,barWidth:S});C&&F.add(C),g=o.y,b=o.x,e>0&&p.push(b+(null!=S?S:0)/2),u.push(g),this.renderSeries(n(l({realIndex:x,pathFill:y.color},y.useRangeColor?{lineFill:y.color}:{}),{j:e,i:h,columnGroupIndex:f,pathFrom:o.pathFrom,pathTo:o.pathTo,strokeWidth:s,elSeries:m,x:b,y:g,series:t,barHeight:Math.abs(o.barHeight?o.barHeight:R),barWidth:Math.abs(o.barWidth?o.barWidth:S),elDataLabelsWrap:X,elGoalsMarkers:F,elBarShadows:B,visibleSeries:this.visibleI,type:"bar"}))}if(r.globals.seriesXvalues[x]=p,r.globals.seriesYvalues[x]=u,r.globals.previousPaths.length>0){const e=[];for(let s=0;s<t[h].length;s++)e.push(y(r,x,s));C({w:r,elSeries:m,record:this._prevRecord(x),newKeys:e,isHorizontal:this.isHorizontal,speed:r.config.chart.animations.dynamicAnimation.speed})}d.add(m)}return d}renderSeries({realIndex:t,pathFill:e,lineFill:s,j:a,i:i,columnGroupIndex:r,pathFrom:o,pathTo:l,strokeWidth:n,elSeries:h,x:d,y:c,y1:b,y2:u,series:p,barHeight:x,barWidth:f,barXPosition:m,barYPosition:v,elDataLabelsWrap:C,elGoalsMarkers:P,elBarShadows:L,visibleSeries:I,type:k,classes:W}){var D;const O=this.w,R=new g(this.w,this.ctx),S=function(t,e){const s=t&&t.renderer;return s&&s.kind&&"svg"!==s.kind?s:e}(this.ctx,R);let X=!1;if(h._bindingsDelegated||(h._bindingsDelegated=!0,R.setupEventDelegation(h,`.apexcharts-${k}-area`)),!s){let e=function(t){const e=O.config.stroke.colors;let s;return Array.isArray(e)&&e.length>0&&(s=e[t],s||(s=""),"function"==typeof s)?s({value:O.seriesData.series[t][a],dataPointIndex:a,w:O}):s};const i="function"==typeof O.globals.stroke.colors[t]?e(t):O.globals.stroke.colors[t];s=this.barOptions.distributed?O.globals.stroke.colors[a]:i}const F=new w(this).handleBarDataLabels({x:d,y:c,y1:b,y2:u,i:i,j:a,series:p,realIndex:t,columnGroupIndex:r,barHeight:x,barWidth:f,barXPosition:m,barYPosition:v,visibleSeries:I});O.globals.isBarHorizontal||(F.dataLabelsPos.dataLabelsX+Math.max(f,O.globals.barPadForNumericAxis)<0||F.dataLabelsPos.dataLabelsX-Math.max(f,O.globals.barPadForNumericAxis)>O.layout.gridWidth)&&(X=!0),O.config.series[i].data[a]&&O.config.series[i].data[a].strokeColor&&(s=O.config.series[i].data[a].strokeColor),this.isNullValue&&(e="none");const B=O.config.chart.animations,j=B.animateGradually;let Y=0;if(j&&!1!==j.enabled&&!(O.globals.dataChanged&&this.isLayoutShift(t))){const t=O.globals.dataPoints||1,e=j.delay||0,s=Math.min(e,.5*B.speed/Math.max(1,t));let r=A({style:"sequential",index:a,baseDelay:s});O.config.chart.stacked&&(r+=i*s*.5);Y=r/(e||1)}if(!X){const r=!0===(null==(D=this.ctx.morphTypeChange)?void 0:D.isActive())?this.ctx.morphTypeChange.getSpeed():O.config.chart.animations.dynamicAnimation.speed,d=S.renderPaths({i:i,j:a,realIndex:t,pathFrom:o,pathTo:l,stroke:s,strokeWidth:n,strokeLineCap:O.config.stroke.lineCap,fill:e,animationDelay:Y,initialSpeed:O.config.chart.animations.speed,dataChangeSpeed:r,className:`apexcharts-${k}-area ${W}`,chartType:k,bindEventsOnPaths:!1});d.attr("clip-path",`url(#gridRectBarMask${O.globals.cuid})`);const c=O.config.forecastDataPoints;c.count>0&&a>=O.globals.dataPoints-c.count&&(d.node.setAttribute("stroke-dasharray",c.dashArray),d.node.setAttribute("stroke-width",c.strokeWidth),d.node.setAttribute("fill-opacity",c.fillOpacity)),void 0!==b&&void 0!==u&&(d.attr("data-range-y1",b),d.attr("data-range-y2",u));new H(this.w).setSelectionFilter(d,t,a),h.add(d),d.attr({cy:F.dataLabelsPos.bcy,cx:F.dataLabelsPos.bcx,j:a,val:O.seriesData.series[i][a],barHeight:x,barWidth:f,"data:pathKey":y(O,t,a)}),"canvas"===S.kind&&(O.globals.barCanvasCoords||(O.globals.barCanvasCoords={}),O.globals.barCanvasCoords[t]||(O.globals.barCanvasCoords[t]={}),O.globals.barCanvasCoords[t][a]={cx:F.dataLabelsPos.bcx,cy:F.dataLabelsPos.bcy,barWidth:f}),null!==F.dataLabels&&C.add(F.dataLabels),F.totalDataLabels&&C.add(F.totalDataLabels),h.add(C),P&&h.add(P),L&&h.add(L)}return h}drawBarPaths({indexes:t,barHeight:e,strokeWidth:s,zeroW:a,x:i,y:r,yDivision:o,elSeries:l}){const n=this.w,h=t.i,d=t.j;let c;if(n.axisFlags.isXNumeric)c=(r=(n.seriesData.seriesX[h][d]-n.globals.minX)/this.invertedXRatio-e)+e*this.visibleI;else if(n.config.plotOptions.bar.hideZeroBarsWhenGrouped){const{nonZeroColumns:t,zeroEncounters:s}=this.barHelpers.getZeroValueEncounters({i:h,j:d});t>0&&(e=this.seriesLen*e/t),c=r+e*this.visibleI,c-=e*s}else c=r+e*this.visibleI;const b=this.isFunnel&&"trapezoid"===n.config.plotOptions.funnel.shape,g=this.isPyramid&&this.pyramidLayout?this.pyramidLayout[d]:null,u=!!g;if(g)c=g.y,e=g.height;else if(this.isFunnel&&!b){const t=null!=a?a:0;a=t-(this.barHelpers.getXForValue(this.series[h][d],t)-t)/2}let p;return i=this.barHelpers.getXForValue(this.series[h][d],null!=a?a:0),p=g?this.barHelpers.getPyramidPaths({barYPosition:c,barHeight:e,topHalf:g.topHalf,bottomHalf:g.bottomHalf,realIndex:t.realIndex,j:d,strokeWidth:s,w:n}):b?this.barHelpers.getFunnelTrapezoidPaths({barYPosition:c,barHeight:e,series:this.series,i:h,j:d,realIndex:t.realIndex,strokeWidth:s,w:n}):this.barHelpers.getBarpaths({barYPosition:c,barHeight:e,x1:a,x2:i,strokeWidth:s,isReversed:this.isReversed,series:this.series,realIndex:t.realIndex,i:h,j:d,w:n}),(b||u)&&(a=p.x1,i=p.x),n.axisFlags.isXNumeric||u||(r+=o),u&&(r=c),this.barHelpers.barBackground({j:d,i:h,y1:c-e*this.visibleI,y2:e*this.seriesLen,elSeries:l}),{pathTo:p.pathTo,pathFrom:p.pathFrom,x1:a,x:i,y:r,goalX:this.barHelpers.getGoalValues("x",a,null,h,d,0),barYPosition:c,barHeight:e}}drawColumnPaths({indexes:t,x:e,y:s,xDivision:a,barWidth:i,zeroH:r,strokeWidth:o,elSeries:l}){const n=this.w,h=t.realIndex,d=t.translationsIndex,c=t.i,b=t.j,g=t.bc;let u;if(n.axisFlags.isXNumeric){const t=this.getBarXForNumericXAxis({x:e,j:b,realIndex:h,barWidth:i});e=t.x,u=t.barXPosition}else if(n.config.plotOptions.bar.hideZeroBarsWhenGrouped){const{nonZeroColumns:t,zeroEncounters:s}=this.barHelpers.getZeroValueEncounters({i:c,j:b});t>0&&(i=this.seriesLen*i/t),u=e+i*this.visibleI,u-=i*s}else u=e+i*this.visibleI;s=this.barHelpers.getYForValue(this.series[c][b],r,d);const p=this.barHelpers.getColumnPaths({barXPosition:u,barWidth:i,y1:r,y2:s,strokeWidth:o,isReversed:this.isReversed,series:this.series,realIndex:h,i:c,j:b,w:n});return n.axisFlags.isXNumeric||(e+=a),this.barHelpers.barBackground({bc:g,j:b,i:c,x1:u-o/2-i*this.visibleI,x2:i*this.seriesLen+o/2,elSeries:l}),{pathTo:p.pathTo,pathFrom:p.pathFrom,x:e,y:s,goalY:this.barHelpers.getGoalValues("y",null,r,c,b,d),barXPosition:u,barWidth:i}}getBarXForNumericXAxis({x:t,barWidth:e,realIndex:s,j:a}){const i=this.w;let r=s;return i.seriesData.seriesX[s].length||(r=i.globals.maxValsInArrayIndex),I.isNumber(i.seriesData.seriesX[r][a])&&(t=(i.seriesData.seriesX[r][a]-i.globals.minX)/this.xRatio-e*this.seriesLen/2),{barXPosition:t+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 i=e.globals.previousPaths[a];i.paths&&i.paths.length>0&&parseInt(i.realIndex,10)===parseInt(String(t),10)&&(s=i)}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 i=!1;if(f(a)&&a.globals.previousPaths.length>0){const r=this._prevRecord(t),o=null!=(s=null==(e=a.seriesData.series[t])?void 0:e.length)?s:0;if(r)if(r.paths.length!==o)i=!0;else{const e=this._prevKeyedPaths(t);if(e)for(let s=0;s<o;s++)if(!e.has(y(a,t,s))){i=!0;break}}else i=o>0}return this._ltCache[t]=i,i}isLayoutShift(t){if(this.isLengthTransition(t))return!0;if(this._layoutShiftCache||(this._layoutShiftCache={}),void 0!==this._layoutShiftCache[t])return this._layoutShiftCache[t];const e=v(this.w,t,!0,!0),s=!(!e||!e.join.changed);return this._layoutShiftCache[t]=s,s}getPreviousPath(t,e,s){const a=this.w,i=this._prevRecord(t);if(!i)return f(a)?null:s;let r=null,o=!1;const l=this._prevKeyedPaths(t);if(l){const s=l.get(y(a,t,e));s?r=s.d:o=!0}else void 0!==i.paths[e]?r=i.paths[e].d:o=!0;return r&&W.pathCommandCount(r)===W.pathCommandCount(s)?r:o&&f(a)?null:s}static pathCommandCount(t){if(!t)return 0;const e=t.match(/[A-Za-z]/g);return e?e.length:0}}function D({w:t,points:e,seedA:s,seedB:a,center:i,halfExtent:r,alongFn:o,isHorizontal:l,options:n,clampAt:h}){const d=n;if(!d||!1===d.show)return[];if(!e||!e.length)return[];const c=d.maxPoints||3e3,b=e.length>c?Math.ceil(e.length/c):1,g=null!=d.size?d.size:2.5,u=r*(null!=d.jitter?d.jitter:.5),p=!1!==d.constrainToViolin&&"function"==typeof h,x="square"===d.shape,f=d.colorScale,y=f&&Array.isArray(f.colors)&&f.colors.length>0,m=y?Math.max(2,f.steps||24):1,v=y&&null!=f.min?f.min:t.globals.minY,C=(y&&null!=f.max?f.max:t.globals.maxY)-v||1,w=y?new Array(m).fill(""):[""];for(let t=0;t<e.length;t+=b){const r=e[t],n=o(r);let d=2*(X(7919*s+100003*a+t)-.5)*u;if(p){const t=h(r);d>t&&(d=t),d<-t&&(d=-t)}const c=l?n:i+d,b=l?i+d:n,f=x?B(c,b,g):F(c,b,g);if(y){let t=(r-v)/C;t<0&&(t=0),t>1&&(t=1),w[Math.round(t*(m-1))]+=f}else w[0]+=f}if(!y)return w[0]?[{fill:null,d:w[0]}]:[];const P=[];for(let t=0;t<m;t++)w[t]&&P.push({fill:S(f.colors,t/(m-1)),d:w[t]});return P}function O({graphics:t,w:e,elSeries:s,pointsByCat:a,options:i,distributed:r,realIndex:o,wrapClass:l,pointClass:n}){if(!i||!1===i.show||!a.length)return;const h=null!=i.opacity?i.opacity:.9,d=null!=i.strokeColor?i.strokeColor:"#fff",c=null!=i.strokeWidth?i.strokeWidth:1,b=e.config.chart.animations.enabled&&!e.globals.resized&&!e.globals.dataChanged,g=t.group({class:b?`${l} apexcharts-element-hidden`:l});b&&e.globals.delayedElements.push({el:g.node}),a.forEach(({groups:s,j:a})=>{const l=r?e.globals.colors[a]:e.globals.colors[o],b=i.fillColor,u="series"===b?l:"series-dark"===b?R(l,.45):b||R(l,.45);s.forEach(s=>{const i=t.drawPath({d:s.d,fill:null!=s.fill?s.fill:u,stroke:c>0?d:"none",strokeWidth:c,fillOpacity:h,classes:n});i.attr("data:realIndex",o),i.attr("j",a),i.attr("clip-path",`url(#gridRectBarMask${e.globals.cuid})`),i.node.style.pointerEvents="none",g.add(i)})}),s.add(g)}function R(t,e){const s=I.parseHex(t);if(!s)return t;const a=Math.max(0,1-e);return`rgb(${Math.round(s[0]*a)},${Math.round(s[1]*a)},${Math.round(s[2]*a)})`}function S(t,e){if(!t.length)return"#000";if(1===t.length)return t[0];const s=Math.max(0,Math.min(1,e))*(t.length-1),a=Math.floor(s),i=s-a,r=I.parseHex(t[a])||[0,0,0],o=I.parseHex(t[Math.min(a+1,t.length-1)])||r,l=(t,e)=>Math.round(t+(e-t)*i);return`rgb(${l(r[0],o[0])},${l(r[1],o[1])},${l(r[2],o[2])})`}function X(t){let e=(2654435769^t)>>>0;return e=Math.imul(e^e>>>16,73244475),e=Math.imul(e^e>>>16,73244475),((e^e>>>16)>>>0)/4294967296}function F(t,e,s){return`M ${t-s} ${e} a ${s} ${s} 0 1 0 ${2*s} 0 a ${s} ${s} 0 1 0 ${-2*s} 0 `}function B(t,e,s){return`M ${t-s} ${e-s} h ${2*s} v ${2*s} h ${-2*s} z `}class j extends W{draw(t,e,s){var a;const i=this.w,r=new g(this.w),o=i.globals.comboCharts?e:i.config.chart.type,h=new L(this.w);this.candlestickOptions=this.w.config.plotOptions.candlestick,this.boxOptions=this.w.config.plotOptions.boxPlot,this.isHorizontal=i.config.plotOptions.bar.horizontal,this.isOHLC=this.candlestickOptions&&"ohlc"===this.candlestickOptions.type,this.coreUtils=new b(this.w),t=this.coreUtils.getLogSeries(t),this.series=t,this.yRatio=this.coreUtils.getLogYRatios(this.yRatio),this.barHelpers.initVariables(t);const d=r.group({class:`apexcharts-${o}-series apexcharts-plot-series`});for(let e=0;e<t.length;e++){let o,c;this.isBoxPlot="boxPlot"===i.config.chart.type||"boxPlot"===i.config.series[e].type;const b=[],g=[],u=i.globals.comboCharts?s[e]:e,{columnGroupIndex:p}=this.barHelpers.getGroupIndex(u),x=r.group({class:"apexcharts-series",seriesName:I.escapeString(i.seriesData.seriesNames[u]),rel:e+1,"data:realIndex":u});P.addCollapsedClassToSeries(this.w,x,u),t[e].length>0&&(this.visibleI=this.visibleI+1);let f=0;this.yRatio.length>1&&(this.yaxisIndex=i.globals.seriesYAxisReverseMap[u][0],f=u);const y=this.barHelpers.initialPositions(u),{y:m,barHeight:v,yDivision:C,zeroW:w,x:L,barWidth:k,xDivision:H,zeroH:A}=y;c=m,o=L,g.push(o+(null!=k?k:0)/2);const W=r.group({class:"apexcharts-datalabels","data:realIndex":u}),R=r.group({class:"apexcharts-bar-goals-markers"}),S=this.isBoxPlot?this.boxOptions.points:null,X=[],F=i.layout.gridWidth,B=null!=k?k:0;for(let s=0;s<i.globals.dataPoints;s++){const r=this.barHelpers.getStrokeWidth(e,s,u);let d=null;const y={indexes:{i:e,j:s,realIndex:u,translationsIndex:f},x:o,y:c,strokeWidth:r,elSeries:x};if(d=this.isHorizontal?this.drawHorizontalBoxPaths(n(l({},y),{yDivision:C,barHeight:v,zeroW:w})):this.drawVerticalBoxPaths(n(l({},y),{xDivision:H,barWidth:k,zeroH:A,cullBounds:{lo:-B,hi:F+B}})),c=d.y,o=d.x,s>0&&g.push(o+(null!=k?k:0)/2),b.push(c),d.culled)continue;const m=this.barHelpers.drawGoalLine({barXPosition:d.barXPosition,barYPosition:d.barYPosition,goalX:d.goalX,goalY:d.goalY,barHeight:v,barWidth:k});if(m&&R.add(m),d.pathTo.forEach((a,l)=>{const n=!this.isBoxPlot&&this.candlestickOptions.wick.useFillColor?d.color[l]:i.globals.stroke.colors[e],b=h.fillPath({seriesNumber:u,dataPointIndex:s,color:d.color[l],value:t[e][s]});this.renderSeries({realIndex:u,pathFill:b,lineFill:n,j:s,i:e,pathFrom:d.pathFrom,pathTo:a,strokeWidth:r,elSeries:x,x:o,y:c,series:t,columnGroupIndex:p,barHeight:v,barWidth:k,elDataLabelsWrap:W,elGoalsMarkers:R,visibleSeries:this.visibleI,type:i.config.chart.type})}),S&&!1!==S.show){const t=null==(a=i.candleData.seriesBoxPoints[u])?void 0:a[s];if(t&&t.length){const e=t=>this.coreUtils.getLogValAtSeriesIndex(t,u);let a,r,o;if(this.isHorizontal){const t=this.invertedYRatio,s=null!=v?v:0,i=null!=w?w:0;a=d.barYPosition+s/2,r=s/2,o=s=>i+e(s)/t}else{const t=this.yRatio[f],s=null!=k?k:0,i=null!=A?A:0;a=d.barXPosition+s/2,r=s/2,o=s=>i-e(s)/t}const l=D({w:i,points:t,seedA:u,seedB:s,center:a,halfExtent:r,alongFn:o,isHorizontal:this.isHorizontal,options:S});l.length&&X.push({groups:l,j:s})}}}S&&O({graphics:r,w:i,elSeries:x,pointsByCat:X,options:S,distributed:i.config.plotOptions.bar.distributed,realIndex:u,wrapClass:"apexcharts-boxPlot-points-wrap",pointClass:"apexcharts-boxPlot-points"}),i.globals.seriesXvalues[u]=g,i.globals.seriesYvalues[u]=b,d.add(x)}return d}drawVerticalBoxPaths({indexes:t,x:e,xDivision:s,barWidth:a,zeroH:i,strokeWidth:r,cullBounds:o=null}){var l,n;const h=this.w,d=new g(this.w),c=t.i,b=t.j,{colors:u}=h.config.plotOptions.candlestick,{colors:p}=this.boxOptions,x=t.realIndex,f=t=>Array.isArray(t)?t[x]:t,y=f(u.upward),m=f(u.downward),v=this.yRatio[t.translationsIndex],C=this.getOHLCValue(x,b);let w=i,P=i,L=C.o<C.c?[y]:[m];this.isBoxPlot&&(L=[f(p.lower),f(p.upper)]);let I=Math.min(C.o,C.c),k=Math.max(C.o,C.c),H=C.m;h.axisFlags.isXNumeric&&(e=(h.seriesData.seriesX[x][b]-h.globals.minX)/this.xRatio-a/2);const A=e+a*this.visibleI;if(void 0===(null==(l=this.series[c])?void 0:l[b])||null===(null==(n=this.series[c])?void 0:n[b])?(I=i,k=i):(I=i-I/v,k=i-k/v,w=i-C.h/v,P=i-C.l/v,H=i-C.m/v),o&&(A+a<o.lo||A>o.hi))return{pathTo:null,pathFrom:null,x:h.axisFlags.isXNumeric?e:e+s,y:k,barXPosition:A,color:L,culled:!0};let W;if(this.isOHLC){const t=A+a/2,e=i-C.o/v,s=i-C.c/v;W=[d.move(t,w)+d.line(t,P)+d.move(t,e)+d.line(A,e)+d.move(t,s)+d.line(A+a,s)]}else W=this.isBoxPlot?[d.move(A,I)+d.line(A+a/2,I)+d.line(A+a/2,w)+d.line(A+a/4,w)+d.line(A+a-a/4,w)+d.line(A+a/2,w)+d.line(A+a/2,I)+d.line(A+a,I)+d.line(A+a,H)+d.line(A,H)+d.line(A,I+r/2),d.move(A,H)+d.line(A+a,H)+d.line(A+a,k)+d.line(A+a/2,k)+d.line(A+a/2,P)+d.line(A+a-a/4,P)+d.line(A+a/4,P)+d.line(A+a/2,P)+d.line(A+a/2,k)+d.line(A,k)+d.line(A,H)+"z"]:[d.move(A,k)+d.line(A+a/2,k)+d.line(A+a/2,w)+d.line(A+a/2,k)+d.line(A+a,k)+d.line(A+a,I)+d.line(A+a/2,I)+d.line(A+a/2,P)+d.line(A+a/2,I)+d.line(A,I)+d.line(A,k-r/2)];let D=null;return h.globals.previousPaths.length>0&&(D=this.getPreviousPath(x,b,W[0])),null==D&&(D=d.move(A+a/2,I)+d.move(A,I)),h.axisFlags.isXNumeric||(e+=s),{pathTo:W,pathFrom:D,x:e,y:k,goalY:this.barHelpers.getGoalValues("y",null,i,c,b,t.translationsIndex),barXPosition:A,color:L}}drawHorizontalBoxPaths({indexes:t,y:e,yDivision:s,barHeight:a,zeroW:i,strokeWidth:r}){var o,l;const n=this.w,h=new g(this.w),d=t.i,c=t.j,b=t.realIndex,{colors:u}=n.config.plotOptions.candlestick,{colors:p}=this.boxOptions,x=t=>Array.isArray(t)?t[b]:t,f=this.invertedYRatio,y=this.getOHLCValue(b,c);let m=y.o<y.c?[x(u.upward)]:[x(u.downward)];this.isBoxPlot&&(m=[x(p.lower),x(p.upper)]);let v=i,C=i,w=Math.min(y.o,y.c),P=Math.max(y.o,y.c),L=y.m;n.axisFlags.isXNumeric&&(e=(n.seriesData.seriesX[b][c]-n.globals.minX)/this.invertedXRatio-a/2);const I=e+a*this.visibleI;void 0===(null==(o=this.series[d])?void 0:o[c])||null===(null==(l=this.series[d])?void 0:l[c])?(w=i,P=i):(w=i+w/f,P=i+P/f,v=i+y.h/f,C=i+y.l/f,L=i+y.m/f);const k=[h.move(w,I)+h.line(w,I+a/2)+h.line(v,I+a/2)+h.line(v,I+a/2-a/4)+h.line(v,I+a/2+a/4)+h.line(v,I+a/2)+h.line(w,I+a/2)+h.line(w,I+a)+h.line(L,I+a)+h.line(L,I)+h.line(w+r/2,I),h.move(L,I)+h.line(L,I+a)+h.line(P,I+a)+h.line(P,I+a/2)+h.line(C,I+a/2)+h.line(C,I+a-a/4)+h.line(C,I+a/4)+h.line(C,I+a/2)+h.line(P,I+a/2)+h.line(P,I)+h.line(L,I)+"z"];let H=null;return n.globals.previousPaths.length>0&&(H=this.getPreviousPath(b,c,k[0])),null==H&&(H=h.move(w,I+a/2)+h.move(w,I)),n.axisFlags.isXNumeric||(e+=s),{pathTo:k,pathFrom:H,x:P,y:e,goalX:this.barHelpers.getGoalValues("x",i,null,d,c,0),barYPosition:I,color:m}}getOHLCValue(t,e){const s=this.w,a=this.coreUtils,i=s=>s[t]&&null!=s[t][e]?a.getLogValAtSeriesIndex(s[t][e],t):0,r=i(s.candleData.seriesCandleH),o=i(s.candleData.seriesCandleO),l=i(s.candleData.seriesCandleM),n=i(s.candleData.seriesCandleC),h=i(s.candleData.seriesCandleL);return{o:this.isBoxPlot?r:o,h:this.isBoxPlot?o:r,m:l,l:this.isBoxPlot?n:h,c:this.isBoxPlot?h:n}}}h.use({candlestick:j,boxPlot:j}),exports.default=h;