apexcharts 7.2.0 → 7.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (172) hide show
  1. package/LICENSE +30 -11
  2. package/dist/apexcharts.common.js +2 -2
  3. package/dist/apexcharts.core.js +545 -463
  4. package/dist/apexcharts.core.min.js +2 -2
  5. package/dist/apexcharts.esm.js +1149 -801
  6. package/dist/apexcharts.js +684 -254
  7. package/dist/apexcharts.min.js +2 -2
  8. package/dist/apexcharts.ssr.common.js +2 -2
  9. package/dist/apexcharts.ssr.esm.js +684 -254
  10. package/dist/area.common.js +1 -1
  11. package/dist/area.esm.js +1 -1
  12. package/dist/bar.common.js +2 -2
  13. package/dist/bar.esm.js +20 -10
  14. package/dist/bar.js +2 -2
  15. package/dist/boxPlot.common.js +2 -2
  16. package/dist/boxPlot.esm.js +20 -10
  17. package/dist/bubble.common.js +1 -1
  18. package/dist/bubble.esm.js +1 -1
  19. package/dist/candlestick.common.js +2 -2
  20. package/dist/candlestick.esm.js +20 -10
  21. package/dist/candlestick.js +2 -2
  22. package/dist/column.common.js +2 -2
  23. package/dist/column.esm.js +20 -10
  24. package/dist/core.common.js +2 -2
  25. package/dist/core.esm.js +545 -463
  26. package/dist/donut.common.js +1 -1
  27. package/dist/donut.esm.js +1 -1
  28. package/dist/dumbbell.common.js +2 -2
  29. package/dist/dumbbell.esm.js +20 -10
  30. package/dist/features/all.common.js +2 -2
  31. package/dist/features/all.esm.js +364 -26
  32. package/dist/features/annotations.common.js +1 -1
  33. package/dist/features/annotations.esm.js +1 -1
  34. package/dist/features/annotations.js +1 -1
  35. package/dist/features/context-menu.common.js +1 -1
  36. package/dist/features/context-menu.esm.js +1 -1
  37. package/dist/features/context-menu.js +1 -1
  38. package/dist/features/drilldown.common.js +1 -1
  39. package/dist/features/drilldown.esm.js +1 -1
  40. package/dist/features/drilldown.js +1 -1
  41. package/dist/features/dumbbell.common.js +1 -1
  42. package/dist/features/dumbbell.esm.js +1 -1
  43. package/dist/features/dumbbell.js +1 -1
  44. package/dist/features/exports.common.js +2 -2
  45. package/dist/features/exports.esm.js +12 -14
  46. package/dist/features/exports.js +2 -2
  47. package/dist/features/facet.common.js +1 -1
  48. package/dist/features/facet.esm.js +1 -1
  49. package/dist/features/facet.js +1 -1
  50. package/dist/features/history.common.js +1 -1
  51. package/dist/features/history.esm.js +1 -1
  52. package/dist/features/history.js +1 -1
  53. package/dist/features/ink.common.js +1 -1
  54. package/dist/features/ink.esm.js +1 -1
  55. package/dist/features/ink.js +1 -1
  56. package/dist/features/keyboard.common.js +2 -2
  57. package/dist/features/keyboard.esm.js +14 -1
  58. package/dist/features/keyboard.js +2 -2
  59. package/dist/features/legend.common.js +1 -1
  60. package/dist/features/legend.esm.js +1 -1
  61. package/dist/features/legend.js +1 -1
  62. package/dist/features/link.common.js +1 -1
  63. package/dist/features/link.esm.js +38 -38
  64. package/dist/features/link.js +1 -1
  65. package/dist/features/marks.common.js +1 -1
  66. package/dist/features/marks.esm.js +1 -1
  67. package/dist/features/marks.js +1 -1
  68. package/dist/features/measure.common.js +1 -1
  69. package/dist/features/measure.esm.js +1 -1
  70. package/dist/features/measure.js +1 -1
  71. package/dist/features/morph.common.js +1 -1
  72. package/dist/features/morph.esm.js +1 -1
  73. package/dist/features/morph.js +1 -1
  74. package/dist/features/perspectives.common.js +1 -1
  75. package/dist/features/perspectives.esm.js +11 -11
  76. package/dist/features/perspectives.js +1 -1
  77. package/dist/features/raincloud.common.js +1 -1
  78. package/dist/features/raincloud.esm.js +1 -1
  79. package/dist/features/raincloud.js +1 -1
  80. package/dist/features/renderer-canvas.common.js +1 -1
  81. package/dist/features/renderer-canvas.esm.js +1 -1
  82. package/dist/features/renderer-canvas.js +1 -1
  83. package/dist/features/stats.common.js +1 -1
  84. package/dist/features/stats.esm.js +1 -1
  85. package/dist/features/stats.js +1 -1
  86. package/dist/features/storyboard.common.js +1 -1
  87. package/dist/features/storyboard.esm.js +11 -11
  88. package/dist/features/storyboard.js +1 -1
  89. package/dist/features/streamgraph.common.js +1 -1
  90. package/dist/features/streamgraph.esm.js +1 -1
  91. package/dist/features/streamgraph.js +1 -1
  92. package/dist/features/toolbar.common.js +2 -2
  93. package/dist/features/toolbar.esm.js +172 -25
  94. package/dist/features/toolbar.js +2 -2
  95. package/dist/features/trellis.common.js +1 -1
  96. package/dist/features/trellis.esm.js +1 -1
  97. package/dist/features/trellis.js +1 -1
  98. package/dist/features/waterfall.common.js +1 -1
  99. package/dist/features/waterfall.esm.js +1 -1
  100. package/dist/features/waterfall.js +1 -1
  101. package/dist/features/weave.common.js +2 -2
  102. package/dist/features/weave.esm.js +180 -2
  103. package/dist/features/weave.js +2 -2
  104. package/dist/heatmap.common.js +1 -1
  105. package/dist/heatmap.esm.js +1 -1
  106. package/dist/heatmap.js +1 -1
  107. package/dist/histogram.common.js +2 -2
  108. package/dist/histogram.esm.js +20 -10
  109. package/dist/line.common.js +1 -1
  110. package/dist/line.esm.js +1 -1
  111. package/dist/line.js +1 -1
  112. package/dist/pictograms.common.js +1 -1
  113. package/dist/pictograms.esm.js +1 -1
  114. package/dist/pictograms.js +1 -1
  115. package/dist/pie.common.js +1 -1
  116. package/dist/pie.esm.js +1 -1
  117. package/dist/pie.js +1 -1
  118. package/dist/polarArea.common.js +1 -1
  119. package/dist/polarArea.esm.js +1 -1
  120. package/dist/radar.common.js +1 -1
  121. package/dist/radar.esm.js +1 -1
  122. package/dist/radar.js +1 -1
  123. package/dist/radialBar.common.js +1 -1
  124. package/dist/radialBar.esm.js +1 -1
  125. package/dist/radialBar.js +1 -1
  126. package/dist/raincloud.common.js +2 -2
  127. package/dist/raincloud.esm.js +20 -10
  128. package/dist/rangeArea.common.js +1 -1
  129. package/dist/rangeArea.esm.js +1 -1
  130. package/dist/rangeBar.common.js +2 -2
  131. package/dist/rangeBar.esm.js +20 -10
  132. package/dist/scatter.common.js +1 -1
  133. package/dist/scatter.esm.js +1 -1
  134. package/dist/streamgraph.common.js +1 -1
  135. package/dist/streamgraph.esm.js +1 -1
  136. package/dist/sunburst.common.js +1 -1
  137. package/dist/sunburst.esm.js +1 -1
  138. package/dist/sunburst.js +1 -1
  139. package/dist/treemap.common.js +1 -1
  140. package/dist/treemap.esm.js +1 -1
  141. package/dist/treemap.js +1 -1
  142. package/dist/unit-shapes.common.js +1 -1
  143. package/dist/unit-shapes.esm.js +1 -1
  144. package/dist/unit-shapes.js +1 -1
  145. package/dist/unit.common.js +1 -1
  146. package/dist/unit.esm.js +79 -79
  147. package/dist/unit.js +1 -1
  148. package/dist/violin.common.js +2 -2
  149. package/dist/violin.esm.js +20 -10
  150. package/dist/violin.js +2 -2
  151. package/dist/waterfall.common.js +2 -2
  152. package/dist/waterfall.esm.js +20 -10
  153. package/package.json +2 -2
  154. package/src/apexcharts.js +39 -15
  155. package/src/charts/common/bar/Helpers.js +31 -12
  156. package/src/modules/Data.js +8 -2
  157. package/src/modules/Exports.js +14 -12
  158. package/src/modules/Formatters.js +24 -1
  159. package/src/modules/Range.js +28 -1
  160. package/src/modules/Toolbar.js +112 -2
  161. package/src/modules/ZoomPanSelection.js +85 -7
  162. package/src/modules/accessibility/KeyboardNavigation.js +14 -0
  163. package/src/modules/axes/YAxis.js +12 -15
  164. package/src/modules/helpers/UpdateHelpers.js +25 -8
  165. package/src/modules/settings/Globals.js +5 -10
  166. package/src/modules/settings/Options.js +15 -0
  167. package/src/modules/weave/PluginAPI.js +57 -1
  168. package/src/modules/weave/WeaveHost.js +148 -0
  169. package/src/ssr/DOMShim.js +50 -0
  170. package/src/types/internal.d.ts +1 -1
  171. package/src/utils/Utils.js +6 -9
  172. package/types/apexcharts.d.ts +17 -0
@@ -42,7 +42,7 @@ var __async = (__this, __arguments, generator) => {
42
42
  });
43
43
  };
44
44
  /*!
45
- * ApexCharts v7.2.0
45
+ * ApexCharts v7.4.0
46
46
  * (c) 2018-2026 ApexCharts
47
47
  */
48
48
 
@@ -82,6 +82,11 @@ var __async = (__this, __arguments, generator) => {
82
82
  return {};
83
83
  }
84
84
  }
85
+ const CHAR_WIDTH_EM = 0.55;
86
+ const ASCENT_EM = 0.917;
87
+ const DESCENT_EM = 0.25;
88
+ const LINE_HEIGHT_EM = 1.1;
89
+ const DEFAULT_FONT_SIZE = 11;
85
90
  class SSRElement {
86
91
  /**
87
92
  * @param {string} nodeName
@@ -202,6 +207,43 @@ var __async = (__this, __arguments, generator) => {
202
207
  y: 0
203
208
  };
204
209
  }
210
+ getBBox() {
211
+ if (this.nodeName !== "text" && this.nodeName !== "tspan") {
212
+ return { x: 0, y: 0, width: 0, height: 0 };
213
+ }
214
+ const lines = this._textLines();
215
+ const longest = lines.reduce((acc, line) => Math.max(acc, line.length), 0);
216
+ if (!longest) {
217
+ return { x: 0, y: 0, width: 0, height: 0 };
218
+ }
219
+ const fontSize = parseFloat(this.attributes.get("font-size")) || DEFAULT_FONT_SIZE;
220
+ const width = longest * fontSize * CHAR_WIDTH_EM;
221
+ const height = fontSize * (ASCENT_EM + DESCENT_EM) + (lines.length - 1) * fontSize * LINE_HEIGHT_EM;
222
+ const anchor = this.attributes.get("text-anchor");
223
+ const x = parseFloat(this.attributes.get("x")) || 0;
224
+ const y = parseFloat(this.attributes.get("y")) || 0;
225
+ return {
226
+ x: anchor === "middle" ? x - width / 2 : anchor === "end" ? x - width : x,
227
+ y: y - fontSize * ASCENT_EM,
228
+ width,
229
+ height
230
+ };
231
+ }
232
+ /**
233
+ * Text of this element, one entry per rendered line
234
+ * @returns {string[]}
235
+ */
236
+ _textLines() {
237
+ var _a;
238
+ const tspans = this.children.filter((child) => child.nodeName === "tspan");
239
+ if (tspans.length) {
240
+ return tspans.map((tspan) => {
241
+ var _a2;
242
+ return String((_a2 = tspan.textContent) != null ? _a2 : "");
243
+ });
244
+ }
245
+ return [String((_a = this.textContent) != null ? _a : "")];
246
+ }
205
247
  getRootNode() {
206
248
  let root = this;
207
249
  while (root.parentNode) {
@@ -691,15 +733,12 @@ var __async = (__this, __arguments, generator) => {
691
733
  return output;
692
734
  }
693
735
  // A per-series shallow copy: the series OBJECTS are copied, their data arrays
694
- // are shared. Almost every internal "mutation" of a series' data is a
695
- // property REPLACEMENT (`series[i].data = []` on legend collapse,
696
- // `series[i] = 0` for non-axis charts), and those cannot reach a copy made
697
- // this way because the series object was copied at capture time. The
698
- // exception is appendData(), whose push loop grows the shared data array in
699
- // place, so a copy taken before it does see the appended points; see the
700
- // note above defineLazyInitialSeries(). This is the same cheap shape
701
- // `globals.initialSeries` captures, so snapshotting a config stays O(n)
702
- // instead of deep-cloning every point.
736
+ // are shared. Every internal "mutation" of a series' data is a property
737
+ // REPLACEMENT (`series[i].data = []` on legend collapse, `series[i] = 0` for
738
+ // non-axis charts, appendData's concat), and those cannot reach a copy made
739
+ // this way because the series object was copied at capture time. This is the
740
+ // same cheap shape `globals.initialSeries` captures, so snapshotting a config
741
+ // stays O(n) instead of deep-cloning every point.
703
742
  /**
704
743
  * @param {any} series
705
744
  */
@@ -1355,11 +1394,11 @@ var __async = (__this, __arguments, generator) => {
1355
1394
  format = format.replace(/(^|[^\\])yyyy+/g, "$1" + y);
1356
1395
  format = format.replace(/(^|[^\\])yy/g, "$1" + y.toString().substr(2, 2));
1357
1396
  format = format.replace(/(^|[^\\])y/g, "$1" + y);
1358
- const M2 = (utc ? date.getUTCMonth() : date.getMonth()) + 1;
1397
+ const M = (utc ? date.getUTCMonth() : date.getMonth()) + 1;
1359
1398
  format = format.replace(/(^|[^\\])MMMM+/g, "$1" + MMMM[0]);
1360
1399
  format = format.replace(/(^|[^\\])MMM/g, "$1" + MMM[0]);
1361
- format = format.replace(/(^|[^\\])MM/g, "$1" + ii(M2));
1362
- format = format.replace(/(^|[^\\])M/g, "$1" + M2);
1400
+ format = format.replace(/(^|[^\\])MM/g, "$1" + ii(M));
1401
+ format = format.replace(/(^|[^\\])M/g, "$1" + M);
1363
1402
  const d = utc ? date.getUTCDate() : date.getDate();
1364
1403
  format = format.replace(/(^|[^\\])dddd+/g, "$1" + dddd[0]);
1365
1404
  format = format.replace(/(^|[^\\])ddd/g, "$1" + ddd[0]);
@@ -1401,8 +1440,8 @@ var __async = (__this, __arguments, generator) => {
1401
1440
  const day = (utc ? date.getUTCDay() : date.getDay()) + 1;
1402
1441
  format = format.replace(new RegExp(dddd[0], "g"), dddd[day]);
1403
1442
  format = format.replace(new RegExp(ddd[0], "g"), ddd[day]);
1404
- format = format.replace(new RegExp(MMMM[0], "g"), MMMM[M2]);
1405
- format = format.replace(new RegExp(MMM[0], "g"), MMM[M2]);
1443
+ format = format.replace(new RegExp(MMMM[0], "g"), MMMM[M]);
1444
+ format = format.replace(new RegExp(MMM[0], "g"), MMM[M]);
1406
1445
  format = format.replace(/\\(.)/g, "$1");
1407
1446
  return format;
1408
1447
  }
@@ -1870,6 +1909,7 @@ var __async = (__this, __arguments, generator) => {
1870
1909
  setLabelFormatters() {
1871
1910
  const w = this.w;
1872
1911
  const fmt = w.formatters;
1912
+ const inferredNumericX = w.axisFlags.isXNumeric && w.axisFlags.dataFormatXNumeric && w.config.xaxis.type !== "datetime" && !w.config.xaxis.convertedCatToNumeric && !w.globals.isBarHorizontal;
1873
1913
  fmt.xaxisTooltipFormatter = (val) => {
1874
1914
  return this.defaultGeneralFormatter(val);
1875
1915
  };
@@ -1886,8 +1926,13 @@ var __async = (__this, __arguments, generator) => {
1886
1926
  fmt.xLabelFormatter = w.config.xaxis.labels.formatter;
1887
1927
  } else {
1888
1928
  fmt.xLabelFormatter = (val) => {
1929
+ var _a;
1889
1930
  if (Utils$1.isNumber(val)) {
1890
- if (!w.config.xaxis.convertedCatToNumeric && w.config.xaxis.type === "numeric") {
1931
+ if (!w.config.xaxis.convertedCatToNumeric && (w.config.xaxis.type === "numeric" || inferredNumericX)) {
1932
+ const ticks = (_a = w.globals.xAxisScale) == null ? void 0 : _a.result;
1933
+ if (inferredNumericX && Array.isArray(ticks) && ticks.every(Number.isInteger)) {
1934
+ return val.toFixed(0);
1935
+ }
1891
1936
  if (Utils$1.isNumber(w.config.xaxis.decimalsInFloat)) {
1892
1937
  return val.toFixed(w.config.xaxis.decimalsInFloat);
1893
1938
  } else {
@@ -1913,6 +1958,12 @@ var __async = (__this, __arguments, generator) => {
1913
1958
  }
1914
1959
  if (typeof w.config.tooltip.x.formatter === "function") {
1915
1960
  fmt.ttKeyFormatter = w.config.tooltip.x.formatter;
1961
+ } else if (w.config.xaxis.labels.formatter === void 0 && inferredNumericX) {
1962
+ const xLabelFormatter = (
1963
+ /** @type {(val: any) => any} */
1964
+ fmt.xLabelFormatter
1965
+ );
1966
+ fmt.ttKeyFormatter = (val) => Number.isInteger(val) ? val.toFixed(0) : xLabelFormatter(val);
1916
1967
  } else {
1917
1968
  fmt.ttKeyFormatter = fmt.xLabelFormatter;
1918
1969
  }
@@ -2771,6 +2822,17 @@ var __async = (__this, __arguments, generator) => {
2771
2822
  // around the pinch centroid (matching the x-only wheel/toolbar zoom),
2772
2823
  // frame-by-frame rather than the 400ms wheel throttle.
2773
2824
  pinch: "auto",
2825
+ // Drag-to-zoom is deliberate, so it is not gated the way those two
2826
+ // are: it stays on with the toolbar hidden. The reset button that
2827
+ // undoes it does not, which leaves the viewer in a window with no
2828
+ // exit. So while the chart IS zoomed and nothing else on screen can
2829
+ // reset it, one reset control is drawn where the toolbar would have
2830
+ // been, and it goes when the range does. A chart nobody zooms is
2831
+ // untouched. Set false for a page that supplies its own reset (which
2832
+ // also turns off the Escape shortcut), or true to force the control
2833
+ // on whenever the chart is zoomed, even where `toolbar.tools.reset`
2834
+ // is off.
2835
+ resetControl: "auto",
2774
2836
  zoomedArea: {
2775
2837
  fill: {
2776
2838
  color: "#90CAF9",
@@ -2837,6 +2899,11 @@ var __async = (__this, __arguments, generator) => {
2837
2899
  borderRadius: 0,
2838
2900
  borderRadiusApplication: "around",
2839
2901
  // [around, end]
2902
+ // Which segments of a stack round. 'all' caps both ends of the
2903
+ // stack (baseline and far end); 'last' caps only the far end, so
2904
+ // the stack sits square on the baseline. Stacked charts only.
2905
+ borderRadiusWhenStacked: "all",
2906
+ // [all, last]
2840
2907
  rangeBarOverlap: true,
2841
2908
  rangeBarGroupRows: false,
2842
2909
  hideZeroBarsWhenGrouped: false,
@@ -7625,16 +7692,11 @@ var __async = (__this, __arguments, generator) => {
7625
7692
  * which cannot reach the captured copies because each series object was
7626
7693
  * copied at capture time.
7627
7694
  *
7628
- * The one in-place mutator is appendData(), whose push loop grows the shared
7629
- * data array. Re-capturing after it does not undo that: the pushed points
7630
- * are already in the array both snapshots point at, so a snapshot taken
7631
- * before the append reads back as appended. That is the documented
7632
- * behaviour of appendData(overwriteInitialSeries = true), and the `false`
7633
- * case is not honoured for a separate, older reason: Data.parseData()
7634
- * re-captures initialSeries unconditionally on the re-render appendData
7635
- * triggers. Detaching would mean copying the data arrays, which is exactly
7636
- * the per-point cost this snapshot exists to avoid. The same exception
7637
- * applies to `initialConfig.series`, which is captured with the same shape.
7695
+ * appendData() used to be the exception, growing the shared data array in
7696
+ * place. It now replaces the array instead (`data = data.concat(newData)`):
7697
+ * one array copy per call, against the per-point cost this snapshot exists
7698
+ * to avoid. With that, no internal edit can reach a captured copy. The same
7699
+ * holds for `initialConfig.series`, which is captured with the same shape.
7638
7700
  *
7639
7701
  * @param {Record<string, any>} globals
7640
7702
  */
@@ -8161,9 +8223,9 @@ var __async = (__this, __arguments, generator) => {
8161
8223
  if (w.seriesData.series.length === 0) return total;
8162
8224
  for (let i2 = 0; i2 < w.seriesData.series[w.globals.maxValsInArrayIndex].length; i2++) {
8163
8225
  let t2 = 0;
8164
- for (let j = 0; j < w.seriesData.series.length; j++) {
8165
- if (typeof w.seriesData.series[j][i2] !== "undefined" && excludedSeriesIndices.indexOf(j) === -1) {
8166
- t2 += w.seriesData.series[j][i2];
8226
+ for (let j2 = 0; j2 < w.seriesData.series.length; j2++) {
8227
+ if (typeof w.seriesData.series[j2][i2] !== "undefined" && excludedSeriesIndices.indexOf(j2) === -1) {
8228
+ t2 += w.seriesData.series[j2][i2];
8167
8229
  }
8168
8230
  }
8169
8231
  total.push(t2);
@@ -8409,8 +8471,8 @@ var __async = (__this, __arguments, generator) => {
8409
8471
  w.globals.seriesTotals = w.seriesData.series.map((ser) => {
8410
8472
  let total = 0;
8411
8473
  if (Array.isArray(ser)) {
8412
- for (let j = 0; j < ser.length; j++) {
8413
- total += ser[j];
8474
+ for (let j2 = 0; j2 < ser.length; j2++) {
8475
+ total += ser[j2];
8414
8476
  }
8415
8477
  } else {
8416
8478
  total += ser;
@@ -8426,9 +8488,9 @@ var __async = (__this, __arguments, generator) => {
8426
8488
  const w = this.w;
8427
8489
  const seriesTotalsXRange = w.seriesData.series.map((ser, index) => {
8428
8490
  let total = 0;
8429
- for (let j = 0; j < ser.length; j++) {
8430
- if (w.seriesData.seriesX[index][j] > minX && w.seriesData.seriesX[index][j] < maxX) {
8431
- total += ser[j];
8491
+ for (let j2 = 0; j2 < ser.length; j2++) {
8492
+ if (w.seriesData.seriesX[index][j2] > minX && w.seriesData.seriesX[index][j2] < maxX) {
8493
+ total += ser[j2];
8432
8494
  }
8433
8495
  }
8434
8496
  return total;
@@ -8446,11 +8508,11 @@ var __async = (__this, __arguments, generator) => {
8446
8508
  w.globals.seriesPercent = w.seriesData.series.map((ser) => {
8447
8509
  const seriesPercent = [];
8448
8510
  if (Array.isArray(ser)) {
8449
- for (let j = 0; j < ser.length; j++) {
8450
- const total = w.seriesData.stackedSeriesTotals[j];
8511
+ for (let j2 = 0; j2 < ser.length; j2++) {
8512
+ const total = w.seriesData.stackedSeriesTotals[j2];
8451
8513
  let percent = 0;
8452
8514
  if (total) {
8453
- percent = 100 * ser[j] / total;
8515
+ percent = 100 * ser[j2] / total;
8454
8516
  }
8455
8517
  seriesPercent.push(percent);
8456
8518
  }
@@ -8825,44 +8887,44 @@ var __async = (__this, __arguments, generator) => {
8825
8887
  if (cmd === "Z") {
8826
8888
  commands.push(["Z"]);
8827
8889
  } else if (cmd === "M" || cmd === "L" || cmd === "T") {
8828
- for (let j = 0; j < nums.length; j += 2) {
8829
- commands.push([cmd, nums[j], nums[j + 1]]);
8890
+ for (let j2 = 0; j2 < nums.length; j2 += 2) {
8891
+ commands.push([cmd, nums[j2], nums[j2 + 1]]);
8830
8892
  }
8831
8893
  } else if (cmd === "H") {
8832
- for (let j = 0; j < nums.length; j++) {
8833
- commands.push([cmd, nums[j]]);
8894
+ for (let j2 = 0; j2 < nums.length; j2++) {
8895
+ commands.push([cmd, nums[j2]]);
8834
8896
  }
8835
8897
  } else if (cmd === "V") {
8836
- for (let j = 0; j < nums.length; j++) {
8837
- commands.push([cmd, nums[j]]);
8898
+ for (let j2 = 0; j2 < nums.length; j2++) {
8899
+ commands.push([cmd, nums[j2]]);
8838
8900
  }
8839
8901
  } else if (cmd === "C") {
8840
- for (let j = 0; j < nums.length; j += 6) {
8902
+ for (let j2 = 0; j2 < nums.length; j2 += 6) {
8841
8903
  commands.push([
8842
8904
  cmd,
8843
- nums[j],
8844
- nums[j + 1],
8845
- nums[j + 2],
8846
- nums[j + 3],
8847
- nums[j + 4],
8848
- nums[j + 5]
8905
+ nums[j2],
8906
+ nums[j2 + 1],
8907
+ nums[j2 + 2],
8908
+ nums[j2 + 3],
8909
+ nums[j2 + 4],
8910
+ nums[j2 + 5]
8849
8911
  ]);
8850
8912
  }
8851
8913
  } else if (cmd === "S" || cmd === "Q") {
8852
- for (let j = 0; j < nums.length; j += 4) {
8853
- commands.push([cmd, nums[j], nums[j + 1], nums[j + 2], nums[j + 3]]);
8914
+ for (let j2 = 0; j2 < nums.length; j2 += 4) {
8915
+ commands.push([cmd, nums[j2], nums[j2 + 1], nums[j2 + 2], nums[j2 + 3]]);
8854
8916
  }
8855
8917
  } else if (cmd === "A") {
8856
- for (let j = 0; j < nums.length; j += 7) {
8918
+ for (let j2 = 0; j2 < nums.length; j2 += 7) {
8857
8919
  commands.push([
8858
8920
  cmd,
8859
- nums[j],
8860
- nums[j + 1],
8861
- nums[j + 2],
8862
- nums[j + 3],
8863
- nums[j + 4],
8864
- nums[j + 5],
8865
- nums[j + 6]
8921
+ nums[j2],
8922
+ nums[j2 + 1],
8923
+ nums[j2 + 2],
8924
+ nums[j2 + 3],
8925
+ nums[j2 + 4],
8926
+ nums[j2 + 5],
8927
+ nums[j2 + 6]
8866
8928
  ]);
8867
8929
  }
8868
8930
  }
@@ -8982,11 +9044,11 @@ var __async = (__this, __arguments, generator) => {
8982
9044
  return false;
8983
9045
  }
8984
9046
  function arcToBezier(pos, val) {
8985
- var rx = Math.abs(val[1]), ry = Math.abs(val[2]), xAxisRotation = val[3] % 360, largeArcFlag = val[4], sweepFlag = val[5], x = val[6], y = val[7], A2 = new Point(pos[0], pos[1]), B = new Point(x, y), primedCoord, lambda, mat, k, c, cSquare, t2, O, OA, OB, tetaStart, tetaEnd, deltaTeta, nbSectors, f, arcSegPoints, angle, sinAngle, cosAngle, pt, i2, il, retVal = [], x1, y1, x2, y2;
8986
- if (rx === 0 || ry === 0 || A2.x === B.x && A2.y === B.y) {
8987
- return [["C", A2.x, A2.y, B.x, B.y, B.x, B.y]];
9047
+ var rx = Math.abs(val[1]), ry = Math.abs(val[2]), xAxisRotation = val[3] % 360, largeArcFlag = val[4], sweepFlag = val[5], x = val[6], y = val[7], A = new Point(pos[0], pos[1]), B = new Point(x, y), primedCoord, lambda, mat, k, c, cSquare, t2, O, OA, OB, tetaStart, tetaEnd, deltaTeta, nbSectors, f, arcSegPoints, angle, sinAngle, cosAngle, pt, i2, il, retVal = [], x1, y1, x2, y2;
9048
+ if (rx === 0 || ry === 0 || A.x === B.x && A.y === B.y) {
9049
+ return [["C", A.x, A.y, B.x, B.y, B.x, B.y]];
8988
9050
  }
8989
- primedCoord = new Point((A2.x - B.x) / 2, (A2.y - B.y) / 2).transform(
9051
+ primedCoord = new Point((A.x - B.x) / 2, (A.y - B.y) / 2).transform(
8990
9052
  // Start with the identity matrix (no args → Matrix defaults a=d=1, others 0).
8991
9053
  // Passing all-zero args here would produce a degenerate zero matrix, since
8992
9054
  // `0 ?? 1` is `0`, not `1` — every subsequent transform then yields (0,0)
@@ -9002,9 +9064,9 @@ var __async = (__this, __arguments, generator) => {
9002
9064
  }
9003
9065
  mat = /** @type {any} */
9004
9066
  new Matrix().rotate(xAxisRotation).scale(1 / rx, 1 / ry).rotate(-xAxisRotation);
9005
- A2 = A2.transform(mat);
9067
+ A = A.transform(mat);
9006
9068
  B = B.transform(mat);
9007
- k = [B.x - A2.x, B.y - A2.y];
9069
+ k = [B.x - A.x, B.y - A.y];
9008
9070
  cSquare = k[0] * k[0] + k[1] * k[1];
9009
9071
  c = Math.sqrt(cSquare);
9010
9072
  k[0] /= c;
@@ -9013,8 +9075,8 @@ var __async = (__this, __arguments, generator) => {
9013
9075
  if (largeArcFlag === sweepFlag) {
9014
9076
  t2 *= -1;
9015
9077
  }
9016
- O = new Point((B.x + A2.x) / 2 + t2 * -k[1], (B.y + A2.y) / 2 + t2 * k[0]);
9017
- OA = new Point(A2.x - O.x, A2.y - O.y);
9078
+ O = new Point((B.x + A.x) / 2 + t2 * -k[1], (B.y + A.y) / 2 + t2 * k[0]);
9079
+ OA = new Point(A.x - O.x, A.y - O.y);
9018
9080
  OB = new Point(B.x - O.x, B.y - O.y);
9019
9081
  tetaStart = Math.acos(OA.x / Math.sqrt(OA.x * OA.x + OA.y * OA.y));
9020
9082
  if (OA.y < 0) tetaStart *= -1;
@@ -9804,7 +9866,7 @@ var __async = (__this, __arguments, generator) => {
9804
9866
  const {
9805
9867
  el,
9806
9868
  realIndex,
9807
- j,
9869
+ j: j2,
9808
9870
  fill,
9809
9871
  pathFrom,
9810
9872
  pathTo,
@@ -9825,7 +9887,7 @@ var __async = (__this, __arguments, generator) => {
9825
9887
  me.morphSVG(
9826
9888
  el,
9827
9889
  realIndex,
9828
- j,
9890
+ j2,
9829
9891
  w.config.chart.type === "line" && !w.globals.comboCharts ? "stroke" : fill,
9830
9892
  pathFrom,
9831
9893
  pathTo,
@@ -9901,7 +9963,7 @@ var __async = (__this, __arguments, generator) => {
9901
9963
  * @param {any} el - SVG.js path element
9902
9964
  * @param {{realIndex: number, j?: number, isFill: boolean, isLast: boolean, speed: number, delay: number, mask?: {type: 'rect'|'radial', cx?: number, cy?: number, r?: number}}} params
9903
9965
  */
9904
- animateDraw(el, { realIndex, j, isFill, isLast, speed, delay, mask: maskShape }) {
9966
+ animateDraw(el, { realIndex, j: j2, isFill, isLast, speed, delay, mask: maskShape }) {
9905
9967
  const w = this.w;
9906
9968
  const me = this;
9907
9969
  const finalize = () => {
@@ -9922,7 +9984,7 @@ var __async = (__this, __arguments, generator) => {
9922
9984
  const radialCx = maskShape && maskShape.cx || 0;
9923
9985
  const radialCy = maskShape && maskShape.cy || 0;
9924
9986
  const targetRadius = (maskShape && maskShape.r || w.layout.gridWidth / 2) + pad;
9925
- const maskId = `apexDrawMask${w.globals.cuid}-${realIndex}-${j != null ? j : 0}-${isFill ? "f" : "s"}`;
9987
+ const maskId = `apexDrawMask${w.globals.cuid}-${realIndex}-${j2 != null ? j2 : 0}-${isFill ? "f" : "s"}`;
9926
9988
  const mask = BrowserAPIs.createElementNS(SVGNS, "mask");
9927
9989
  mask.setAttribute("id", maskId);
9928
9990
  mask.setAttribute("maskUnits", "userSpaceOnUse");
@@ -10034,7 +10096,7 @@ var __async = (__this, __arguments, generator) => {
10034
10096
  * pathTo (extra anchors sitting exactly on the final geometry) and snap to
10035
10097
  * the clean pathTo at the end.
10036
10098
  */
10037
- morphSVG(el, realIndex, j, fill, pathFrom, pathTo, speed, delay, scrollMorph, pathToInterp) {
10099
+ morphSVG(el, realIndex, j2, fill, pathFrom, pathTo, speed, delay, scrollMorph, pathToInterp) {
10038
10100
  var _a, _b;
10039
10101
  const w = this.w;
10040
10102
  if (!pathFrom) {
@@ -10082,9 +10144,9 @@ var __async = (__this, __arguments, generator) => {
10082
10144
  morphAlgo,
10083
10145
  pathToInterp ? pathTo : void 0
10084
10146
  ).after(() => {
10085
- if (Utils$1.isNumber(j)) {
10147
+ if (Utils$1.isNumber(j2)) {
10086
10148
  const maxSeries = w.seriesData.series[w.globals.maxValsInArrayIndex];
10087
- if (maxSeries && j === maxSeries.length - 2 && w.globals.shouldAnimate) {
10149
+ if (maxSeries && j2 === maxSeries.length - 2 && w.globals.shouldAnimate) {
10088
10150
  this.animationCompleted(el);
10089
10151
  }
10090
10152
  } else if (fill !== "none" && w.globals.shouldAnimate) {
@@ -10657,7 +10719,7 @@ var __async = (__this, __arguments, generator) => {
10657
10719
  * @return {any} svg.js path object
10658
10720
  **/
10659
10721
  renderPaths({
10660
- j,
10722
+ j: j2,
10661
10723
  realIndex,
10662
10724
  pathFrom,
10663
10725
  pathTo,
@@ -10752,7 +10814,7 @@ var __async = (__this, __arguments, generator) => {
10752
10814
  });
10753
10815
  const defaultAnimateOpts = {
10754
10816
  el,
10755
- j,
10817
+ j: j2,
10756
10818
  realIndex,
10757
10819
  pathFrom,
10758
10820
  pathTo,
@@ -10770,7 +10832,7 @@ var __async = (__this, __arguments, generator) => {
10770
10832
  const isLast = w.globals.comboCharts ? true : realIndex === seriesCount - 1;
10771
10833
  anim.animateDraw(el, {
10772
10834
  realIndex,
10773
- j,
10835
+ j: j2,
10774
10836
  isFill,
10775
10837
  isLast,
10776
10838
  speed: drawSpeed,
@@ -11138,19 +11200,19 @@ var __async = (__this, __arguments, generator) => {
11138
11200
  const w = this.w;
11139
11201
  const filters = new Filters(this.w);
11140
11202
  const i2 = parseInt((_a = path.node.getAttribute("index")) != null ? _a : "", 10);
11141
- const j = parseInt((_b = path.node.getAttribute("j")) != null ? _b : "", 10);
11142
- if (isNaN(i2) || isNaN(j)) return;
11203
+ const j2 = parseInt((_b = path.node.getAttribute("j")) != null ? _b : "", 10);
11204
+ if (isNaN(i2) || isNaN(j2)) return;
11143
11205
  if (typeof w.config.chart.events.dataPointMouseEnter === "function") {
11144
11206
  w.config.chart.events.dataPointMouseEnter(e2, this.ctx, {
11145
11207
  seriesIndex: i2,
11146
- dataPointIndex: j,
11208
+ dataPointIndex: j2,
11147
11209
  w
11148
11210
  });
11149
11211
  }
11150
11212
  Graphics._fireEvent(w, "dataPointMouseEnter", [
11151
11213
  e2,
11152
11214
  this.ctx,
11153
- { seriesIndex: i2, dataPointIndex: j, w }
11215
+ { seriesIndex: i2, dataPointIndex: j2, w }
11154
11216
  ]);
11155
11217
  if (w.config.states.active.filter.type !== "none") {
11156
11218
  if (path.node.getAttribute("selected") === "true") {
@@ -11174,19 +11236,19 @@ var __async = (__this, __arguments, generator) => {
11174
11236
  const w = this.w;
11175
11237
  const filters = new Filters(this.w);
11176
11238
  const i2 = parseInt((_a = path.node.getAttribute("index")) != null ? _a : "", 10);
11177
- const j = parseInt((_b = path.node.getAttribute("j")) != null ? _b : "", 10);
11178
- if (isNaN(i2) || isNaN(j)) return;
11239
+ const j2 = parseInt((_b = path.node.getAttribute("j")) != null ? _b : "", 10);
11240
+ if (isNaN(i2) || isNaN(j2)) return;
11179
11241
  if (typeof w.config.chart.events.dataPointMouseLeave === "function") {
11180
11242
  w.config.chart.events.dataPointMouseLeave(e2, this.ctx, {
11181
11243
  seriesIndex: i2,
11182
- dataPointIndex: j,
11244
+ dataPointIndex: j2,
11183
11245
  w
11184
11246
  });
11185
11247
  }
11186
11248
  Graphics._fireEvent(w, "dataPointMouseLeave", [
11187
11249
  e2,
11188
11250
  this.ctx,
11189
- { seriesIndex: i2, dataPointIndex: j, w }
11251
+ { seriesIndex: i2, dataPointIndex: j2, w }
11190
11252
  ]);
11191
11253
  if (w.config.states.active.filter.type !== "none") {
11192
11254
  if (path.node.getAttribute("selected") === "true") {
@@ -11230,11 +11292,11 @@ var __async = (__this, __arguments, generator) => {
11230
11292
  * @param {any} path @param {any} filters @param {number} i @param {number} j
11231
11293
  * @returns {'true' | 'false'}
11232
11294
  */
11233
- _togglePointSelection(path, filters, i2, j) {
11295
+ _togglePointSelection(path, filters, i2, j2) {
11234
11296
  const w = this.w;
11235
11297
  if (path.node.getAttribute("selected") === "true") {
11236
11298
  path.node.setAttribute("selected", "false");
11237
- const index = w.interact.selectedDataPoints[i2].indexOf(j);
11299
+ const index = w.interact.selectedDataPoints[i2].indexOf(j2);
11238
11300
  if (index > -1) {
11239
11301
  w.interact.selectedDataPoints[i2].splice(index, 1);
11240
11302
  }
@@ -11247,7 +11309,7 @@ var __async = (__this, __arguments, generator) => {
11247
11309
  if (typeof w.interact.selectedDataPoints[i2] === "undefined") {
11248
11310
  w.interact.selectedDataPoints[i2] = [];
11249
11311
  }
11250
- w.interact.selectedDataPoints[i2].push(j);
11312
+ w.interact.selectedDataPoints[i2].push(j2);
11251
11313
  return "true";
11252
11314
  }
11253
11315
  /**
@@ -11291,19 +11353,19 @@ var __async = (__this, __arguments, generator) => {
11291
11353
  const w = this.w;
11292
11354
  const filters = new Filters(this.w);
11293
11355
  const i2 = parseInt((_a = path.node.getAttribute("index")) != null ? _a : "", 10);
11294
- const j = parseInt((_b = path.node.getAttribute("j")) != null ? _b : "", 10);
11295
- if (isNaN(i2) || isNaN(j)) return;
11356
+ const j2 = parseInt((_b = path.node.getAttribute("j")) != null ? _b : "", 10);
11357
+ if (isNaN(i2) || isNaN(j2)) return;
11296
11358
  const link = w.config.chart.link;
11297
11359
  const crossfilterClick = !!(link && (typeof link.dimension === "function" || link.enabled));
11298
11360
  if (!crossfilterClick) {
11299
- const selected = this._togglePointSelection(path, filters, i2, j);
11361
+ const selected = this._togglePointSelection(path, filters, i2, j2);
11300
11362
  this._applyPointSelectionFilter(path, filters, i2, selected);
11301
11363
  }
11302
11364
  if (typeof w.config.chart.events.dataPointSelection === "function") {
11303
11365
  w.config.chart.events.dataPointSelection(e2, this.ctx, {
11304
11366
  selectedDataPoints: w.interact.selectedDataPoints,
11305
11367
  seriesIndex: i2,
11306
- dataPointIndex: j,
11368
+ dataPointIndex: j2,
11307
11369
  w
11308
11370
  });
11309
11371
  }
@@ -11314,7 +11376,7 @@ var __async = (__this, __arguments, generator) => {
11314
11376
  {
11315
11377
  selectedDataPoints: w.interact.selectedDataPoints,
11316
11378
  seriesIndex: i2,
11317
- dataPointIndex: j,
11379
+ dataPointIndex: j2,
11318
11380
  w
11319
11381
  }
11320
11382
  ]);
@@ -12066,9 +12128,9 @@ var __async = (__this, __arguments, generator) => {
12066
12128
  /** @type {Record<string, any>} */
12067
12129
  (_e = w.config.series[i2]) == null ? void 0 : _e.data
12068
12130
  );
12069
- for (let j = 0; j < series[i2].length; j++) {
12070
- if (series[i2][j] === null) hasNull = true;
12071
- const d = Array.isArray(data) ? data[j] : null;
12131
+ for (let j2 = 0; j2 < series[i2].length; j2++) {
12132
+ if (series[i2][j2] === null) hasNull = true;
12133
+ const d = Array.isArray(data) ? data[j2] : null;
12072
12134
  if (d && (d.fillColor || d.strokeColor)) {
12073
12135
  perPointStyle = true;
12074
12136
  break;
@@ -12106,7 +12168,7 @@ var __async = (__this, __arguments, generator) => {
12106
12168
  plotChartMarkers({
12107
12169
  pointsPos,
12108
12170
  seriesIndex,
12109
- j,
12171
+ j: j2,
12110
12172
  pSize,
12111
12173
  alwaysDrawMarker = false,
12112
12174
  isVirtualPoint = false
@@ -12121,13 +12183,13 @@ var __async = (__this, __arguments, generator) => {
12121
12183
  if (Array.isArray(p.x)) {
12122
12184
  for (let q = 0; q < p.x.length; q++) {
12123
12185
  let markerElement;
12124
- let dataPointIndex = j;
12186
+ let dataPointIndex = j2;
12125
12187
  let invalidMarker = !Utils$1.isNumber(p.y[q]);
12126
- if (w.globals.markers.largestSize === 0 && w.globals.hasNullValues && w.seriesData.series[i2][j + 1] !== null && !isVirtualPoint) {
12188
+ if (w.globals.markers.largestSize === 0 && w.globals.hasNullValues && w.seriesData.series[i2][j2 + 1] !== null && !isVirtualPoint) {
12127
12189
  invalidMarker = true;
12128
12190
  }
12129
- if (j === 1 && q === 0) dataPointIndex = 0;
12130
- if (j === 1 && q === 1) dataPointIndex = 1;
12191
+ if (j2 === 1 && q === 0) dataPointIndex = 0;
12192
+ if (j2 === 1 && q === 1) dataPointIndex = 1;
12131
12193
  let markerClasses = "apexcharts-marker";
12132
12194
  if (Markers.markersAreInert(w)) {
12133
12195
  markerClasses += " no-pointer-events";
@@ -12432,7 +12494,7 @@ var __async = (__this, __arguments, generator) => {
12432
12494
  * @param {number} j
12433
12495
  * @param {Record<string, any>} opts
12434
12496
  */
12435
- draw(elSeries, j, opts) {
12497
+ draw(elSeries, j2, opts) {
12436
12498
  const w = this.w;
12437
12499
  const graphics = this.graphics;
12438
12500
  const emit = seriesEmitter(this.ctx, graphics);
@@ -12457,10 +12519,10 @@ var __async = (__this, __arguments, generator) => {
12457
12519
  }
12458
12520
  if (Array.isArray(pointsPos.x)) {
12459
12521
  for (let q = 0; q < pointsPos.x.length; q++) {
12460
- let dataPointIndex = j + 1;
12522
+ let dataPointIndex = j2 + 1;
12461
12523
  let shouldDraw = true;
12462
- if (j === 0 && q === 0) dataPointIndex = 0;
12463
- if (j === 0 && q === 1) dataPointIndex = 1;
12524
+ if (j2 === 0 && q === 0) dataPointIndex = 0;
12525
+ if (j2 === 0 && q === 1) dataPointIndex = 1;
12464
12526
  let radius = w.globals.markers.size[realIndex];
12465
12527
  if (zRatio !== Infinity) {
12466
12528
  const bubble = w.config.plotOptions.bubble;
@@ -12488,7 +12550,7 @@ var __async = (__this, __arguments, generator) => {
12488
12550
  radius,
12489
12551
  realIndex,
12490
12552
  dataPointIndex,
12491
- j
12553
+ j2
12492
12554
  );
12493
12555
  elPointsWrap.add(point);
12494
12556
  if (emit.kind === "canvas") {
@@ -12539,7 +12601,7 @@ var __async = (__this, __arguments, generator) => {
12539
12601
  * @param {number} dataPointIndex
12540
12602
  * @param {number} j
12541
12603
  */
12542
- drawPoint(x, y, radius, realIndex, dataPointIndex, j) {
12604
+ drawPoint(x, y, radius, realIndex, dataPointIndex, j2) {
12543
12605
  var _a;
12544
12606
  const w = this.w;
12545
12607
  const i2 = realIndex;
@@ -12592,7 +12654,7 @@ var __async = (__this, __arguments, generator) => {
12592
12654
  dataPointIndex,
12593
12655
  color: markerConfig.pointFillColor,
12594
12656
  patternUnits: "objectBoundingBox",
12595
- value: w.seriesData.series[realIndex][j]
12657
+ value: w.seriesData.series[realIndex][j2]
12596
12658
  });
12597
12659
  if (ps.fillCacheable === void 0) {
12598
12660
  ps.fillCacheable = ps.canCacheConfig && fill.getFillType(realIndex) === "solid" && typeof markerConfig.pointFillColor === "string" && !!markerConfig.pointFillColor;
@@ -12746,13 +12808,13 @@ var __async = (__this, __arguments, generator) => {
12746
12808
  };
12747
12809
  }
12748
12810
  /** @param {{type: any, pos: any, i: any, j: any, isRangeStart: any, strokeWidth?: any}} opts */
12749
- drawDataLabel({ type, pos, i: i2, j, isRangeStart, strokeWidth = 2 }) {
12811
+ drawDataLabel({ type, pos, i: i2, j: j2, isRangeStart, strokeWidth = 2 }) {
12750
12812
  const w = this.w;
12751
12813
  const graphics = new Graphics(this.w);
12752
12814
  const dataLabelsConfig = w.config.dataLabels;
12753
12815
  let x = 0;
12754
12816
  let y = 0;
12755
- let dataPointIndex = j;
12817
+ let dataPointIndex = j2;
12756
12818
  let elDataLabelsWrap = null;
12757
12819
  const seriesCollapsed = w.globals.collapsedSeriesIndices.indexOf(i2) !== -1;
12758
12820
  if (seriesCollapsed || !dataLabelsConfig.enabled || !Array.isArray(pos.x)) {
@@ -12762,8 +12824,8 @@ var __async = (__this, __arguments, generator) => {
12762
12824
  class: "apexcharts-data-labels"
12763
12825
  });
12764
12826
  for (let q = 0; q < pos.x.length; q++) {
12765
- if (j === 1 && q === 0) dataPointIndex = 0;
12766
- if (j === 1 && q === 1) dataPointIndex = 1;
12827
+ if (j2 === 1 && q === 0) dataPointIndex = 0;
12828
+ if (j2 === 1 && q === 1) dataPointIndex = 1;
12767
12829
  x = pos.x[q] + resolveDataLabelOffset(dataLabelsConfig.offsetX, w, i2, dataPointIndex);
12768
12830
  y = pos.y[q] + resolveDataLabelOffset(dataLabelsConfig.offsetY, w, i2, dataPointIndex) + strokeWidth;
12769
12831
  if (!isNaN(x)) {
@@ -12835,7 +12897,7 @@ var __async = (__this, __arguments, generator) => {
12835
12897
  x,
12836
12898
  y,
12837
12899
  i: i2,
12838
- j,
12900
+ j: j2,
12839
12901
  text,
12840
12902
  textAnchor,
12841
12903
  fontSize,
@@ -12848,7 +12910,7 @@ var __async = (__this, __arguments, generator) => {
12848
12910
  // some callers (radar) reuse `j` for something other than the data point
12849
12911
  // index, so per-point offsets take these explicit indices when supplied
12850
12912
  seriesIndex = i2,
12851
- dataPointIndex = j
12913
+ dataPointIndex = j2
12852
12914
  } = opts;
12853
12915
  let dataLabelText = null;
12854
12916
  if (Array.isArray(w.config.dataLabels.enabledOnSeries)) {
@@ -12868,7 +12930,7 @@ var __async = (__this, __arguments, generator) => {
12868
12930
  y,
12869
12931
  text,
12870
12932
  i2,
12871
- j,
12933
+ j2,
12872
12934
  alwaysDrawDataLabel,
12873
12935
  parseInt(
12874
12936
  /** @type {any} */
@@ -12891,14 +12953,14 @@ var __async = (__this, __arguments, generator) => {
12891
12953
  }
12892
12954
  let dataLabelColor = w.globals.dataLabels.style.colors[i2];
12893
12955
  if ((w.config.chart.type === "bar" || w.config.chart.type === "rangeBar") && w.config.plotOptions.bar.distributed || w.config.dataLabels.distributed) {
12894
- dataLabelColor = w.globals.dataLabels.style.colors[j];
12956
+ dataLabelColor = w.globals.dataLabels.style.colors[j2];
12895
12957
  }
12896
12958
  if (typeof dataLabelColor === "function") {
12897
12959
  dataLabelColor = /** @type {any} */
12898
12960
  dataLabelColor({
12899
12961
  series: w.seriesData.series,
12900
12962
  seriesIndex: i2,
12901
- dataPointIndex: j,
12963
+ dataPointIndex: j2,
12902
12964
  w
12903
12965
  });
12904
12966
  }
@@ -12921,10 +12983,10 @@ var __async = (__this, __arguments, generator) => {
12921
12983
  let offX = resolvedOffX;
12922
12984
  const offY = resolvedOffY;
12923
12985
  if (w.globals.isSlopeChart) {
12924
- if (j !== 0) {
12986
+ if (j2 !== 0) {
12925
12987
  offX = resolvedOffX * -2 + 5;
12926
12988
  }
12927
- if (j !== 0 && j !== /** @type {Record<string,any>} */
12989
+ if (j2 !== 0 && j2 !== /** @type {Record<string,any>} */
12928
12990
  w.config.series[i2].data.length - 1) {
12929
12991
  offX = 0;
12930
12992
  }
@@ -12960,7 +13022,7 @@ var __async = (__this, __arguments, generator) => {
12960
13022
  if (typeof w.globals.lastDrawnDataLabelsIndexes[i2] === "undefined") {
12961
13023
  w.globals.lastDrawnDataLabelsIndexes[i2] = [];
12962
13024
  }
12963
- w.globals.lastDrawnDataLabelsIndexes[i2].push(j);
13025
+ w.globals.lastDrawnDataLabelsIndexes[i2].push(j2);
12964
13026
  }
12965
13027
  return dataLabelText;
12966
13028
  }
@@ -14867,14 +14929,14 @@ var __async = (__this, __arguments, generator) => {
14867
14929
  /** @type {Record<string,any>} */
14868
14930
  cnf.series[si].group === gn
14869
14931
  ) {
14870
- for (let j = 0; j < this.w.seriesData.series[si].length; j++) {
14871
- const val = this.w.seriesData.series[si][j];
14932
+ for (let j2 = 0; j2 < this.w.seriesData.series[si].length; j2++) {
14933
+ const val = this.w.seriesData.series[si][j2];
14872
14934
  if (val >= 0) {
14873
- posSeries[gni][j] += val;
14935
+ posSeries[gni][j2] += val;
14874
14936
  } else {
14875
- negSeries[gni][j] += val;
14937
+ negSeries[gni][j2] += val;
14876
14938
  }
14877
- sumSeries[gni][j] += val;
14939
+ sumSeries[gni][j2] += val;
14878
14940
  lowestY = Math.min(lowestY, val);
14879
14941
  highestY = Math.max(highestY, val);
14880
14942
  }
@@ -15201,8 +15263,8 @@ var __async = (__this, __arguments, generator) => {
15201
15263
  } else {
15202
15264
  let yDec = gl.yValueDecimal;
15203
15265
  let hasNulls = false;
15204
- for (let j = firstXIndex; j <= jEnd; j++) {
15205
- const val = arr[j];
15266
+ for (let j2 = firstXIndex; j2 <= jEnd; j2++) {
15267
+ const val = arr[j2];
15206
15268
  if (val !== null && typeof val === "number" && val === val && val !== Infinity && val !== -Infinity) {
15207
15269
  if (val > maxY) maxY = val;
15208
15270
  if (val < lowestY) lowestY = val;
@@ -15241,58 +15303,58 @@ var __async = (__this, __arguments, generator) => {
15241
15303
  }
15242
15304
  continue;
15243
15305
  }
15244
- for (let j = firstXIndex; j <= lastXIndex && j < this.w.seriesData.series[i2].length; j++) {
15245
- let val = series[i2][j];
15306
+ for (let j2 = firstXIndex; j2 <= lastXIndex && j2 < this.w.seriesData.series[i2].length; j2++) {
15307
+ let val = series[i2][j2];
15246
15308
  if (val !== null && Utils$1.isNumber(val)) {
15247
- if (typeof ((_b = seriesMax[i2]) == null ? void 0 : _b[j]) !== "undefined") {
15248
- maxY = Math.max(maxY, seriesMax[i2][j]);
15249
- lowestY = Math.min(lowestY, seriesMax[i2][j]);
15309
+ if (typeof ((_b = seriesMax[i2]) == null ? void 0 : _b[j2]) !== "undefined") {
15310
+ maxY = Math.max(maxY, seriesMax[i2][j2]);
15311
+ lowestY = Math.min(lowestY, seriesMax[i2][j2]);
15250
15312
  }
15251
- if (typeof ((_c = seriesMin[i2]) == null ? void 0 : _c[j]) !== "undefined") {
15252
- lowestY = Math.min(lowestY, seriesMin[i2][j]);
15253
- highestY = Math.max(highestY, seriesMin[i2][j]);
15313
+ if (typeof ((_c = seriesMin[i2]) == null ? void 0 : _c[j2]) !== "undefined") {
15314
+ lowestY = Math.min(lowestY, seriesMin[i2][j2]);
15315
+ highestY = Math.max(highestY, seriesMin[i2][j2]);
15254
15316
  }
15255
15317
  switch (seriesType) {
15256
15318
  case "candlestick":
15257
15319
  {
15258
- if (typeof this.w.candleData.seriesCandleC[i2][j] !== "undefined") {
15259
- maxY = Math.max(maxY, this.w.candleData.seriesCandleH[i2][j]);
15320
+ if (typeof this.w.candleData.seriesCandleC[i2][j2] !== "undefined") {
15321
+ maxY = Math.max(maxY, this.w.candleData.seriesCandleH[i2][j2]);
15260
15322
  lowestY = Math.min(
15261
15323
  lowestY,
15262
- this.w.candleData.seriesCandleL[i2][j]
15324
+ this.w.candleData.seriesCandleL[i2][j2]
15263
15325
  );
15264
15326
  }
15265
15327
  }
15266
15328
  break;
15267
15329
  case "boxPlot":
15268
15330
  {
15269
- if (typeof this.w.candleData.seriesCandleC[i2][j] !== "undefined") {
15270
- maxY = Math.max(maxY, this.w.candleData.seriesCandleC[i2][j]);
15331
+ if (typeof this.w.candleData.seriesCandleC[i2][j2] !== "undefined") {
15332
+ maxY = Math.max(maxY, this.w.candleData.seriesCandleC[i2][j2]);
15271
15333
  lowestY = Math.min(
15272
15334
  lowestY,
15273
- this.w.candleData.seriesCandleO[i2][j]
15335
+ this.w.candleData.seriesCandleO[i2][j2]
15274
15336
  );
15275
15337
  }
15276
15338
  }
15277
15339
  break;
15278
15340
  case "violin":
15279
15341
  {
15280
- if (typeof ((_d = this.w.violinData.seriesViolinMax[i2]) == null ? void 0 : _d[j]) !== "undefined") {
15281
- maxY = Math.max(maxY, this.w.violinData.seriesViolinMax[i2][j]);
15342
+ if (typeof ((_d = this.w.violinData.seriesViolinMax[i2]) == null ? void 0 : _d[j2]) !== "undefined") {
15343
+ maxY = Math.max(maxY, this.w.violinData.seriesViolinMax[i2][j2]);
15282
15344
  lowestY = Math.min(
15283
15345
  lowestY,
15284
- this.w.violinData.seriesViolinMin[i2][j]
15346
+ this.w.violinData.seriesViolinMin[i2][j2]
15285
15347
  );
15286
15348
  }
15287
15349
  }
15288
15350
  break;
15289
15351
  }
15290
15352
  if (seriesType && seriesType !== "candlestick" && seriesType !== "boxPlot" && seriesType !== "violin" && seriesType !== "rangeArea" && seriesType !== "rangeBar") {
15291
- maxY = Math.max(maxY, this.w.seriesData.series[i2][j]);
15292
- lowestY = Math.min(lowestY, this.w.seriesData.series[i2][j]);
15353
+ maxY = Math.max(maxY, this.w.seriesData.series[i2][j2]);
15354
+ lowestY = Math.min(lowestY, this.w.seriesData.series[i2][j2]);
15293
15355
  }
15294
- if (this.w.seriesData.seriesGoals[i2] && this.w.seriesData.seriesGoals[i2][j] && Array.isArray(this.w.seriesData.seriesGoals[i2][j])) {
15295
- this.w.seriesData.seriesGoals[i2][j].forEach(
15356
+ if (this.w.seriesData.seriesGoals[i2] && this.w.seriesData.seriesGoals[i2][j2] && Array.isArray(this.w.seriesData.seriesGoals[i2][j2])) {
15357
+ this.w.seriesData.seriesGoals[i2][j2].forEach(
15296
15358
  (g) => {
15297
15359
  maxY = Math.max(maxY, g.value);
15298
15360
  lowestY = Math.min(lowestY, g.value);
@@ -15300,7 +15362,7 @@ var __async = (__this, __arguments, generator) => {
15300
15362
  );
15301
15363
  }
15302
15364
  if (this.w.config.chart.type === "boxPlot" || seriesType === "boxPlot") {
15303
- const boxPts = (_f = (_e = this.w.candleData.seriesBoxPoints) == null ? void 0 : _e[i2]) == null ? void 0 : _f[j];
15365
+ const boxPts = (_f = (_e = this.w.candleData.seriesBoxPoints) == null ? void 0 : _e[i2]) == null ? void 0 : _f[j2];
15304
15366
  if (boxPts) {
15305
15367
  for (let p = 0; p < boxPts.length; p++) {
15306
15368
  const pv = boxPts[p];
@@ -15319,8 +15381,8 @@ var __async = (__this, __arguments, generator) => {
15319
15381
  val.toString().split(".")[1].length
15320
15382
  );
15321
15383
  }
15322
- if (minY > ((_g = seriesMin[i2]) == null ? void 0 : _g[j]) && ((_h = seriesMin[i2]) == null ? void 0 : _h[j]) < 0) {
15323
- minY = seriesMin[i2][j];
15384
+ if (minY > ((_g = seriesMin[i2]) == null ? void 0 : _g[j2]) && ((_h = seriesMin[i2]) == null ? void 0 : _h[j2]) < 0) {
15385
+ minY = seriesMin[i2][j2];
15324
15386
  }
15325
15387
  } else {
15326
15388
  gl.hasNullValues = true;
@@ -15501,8 +15563,8 @@ var __async = (__this, __arguments, generator) => {
15501
15563
  if (pe.minX < minX) minX = pe.minX;
15502
15564
  continue;
15503
15565
  }
15504
- for (let j = 0; j < lbls.length; j++) {
15505
- const v = lbls[j];
15566
+ for (let j2 = 0; j2 < lbls.length; j2++) {
15567
+ const v = lbls[j2];
15506
15568
  if (v !== null && typeof v === "number" && v === v) {
15507
15569
  if (v > maxX) maxX = v;
15508
15570
  if (v < minX) minX = v;
@@ -15531,7 +15593,17 @@ var __async = (__this, __arguments, generator) => {
15531
15593
  let ticks = 10;
15532
15594
  if (cnf.xaxis.tickAmount === void 0) {
15533
15595
  ticks = Math.round(gl.svgWidth / 150);
15534
- if (cnf.xaxis.type === "numeric" && gl.dataPoints < 30) {
15596
+ const inferredNumericX = this.w.axisFlags.isXNumeric && this.w.axisFlags.dataFormatXNumeric && cnf.xaxis.type !== "datetime" && !cnf.xaxis.convertedCatToNumeric && !gl.isBarHorizontal;
15597
+ const fontSize = parseFloat(cnf.xaxis.labels.style.fontSize) || 12;
15598
+ const widestLabelLength = this.w.labelData.labels.reduce(
15599
+ (widest, seriesLabels) => Array.isArray(seriesLabels) ? seriesLabels.reduce(
15600
+ (seriesWidest, label) => Math.max(seriesWidest, String(label).length),
15601
+ widest
15602
+ ) : widest,
15603
+ 0
15604
+ );
15605
+ const allPointLabelsFit = gl.dataPoints * widestLabelLength * fontSize * 0.6 <= gl.svgWidth;
15606
+ if ((cnf.xaxis.type === "numeric" || inferredNumericX && allPointLabelsFit) && gl.dataPoints < 30) {
15535
15607
  ticks = gl.dataPoints - 1;
15536
15608
  }
15537
15609
  if (ticks > gl.dataPoints && gl.dataPoints !== 0) {
@@ -15615,10 +15687,10 @@ var __async = (__this, __arguments, generator) => {
15615
15687
  if (!this.w.axisFlags.isDataXYZ) return;
15616
15688
  for (let i2 = 0; i2 < this.w.seriesData.series.length; i2++) {
15617
15689
  if (typeof this.w.seriesData.seriesZ[i2] !== "undefined") {
15618
- for (let j = 0; j < this.w.seriesData.seriesZ[i2].length; j++) {
15619
- if (this.w.seriesData.seriesZ[i2][j] !== null && Utils$1.isNumber(this.w.seriesData.seriesZ[i2][j])) {
15620
- gl.maxZ = Math.max(gl.maxZ, this.w.seriesData.seriesZ[i2][j]);
15621
- gl.minZ = Math.min(gl.minZ, this.w.seriesData.seriesZ[i2][j]);
15690
+ for (let j2 = 0; j2 < this.w.seriesData.seriesZ[i2].length; j2++) {
15691
+ if (this.w.seriesData.seriesZ[i2][j2] !== null && Utils$1.isNumber(this.w.seriesData.seriesZ[i2][j2])) {
15692
+ gl.maxZ = Math.max(gl.maxZ, this.w.seriesData.seriesZ[i2][j2]);
15693
+ gl.minZ = Math.min(gl.minZ, this.w.seriesData.seriesZ[i2][j2]);
15622
15694
  }
15623
15695
  }
15624
15696
  }
@@ -15680,8 +15752,8 @@ var __async = (__this, __arguments, generator) => {
15680
15752
  }
15681
15753
  let presorted = true;
15682
15754
  let minDiff = gl.minXDiff;
15683
- for (let j = 1; j < sX.length; j++) {
15684
- const d = sX[j] - sX[j - 1];
15755
+ for (let j2 = 1; j2 < sX.length; j2++) {
15756
+ const d = sX[j2] - sX[j2 - 1];
15685
15757
  if (d > 0) {
15686
15758
  if (d < minDiff) minDiff = d;
15687
15759
  } else if (d < 0) {
@@ -15698,9 +15770,9 @@ var __async = (__this, __arguments, generator) => {
15698
15770
  }
15699
15771
  const seriesX = sX.slice();
15700
15772
  seriesX.sort((a2, b) => a2 - b);
15701
- seriesX.forEach((s2, j) => {
15702
- if (j > 0) {
15703
- const xDiff = s2 - seriesX[j - 1];
15773
+ seriesX.forEach((s2, j2) => {
15774
+ if (j2 > 0) {
15775
+ const xDiff = s2 - seriesX[j2 - 1];
15704
15776
  if (xDiff > 0) {
15705
15777
  gl.minXDiff = Math.min(xDiff, gl.minXDiff);
15706
15778
  }
@@ -15734,19 +15806,19 @@ var __async = (__this, __arguments, generator) => {
15734
15806
  const bounds = windowed ? this._autoScaleXBounds(i2) : null;
15735
15807
  const xs = this.w.seriesData.seriesX[i2];
15736
15808
  const hasX = !!(bounds && xs && xs.length);
15737
- for (let j = 0; j < this.w.seriesData.series[gl.maxValsInArrayIndex].length; j++) {
15738
- if (hasX && (xs[j] < bounds.lo || xs[j] > bounds.hi)) continue;
15739
- if (typeof stackedPoss[group][j] === "undefined") {
15740
- stackedPoss[group][j] = 0;
15741
- stackedNegs[group][j] = 0;
15809
+ for (let j2 = 0; j2 < this.w.seriesData.series[gl.maxValsInArrayIndex].length; j2++) {
15810
+ if (hasX && (xs[j2] < bounds.lo || xs[j2] > bounds.hi)) continue;
15811
+ if (typeof stackedPoss[group][j2] === "undefined") {
15812
+ stackedPoss[group][j2] = 0;
15813
+ stackedNegs[group][j2] = 0;
15742
15814
  }
15743
15815
  const stackSeries = this.w.config.chart.stacked && !gl.comboCharts || this.w.config.chart.stacked && gl.comboCharts && (!this.w.config.chart.stackOnlyBar || /** @type {Record<string,any>} */
15744
15816
  ((_b = (_a = this.w.config.series) == null ? void 0 : _a[i2]) == null ? void 0 : _b.type) === "bar" || /** @type {Record<string,any>} */
15745
15817
  ((_d = (_c = this.w.config.series) == null ? void 0 : _c[i2]) == null ? void 0 : _d.type) === "column");
15746
15818
  if (stackSeries) {
15747
- if (this.w.seriesData.series[i2][j] !== null && Utils$1.isNumber(this.w.seriesData.series[i2][j])) {
15748
- this.w.seriesData.series[i2][j] > 0 ? stackedPoss[group][j] += parseFloat(String(this.w.seriesData.series[i2][j])) + 1e-4 : stackedNegs[group][j] += parseFloat(
15749
- String(this.w.seriesData.series[i2][j])
15819
+ if (this.w.seriesData.series[i2][j2] !== null && Utils$1.isNumber(this.w.seriesData.series[i2][j2])) {
15820
+ this.w.seriesData.series[i2][j2] > 0 ? stackedPoss[group][j2] += parseFloat(String(this.w.seriesData.series[i2][j2])) + 1e-4 : stackedNegs[group][j2] += parseFloat(
15821
+ String(this.w.seriesData.series[i2][j2])
15750
15822
  );
15751
15823
  }
15752
15824
  }
@@ -16226,42 +16298,30 @@ var __async = (__this, __arguments, generator) => {
16226
16298
  }
16227
16299
  setYAxisTextAlignments() {
16228
16300
  const w = this.w;
16229
- const yaxis = Array.from(
16230
- w.dom.baseEl.getElementsByClassName("apexcharts-yaxis")
16231
- );
16232
- yaxis.forEach((y, index) => {
16233
- const yaxe = w.config.yaxis[index];
16301
+ w.config.yaxis.forEach((yaxe, index) => {
16234
16302
  if (yaxe && !yaxe.floating && yaxe.labels.align !== void 0) {
16235
16303
  const yAxisInner = w.dom.baseEl.querySelector(
16236
16304
  `.apexcharts-yaxis[rel='${index}'] .apexcharts-yaxis-texts-g`
16237
16305
  );
16306
+ if (!yAxisInner) return;
16238
16307
  const yAxisTexts = Array.from(
16239
16308
  w.dom.baseEl.querySelectorAll(
16240
16309
  `.apexcharts-yaxis[rel='${index}'] .apexcharts-yaxis-label`
16241
16310
  )
16242
16311
  );
16243
- const rect = (
16244
- /** @type {Element} */
16245
- yAxisInner.getBoundingClientRect()
16246
- );
16312
+ const rect = yAxisInner.getBoundingClientRect();
16247
16313
  yAxisTexts.forEach((label) => {
16248
16314
  label.setAttribute("text-anchor", yaxe.labels.align);
16249
16315
  });
16250
16316
  if (yaxe.labels.align === "left" && !yaxe.opposite) {
16251
- yAxisInner.setAttribute(
16252
- "transform",
16253
- `translate(-${rect.width}, 0)`
16254
- );
16317
+ yAxisInner.setAttribute("transform", `translate(-${rect.width}, 0)`);
16255
16318
  } else if (yaxe.labels.align === "center") {
16256
16319
  yAxisInner.setAttribute(
16257
16320
  "transform",
16258
16321
  `translate(${rect.width / 2 * (!yaxe.opposite ? -1 : 1)}, 0)`
16259
16322
  );
16260
16323
  } else if (yaxe.labels.align === "right" && yaxe.opposite) {
16261
- yAxisInner.setAttribute(
16262
- "transform",
16263
- `translate(${rect.width}, 0)`
16264
- );
16324
+ yAxisInner.setAttribute("transform", `translate(${rect.width}, 0)`);
16265
16325
  }
16266
16326
  }
16267
16327
  });
@@ -16699,15 +16759,15 @@ var __async = (__this, __arguments, generator) => {
16699
16759
  w.dom.baseEl.querySelectorAll(".apexcharts-marker").forEach((node) => {
16700
16760
  var _a2, _b2, _c2, _d, _e;
16701
16761
  const ri = parseInt((_a2 = node.getAttribute("index")) != null ? _a2 : "", 10);
16702
- const j = parseInt(
16762
+ const j2 = parseInt(
16703
16763
  (_c2 = (_b2 = node.getAttribute("j")) != null ? _b2 : node.getAttribute("rel")) != null ? _c2 : "",
16704
16764
  10
16705
16765
  );
16706
16766
  const r2 = parseFloat(
16707
16767
  (_e = (_d = node.getAttribute("r")) != null ? _d : node.getAttribute("default-marker-size")) != null ? _e : ""
16708
16768
  );
16709
- if (isFinite(ri) && isFinite(j) && isFinite(r2)) {
16710
- (rPixels[ri] = rPixels[ri] || [])[j] = r2;
16769
+ if (isFinite(ri) && isFinite(j2) && isFinite(r2)) {
16770
+ (rPixels[ri] = rPixels[ri] || [])[j2] = r2;
16711
16771
  }
16712
16772
  });
16713
16773
  }
@@ -16762,29 +16822,29 @@ var __async = (__this, __arguments, generator) => {
16762
16822
  if (largeThreshold > 0 && w.globals.dataPoints > largeThreshold) return false;
16763
16823
  return !!(Environment.isBrowser() && w.globals.dataChanged && w.globals.shouldAnimate);
16764
16824
  }
16765
- function datumKey(w, realIndex, j) {
16825
+ function datumKey(w, realIndex, j2) {
16766
16826
  var _a, _b, _c, _d;
16767
16827
  if ((_a = w.axisFlags) == null ? void 0 : _a.isXNumeric) {
16768
16828
  const sx = (_c = (_b = w.seriesData) == null ? void 0 : _b.seriesX) == null ? void 0 : _c[realIndex];
16769
- if (sx && sx.length && sx[j] != null) return "x:" + sx[j];
16829
+ if (sx && sx.length && sx[j2] != null) return "x:" + sx[j2];
16770
16830
  }
16771
- const lbl = (_d = w.globals.labels) == null ? void 0 : _d[j];
16831
+ const lbl = (_d = w.globals.labels) == null ? void 0 : _d[j2];
16772
16832
  if (lbl != null && String(lbl) !== "") {
16773
16833
  return "c:" + (Array.isArray(lbl) ? lbl.join(" ") : String(lbl));
16774
16834
  }
16775
- return "j:" + j;
16835
+ return "j:" + j2;
16776
16836
  }
16777
- function frameDatumKey(frame, realIndex, j) {
16837
+ function frameDatumKey(frame, realIndex, j2) {
16778
16838
  var _a, _b;
16779
16839
  if (frame.isXNumeric) {
16780
16840
  const sx = (_a = frame.seriesX) == null ? void 0 : _a[realIndex];
16781
- if (sx && sx.length && sx[j] != null) return "x:" + sx[j];
16841
+ if (sx && sx.length && sx[j2] != null) return "x:" + sx[j2];
16782
16842
  }
16783
- const lbl = (_b = frame.labels) == null ? void 0 : _b[j];
16843
+ const lbl = (_b = frame.labels) == null ? void 0 : _b[j2];
16784
16844
  if (lbl != null && String(lbl) !== "") {
16785
16845
  return "c:" + (Array.isArray(lbl) ? lbl.join(" ") : String(lbl));
16786
16846
  }
16787
- return "j:" + j;
16847
+ return "j:" + j2;
16788
16848
  }
16789
16849
  function joinKeys(oldKeys, newKeys) {
16790
16850
  const oldIndex = /* @__PURE__ */ new Map();
@@ -16830,9 +16890,9 @@ var __async = (__this, __arguments, generator) => {
16830
16890
  if (!Array.isArray(oldY) || !Array.isArray(newY)) return null;
16831
16891
  if (!oldY.length || !newY.length) return null;
16832
16892
  const oldKeys = uniquifyKeys(
16833
- oldY.map((_, j) => frameDatumKey(frame, realIndex, j))
16893
+ oldY.map((_, j2) => frameDatumKey(frame, realIndex, j2))
16834
16894
  );
16835
- const newKeys = uniquifyKeys(newY.map((_, j) => datumKey(w, realIndex, j)));
16895
+ const newKeys = uniquifyKeys(newY.map((_, j2) => datumKey(w, realIndex, j2)));
16836
16896
  const join = joinKeys(oldKeys, newKeys);
16837
16897
  if (!join.ordered && !allowReorder) return null;
16838
16898
  if (!join.changed && !includeIdentity) return null;
@@ -17374,7 +17434,7 @@ var __async = (__this, __arguments, generator) => {
17374
17434
  }
17375
17435
  if (countUp && old) {
17376
17436
  const realIndex = parseInt(key, 10);
17377
- const j = parseInt(group.getAttribute("data:dlJ") || "", 10);
17437
+ const j2 = parseInt(group.getAttribute("data:dlJ") || "", 10);
17378
17438
  countUpText(w, {
17379
17439
  el: textEl,
17380
17440
  from: old.val,
@@ -17385,7 +17445,7 @@ var __async = (__this, __arguments, generator) => {
17385
17445
  // of `w` on every frame. Same shape the bar formatter gets.
17386
17446
  fmtOpts: __spreadProps(__spreadValues({}, w), {
17387
17447
  seriesIndex: realIndex,
17388
- dataPointIndex: isFinite(j) ? j : 0,
17448
+ dataPointIndex: isFinite(j2) ? j2 : 0,
17389
17449
  w
17390
17450
  }),
17391
17451
  duration,
@@ -17672,20 +17732,20 @@ var __async = (__this, __arguments, generator) => {
17672
17732
  const nextRecords = [];
17673
17733
  const nextIndices = [];
17674
17734
  records.forEach((rec) => {
17675
- const j = rec && rec.name != null ? newNames.indexOf(rec.name) : rec.index;
17676
- if (j == null || j < 0 || j >= target.length) return;
17735
+ const j2 = rec && rec.name != null ? newNames.indexOf(rec.name) : rec.index;
17736
+ if (j2 == null || j2 < 0 || j2 >= target.length) return;
17677
17737
  const s2 = (
17678
17738
  /** @type {any} */
17679
- target[j]
17739
+ target[j2]
17680
17740
  );
17681
- rec.index = j;
17741
+ rec.index = j2;
17682
17742
  if (gl.axisCharts) {
17683
17743
  if (s2 && Array.isArray(s2.data) && s2.data.length) rec.data = s2.data.slice();
17684
17744
  } else {
17685
17745
  rec.data = s2;
17686
17746
  }
17687
17747
  nextRecords.push(rec);
17688
- nextIndices.push(j);
17748
+ nextIndices.push(j2);
17689
17749
  });
17690
17750
  return { records: nextRecords, indices: nextIndices };
17691
17751
  };
@@ -17953,14 +18013,14 @@ var __async = (__this, __arguments, generator) => {
17953
18013
  ),
17954
18014
  realIndex: seriesEls[i2].getAttribute("data:realIndex")
17955
18015
  };
17956
- for (let j = 0; j < paths.length; j++) {
17957
- if (paths[j].hasAttribute("pathTo")) {
17958
- const d = paths[j].getAttribute("pathTo");
18016
+ for (let j2 = 0; j2 < paths.length; j2++) {
18017
+ if (paths[j2].hasAttribute("pathTo")) {
18018
+ const d = paths[j2].getAttribute("pathTo");
17959
18019
  dArr.paths.push({
17960
18020
  d,
17961
- key: paths[j].getAttribute("data:pathKey"),
17962
- fill: paths[j].getAttribute("fill"),
17963
- flip: paths[j].classList.contains("apexcharts-flip-y") || paths[j].classList.contains("apexcharts-flip-x")
18021
+ key: paths[j2].getAttribute("data:pathKey"),
18022
+ fill: paths[j2].getAttribute("fill"),
18023
+ flip: paths[j2].classList.contains("apexcharts-flip-y") || paths[j2].classList.contains("apexcharts-flip-x")
17964
18024
  });
17965
18025
  }
17966
18026
  }
@@ -18071,7 +18131,7 @@ var __async = (__this, __arguments, generator) => {
18071
18131
  const w = this.w;
18072
18132
  for (let sl = 0; sl < series.length; sl++) {
18073
18133
  if (series[sl].length === 0) {
18074
- for (let j = 0; j < series[w.globals.maxValsInArrayIndex].length; j++) {
18134
+ for (let j2 = 0; j2 < series[w.globals.maxValsInArrayIndex].length; j2++) {
18075
18135
  series[sl].push(0);
18076
18136
  }
18077
18137
  }
@@ -19261,8 +19321,8 @@ var __async = (__this, __arguments, generator) => {
19261
19321
  if (!totals.length) return;
19262
19322
  const formatter = totalConfig.formatter || w.config.dataLabels.formatter;
19263
19323
  const labels = totals.map(
19264
- (val, j) => String(
19265
- formatter ? formatter(val, __spreadProps(__spreadValues({}, w), { seriesIndex: 0, dataPointIndex: j, w })) : val
19324
+ (val, j2) => String(
19325
+ formatter ? formatter(val, __spreadProps(__spreadValues({}, w), { seriesIndex: 0, dataPointIndex: j2, w })) : val
19266
19326
  )
19267
19327
  );
19268
19328
  const graphics = new Graphics(w);
@@ -20957,7 +21017,7 @@ var __async = (__this, __arguments, generator) => {
20957
21017
  if (opts.keepDatum) node._datum = d;
20958
21018
  if (isObj && Array.isArray(d.children) && d.children.length) {
20959
21019
  node.children = d.children.map(
20960
- (c, j) => toNode(w, c, j, null, node._key, seenIds, opts)
21020
+ (c, j2) => toNode(w, c, j2, null, node._key, seenIds, opts)
20961
21021
  );
20962
21022
  } else if (isObj && d.drilldown != null && opts.expandDrilldown !== false) {
20963
21023
  const visited = seenIds || /* @__PURE__ */ new Set();
@@ -20968,7 +21028,7 @@ var __async = (__this, __arguments, generator) => {
20968
21028
  nextSeen.add(d.drilldown);
20969
21029
  const palette = Array.isArray(dd.colors) ? dd.colors : null;
20970
21030
  node.children = dd.data.map(
20971
- (c, j) => toNode(w, c, j, palette, node._key, nextSeen, opts)
21031
+ (c, j2) => toNode(w, c, j2, palette, node._key, nextSeen, opts)
20972
21032
  );
20973
21033
  }
20974
21034
  }
@@ -20992,7 +21052,7 @@ var __async = (__this, __arguments, generator) => {
20992
21052
  _key: key,
20993
21053
  _seriesIndex: i2,
20994
21054
  children: data.map(
20995
- (d, j) => toNode(w, d, j, null, key, null, opts)
21055
+ (d, j2) => toNode(w, d, j2, null, key, null, opts)
20996
21056
  )
20997
21057
  };
20998
21058
  return root;
@@ -21016,8 +21076,8 @@ var __async = (__this, __arguments, generator) => {
21016
21076
  for (let i2 = 0; i2 < series.length; i2++) {
21017
21077
  const data = series[i2] && series[i2].data;
21018
21078
  if (!Array.isArray(data)) continue;
21019
- for (let j = 0; j < data.length; j++) {
21020
- const d = data[j];
21079
+ for (let j2 = 0; j2 < data.length; j2++) {
21080
+ const d = data[j2];
21021
21081
  if (!d || typeof d !== "object") continue;
21022
21082
  if (Array.isArray(d.children) && d.children.length) return true;
21023
21083
  if (countDrilldown && d.drilldown != null) return true;
@@ -21174,8 +21234,8 @@ var __async = (__this, __arguments, generator) => {
21174
21234
  let xSorted = true;
21175
21235
  let minXDiff = Infinity;
21176
21236
  let prevX = NaN;
21177
- for (let j = 0; j < n2; j++) {
21178
- const point = data[j];
21237
+ for (let j2 = 0; j2 < n2; j2++) {
21238
+ const point = data[j2];
21179
21239
  if (!Array.isArray(point) || point.length > 2) return false;
21180
21240
  const x = point[0];
21181
21241
  const y = point[1];
@@ -21223,8 +21283,8 @@ var __async = (__this, __arguments, generator) => {
21223
21283
  } else {
21224
21284
  return false;
21225
21285
  }
21226
- ys[j] = y;
21227
- xs[j] = x;
21286
+ ys[j2] = y;
21287
+ xs[j2] = x;
21228
21288
  }
21229
21289
  this.twoDSeries = ys;
21230
21290
  this.twoDSeriesX = xs;
@@ -21259,8 +21319,8 @@ var __async = (__this, __arguments, generator) => {
21259
21319
  if (!isBoxPlot && cnf.xaxis.type !== "datetime" && this._fast2DArrayParse(data, i2)) {
21260
21320
  return;
21261
21321
  }
21262
- for (let j = 0; j < data.length; j++) {
21263
- const point = data[j];
21322
+ for (let j2 = 0; j2 < data.length; j2++) {
21323
+ const point = data[j2];
21264
21324
  const x = point[0];
21265
21325
  const y = point[1];
21266
21326
  const z = point[2];
@@ -21300,8 +21360,8 @@ var __async = (__this, __arguments, generator) => {
21300
21360
  activeI = this.activeSeriesIndex;
21301
21361
  }
21302
21362
  const activeData = ser[activeI].data;
21303
- for (let j = 0; j < data.length; j++) {
21304
- const point = data[j];
21363
+ for (let j2 = 0; j2 < data.length; j2++) {
21364
+ const point = data[j2];
21305
21365
  if (typeof point.y !== "undefined") {
21306
21366
  const val = Array.isArray(point.y) ? Utils$1.parseNumber(point.y[point.y.length - 1]) : Utils$1.parseNumber(point.y);
21307
21367
  this.twoDSeries.push(val);
@@ -21319,8 +21379,8 @@ var __async = (__this, __arguments, generator) => {
21319
21379
  this.w.axisFlags.isDataXYZ = true;
21320
21380
  }
21321
21381
  }
21322
- for (let j = 0; j < activeData.length; j++) {
21323
- const point = activeData[j];
21382
+ for (let j2 = 0; j2 < activeData.length; j2++) {
21383
+ const point = activeData[j2];
21324
21384
  const x = point.x;
21325
21385
  const isXString = typeof x === "string";
21326
21386
  const isXArr = Array.isArray(x);
@@ -21427,12 +21487,12 @@ var __async = (__this, __arguments, generator) => {
21427
21487
  const data = ser[i2].data || [];
21428
21488
  const start = [];
21429
21489
  const end = [];
21430
- for (let j = 0; j < data.length; j++) {
21431
- const datum = data[j];
21490
+ for (let j2 = 0; j2 < data.length; j2++) {
21491
+ const datum = data[j2];
21432
21492
  let lo;
21433
21493
  let hi;
21434
21494
  if (typeof yExtent === "function") {
21435
- let ext = yExtent(datum, j);
21495
+ let ext = yExtent(datum, j2);
21436
21496
  if (!Array.isArray(ext)) ext = [ext];
21437
21497
  const nums = ext.map((v) => Utils$1.parseNumber(v)).filter((v) => v !== null && !isNaN(v));
21438
21498
  lo = nums.length ? Math.min(...nums) : null;
@@ -21499,8 +21559,8 @@ var __async = (__this, __arguments, generator) => {
21499
21559
  const minArr = [];
21500
21560
  const maxArr = [];
21501
21561
  const placeholders = [];
21502
- for (let j = 0; j < data.length; j++) {
21503
- const d = data[j];
21562
+ for (let j2 = 0; j2 < data.length; j2++) {
21563
+ const d = data[j2];
21504
21564
  const dens = (_c = (_b = (_a = d == null ? void 0 : d.y) == null ? void 0 : _a.density) != null ? _b : d == null ? void 0 : d[1]) != null ? _c : [];
21505
21565
  const pts = (_f = (_e = (_d = d == null ? void 0 : d.y) == null ? void 0 : _d.points) != null ? _e : d == null ? void 0 : d[2]) != null ? _f : [];
21506
21566
  const summary = this._parseViolinSummary((_h = (_g = d == null ? void 0 : d.y) == null ? void 0 : _g.summary) != null ? _h : d == null ? void 0 : d[3]);
@@ -21592,29 +21652,29 @@ var __async = (__this, __arguments, generator) => {
21592
21652
  }
21593
21653
  });
21594
21654
  if (format === "array") {
21595
- for (let j = 0; j < ser[i2].data.length; j++) {
21596
- if (Array.isArray(ser[i2].data[j])) {
21597
- rangeStart.push(ser[i2].data[j][1][0]);
21598
- rangeEnd.push(ser[i2].data[j][1][1]);
21655
+ for (let j2 = 0; j2 < ser[i2].data.length; j2++) {
21656
+ if (Array.isArray(ser[i2].data[j2])) {
21657
+ rangeStart.push(ser[i2].data[j2][1][0]);
21658
+ rangeEnd.push(ser[i2].data[j2][1][1]);
21599
21659
  } else {
21600
- rangeStart.push(ser[i2].data[j]);
21601
- rangeEnd.push(ser[i2].data[j]);
21660
+ rangeStart.push(ser[i2].data[j2]);
21661
+ rangeEnd.push(ser[i2].data[j2]);
21602
21662
  }
21603
21663
  }
21604
21664
  } else if (format === "xy") {
21605
- for (let j = 0; j < ser[i2].data.length; j++) {
21606
- const isDataPoint2D = Array.isArray(ser[i2].data[j].y);
21665
+ for (let j2 = 0; j2 < ser[i2].data.length; j2++) {
21666
+ const isDataPoint2D = Array.isArray(ser[i2].data[j2].y);
21607
21667
  const id = Utils$1.randomId();
21608
- const x = ser[i2].data[j].x;
21668
+ const x = ser[i2].data[j2].x;
21609
21669
  const y = {
21610
- y1: isDataPoint2D ? ser[i2].data[j].y[0] : ser[i2].data[j].y,
21611
- y2: isDataPoint2D ? ser[i2].data[j].y[1] : ser[i2].data[j].y,
21670
+ y1: isDataPoint2D ? ser[i2].data[j2].y[0] : ser[i2].data[j2].y,
21671
+ y2: isDataPoint2D ? ser[i2].data[j2].y[1] : ser[i2].data[j2].y,
21612
21672
  rangeName: id
21613
21673
  };
21614
21674
  const gl = this.w.globals;
21615
21675
  if (!gl.seriesRangeName) gl.seriesRangeName = {};
21616
21676
  if (!gl.seriesRangeName[i2]) gl.seriesRangeName[i2] = {};
21617
- gl.seriesRangeName[i2][j] = id;
21677
+ gl.seriesRangeName[i2][j2] = id;
21618
21678
  const keyObj = uniqueKeysMap.get(x);
21619
21679
  if (keyObj) {
21620
21680
  keyObj.y.push(y);
@@ -21657,8 +21717,8 @@ var __async = (__this, __arguments, generator) => {
21657
21717
  } else {
21658
21718
  getVals = (d) => Array.isArray(d.y) ? d.y : [];
21659
21719
  }
21660
- for (let j = 0; j < data.length; j++) {
21661
- const vals = getVals(data[j]);
21720
+ for (let j2 = 0; j2 < data.length; j2++) {
21721
+ const vals = getVals(data[j2]);
21662
21722
  if (vals && vals.length >= 2) {
21663
21723
  serO.push(vals[0]);
21664
21724
  serH.push(vals[1]);
@@ -21671,8 +21731,8 @@ var __async = (__this, __arguments, generator) => {
21671
21731
  serC.push(vals[3]);
21672
21732
  }
21673
21733
  }
21674
- const pts = data[j] && /** @type {any} */
21675
- data[j].points;
21734
+ const pts = data[j2] && /** @type {any} */
21735
+ data[j2].points;
21676
21736
  serPoints.push(Array.isArray(pts) ? pts : []);
21677
21737
  }
21678
21738
  return {
@@ -21720,18 +21780,18 @@ var __async = (__this, __arguments, generator) => {
21720
21780
  });
21721
21781
  this.w.labelData.seriesGroups = buckets;
21722
21782
  const handleDates = () => {
21723
- for (let j = 0; j < xlabels.length; j++) {
21724
- if (typeof xlabels[j] === "string") {
21725
- const isDate = dt.isValidDate(xlabels[j]);
21783
+ for (let j2 = 0; j2 < xlabels.length; j2++) {
21784
+ if (typeof xlabels[j2] === "string") {
21785
+ const isDate = dt.isValidDate(xlabels[j2]);
21726
21786
  if (isDate) {
21727
- this.twoDSeriesX.push(dt.parseDate(xlabels[j]));
21787
+ this.twoDSeriesX.push(dt.parseDate(xlabels[j2]));
21728
21788
  } else {
21729
21789
  throw new Error(
21730
21790
  "You have provided invalid Date format. Please provide a valid JavaScript Date"
21731
21791
  );
21732
21792
  }
21733
21793
  } else {
21734
- this.twoDSeriesX.push(xlabels[j]);
21794
+ this.twoDSeriesX.push(xlabels[j2]);
21735
21795
  }
21736
21796
  }
21737
21797
  };
@@ -22474,8 +22534,11 @@ var __async = (__this, __arguments, generator) => {
22474
22534
  // Segregate user provided data into appropriate vars
22475
22535
  /**
22476
22536
  * @param {any[]} ser
22537
+ * @param {boolean} [overwriteInitialSeries=true] false when the caller hands
22538
+ * back the series the chart already has (an internal re-render), so the
22539
+ * baseline resetSeries() restores must not move.
22477
22540
  */
22478
- parseData(ser) {
22541
+ parseData(ser, overwriteInitialSeries = true) {
22479
22542
  var _a, _b, _c, _d, _e, _f, _g;
22480
22543
  const w = this.w;
22481
22544
  const cnf = w.config;
@@ -22508,7 +22571,8 @@ var __async = (__this, __arguments, generator) => {
22508
22571
  ser = ser.map((s2) => __spreadValues({}, s2));
22509
22572
  }
22510
22573
  cnf.series = ser;
22511
- if (gl.dataReducerRawSeries && ((_g = cnf.chart.dataReducer) == null ? void 0 : _g.enabled)) {
22574
+ if (!overwriteInitialSeries) ;
22575
+ else if (gl.dataReducerRawSeries && ((_g = cnf.chart.dataReducer) == null ? void 0 : _g.enabled)) {
22512
22576
  const stash = gl.dataReducerRawSeries;
22513
22577
  gl.initialSeries = ser.map((s2, i2) => {
22514
22578
  var _a2, _b2, _c2;
@@ -22727,9 +22791,9 @@ var __async = (__this, __arguments, generator) => {
22727
22791
  let avgX = 0;
22728
22792
  let avgY = 0;
22729
22793
  const avgRangeLen = avgRangeEnd - avgRangeStart;
22730
- for (let j = avgRangeStart; j < avgRangeEnd; j++) {
22731
- avgX += getX(data[j]);
22732
- avgY += getY(data[j]);
22794
+ for (let j2 = avgRangeStart; j2 < avgRangeEnd; j2++) {
22795
+ avgX += getX(data[j2]);
22796
+ avgY += getY(data[j2]);
22733
22797
  }
22734
22798
  avgX /= avgRangeLen;
22735
22799
  avgY /= avgRangeLen;
@@ -22739,13 +22803,13 @@ var __async = (__this, __arguments, generator) => {
22739
22803
  const pointAY = getY(data[a2]);
22740
22804
  let maxArea = -1;
22741
22805
  let maxAreaIdx = rangeStart;
22742
- for (let j = rangeStart; j < rangeEnd; j++) {
22806
+ for (let j2 = rangeStart; j2 < rangeEnd; j2++) {
22743
22807
  const area = Math.abs(
22744
- (pointAX - avgX) * (getY(data[j]) - pointAY) - (pointAX - getX(data[j])) * (avgY - pointAY)
22808
+ (pointAX - avgX) * (getY(data[j2]) - pointAY) - (pointAX - getX(data[j2])) * (avgY - pointAY)
22745
22809
  ) * 0.5;
22746
22810
  if (area > maxArea) {
22747
22811
  maxArea = area;
22748
- maxAreaIdx = j;
22812
+ maxAreaIdx = j2;
22749
22813
  }
22750
22814
  }
22751
22815
  sampled.push(data[maxAreaIdx]);
@@ -22787,8 +22851,8 @@ var __async = (__this, __arguments, generator) => {
22787
22851
  let high = firstY[1];
22788
22852
  let low = firstY[2];
22789
22853
  let close = firstY[3];
22790
- for (let j = start + 1; j < end; j++) {
22791
- const y = getY(data[j]);
22854
+ for (let j2 = start + 1; j2 < end; j2++) {
22855
+ const y = getY(data[j2]);
22792
22856
  if (y[1] > high) high = y[1];
22793
22857
  if (y[2] < low) low = y[2];
22794
22858
  close = y[3];
@@ -22828,8 +22892,8 @@ var __async = (__this, __arguments, generator) => {
22828
22892
  if (end <= start) continue;
22829
22893
  let low = Infinity;
22830
22894
  let high = -Infinity;
22831
- for (let j = start; j < end; j++) {
22832
- const y = getY(data[j]);
22895
+ for (let j2 = start; j2 < end; j2++) {
22896
+ const y = getY(data[j2]);
22833
22897
  if (y == null) continue;
22834
22898
  for (let k = 0; k < 2; k++) {
22835
22899
  const v = y[k];
@@ -22948,7 +23012,9 @@ var __async = (__this, __arguments, generator) => {
22948
23012
  );
22949
23013
  initialConfig.series = !options2.series && prevInitialSeries ? prevInitialSeries : Utils$1.copySeriesShallow(w.config.series);
22950
23014
  w.globals.initialConfig = initialConfig;
22951
- w.globals.initialSeries = w.config.series;
23015
+ if (options2.series) {
23016
+ w.globals.initialSeries = w.config.series;
23017
+ }
22952
23018
  }
22953
23019
  if (options2.series && (w.globals.collapsedSeriesIndices.length > 0 || w.globals.ancillaryCollapsedSeriesIndices.length > 0)) {
22954
23020
  ch.series.reconcileCollapsedByName();
@@ -22997,14 +23063,20 @@ var __async = (__this, __arguments, generator) => {
22997
23063
  w.globals.streamgraphRawSeries = null;
22998
23064
  w.globals.treemapRawSeries = null;
22999
23065
  }
23066
+ const definedSeries = newSeries;
23067
+ let reconciledCollapses = false;
23000
23068
  if (w.globals.axisCharts && (w.globals.collapsedSeriesIndices.length > 0 || w.globals.ancillaryCollapsedSeriesIndices.length > 0)) {
23001
23069
  newSeries = newSeries.map(
23002
23070
  (s2) => s2 && typeof s2 === "object" ? __spreadValues({}, s2) : s2
23003
23071
  );
23004
23072
  this.ctx.series.reconcileCollapsedByName(newSeries);
23073
+ reconciledCollapses = true;
23005
23074
  }
23006
23075
  this.ctx.data.resetParsingFlags();
23007
- const parsedState = this.ctx.data.parseData(newSeries);
23076
+ const parsedState = this.ctx.data.parseData(
23077
+ newSeries,
23078
+ overwriteInitialSeries
23079
+ );
23008
23080
  this.ctx._writeParsedSeriesData(parsedState.seriesData);
23009
23081
  this.ctx._writeParsedRangeData(parsedState.rangeData);
23010
23082
  this.ctx._writeParsedCandleData(parsedState.candleData);
@@ -23013,10 +23085,12 @@ var __async = (__this, __arguments, generator) => {
23013
23085
  if (overwriteInitialSeries) {
23014
23086
  if (w.globals.initialConfig) {
23015
23087
  w.globals.initialConfig.series = Utils$1.copySeriesShallow(
23016
- w.config.series
23088
+ reconciledCollapses ? definedSeries : w.config.series
23017
23089
  );
23018
23090
  }
23019
- w.globals.initialSeries = w.config.series;
23091
+ if (reconciledCollapses) {
23092
+ w.globals.initialSeries = definedSeries;
23093
+ }
23020
23094
  }
23021
23095
  if (this._canUseFastPath(newSeries, prevSeriesCount, prevDataLengths, w)) {
23022
23096
  return this.ctx.fastUpdate(animate, prevAxisScaleSig).then(() => {
@@ -23347,11 +23421,11 @@ var __async = (__this, __arguments, generator) => {
23347
23421
  hoverArea.classList.add("hovering-pan");
23348
23422
  }
23349
23423
  }
23350
- let j = Math.round(hoverX / xDivisor);
23424
+ let j2 = Math.round(hoverX / xDivisor);
23351
23425
  const jHorz = Math.floor(hoverY / yDivisor);
23352
23426
  if (hasBars && !w.config.xaxis.convertedCatToNumeric) {
23353
- j = Math.ceil(hoverX / xDivisor);
23354
- j = j - 1;
23427
+ j2 = Math.ceil(hoverX / xDivisor);
23428
+ j2 = j2 - 1;
23355
23429
  }
23356
23430
  let capturedSeries = null;
23357
23431
  let closest = null;
@@ -23377,7 +23451,7 @@ var __async = (__this, __arguments, generator) => {
23377
23451
  seriesYValArr
23378
23452
  );
23379
23453
  capturedSeries = closest.index;
23380
- j = (_a = closest.j) != null ? _a : 0;
23454
+ j2 = (_a = closest.j) != null ? _a : 0;
23381
23455
  const wasCompacted = seriesXValArr.some(
23382
23456
  (arr, i2) => arr.length !== w.globals.seriesXvalues[i2].length
23383
23457
  );
@@ -23393,19 +23467,19 @@ var __async = (__this, __arguments, generator) => {
23393
23467
  nearest = i2;
23394
23468
  }
23395
23469
  }
23396
- if (nearest !== null) j = nearest;
23470
+ if (nearest !== null) j2 = nearest;
23397
23471
  }
23398
23472
  }
23399
23473
  w.interact.capturedSeriesIndex = capturedSeries === null ? -1 : capturedSeries;
23400
- if (!j || j < 1) j = 0;
23474
+ if (!j2 || j2 < 1) j2 = 0;
23401
23475
  if (w.globals.isBarHorizontal) {
23402
23476
  w.interact.capturedDataPointIndex = jHorz;
23403
23477
  } else {
23404
- w.interact.capturedDataPointIndex = j;
23478
+ w.interact.capturedDataPointIndex = j2;
23405
23479
  }
23406
23480
  return {
23407
23481
  capturedSeries,
23408
- j: w.globals.isBarHorizontal ? jHorz : j,
23482
+ j: w.globals.isBarHorizontal ? jHorz : j2,
23409
23483
  hoverX,
23410
23484
  hoverY
23411
23485
  };
@@ -23452,11 +23526,11 @@ var __async = (__this, __arguments, generator) => {
23452
23526
  const xArr = Xarrays[i2];
23453
23527
  const yArr = Yarrays[i2];
23454
23528
  const len = Math.min(xArr.length, yArr.length);
23455
- for (let j = 0; j < len; j++) {
23456
- const distX = Math.abs(hoverX - xArr[j]);
23529
+ for (let j2 = 0; j2 < len; j2++) {
23530
+ const distX = Math.abs(hoverX - xArr[j2]);
23457
23531
  if (distX < bucketDistX) {
23458
23532
  bucketDistX = distX;
23459
- closestPointIndex = j;
23533
+ closestPointIndex = j2;
23460
23534
  }
23461
23535
  }
23462
23536
  }
@@ -23478,14 +23552,14 @@ var __async = (__this, __arguments, generator) => {
23478
23552
  }
23479
23553
  continue;
23480
23554
  }
23481
- for (let j = 0; j < len - 1; j++) {
23555
+ for (let j2 = 0; j2 < len - 1; j2++) {
23482
23556
  const seg = this._distanceToSegment(
23483
23557
  hoverX,
23484
23558
  hoverY,
23485
- xArr[j],
23486
- yArr[j],
23487
- xArr[j + 1],
23488
- yArr[j + 1]
23559
+ xArr[j2],
23560
+ yArr[j2],
23561
+ xArr[j2 + 1],
23562
+ yArr[j2 + 1]
23489
23563
  );
23490
23564
  if (seg.dist < bestSegDist) {
23491
23565
  bestSegDist = seg.dist;
@@ -23520,33 +23594,33 @@ var __async = (__this, __arguments, generator) => {
23520
23594
  const yArr = Yarrays[i2];
23521
23595
  const len = Math.min(xArr.length, yArr.length);
23522
23596
  if (isLineArea && len >= 2) {
23523
- for (let j = 0; j < len - 1; j++) {
23597
+ for (let j2 = 0; j2 < len - 1; j2++) {
23524
23598
  const seg = this._distanceToSegment(
23525
23599
  hoverX,
23526
23600
  hoverY,
23527
- xArr[j],
23528
- yArr[j],
23529
- xArr[j + 1],
23530
- yArr[j + 1]
23601
+ xArr[j2],
23602
+ yArr[j2],
23603
+ xArr[j2 + 1],
23604
+ yArr[j2 + 1]
23531
23605
  );
23532
23606
  if (seg.dist < closestDist) {
23533
23607
  closestDist = seg.dist;
23534
23608
  closestSeriesIndex = i2;
23535
- closestPointIndex = seg.t < 0.5 ? j : j + 1;
23609
+ closestPointIndex = seg.t < 0.5 ? j2 : j2 + 1;
23536
23610
  }
23537
23611
  }
23538
23612
  continue;
23539
23613
  }
23540
- for (let j = 0; j < len; j++) {
23541
- const xVal = xArr[j];
23614
+ for (let j2 = 0; j2 < len; j2++) {
23615
+ const xVal = xArr[j2];
23542
23616
  const distX = hoverX - xVal;
23543
- const yVal = yArr[j];
23617
+ const yVal = yArr[j2];
23544
23618
  const distY = hoverY - yVal;
23545
23619
  const dist = Math.sqrt(distX * distX + distY * distY);
23546
23620
  if (dist < closestDist) {
23547
23621
  closestDist = dist;
23548
23622
  closestSeriesIndex = i2;
23549
- closestPointIndex = j;
23623
+ closestPointIndex = j2;
23550
23624
  }
23551
23625
  }
23552
23626
  }
@@ -23608,7 +23682,7 @@ var __async = (__this, __arguments, generator) => {
23608
23682
  * @param {number} j - the inner index of series (series[i][j])
23609
23683
  * @return {boolean}
23610
23684
  */
23611
- isXoverlap(j) {
23685
+ isXoverlap(j2) {
23612
23686
  const w = this.w;
23613
23687
  const xSameForAllSeriesJArr = [];
23614
23688
  const seriesX = w.seriesData.seriesX.filter(
@@ -23616,8 +23690,8 @@ var __async = (__this, __arguments, generator) => {
23616
23690
  );
23617
23691
  if (seriesX.length > 0) {
23618
23692
  for (let i2 = 0; i2 < seriesX.length - 1; i2++) {
23619
- if (typeof seriesX[i2][j] !== "undefined" && typeof seriesX[i2 + 1][j] !== "undefined") {
23620
- if (seriesX[i2][j] !== seriesX[i2 + 1][j]) {
23693
+ if (typeof seriesX[i2][j2] !== "undefined" && typeof seriesX[i2 + 1][j2] !== "undefined") {
23694
+ if (seriesX[i2][j2] !== seriesX[i2 + 1][j2]) {
23621
23695
  xSameForAllSeriesJArr.push("unEqual");
23622
23696
  }
23623
23697
  }
@@ -23768,20 +23842,20 @@ var __async = (__this, __arguments, generator) => {
23768
23842
  this.tooltipUtil = new Utils(tooltipContext);
23769
23843
  }
23770
23844
  /** @param {{ shared?: boolean, ttItems?: any, i?: number, j?: any, y1?: any, y2?: any, e?: any }} opts */
23771
- drawSeriesTexts({ shared = true, ttItems, i: i2 = 0, j = null, y1, y2, e: e2 }) {
23845
+ drawSeriesTexts({ shared = true, ttItems, i: i2 = 0, j: j2 = null, y1, y2, e: e2 }) {
23772
23846
  const w = this.w;
23773
23847
  if (w.config.tooltip.custom !== void 0) {
23774
- this.handleCustomTooltip({ i: i2, j, y1, y2, w });
23848
+ this.handleCustomTooltip({ i: i2, j: j2, y1, y2, w });
23775
23849
  } else {
23776
23850
  this.toggleActiveInactiveSeries(shared, i2);
23777
23851
  }
23778
23852
  const values = this.getValuesToPrint({
23779
23853
  i: i2,
23780
- j
23854
+ j: j2
23781
23855
  });
23782
23856
  this.printLabels({
23783
23857
  i: i2,
23784
- j,
23858
+ j: j2,
23785
23859
  values,
23786
23860
  ttItems,
23787
23861
  shared,
@@ -23794,16 +23868,16 @@ var __async = (__this, __arguments, generator) => {
23794
23868
  }
23795
23869
  }
23796
23870
  /** @param {{i: any, j: any, values: any, ttItems: any, shared: any, e: any}} opts */
23797
- printLabels({ i: i2, j, values, ttItems, shared, e: e2 }) {
23871
+ printLabels({ i: i2, j: j2, values, ttItems, shared, e: e2 }) {
23798
23872
  const w = this.w;
23799
23873
  const { xVal, zVal, xAxisTTVal } = values;
23800
23874
  const seriesLen = w.seriesData.series.length;
23801
- const basePColor = j !== null && w.config.plotOptions.bar.distributed ? w.globals.colors[j] : w.globals.colors[i2];
23875
+ const basePColor = j2 !== null && w.config.plotOptions.bar.distributed ? w.globals.colors[j2] : w.globals.colors[i2];
23802
23876
  for (let t2 = 0; t2 < seriesLen; t2++) {
23803
23877
  const tIndex = w.config.tooltip.inverseOrder ? seriesLen - 1 - t2 : t2;
23804
23878
  const row = this.computeSeriesRow({
23805
23879
  i: i2,
23806
- j,
23880
+ j: j2,
23807
23881
  t: t2,
23808
23882
  tIndex,
23809
23883
  shared,
@@ -23813,7 +23887,7 @@ var __async = (__this, __arguments, generator) => {
23813
23887
  this.DOMHandling({
23814
23888
  i: i2,
23815
23889
  t: tIndex,
23816
- j,
23890
+ j: j2,
23817
23891
  ttItems,
23818
23892
  values: {
23819
23893
  val: row.val,
@@ -23834,7 +23908,7 @@ var __async = (__this, __arguments, generator) => {
23834
23908
  * printLabels() to keep the outer loop scannable.
23835
23909
  * @param {{i: number, j: any, t: number, tIndex: number, shared: boolean, e: any, basePColor: string}} opts
23836
23910
  */
23837
- computeSeriesRow({ i: i2, j, tIndex, shared, e: e2, basePColor }) {
23911
+ computeSeriesRow({ i: i2, j: j2, tIndex, shared, e: e2, basePColor }) {
23838
23912
  const w = this.w;
23839
23913
  let f = this.getFormatters(i2);
23840
23914
  let pColor = basePColor;
@@ -23846,19 +23920,19 @@ var __async = (__this, __arguments, generator) => {
23846
23920
  let seriesName = w.config.chart.type === "treemap" ? f.yLbTitleFormatter(
23847
23921
  String(
23848
23922
  /** @type {any} */
23849
- w.config.series[i2].data[j].x
23923
+ w.config.series[i2].data[j2].x
23850
23924
  ),
23851
23925
  {
23852
23926
  series: w.seriesData.series,
23853
23927
  seriesIndex: i2,
23854
- dataPointIndex: j,
23928
+ dataPointIndex: j2,
23855
23929
  w
23856
23930
  }
23857
23931
  ) : this.getSeriesName({
23858
23932
  fn: f.yLbTitleFormatter,
23859
23933
  index: i2,
23860
23934
  seriesIndex: i2,
23861
- j
23935
+ j: j2
23862
23936
  });
23863
23937
  if (w.globals.axisCharts) {
23864
23938
  if (shared) {
@@ -23867,18 +23941,18 @@ var __async = (__this, __arguments, generator) => {
23867
23941
  fn: f.yLbTitleFormatter,
23868
23942
  index: tIndex,
23869
23943
  seriesIndex: i2,
23870
- j
23944
+ j: j2
23871
23945
  });
23872
23946
  pColor = w.globals.colors[tIndex];
23873
- val = this.formatYValue(f, tIndex, j);
23874
- goalVals = this.formatGoalVals(f, tIndex, j);
23947
+ val = this.formatYValue(f, tIndex, j2);
23948
+ goalVals = this.formatGoalVals(f, tIndex, j2);
23875
23949
  } else {
23876
23950
  pColor = this.resolvePatternColor(e2, pColor);
23877
- val = this.formatYValue(f, i2, j);
23878
- goalVals = this.formatGoalVals(f, i2, j);
23951
+ val = this.formatYValue(f, i2, j2);
23952
+ goalVals = this.formatGoalVals(f, i2, j2);
23879
23953
  }
23880
23954
  }
23881
- if (j === null) {
23955
+ if (j2 === null) {
23882
23956
  val = f.yLbFormatter(w.seriesData.series[i2], __spreadProps(__spreadValues({}, w), {
23883
23957
  seriesIndex: i2,
23884
23958
  dataPointIndex: i2
@@ -23893,35 +23967,35 @@ var __async = (__this, __arguments, generator) => {
23893
23967
  * @param {number} index
23894
23968
  * @param {any} j
23895
23969
  */
23896
- formatYValue(f, index, j) {
23970
+ formatYValue(f, index, j2) {
23897
23971
  var _a, _b, _c, _d;
23898
23972
  const w = this.w;
23899
23973
  const steps = w.waterfallData && w.waterfallData.values;
23900
- if (steps && steps[index] && steps[index][j] != null) {
23901
- return f.yLbFormatter(steps[index][j], {
23974
+ if (steps && steps[index] && steps[index][j2] != null) {
23975
+ return f.yLbFormatter(steps[index][j2], {
23902
23976
  series: steps,
23903
23977
  seriesIndex: index,
23904
- dataPointIndex: j,
23978
+ dataPointIndex: j2,
23905
23979
  w
23906
23980
  });
23907
23981
  }
23908
23982
  if (w.axisFlags.isRangeData) {
23909
- return f.yLbFormatter((_b = (_a = w.rangeData.seriesRangeStart) == null ? void 0 : _a[index]) == null ? void 0 : _b[j], {
23983
+ return f.yLbFormatter((_b = (_a = w.rangeData.seriesRangeStart) == null ? void 0 : _a[index]) == null ? void 0 : _b[j2], {
23910
23984
  series: w.rangeData.seriesRangeStart,
23911
23985
  seriesIndex: index,
23912
- dataPointIndex: j,
23986
+ dataPointIndex: j2,
23913
23987
  w
23914
- }) + " - " + f.yLbFormatter((_d = (_c = w.rangeData.seriesRangeEnd) == null ? void 0 : _c[index]) == null ? void 0 : _d[j], {
23988
+ }) + " - " + f.yLbFormatter((_d = (_c = w.rangeData.seriesRangeEnd) == null ? void 0 : _c[index]) == null ? void 0 : _d[j2], {
23915
23989
  series: w.rangeData.seriesRangeEnd,
23916
23990
  seriesIndex: index,
23917
- dataPointIndex: j,
23991
+ dataPointIndex: j2,
23918
23992
  w
23919
23993
  });
23920
23994
  }
23921
- return f.yLbFormatter(w.seriesData.series[index][j], {
23995
+ return f.yLbFormatter(w.seriesData.series[index][j2], {
23922
23996
  series: w.seriesData.series,
23923
23997
  seriesIndex: index,
23924
- dataPointIndex: j,
23998
+ dataPointIndex: j2,
23925
23999
  w
23926
24000
  });
23927
24001
  }
@@ -23932,16 +24006,16 @@ var __async = (__this, __arguments, generator) => {
23932
24006
  * @param {number} index
23933
24007
  * @param {any} j
23934
24008
  */
23935
- formatGoalVals(f, index, j) {
24009
+ formatGoalVals(f, index, j2) {
23936
24010
  var _a;
23937
24011
  const w = this.w;
23938
- const goals = (_a = w.seriesData.seriesGoals[index]) == null ? void 0 : _a[j];
24012
+ const goals = (_a = w.seriesData.seriesGoals[index]) == null ? void 0 : _a[j2];
23939
24013
  if (!Array.isArray(goals)) return [];
23940
24014
  return goals.map((goal) => ({
23941
24015
  attrs: goal,
23942
24016
  val: f.yLbFormatter(goal.value, {
23943
24017
  seriesIndex: index,
23944
- dataPointIndex: j,
24018
+ dataPointIndex: j2,
23945
24019
  w
23946
24020
  })
23947
24021
  }));
@@ -24013,17 +24087,17 @@ var __async = (__this, __arguments, generator) => {
24013
24087
  };
24014
24088
  }
24015
24089
  /** @param {{fn: any, index: any, seriesIndex: any, j: any}} opts */
24016
- getSeriesName({ fn, index, seriesIndex, j }) {
24090
+ getSeriesName({ fn, index, seriesIndex, j: j2 }) {
24017
24091
  const w = this.w;
24018
24092
  return fn(String(w.seriesData.seriesNames[index]), {
24019
24093
  series: w.seriesData.series,
24020
24094
  seriesIndex,
24021
- dataPointIndex: j,
24095
+ dataPointIndex: j2,
24022
24096
  w
24023
24097
  });
24024
24098
  }
24025
24099
  /** @param {{ t?: any, j?: any, i?: any, ttItems?: any, values?: any, seriesName?: any, shared?: any, pColor?: any }} opts */
24026
- DOMHandling({ t: t2, j, ttItems, values, seriesName, shared, pColor }) {
24100
+ DOMHandling({ t: t2, j: j2, ttItems, values, seriesName, shared, pColor }) {
24027
24101
  const w = this.w;
24028
24102
  const ttCtx = this.ttCtx;
24029
24103
  const { val, goalVals, xVal, xAxisTTVal, zVal } = values;
@@ -24090,7 +24164,7 @@ var __async = (__this, __arguments, generator) => {
24090
24164
  ttGVal.innerHTML = gVals + `</div>`;
24091
24165
  };
24092
24166
  if (shared) {
24093
- if (w.seriesData.seriesGoals[t2][j] && Array.isArray(w.seriesData.seriesGoals[t2][j])) {
24167
+ if (w.seriesData.seriesGoals[t2][j2] && Array.isArray(w.seriesData.seriesGoals[t2][j2])) {
24094
24168
  createGoalsHtml();
24095
24169
  } else {
24096
24170
  ttGLabel.innerHTML = "";
@@ -24162,7 +24236,7 @@ var __async = (__this, __arguments, generator) => {
24162
24236
  }
24163
24237
  }
24164
24238
  /** @param {{i: any, j: any}} opts */
24165
- getValuesToPrint({ i: i2, j }) {
24239
+ getValuesToPrint({ i: i2, j: j2 }) {
24166
24240
  var _a, _b, _c, _d, _e, _f, _g, _h;
24167
24241
  const w = this.w;
24168
24242
  const filteredSeriesX = w.seriesData.seriesX.map(
@@ -24175,29 +24249,29 @@ var __async = (__this, __arguments, generator) => {
24175
24249
  const customFormatterOpts = {
24176
24250
  series: w.seriesData.series,
24177
24251
  seriesIndex: i2,
24178
- dataPointIndex: j,
24252
+ dataPointIndex: j2,
24179
24253
  w
24180
24254
  };
24181
24255
  const zFormatter = w.formatters.ttZFormatter;
24182
- if (j === null) {
24256
+ if (j2 === null) {
24183
24257
  val = w.seriesData.series[i2];
24184
24258
  } else {
24185
24259
  if (w.axisFlags.isXNumeric && w.config.chart.type !== "treemap") {
24186
- xVal = filteredSeriesX[i2][j];
24260
+ xVal = filteredSeriesX[i2][j2];
24187
24261
  if (filteredSeriesX[i2].length === 0) {
24188
24262
  const firstActiveSeriesIndex = this.tooltipUtil.getFirstActiveXArray(filteredSeriesX);
24189
- xVal = filteredSeriesX[firstActiveSeriesIndex][j];
24263
+ xVal = filteredSeriesX[firstActiveSeriesIndex][j2];
24190
24264
  }
24191
24265
  } else {
24192
24266
  const dataFormat = new Data(this.w);
24193
24267
  if (dataFormat.isFormatXY()) {
24194
24268
  xVal = typeof /** @type {any} */
24195
- w.config.series[i2].data[j] !== "undefined" ? (
24269
+ w.config.series[i2].data[j2] !== "undefined" ? (
24196
24270
  /** @type {any} */
24197
- w.config.series[i2].data[j].x
24271
+ w.config.series[i2].data[j2].x
24198
24272
  ) : "";
24199
24273
  } else {
24200
- xVal = typeof w.labelData.labels[j] !== "undefined" ? w.labelData.labels[j] : "";
24274
+ xVal = typeof w.labelData.labels[j2] !== "undefined" ? w.labelData.labels[j2] : "";
24201
24275
  }
24202
24276
  }
24203
24277
  }
@@ -24226,7 +24300,7 @@ var __async = (__this, __arguments, generator) => {
24226
24300
  xVal = (_f = (_e = (_d = w.formatters).ttKeyFormatter) == null ? void 0 : _e.call(_d, bufferXVal, customFormatterOpts)) != null ? _f : bufferXVal;
24227
24301
  }
24228
24302
  if (w.seriesData.seriesZ.length > 0 && w.seriesData.seriesZ[i2].length > 0) {
24229
- zVal = zFormatter == null ? void 0 : zFormatter(w.seriesData.seriesZ[i2][j], w);
24303
+ zVal = zFormatter == null ? void 0 : zFormatter(w.seriesData.seriesZ[i2][j2], w);
24230
24304
  }
24231
24305
  if (typeof w.config.xaxis.tooltip.formatter === "function") {
24232
24306
  xAxisTTVal = (_h = (_g = w.formatters).xaxisTooltipFormatter) == null ? void 0 : _h.call(
@@ -24245,7 +24319,7 @@ var __async = (__this, __arguments, generator) => {
24245
24319
  };
24246
24320
  }
24247
24321
  /** @param {{i: any, j: any, y1: any, y2: any, w: any}} opts */
24248
- handleCustomTooltip({ i: i2, j, y1, y2, w }) {
24322
+ handleCustomTooltip({ i: i2, j: j2, y1, y2, w }) {
24249
24323
  const tooltipEl = this.ttCtx.getElTooltip();
24250
24324
  let fn = w.config.tooltip.custom;
24251
24325
  if (Array.isArray(fn)) {
@@ -24255,7 +24329,7 @@ var __async = (__this, __arguments, generator) => {
24255
24329
  const customTooltip = fn({
24256
24330
  series: w.seriesData.series,
24257
24331
  seriesIndex: i2,
24258
- dataPointIndex: j,
24332
+ dataPointIndex: j2,
24259
24333
  y1,
24260
24334
  y2,
24261
24335
  w
@@ -24289,14 +24363,14 @@ var __async = (__this, __arguments, generator) => {
24289
24363
  * @param {number} cx - point's x position, wherever point's x is, you need to move crosshair
24290
24364
  * @param {number | null} [j]
24291
24365
  */
24292
- moveXCrosshairs(cx, j = null) {
24366
+ moveXCrosshairs(cx, j2 = null) {
24293
24367
  const ttCtx = this.ttCtx;
24294
24368
  const w = this.w;
24295
24369
  const xcrosshairs = ttCtx.getElXCrosshairs();
24296
24370
  let x = cx - ttCtx.xcrosshairsWidth / 2;
24297
24371
  const tickAmount = w.labelData.labels.slice().length;
24298
- if (j !== null) {
24299
- x = w.layout.gridWidth / tickAmount * j;
24372
+ if (j2 !== null) {
24373
+ x = w.layout.gridWidth / tickAmount * j2;
24300
24374
  }
24301
24375
  if (xcrosshairs !== null && !w.globals.isBarHorizontal) {
24302
24376
  xcrosshairs.setAttribute("x", String(x));
@@ -24572,7 +24646,7 @@ var __async = (__this, __arguments, generator) => {
24572
24646
  * @param {number} i
24573
24647
  * @param {number} j
24574
24648
  */
24575
- moveMarkers(i2, j) {
24649
+ moveMarkers(i2, j2) {
24576
24650
  var _a;
24577
24651
  const w = this.w;
24578
24652
  const ttCtx = this.ttCtx;
@@ -24581,14 +24655,14 @@ var __async = (__this, __arguments, generator) => {
24581
24655
  ` .apexcharts-series[data\\:realIndex='${i2}'] .apexcharts-marker`
24582
24656
  );
24583
24657
  for (let p = 0; p < allPoints.length; p++) {
24584
- if (parseInt((_a = allPoints[p].getAttribute("rel")) != null ? _a : "0", 10) === j) {
24658
+ if (parseInt((_a = allPoints[p].getAttribute("rel")) != null ? _a : "0", 10) === j2) {
24585
24659
  ttCtx.marker.resetPointsSize();
24586
- ttCtx.marker.enlargeCurrentPoint(j, allPoints[p]);
24660
+ ttCtx.marker.enlargeCurrentPoint(j2, allPoints[p]);
24587
24661
  }
24588
24662
  }
24589
24663
  } else {
24590
24664
  ttCtx.marker.resetPointsSize();
24591
- this.moveDynamicPointOnHover(j, i2);
24665
+ this.moveDynamicPointOnHover(j2, i2);
24592
24666
  }
24593
24667
  }
24594
24668
  // This function is used when you need to show markers/points only on hover -
@@ -24597,7 +24671,7 @@ var __async = (__this, __arguments, generator) => {
24597
24671
  * @param {number} j
24598
24672
  * @param {number} capturedSeries
24599
24673
  */
24600
- moveDynamicPointOnHover(j, capturedSeries) {
24674
+ moveDynamicPointOnHover(j2, capturedSeries) {
24601
24675
  var _a, _b, _c, _d, _e;
24602
24676
  const w = this.w;
24603
24677
  const ttCtx = this.ttCtx;
@@ -24613,8 +24687,8 @@ var __async = (__this, __arguments, generator) => {
24613
24687
  if (serType && (serType === "column" || serType === "candlestick" || serType === "boxPlot" || serType === "violin")) {
24614
24688
  return;
24615
24689
  }
24616
- cx = (_b = (_a = pointsArr[capturedSeries]) == null ? void 0 : _a[j]) == null ? void 0 : _b[0];
24617
- cy = ((_d = (_c = pointsArr[capturedSeries]) == null ? void 0 : _c[j]) == null ? void 0 : _d[1]) || 0;
24690
+ cx = (_b = (_a = pointsArr[capturedSeries]) == null ? void 0 : _a[j2]) == null ? void 0 : _b[0];
24691
+ cy = ((_d = (_c = pointsArr[capturedSeries]) == null ? void 0 : _c[j2]) == null ? void 0 : _d[1]) || 0;
24618
24692
  const point = w.dom.baseEl.querySelector(
24619
24693
  `.apexcharts-series[data\\:realIndex='${capturedSeries}'] .apexcharts-series-markers path`
24620
24694
  );
@@ -24633,7 +24707,7 @@ var __async = (__this, __arguments, generator) => {
24633
24707
  /**
24634
24708
  * @param {number} j
24635
24709
  */
24636
- moveDynamicPointsOnHover(j) {
24710
+ moveDynamicPointsOnHover(j2) {
24637
24711
  var _a, _b;
24638
24712
  const ttCtx = this.ttCtx;
24639
24713
  const w = ttCtx.w;
@@ -24650,9 +24724,9 @@ var __async = (__this, __arguments, generator) => {
24650
24724
  "bubble"
24651
24725
  ]);
24652
24726
  const hoverSize = ttCtx.tooltipUtil.getHoverMarkerSize(activeSeries);
24653
- if ((_a = pointsArr[activeSeries]) == null ? void 0 : _a[j]) {
24654
- cx = pointsArr[activeSeries][j][0];
24655
- cy = pointsArr[activeSeries][j][1];
24727
+ if ((_a = pointsArr[activeSeries]) == null ? void 0 : _a[j2]) {
24728
+ cx = pointsArr[activeSeries][j2][0];
24729
+ cy = pointsArr[activeSeries][j2][1];
24656
24730
  }
24657
24731
  if (isNaN(cx)) {
24658
24732
  return;
@@ -24667,12 +24741,12 @@ var __async = (__this, __arguments, generator) => {
24667
24741
  }
24668
24742
  }
24669
24743
  if (points[p] && pointArr && pointArr.length) {
24670
- let pcy = pointsArr[p][j][1];
24744
+ let pcy = pointsArr[p][j2][1];
24671
24745
  let pcy2;
24672
24746
  points[p].setAttribute("cx", cx);
24673
24747
  const shape = (_b = points[p].getAttribute("shape")) != null ? _b : "circle";
24674
24748
  if (w.config.chart.type === "rangeArea" && !w.globals.comboCharts) {
24675
- const rangeStartIndex = j + w.seriesData.series[p].length;
24749
+ const rangeStartIndex = j2 + w.seriesData.series[p].length;
24676
24750
  pcy2 = pointsArr[p][rangeStartIndex][1];
24677
24751
  const pcyDiff = Math.abs(pcy - pcy2) / 2;
24678
24752
  pcy = pcy - pcyDiff;
@@ -24695,7 +24769,7 @@ var __async = (__this, __arguments, generator) => {
24695
24769
  * @param {number} j
24696
24770
  * @param {number} capturedSeries
24697
24771
  */
24698
- moveStickyTooltipOverBars(j, capturedSeries) {
24772
+ moveStickyTooltipOverBars(j2, capturedSeries) {
24699
24773
  var _a, _b, _c, _d, _e;
24700
24774
  const w = this.w;
24701
24775
  const ttCtx = this.ttCtx;
@@ -24712,15 +24786,15 @@ var __async = (__this, __arguments, generator) => {
24712
24786
  i2 = series.getActiveConfigSeriesIndex("desc") + 1;
24713
24787
  }
24714
24788
  let jBar = w.dom.baseEl.querySelector(
24715
- `.apexcharts-bar-series .apexcharts-series[rel='${i2}'] path[j='${j}'], .apexcharts-candlestick-series .apexcharts-series[rel='${i2}'] path[j='${j}'], .apexcharts-boxPlot-series .apexcharts-series[rel='${i2}'] path[j='${j}'], .apexcharts-violin-series .apexcharts-series[rel='${i2}'] path[j='${j}'], .apexcharts-rangebar-series .apexcharts-series[rel='${i2}'] path[j='${j}']`
24789
+ `.apexcharts-bar-series .apexcharts-series[rel='${i2}'] path[j='${j2}'], .apexcharts-candlestick-series .apexcharts-series[rel='${i2}'] path[j='${j2}'], .apexcharts-boxPlot-series .apexcharts-series[rel='${i2}'] path[j='${j2}'], .apexcharts-violin-series .apexcharts-series[rel='${i2}'] path[j='${j2}'], .apexcharts-rangebar-series .apexcharts-series[rel='${i2}'] path[j='${j2}']`
24716
24790
  );
24717
24791
  if (!jBar && typeof capturedSeries === "number") {
24718
24792
  jBar = w.dom.baseEl.querySelector(
24719
- `.apexcharts-bar-series .apexcharts-series[data\\:realIndex='${capturedSeries}'] path[j='${j}'],
24720
- .apexcharts-candlestick-series .apexcharts-series[data\\:realIndex='${capturedSeries}'] path[j='${j}'],
24721
- .apexcharts-boxPlot-series .apexcharts-series[data\\:realIndex='${capturedSeries}'] path[j='${j}'],
24722
- .apexcharts-violin-series .apexcharts-series[data\\:realIndex='${capturedSeries}'] path[j='${j}'],
24723
- .apexcharts-rangebar-series .apexcharts-series[data\\:realIndex='${capturedSeries}'] path[j='${j}']`
24793
+ `.apexcharts-bar-series .apexcharts-series[data\\:realIndex='${capturedSeries}'] path[j='${j2}'],
24794
+ .apexcharts-candlestick-series .apexcharts-series[data\\:realIndex='${capturedSeries}'] path[j='${j2}'],
24795
+ .apexcharts-boxPlot-series .apexcharts-series[data\\:realIndex='${capturedSeries}'] path[j='${j2}'],
24796
+ .apexcharts-violin-series .apexcharts-series[data\\:realIndex='${capturedSeries}'] path[j='${j2}'],
24797
+ .apexcharts-rangebar-series .apexcharts-series[data\\:realIndex='${capturedSeries}'] path[j='${j2}']`
24724
24798
  );
24725
24799
  }
24726
24800
  let bc = null;
@@ -24729,11 +24803,11 @@ var __async = (__this, __arguments, generator) => {
24729
24803
  w.globals.barCanvasCoords
24730
24804
  );
24731
24805
  if (!jBar && bcc) {
24732
- bc = typeof capturedSeries === "number" && ((_a = bcc[capturedSeries]) == null ? void 0 : _a[j]) || null;
24806
+ bc = typeof capturedSeries === "number" && ((_a = bcc[capturedSeries]) == null ? void 0 : _a[j2]) || null;
24733
24807
  if (!bc) {
24734
24808
  for (const key in bcc) {
24735
- if ((_b = bcc[key]) == null ? void 0 : _b[j]) {
24736
- bc = bcc[key][j];
24809
+ if ((_b = bcc[key]) == null ? void 0 : _b[j2]) {
24810
+ bc = bcc[key][j2];
24737
24811
  break;
24738
24812
  }
24739
24813
  }
@@ -24748,7 +24822,7 @@ var __async = (__this, __arguments, generator) => {
24748
24822
  const isBoxOrCandle = jBar && (jBar.classList.contains("apexcharts-candlestick-area") || jBar.classList.contains("apexcharts-boxPlot-area"));
24749
24823
  if (w.axisFlags.isXNumeric) {
24750
24824
  if (jBar && !isBoxOrCandle) {
24751
- const center = this._datapointCenterXFromBars(j);
24825
+ const center = this._datapointCenterXFromBars(j2);
24752
24826
  if (center != null) {
24753
24827
  bcx = center;
24754
24828
  } else {
@@ -24761,9 +24835,9 @@ var __async = (__this, __arguments, generator) => {
24761
24835
  }
24762
24836
  } else {
24763
24837
  if (!w.globals.isBarHorizontal && !bc) {
24764
- bcx = ttCtx.xAxisTicksPositions[j - 1] + ttCtx.dataPointsDividedWidth / 2;
24838
+ bcx = ttCtx.xAxisTicksPositions[j2 - 1] + ttCtx.dataPointsDividedWidth / 2;
24765
24839
  if (isNaN(bcx)) {
24766
- bcx = ttCtx.xAxisTicksPositions[j] - ttCtx.dataPointsDividedWidth / 2;
24840
+ bcx = ttCtx.xAxisTicksPositions[j2] - ttCtx.dataPointsDividedWidth / 2;
24767
24841
  }
24768
24842
  }
24769
24843
  }
@@ -24783,7 +24857,7 @@ var __async = (__this, __arguments, generator) => {
24783
24857
  }
24784
24858
  if (!ttCtx.fixedTooltip) {
24785
24859
  if (w.globals.isBarHorizontal && !w.config.tooltip.followCursor) {
24786
- const placed = this.placeHorizontalSharedTooltip(j);
24860
+ const placed = this.placeHorizontalSharedTooltip(j2);
24787
24861
  if (placed) return;
24788
24862
  }
24789
24863
  this.moveTooltip(bcx, bcy || w.layout.gridHeight);
@@ -24800,11 +24874,11 @@ var __async = (__this, __arguments, generator) => {
24800
24874
  * @param {number} j
24801
24875
  * @returns {number | null}
24802
24876
  */
24803
- _datapointCenterXFromBars(j) {
24877
+ _datapointCenterXFromBars(j2) {
24804
24878
  var _a, _b;
24805
24879
  const w = this.w;
24806
24880
  const bars = w.dom.baseEl.querySelectorAll(
24807
- `.apexcharts-bar-series path[j='${j}'],.apexcharts-rangebar-series path[j='${j}']`
24881
+ `.apexcharts-bar-series path[j='${j2}'],.apexcharts-rangebar-series path[j='${j2}']`
24808
24882
  );
24809
24883
  if (!bars.length) return null;
24810
24884
  let unionLeft = Infinity;
@@ -24833,7 +24907,7 @@ var __async = (__this, __arguments, generator) => {
24833
24907
  * @param {number} j
24834
24908
  * @returns {boolean}
24835
24909
  */
24836
- placeHorizontalSharedTooltip(j) {
24910
+ placeHorizontalSharedTooltip(j2) {
24837
24911
  var _a, _b;
24838
24912
  const w = this.w;
24839
24913
  const ttCtx = this.ttCtx;
@@ -24843,7 +24917,7 @@ var __async = (__this, __arguments, generator) => {
24843
24917
  if (!elGrid) return false;
24844
24918
  const gridRect = elGrid.getBoundingClientRect();
24845
24919
  const bars = w.dom.baseEl.querySelectorAll(
24846
- `.apexcharts-bar-series path[j='${j}'],.apexcharts-rangebar-series path[j='${j}'],.apexcharts-boxPlot-series path[j='${j}']`
24920
+ `.apexcharts-bar-series path[j='${j2}'],.apexcharts-rangebar-series path[j='${j2}'],.apexcharts-boxPlot-series path[j='${j2}']`
24847
24921
  );
24848
24922
  if (!bars.length) return false;
24849
24923
  let unionLeft = Infinity;
@@ -25012,12 +25086,12 @@ var __async = (__this, __arguments, generator) => {
25012
25086
  /**
25013
25087
  * @param {number} j
25014
25088
  */
25015
- enlargePoints(j) {
25089
+ enlargePoints(j2) {
25016
25090
  var _a, _b;
25017
25091
  const w = this.w;
25018
25092
  const me = this;
25019
25093
  const ttCtx = this.ttCtx;
25020
- const col = j;
25094
+ const col = j2;
25021
25095
  const points = w.dom.baseEl.querySelectorAll(
25022
25096
  ".apexcharts-series:not(.apexcharts-series-collapsed) .apexcharts-marker"
25023
25097
  );
@@ -25132,7 +25206,7 @@ var __async = (__this, __arguments, generator) => {
25132
25206
  const renderer = w.globals.activeRenderer;
25133
25207
  const canvasCells = type === "heatmap" && renderer && renderer.kind === "canvas" && typeof renderer.hitTest === "function";
25134
25208
  const hovered = Utils.hoverTarget(e2);
25135
- let i2, j, cx, cy, width, height;
25209
+ let i2, j2, cx, cy, width, height;
25136
25210
  if (canvasCells) {
25137
25211
  const seriesBound = opt.elGrid.getBoundingClientRect();
25138
25212
  const clientX = (_a = opt.clientX) != null ? _a : e2.type === "touchmove" ? e2.touches[0].clientX : e2.clientX;
@@ -25145,14 +25219,14 @@ var __async = (__this, __arguments, generator) => {
25145
25219
  return { x, y, noHit: true };
25146
25220
  }
25147
25221
  i2 = hit.seriesIndex;
25148
- j = hit.dataPointIndex;
25222
+ j2 = hit.dataPointIndex;
25149
25223
  cx = hit.x;
25150
25224
  cy = hit.y;
25151
25225
  width = hit.width;
25152
25226
  height = hit.height;
25153
25227
  } else if (hovered.classList.contains(`apexcharts-${type}-rect`)) {
25154
25228
  i2 = this.getAttr(e2, "i");
25155
- j = this.getAttr(e2, "j");
25229
+ j2 = this.getAttr(e2, "j");
25156
25230
  cx = this.getAttr(e2, "cx");
25157
25231
  cy = this.getAttr(e2, "cy");
25158
25232
  width = this.getAttr(e2, "width");
@@ -25163,12 +25237,12 @@ var __async = (__this, __arguments, generator) => {
25163
25237
  ttCtx.tooltipLabels.drawSeriesTexts({
25164
25238
  ttItems: opt.ttItems,
25165
25239
  i: i2,
25166
- j,
25240
+ j: j2,
25167
25241
  shared: false,
25168
25242
  e: e2
25169
25243
  });
25170
25244
  w.interact.capturedSeriesIndex = i2;
25171
- w.interact.capturedDataPointIndex = j;
25245
+ w.interact.capturedDataPointIndex = j2;
25172
25246
  ttCtx.tooltipPosition.moveXCrosshairs(cx + width / 2);
25173
25247
  const tooltipEl = ttCtx.getElTooltip();
25174
25248
  if (type === "heatmap" && w.config.tooltip.arrow && !w.config.tooltip.followCursor && tooltipEl) {
@@ -25251,12 +25325,12 @@ var __async = (__this, __arguments, generator) => {
25251
25325
  const w = this.w;
25252
25326
  const ttCtx = this.ttCtx;
25253
25327
  let i2;
25254
- let j;
25328
+ let j2;
25255
25329
  if (Utils.hoverTarget(e2).classList.contains("apexcharts-marker")) {
25256
25330
  const cx = parseInt(opt.paths.getAttribute("cx"), 10);
25257
25331
  const cy = parseInt(opt.paths.getAttribute("cy"), 10);
25258
25332
  const val = parseFloat(opt.paths.getAttribute("val"));
25259
- j = parseInt(opt.paths.getAttribute("rel"), 10);
25333
+ j2 = parseInt(opt.paths.getAttribute("rel"), 10);
25260
25334
  i2 = parseInt(
25261
25335
  opt.paths.parentNode.parentNode.parentNode.getAttribute("rel"),
25262
25336
  10
@@ -25270,15 +25344,15 @@ var __async = (__this, __arguments, generator) => {
25270
25344
  ttCtx.tooltipLabels.drawSeriesTexts({
25271
25345
  ttItems: opt.ttItems,
25272
25346
  i: i2,
25273
- j,
25347
+ j: j2,
25274
25348
  shared: ttCtx.showOnIntersect ? false : w.config.tooltip.shared,
25275
25349
  e: e2
25276
25350
  });
25277
25351
  if (e2.type === "mouseup") {
25278
- ttCtx.markerClick(e2, i2, j);
25352
+ ttCtx.markerClick(e2, i2, j2);
25279
25353
  }
25280
25354
  w.interact.capturedSeriesIndex = i2;
25281
- w.interact.capturedDataPointIndex = j;
25355
+ w.interact.capturedDataPointIndex = j2;
25282
25356
  const arrowEnabled = !!w.config.tooltip.arrow;
25283
25357
  x = cx;
25284
25358
  if (arrowEnabled) {
@@ -25295,7 +25369,7 @@ var __async = (__this, __arguments, generator) => {
25295
25369
  const seriesBound = elGrid.getBoundingClientRect();
25296
25370
  y = ttCtx.e.clientY + w.layout.translateY - seriesBound.top;
25297
25371
  }
25298
- ttCtx.marker.enlargeCurrentPoint(j, opt.paths, x, y);
25372
+ ttCtx.marker.enlargeCurrentPoint(j2, opt.paths, x, y);
25299
25373
  }
25300
25374
  return {
25301
25375
  x,
@@ -25324,9 +25398,9 @@ var __async = (__this, __arguments, generator) => {
25324
25398
  return;
25325
25399
  }
25326
25400
  i2 = barXY.i;
25327
- const j = barXY.j;
25401
+ const j2 = barXY.j;
25328
25402
  w.interact.capturedSeriesIndex = i2;
25329
- w.interact.capturedDataPointIndex = j !== null ? j : w.interact.capturedDataPointIndex;
25403
+ w.interact.capturedDataPointIndex = j2 !== null ? j2 : w.interact.capturedDataPointIndex;
25330
25404
  if (w.globals.isBarHorizontal && ttCtx.tooltipUtil.hasBars() || !w.config.tooltip.shared) {
25331
25405
  x = barXY.x;
25332
25406
  y = barXY.y;
@@ -25442,7 +25516,7 @@ var __async = (__this, __arguments, generator) => {
25442
25516
  /** @param {{e: any, opt: any}} opts */
25443
25517
  getBarTooltipXY({ e: e2, opt }) {
25444
25518
  const w = this.w;
25445
- let j = null;
25519
+ let j2 = null;
25446
25520
  const ttCtx = this.ttCtx;
25447
25521
  let i2 = 0;
25448
25522
  let x = 0;
@@ -25481,7 +25555,7 @@ var __async = (__this, __arguments, generator) => {
25481
25555
  bottom: rectTopInGrid + bh
25482
25556
  };
25483
25557
  const clientX = e2.type === "touchmove" ? e2.touches[0].clientX : e2.clientX;
25484
- j = parseInt(bar.getAttribute("j"), 10);
25558
+ j2 = parseInt(bar.getAttribute("j"), 10);
25485
25559
  i2 = parseInt(bar.parentNode.getAttribute("rel"), 10) - 1;
25486
25560
  const y1 = bar.getAttribute("data-range-y1");
25487
25561
  const y2 = bar.getAttribute("data-range-y2");
@@ -25506,7 +25580,7 @@ var __async = (__this, __arguments, generator) => {
25506
25580
  ttCtx.tooltipLabels.drawSeriesTexts({
25507
25581
  ttItems: opt.ttItems,
25508
25582
  i: i2,
25509
- j,
25583
+ j: j2,
25510
25584
  y1: y1 ? parseInt(y1, 10) : null,
25511
25585
  y2: y2 ? parseInt(y2, 10) : null,
25512
25586
  shared: ttCtx.showOnIntersect ? false : w.config.tooltip.shared,
@@ -25539,7 +25613,7 @@ var __async = (__this, __arguments, generator) => {
25539
25613
  barHeight,
25540
25614
  barWidth,
25541
25615
  i: i2,
25542
- j,
25616
+ j: j2,
25543
25617
  // SVG attribute values — left for any caller that still wants them.
25544
25618
  barCx,
25545
25619
  barCy,
@@ -26500,9 +26574,9 @@ var __async = (__this, __arguments, generator) => {
26500
26574
  const tooltipEl = this.getElTooltip();
26501
26575
  if (!tooltipEl) return;
26502
26576
  const i2 = parseInt(dotEl.getAttribute("i") || "0", 10);
26503
- const j = parseInt(dotEl.getAttribute("j") || "0", 10);
26577
+ const j2 = parseInt(dotEl.getAttribute("j") || "0", 10);
26504
26578
  if (typeof w.config.tooltip.custom === "function") {
26505
- this.tooltipLabels.handleCustomTooltip({ i: i2, j, y1: null, y2: null, w });
26579
+ this.tooltipLabels.handleCustomTooltip({ i: i2, j: j2, y1: null, y2: null, w });
26506
26580
  return;
26507
26581
  }
26508
26582
  const seriesName = w.seriesData.seriesNames[i2] || `series-${i2 + 1}`;
@@ -26512,7 +26586,7 @@ var __async = (__this, __arguments, generator) => {
26512
26586
  const unitOpts = w.config.plotOptions.unit || {};
26513
26587
  const unitValue = unitOpts.unitValue > 0 ? unitOpts.unitValue : 1;
26514
26588
  const catData = w.seriesData.unitData && w.seriesData.unitData[i2];
26515
- const datum = catData ? catData[j] : void 0;
26589
+ const datum = catData ? catData[j2] : void 0;
26516
26590
  const datumObj = datum && typeof datum === "object" ? datum : null;
26517
26591
  const color = datumObj && datumObj.fillColor || w.globals.colors && w.globals.colors[i2] || "#008FFB";
26518
26592
  let body;
@@ -26521,7 +26595,7 @@ var __async = (__this, __arguments, generator) => {
26521
26595
  body = fmt({
26522
26596
  seriesName,
26523
26597
  seriesIndex: i2,
26524
- dataPointIndex: j,
26598
+ dataPointIndex: j2,
26525
26599
  count,
26526
26600
  value,
26527
26601
  unitValue,
@@ -26532,9 +26606,9 @@ var __async = (__this, __arguments, generator) => {
26532
26606
  } else if (datum !== void 0 && datum !== null) {
26533
26607
  const label = datumObj ? (_c = (_b = (_a = datumObj.name) != null ? _a : datumObj.label) != null ? _b : datumObj.x) != null ? _c : null : null;
26534
26608
  const dVal = datumObj ? (_e = (_d = datumObj.value) != null ? _d : datumObj.y) != null ? _e : null : datum;
26535
- body = label != null && dVal != null ? `${label}: ${dVal}` : label != null ? String(label) : dVal != null ? String(dVal) : `#${(j + 1).toLocaleString()} of ${count.toLocaleString()}`;
26609
+ body = label != null && dVal != null ? `${label}: ${dVal}` : label != null ? String(label) : dVal != null ? String(dVal) : `#${(j2 + 1).toLocaleString()} of ${count.toLocaleString()}`;
26536
26610
  } else {
26537
- body = `#${(j + 1).toLocaleString()} of ${count.toLocaleString()}`;
26611
+ body = `#${(j2 + 1).toLocaleString()} of ${count.toLocaleString()}`;
26538
26612
  if (unitValue !== 1) {
26539
26613
  body += ` &middot; ${unitValue.toLocaleString()} per dot`;
26540
26614
  }
@@ -26563,7 +26637,7 @@ var __async = (__this, __arguments, generator) => {
26563
26637
  clientX,
26564
26638
  clientY
26565
26639
  });
26566
- const j = capj.j;
26640
+ const j2 = capj.j;
26567
26641
  let capturedSeries = capj.capturedSeries;
26568
26642
  if (capturedSeries !== null && w.globals.collapsedSeriesIndices.includes(capturedSeries != null ? capturedSeries : -1))
26569
26643
  capturedSeries = null;
@@ -26573,9 +26647,9 @@ var __async = (__this, __arguments, generator) => {
26573
26647
  return;
26574
26648
  }
26575
26649
  if (capturedSeries !== null) {
26576
- this.handleStickyCapturedSeries(e2, capturedSeries != null ? capturedSeries : -1, opt, j != null ? j : 0);
26650
+ this.handleStickyCapturedSeries(e2, capturedSeries != null ? capturedSeries : -1, opt, j2 != null ? j2 : 0);
26577
26651
  } else {
26578
- if (this.tooltipUtil.isXoverlap(j != null ? j : 0) || w.globals.isBarHorizontal) {
26652
+ if (this.tooltipUtil.isXoverlap(j2 != null ? j2 : 0) || w.globals.isBarHorizontal) {
26579
26653
  const firstVisibleSeries = w.seriesData.series.findIndex(
26580
26654
  /**
26581
26655
  * @param {any} s
@@ -26583,7 +26657,7 @@ var __async = (__this, __arguments, generator) => {
26583
26657
  */
26584
26658
  (s2, i2) => !w.globals.collapsedSeriesIndices.includes(i2)
26585
26659
  );
26586
- this.create(e2, this, firstVisibleSeries, j != null ? j : 0, opt.ttItems);
26660
+ this.create(e2, this, firstVisibleSeries, j2 != null ? j2 : 0, opt.ttItems);
26587
26661
  }
26588
26662
  }
26589
26663
  }
@@ -26593,23 +26667,23 @@ var __async = (__this, __arguments, generator) => {
26593
26667
  * @param {Record<string, any>} opt
26594
26668
  * @param {number} j
26595
26669
  */
26596
- handleStickyCapturedSeries(e2, capturedSeries, opt, j) {
26670
+ handleStickyCapturedSeries(e2, capturedSeries, opt, j2) {
26597
26671
  const w = this.w;
26598
26672
  if (!this.tConfig.shared) {
26599
- const ignoreNull = w.seriesData.series[capturedSeries][j] === null;
26673
+ const ignoreNull = w.seriesData.series[capturedSeries][j2] === null;
26600
26674
  if (ignoreNull) {
26601
26675
  this.handleMouseOut(opt);
26602
26676
  return;
26603
26677
  }
26604
26678
  }
26605
- if (typeof w.seriesData.series[capturedSeries][j] !== "undefined") {
26606
- if (this.tConfig.shared && this.tooltipUtil.isXoverlap(j) && this.tooltipUtil.isInitialSeriesSameLen()) {
26607
- this.create(e2, this, capturedSeries, j, opt.ttItems);
26679
+ if (typeof w.seriesData.series[capturedSeries][j2] !== "undefined") {
26680
+ if (this.tConfig.shared && this.tooltipUtil.isXoverlap(j2) && this.tooltipUtil.isInitialSeriesSameLen()) {
26681
+ this.create(e2, this, capturedSeries, j2, opt.ttItems);
26608
26682
  } else {
26609
- this.create(e2, this, capturedSeries, j, opt.ttItems, false);
26683
+ this.create(e2, this, capturedSeries, j2, opt.ttItems, false);
26610
26684
  }
26611
26685
  } else {
26612
- if (this.tooltipUtil.isXoverlap(j)) {
26686
+ if (this.tooltipUtil.isXoverlap(j2)) {
26613
26687
  const firstVisibleSeries = w.seriesData.series.findIndex(
26614
26688
  /**
26615
26689
  * @param {any} s
@@ -26617,7 +26691,7 @@ var __async = (__this, __arguments, generator) => {
26617
26691
  */
26618
26692
  (s2, i2) => !w.globals.collapsedSeriesIndices.includes(i2)
26619
26693
  );
26620
- this.create(e2, this, firstVisibleSeries, j, opt.ttItems);
26694
+ this.create(e2, this, firstVisibleSeries, j2, opt.ttItems);
26621
26695
  }
26622
26696
  }
26623
26697
  }
@@ -26725,12 +26799,12 @@ var __async = (__this, __arguments, generator) => {
26725
26799
  * @param {any} ttItems
26726
26800
  * @param {boolean | null} shared
26727
26801
  */
26728
- create(e2, context, capturedSeries, j, ttItems, shared = null) {
26802
+ create(e2, context, capturedSeries, j2, ttItems, shared = null) {
26729
26803
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u;
26730
26804
  const w = this.w;
26731
26805
  const ttCtx = context;
26732
26806
  if (e2.type === "mouseup") {
26733
- this.markerClick(e2, capturedSeries, j);
26807
+ this.markerClick(e2, capturedSeries, j2);
26734
26808
  }
26735
26809
  if (shared === null) shared = this.tConfig.shared;
26736
26810
  const hasMarkers = this.tooltipUtil.hasMarkers(capturedSeries);
@@ -26741,9 +26815,9 @@ var __async = (__this, __arguments, generator) => {
26741
26815
  const bars = this.tooltipUtil.getElBars();
26742
26816
  const handlePoints = () => {
26743
26817
  if (w.globals.markers.largestSize > 0 && !canvasMode && !w.globals.markers.batched) {
26744
- ttCtx.marker.enlargePoints(j);
26818
+ ttCtx.marker.enlargePoints(j2);
26745
26819
  } else {
26746
- ttCtx.tooltipPosition.moveDynamicPointsOnHover(j);
26820
+ ttCtx.tooltipPosition.moveDynamicPointsOnHover(j2);
26747
26821
  }
26748
26822
  };
26749
26823
  if (w.config.legend.tooltipHoverFormatter) {
@@ -26764,7 +26838,7 @@ var __async = (__this, __arguments, generator) => {
26764
26838
  );
26765
26839
  const text = legendFormatter(legendName, {
26766
26840
  seriesIndex: shared ? lsIndex : capturedSeries,
26767
- dataPointIndex: j,
26841
+ dataPointIndex: j2,
26768
26842
  w
26769
26843
  });
26770
26844
  if (!shared) {
@@ -26784,11 +26858,11 @@ var __async = (__this, __arguments, generator) => {
26784
26858
  const commonSeriesTextsParams = __spreadValues(__spreadValues({
26785
26859
  ttItems,
26786
26860
  i: capturedSeries,
26787
- j
26788
- }, ((_i = (_h = (_g = (_f = _rangeData.seriesRange) == null ? void 0 : _f[capturedSeries]) == null ? void 0 : _g[j]) == null ? void 0 : _h.y[0]) == null ? void 0 : _i.y1) !== void 0 && {
26789
- y1: (_m = (_l = (_k = (_j = _rangeData.seriesRange) == null ? void 0 : _j[capturedSeries]) == null ? void 0 : _k[j]) == null ? void 0 : _l.y[0]) == null ? void 0 : _m.y1
26790
- }), ((_q = (_p = (_o = (_n = _rangeData.seriesRange) == null ? void 0 : _n[capturedSeries]) == null ? void 0 : _o[j]) == null ? void 0 : _p.y[0]) == null ? void 0 : _q.y2) !== void 0 && {
26791
- y2: (_u = (_t = (_s = (_r = _rangeData.seriesRange) == null ? void 0 : _r[capturedSeries]) == null ? void 0 : _s[j]) == null ? void 0 : _t.y[0]) == null ? void 0 : _u.y2
26861
+ j: j2
26862
+ }, ((_i = (_h = (_g = (_f = _rangeData.seriesRange) == null ? void 0 : _f[capturedSeries]) == null ? void 0 : _g[j2]) == null ? void 0 : _h.y[0]) == null ? void 0 : _i.y1) !== void 0 && {
26863
+ y1: (_m = (_l = (_k = (_j = _rangeData.seriesRange) == null ? void 0 : _j[capturedSeries]) == null ? void 0 : _k[j2]) == null ? void 0 : _l.y[0]) == null ? void 0 : _m.y1
26864
+ }), ((_q = (_p = (_o = (_n = _rangeData.seriesRange) == null ? void 0 : _n[capturedSeries]) == null ? void 0 : _o[j2]) == null ? void 0 : _p.y[0]) == null ? void 0 : _q.y2) !== void 0 && {
26865
+ y2: (_u = (_t = (_s = (_r = _rangeData.seriesRange) == null ? void 0 : _r[capturedSeries]) == null ? void 0 : _s[j2]) == null ? void 0 : _t.y[0]) == null ? void 0 : _u.y2
26792
26866
  });
26793
26867
  if (shared) {
26794
26868
  ttCtx.tooltipLabels.drawSeriesTexts(__spreadProps(__spreadValues({}, commonSeriesTextsParams), {
@@ -26798,7 +26872,7 @@ var __async = (__this, __arguments, generator) => {
26798
26872
  handlePoints();
26799
26873
  } else if (this.tooltipUtil.hasBars()) {
26800
26874
  if (canvasMode) {
26801
- ttCtx.tooltipPosition.moveStickyTooltipOverBars(j, capturedSeries);
26875
+ ttCtx.tooltipPosition.moveStickyTooltipOverBars(j2, capturedSeries);
26802
26876
  }
26803
26877
  this.barSeriesHeight = this.tooltipUtil.getBarsHeight(
26804
26878
  /** @type {any[]} */
@@ -26806,13 +26880,13 @@ var __async = (__this, __arguments, generator) => {
26806
26880
  );
26807
26881
  if (this.barSeriesHeight > 0) {
26808
26882
  const graphics = new Graphics(this.w, this.ctx);
26809
- const paths = w.dom.Paper.find(`.apexcharts-bar-area[j='${j}']`);
26883
+ const paths = w.dom.Paper.find(`.apexcharts-bar-area[j='${j2}']`);
26810
26884
  this.deactivateHoverFilter();
26811
26885
  const points = ttCtx.tooltipUtil.getAllMarkers(true);
26812
26886
  if (points.length && !this.barSeriesHeight) {
26813
26887
  handlePoints();
26814
26888
  }
26815
- ttCtx.tooltipPosition.moveStickyTooltipOverBars(j, capturedSeries);
26889
+ ttCtx.tooltipPosition.moveStickyTooltipOverBars(j2, capturedSeries);
26816
26890
  for (let b = 0; b < paths.length; b++) {
26817
26891
  graphics.pathMouseEnter(
26818
26892
  /** @type {any} */
@@ -26828,12 +26902,12 @@ var __async = (__this, __arguments, generator) => {
26828
26902
  shared: false
26829
26903
  }, commonSeriesTextsParams));
26830
26904
  if (this.tooltipUtil.hasBars()) {
26831
- ttCtx.tooltipPosition.moveStickyTooltipOverBars(j, capturedSeries);
26905
+ ttCtx.tooltipPosition.moveStickyTooltipOverBars(j2, capturedSeries);
26832
26906
  }
26833
26907
  if (hasMarkers) {
26834
- ttCtx.tooltipPosition.moveMarkers(capturedSeries, j);
26908
+ ttCtx.tooltipPosition.moveMarkers(capturedSeries, j2);
26835
26909
  } else if (dynamicPoints) {
26836
- ttCtx.tooltipPosition.moveDynamicPointOnHover(j, capturedSeries);
26910
+ ttCtx.tooltipPosition.moveDynamicPointOnHover(j2, capturedSeries);
26837
26911
  }
26838
26912
  }
26839
26913
  }
@@ -28646,14 +28720,14 @@ var __async = (__this, __arguments, generator) => {
28646
28720
  const t2 = __spreadProps(__spreadValues({}, n2), { signatureVerified: true });
28647
28721
  return void (this.licenseKey === e2 ? this.publish(t2) : this.notify(t2));
28648
28722
  }
28649
- const h = "Invalid license key. The license signature does not verify.", d = { data: i2.data, expired: false, message: h, signatureVerified: true, valid: false };
28650
- this.licenseKey === e2 ? this.publish(d) : this.notify(d), t(`[Apex] ${h}`);
28723
+ const u = "Invalid license key. The license signature does not verify.", h = { data: i2.data, expired: false, message: u, signatureVerified: true, valid: false };
28724
+ this.licenseKey === e2 ? this.publish(h) : this.notify(h), t(`[Apex] ${u}`);
28651
28725
  });
28652
28726
  }
28653
28727
  };
28654
28728
  l.publicKeysSpki = ["MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEQIaK9UMD6n0oR/FIy8QdL0uSzKMQlf1BB+tOrji4/WuHsyRNxeDhVykoSsNURozMi1xhmqWvBH1L//xIfugTPA=="], l.verdicts = /* @__PURE__ */ new Map(), l.verifying = /* @__PURE__ */ new Set(), l.warnedUnverifiable = false, l.epoch = 0;
28655
28729
  let o = l;
28656
- const A = class {
28730
+ const j = class {
28657
28731
  static applyStyles(e2) {
28658
28732
  Object.assign(e2.style, this.CRITICAL_STYLES, { backgroundImage: this.createWatermarkPattern(), backgroundRepeat: "repeat" });
28659
28733
  }
@@ -28711,8 +28785,8 @@ var __async = (__this, __arguments, generator) => {
28711
28785
  })));
28712
28786
  }
28713
28787
  };
28714
- A.WATERMARK_ATTR = "data-apexcharts-watermark", A.WATERMARK_TEXT = "APEXCHARTS", A.ATTR = "data-apexcharts-watermark", A.CRITICAL_STYLES = { bottom: "0", display: "block", left: "0", msUserSelect: "none", opacity: "1", pointerEvents: "none", position: "absolute", right: "0", top: "0", userSelect: "none", visibility: "visible", webkitUserSelect: "none", zIndex: "10000" }, A.managed = /* @__PURE__ */ new Set(), A.subscribed = false;
28715
- let M = A;
28788
+ j.WATERMARK_ATTR = "data-apexcharts-watermark", j.WATERMARK_TEXT = "APEXCHARTS", j.ATTR = "data-apexcharts-watermark", j.CRITICAL_STYLES = { bottom: "0", display: "block", left: "0", msUserSelect: "none", opacity: "1", pointerEvents: "none", position: "absolute", right: "0", top: "0", userSelect: "none", visibility: "visible", webkitUserSelect: "none", zIndex: "10000" }, j.managed = /* @__PURE__ */ new Set(), j.subscribed = false;
28789
+ let C = j;
28716
28790
  const PRICING_URL = "https://apexcharts.com/pricing";
28717
28791
  let _perspectivesTokenDecoded = false;
28718
28792
  const enforced = /* @__PURE__ */ new Set();
@@ -28765,15 +28839,15 @@ var __async = (__this, __arguments, generator) => {
28765
28839
  return typeof plan === "string" && PREMIUM_PLANS.has(plan.toLowerCase());
28766
28840
  }
28767
28841
  function reinstateWatermark(ctx, elWrap) {
28768
- const node = M.add(elWrap, { manage: false });
28842
+ const node = C.add(elWrap, { manage: false });
28769
28843
  if (!node || typeof MutationObserver === "undefined") return;
28770
28844
  if (ctx._wmNodeObserver && ctx._wmObservedNode === node) return;
28771
28845
  if (ctx._wmNodeObserver) ctx._wmNodeObserver.disconnect();
28772
28846
  const nodeObs = new MutationObserver(() => {
28773
- const n2 = M.node(elWrap);
28847
+ const n2 = C.node(elWrap);
28774
28848
  if (!n2) return;
28775
28849
  nodeObs.disconnect();
28776
- M.applyStyles(n2);
28850
+ C.applyStyles(n2);
28777
28851
  nodeObs.takeRecords();
28778
28852
  nodeObs.observe(n2, { attributes: true, attributeFilter: ["style"] });
28779
28853
  });
@@ -28785,7 +28859,7 @@ var __async = (__this, __arguments, generator) => {
28785
28859
  reinstateWatermark(ctx, elWrap);
28786
28860
  if (typeof MutationObserver === "undefined" || ctx._wmWrapObserver) return;
28787
28861
  const wrapObs = new MutationObserver(() => {
28788
- if (!M.node(elWrap)) reinstateWatermark(ctx, elWrap);
28862
+ if (!C.node(elWrap)) reinstateWatermark(ctx, elWrap);
28789
28863
  });
28790
28864
  wrapObs.observe(elWrap, { childList: true });
28791
28865
  ctx._wmWrapObserver = wrapObs;
@@ -28801,7 +28875,7 @@ var __async = (__this, __arguments, generator) => {
28801
28875
  }
28802
28876
  ctx._wmObservedNode = null;
28803
28877
  const wrap = elWrap || ctx.w && ctx.w.dom && ctx.w.dom.elWrap;
28804
- if (wrap) M.remove(wrap, { manage: false });
28878
+ if (wrap) C.remove(wrap, { manage: false });
28805
28879
  }
28806
28880
  function notifyTrial(ctx, key, features) {
28807
28881
  if (ctx._premiumLicenseNotified) return;
@@ -29178,8 +29252,9 @@ var __async = (__this, __arguments, generator) => {
29178
29252
  /**
29179
29253
  * @param {any[]} ser
29180
29254
  * @param {object} opts
29255
+ * @param {boolean} [overwriteInitialSeries=true]
29181
29256
  */
29182
- create(ser, opts) {
29257
+ create(ser, opts, overwriteInitialSeries = true) {
29183
29258
  var _a, _b, _c, _d, _e, _f;
29184
29259
  const w = this.w;
29185
29260
  if (!this.core) {
@@ -29226,7 +29301,7 @@ var __async = (__this, __arguments, generator) => {
29226
29301
  if (Environment.isBrowser()) {
29227
29302
  this.events.setupEventHandlers();
29228
29303
  }
29229
- const parsedState = this.data.parseData(series);
29304
+ const parsedState = this.data.parseData(series, overwriteInitialSeries);
29230
29305
  this._writeParsedSeriesData(parsedState.seriesData);
29231
29306
  this._writeParsedRangeData(parsedState.rangeData);
29232
29307
  this._writeParsedCandleData(parsedState.candleData);
@@ -29293,7 +29368,7 @@ var __async = (__this, __arguments, generator) => {
29293
29368
  const me = this;
29294
29369
  const w = me.w;
29295
29370
  return new Promise((resolve, reject) => {
29296
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
29371
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
29297
29372
  if (me.el === null) {
29298
29373
  return reject(
29299
29374
  new Error("Not enough data to display or target element not found")
@@ -29391,9 +29466,11 @@ var __async = (__this, __arguments, generator) => {
29391
29466
  }
29392
29467
  if (w.config.chart.toolbar.show && !w.globals.allSeriesCollapsed) {
29393
29468
  (_k = me.toolbar) == null ? void 0 : _k.createToolbar();
29469
+ } else if (!w.globals.allSeriesCollapsed && ((_l = me.toolbar) == null ? void 0 : _l.resetControlDue())) {
29470
+ me.toolbar.createToolbar({ resetOnly: true });
29394
29471
  }
29395
29472
  }
29396
- (_l = me.weave) == null ? void 0 : _l.dispatch("draw", {
29473
+ (_m = me.weave) == null ? void 0 : _m.dispatch("draw", {
29397
29474
  pass: "full",
29398
29475
  xyRatios: graphData == null ? void 0 : graphData.xyRatios
29399
29476
  });
@@ -29582,6 +29659,7 @@ var __async = (__this, __arguments, generator) => {
29582
29659
  * @returns {Promise<ApexCharts>} Resolves with the chart instance after re-render.
29583
29660
  */
29584
29661
  appendData(newData, overwriteInitialSeries = true) {
29662
+ var _a;
29585
29663
  const me = this;
29586
29664
  me.data.resetParsingFlags();
29587
29665
  me.w.globals.dataChanged = true;
@@ -29596,14 +29674,13 @@ var __async = (__this, __arguments, generator) => {
29596
29674
  newData[i2]
29597
29675
  );
29598
29676
  if (src && Array.isArray(src.data) && Array.isArray(derivedRaw[i2].data)) {
29599
- for (let j = 0; j < src.data.length; j++) {
29600
- derivedRaw[i2].data.push(src.data[j]);
29601
- }
29677
+ derivedRaw[i2].data = derivedRaw[i2].data.concat(src.data);
29602
29678
  }
29603
29679
  }
29604
- return this.update();
29680
+ return this.update(void 0, overwriteInitialSeries);
29605
29681
  }
29606
29682
  const newSeries = me.w.config.series.slice();
29683
+ const reducerRaw = me.w.globals.dataReducerRawSeries;
29607
29684
  for (let i2 = 0; i2 < newSeries.length; i2++) {
29608
29685
  if (newData[i2] !== null && typeof newData[i2] !== "undefined") {
29609
29686
  const srcSerie = (
@@ -29614,17 +29691,15 @@ var __async = (__this, __arguments, generator) => {
29614
29691
  /** @type {any} */
29615
29692
  newSeries[i2]
29616
29693
  );
29617
- for (let j = 0; j < srcSerie.data.length; j++) {
29618
- dstSerie.data.push(srcSerie.data[j]);
29694
+ dstSerie.data = dstSerie.data.concat(srcSerie.data);
29695
+ if (reducerRaw && Array.isArray((_a = reducerRaw[i2]) == null ? void 0 : _a.data)) {
29696
+ reducerRaw[i2].data = reducerRaw[i2].data.concat(srcSerie.data);
29619
29697
  }
29620
29698
  }
29621
29699
  }
29622
29700
  trimStreamingSeries(newSeries, me.w);
29623
29701
  me.w.config.series = newSeries;
29624
- if (overwriteInitialSeries) {
29625
- me.w.globals.initialSeries = me.w.config.series;
29626
- }
29627
- return this.update();
29702
+ return this.update(void 0, overwriteInitialSeries);
29628
29703
  }
29629
29704
  /**
29630
29705
  * True when an options object carries enough series data that a
@@ -29646,15 +29721,22 @@ var __async = (__this, __arguments, generator) => {
29646
29721
  }
29647
29722
  /**
29648
29723
  * @param {object} [options]
29724
+ * @param {boolean} [overwriteInitialSeries=false] true only when the caller
29725
+ * redefined the series before triggering this re-render, so the parse it
29726
+ * runs is the one that captures the new baseline.
29649
29727
  */
29650
- update(options2) {
29728
+ update(options2, overwriteInitialSeries = false) {
29651
29729
  return new Promise((resolve, reject) => {
29652
29730
  if (options2 && this.lastUpdateOptions && !_ApexCharts._optionsTooBigToCompare(options2) && Utils$1.stringifyForCompare(this.lastUpdateOptions) === Utils$1.stringifyForCompare(options2)) {
29653
29731
  return resolve(this);
29654
29732
  }
29655
29733
  this.lastUpdateOptions = options2 && !_ApexCharts._optionsTooBigToCompare(options2) ? Utils$1.clone(options2) : null;
29656
29734
  new Destroy(this.ctx).clear({ isUpdating: true });
29657
- const graphData = this.create(this.w.config.series, options2 != null ? options2 : {});
29735
+ const graphData = this.create(
29736
+ this.w.config.series,
29737
+ options2 != null ? options2 : {},
29738
+ overwriteInitialSeries
29739
+ );
29658
29740
  if (!graphData) return resolve(this);
29659
29741
  this.mount(graphData).then(() => {
29660
29742
  var _a;