velo-plot 2.0.0 → 2.20.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 (65) hide show
  1. package/dist/{ChartCore-BhQ4j7f5.js → ChartCore-ivzLqxVb.js} +419 -393
  2. package/dist/ChartCore-ivzLqxVb.js.map +1 -0
  3. package/dist/{SciPlot-GJvw7GJo.js → SciPlot-CEU4ApgD.js} +2 -2
  4. package/dist/{SciPlot-GJvw7GJo.js.map → SciPlot-CEU4ApgD.js.map} +1 -1
  5. package/dist/{axisFormat-SPX-CD5s.js → axisFormat-CzumxpCL.js} +3 -3
  6. package/dist/axisFormat-CzumxpCL.js.map +1 -0
  7. package/dist/core/chart/ChartAxisManager.d.ts +2 -0
  8. package/dist/core/chart/ChartCore.d.ts +15 -0
  9. package/dist/core/chart/ChartPluginBridge.d.ts +1 -0
  10. package/dist/core/chart/ChartRenderLoop.d.ts +2 -0
  11. package/dist/core/chart/ChartStateManager.d.ts +2 -0
  12. package/dist/core/chart/types.d.ts +5 -0
  13. package/dist/core/sync/index.d.ts +0 -1
  14. package/dist/{createStackedChart-DJSmqerD.js → createStackedChart-DxNW0VkF.js} +178 -179
  15. package/dist/createStackedChart-DxNW0VkF.js.map +1 -0
  16. package/dist/{index-D7dTq6VB.js → index-BBpJwOct.js} +17 -19
  17. package/dist/index-BBpJwOct.js.map +1 -0
  18. package/dist/{index-CUGS98p4.js → index-CaXWSOTk.js} +3 -6
  19. package/dist/index-CaXWSOTk.js.map +1 -0
  20. package/dist/{index-CWipqOLP.js → index-qunX30Xu.js} +2 -2
  21. package/dist/{index-CWipqOLP.js.map → index-qunX30Xu.js.map} +1 -1
  22. package/dist/{index.core-fpZ1dYN0.js → index.core-COREBDNq.js} +25 -24
  23. package/dist/{index.core-fpZ1dYN0.js.map → index.core-COREBDNq.js.map} +1 -1
  24. package/dist/index.d.ts +1 -1
  25. package/dist/{mockDatafeed-Cdg5hKEo.js → mockDatafeed-927foCM4.js} +2 -2
  26. package/dist/mockDatafeed-927foCM4.js.map +1 -0
  27. package/dist/plugins/analysis/contours.d.ts +31 -0
  28. package/dist/plugins/analysis.js +494 -407
  29. package/dist/plugins/analysis.js.map +1 -1
  30. package/dist/plugins/broken-axis.js +170 -181
  31. package/dist/plugins/broken-axis.js.map +1 -1
  32. package/dist/plugins/forecasting/algorithms.d.ts +7 -2
  33. package/dist/plugins/forecasting/types.d.ts +13 -3
  34. package/dist/plugins/forecasting.js +355 -175
  35. package/dist/plugins/forecasting.js.map +1 -1
  36. package/dist/plugins/latex/symbols.d.ts +50 -0
  37. package/dist/plugins/latex/types.d.ts +13 -1
  38. package/dist/plugins/latex.js +351 -331
  39. package/dist/plugins/latex.js.map +1 -1
  40. package/dist/plugins/ml-integration/native-algorithms.d.ts +24 -4
  41. package/dist/plugins/ml-integration/types.d.ts +19 -0
  42. package/dist/plugins/ml-integration.js +191 -140
  43. package/dist/plugins/ml-integration.js.map +1 -1
  44. package/dist/plugins/pattern-recognition/types.d.ts +28 -1
  45. package/dist/plugins/pattern-recognition.js +416 -343
  46. package/dist/plugins/pattern-recognition.js.map +1 -1
  47. package/dist/plugins/snapshot.js +36 -36
  48. package/dist/plugins/snapshot.js.map +1 -1
  49. package/dist/plugins/sync.js +1 -1
  50. package/dist/plugins/tools.js +1 -1
  51. package/dist/plugins/virtualization.js +1 -1
  52. package/dist/react.js +2 -2
  53. package/dist/symbols-DT0eLlpW.js +568 -0
  54. package/dist/symbols-DT0eLlpW.js.map +1 -0
  55. package/dist/trading.js +5 -5
  56. package/dist/velo-plot.full.js +184 -182
  57. package/dist/velo-plot.js +3 -3
  58. package/dist/workers/indicatorsAsync.d.ts +24 -0
  59. package/package.json +1 -1
  60. package/dist/ChartCore-BhQ4j7f5.js.map +0 -1
  61. package/dist/axisFormat-SPX-CD5s.js.map +0 -1
  62. package/dist/createStackedChart-DJSmqerD.js.map +0 -1
  63. package/dist/index-CUGS98p4.js.map +0 -1
  64. package/dist/index-D7dTq6VB.js.map +0 -1
  65. package/dist/mockDatafeed-Cdg5hKEo.js.map +0 -1
@@ -1,12 +1,13 @@
1
1
  var ct = Object.defineProperty;
2
2
  var ut = (i, e, t) => e in i ? ct(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t;
3
3
  var m = (i, e, t) => ut(i, typeof e != "symbol" ? e + "" : e, t);
4
- import { g as qe, h as Ge, a as je, c as Ze, E as dt } from "./axisFormat-SPX-CD5s.js";
4
+ import { g as qe, h as Ge, a as je, c as Qe, E as dt } from "./axisFormat-CzumxpCL.js";
5
5
  import { G as ft } from "./gpuRenderer-BpaMYz-k.js";
6
6
  import "./index-x4stH3jD.js";
7
7
  import { P as gt } from "./index-qhscKTDy.js";
8
+ import "./symbols-DT0eLlpW.js";
8
9
  import { f as yt, m as mt, e as pt, s as xt, r as bt, a as vt } from "./indicators--eJGmVox.js";
9
- import { n as wt, W as St } from "./pool-15HMCNv8.js";
10
+ import { n as St, W as wt } from "./pool-15HMCNv8.js";
10
11
  const ae = { top: 20, right: 30, bottom: 55, left: 75 };
11
12
  class Mt {
12
13
  constructor(e) {
@@ -281,7 +282,7 @@ function Ft(i, e, t) {
281
282
  }
282
283
  return [n, s, o];
283
284
  }
284
- function Qe(i, e) {
285
+ function Ze(i, e) {
285
286
  const t = Math.min(i.length, e.length), n = new Float32Array(t * 2);
286
287
  for (let s = 0; s < t; s++)
287
288
  n[s * 2] = i[s], n[s * 2 + 1] = e[s];
@@ -290,7 +291,7 @@ function Qe(i, e) {
290
291
  function Dt(i, e, t = "after") {
291
292
  const n = Math.min(i.length, e.length);
292
293
  if (n < 2)
293
- return Qe(i, e);
294
+ return Ze(i, e);
294
295
  const s = t === "center" ? 1 + (n - 1) * 3 : n * 2 - 1, o = new Float32Array(s * 2);
295
296
  let r = 0;
296
297
  for (let a = 0; a < n; a++)
@@ -340,8 +341,8 @@ function zt(i, e, t, n, s, o, r) {
340
341
  const a = i.length, l = r / 2, h = new Float32Array(a * 20), d = new Float32Array(a * 12);
341
342
  let c = 0, f = 0;
342
343
  for (let u = 0; u < a; u++) {
343
- const g = i[u], y = e[u], x = t[u], b = n[u], w = s[u], p = o[u];
344
- h[c++] = g, h[c++] = y, h[c++] = g, h[c++] = x, h[c++] = g, h[c++] = w, h[c++] = g, h[c++] = p, h[c++] = g - l, h[c++] = b, h[c++] = g + l, h[c++] = b, h[c++] = g - l, h[c++] = x, h[c++] = g + l, h[c++] = x, h[c++] = g - l, h[c++] = w, h[c++] = g + l, h[c++] = w, d[f++] = g - l, d[f++] = x, d[f++] = g + l, d[f++] = x, d[f++] = g + l, d[f++] = w, d[f++] = g - l, d[f++] = x, d[f++] = g + l, d[f++] = w, d[f++] = g - l, d[f++] = w;
344
+ const g = i[u], y = e[u], x = t[u], b = n[u], S = s[u], p = o[u];
345
+ h[c++] = g, h[c++] = y, h[c++] = g, h[c++] = x, h[c++] = g, h[c++] = S, h[c++] = g, h[c++] = p, h[c++] = g - l, h[c++] = b, h[c++] = g + l, h[c++] = b, h[c++] = g - l, h[c++] = x, h[c++] = g + l, h[c++] = x, h[c++] = g - l, h[c++] = S, h[c++] = g + l, h[c++] = S, d[f++] = g - l, d[f++] = x, d[f++] = g + l, d[f++] = x, d[f++] = g + l, d[f++] = S, d[f++] = g - l, d[f++] = x, d[f++] = g + l, d[f++] = S, d[f++] = g - l, d[f++] = S;
345
346
  }
346
347
  return { lines: h, boxes: d };
347
348
  }
@@ -349,11 +350,11 @@ function Ot(i, e, t, n) {
349
350
  const s = i.length, o = t / 2, r = new Float32Array(s * 12), a = new Float32Array(s * 12), l = new Float32Array(s * 12), h = new Float32Array((s - 1) * 4);
350
351
  let d = 0, c = 0, f = 0, u = 0, g = 0;
351
352
  for (let y = 0; y < s; y++) {
352
- const x = i[y], b = e[y], w = (n == null ? void 0 : n[y]) ?? !1;
353
+ const x = i[y], b = e[y], S = (n == null ? void 0 : n[y]) ?? !1;
353
354
  let p, v;
354
- if (w ? (p = 0, v = g, l[f++] = x - o, l[f++] = p, l[f++] = x + o, l[f++] = p, l[f++] = x + o, l[f++] = v, l[f++] = x - o, l[f++] = p, l[f++] = x + o, l[f++] = v, l[f++] = x - o, l[f++] = v) : (p = g, v = g + b, g = v, b >= 0 ? (r[d++] = x - o, r[d++] = p, r[d++] = x + o, r[d++] = p, r[d++] = x + o, r[d++] = v, r[d++] = x - o, r[d++] = p, r[d++] = x + o, r[d++] = v, r[d++] = x - o, r[d++] = v) : (a[c++] = x - o, a[c++] = v, a[c++] = x + o, a[c++] = v, a[c++] = x + o, a[c++] = p, a[c++] = x - o, a[c++] = v, a[c++] = x + o, a[c++] = p, a[c++] = x - o, a[c++] = p)), y < s - 1) {
355
- const S = i[y + 1];
356
- h[u++] = x + o, h[u++] = v, h[u++] = S - o, h[u++] = v;
355
+ if (S ? (p = 0, v = g, l[f++] = x - o, l[f++] = p, l[f++] = x + o, l[f++] = p, l[f++] = x + o, l[f++] = v, l[f++] = x - o, l[f++] = p, l[f++] = x + o, l[f++] = v, l[f++] = x - o, l[f++] = v) : (p = g, v = g + b, g = v, b >= 0 ? (r[d++] = x - o, r[d++] = p, r[d++] = x + o, r[d++] = p, r[d++] = x + o, r[d++] = v, r[d++] = x - o, r[d++] = p, r[d++] = x + o, r[d++] = v, r[d++] = x - o, r[d++] = v) : (a[c++] = x - o, a[c++] = v, a[c++] = x + o, a[c++] = v, a[c++] = x + o, a[c++] = p, a[c++] = x - o, a[c++] = v, a[c++] = x + o, a[c++] = p, a[c++] = x - o, a[c++] = p)), y < s - 1) {
356
+ const w = i[y + 1];
357
+ h[u++] = x + o, h[u++] = v, h[u++] = w - o, h[u++] = v;
357
358
  }
358
359
  }
359
360
  return {
@@ -423,14 +424,14 @@ function Vt(i, e, t, n, s, o) {
423
424
  s.translate[1]
424
425
  ), i.uniform4f(e.uniforms.uColor, o[0], o[1], o[2], o[3]), i.drawArrays(i.TRIANGLES, 0, n), i.disableVertexAttribArray(e.attributes.position);
425
426
  }
426
- function Wt(i, e, t, n, s, o, r = 1) {
427
+ function Xt(i, e, t, n, s, o, r = 1) {
427
428
  i.useProgram(e.program), i.lineWidth(r), i.bindBuffer(i.ARRAY_BUFFER, t), i.enableVertexAttribArray(e.attributes.position), i.vertexAttribPointer(e.attributes.position, 2, i.FLOAT, !1, 0, 0), i.uniform2f(e.uniforms.uScale, s.scale[0], s.scale[1]), i.uniform2f(
428
429
  e.uniforms.uTranslate,
429
430
  s.translate[0],
430
431
  s.translate[1]
431
432
  ), i.uniform4f(e.uniforms.uColor, o[0], o[1], o[2], o[3]), i.drawArrays(i.LINES, 0, n), i.disableVertexAttribArray(e.attributes.position);
432
433
  }
433
- function Xt(i, e, t, n, s) {
434
+ function Wt(i, e, t, n, s) {
434
435
  const o = Be(s);
435
436
  i.useProgram(e.line.program), i.bindBuffer(i.ARRAY_BUFFER, t.boxBuffer), i.enableVertexAttribArray(e.line.attributes.position), i.vertexAttribPointer(e.line.attributes.position, 2, i.FLOAT, !1, 0, 0), i.uniform2f(e.line.uniforms.uScale, n.scale[0], n.scale[1]), i.uniform2f(
436
437
  e.line.uniforms.uTranslate,
@@ -470,9 +471,9 @@ function Nt(i, e, t, n, s, o) {
470
471
  const f = $t(r, o.invertX);
471
472
  for (const u of s) {
472
473
  if (!u.visible || u.count === 0 && u.type !== "boxplot" && u.type !== "waterfall") continue;
473
- const g = u.yBounds ? u.yBounds.min : r.yMin, x = (u.yBounds ? u.yBounds.max : r.yMax) - g, b = x > 0 ? 2 / x : 1, w = -1 - g * b, p = {
474
+ const g = u.yBounds ? u.yBounds.min : r.yMin, x = (u.yBounds ? u.yBounds.max : r.yMax) - g, b = x > 0 ? 2 / x : 1, S = -1 - g * b, p = {
474
475
  scale: [f.scale[0], b],
475
- translate: [f.translate[0], w]
476
+ translate: [f.translate[0], S]
476
477
  }, v = Be(u.style);
477
478
  if (u.type === "scatter")
478
479
  Ae(
@@ -570,7 +571,7 @@ function Nt(i, e, t, n, s, o) {
570
571
  v
571
572
  );
572
573
  else if (u.type === "boxplot")
573
- u.boxBuffer && u.boxLinesBuffer && Xt(
574
+ u.boxBuffer && u.boxLinesBuffer && Wt(
574
575
  i,
575
576
  { line: n.lineProgram, point: n.pointProgram },
576
577
  {
@@ -583,19 +584,19 @@ function Nt(i, e, t, n, s, o) {
583
584
  u.style
584
585
  );
585
586
  else if (u.type === "waterfall") {
586
- const S = _(u.style.positiveColor || "#22c55e"), M = _(u.style.negativeColor || "#ef4444"), A = _(u.style.subtotalColor || "#3b82f6"), k = _(u.style.connectorColor || "#64748b");
587
- u.wfPositiveBuffer && u.wfPositiveCount && u.wfPositiveCount > 0 && (i.useProgram(n.lineProgram.program), i.bindBuffer(i.ARRAY_BUFFER, u.wfPositiveBuffer), i.enableVertexAttribArray(n.lineProgram.attributes.position), i.vertexAttribPointer(n.lineProgram.attributes.position, 2, i.FLOAT, !1, 0, 0), i.uniform2f(n.lineProgram.uniforms.uScale, p.scale[0], p.scale[1]), i.uniform2f(n.lineProgram.uniforms.uTranslate, p.translate[0], p.translate[1]), i.uniform4f(n.lineProgram.uniforms.uColor, S[0], S[1], S[2], 0.9), i.drawArrays(i.TRIANGLES, 0, u.wfPositiveCount)), u.wfNegativeBuffer && u.wfNegativeCount && u.wfNegativeCount > 0 && (i.useProgram(n.lineProgram.program), i.bindBuffer(i.ARRAY_BUFFER, u.wfNegativeBuffer), i.enableVertexAttribArray(n.lineProgram.attributes.position), i.vertexAttribPointer(n.lineProgram.attributes.position, 2, i.FLOAT, !1, 0, 0), i.uniform2f(n.lineProgram.uniforms.uScale, p.scale[0], p.scale[1]), i.uniform2f(n.lineProgram.uniforms.uTranslate, p.translate[0], p.translate[1]), i.uniform4f(n.lineProgram.uniforms.uColor, M[0], M[1], M[2], 0.9), i.drawArrays(i.TRIANGLES, 0, u.wfNegativeCount)), u.wfSubtotalBuffer && u.wfSubtotalCount && u.wfSubtotalCount > 0 && (i.useProgram(n.lineProgram.program), i.bindBuffer(i.ARRAY_BUFFER, u.wfSubtotalBuffer), i.enableVertexAttribArray(n.lineProgram.attributes.position), i.vertexAttribPointer(n.lineProgram.attributes.position, 2, i.FLOAT, !1, 0, 0), i.uniform2f(n.lineProgram.uniforms.uScale, p.scale[0], p.scale[1]), i.uniform2f(n.lineProgram.uniforms.uTranslate, p.translate[0], p.translate[1]), i.uniform4f(n.lineProgram.uniforms.uColor, A[0], A[1], A[2], 0.9), i.drawArrays(i.TRIANGLES, 0, u.wfSubtotalCount)), u.style.showConnectors !== !1 && u.wfConnectorBuffer && u.wfConnectorCount && u.wfConnectorCount > 0 && (i.useProgram(n.lineProgram.program), i.bindBuffer(i.ARRAY_BUFFER, u.wfConnectorBuffer), i.enableVertexAttribArray(n.lineProgram.attributes.position), i.vertexAttribPointer(n.lineProgram.attributes.position, 2, i.FLOAT, !1, 0, 0), i.uniform2f(n.lineProgram.uniforms.uScale, p.scale[0], p.scale[1]), i.uniform2f(n.lineProgram.uniforms.uTranslate, p.translate[0], p.translate[1]), i.uniform4f(n.lineProgram.uniforms.uColor, k[0], k[1], k[2], 0.6), i.lineWidth(1), i.drawArrays(i.LINES, 0, u.wfConnectorCount)), i.disableVertexAttribArray(n.lineProgram.attributes.position);
587
+ const w = _(u.style.positiveColor || "#22c55e"), M = _(u.style.negativeColor || "#ef4444"), A = _(u.style.subtotalColor || "#3b82f6"), k = _(u.style.connectorColor || "#64748b");
588
+ u.wfPositiveBuffer && u.wfPositiveCount && u.wfPositiveCount > 0 && (i.useProgram(n.lineProgram.program), i.bindBuffer(i.ARRAY_BUFFER, u.wfPositiveBuffer), i.enableVertexAttribArray(n.lineProgram.attributes.position), i.vertexAttribPointer(n.lineProgram.attributes.position, 2, i.FLOAT, !1, 0, 0), i.uniform2f(n.lineProgram.uniforms.uScale, p.scale[0], p.scale[1]), i.uniform2f(n.lineProgram.uniforms.uTranslate, p.translate[0], p.translate[1]), i.uniform4f(n.lineProgram.uniforms.uColor, w[0], w[1], w[2], 0.9), i.drawArrays(i.TRIANGLES, 0, u.wfPositiveCount)), u.wfNegativeBuffer && u.wfNegativeCount && u.wfNegativeCount > 0 && (i.useProgram(n.lineProgram.program), i.bindBuffer(i.ARRAY_BUFFER, u.wfNegativeBuffer), i.enableVertexAttribArray(n.lineProgram.attributes.position), i.vertexAttribPointer(n.lineProgram.attributes.position, 2, i.FLOAT, !1, 0, 0), i.uniform2f(n.lineProgram.uniforms.uScale, p.scale[0], p.scale[1]), i.uniform2f(n.lineProgram.uniforms.uTranslate, p.translate[0], p.translate[1]), i.uniform4f(n.lineProgram.uniforms.uColor, M[0], M[1], M[2], 0.9), i.drawArrays(i.TRIANGLES, 0, u.wfNegativeCount)), u.wfSubtotalBuffer && u.wfSubtotalCount && u.wfSubtotalCount > 0 && (i.useProgram(n.lineProgram.program), i.bindBuffer(i.ARRAY_BUFFER, u.wfSubtotalBuffer), i.enableVertexAttribArray(n.lineProgram.attributes.position), i.vertexAttribPointer(n.lineProgram.attributes.position, 2, i.FLOAT, !1, 0, 0), i.uniform2f(n.lineProgram.uniforms.uScale, p.scale[0], p.scale[1]), i.uniform2f(n.lineProgram.uniforms.uTranslate, p.translate[0], p.translate[1]), i.uniform4f(n.lineProgram.uniforms.uColor, A[0], A[1], A[2], 0.9), i.drawArrays(i.TRIANGLES, 0, u.wfSubtotalCount)), u.style.showConnectors !== !1 && u.wfConnectorBuffer && u.wfConnectorCount && u.wfConnectorCount > 0 && (i.useProgram(n.lineProgram.program), i.bindBuffer(i.ARRAY_BUFFER, u.wfConnectorBuffer), i.enableVertexAttribArray(n.lineProgram.attributes.position), i.vertexAttribPointer(n.lineProgram.attributes.position, 2, i.FLOAT, !1, 0, 0), i.uniform2f(n.lineProgram.uniforms.uScale, p.scale[0], p.scale[1]), i.uniform2f(n.lineProgram.uniforms.uTranslate, p.translate[0], p.translate[1]), i.uniform4f(n.lineProgram.uniforms.uColor, k[0], k[1], k[2], 0.6), i.lineWidth(1), i.drawArrays(i.LINES, 0, u.wfConnectorCount)), i.disableVertexAttribArray(n.lineProgram.attributes.position);
588
589
  }
589
590
  if (u.errorBuffer && u.errorCount) {
590
- const S = u.style.errorBars || {}, M = S.color ? Be({ color: S.color, opacity: S.opacity ?? 0.7 }) : v;
591
- Wt(
591
+ const w = u.style.errorBars || {}, M = w.color ? Be({ color: w.color, opacity: w.opacity ?? 0.7 }) : v;
592
+ Xt(
592
593
  i,
593
594
  n.lineProgram,
594
595
  u.errorBuffer,
595
596
  u.errorCount,
596
597
  p,
597
598
  M,
598
- S.width ?? 1
599
+ w.width ?? 1
599
600
  );
600
601
  }
601
602
  }
@@ -647,7 +648,7 @@ class Pe {
647
648
  this.gl = t, this.programs = It(t), this.buffers = new Mt(t), this.textures = new Ht(t), t.enable(t.BLEND), t.blendFunc(t.SRC_ALPHA, t.ONE_MINUS_SRC_ALPHA), this.isInitialized = !0;
648
649
  }
649
650
  setDPR(e) {
650
- this.dpr = e, this.resize();
651
+ this.dpr = e;
651
652
  }
652
653
  get available() {
653
654
  return this.isInitialized;
@@ -948,7 +949,7 @@ const Ee = {
948
949
  ],
949
950
  highlightColor: "#000000"
950
951
  // Pure Black
951
- }, Zt = {
952
+ }, Qt = {
952
953
  name: "ocean",
953
954
  isDark: !0,
954
955
  colors: [
@@ -995,15 +996,15 @@ const Ee = {
995
996
  ],
996
997
  highlightColor: "#FFD700"
997
998
  // Gold
998
- }, Qt = [
999
+ }, Zt = [
999
1000
  Ee,
1000
1001
  Ke,
1001
1002
  Gt,
1002
1003
  jt,
1003
- Zt
1004
+ Qt
1004
1005
  ];
1005
1006
  function Oe(i) {
1006
- const e = Qt.find((t) => t.name === i);
1007
+ const e = Zt.find((t) => t.name === i);
1007
1008
  return e || (console.warn(`[ColorScheme] Unknown scheme "${i}", using vibrant`), Ee);
1008
1009
  }
1009
1010
  function $e(i) {
@@ -1211,7 +1212,7 @@ const H = {
1211
1212
  lineColor: "rgba(100, 180, 255, 0.6)"
1212
1213
  }
1213
1214
  };
1214
- function ns(i, e) {
1215
+ function os(i, e) {
1215
1216
  return {
1216
1217
  ...i,
1217
1218
  ...e,
@@ -1384,21 +1385,21 @@ class ii {
1384
1385
  for (const p of l) {
1385
1386
  const v = he(t.transform(p));
1386
1387
  if (v >= e.x && v <= e.x + e.width) {
1387
- const S = u ? this.formatXTick(p, n, g) : "";
1388
- (!u || S) && y.push({ tick: p, x: v, label: S });
1388
+ const w = u ? this.formatXTick(p, n, g) : "";
1389
+ (!u || w) && y.push({ tick: p, x: v, label: w });
1389
1390
  }
1390
1391
  }
1391
1392
  let x = !1;
1392
1393
  if (u && y.length > 1) {
1393
1394
  let p = 0;
1394
- for (const S of y)
1395
- p = Math.max(p, o.measureText(S.label).width);
1395
+ for (const w of y)
1396
+ p = Math.max(p, o.measureText(w.label).width);
1396
1397
  let v = 1 / 0;
1397
- for (let S = 1; S < y.length; S++)
1398
- v = Math.min(v, y[S].x - y[S - 1].x);
1398
+ for (let w = 1; w < y.length; w++)
1399
+ v = Math.min(v, y[w].x - y[w - 1].x);
1399
1400
  x = p + 8 > v;
1400
1401
  }
1401
- const b = h + r.tickLength + (x ? 6 : 3), w = x ? -Math.PI / 4 : void 0;
1402
+ const b = h + r.tickLength + (x ? 6 : 3), S = x ? -Math.PI / 4 : void 0;
1402
1403
  for (const p of y)
1403
1404
  f && (o.strokeStyle = r.tickColor, o.beginPath(), o.moveTo(p.x, h), o.lineTo(p.x, h + r.tickLength), o.stroke()), u && p.label && this.drawLatexOrText(
1404
1405
  p.label,
@@ -1410,7 +1411,7 @@ class ii {
1410
1411
  color: r.labelColor,
1411
1412
  align: x ? "right" : "center",
1412
1413
  baseline: x ? "middle" : "top",
1413
- rotation: w
1414
+ rotation: S
1414
1415
  }
1415
1416
  );
1416
1417
  }
@@ -1431,10 +1432,10 @@ class ii {
1431
1432
  drawYAxis(e, t, n, s = "left", o = 0, r) {
1432
1433
  const { ctx: a } = this, l = this.theme.yAxis, h = (n == null ? void 0 : n.tickCount) ?? 6, d = t.ticks(h), c = n == null ? void 0 : n.label, f = (n == null ? void 0 : n.showLine) !== !1, u = (n == null ? void 0 : n.showTicks) !== !1, g = (n == null ? void 0 : n.showLabels) !== !1, y = Y(s === "left" ? e.x - o : e.x + e.width + o), x = s === "left" ? -1 : 1;
1433
1434
  if (f && (a.strokeStyle = l.lineColor, a.lineWidth = l.lineWidth, a.beginPath(), a.moveTo(y, e.y), a.lineTo(y, e.y + e.height), a.stroke()), (u || g) && (a.fillStyle = l.labelColor, a.font = `${l.labelSize}px ${l.fontFamily}`, a.textAlign = s === "left" ? "right" : "left", a.textBaseline = "middle", d.forEach((b) => {
1434
- const w = he(t.transform(b));
1435
- if (w >= e.y && w <= e.y + e.height && (u && (a.strokeStyle = l.tickColor, a.beginPath(), a.moveTo(y, w), a.lineTo(y + l.tickLength * x, w), a.stroke()), g)) {
1435
+ const S = he(t.transform(b));
1436
+ if (S >= e.y && S <= e.y + e.height && (u && (a.strokeStyle = l.tickColor, a.beginPath(), a.moveTo(y, S), a.lineTo(y + l.tickLength * x, S), a.stroke()), g)) {
1436
1437
  const p = y + (l.tickLength + 3) * x;
1437
- this.drawLatexOrText(this.formatYTick(b, n), p, w, {
1438
+ this.drawLatexOrText(this.formatYTick(b, n), p, S, {
1438
1439
  fontSize: l.labelSize,
1439
1440
  fontFamily: l.fontFamily,
1440
1441
  color: l.labelColor,
@@ -1443,8 +1444,8 @@ class ii {
1443
1444
  });
1444
1445
  }
1445
1446
  })), c) {
1446
- const b = (r == null ? void 0 : r.titleGap) ?? 50, w = s === "left" ? y - b : y + b, p = e.y + e.height / 2;
1447
- this.drawLatexOrText(c, w, p, {
1447
+ const b = (r == null ? void 0 : r.titleGap) ?? 50, S = s === "left" ? y - b : y + b, p = e.y + e.height / 2;
1448
+ this.drawLatexOrText(c, S, p, {
1448
1449
  fontSize: l.titleSize,
1449
1450
  fontFamily: l.fontFamily,
1450
1451
  color: l.titleColor,
@@ -1522,8 +1523,8 @@ class ii {
1522
1523
  n.moveTo(h + c, d), n.lineTo(h + a - c, d), n.arcTo(h + a, d, h + a, d + c, c), n.lineTo(h + a, d + l - c), n.arcTo(h + a, d + l, h + a - c, d + l, c), n.lineTo(h + c, d + l), n.arcTo(h, d + l, h, d + l - c, c), n.lineTo(h, d + c), n.arcTo(h, d, h + c, d, c), n.closePath(), n.fill(), n.stroke(), n.textAlign = "left", n.textBaseline = "middle", r.forEach((f, u) => {
1523
1524
  const g = d + s.padding + u * (s.swatchSize + s.itemGap), y = h + s.padding, x = g + s.swatchSize / 2, b = y + s.swatchSize / 2;
1524
1525
  n.save(), n.globalAlpha = f.opacity, n.fillStyle = f.color, n.strokeStyle = f.color, n.lineWidth = 2;
1525
- const w = s.swatchSize, p = String(f.type).toLowerCase(), v = !!f.symbol && f.symbol !== "circle", S = p === "scatter" || p === "1" || p === "line" && v, M = p.includes("scatter") || p === "2";
1526
- S ? this.drawLegendSymbol(n, f.symbol ?? "circle", b, x, w * 0.9) : M ? (n.beginPath(), n.moveTo(y, x), n.lineTo(y + w, x), n.stroke(), this.drawLegendSymbol(n, f.symbol ?? "circle", b, x, w * 0.6)) : (n.beginPath(), n.moveTo(y, x), n.lineTo(y + w, x), n.stroke()), n.restore(), this.drawLatexOrText(f.label, h + s.padding + s.swatchSize + 8, x, {
1526
+ const S = s.swatchSize, p = String(f.type).toLowerCase(), v = !!f.symbol && f.symbol !== "circle", w = p === "scatter" || p === "1" || p === "line" && v, M = p.includes("scatter") || p === "2";
1527
+ w ? this.drawLegendSymbol(n, f.symbol ?? "circle", b, x, S * 0.9) : M ? (n.beginPath(), n.moveTo(y, x), n.lineTo(y + S, x), n.stroke(), this.drawLegendSymbol(n, f.symbol ?? "circle", b, x, S * 0.6)) : (n.beginPath(), n.moveTo(y, x), n.lineTo(y + S, x), n.stroke()), n.restore(), this.drawLatexOrText(f.label, h + s.padding + s.swatchSize + 8, x, {
1527
1528
  fontSize: s.fontSize,
1528
1529
  fontFamily: s.fontFamily,
1529
1530
  color: s.textColor,
@@ -1599,9 +1600,9 @@ class ii {
1599
1600
  let f = 0;
1600
1601
  a.forEach((p) => {
1601
1602
  if (!!this.latexAPI && (p.includes("\\") || p.includes("^") || p.includes("_") || p.includes("{") && p.includes("}"))) {
1602
- const S = this.latexAPI.measure(p, { fontSize: r.tooltipSize });
1603
- d = Math.max(d, S.width);
1604
- const M = Math.max(l, S.height);
1603
+ const w = this.latexAPI.measure(p, { fontSize: r.tooltipSize });
1604
+ d = Math.max(d, w.width);
1605
+ const M = Math.max(l, w.height);
1605
1606
  c.push(M), f += M;
1606
1607
  } else
1607
1608
  d = Math.max(d, o.measureText(p).width), c.push(l), f += l;
@@ -1611,15 +1612,15 @@ class ii {
1611
1612
  y + u > s.x + s.width && (y = e - u - 15), x < s.y && (x = t + 15), o.fillStyle = r.tooltipBackground, o.strokeStyle = r.tooltipBorder, o.lineWidth = 1, o.beginPath();
1612
1613
  const b = 4;
1613
1614
  o.moveTo(y + b, x), o.lineTo(y + u - b, x), o.arcTo(y + u, x, y + u, x + b, b), o.lineTo(y + u, x + g - b), o.arcTo(y + u, x + g, y + u - b, x + g, b), o.lineTo(y + b, x + g), o.arcTo(y, x + g, y, x + g - b, b), o.lineTo(y, x + b), o.arcTo(y, x, y + b, x, b), o.closePath(), o.fill(), o.stroke();
1614
- let w = x + h;
1615
+ let S = x + h;
1615
1616
  a.forEach((p, v) => {
1616
- this.drawLatexOrText(p, y + h, w, {
1617
+ this.drawLatexOrText(p, y + h, S, {
1617
1618
  fontSize: r.tooltipSize,
1618
1619
  fontFamily: this.theme.xAxis.fontFamily,
1619
1620
  color: r.tooltipColor,
1620
1621
  align: "left",
1621
1622
  baseline: "top"
1622
- }), w += c[v];
1623
+ }), S += c[v];
1623
1624
  });
1624
1625
  }
1625
1626
  /**
@@ -1633,9 +1634,9 @@ class ii {
1633
1634
  let f = 0;
1634
1635
  r.forEach((p) => {
1635
1636
  if (!!this.latexAPI && (p.includes("\\") || p.includes("^") || p.includes("_") || p.includes("{") && p.includes("}"))) {
1636
- const S = this.latexAPI.measure(p, { fontSize: o.tooltipSize });
1637
- d = Math.max(d, S.width);
1638
- const M = Math.max(a, S.height);
1637
+ const w = this.latexAPI.measure(p, { fontSize: o.tooltipSize });
1638
+ d = Math.max(d, w.width);
1639
+ const M = Math.max(a, w.height);
1639
1640
  c.push(M), f += M;
1640
1641
  } else
1641
1642
  d = Math.max(d, s.measureText(p).width), c.push(a), f += a;
@@ -1659,15 +1660,15 @@ class ii {
1659
1660
  s.fillStyle = o.tooltipBackground, s.strokeStyle = o.tooltipBorder, s.lineWidth = 1, s.beginPath();
1660
1661
  const b = 4;
1661
1662
  s.moveTo(y + b, x), s.lineTo(y + u - b, x), s.arcTo(y + u, x, y + u, x + b, b), s.lineTo(y + u, x + g - b), s.arcTo(y + u, x + g, y + u - b, x + g, b), s.lineTo(y + b, x + g), s.arcTo(y, x + g, y, x + g - b, b), s.lineTo(y, x + b), s.arcTo(y, x, y + b, x, b), s.closePath(), s.fill(), s.stroke();
1662
- let w = x + l;
1663
+ let S = x + l;
1663
1664
  r.forEach((p, v) => {
1664
- this.drawLatexOrText(p, y + l, w, {
1665
+ this.drawLatexOrText(p, y + l, S, {
1665
1666
  fontSize: o.tooltipSize,
1666
1667
  fontFamily: this.theme.xAxis.fontFamily,
1667
1668
  color: o.tooltipColor,
1668
1669
  align: "left",
1669
1670
  baseline: "top"
1670
- }), w += c[v];
1671
+ }), S += c[v];
1671
1672
  });
1672
1673
  }
1673
1674
  /**
@@ -1689,14 +1690,14 @@ class ii {
1689
1690
  for (let y = 0; y < r.x.length; y++) {
1690
1691
  const x = n.transform(r.x[y]), b = s.transform(r.y[y]);
1691
1692
  if (x < e.x || x > e.x + e.width || b < e.y || b > e.y + e.height) continue;
1692
- const w = t.getYError(y);
1693
- if (w) {
1694
- const [v, S] = w, M = r.y[y], A = s.transform(M + S), k = s.transform(M - v);
1693
+ const S = t.getYError(y);
1694
+ if (S) {
1695
+ const [v, w] = S, M = r.y[y], A = s.transform(M + w), k = s.transform(M - v);
1695
1696
  o.beginPath(), (g === "both" || g === "positive") && (o.moveTo(x, b), o.lineTo(x, A), f && (o.moveTo(x - c / 2, A), o.lineTo(x + c / 2, A))), (g === "both" || g === "negative") && (o.moveTo(x, b), o.lineTo(x, k), f && (o.moveTo(x - c / 2, k), o.lineTo(x + c / 2, k))), o.stroke();
1696
1697
  }
1697
1698
  const p = t.getXError(y);
1698
1699
  if (p) {
1699
- const [v, S] = p, M = r.x[y], A = n.transform(M + S), k = n.transform(M - v);
1700
+ const [v, w] = p, M = r.x[y], A = n.transform(M + w), k = n.transform(M - v);
1700
1701
  o.beginPath(), (g === "both" || g === "positive") && (o.moveTo(x, b), o.lineTo(A, b), f && (o.moveTo(A, b - c / 2), o.lineTo(A, b + c / 2))), (g === "both" || g === "negative") && (o.moveTo(x, b), o.lineTo(k, b), f && (o.moveTo(k, b - c / 2), o.lineTo(k, b + c / 2))), o.stroke();
1701
1702
  }
1702
1703
  }
@@ -1729,14 +1730,14 @@ class ii {
1729
1730
  const r = t.getData(), a = this.ctx, l = r.x, h = r.high ?? r.y, d = r.low ?? r.y, c = r.close ?? r.y;
1730
1731
  for (const u of o) {
1731
1732
  const g = (() => {
1732
- let S = 0, M = Math.abs(l[0] - u.time);
1733
+ let w = 0, M = Math.abs(l[0] - u.time);
1733
1734
  for (let A = 1; A < l.length; A++) {
1734
1735
  const k = Math.abs(l[A] - u.time);
1735
- k < M && (M = k, S = A);
1736
+ k < M && (M = k, w = A);
1736
1737
  }
1737
- return S;
1738
- })(), y = u.position ?? "aboveBar", x = y === "belowBar" ? d[g] : y === "inBar" ? c[g] : h[g], b = e.x + n.transform(l[g]), w = e.y + s.transform(x), p = u.color ?? "#22c55e", v = y === "belowBar" ? 10 : -10;
1739
- a.save(), a.fillStyle = p, a.strokeStyle = p, a.lineWidth = 1.5, u.shape === "arrowDown" ? (a.beginPath(), a.moveTo(b, w - v), a.lineTo(b - 5, w - v - 8), a.lineTo(b + 5, w - v - 8), a.closePath(), a.fill()) : u.shape === "circle" ? (a.beginPath(), a.arc(b, w + v, 4, 0, Math.PI * 2), a.fill()) : (a.beginPath(), a.moveTo(b, w + v), a.lineTo(b - 5, w + v + 8), a.lineTo(b + 5, w + v + 8), a.closePath(), a.fill()), u.text && (a.font = "10px sans-serif", a.textAlign = "center", a.fillText(u.text, b, w + v + (y === "belowBar" ? 20 : -14))), a.restore();
1738
+ return w;
1739
+ })(), y = u.position ?? "aboveBar", x = y === "belowBar" ? d[g] : y === "inBar" ? c[g] : h[g], b = e.x + n.transform(l[g]), S = e.y + s.transform(x), p = u.color ?? "#22c55e", v = y === "belowBar" ? 10 : -10;
1740
+ a.save(), a.fillStyle = p, a.strokeStyle = p, a.lineWidth = 1.5, u.shape === "arrowDown" ? (a.beginPath(), a.moveTo(b, S - v), a.lineTo(b - 5, S - v - 8), a.lineTo(b + 5, S - v - 8), a.closePath(), a.fill()) : u.shape === "circle" ? (a.beginPath(), a.arc(b, S + v, 4, 0, Math.PI * 2), a.fill()) : (a.beginPath(), a.moveTo(b, S + v), a.lineTo(b - 5, S + v + 8), a.lineTo(b + 5, S + v + 8), a.closePath(), a.fill()), u.text && (a.font = "10px sans-serif", a.textAlign = "center", a.fillText(u.text, b, S + v + (y === "belowBar" ? 20 : -14))), a.restore();
1740
1741
  }
1741
1742
  }
1742
1743
  /** Horizontal dashed lines for active price alerts (Stage 2.19). */
@@ -1828,14 +1829,14 @@ class ni {
1828
1829
  else
1829
1830
  return;
1830
1831
  const d = this.getBounds(h), c = e.deltaY > 0 ? 1.1 : 0.9, f = (s - t.x) / t.width, u = 1 - (o - t.y) / t.height, g = d.xMin + f * (d.xMax - d.xMin), y = d.yMin + u * (d.yMax - d.yMin), x = 1e-12, b = 1e15;
1831
- let w = a ? g - (g - d.xMin) * c : d.xMin, p = a ? g + (d.xMax - g) * c : d.xMax, v = l ? y - (y - d.yMin) * c : d.yMin, S = l ? y + (d.yMax - y) * c : d.yMax;
1832
- const M = p - w, A = S - v;
1833
- (M < x || M > b) && (w = d.xMin, p = d.xMax), (A < x || A > b) && (v = d.yMin, S = d.yMax);
1832
+ let S = a ? g - (g - d.xMin) * c : d.xMin, p = a ? g + (d.xMax - g) * c : d.xMax, v = l ? y - (y - d.yMin) * c : d.yMin, w = l ? y + (d.yMax - y) * c : d.yMax;
1833
+ const M = p - S, A = w - v;
1834
+ (M < x || M > b) && (S = d.xMin, p = d.xMax), (A < x || A > b) && (v = d.yMin, w = d.yMax);
1834
1835
  const k = {
1835
- xMin: w,
1836
+ xMin: S,
1836
1837
  xMax: p,
1837
1838
  yMin: v,
1838
- yMax: S
1839
+ yMax: w
1839
1840
  };
1840
1841
  this.callbacks.onZoom(k, h);
1841
1842
  }
@@ -1856,10 +1857,10 @@ class ni {
1856
1857
  defaultPrevented: e.defaultPrevented
1857
1858
  }), e.defaultPrevented) return;
1858
1859
  const a = this.getAxesLayout();
1859
- for (const w of a) {
1860
+ for (const S of a) {
1860
1861
  let v;
1861
- if (w.position === "left" ? v = t.x - 65 - w.offset : v = t.x + t.width + w.offset, s >= v && s <= v + 65 && o >= t.y && o <= t.y + t.height) {
1862
- this.isDragging = !0, this.panningAxisId = w.id, this.lastMousePos = { x: e.clientX, y: e.clientY }, this.container.style.cursor = "ns-resize", (c = (d = this.callbacks).onDragStart) == null || c.call(d);
1862
+ if (S.position === "left" ? v = t.x - 65 - S.offset : v = t.x + t.width + S.offset, s >= v && s <= v + 65 && o >= t.y && o <= t.y + t.height) {
1863
+ this.isDragging = !0, this.panningAxisId = S.id, this.lastMousePos = { x: e.clientX, y: e.clientY }, this.container.style.cursor = "ns-resize", (c = (d = this.callbacks).onDragStart) == null || c.call(d);
1863
1864
  return;
1864
1865
  }
1865
1866
  }
@@ -1918,11 +1919,11 @@ class ni {
1918
1919
  return;
1919
1920
  }
1920
1921
  if (this.isBoxZooming) {
1921
- const y = Math.min(this.selectionStart.x, n), x = Math.min(this.selectionStart.y, s), b = Math.abs(n - this.selectionStart.x), w = Math.abs(s - this.selectionStart.y);
1922
- b > 5 && w > 5 && this.callbacks.onBoxZoom({ x: y, y: x, width: b, height: w }), this.callbacks.onBoxZoom(null);
1922
+ const y = Math.min(this.selectionStart.x, n), x = Math.min(this.selectionStart.y, s), b = Math.abs(n - this.selectionStart.x), S = Math.abs(s - this.selectionStart.y);
1923
+ b > 5 && S > 5 && this.callbacks.onBoxZoom({ x: y, y: x, width: b, height: S }), this.callbacks.onBoxZoom(null);
1923
1924
  } else if (this.isBoxSelecting) {
1924
- const y = Math.min(this.selectionStart.x, n), x = Math.min(this.selectionStart.y, s), b = Math.abs(n - this.selectionStart.x), w = Math.abs(s - this.selectionStart.y);
1925
- this.callbacks.onBoxSelect && this.callbacks.onBoxSelect({ x: y, y: x, width: b, height: w }, e.shiftKey);
1925
+ const y = Math.min(this.selectionStart.x, n), x = Math.min(this.selectionStart.y, s), b = Math.abs(n - this.selectionStart.x), S = Math.abs(s - this.selectionStart.y);
1926
+ this.callbacks.onBoxSelect && this.callbacks.onBoxSelect({ x: y, y: x, width: b, height: S }, e.shiftKey);
1926
1927
  }
1927
1928
  const o = this.isDragging || this.isBoxSelecting || this.isBoxZooming, r = Math.hypot(
1928
1929
  n - this.mouseDownPos.x,
@@ -2014,8 +2015,8 @@ class oi {
2014
2015
  if (g.x.length === 0) return;
2015
2016
  const y = f.getYAxisId() || this.ctx.getPrimaryYAxisId(), x = r.get(y);
2016
2017
  if (!x) return;
2017
- const b = o.invert(e), w = this.findNearestIndex(g.x, b), p = 50, v = Math.max(0, w - p), S = Math.min(g.x.length, w + p);
2018
- for (let M = v; M < S; M++) {
2018
+ const b = o.invert(e), S = this.findNearestIndex(g.x, b), p = 50, v = Math.max(0, S - p), w = Math.min(g.x.length, S + p);
2019
+ for (let M = v; M < w; M++) {
2019
2020
  const A = o.transform(g.x[M]), k = x.transform(g.y[M]), B = A - e, F = k - t, I = B * B + F * F;
2020
2021
  I < c && I <= h && (c = I, d = {
2021
2022
  seriesId: u,
@@ -2214,10 +2215,10 @@ class oi {
2214
2215
  indices: v
2215
2216
  }));
2216
2217
  this.selectPoints(b, e ? "add" : "single");
2217
- const w = this.getSelectedPoints();
2218
+ const S = this.getSelectedPoints();
2218
2219
  this.ctx.events.emit("regionSelect", {
2219
2220
  bounds: g,
2220
- containedPoints: w
2221
+ containedPoints: S
2221
2222
  });
2222
2223
  } else e || this.clearSelection();
2223
2224
  this.cancelBoxSelection();
@@ -2617,8 +2618,8 @@ function ui(i, e, t, n, s, o) {
2617
2618
  if (f === "after") c.push(`${g.toFixed(1)},${b.toFixed(1)}`);
2618
2619
  else if (f === "before") c.push(`${x.toFixed(1)},${y.toFixed(1)}`);
2619
2620
  else if (f === "center") {
2620
- const w = (x + g) / 2;
2621
- c.push(`${w.toFixed(1)},${b.toFixed(1)}`), c.push(`${w.toFixed(1)},${y.toFixed(1)}`);
2621
+ const S = (x + g) / 2;
2622
+ c.push(`${S.toFixed(1)},${b.toFixed(1)}`), c.push(`${S.toFixed(1)},${y.toFixed(1)}`);
2622
2623
  }
2623
2624
  }
2624
2625
  c.push(`${g.toFixed(1)},${y.toFixed(1)}`);
@@ -2658,13 +2659,13 @@ function ui(i, e, t, n, s, o) {
2658
2659
  const c = (h.barWidth || 5) * (t.width / (n.domain[1] - n.domain[0])), f = h.bullishColor || "#26a69a", u = h.bearishColor || "#ef5350";
2659
2660
  if (l.open && l.high && l.low && l.close)
2660
2661
  for (let g = 0; g < l.x.length; g++) {
2661
- const y = l.close[g] >= l.open[g], x = n.transform(l.x[g]), b = a.transform(l.open[g]), w = a.transform(l.close[g]), p = a.transform(l.high[g]), v = a.transform(l.low[g]), S = y ? f : u;
2662
+ const y = l.close[g] >= l.open[g], x = n.transform(l.x[g]), b = a.transform(l.open[g]), S = a.transform(l.close[g]), p = a.transform(l.high[g]), v = a.transform(l.low[g]), w = y ? f : u;
2662
2663
  i.push(
2663
- `<line x1="${x.toFixed(1)}" y1="${p.toFixed(1)}" x2="${x.toFixed(1)}" y2="${v.toFixed(1)}" stroke="${S}" stroke-width="1" />`
2664
+ `<line x1="${x.toFixed(1)}" y1="${p.toFixed(1)}" x2="${x.toFixed(1)}" y2="${v.toFixed(1)}" stroke="${w}" stroke-width="1" />`
2664
2665
  );
2665
- const M = Math.min(b, w), A = Math.max(1, Math.abs(b - w));
2666
+ const M = Math.min(b, S), A = Math.max(1, Math.abs(b - S));
2666
2667
  i.push(
2667
- `<rect x="${(x - c / 2).toFixed(1)}" y="${M.toFixed(1)}" width="${c.toFixed(1)}" height="${A.toFixed(1)}" fill="${S}" />`
2668
+ `<rect x="${(x - c / 2).toFixed(1)}" y="${M.toFixed(1)}" width="${c.toFixed(1)}" height="${A.toFixed(1)}" fill="${w}" />`
2668
2669
  );
2669
2670
  }
2670
2671
  }
@@ -2683,16 +2684,16 @@ function fi(i, e, t, n, s, o) {
2683
2684
  (r == null ? void 0 : r.showLabels) !== !1 && t.ticks(l).forEach((y) => {
2684
2685
  const x = he(t.transform(y));
2685
2686
  if (x < e.x || x > e.x + e.width) return;
2686
- const b = qe(y, r, d), w = c + (u.tickLength ?? 4) + u.labelSize * 0.75;
2687
+ const b = qe(y, r, d), S = c + (u.tickLength ?? 4) + u.labelSize * 0.75;
2687
2688
  i.push(
2688
- `<text x="${x.toFixed(1)}" y="${w.toFixed(1)}" fill="${u.labelColor}" font-size="${u.labelSize}" text-anchor="middle">${Ye(b)}</text>`
2689
+ `<text x="${x.toFixed(1)}" y="${S.toFixed(1)}" fill="${u.labelColor}" font-size="${u.labelSize}" text-anchor="middle">${Ye(b)}</text>`
2689
2690
  );
2690
2691
  }), (a == null ? void 0 : a.showLabels) !== !1 && n.ticks(h).forEach((y) => {
2691
2692
  const x = he(n.transform(y));
2692
2693
  if (x < e.y || x > e.y + e.height) return;
2693
- const b = Ge(y, a), w = f - (g.tickLength ?? 4) - 4;
2694
+ const b = Ge(y, a), S = f - (g.tickLength ?? 4) - 4;
2694
2695
  i.push(
2695
- `<text x="${w.toFixed(1)}" y="${(x + g.labelSize * 0.35).toFixed(1)}" fill="${g.labelColor}" font-size="${g.labelSize}" text-anchor="end">${Ye(b)}</text>`
2696
+ `<text x="${S.toFixed(1)}" y="${(x + g.labelSize * 0.35).toFixed(1)}" fill="${g.labelColor}" font-size="${g.labelSize}" text-anchor="end">${Ye(b)}</text>`
2696
2697
  );
2697
2698
  });
2698
2699
  }
@@ -2822,19 +2823,16 @@ function bi(i, e = {}) {
2822
2823
  if (e.y) {
2823
2824
  const d = i.yScales.get(i.primaryYAxisId);
2824
2825
  d && d.setDomain(e.y[0], e.y[1]), i.viewBounds.yMin = e.y[0], i.viewBounds.yMax = e.y[1];
2825
- } else {
2826
- let f = !1;
2827
- if (a.forEach((u, g) => {
2828
- if (u.min === 1 / 0) return;
2829
- f = !0;
2830
- const y = i.yAxisOptionsMap.get(g), x = i.yScales.get(g);
2831
- if (!y || !x) return;
2832
- let b = u.max - u.min;
2833
- (b <= 0 || !isFinite(b)) && (b = Math.abs(u.min) * 0.1 || 1);
2834
- const w = b * n, p = Math.max(-1e15, u.min - w), v = Math.min(1e15, u.max + w);
2835
- x.setDomain(p, v), g === i.primaryYAxisId && (i.viewBounds.yMin = p, i.viewBounds.yMax = v);
2836
- }), !e.y && !f && !r) return !1;
2837
- }
2826
+ } else
2827
+ a.forEach((f, u) => {
2828
+ if (f.min === 1 / 0) return;
2829
+ const g = i.yAxisOptionsMap.get(u), y = i.yScales.get(u);
2830
+ if (!g || !y) return;
2831
+ let x = f.max - f.min;
2832
+ (x <= 0 || !isFinite(x)) && (x = Math.abs(f.min) * 0.1 || 1);
2833
+ const b = x * n, S = Math.max(-1e15, f.min - b), p = Math.min(1e15, f.max + b);
2834
+ y.setDomain(S, p), u === i.primaryYAxisId && (i.viewBounds.yMin = S, i.viewBounds.yMax = p);
2835
+ });
2838
2836
  if (r && s !== void 0 && o !== void 0) {
2839
2837
  let f = o - s;
2840
2838
  (f <= 0 || !isFinite(f)) && (f = Math.abs(s) * 0.1 || 1);
@@ -2872,7 +2870,7 @@ function vi(i) {
2872
2870
  }
2873
2871
  }), i.requestRender();
2874
2872
  }
2875
- function wi(i, e, t, n) {
2873
+ function Si(i, e, t, n) {
2876
2874
  if (e === null) {
2877
2875
  if (t && t.width > 5 && t.height > 5) {
2878
2876
  const s = i.getPlotArea(), o = i.viewBounds, r = (t.x - s.x) / s.width, a = (t.x + t.width - s.x) / s.width, l = 1 - (t.y - s.y) / s.height, h = 1 - (t.y + t.height - s.y) / s.height, d = o.xMin + r * (o.xMax - o.xMin), c = o.xMin + a * (o.xMax - o.xMin), f = o.yMin + h * (o.yMax - o.yMin), u = o.yMin + l * (o.yMax - o.yMin);
@@ -2882,7 +2880,7 @@ function wi(i, e, t, n) {
2882
2880
  }
2883
2881
  return e;
2884
2882
  }
2885
- const Si = {
2883
+ const wi = {
2886
2884
  /** Linear easing - constant speed */
2887
2885
  linear: (i) => i,
2888
2886
  /** Ease in - starts slow, accelerates */
@@ -2919,7 +2917,7 @@ class it {
2919
2917
  * Start a new animation
2920
2918
  */
2921
2919
  animate(e) {
2922
- const t = `anim_${++this.idCounter}`, n = typeof e.easing == "function" ? e.easing : Si[e.easing || "easeOutCubic"];
2920
+ const t = `anim_${++this.idCounter}`, n = typeof e.easing == "function" ? e.easing : wi[e.easing || "easeOutCubic"];
2923
2921
  let s, o;
2924
2922
  const r = new Promise((a, l) => {
2925
2923
  s = a, o = l;
@@ -3050,7 +3048,7 @@ class it {
3050
3048
  }), this.animations.size > 0 ? this.frameId = requestAnimationFrame(() => this.tick()) : this.frameId = null;
3051
3049
  }
3052
3050
  }
3053
- const X = {
3051
+ const W = {
3054
3052
  enabled: !0,
3055
3053
  zoom: {
3056
3054
  enabled: !1,
@@ -3086,16 +3084,16 @@ const X = {
3086
3084
  };
3087
3085
  function _e(i) {
3088
3086
  return i ? {
3089
- enabled: i.enabled ?? X.enabled,
3090
- zoom: { ...X.zoom, ...i.zoom },
3091
- pan: { ...X.pan, ...i.pan },
3092
- dataUpdate: { ...X.dataUpdate, ...i.dataUpdate },
3093
- seriesEntry: { ...X.seriesEntry, ...i.seriesEntry },
3094
- autoScale: { ...X.autoScale, ...i.autoScale }
3095
- } : { ...X };
3087
+ enabled: i.enabled ?? W.enabled,
3088
+ zoom: { ...W.zoom, ...i.zoom },
3089
+ pan: { ...W.pan, ...i.pan },
3090
+ dataUpdate: { ...W.dataUpdate, ...i.dataUpdate },
3091
+ seriesEntry: { ...W.seriesEntry, ...i.seriesEntry },
3092
+ autoScale: { ...W.autoScale, ...i.autoScale }
3093
+ } : { ...W };
3096
3094
  }
3097
3095
  let ke = null;
3098
- function ss() {
3096
+ function rs() {
3099
3097
  return ke || (ke = new it()), ke;
3100
3098
  }
3101
3099
  let G = null, j = null;
@@ -3115,7 +3113,7 @@ function Mi(i, e) {
3115
3113
  const c = i.viewBounds.yMax - i.viewBounds.yMin, f = a - r, u = c > 0 ? f / c : 1, g = c > 0 ? (r - i.viewBounds.yMin) / c : 0;
3116
3114
  i.yScales.forEach((x, b) => {
3117
3115
  if (b === i.primaryYAxisId) return;
3118
- const w = x.domain[1] - x.domain[0], p = n ? 0 : x.domain[0] + g * w, v = n ? x.domain[0] + u * w : p + u * w;
3116
+ const S = x.domain[1] - x.domain[0], p = n ? 0 : x.domain[0] + g * S, v = n ? x.domain[0] + u * S : p + u * S;
3119
3117
  x.setDomain(p, v);
3120
3118
  }), i.viewBounds.yMin = r, i.viewBounds.yMax = a;
3121
3119
  const y = i.yScales.get(i.primaryYAxisId);
@@ -3145,8 +3143,8 @@ function Mi(i, e) {
3145
3143
  if (u === i.primaryYAxisId)
3146
3144
  f.setDomain(i.viewBounds.yMin, i.viewBounds.yMax);
3147
3145
  else {
3148
- const g = d.get(u), y = h.yMax - h.yMin, x = i.viewBounds.yMax - i.viewBounds.yMin, b = y > 0 ? x / y : 1, w = y > 0 ? (i.viewBounds.yMin - h.yMin) / y : 0, p = g[1] - g[0], v = g[0] + w * p, S = v + b * p;
3149
- f.setDomain(v, S);
3146
+ const g = d.get(u), y = h.yMax - h.yMin, x = i.viewBounds.yMax - i.viewBounds.yMin, b = y > 0 ? x / y : 1, S = y > 0 ? (i.viewBounds.yMin - h.yMin) / y : 0, p = g[1] - g[0], v = g[0] + S * p, w = v + b * p;
3147
+ f.setDomain(v, w);
3150
3148
  }
3151
3149
  });
3152
3150
  i.requestRender();
@@ -3163,56 +3161,56 @@ function Ci(i, e = !0) {
3163
3161
  if (i.series.size === 0) return null;
3164
3162
  let t = 1 / 0, n = -1 / 0;
3165
3163
  const s = /* @__PURE__ */ new Map();
3166
- i.yScales.forEach((w, p) => {
3164
+ i.yScales.forEach((S, p) => {
3167
3165
  s.set(p, { min: 1 / 0, max: -1 / 0 });
3168
3166
  });
3169
3167
  let o = !1;
3170
- if (i.series.forEach((w) => {
3171
- if (!w.isVisible()) return;
3172
- const p = w.getBounds();
3168
+ if (i.series.forEach((S) => {
3169
+ if (!S.isVisible()) return;
3170
+ const p = S.getBounds();
3173
3171
  if (p && isFinite(p.xMin) && isFinite(p.xMax) && isFinite(p.yMin) && isFinite(p.yMax)) {
3174
3172
  t = Math.min(t, p.xMin), n = Math.max(n, p.xMax);
3175
- const v = w.getYAxisId() || i.primaryYAxisId, S = s.get(v);
3176
- S && (S.min = Math.min(S.min, p.yMin), S.max = Math.max(S.max, p.yMax)), o = !0;
3173
+ const v = S.getYAxisId() || i.primaryYAxisId, w = s.get(v);
3174
+ w && (w.min = Math.min(w.min, p.yMin), w.max = Math.max(w.max, p.yMax)), o = !0;
3177
3175
  }
3178
3176
  }), !o) return null;
3179
3177
  const r = 1e15, a = -1e15;
3180
3178
  let l = i.viewBounds.xMin, h = i.viewBounds.xMax, d = i.viewBounds.yMin, c = i.viewBounds.yMax;
3181
3179
  if (i.xAxisOptions.auto) {
3182
- let w = n - t;
3183
- (w <= 0 || !isFinite(w)) && (w = Math.abs(t) * 0.1 || 1);
3184
- const p = Math.min(w * 5e-3, 1e10);
3180
+ let S = n - t;
3181
+ (S <= 0 || !isFinite(S)) && (S = Math.abs(t) * 0.1 || 1);
3182
+ const p = Math.min(S * 5e-3, 1e10);
3185
3183
  l = Math.max(a, t - p), h = Math.min(r, n + p);
3186
3184
  }
3187
3185
  const f = s.get(i.primaryYAxisId), u = i.yAxisOptionsMap.get(i.primaryYAxisId);
3188
3186
  if (f && (u != null && u.auto) && f.min !== 1 / 0) {
3189
- let w = f.max - f.min;
3190
- (w <= 0 || !isFinite(w)) && (w = Math.abs(f.min) * 0.1 || 1);
3191
- const p = Math.min(w * 5e-3, 1e10);
3187
+ let S = f.max - f.min;
3188
+ (S <= 0 || !isFinite(S)) && (S = Math.abs(f.min) * 0.1 || 1);
3189
+ const p = Math.min(S * 5e-3, 1e10);
3192
3190
  d = Math.max(a, f.min - p), c = Math.min(r, f.max + p);
3193
3191
  }
3194
3192
  const g = e && i.animationConfig.enabled && i.animationConfig.autoScale.enabled;
3195
3193
  if (j != null && j.isRunning() && j.cancel(), !g)
3196
- return i.viewBounds.xMin = l, i.viewBounds.xMax = h, i.viewBounds.yMin = d, i.viewBounds.yMax = c, i.yScales.forEach((w, p) => {
3197
- const v = s.get(p), S = i.yAxisOptionsMap.get(p);
3198
- if (v && (S != null && S.auto) && v.min !== 1 / 0) {
3194
+ return i.viewBounds.xMin = l, i.viewBounds.xMax = h, i.viewBounds.yMin = d, i.viewBounds.yMax = c, i.yScales.forEach((S, p) => {
3195
+ const v = s.get(p), w = i.yAxisOptionsMap.get(p);
3196
+ if (v && (w != null && w.auto) && v.min !== 1 / 0) {
3199
3197
  let M = v.max - v.min;
3200
3198
  (M <= 0 || !isFinite(M)) && (M = Math.abs(v.min) * 0.1 || 1);
3201
3199
  const A = Math.min(M * 5e-3, 1e10);
3202
- w.setDomain(
3200
+ S.setDomain(
3203
3201
  Math.max(a, v.min - A),
3204
3202
  Math.min(r, v.max + A)
3205
3203
  );
3206
3204
  }
3207
3205
  }), i.events.emit("autoScale", void 0), i.requestRender(), null;
3208
3206
  const y = { ...i.viewBounds }, x = /* @__PURE__ */ new Map();
3209
- i.yScales.forEach((w, p) => {
3210
- x.set(p, [...w.domain]);
3207
+ i.yScales.forEach((S, p) => {
3208
+ x.set(p, [...S.domain]);
3211
3209
  });
3212
3210
  const b = /* @__PURE__ */ new Map();
3213
- return i.yScales.forEach((w, p) => {
3214
- const v = s.get(p), S = i.yAxisOptionsMap.get(p);
3215
- if (v && (S != null && S.auto) && v.min !== 1 / 0) {
3211
+ return i.yScales.forEach((S, p) => {
3212
+ const v = s.get(p), w = i.yAxisOptionsMap.get(p);
3213
+ if (v && (w != null && w.auto) && v.min !== 1 / 0) {
3216
3214
  let M = v.max - v.min;
3217
3215
  (M <= 0 || !isFinite(M)) && (M = Math.abs(v.min) * 0.1 || 1);
3218
3216
  const A = Math.min(M * 5e-3, 1e10);
@@ -3221,16 +3219,16 @@ function Ci(i, e = !0) {
3221
3219
  Math.min(r, v.max + A)
3222
3220
  ]);
3223
3221
  } else
3224
- b.set(p, [...w.domain]);
3222
+ b.set(p, [...S.domain]);
3225
3223
  }), j = i.animationEngine.animate({
3226
3224
  duration: i.animationConfig.autoScale.duration,
3227
3225
  easing: i.animationConfig.autoScale.easing,
3228
- onUpdate: (w) => {
3229
- i.viewBounds.xMin = y.xMin + (l - y.xMin) * w, i.viewBounds.xMax = y.xMax + (h - y.xMax) * w, i.viewBounds.yMin = y.yMin + (d - y.yMin) * w, i.viewBounds.yMax = y.yMax + (c - y.yMax) * w, i.yScales.forEach((p, v) => {
3230
- const S = x.get(v), M = b.get(v);
3226
+ onUpdate: (S) => {
3227
+ i.viewBounds.xMin = y.xMin + (l - y.xMin) * S, i.viewBounds.xMax = y.xMax + (h - y.xMax) * S, i.viewBounds.yMin = y.yMin + (d - y.yMin) * S, i.viewBounds.yMax = y.yMax + (c - y.yMax) * S, i.yScales.forEach((p, v) => {
3228
+ const w = x.get(v), M = b.get(v);
3231
3229
  p.setDomain(
3232
- S[0] + (M[0] - S[0]) * w,
3233
- S[1] + (M[1] - S[1]) * w
3230
+ w[0] + (M[0] - w[0]) * S,
3231
+ w[1] + (M[1] - w[1]) * S
3234
3232
  );
3235
3233
  }), i.requestRender();
3236
3234
  },
@@ -3301,16 +3299,16 @@ function Bi(i) {
3301
3299
  function Ti(i, e, t, n) {
3302
3300
  if (i === "heatmap" && t) {
3303
3301
  const { xValues: y, yValues: x } = t;
3304
- let b = 1 / 0, w = -1 / 0, p = 1 / 0, v = -1 / 0;
3305
- for (let S = 0; S < y.length; S++) {
3306
- const M = y[S];
3307
- M < b && (b = M), M > w && (w = M);
3302
+ let b = 1 / 0, S = -1 / 0, p = 1 / 0, v = -1 / 0;
3303
+ for (let w = 0; w < y.length; w++) {
3304
+ const M = y[w];
3305
+ M < b && (b = M), M > S && (S = M);
3308
3306
  }
3309
- for (let S = 0; S < x.length; S++) {
3310
- const M = x[S];
3307
+ for (let w = 0; w < x.length; w++) {
3308
+ const M = x[w];
3311
3309
  M < p && (p = M), M > v && (v = M);
3312
3310
  }
3313
- return b === 1 / 0 || p === 1 / 0 ? null : { xMin: b, xMax: w, yMin: p, yMax: v };
3311
+ return b === 1 / 0 || p === 1 / 0 ? null : { xMin: b, xMax: S, yMin: p, yMax: v };
3314
3312
  }
3315
3313
  if (i === "polar" && n)
3316
3314
  return Bi(n);
@@ -3323,15 +3321,15 @@ function Ti(i, e, t, n) {
3323
3321
  x < c && (c = x), x > f && (f = x);
3324
3322
  const b = [];
3325
3323
  o.length > y && isFinite(o[y]) && b.push(o[y]), r && isFinite(r[y]) && b.push(r[y]), a && isFinite(a[y]) && b.push(a[y]), l && isFinite(l[y]) && b.push(l[y]), h && isFinite(h[y]) && b.push(h[y]), d && isFinite(d[y]) && b.push(d[y]);
3326
- for (const w of b)
3327
- w < u && (u = w), w > g && (g = w);
3324
+ for (const S of b)
3325
+ S < u && (u = S), S > g && (g = S);
3328
3326
  }
3329
3327
  return c === 1 / 0 || u === 1 / 0 ? null : { xMin: c, xMax: f, yMin: u, yMax: g };
3330
3328
  }
3331
3329
  function P(i) {
3332
3330
  return i ? i instanceof Float32Array || i instanceof Float64Array ? i : new Float32Array(i) : new Float32Array(0);
3333
3331
  }
3334
- function W(i, e) {
3332
+ function X(i, e) {
3335
3333
  const t = new i.constructor(i.length + e.length);
3336
3334
  return t.set(i, 0), t.set(e, i.length), t;
3337
3335
  }
@@ -3483,7 +3481,7 @@ class Di {
3483
3481
  if (e) {
3484
3482
  if (e.append) {
3485
3483
  const t = P(e.x), n = P(e.y);
3486
- if (t.length > 0 && (this.data.x = W(this.data.x, t), this.data.y = W(this.data.y, n), e.y2 && (this.data.y2 = this.data.y2 ? W(this.data.y2, P(e.y2)) : P(e.y2)), e.open && (this.data.open = this.data.open ? W(this.data.open, P(e.open)) : P(e.open)), e.high && (this.data.high = this.data.high ? W(this.data.high, P(e.high)) : P(e.high)), e.low && (this.data.low = this.data.low ? W(this.data.low, P(e.low)) : P(e.low)), e.close && (this.data.close = this.data.close ? W(this.data.close, P(e.close)) : P(e.close)), e.median && (this.data.median = this.data.median ? W(this.data.median, P(e.median)) : P(e.median)), this.lastAppendCount += t.length, this.maxPoints && this.data.x.length > this.maxPoints)) {
3484
+ if (t.length > 0 && (this.data.x = X(this.data.x, t), this.data.y = X(this.data.y, n), e.y2 && (this.data.y2 = this.data.y2 ? X(this.data.y2, P(e.y2)) : P(e.y2)), e.open && (this.data.open = this.data.open ? X(this.data.open, P(e.open)) : P(e.open)), e.high && (this.data.high = this.data.high ? X(this.data.high, P(e.high)) : P(e.high)), e.low && (this.data.low = this.data.low ? X(this.data.low, P(e.low)) : P(e.low)), e.close && (this.data.close = this.data.close ? X(this.data.close, P(e.close)) : P(e.close)), e.median && (this.data.median = this.data.median ? X(this.data.median, P(e.median)) : P(e.median)), this.lastAppendCount += t.length, this.maxPoints && this.data.x.length > this.maxPoints)) {
3487
3485
  const s = this.data.x.length - this.maxPoints;
3488
3486
  this.data.x = this.data.x.slice(s), this.data.y = this.data.y.slice(s), this.data.y2 && (this.data.y2 = this.data.y2.slice(s)), this.data.open && (this.data.open = this.data.open.slice(s)), this.data.high && (this.data.high = this.data.high.slice(s)), this.data.low && (this.data.low = this.data.low.slice(s)), this.data.close && (this.data.close = this.data.close.slice(s)), this.lastAppendCount = 0;
3489
3487
  }
@@ -3623,7 +3621,7 @@ function ce(i, e) {
3623
3621
  subtotal: h.subtotalCount,
3624
3622
  connectors: h.connectorData.length / 2
3625
3623
  };
3626
- } else s === "polar" ? Yi(i, e) : i.renderer.createBuffer(o, Qe(n.x, n.y));
3624
+ } else s === "polar" ? Yi(i, e) : i.renderer.createBuffer(o, Ze(n.x, n.y));
3627
3625
  if (e.hasErrorData()) {
3628
3626
  const r = e.getData(), a = Lt(
3629
3627
  r.x,
@@ -3674,7 +3672,7 @@ function Vi(i, e) {
3674
3672
  function N(i) {
3675
3673
  return i instanceof Float32Array || i instanceof Float64Array ? i : Float32Array.from(i);
3676
3674
  }
3677
- function Wi(i) {
3675
+ function Xi(i) {
3678
3676
  const e = new Float32Array(i.length), t = new Float32Array(i.length);
3679
3677
  for (let n = 0; n < i.length; n++) {
3680
3678
  const s = i[n];
@@ -3682,7 +3680,7 @@ function Wi(i) {
3682
3680
  }
3683
3681
  return { positive: e, negative: t };
3684
3682
  }
3685
- function Xi(i, e, t) {
3683
+ function Wi(i, e, t) {
3686
3684
  if (i === void 0 || i === "zero") return 0;
3687
3685
  if (typeof i == "number") return i;
3688
3686
  const n = t.find((o) => o.id === i);
@@ -3709,21 +3707,16 @@ function Ni(i, e, t, n, s) {
3709
3707
  h(i[c], e[c], l(c));
3710
3708
  continue;
3711
3709
  }
3712
- const w = u - f - (y - g);
3713
- let p = w !== 0 ? (g - f) / w : 0.5;
3714
- p = Math.max(0, Math.min(1, p));
3715
- const v = i[c - 1] + p * (i[c] - i[c - 1]), S = f + p * (u - f), M = x ? n : s, A = b ? n : s;
3716
- h(v, S, M), d(), h(v, S, A), h(i[c], e[c], l(c));
3710
+ const S = u - f - (y - g), p = Math.max(0, Math.min(1, (g - f) / S)), v = i[c - 1] + p * (i[c] - i[c - 1]), w = f + p * (u - f), M = x ? n : s, A = b ? n : s;
3711
+ h(v, w, M), d(), h(v, w, A), h(i[c], e[c], l(c));
3717
3712
  }
3718
3713
  return d(), r;
3719
3714
  }
3720
3715
  function Hi(i, e, t, n, s, o, r, a) {
3721
- const l = s.colorZones;
3722
- if (!l) return;
3723
- const d = Ni(
3716
+ const l = s.colorZones, d = Ni(
3724
3717
  t,
3725
3718
  n,
3726
- (c) => Xi(l.ref, c, o),
3719
+ (c) => Wi(l.ref, c, o),
3727
3720
  l.aboveColor,
3728
3721
  l.belowColor
3729
3722
  );
@@ -3754,7 +3747,7 @@ const Ui = {
3754
3747
  peakSize: 6,
3755
3748
  troughSize: 6
3756
3749
  };
3757
- function we(i) {
3750
+ function Se(i) {
3758
3751
  var h, d, c, f;
3759
3752
  const { id: e, data: t, style: n = {}, visible: s = !0 } = i, o = { ...Ui, ...n }, r = N(t.x), a = r.length, l = [];
3760
3753
  if ((h = t.fills) != null && h.length)
@@ -3776,7 +3769,7 @@ function we(i) {
3776
3769
  });
3777
3770
  }
3778
3771
  if (t.histogram) {
3779
- const u = N(t.histogram.y), { positive: g, negative: y } = Wi(u), x = t.histogram.barWidth, b = x !== void 0 ? { barWidth: x } : {};
3772
+ const u = N(t.histogram.y), { positive: g, negative: y } = Xi(u), x = t.histogram.barWidth, b = x !== void 0 ? { barWidth: x } : {};
3780
3773
  l.push({
3781
3774
  id: `${e}-hist-pos`,
3782
3775
  type: "bar",
@@ -3887,10 +3880,10 @@ function we(i) {
3887
3880
  }
3888
3881
  return l;
3889
3882
  }
3890
- function os(i) {
3891
- return we(i);
3883
+ function as(i) {
3884
+ return Se(i);
3892
3885
  }
3893
- function rs(i, e, t = 3) {
3886
+ function ls(i, e, t = 3) {
3894
3887
  const n = N(i), s = N(e), o = [], r = Math.max(1, t);
3895
3888
  for (let a = r; a < s.length - r; a++) {
3896
3889
  let l = !0, h = !0;
@@ -3930,7 +3923,7 @@ function Gi(i, e) {
3930
3923
  }
3931
3924
  }
3932
3925
  if (je(i.xAxisOptions) && ((s = (n = t.data) == null ? void 0 : n.x) != null && s.length)) {
3933
- const { displayX: o, mapping: r } = Ze(t.data.x, i.xAxisOptions);
3926
+ const { displayX: o, mapping: r } = Qe(t.data.x, i.xAxisOptions);
3934
3927
  i.timeScaleMapping = r, t = {
3935
3928
  ...t,
3936
3929
  data: { ...t.data, x: o }
@@ -3939,13 +3932,13 @@ function Gi(i, e) {
3939
3932
  return t;
3940
3933
  }
3941
3934
  function ji(i) {
3942
- return i.type === "indicator" ? we(i) : [i];
3935
+ return i.type === "indicator" ? Se(i) : [i];
3943
3936
  }
3944
- function Zi(i, e) {
3937
+ function Qi(i, e) {
3945
3938
  for (const t of ji(e))
3946
- Qi(i, t);
3939
+ Zi(i, t);
3947
3940
  }
3948
- function Qi(i, e) {
3941
+ function Zi(i, e) {
3949
3942
  var s, o;
3950
3943
  const t = Gi(i, e);
3951
3944
  if (t.type !== "heatmap" && !((s = t.style) != null && s.color) && !t.color && i.colorScheme) {
@@ -3965,7 +3958,7 @@ function Ki(i, e, t) {
3965
3958
  if (n) {
3966
3959
  let s = t;
3967
3960
  if (t.x && je(i.xAxisOptions)) {
3968
- const { displayX: o, mapping: r } = Ze(t.x, i.xAxisOptions);
3961
+ const { displayX: o, mapping: r } = Qe(t.x, i.xAxisOptions);
3969
3962
  i.timeScaleMapping = r, s = { ...t, x: o };
3970
3963
  }
3971
3964
  n.updateData(s), ce(i, n), i.requestRender();
@@ -4081,7 +4074,7 @@ function nn(i, e, t) {
4081
4074
  let a;
4082
4075
  return r < 1.5 ? a = 1 : r < 3 ? a = 2 : r < 7 ? a = 5 : a = 10, a * o;
4083
4076
  }
4084
- function as(i) {
4077
+ function hs(i) {
4085
4078
  return i === "log" ? new ie() : new te();
4086
4079
  }
4087
4080
  const O = {
@@ -4182,12 +4175,12 @@ function sn(i, e) {
4182
4175
  const U = { scale: "linear", auto: !0, position: A.position || (B ? "left" : "right"), ...A, id: I };
4183
4176
  y.set(I, U), x.set(I, U.scale === "log" ? new ie() : new te());
4184
4177
  }), i.style.position = "relative", i.style.overflow = "hidden", i.style.backgroundColor = e.background ?? s.backgroundColor;
4185
- const p = We("webgl"), v = We("overlay");
4178
+ const p = Xe("webgl"), v = Xe("overlay");
4186
4179
  for (; i.firstChild; )
4187
4180
  i.removeChild(i.firstChild);
4188
4181
  i.appendChild(p), i.appendChild(v);
4189
- const S = v.getContext("2d");
4190
- if (!S) throw new Error("Failed to get 2D context");
4182
+ const w = v.getContext("2d");
4183
+ if (!w) throw new Error("Failed to get 2D context");
4191
4184
  return {
4192
4185
  theme: s,
4193
4186
  backgroundColor: r,
@@ -4204,11 +4197,11 @@ function sn(i, e) {
4204
4197
  primaryYAxisId: b,
4205
4198
  webglCanvas: p,
4206
4199
  overlayCanvas: v,
4207
- overlayCtx: S,
4200
+ overlayCtx: w,
4208
4201
  layout: n
4209
4202
  };
4210
4203
  }
4211
- function We(i) {
4204
+ function Xe(i) {
4212
4205
  const e = document.createElement("canvas");
4213
4206
  return e.style.cssText = "position:absolute;top:0;left:0;width:100%;height:100%;", i === "overlay" && (e.style.pointerEvents = "none"), e;
4214
4207
  }
@@ -4232,10 +4225,8 @@ function rn(i) {
4232
4225
  function an(i, e, t, n, s) {
4233
4226
  const o = i.getBoundingClientRect();
4234
4227
  if (o.width === 0 || o.height === 0) return !1;
4235
- const r = Math.max(1, Math.round(o.width * s)), a = Math.max(1, Math.round(o.height * s)), l = `${Math.round(o.width)}px`, h = `${Math.round(o.height)}px`;
4236
- return e.width === r && e.height === a && e.style.width === l && e.style.height === h ? !1 : ([e, t].forEach((c) => {
4237
- c.width = r, c.height = a, c.style.width = l, c.style.height = h;
4238
- }), n.setTransform(s, 0, 0, s, 0, 0), n.imageSmoothingEnabled = !0, "imageSmoothingQuality" in n && (n.imageSmoothingQuality = "high"), !0);
4228
+ const r = Math.max(1, Math.round(o.width * s)), a = Math.max(1, Math.round(o.height * s)), l = `${Math.round(o.width)}px`, h = `${Math.round(o.height)}px`, d = e.width !== r || e.height !== a || e.style.width !== l || e.style.height !== h, c = t.width !== r || t.height !== a;
4229
+ return !d && !c ? (n.setTransform(s, 0, 0, s, 0, 0), n.imageSmoothingEnabled = !0, "imageSmoothingQuality" in n && (n.imageSmoothingQuality = "high"), !1) : (d && (e.width = r, e.height = a, e.style.width = l, e.style.height = h), c && (t.width = r, t.height = a), t.style.width = l, t.style.height = h, n.setTransform(s, 0, 0, s, 0, 0), n.imageSmoothingEnabled = !0, "imageSmoothingQuality" in n && (n.imageSmoothingQuality = "high"), !0);
4239
4230
  }
4240
4231
  class ln {
4241
4232
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
@@ -5321,8 +5312,8 @@ class yn {
5321
5312
  else if (b)
5322
5313
  r.globalAlpha = 0.6, r.fillRect(0, o * 0.2, o, o * 0.6), r.globalAlpha = 1, r.strokeRect(0, o * 0.2, o, o * 0.6);
5323
5314
  else if (g === "candlestick") {
5324
- const w = a.bullishColor || "#26a69a";
5325
- r.fillStyle = w, r.fillRect(o * 0.3, o * 0.2, o * 0.4, o * 0.6), r.beginPath(), r.moveTo(o * 0.5, 0), r.lineTo(o * 0.5, o), r.strokeStyle = w, r.stroke();
5315
+ const S = a.bullishColor || "#26a69a";
5316
+ r.fillStyle = S, r.fillRect(o * 0.3, o * 0.2, o * 0.4, o * 0.6), r.beginPath(), r.moveTo(o * 0.5, 0), r.lineTo(o * 0.5, o), r.strokeStyle = S, r.stroke();
5326
5317
  } else
5327
5318
  r.beginPath(), r.moveTo(0, u), r.lineTo(o, u), r.stroke();
5328
5319
  }
@@ -5375,10 +5366,10 @@ class yn {
5375
5366
  e.fillStyle = f ? n.backgroundColor : "rgba(255, 255, 255, 0.85)", e.strokeStyle = n.borderColor, e.lineWidth = 1 * t;
5376
5367
  const u = n.borderRadius * t;
5377
5368
  e.beginPath(), e.moveTo(l + u, h), e.lineTo(l + d - u, h), e.arcTo(l + d, h, l + d, h + u, u), e.lineTo(l + d, h + c - u), e.arcTo(l + d, h + c, l + d - u, h + c, u), e.lineTo(l + u, h + c), e.arcTo(l, h + c, l, h + c - u, u), e.lineTo(l, h + u), e.arcTo(l, h, l + u, h, u), e.closePath(), e.fill(), e.stroke(), e.textAlign = "left", e.textBaseline = "middle", e.font = `${n.fontSize * t}px ${n.fontFamily}`, this.series.forEach((g, y) => {
5378
- const x = h + a + s + y * (r + o) + r / 2, b = l + s + r / 2, w = x, p = g.getStyle(), v = g.getType(), S = p.symbol || "circle";
5369
+ const x = h + a + s + y * (r + o) + r / 2, b = l + s + r / 2, S = x, p = g.getStyle(), v = g.getType(), w = p.symbol || "circle";
5379
5370
  e.fillStyle = p.color || "#ff0055", e.strokeStyle = p.color || "#ff0055", e.lineWidth = 2 * t;
5380
5371
  const M = String(v).toLowerCase(), A = M === "scatter" || M === "1" || M === "line" && !!p.symbol, k = M.includes("scatter") || M === "2";
5381
- A ? this.drawSymbol(e, S, b, w, r * 0.9) : k ? (e.beginPath(), e.moveTo(l + s, w), e.lineTo(l + s + r, w), e.stroke(), this.drawSymbol(e, S, b, w, r * 0.6)) : (e.beginPath(), e.moveTo(l + s, w), e.lineTo(l + s + r, w), e.stroke()), e.fillStyle = n.textColor, e.fillText(g.getName(), l + s + r + 8 * t, x);
5372
+ A ? this.drawSymbol(e, w, b, S, r * 0.9) : k ? (e.beginPath(), e.moveTo(l + s, S), e.lineTo(l + s + r, S), e.stroke(), this.drawSymbol(e, w, b, S, r * 0.6)) : (e.beginPath(), e.moveTo(l + s, S), e.lineTo(l + s + r, S), e.stroke()), e.fillStyle = n.textColor, e.fillText(g.getName(), l + s + r + 8 * t, x);
5382
5373
  }), e.restore();
5383
5374
  }
5384
5375
  updateTheme(e) {
@@ -5551,15 +5542,15 @@ class xn {
5551
5542
  this.clear(), this.completedCount = 0, this.idCounter = 0;
5552
5543
  }
5553
5544
  }
5554
- const Q = new xn();
5545
+ const Z = new xn();
5555
5546
  function bn() {
5556
- return Q.enqueue();
5547
+ return Z.enqueue();
5557
5548
  }
5558
5549
  function Ie(i) {
5559
- Q.markComplete(i);
5550
+ Z.markComplete(i);
5560
5551
  }
5561
- function ls() {
5562
- return Q.getStatus();
5552
+ function cs() {
5553
+ return Z.getStatus();
5563
5554
  }
5564
5555
  class vn {
5565
5556
  static getStatus() {
@@ -5569,23 +5560,23 @@ class vn {
5569
5560
  this.instance.reset();
5570
5561
  }
5571
5562
  }
5572
- m(vn, "instance", Q);
5573
- function hs() {
5563
+ m(vn, "instance", Z);
5564
+ function us() {
5574
5565
  return {
5575
- getStatus: () => Q.getStatus(),
5576
- reset: () => Q.reset()
5566
+ getStatus: () => Z.getStatus(),
5567
+ reset: () => Z.reset()
5577
5568
  };
5578
5569
  }
5579
- async function cs(i, e) {
5570
+ async function ds(i, e) {
5580
5571
  await e();
5581
5572
  }
5582
- function us(i = 200) {
5573
+ function fs(i = 200) {
5583
5574
  return new Promise((e) => setTimeout(e, i));
5584
5575
  }
5585
- function ds() {
5586
- Q.reset();
5576
+ function gs() {
5577
+ Z.reset();
5587
5578
  }
5588
- class wn {
5579
+ class Sn {
5589
5580
  constructor(e) {
5590
5581
  this.pluginManager = e;
5591
5582
  }
@@ -5700,6 +5691,9 @@ class wn {
5700
5691
  get forecasting() {
5701
5692
  return this.getAPI("velo-plot-forecasting");
5702
5693
  }
5694
+ get patterns() {
5695
+ return this.getAPI("pattern-recognition");
5696
+ }
5703
5697
  get latex() {
5704
5698
  return this.getAPI("velo-plot-latex");
5705
5699
  }
@@ -5716,10 +5710,14 @@ class wn {
5716
5710
  return this.pluginManager.getNames();
5717
5711
  }
5718
5712
  }
5719
- class Sn {
5713
+ class wn {
5720
5714
  constructor(e) {
5721
5715
  this.ctx = e;
5722
5716
  }
5717
+ /** Swap the X scale (e.g. broken-axis plugin) so tick generation uses it. */
5718
+ setXScale(e) {
5719
+ this.ctx.xScale = e;
5720
+ }
5723
5721
  /**
5724
5722
  * Add a new Y axis dynamically
5725
5723
  */
@@ -5818,7 +5816,7 @@ class Sn {
5818
5816
  }
5819
5817
  }
5820
5818
  const ot = 1;
5821
- function Xe(i) {
5819
+ function We(i) {
5822
5820
  const e = i instanceof Float32Array ? i : new Float32Array(i), t = new Uint8Array(e.buffer);
5823
5821
  let n = "";
5824
5822
  for (let s = 0; s < t.length; s++)
@@ -5873,12 +5871,12 @@ function Pn(i, e = !0) {
5873
5871
  return console.error("[SciPlot] Failed to parse URL hash:", t), null;
5874
5872
  }
5875
5873
  }
5876
- function fs(i) {
5874
+ function ys(i) {
5877
5875
  if (!i || typeof i != "object") return !1;
5878
5876
  const e = i;
5879
5877
  return !(typeof e.version != "number" || !e.viewBounds || typeof e.viewBounds != "object" || !Array.isArray(e.series));
5880
5878
  }
5881
- class gs {
5879
+ class ms {
5882
5880
  constructor(e = 50) {
5883
5881
  m(this, "history", []);
5884
5882
  m(this, "currentIndex", -1);
@@ -5938,6 +5936,10 @@ class kn {
5938
5936
  constructor(e) {
5939
5937
  this.ctx = e;
5940
5938
  }
5939
+ /** Swap the X scale (e.g. broken-axis plugin) — the context holds a snapshot. */
5940
+ setXScale(e) {
5941
+ this.ctx.xScale = e;
5942
+ }
5941
5943
  /**
5942
5944
  * Export complete chart state
5943
5945
  */
@@ -5979,8 +5981,8 @@ class kn {
5979
5981
  style: o.getStyle(),
5980
5982
  visible: o.isVisible(),
5981
5983
  data: t ? {
5982
- x: Xe(o.getData().x),
5983
- y: Xe(o.getData().y)
5984
+ x: We(o.getData().x),
5985
+ y: We(o.getData().y)
5984
5986
  } : { x: "", y: "" }
5985
5987
  })),
5986
5988
  annotations: n ? this.ctx.getAnnotations() : [],
@@ -6056,13 +6058,13 @@ function Bn(i, e, t, n) {
6056
6058
  valueColor: g = "#fff",
6057
6059
  valueSize: y = 24,
6058
6060
  label: x
6059
- } = t, b = n.x + n.width / 2, w = n.y + n.height / 2, p = Math.min(n.width, n.height) / 2 * d, v = f - c, S = Math.max(0, Math.min(1, (s - o) / (r - o))), M = (c + S * v) * (Math.PI / 180);
6060
- i.save(), i.beginPath(), i.arc(b, w, p, c * (Math.PI / 180), f * (Math.PI / 180)), i.strokeStyle = "rgba(255, 255, 255, 0.1)", i.lineWidth = p * 0.2, i.lineCap = "round", i.stroke();
6061
+ } = t, b = n.x + n.width / 2, S = n.y + n.height / 2, p = Math.min(n.width, n.height) / 2 * d, v = f - c, w = Math.max(0, Math.min(1, (s - o) / (r - o))), M = (c + w * v) * (Math.PI / 180);
6062
+ i.save(), i.beginPath(), i.arc(b, S, p, c * (Math.PI / 180), f * (Math.PI / 180)), i.strokeStyle = "rgba(255, 255, 255, 0.1)", i.lineWidth = p * 0.2, i.lineCap = "round", i.stroke();
6061
6063
  for (const k of h) {
6062
6064
  const B = Math.max(0, Math.min(1, (k.from - o) / (r - o))), F = Math.max(0, Math.min(1, (k.to - o) / (r - o)));
6063
6065
  i.beginPath(), i.arc(
6064
6066
  b,
6065
- w,
6067
+ S,
6066
6068
  p,
6067
6069
  (c + B * v) * (Math.PI / 180),
6068
6070
  (c + F * v) * (Math.PI / 180)
@@ -6071,9 +6073,9 @@ function Bn(i, e, t, n) {
6071
6073
  const A = 11;
6072
6074
  for (let k = 0; k < A; k++) {
6073
6075
  const B = (c + k / (A - 1) * v) * (Math.PI / 180), F = p * 0.85, I = p * 0.95;
6074
- i.beginPath(), i.moveTo(b + F * Math.cos(B), w + F * Math.sin(B)), i.lineTo(b + I * Math.cos(B), w + I * Math.sin(B)), i.strokeStyle = "rgba(255, 255, 255, 0.5)", i.lineWidth = 2, i.stroke();
6076
+ i.beginPath(), i.moveTo(b + F * Math.cos(B), S + F * Math.sin(B)), i.lineTo(b + I * Math.cos(B), S + I * Math.sin(B)), i.strokeStyle = "rgba(255, 255, 255, 0.5)", i.lineWidth = 2, i.stroke();
6075
6077
  }
6076
- i.beginPath(), i.moveTo(b, w), i.lineTo(b + p * 0.9 * Math.cos(M), w + p * 0.9 * Math.sin(M)), i.strokeStyle = a, i.lineWidth = l, i.lineCap = "round", i.shadowColor = a, i.shadowBlur = 10, i.stroke(), i.shadowBlur = 0, i.beginPath(), i.arc(b, w, 8, 0, Math.PI * 2), i.fillStyle = a, i.fill(), i.strokeStyle = "#fff", i.lineWidth = 2, i.stroke(), u && (i.textAlign = "center", i.textBaseline = "middle", i.font = `bold ${y}px Inter, sans-serif`, i.fillStyle = g, i.fillText(s.toFixed(1), b, w + p * 0.4), x && (i.font = `${y * 0.5}px Inter, sans-serif`, i.fillStyle = "rgba(255, 255, 255, 0.6)", i.fillText(x, b, w + p * 0.6))), i.restore();
6078
+ i.beginPath(), i.moveTo(b, S), i.lineTo(b + p * 0.9 * Math.cos(M), S + p * 0.9 * Math.sin(M)), i.strokeStyle = a, i.lineWidth = l, i.lineCap = "round", i.shadowColor = a, i.shadowBlur = 10, i.stroke(), i.shadowBlur = 0, i.beginPath(), i.arc(b, S, 8, 0, Math.PI * 2), i.fillStyle = a, i.fill(), i.strokeStyle = "#fff", i.lineWidth = 2, i.stroke(), u && (i.textAlign = "center", i.textBaseline = "middle", i.font = `bold ${y}px Inter, sans-serif`, i.fillStyle = g, i.fillText(s.toFixed(1), b, S + p * 0.4), x && (i.font = `${y * 0.5}px Inter, sans-serif`, i.fillStyle = "rgba(255, 255, 255, 0.6)", i.fillText(x, b, S + p * 0.6))), i.restore();
6077
6079
  }
6078
6080
  function Tn(i, e, t, n) {
6079
6081
  const { nodes: s, links: o } = e, {
@@ -6089,12 +6091,12 @@ function Tn(i, e, t, n) {
6089
6091
  y: n.y + y,
6090
6092
  width: f,
6091
6093
  height: u
6092
- }, w = /* @__PURE__ */ new Set();
6094
+ }, S = /* @__PURE__ */ new Set();
6093
6095
  o.forEach((C) => {
6094
- w.add(C.source), w.add(C.target);
6096
+ S.add(C.source), S.add(C.target);
6095
6097
  });
6096
- const p = Array.from(w), v = /* @__PURE__ */ new Map(), S = new Set(o.map((C) => C.target));
6097
- p.filter((C) => !S.has(C)).forEach((C) => v.set(C, 0));
6098
+ const p = Array.from(S), v = /* @__PURE__ */ new Map(), w = new Set(o.map((C) => C.target));
6099
+ p.filter((C) => !w.has(C)).forEach((C) => v.set(C, 0));
6098
6100
  let A = !0;
6099
6101
  for (; A; )
6100
6102
  A = !1, o.forEach((C) => {
@@ -6143,8 +6145,8 @@ function Tn(i, e, t, n) {
6143
6145
  o.forEach((C) => {
6144
6146
  const T = ne.get(C.source), R = ne.get(C.target);
6145
6147
  if (!T || !R) return;
6146
- const D = Fe.get(C.source) || 0, q = De.get(C.target) || 0, se = I.get(C.source) || 1, oe = F.get(C.target) || 1, re = C.value / se * T.height, V = C.value / oe * R.height, L = T.x + T.width, $ = T.y + D, J = $ + re, z = R.x, K = R.y + q, Se = K + V, ge = (z - L) * 0.5, Me = i.createLinearGradient(L, ($ + J) / 2, z, (K + Se) / 2);
6147
- Me.addColorStop(0, T.color), Me.addColorStop(1, R.color), i.beginPath(), i.moveTo(L, $), i.bezierCurveTo(L + ge, $, z - ge, K, z, K), i.lineTo(z, Se), i.bezierCurveTo(z - ge, Se, L + ge, J, L, J), i.closePath(), i.fillStyle = Me, i.globalAlpha = h, i.fill(), i.strokeStyle = T.color, i.globalAlpha = h * 0.3, i.lineWidth = 0.5, i.stroke(), Fe.set(C.source, D + re), De.set(C.target, q + V);
6148
+ const D = Fe.get(C.source) || 0, q = De.get(C.target) || 0, se = I.get(C.source) || 1, oe = F.get(C.target) || 1, re = C.value / se * T.height, V = C.value / oe * R.height, L = T.x + T.width, $ = T.y + D, J = $ + re, z = R.x, K = R.y + q, we = K + V, ge = (z - L) * 0.5, Me = i.createLinearGradient(L, ($ + J) / 2, z, (K + we) / 2);
6149
+ Me.addColorStop(0, T.color), Me.addColorStop(1, R.color), i.beginPath(), i.moveTo(L, $), i.bezierCurveTo(L + ge, $, z - ge, K, z, K), i.lineTo(z, we), i.bezierCurveTo(z - ge, we, L + ge, J, L, J), i.closePath(), i.fillStyle = Me, i.globalAlpha = h, i.fill(), i.strokeStyle = T.color, i.globalAlpha = h * 0.3, i.lineWidth = 0.5, i.stroke(), Fe.set(C.source, D + re), De.set(C.target, q + V);
6148
6150
  }), i.restore(), i.save(), i.globalAlpha = 1, ne.forEach((C) => {
6149
6151
  i.fillStyle = C.color, i.fillRect(C.x, C.y, C.width, C.height);
6150
6152
  const T = i.createLinearGradient(C.x, C.y, C.x + C.width, C.y);
@@ -6231,8 +6233,8 @@ function In(i, e) {
6231
6233
  const g = i.renderer.getBuffer(`${s.getId()}_box_lines`), y = i.renderer.getBuffer(`${s.getId()}_box_faces`);
6232
6234
  if (g && y) {
6233
6235
  const x = s.getYAxisId() || i.primaryYAxisId, b = i.yScales.get(x);
6234
- let w;
6235
- b && (w = { min: b.domain[0], max: b.domain[1] }), u = {
6236
+ let S;
6237
+ b && (S = { min: b.domain[0], max: b.domain[1] }), u = {
6236
6238
  id: s.getId(),
6237
6239
  buffer: g,
6238
6240
  // Use lines buffer as main buffer for reference
@@ -6241,7 +6243,7 @@ function In(i, e) {
6241
6243
  style: s.getStyle(),
6242
6244
  visible: s.isVisible(),
6243
6245
  type: "boxplot",
6244
- yBounds: w,
6246
+ yBounds: S,
6245
6247
  boxLinesBuffer: g,
6246
6248
  boxLinesCount: s.getPointCount() * 10,
6247
6249
  boxBuffer: y,
@@ -6252,10 +6254,10 @@ function In(i, e) {
6252
6254
  if (r === "waterfall" && !u) {
6253
6255
  const g = i.renderer.getBuffer(`${s.getId()}_wf_positive`), y = i.renderer.getBuffer(`${s.getId()}_wf_negative`), x = i.renderer.getBuffer(`${s.getId()}_wf_subtotal`), b = i.renderer.getBuffer(`${s.getId()}_wf_connectors`);
6254
6256
  if (g || y || x) {
6255
- const w = s.getYAxisId() || i.primaryYAxisId, p = i.yScales.get(w);
6257
+ const S = s.getYAxisId() || i.primaryYAxisId, p = i.yScales.get(S);
6256
6258
  let v;
6257
6259
  p && (v = { min: p.domain[0], max: p.domain[1] });
6258
- const S = s.waterfallCounts || { positive: 0, negative: 0, subtotal: 0, connectors: 0 };
6260
+ const w = s.waterfallCounts || { positive: 0, negative: 0, subtotal: 0, connectors: 0 };
6259
6261
  u = {
6260
6262
  id: s.getId(),
6261
6263
  buffer: g || y || x,
@@ -6267,13 +6269,13 @@ function In(i, e) {
6267
6269
  type: "waterfall",
6268
6270
  yBounds: v,
6269
6271
  wfPositiveBuffer: g,
6270
- wfPositiveCount: S.positive,
6272
+ wfPositiveCount: w.positive,
6271
6273
  wfNegativeBuffer: y,
6272
- wfNegativeCount: S.negative,
6274
+ wfNegativeCount: w.negative,
6273
6275
  wfSubtotalBuffer: x,
6274
- wfSubtotalCount: S.subtotal,
6276
+ wfSubtotalCount: w.subtotal,
6275
6277
  wfConnectorBuffer: b,
6276
- wfConnectorCount: S.connectors
6278
+ wfConnectorCount: w.connectors
6277
6279
  };
6278
6280
  }
6279
6281
  }
@@ -6288,8 +6290,8 @@ function In(i, e) {
6288
6290
  if (r === "heatmap") {
6289
6291
  const y = s.getHeatmapData(), x = s.getHeatmapStyle();
6290
6292
  if (y) {
6291
- const b = y.xValues.length, w = y.yValues.length;
6292
- u.count = (b - 1) * (w - 1) * 6;
6293
+ const b = y.xValues.length, S = y.yValues.length;
6294
+ u.count = (b - 1) * (S - 1) * 6;
6293
6295
  let p = 1 / 0, v = -1 / 0;
6294
6296
  for (let M = 0; M < y.zValues.length; M++) {
6295
6297
  const A = y.zValues[M];
@@ -6299,8 +6301,8 @@ function In(i, e) {
6299
6301
  min: ((a = x == null ? void 0 : x.colorScale) == null ? void 0 : a.min) ?? (p === 1 / 0 ? 0 : p),
6300
6302
  max: ((l = x == null ? void 0 : x.colorScale) == null ? void 0 : l.max) ?? (v === -1 / 0 ? 1 : v)
6301
6303
  }, u.zBounds.min === u.zBounds.max && (u.zBounds.max = u.zBounds.min + 1);
6302
- const S = `${s.getId()}_colormap`;
6303
- u.colormapTexture = i.renderer.getTexture(S);
6304
+ const w = `${s.getId()}_colormap`;
6305
+ u.colormapTexture = i.renderer.getTexture(w);
6304
6306
  }
6305
6307
  }
6306
6308
  }
@@ -6346,7 +6348,7 @@ function In(i, e) {
6346
6348
  return t;
6347
6349
  }
6348
6350
  function Ue(i, e, t) {
6349
- var y, x, b, w;
6351
+ var y, x, b, S;
6350
6352
  const n = i.container.getBoundingClientRect();
6351
6353
  if (n.width === 0 || n.height === 0) {
6352
6354
  console.warn(
@@ -6361,10 +6363,10 @@ function Ue(i, e, t) {
6361
6363
  if (p.isVisible())
6362
6364
  if (v === "polar") {
6363
6365
  s = !0;
6364
- const S = p.getPolarData();
6365
- if (S) {
6366
- for (let A = 0; A < S.r.length; A++)
6367
- a = Math.max(a, Math.abs(S.r[A]));
6366
+ const w = p.getPolarData();
6367
+ if (w) {
6368
+ for (let A = 0; A < w.r.length; A++)
6369
+ a = Math.max(a, Math.abs(w.r[A]));
6368
6370
  const M = p.getStyle();
6369
6371
  M.angleMode && (l = M.angleMode), M.radialDivisions && (h = M.radialDivisions), M.angularDivisions && (d = M.angularDivisions);
6370
6372
  }
@@ -6394,27 +6396,27 @@ function Ue(i, e, t) {
6394
6396
  if (!p.isVisible()) return;
6395
6397
  const v = p.getType();
6396
6398
  if (v === "gauge") {
6397
- const S = p.getGaugeData(), M = p.getGaugeStyle();
6398
- S && M && Bn(i.overlayCtx, S, M, e);
6399
+ const w = p.getGaugeData(), M = p.getGaugeStyle();
6400
+ w && M && Bn(i.overlayCtx, w, M, e);
6399
6401
  } else if (v === "sankey") {
6400
- const S = p.getSankeyData(), M = p.getSankeyStyle();
6401
- S && M && Tn(i.overlayCtx, S, M, e);
6402
+ const w = p.getSankeyData(), M = p.getSankeyStyle();
6403
+ w && M && Tn(i.overlayCtx, w, M, e);
6402
6404
  }
6403
6405
  }), c || i.overlay.drawXAxis(e, i.xScale, i.xAxisOptions, i.layout.xAxisLayout);
6404
6406
  const f = [], u = [];
6405
6407
  i.yAxisOptionsMap.forEach((p, v) => {
6406
6408
  p.position === "right" ? u.push(v) : f.push(v);
6407
6409
  }), c || (f.forEach((p, v) => {
6408
- const S = i.yScales.get(p), M = i.yAxisOptionsMap.get(p);
6409
- if (S && M) {
6410
+ const w = i.yScales.get(p), M = i.yAxisOptionsMap.get(p);
6411
+ if (w && M) {
6410
6412
  const A = v * 65;
6411
- i.overlay.drawYAxis(e, S, M, "left", A, i.layout.yAxisLayout);
6413
+ i.overlay.drawYAxis(e, w, M, "left", A, i.layout.yAxisLayout);
6412
6414
  }
6413
6415
  }), u.forEach((p, v) => {
6414
- const S = i.yScales.get(p), M = i.yAxisOptionsMap.get(p);
6415
- if (S && M) {
6416
+ const w = i.yScales.get(p), M = i.yAxisOptionsMap.get(p);
6417
+ if (w && M) {
6416
6418
  const A = v * 65;
6417
- i.overlay.drawYAxis(e, S, M, "right", A, i.layout.yAxisLayout);
6419
+ i.overlay.drawYAxis(e, w, M, "right", A, i.layout.yAxisLayout);
6418
6420
  }
6419
6421
  })), i.overlay.drawPlotBorder(e), i.series.forEach((p) => {
6420
6422
  if (p.isVisible() && p.hasErrorData()) {
@@ -6423,11 +6425,11 @@ function Ue(i, e, t) {
6423
6425
  }
6424
6426
  }), i.series.forEach((p) => {
6425
6427
  if (!p.isVisible() || p.getType() !== "candlestick") return;
6426
- const v = p.getYAxisId() || i.primaryYAxisId, S = i.yScales.get(v) || t;
6427
- i.overlay.drawCandlestickMarkers(e, p, i.xScale, S);
6428
+ const v = p.getYAxisId() || i.primaryYAxisId, w = i.yScales.get(v) || t;
6429
+ i.overlay.drawCandlestickMarkers(e, p, i.xScale, w);
6428
6430
  });
6429
6431
  const g = ((b = i.getAlerts) == null ? void 0 : b.call(i)) ?? [];
6430
- if (g.length && i.overlay.drawPriceAlertLines(e, g, t), i.selectionRect && i.overlay.drawSelectionRect(i.selectionRect), i.selectionManager.render(i.overlayCtx, e), (w = i.cursorOptions) != null && w.enabled && i.cursorPosition) {
6432
+ if (g.length && i.overlay.drawPriceAlertLines(e, g, t), i.selectionRect && i.overlay.drawSelectionRect(i.selectionRect), i.selectionManager.render(i.overlayCtx, e), (S = i.cursorOptions) != null && S.enabled && i.cursorPosition) {
6431
6433
  const p = i.cursorOptions.valueDisplayMode ?? "floating";
6432
6434
  let v;
6433
6435
  p !== "disabled" && (v = i.cursorOptions.formatter ? i.cursorOptions.formatter(
@@ -6436,7 +6438,7 @@ function Ue(i, e, t) {
6436
6438
  ""
6437
6439
  ) : `X: ${i.pixelToDataX(i.cursorPosition.x).toFixed(3)}
6438
6440
  Y: ${i.pixelToDataY(i.cursorPosition.y).toExponential(2)}`);
6439
- const S = {
6441
+ const w = {
6440
6442
  enabled: !0,
6441
6443
  x: i.cursorPosition.x,
6442
6444
  y: i.cursorPosition.y,
@@ -6445,7 +6447,7 @@ Y: ${i.pixelToDataY(i.cursorPosition.y).toExponential(2)}`);
6445
6447
  valueDisplayMode: p,
6446
6448
  cornerPosition: i.cursorOptions.cornerPosition ?? "top-left"
6447
6449
  };
6448
- i.overlay.drawCursor(e, S, i.cursorOptions.lineStyle);
6450
+ i.overlay.drawCursor(e, w, i.cursorOptions.lineStyle);
6449
6451
  }
6450
6452
  }
6451
6453
  class En {
@@ -6468,6 +6470,10 @@ class En {
6468
6470
  setRenderer(e) {
6469
6471
  this.ctx.renderer = e;
6470
6472
  }
6473
+ /** Swap the X scale (e.g. broken-axis plugin) — the context holds a snapshot. */
6474
+ setXScale(e) {
6475
+ this.ctx.xScale = e;
6476
+ }
6471
6477
  /**
6472
6478
  * Check if init has started
6473
6479
  */
@@ -6599,7 +6605,7 @@ function Rn(i) {
6599
6605
  data: i.data,
6600
6606
  style: i.style,
6601
6607
  name: i.label
6602
- }, n = we(t);
6608
+ }, n = Se(t);
6603
6609
  return {
6604
6610
  id: i.id,
6605
6611
  height: i.height ?? 0.25,
@@ -6620,9 +6626,65 @@ function Rn(i) {
6620
6626
  series: n
6621
6627
  };
6622
6628
  }
6623
- let Z = null;
6624
- function Fn() {
6625
- return Z || (Z = new St(
6629
+ let Q = null;
6630
+ function Fn(i) {
6631
+ const e = performance.now();
6632
+ switch (i.indicator) {
6633
+ case "rsi":
6634
+ return {
6635
+ id: i.id,
6636
+ type: "indicator-result",
6637
+ indicator: "rsi",
6638
+ values: bt(i.data, i.period ?? 14),
6639
+ duration: performance.now() - e
6640
+ };
6641
+ case "sma":
6642
+ return {
6643
+ id: i.id,
6644
+ type: "indicator-result",
6645
+ indicator: "sma",
6646
+ values: xt(i.data, i.period ?? 14),
6647
+ duration: performance.now() - e
6648
+ };
6649
+ case "ema":
6650
+ return {
6651
+ id: i.id,
6652
+ type: "indicator-result",
6653
+ indicator: "ema",
6654
+ values: pt(i.data, i.period ?? 14),
6655
+ duration: performance.now() - e
6656
+ };
6657
+ case "macd": {
6658
+ const t = mt(
6659
+ i.data,
6660
+ i.fastPeriod ?? 12,
6661
+ i.slowPeriod ?? 26,
6662
+ i.signalPeriod ?? 9
6663
+ );
6664
+ return {
6665
+ id: i.id,
6666
+ type: "indicator-result",
6667
+ indicator: "macd",
6668
+ ...t,
6669
+ duration: performance.now() - e
6670
+ };
6671
+ }
6672
+ case "bollingerBands": {
6673
+ const t = yt(i.data, i.period ?? 20, i.stdDev ?? 2);
6674
+ return {
6675
+ id: i.id,
6676
+ type: "indicator-result",
6677
+ indicator: "bollingerBands",
6678
+ ...t,
6679
+ duration: performance.now() - e
6680
+ };
6681
+ }
6682
+ default:
6683
+ throw new Error(`Unknown indicator: ${i.indicator}`);
6684
+ }
6685
+ }
6686
+ function Dn() {
6687
+ return Q || (Q = new wt(
6626
6688
  () => new Worker(new URL(
6627
6689
  /* @vite-ignore */
6628
6690
  "/assets/indicator.worker-bv0zC4EX.js",
@@ -6631,70 +6693,15 @@ function Fn() {
6631
6693
  {
6632
6694
  poolSize: 2,
6633
6695
  syncFallback: !0,
6634
- syncHandler(i) {
6635
- const e = performance.now();
6636
- switch (i.indicator) {
6637
- case "rsi":
6638
- return {
6639
- id: i.id,
6640
- type: "indicator-result",
6641
- indicator: "rsi",
6642
- values: bt(i.data, i.period ?? 14),
6643
- duration: performance.now() - e
6644
- };
6645
- case "sma":
6646
- return {
6647
- id: i.id,
6648
- type: "indicator-result",
6649
- indicator: "sma",
6650
- values: xt(i.data, i.period ?? 14),
6651
- duration: performance.now() - e
6652
- };
6653
- case "ema":
6654
- return {
6655
- id: i.id,
6656
- type: "indicator-result",
6657
- indicator: "ema",
6658
- values: pt(i.data, i.period ?? 14),
6659
- duration: performance.now() - e
6660
- };
6661
- case "macd": {
6662
- const t = mt(
6663
- i.data,
6664
- i.fastPeriod ?? 12,
6665
- i.slowPeriod ?? 26,
6666
- i.signalPeriod ?? 9
6667
- );
6668
- return {
6669
- id: i.id,
6670
- type: "indicator-result",
6671
- indicator: "macd",
6672
- ...t,
6673
- duration: performance.now() - e
6674
- };
6675
- }
6676
- case "bollingerBands": {
6677
- const t = yt(i.data, i.period ?? 20, i.stdDev ?? 2);
6678
- return {
6679
- id: i.id,
6680
- type: "indicator-result",
6681
- indicator: "bollingerBands",
6682
- ...t,
6683
- duration: performance.now() - e
6684
- };
6685
- }
6686
- default:
6687
- throw new Error(`Unknown indicator: ${i.indicator}`);
6688
- }
6689
- }
6696
+ syncHandler: Fn
6690
6697
  }
6691
- )), Z;
6698
+ )), Q;
6692
6699
  }
6693
6700
  function ue(i) {
6694
6701
  return i instanceof Float32Array || i instanceof Float64Array ? i : Float32Array.from(i);
6695
6702
  }
6696
6703
  async function de(i) {
6697
- const e = wt(i.indicator), t = await Fn().run({ id: e, type: "indicator", ...i });
6704
+ const e = St(i.indicator), t = await Dn().run({ id: e, type: "indicator", ...i });
6698
6705
  return {
6699
6706
  values: t.values,
6700
6707
  signal: t.signal,
@@ -6704,16 +6711,16 @@ async function de(i) {
6704
6711
  duration: t.duration
6705
6712
  };
6706
6713
  }
6707
- async function Dn(i, e = 14) {
6714
+ async function Ln(i, e = 14) {
6708
6715
  return de({ indicator: "rsi", data: ue(i), period: e });
6709
6716
  }
6710
- async function Ln(i, e = 14) {
6717
+ async function zn(i, e = 14) {
6711
6718
  return de({ indicator: "sma", data: ue(i), period: e });
6712
6719
  }
6713
- async function zn(i, e = 14) {
6720
+ async function On(i, e = 14) {
6714
6721
  return de({ indicator: "ema", data: ue(i), period: e });
6715
6722
  }
6716
- async function On(i, e = 12, t = 26, n = 9) {
6723
+ async function $n(i, e = 12, t = 26, n = 9) {
6717
6724
  return de({
6718
6725
  indicator: "macd",
6719
6726
  data: ue(i),
@@ -6722,16 +6729,16 @@ async function On(i, e = 12, t = 26, n = 9) {
6722
6729
  signalPeriod: n
6723
6730
  });
6724
6731
  }
6725
- async function $n(i, e = 20, t = 2) {
6732
+ async function Yn(i, e = 20, t = 2) {
6726
6733
  return de({ indicator: "bollingerBands", data: ue(i), period: e, stdDev: t });
6727
6734
  }
6728
- function ys() {
6729
- Z == null || Z.destroy(), Z = null;
6735
+ function ps() {
6736
+ Q == null || Q.destroy(), Q = null;
6730
6737
  }
6731
- function Yn(i) {
6738
+ function _n(i) {
6732
6739
  return i === "bollingerBands" ? "bollinger" : i;
6733
6740
  }
6734
- function _n(i) {
6741
+ function Vn(i) {
6735
6742
  const e = i.getData(), t = e.x;
6736
6743
  if (!(t != null && t.length))
6737
6744
  throw new Error("[addIndicator] Source series has no X data");
@@ -6741,7 +6748,7 @@ function _n(i) {
6741
6748
  throw new Error("[addIndicator] Source series has no price/Y data");
6742
6749
  return { x: t, prices: s };
6743
6750
  }
6744
- function Vn(i) {
6751
+ function Xn(i) {
6745
6752
  const e = i.getData(), t = e.x;
6746
6753
  if (!(t != null && t.length))
6747
6754
  throw new Error("[addIndicator] Source series has no X data");
@@ -6765,10 +6772,10 @@ function rt(i, e) {
6765
6772
  return n;
6766
6773
  }
6767
6774
  async function at(i, e, t, n = {}, s) {
6768
- const o = Yn(i), r = n.id ?? o, a = e instanceof Float32Array || e instanceof Float64Array ? e : Float32Array.from(e);
6775
+ const o = _n(i), r = n.id ?? o, a = e instanceof Float32Array || e instanceof Float64Array ? e : Float32Array.from(e);
6769
6776
  switch (o) {
6770
6777
  case "rsi": {
6771
- const l = n.period ?? 14, { values: h } = await Dn(t, l);
6778
+ const l = n.period ?? 14, { values: h } = await Ln(t, l);
6772
6779
  return {
6773
6780
  id: r,
6774
6781
  preset: "rsi",
@@ -6785,7 +6792,7 @@ async function at(i, e, t, n = {}, s) {
6785
6792
  };
6786
6793
  }
6787
6794
  case "macd": {
6788
- const l = n.fastPeriod ?? 12, h = n.slowPeriod ?? 26, d = n.signalPeriod ?? 9, c = await On(t, l, h, d);
6795
+ const l = n.fastPeriod ?? 12, h = n.slowPeriod ?? 26, d = n.signalPeriod ?? 9, c = await $n(t, l, h, d);
6789
6796
  return {
6790
6797
  id: r,
6791
6798
  preset: "macd",
@@ -6806,7 +6813,7 @@ async function at(i, e, t, n = {}, s) {
6806
6813
  };
6807
6814
  }
6808
6815
  case "bollinger": {
6809
- const l = n.period ?? 20, h = n.stdDev ?? 2, d = await $n(t, l, h), c = d.upper ?? d.values, f = d.lower ?? d.values;
6816
+ const l = n.period ?? 20, h = n.stdDev ?? 2, d = await Yn(t, l, h), c = d.upper ?? d.values, f = d.lower ?? d.values;
6810
6817
  return {
6811
6818
  id: r,
6812
6819
  preset: "bollinger",
@@ -6826,7 +6833,7 @@ async function at(i, e, t, n = {}, s) {
6826
6833
  };
6827
6834
  }
6828
6835
  case "ema": {
6829
- const l = n.period ?? 14, { values: h } = await zn(t, l);
6836
+ const l = n.period ?? 14, { values: h } = await On(t, l);
6830
6837
  return {
6831
6838
  id: r,
6832
6839
  preset: "ema",
@@ -6838,7 +6845,7 @@ async function at(i, e, t, n = {}, s) {
6838
6845
  };
6839
6846
  }
6840
6847
  case "sma": {
6841
- const l = n.period ?? 14, { values: h } = await Ln(t, l);
6848
+ const l = n.period ?? 14, { values: h } = await zn(t, l);
6842
6849
  return {
6843
6850
  id: r,
6844
6851
  preset: "sma",
@@ -6852,7 +6859,7 @@ async function at(i, e, t, n = {}, s) {
6852
6859
  case "stochastic": {
6853
6860
  if (!s)
6854
6861
  throw new Error("[addIndicator] stochastic requires a candlestick source series");
6855
- const l = Vn(s), h = n.period ?? 14, d = n.signalPeriod ?? 3, c = vt(l, h, d);
6862
+ const l = Xn(s), h = n.period ?? 14, d = n.signalPeriod ?? 3, c = vt(l, h, d);
6856
6863
  return {
6857
6864
  id: r,
6858
6865
  preset: "stochastic",
@@ -6881,19 +6888,19 @@ function Wn(i, e) {
6881
6888
  (n === e || n.startsWith(`${e}-`)) && i.removeSeries(n);
6882
6889
  }
6883
6890
  }
6884
- async function Xn(i, e, t = {}) {
6885
- const n = rt(i, t.sourceSeriesId), { x: s, prices: o } = _n(n);
6891
+ async function Nn(i, e, t = {}) {
6892
+ const n = rt(i, t.sourceSeriesId), { x: s, prices: o } = Vn(n);
6886
6893
  return at(e, s, o, t, n);
6887
6894
  }
6888
- async function Nn(i, e, t = {}) {
6895
+ async function Hn(i, e, t = {}) {
6889
6896
  var l;
6890
6897
  if (t.pane === "new")
6891
6898
  throw new Error(
6892
6899
  "[addIndicator] pane: 'new' requires createStackedChart — use buildIndicatorPaneFromPreset() instead"
6893
6900
  );
6894
- const n = rt(i, t.sourceSeriesId), s = t.yAxisId ?? ((l = n.getYAxisId) == null ? void 0 : l.call(n)), o = await Xn(i, e, t);
6901
+ const n = rt(i, t.sourceSeriesId), s = t.yAxisId ?? ((l = n.getYAxisId) == null ? void 0 : l.call(n)), o = await Nn(i, e, t);
6895
6902
  Wn(i, o.id);
6896
- const r = we({
6903
+ const r = Se({
6897
6904
  id: o.id,
6898
6905
  data: o.data,
6899
6906
  name: t.label ?? o.id.toUpperCase()
@@ -6910,7 +6917,7 @@ async function Nn(i, e, t = {}) {
6910
6917
  seriesIds: a
6911
6918
  };
6912
6919
  }
6913
- async function ms(i, e, t, n, s) {
6920
+ async function xs(i, e, t, n, s) {
6914
6921
  const o = await at(i, e, t, n, s);
6915
6922
  return Rn({
6916
6923
  id: n.id ?? o.id,
@@ -6924,7 +6931,7 @@ async function ms(i, e, t, n, s) {
6924
6931
  data: o.data
6925
6932
  });
6926
6933
  }
6927
- class Hn {
6934
+ class Un {
6928
6935
  constructor(e, t) {
6929
6936
  m(this, "alerts", /* @__PURE__ */ new Map());
6930
6937
  m(this, "idCounter", 0);
@@ -6932,7 +6939,7 @@ class Hn {
6932
6939
  }
6933
6940
  addAlert(e) {
6934
6941
  const t = e.id ?? `alert_${++this.idCounter}`;
6935
- return this.alerts.set(t, { ...e, id: t, latched: !1 }), t;
6942
+ return this.alerts.set(t, { ...e, id: t }), t;
6936
6943
  }
6937
6944
  removeAlert(e) {
6938
6945
  return this.alerts.delete(e);
@@ -6941,12 +6948,11 @@ class Hn {
6941
6948
  this.alerts.clear();
6942
6949
  }
6943
6950
  getAlerts() {
6944
- return Array.from(this.alerts.values()).map(({ latched: e, ...t }) => t);
6951
+ return Array.from(this.alerts.values());
6945
6952
  }
6946
6953
  /** Call after data updates / render tick. */
6947
6954
  evaluate() {
6948
6955
  for (const [e, t] of [...this.alerts.entries()]) {
6949
- if (t.latched && t.once !== !1) continue;
6950
6956
  const n = this.getSeries(t.seriesId);
6951
6957
  if (!n) continue;
6952
6958
  const s = n.getData(), o = s.close ?? s.y;
@@ -6975,36 +6981,36 @@ class Hn {
6975
6981
  triggeredAt: Date.now(),
6976
6982
  triggerPrice: r
6977
6983
  };
6978
- this.events.emit("alert", h), t.once !== !1 && (t.latched = !0, this.alerts.delete(e));
6984
+ this.events.emit("alert", h), t.once !== !1 && this.alerts.delete(e);
6979
6985
  }
6980
6986
  }
6981
6987
  destroy() {
6982
6988
  this.alerts.clear();
6983
6989
  }
6984
6990
  }
6985
- const Un = {
6991
+ const qn = {
6986
6992
  entry: "#38bdf8",
6987
6993
  sl: "#ef4444",
6988
6994
  tp: "#22c55e"
6989
- }, qn = {
6995
+ }, Gn = {
6990
6996
  entry: "Entry",
6991
6997
  sl: "SL",
6992
6998
  tp: "TP"
6993
6999
  };
6994
- function Gn(i, e) {
7000
+ function jn(i, e) {
6995
7001
  const t = i.style ?? "entry";
6996
7002
  return {
6997
7003
  id: e,
6998
7004
  type: "horizontal-line",
6999
7005
  y: i.price,
7000
- color: i.color ?? Un[t],
7001
- label: i.label ?? qn[t],
7006
+ color: i.color ?? qn[t],
7007
+ label: i.label ?? Gn[t],
7002
7008
  labelPosition: "right",
7003
7009
  lineDash: t === "sl" ? [6, 4] : t === "tp" ? [4, 4] : void 0,
7004
7010
  interactive: i.interactive ?? !1
7005
7011
  };
7006
7012
  }
7007
- class jn {
7013
+ class Qn {
7008
7014
  constructor(e) {
7009
7015
  m(this, "container");
7010
7016
  m(this, "webglCanvas");
@@ -7022,6 +7028,12 @@ class jn {
7022
7028
  m(this, "yAxisOptionsMap");
7023
7029
  m(this, "primaryYAxisId");
7024
7030
  m(this, "dpr");
7031
+ /**
7032
+ * When set, overrides the device pixel ratio used by `resize()` instead of
7033
+ * recomputing it from `window.devicePixelRatio`. Used by high-resolution
7034
+ * export (snapshot) so the boosted DPR is not clobbered on the next resize.
7035
+ */
7036
+ m(this, "dprOverride", null);
7025
7037
  m(this, "backgroundColor");
7026
7038
  m(this, "plotAreaBackground");
7027
7039
  m(this, "renderer");
@@ -7119,7 +7131,7 @@ class jn {
7119
7131
  var r;
7120
7132
  return (r = this.pluginManager) == null ? void 0 : r.get(o);
7121
7133
  }
7122
- }), this.pluginBridge = new wn(this.pluginManager), e.loading !== !1) {
7134
+ }), this.pluginBridge = new Sn(this.pluginManager), e.loading !== !1) {
7123
7135
  const o = typeof e.loading == "object" ? e.loading : {
7124
7136
  message: "Loading SciPlot...",
7125
7137
  overlayOpacity: 0.1
@@ -7141,7 +7153,7 @@ class jn {
7141
7153
  requestRender: () => this.requestRender()
7142
7154
  }), this.events.on("selectionChange", (o) => {
7143
7155
  this.pluginManager.notifySelectionChange(o.selected);
7144
- }), this.animationEngine = new it(), this.animationConfig = typeof e.animations == "boolean" ? { ...X, enabled: e.animations } : _e(e.animations);
7156
+ }), this.animationEngine = new it(), this.animationConfig = typeof e.animations == "boolean" ? { ...W, enabled: e.animations } : _e(e.animations);
7145
7157
  const s = typeof e.responsive == "boolean" ? { enabled: e.responsive } : e.responsive;
7146
7158
  this.responsiveManager = new ri(
7147
7159
  {
@@ -7149,10 +7161,10 @@ class jn {
7149
7161
  onStateChange: (o) => this.handleResponsiveChange(o)
7150
7162
  },
7151
7163
  s
7152
- ), this.alertManager = new Hn(this.events, (o) => {
7164
+ ), this.alertManager = new Un(this.events, (o) => {
7153
7165
  const r = o ? this.series.get(o) : void 0;
7154
7166
  return r || this.series.values().next().value;
7155
- }), this.axisManager = new Sn({
7167
+ }), this.axisManager = new wn({
7156
7168
  xAxisOptions: this.xAxisOptions,
7157
7169
  xScale: this.xScale,
7158
7170
  yAxisOptionsMap: this.yAxisOptionsMap,
@@ -7324,7 +7336,8 @@ class jn {
7324
7336
  return this._isDestroyed;
7325
7337
  }
7326
7338
  setXScale(e) {
7327
- this.xScale = e, this.requestRender();
7339
+ var t, n, s;
7340
+ this.xScale = e, (t = this.axisManager) == null || t.setXScale(e), (n = this.renderLoop) == null || n.setXScale(e), (s = this.stateManager) == null || s.setXScale(e), this.requestRender();
7328
7341
  }
7329
7342
  setYScale(e, t) {
7330
7343
  this.yScales.set(e, t), this.requestRender();
@@ -7384,6 +7397,9 @@ class jn {
7384
7397
  get forecasting() {
7385
7398
  return this.pluginBridge.forecasting;
7386
7399
  }
7400
+ get patterns() {
7401
+ return this.pluginBridge.patterns;
7402
+ }
7387
7403
  get latex() {
7388
7404
  var e;
7389
7405
  return ((e = this.pluginBridge) == null ? void 0 : e.latex) ?? this.getPluginAPI("velo-plot-latex");
@@ -7611,7 +7627,7 @@ class jn {
7611
7627
  };
7612
7628
  }
7613
7629
  addSeries(e) {
7614
- Zi(this.getSeriesContext(), e);
7630
+ Qi(this.getSeriesContext(), e);
7615
7631
  const t = this.series.get(e.id);
7616
7632
  t && this.pluginManager.notifySeriesAdd({ series: t, changeType: "add" });
7617
7633
  }
@@ -7667,7 +7683,7 @@ class jn {
7667
7683
  * For stacked layouts use buildIndicatorPaneFromPreset() when creating panes.
7668
7684
  */
7669
7685
  async addIndicator(e, t) {
7670
- return Nn(this, e, t);
7686
+ return Hn(this, e, t);
7671
7687
  }
7672
7688
  addAlert(e) {
7673
7689
  return this.alertManager.addAlert(e);
@@ -7683,7 +7699,7 @@ class jn {
7683
7699
  }
7684
7700
  addPositionLine(e) {
7685
7701
  const t = e.id ?? `position-${++this.positionLineCounter}`;
7686
- return this.addAnnotation(Gn(e, t)), t;
7702
+ return this.addAnnotation(jn(e, t)), t;
7687
7703
  }
7688
7704
  setDrawingMode(e) {
7689
7705
  var n;
@@ -7842,7 +7858,7 @@ class jn {
7842
7858
  }
7843
7859
  handleBoxZoom(e) {
7844
7860
  const t = e === null;
7845
- this.selectionRect = wi(
7861
+ this.selectionRect = Si(
7846
7862
  this.getNavContext(),
7847
7863
  e,
7848
7864
  this.selectionRect,
@@ -7957,6 +7973,16 @@ class jn {
7957
7973
  setDPR(e) {
7958
7974
  this.dpr = e, this.renderer.setDPR(e), this.overlay.setTheme(this.theme), this.resize(), this.requestRender();
7959
7975
  }
7976
+ /**
7977
+ * Locks the device pixel ratio to an explicit value (or clears the lock with
7978
+ * `null`). Unlike {@link setDPR}, this survives subsequent `resize()` calls,
7979
+ * which is required for high-resolution export: the backing stores must stay
7980
+ * enlarged while the snapshot is captured. Pass `null` to restore automatic
7981
+ * DPR handling based on `window.devicePixelRatio`.
7982
+ */
7983
+ setDevicePixelRatioOverride(e) {
7984
+ this.dprOverride = e, e !== null && (this.dpr = e, this.renderer.setDPR(e), this.overlay.setTheme(this.theme)), this.resize(), this.requestRender();
7985
+ }
7960
7986
  /**
7961
7987
  * Update X axis configuration
7962
7988
  */
@@ -8186,7 +8212,7 @@ class jn {
8186
8212
  // Rendering
8187
8213
  resize() {
8188
8214
  if (this.isDestroyed || this.resizeSuspended || !this.renderer) return;
8189
- const e = this.initialOptions.devicePixelRatio ?? window.devicePixelRatio;
8215
+ const e = this.dprOverride ?? this.initialOptions.devicePixelRatio ?? window.devicePixelRatio;
8190
8216
  Math.abs(e - this.dpr) > 1e-3 && (this.dpr = e, this.renderer.setDPR(this.dpr)), an(
8191
8217
  this.container,
8192
8218
  this.webglCanvas,
@@ -8247,8 +8273,8 @@ class jn {
8247
8273
  this.selectionManager.clearSelection(), await new Promise((e) => requestAnimationFrame(() => requestAnimationFrame(e))), this.animationEngine.isAnimating() && await this.animationEngine.waitForIdle(), this.deltaTool && this.deltaTool.recalculate(), this.peakTool && this.peakTool.recalculate(), this.requestOverlayRender();
8248
8274
  }
8249
8275
  }
8250
- function ps(i) {
8251
- const e = new jn(i);
8276
+ function bs(i) {
8277
+ const e = new Qn(i);
8252
8278
  return bn().then((t) => {
8253
8279
  if (e.setInitQueueId(t), e.isDestroyed) {
8254
8280
  Ie(t);
@@ -8260,16 +8286,16 @@ function ps(i) {
8260
8286
  }), e;
8261
8287
  }
8262
8288
  export {
8263
- os as $,
8289
+ as as $,
8264
8290
  it as A,
8265
- ns as B,
8291
+ os as B,
8266
8292
  vn as C,
8267
8293
  Te as D,
8268
8294
  ei as E,
8269
8295
  et as F,
8270
8296
  O as G,
8271
8297
  ot as H,
8272
- Xe as I,
8298
+ We as I,
8273
8299
  Ne as J,
8274
8300
  Mn as K,
8275
8301
  Kt as L,
@@ -8280,45 +8306,45 @@ export {
8280
8306
  An as Q,
8281
8307
  Pn as R,
8282
8308
  Di as S,
8283
- fs as T,
8284
- gs as U,
8285
- Dn as V,
8286
- Ln as W,
8287
- zn as X,
8288
- On as Y,
8289
- $n as Z,
8290
- ys as _,
8291
- Nn as a,
8309
+ ys as T,
8310
+ ms as U,
8311
+ Ln as V,
8312
+ zn as W,
8313
+ On as X,
8314
+ $n as Y,
8315
+ Yn as Z,
8316
+ ps as _,
8317
+ Hn as a,
8292
8318
  Rn as a0,
8293
8319
  at as a1,
8294
- rs as a2,
8295
- Gn as a3,
8320
+ ls as a2,
8321
+ jn as a3,
8296
8322
  dn as a4,
8297
8323
  fn as a5,
8298
- ms as b,
8299
- ps as c,
8300
- Xn as d,
8324
+ xs as b,
8325
+ bs as c,
8326
+ Nn as d,
8301
8327
  qi as e,
8302
8328
  ti as f,
8303
- we as g,
8304
- _n as h,
8305
- ls as i,
8329
+ Se as g,
8330
+ Vn as h,
8331
+ cs as i,
8306
8332
  te as j,
8307
- Si as k,
8308
- X as l,
8333
+ wi as k,
8334
+ W as l,
8309
8335
  st as m,
8310
8336
  _e as n,
8311
- ss as o,
8312
- hs as p,
8313
- cs as q,
8337
+ rs as o,
8338
+ us as p,
8339
+ ds as q,
8314
8340
  rt as r,
8315
8341
  Y as s,
8316
- ds as t,
8342
+ gs as t,
8317
8343
  ie as u,
8318
- as as v,
8319
- us as w,
8320
- Qe as x,
8344
+ hs as v,
8345
+ fs as w,
8346
+ Ze as x,
8321
8347
  _ as y,
8322
8348
  Jt as z
8323
8349
  };
8324
- //# sourceMappingURL=ChartCore-BhQ4j7f5.js.map
8350
+ //# sourceMappingURL=ChartCore-ivzLqxVb.js.map