@tradecanvas/core 1.11.0 → 1.13.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 (107) hide show
  1. package/README.md +2 -4
  2. package/dist/{WebGLSeriesRenderer-DVJBHdfm.js → WebGLSeriesRenderer-BNrnoMHq.js} +202 -159
  3. package/dist/{WebGLSeriesRenderer-DVJBHdfm.js.map → WebGLSeriesRenderer-BNrnoMHq.js.map} +1 -1
  4. package/dist/WebGLSeriesRenderer-Bclv4lzZ.cjs +429 -0
  5. package/dist/{WebGLSeriesRenderer-DjkYvHPQ.cjs.map → WebGLSeriesRenderer-Bclv4lzZ.cjs.map} +1 -1
  6. package/dist/axis/GridRenderer.d.ts +11 -1
  7. package/dist/axis/GridRenderer.d.ts.map +1 -1
  8. package/dist/charts/BaselineRenderer.d.ts.map +1 -1
  9. package/dist/charts/KagiRenderer.d.ts.map +1 -1
  10. package/dist/charts/PointAndFigureRenderer.d.ts.map +1 -1
  11. package/dist/engine/RenderEngine.d.ts +8 -1
  12. package/dist/engine/RenderEngine.d.ts.map +1 -1
  13. package/dist/engine/gpu.d.ts +3 -1
  14. package/dist/engine/gpu.d.ts.map +1 -1
  15. package/dist/engine/gpuContexts.d.ts +23 -0
  16. package/dist/engine/gpuContexts.d.ts.map +1 -0
  17. package/dist/engine/index.d.ts +3 -1
  18. package/dist/engine/index.d.ts.map +1 -1
  19. package/dist/engine/loadWebGL.d.ts +15 -2
  20. package/dist/engine/loadWebGL.d.ts.map +1 -1
  21. package/dist/features/ChartState.d.ts +10 -3
  22. package/dist/features/ChartState.d.ts.map +1 -1
  23. package/dist/{gridLines-BJLaM2d7.js → gpuContexts-Bn58hj7u.js} +156 -62
  24. package/dist/gpuContexts-Bn58hj7u.js.map +1 -0
  25. package/dist/{gridLines-CBmfrSCE.cjs → gpuContexts-DYrOp3uo.cjs} +2 -2
  26. package/dist/{gridLines-BJLaM2d7.js.map → gpuContexts-DYrOp3uo.cjs.map} +1 -1
  27. package/dist/index.cjs +5 -10
  28. package/dist/index.cjs.map +1 -1
  29. package/dist/index.js +3420 -2526
  30. package/dist/index.js.map +1 -1
  31. package/dist/indicators/IndicatorBase.d.ts +6 -1
  32. package/dist/indicators/IndicatorBase.d.ts.map +1 -1
  33. package/dist/indicators/IndicatorEngine.d.ts +14 -2
  34. package/dist/indicators/IndicatorEngine.d.ts.map +1 -1
  35. package/dist/indicators/index.d.ts +14 -2
  36. package/dist/indicators/index.d.ts.map +1 -1
  37. package/dist/indicators/linePen.d.ts +5 -1
  38. package/dist/indicators/linePen.d.ts.map +1 -1
  39. package/dist/indicators/math.d.ts +2 -0
  40. package/dist/indicators/math.d.ts.map +1 -1
  41. package/dist/indicators/overlay/Alligator.d.ts.map +1 -1
  42. package/dist/indicators/overlay/AnchoredVWAP.d.ts.map +1 -1
  43. package/dist/indicators/overlay/BollingerBands.d.ts.map +1 -1
  44. package/dist/indicators/overlay/ChandelierExit.d.ts.map +1 -1
  45. package/dist/indicators/overlay/DonchianChannel.d.ts.map +1 -1
  46. package/dist/indicators/overlay/EMA.d.ts.map +1 -1
  47. package/dist/indicators/overlay/Envelope.d.ts.map +1 -1
  48. package/dist/indicators/overlay/HammingMA.d.ts +19 -0
  49. package/dist/indicators/overlay/HammingMA.d.ts.map +1 -0
  50. package/dist/indicators/overlay/HullMA.d.ts.map +1 -1
  51. package/dist/indicators/overlay/Ichimoku.d.ts.map +1 -1
  52. package/dist/indicators/overlay/KeltnerChannel.d.ts.map +1 -1
  53. package/dist/indicators/overlay/LinearRegressionChannel.d.ts.map +1 -1
  54. package/dist/indicators/overlay/MAChannel.d.ts +13 -0
  55. package/dist/indicators/overlay/MAChannel.d.ts.map +1 -0
  56. package/dist/indicators/overlay/MACross.d.ts.map +1 -1
  57. package/dist/indicators/overlay/MTFMovingAverage.d.ts.map +1 -1
  58. package/dist/indicators/overlay/MovingAverageSets.d.ts +20 -0
  59. package/dist/indicators/overlay/MovingAverageSets.d.ts.map +1 -0
  60. package/dist/indicators/overlay/ParabolicSAR.d.ts.map +1 -1
  61. package/dist/indicators/overlay/PivotPoints.d.ts +5 -0
  62. package/dist/indicators/overlay/PivotPoints.d.ts.map +1 -1
  63. package/dist/indicators/overlay/PriceAverages.d.ts +25 -0
  64. package/dist/indicators/overlay/PriceAverages.d.ts.map +1 -0
  65. package/dist/indicators/overlay/SMA.d.ts.map +1 -1
  66. package/dist/indicators/overlay/SessionVWAP.d.ts.map +1 -1
  67. package/dist/indicators/overlay/Supertrend.d.ts.map +1 -1
  68. package/dist/indicators/overlay/TEMA.d.ts.map +1 -1
  69. package/dist/indicators/overlay/VWAP.d.ts.map +1 -1
  70. package/dist/indicators/overlay/VWMA.d.ts.map +1 -1
  71. package/dist/indicators/overlay/VolatilityIndex.d.ts +13 -0
  72. package/dist/indicators/overlay/VolatilityIndex.d.ts.map +1 -0
  73. package/dist/indicators/overlay/WMA.d.ts.map +1 -1
  74. package/dist/indicators/overlay/ZigZag.d.ts.map +1 -1
  75. package/dist/indicators/panel/AccumulativeSwingIndex.d.ts +13 -0
  76. package/dist/indicators/panel/AccumulativeSwingIndex.d.ts.map +1 -0
  77. package/dist/indicators/panel/AdvanceDecline.d.ts +18 -0
  78. package/dist/indicators/panel/AdvanceDecline.d.ts.map +1 -0
  79. package/dist/indicators/panel/ChopZone.d.ts +17 -0
  80. package/dist/indicators/panel/ChopZone.d.ts.map +1 -0
  81. package/dist/indicators/panel/ElderRay.d.ts.map +1 -1
  82. package/dist/indicators/panel/MajorityRule.d.ts +15 -0
  83. package/dist/indicators/panel/MajorityRule.d.ts.map +1 -0
  84. package/dist/indicators/panel/PriceOscillator.d.ts +8 -0
  85. package/dist/indicators/panel/PriceOscillator.d.ts.map +1 -0
  86. package/dist/indicators/panel/SMIErgodic.d.ts +12 -0
  87. package/dist/indicators/panel/SMIErgodic.d.ts.map +1 -0
  88. package/dist/indicators/panel/VolatilityEstimators.d.ts +29 -0
  89. package/dist/indicators/panel/VolatilityEstimators.d.ts.map +1 -0
  90. package/dist/indicators/plots.d.ts +10 -0
  91. package/dist/indicators/plots.d.ts.map +1 -1
  92. package/dist/indicators/registry.d.ts.map +1 -1
  93. package/dist/indicators/symbols/symbolIndicators.d.ts +27 -0
  94. package/dist/indicators/symbols/symbolIndicators.d.ts.map +1 -1
  95. package/dist/interaction/CrosshairHandler.d.ts.map +1 -1
  96. package/dist/interaction/PinnedTooltip.d.ts.map +1 -1
  97. package/dist/interaction/crosshairLooks.d.ts +7 -0
  98. package/dist/interaction/crosshairLooks.d.ts.map +1 -0
  99. package/dist/realtime/CurrentPriceLine.d.ts.map +1 -1
  100. package/dist/ui/ChartLegend.d.ts.map +1 -1
  101. package/dist/ui/SessionBreaks.d.ts +2 -0
  102. package/dist/ui/SessionBreaks.d.ts.map +1 -1
  103. package/dist/webgl/WebGLSeriesRenderer.d.ts +30 -12
  104. package/dist/webgl/WebGLSeriesRenderer.d.ts.map +1 -1
  105. package/package.json +2 -2
  106. package/dist/WebGLSeriesRenderer-DjkYvHPQ.cjs +0 -429
  107. package/dist/gridLines-CBmfrSCE.cjs.map +0 -1
@@ -1,6 +1,6 @@
1
- import { i as e, o as t, r as n, s as r, t as i } from "./gridLines-BJLaM2d7.js";
2
- import { resolveVolumeColors as a } from "@tradecanvas/commons";
3
- var o = (e, t) => e.time === t.time && e.open === t.open && e.high === t.high && e.low === t.low && e.close === t.close && e.volume === t.volume, s = class {
1
+ import { c as e, d as t, f as n, h as r, l as i, m as a, n as o } from "./gpuContexts-Bn58hj7u.js";
2
+ import { resolveVolumeColors as s } from "@tradecanvas/commons";
3
+ var c = (e, t) => e.time === t.time && e.open === t.open && e.high === t.high && e.low === t.low && e.close === t.close && e.volume === t.volume, l = class {
4
4
  buffer = new Float32Array();
5
5
  count = 0;
6
6
  basePrice = 0;
@@ -24,12 +24,12 @@ var o = (e, t) => e.time === t.time && e.open === t.open && e.high === t.high &&
24
24
  to: 0
25
25
  };
26
26
  let n = this.count;
27
- if (!(e === this.source && n > 0 && t >= n && this.samples.every(({ index: t, bar: n }) => o(e[t], n)))) return this.basePrice = e[t - 1].close, this.ensure(t), this.write(e, 0, t), this.remember(e), {
27
+ if (!(e === this.source && n > 0 && t >= n && this.samples.every(({ index: t, bar: n }) => c(e[t], n)))) return this.basePrice = e[t - 1].close, this.ensure(t), this.write(e, 0, t), this.remember(e), {
28
28
  full: !0,
29
29
  from: 0,
30
30
  to: t
31
31
  };
32
- let r = this.last !== null && o(e[n - 1], this.last) ? n : n - 1;
32
+ let r = this.last !== null && c(e[n - 1], this.last) ? n : n - 1;
33
33
  return t > this.buffer.length / 6 ? (this.ensure(t), this.write(e, 0, t), this.remember(e), {
34
34
  full: !0,
35
35
  from: 0,
@@ -62,11 +62,11 @@ var o = (e, t) => e.time === t.time && e.open === t.open && e.high === t.high &&
62
62
  bar: { ...e[t] }
63
63
  })), this.last = { ...e[t - 1] }, this.source = e;
64
64
  }
65
- }, c = /* @__PURE__ */ new Map(), l;
66
- function u(e, t) {
65
+ }, u = /* @__PURE__ */ new Map(), d;
66
+ function f(e, t) {
67
67
  return e.endsWith("%") ? parseFloat(e) / 100 : parseFloat(e) / t;
68
68
  }
69
- function d(e) {
69
+ function p(e) {
70
70
  let t = e.trim();
71
71
  if (t.toLowerCase() === "transparent") return [
72
72
  0,
@@ -88,28 +88,28 @@ function d(e) {
88
88
  }
89
89
  let r = /^rgba?\(\s*([\d.]+%?)[\s,]+([\d.]+%?)[\s,]+([\d.]+%?)(?:\s*[,/]\s*([\d.]+%?))?\s*\)$/i.exec(t);
90
90
  return r ? [
91
- u(r[1], 255),
92
- u(r[2], 255),
93
- u(r[3], 255),
94
- r[4] === void 0 ? 1 : u(r[4], 1)
91
+ f(r[1], 255),
92
+ f(r[2], 255),
93
+ f(r[3], 255),
94
+ r[4] === void 0 ? 1 : f(r[4], 1)
95
95
  ] : null;
96
96
  }
97
- function f() {
98
- if (l !== void 0) return l;
97
+ function m() {
98
+ if (d !== void 0) return d;
99
99
  try {
100
- l = typeof OffscreenCanvas < "u" ? new OffscreenCanvas(1, 1).getContext("2d") : typeof document < "u" ? document.createElement("canvas").getContext("2d") : null;
100
+ d = typeof OffscreenCanvas < "u" ? new OffscreenCanvas(1, 1).getContext("2d") : typeof document < "u" ? document.createElement("canvas").getContext("2d") : null;
101
101
  } catch {
102
- l = null;
102
+ d = null;
103
103
  }
104
- return l;
104
+ return d;
105
105
  }
106
- function p(e) {
107
- let t = f();
106
+ function h(e) {
107
+ let t = m();
108
108
  if (!t) return null;
109
109
  t.fillStyle = "#000", t.fillStyle = e;
110
110
  let n = String(t.fillStyle);
111
111
  if (t.fillStyle = "#fff", t.fillStyle = e, String(t.fillStyle) !== n) return null;
112
- let r = d(n);
112
+ let r = p(n);
113
113
  if (r) return r;
114
114
  t.clearRect(0, 0, 1, 1), t.fillRect(0, 0, 1, 1);
115
115
  let i = t.getImageData(0, 0, 1, 1).data;
@@ -120,23 +120,23 @@ function p(e) {
120
120
  i[3] / 255
121
121
  ];
122
122
  }
123
- var m = /* @__PURE__ */ new Set();
124
- function h(e) {
125
- let t = c.get(e);
123
+ var g = /* @__PURE__ */ new Set();
124
+ function _(e) {
125
+ let t = u.get(e);
126
126
  if (t) return t;
127
- if (m.has(e)) return null;
128
- let n = d(e) ?? p(e);
129
- return c.size > 256 && c.clear(), m.size > 256 && m.clear(), n ? c.set(e, n) : m.add(e), n;
127
+ if (g.has(e)) return null;
128
+ let n = p(e) ?? h(e);
129
+ return u.size > 256 && u.clear(), g.size > 256 && g.clear(), n ? u.set(e, n) : g.add(e), n;
130
130
  }
131
- function g(e) {
132
- return h(e) ?? [
131
+ function v(e) {
132
+ return _(e) ?? [
133
133
  0,
134
134
  0,
135
135
  0,
136
136
  0
137
137
  ];
138
138
  }
139
- function _([e, t, n, r]) {
139
+ function y([e, t, n, r]) {
140
140
  return [
141
141
  e * r,
142
142
  t * r,
@@ -146,7 +146,7 @@ function _([e, t, n, r]) {
146
146
  }
147
147
  //#endregion
148
148
  //#region src/webgl/yMapping.ts
149
- function v(e, t) {
149
+ function b(e, t) {
150
150
  let { min: n, max: r } = e.priceRange, { y: i, height: a } = e.chartRect, o = +(e.invertScale === !0), s = {
151
151
  log: 0,
152
152
  invert: o,
@@ -185,7 +185,7 @@ function v(e, t) {
185
185
  }
186
186
  //#endregion
187
187
  //#region src/webgl/glKit.ts
188
- var ee = class {
188
+ var x = class {
189
189
  constructor(e) {
190
190
  this.gl = e;
191
191
  }
@@ -253,16 +253,16 @@ var ee = class {
253
253
  };
254
254
  //#endregion
255
255
  //#region src/webgl/polygonSpans.ts
256
- function te(e) {
256
+ function ee(e) {
257
257
  let t = e.length / 2;
258
258
  if (t < 3) return [];
259
259
  let n = 0, r = 0;
260
260
  for (let i = 1; i < t; i++) e[2 * i] < e[2 * n] && (n = i), e[2 * i] > e[2 * r] && (r = i);
261
261
  if (e[2 * n] === e[2 * r]) return [];
262
- let i = b(e, n, r, 1, t), a = b(e, n, r, -1, t);
262
+ let i = C(e, n, r, 1, t), a = C(e, n, r, -1, t);
263
263
  return !i || !a ? null : ne(i, a);
264
264
  }
265
- function y(e) {
265
+ function S(e) {
266
266
  let t = 0, n = e.length / 2;
267
267
  for (let r = 0; r < n; r++) {
268
268
  let i = (r + 1) % n;
@@ -270,7 +270,7 @@ function y(e) {
270
270
  }
271
271
  return t / 2;
272
272
  }
273
- function b(e, t, n, r, i) {
273
+ function C(e, t, n, r, i) {
274
274
  let a = [e[2 * t], e[2 * t + 1]];
275
275
  for (let o = t; o !== n;) {
276
276
  if (o = (o + r + i) % i, e[2 * o] < a[a.length - 2]) return null;
@@ -278,7 +278,7 @@ function b(e, t, n, r, i) {
278
278
  }
279
279
  return a;
280
280
  }
281
- var x = class {
281
+ var te = class {
282
282
  i = 0;
283
283
  constructor(e) {
284
284
  this.c = e;
@@ -294,7 +294,7 @@ function ne(e, t) {
294
294
  let n = /* @__PURE__ */ new Set();
295
295
  for (let t = 0; t < e.length; t += 2) n.add(e[t]);
296
296
  for (let e = 0; e < t.length; e += 2) n.add(t[e]);
297
- let r = [...n].sort((e, t) => e - t), i = new x(e), a = new x(t), o = [], s = r.length - 2;
297
+ let r = [...n].sort((e, t) => e - t), i = new te(e), a = new te(t), o = [], s = r.length - 2;
298
298
  for (let e = 0; e <= s; e++) {
299
299
  let t = r[e], n = r[e + 1], [c, l] = i.at(t, n), [u, d] = a.at(t, n);
300
300
  c === u && l === d || o.push(t, n, c, l, u, d, +(e === 0), +(e === s));
@@ -303,7 +303,7 @@ function ne(e, t) {
303
303
  }
304
304
  //#endregion
305
305
  //#region src/webgl/recordedShaders.ts
306
- var S = "#version 300 es\nprecision highp float;\nuniform vec2 u_canvas;\nuniform vec4 u_clip;\n\nvec4 toClip(vec2 dev) {\n return vec4(dev.x / u_canvas.x * 2.0 - 1.0, 1.0 - dev.y / u_canvas.y * 2.0, 0.0, 1.0);\n}\n", C = "\nvec2 corner(int k) {\n if (k == 0) return vec2(0.0, 0.0);\n if (k == 1 || k == 4) return vec2(1.0, 0.0);\n if (k == 2 || k == 3) return vec2(0.0, 1.0);\n return vec2(1.0, 1.0);\n}\nconst vec4 NOWHERE = vec4(-2.0, -2.0, 0.0, 1.0);\n", w = "\n// This fragment's pixel centre in device pixels, y down.\nvec2 pixelCentre() { return vec2(gl_FragCoord.x, u_canvas.y - gl_FragCoord.y); }\n\n// The share of the pixel centred at p inside the clip.\nfloat clipCoverage(vec2 p) {\n vec2 lo = p - 0.5;\n vec2 c = clamp(min(lo + 1.0, u_clip.zw) - max(lo, u_clip.xy), 0.0, 1.0);\n return c.x * c.y;\n}\n", re = `${S}${C}
306
+ var w = "#version 300 es\nprecision highp float;\nuniform vec2 u_canvas;\nuniform vec4 u_clip;\n\nvec4 toClip(vec2 dev) {\n return vec4(dev.x / u_canvas.x * 2.0 - 1.0, 1.0 - dev.y / u_canvas.y * 2.0, 0.0, 1.0);\n}\n", T = "\nvec2 corner(int k) {\n if (k == 0) return vec2(0.0, 0.0);\n if (k == 1 || k == 4) return vec2(1.0, 0.0);\n if (k == 2 || k == 3) return vec2(0.0, 1.0);\n return vec2(1.0, 1.0);\n}\nconst vec4 NOWHERE = vec4(-2.0, -2.0, 0.0, 1.0);\n", E = "\n// This fragment's pixel centre in device pixels, y down.\nvec2 pixelCentre() { return vec2(gl_FragCoord.x, u_canvas.y - gl_FragCoord.y); }\n\n// The share of the pixel centred at p inside the clip.\nfloat clipCoverage(vec2 p) {\n vec2 lo = p - 0.5;\n vec2 c = clamp(min(lo + 1.0, u_clip.zw) - max(lo, u_clip.xy), 0.0, 1.0);\n return c.x * c.y;\n}\n", re = `${w}${T}
307
307
  uniform float u_hw;
308
308
  in vec4 a_p0;
309
309
  in vec4 a_p1;
@@ -332,7 +332,7 @@ void main() {
332
332
  vec2 pos = mix(a - dir * m, b + dir * m, cr.x) + n * mix(-m, m, cr.y);
333
333
  gl_Position = toClip(pos);
334
334
  }
335
- `, ie = `${S}${w}
335
+ `, ie = `${w}${E}
336
336
  uniform vec4 u_color;
337
337
  uniform float u_hw;
338
338
  uniform int u_cap;
@@ -411,7 +411,7 @@ void main() {
411
411
  if (cov <= 0.0) discard;
412
412
  outColor = u_color * (cov * clipCov);
413
413
  }
414
- `, ae = `${S}${C}
414
+ `, ae = `${w}${T}
415
415
  in vec2 a_x;
416
416
  in vec4 a_ab;
417
417
  in vec2 a_ends;
@@ -428,7 +428,7 @@ void main() {
428
428
  vec2 cr = corner(gl_VertexID % 6);
429
429
  gl_Position = toClip(mix(vec2(floor(a_x.x), floor(lo) - 1.0), vec2(ceil(a_x.y), ceil(hi) + 1.0), cr));
430
430
  }
431
- `, oe = `${S}${w}
431
+ `, oe = `${w}${E}
432
432
  uniform int u_kind;
433
433
  uniform vec4 u_color;
434
434
  uniform vec4 u_line;
@@ -486,7 +486,7 @@ void main() {
486
486
  vec4 color = u_kind == 1 ? gradient(p) : u_color;
487
487
  outColor = color * cov;
488
488
  }
489
- `, se = `${S}${C}
489
+ `, se = `${w}${T}
490
490
  in vec3 a_disc;
491
491
  in vec4 a_color;
492
492
  flat out vec3 v_disc;
@@ -497,7 +497,7 @@ void main() {
497
497
  float m = a_disc.z + 1.0;
498
498
  gl_Position = toClip(mix(a_disc.xy - m, a_disc.xy + m, corner(gl_VertexID % 6)));
499
499
  }
500
- `, ce = `${S}${w}
500
+ `, ce = `${w}${E}
501
501
  flat in vec3 v_disc;
502
502
  flat in vec4 v_color;
503
503
  out vec4 outColor;
@@ -507,7 +507,7 @@ void main() {
507
507
  if (cov <= 0.0) discard;
508
508
  outColor = v_color * cov;
509
509
  }
510
- `, T = 4, E = T * 4, D = 32, O = 7, k = O * 4, le = class {
510
+ `, D = 4, O = D * 4, k = 32, A = 7, j = A * 4, le = class {
511
511
  stroke;
512
512
  span;
513
513
  disc;
@@ -577,8 +577,8 @@ void main() {
577
577
  0,
578
578
  0
579
579
  ]), this.upload(new Float32Array(e.points));
580
- for (let e = 0; e < 6; e++) i.attrib(r, `a_p${e}`, 4, E, e * E);
581
- let a = e.points.length / T - 5;
580
+ for (let e = 0; e < 6; e++) i.attrib(r, `a_p${e}`, 4, O, e * O);
581
+ let a = e.points.length / D - 5;
582
582
  a > 0 && i.gl.drawArraysInstanced(i.gl.TRIANGLES, 0, 6, a);
583
583
  }
584
584
  drawFill(e, t, n) {
@@ -590,7 +590,7 @@ void main() {
590
590
  e.clip.y0,
591
591
  Math.min(e.clip.x1, t),
592
592
  Math.min(e.clip.y1, n)
593
- ]), this.upload(new Float32Array(e.spans)), r.attrib(a, "a_x", 2, D, 0), r.attrib(a, "a_ab", 4, D, 8), r.attrib(a, "a_ends", 2, D, 24), this.paint(a, e.paint), r.gl.drawArraysInstanced(r.gl.TRIANGLES, 0, 6, e.spans.length / 8);
593
+ ]), this.upload(new Float32Array(e.spans)), r.attrib(a, "a_x", 2, k, 0), r.attrib(a, "a_ab", 4, k, 8), r.attrib(a, "a_ends", 2, k, 24), this.paint(a, e.paint), r.gl.drawArraysInstanced(r.gl.TRIANGLES, 0, 6, e.spans.length / 8);
594
594
  }
595
595
  paint(e, t) {
596
596
  let n = this.kit;
@@ -617,15 +617,15 @@ void main() {
617
617
  }
618
618
  drawDiscs(e, t, n, r) {
619
619
  let i = this.disc;
620
- this.common(i, t, n, r) && (this.upload(new Float32Array(e)), this.kit.attrib(i, "a_disc", 3, k, 0), this.kit.attrib(i, "a_color", 4, k, 12), this.kit.gl.drawArraysInstanced(this.kit.gl.TRIANGLES, 0, 6, e.length / O));
620
+ this.common(i, t, n, r) && (this.upload(new Float32Array(e)), this.kit.attrib(i, "a_disc", 3, j, 0), this.kit.attrib(i, "a_color", 4, j, 12), this.kit.gl.drawArraysInstanced(this.kit.gl.TRIANGLES, 0, 6, e.length / A));
621
621
  }
622
- }, A = (e, t) => ({
622
+ }, M = (e, t) => ({
623
623
  x0: Math.max(e.x0, t.x0),
624
624
  y0: Math.max(e.y0, t.y0),
625
625
  x1: Math.min(e.x1, t.x1),
626
626
  y1: Math.min(e.y1, t.y1)
627
- }), j = (e) => !(e.x1 > e.x0 && e.y1 > e.y0);
628
- function M(e, t = 0) {
627
+ }), N = (e) => !(e.x1 > e.x0 && e.y1 > e.y0);
628
+ function P(e, t = 0) {
629
629
  let n = Infinity, r = Infinity, i = -Infinity, a = -Infinity;
630
630
  for (let t = 0; t < e.length; t += 2) {
631
631
  let o = e[t], s = e[t + 1];
@@ -638,7 +638,7 @@ function M(e, t = 0) {
638
638
  y1: a + t
639
639
  };
640
640
  }
641
- function N(e) {
641
+ function F(e) {
642
642
  let t = [...e].sort((e, t) => e.x0 - t.x0), n = [];
643
643
  for (let e of t) {
644
644
  for (let t = n.length - 1; t >= 0; t--) n[t].x1 <= e.x0 && n.splice(t, 1);
@@ -649,7 +649,7 @@ function N(e) {
649
649
  }
650
650
  //#endregion
651
651
  //#region src/webgl/recordedPath.ts
652
- var P = class {
652
+ var I = class {
653
653
  stops = [];
654
654
  constructor(e, t, n, r) {
655
655
  this.x0 = e, this.y0 = t, this.x1 = n, this.y1 = r;
@@ -661,14 +661,14 @@ var P = class {
661
661
  color: t
662
662
  });
663
663
  }
664
- }, F = typeof Path2D == "function" ? Path2D : class {}, I = class e extends F {
664
+ }, L = typeof Path2D == "function" ? Path2D : class {}, R = class e extends L {
665
665
  calls = [];
666
666
  unsupported = !1;
667
667
  constructor(t) {
668
668
  super(t), t instanceof e ? (this.calls.push(...t.calls), this.unsupported = t.unsupported) : t !== void 0 && (this.unsupported = !0);
669
669
  }
670
670
  note(e, t, n = t) {
671
- this.calls.push([e, t]), F.prototype[e]?.apply(this, n);
671
+ this.calls.push([e, t]), L.prototype[e]?.apply(this, n);
672
672
  }
673
673
  unfollowed(e, t) {
674
674
  this.unsupported = !0, this.note(e, [], t);
@@ -728,12 +728,12 @@ var P = class {
728
728
  this.unfollowed("roundRect", e);
729
729
  }
730
730
  addPath(t, n) {
731
- !(t instanceof e) || n !== void 0 ? this.unsupported = !0 : (this.calls.push(...t.calls), this.unsupported ||= t.unsupported), F.prototype.addPath?.call(this, t, n);
731
+ !(t instanceof e) || n !== void 0 ? this.unsupported = !0 : (this.calls.push(...t.calls), this.unsupported ||= t.unsupported), L.prototype.addPath?.call(this, t, n);
732
732
  }
733
733
  };
734
734
  function ue(e) {
735
735
  let t = globalThis, n = Object.prototype.hasOwnProperty.call(t, "Path2D"), r = t.Path2D;
736
- t.Path2D = I;
736
+ t.Path2D = R;
737
737
  try {
738
738
  e();
739
739
  } finally {
@@ -773,12 +773,12 @@ function me(e) {
773
773
  }
774
774
  //#endregion
775
775
  //#region src/webgl/recorder.ts
776
- var L = Math.PI * 2;
777
- function R(e, t) {
776
+ var z = Math.PI * 2;
777
+ function he(e, t) {
778
778
  let n = 2 * Math.sqrt(Math.max(.2 / Math.max(e, .1), 1e-6));
779
779
  return Math.min(512, Math.max(4, Math.ceil(Math.abs(t) / Math.min(n, Math.PI / 4))));
780
780
  }
781
- var z = new Set([
781
+ var B = new Set([
782
782
  "fillStyle",
783
783
  "strokeStyle",
784
784
  "lineWidth",
@@ -797,14 +797,14 @@ var z = new Set([
797
797
  "shadowOffsetX",
798
798
  "shadowOffsetY",
799
799
  "filter"
800
- ]), B = new Set([
800
+ ]), V = new Set([
801
801
  "fontKerning",
802
802
  "fontStretch",
803
803
  "fontVariantCaps",
804
804
  "letterSpacing",
805
805
  "wordSpacing",
806
806
  "textRendering"
807
- ]), V = new Set(["imageSmoothingEnabled", "imageSmoothingQuality"]), H = (e) => !!(e.rect || e.circle) || e.points.length >= 6, he = class {
807
+ ]), H = new Set(["imageSmoothingEnabled", "imageSmoothingQuality"]), U = (e) => !!(e.rect || e.circle) || e.points.length >= 6, ge = class {
808
808
  commands = [];
809
809
  ctx;
810
810
  texts = [];
@@ -845,7 +845,7 @@ var z = new Set([
845
845
  }
846
846
  return this.ok ? !0 : (this.commands.length = t.commands, i.length = t.texts, !1);
847
847
  },
848
- drawText: (e) => ge(e, i)
848
+ drawText: (e) => _e(e, i)
849
849
  };
850
850
  }
851
851
  reset(e) {
@@ -979,14 +979,14 @@ var z = new Set([
979
979
  ].every(Number.isFinite)) return;
980
980
  if (n < 0) throw new DOMException("negative radius", "IndexSizeError");
981
981
  let o = i - r;
982
- o = !a && o >= L ? L : a && -o >= L ? -L : a ? -(((r - i) % L + L) % L) : (o % L + L) % L;
983
- let s = this.current(), c = this.state.transform, l = e + n * Math.cos(r), u = t + n * Math.sin(r), d = !s || s.closed || s.points.length === 2 && Math.abs(s.points[0] - (c[0] * l + c[2] * u + c[4])) < 1e-6 && Math.abs(s.points[1] - (c[1] * l + c[3] * u + c[5])) < 1e-6, f = R(n * Math.abs(c[0]), o);
982
+ o = !a && o >= z ? z : a && -o >= z ? -z : a ? -(((r - i) % z + z) % z) : (o % z + z) % z;
983
+ let s = this.current(), c = this.state.transform, l = e + n * Math.cos(r), u = t + n * Math.sin(r), d = !s || s.closed || s.points.length === 2 && Math.abs(s.points[0] - (c[0] * l + c[2] * u + c[4])) < 1e-6 && Math.abs(s.points[1] - (c[1] * l + c[3] * u + c[5])) < 1e-6, f = he(n * Math.abs(c[0]), o);
984
984
  for (let i = 0; i <= f; i++) {
985
985
  let a = r + o * i / f;
986
986
  this.lineTo(e + n * Math.cos(a), t + n * Math.sin(a));
987
987
  }
988
988
  let p = this.current();
989
- Math.abs(o) >= L - 1e-9 && d && this.uniform() && p && (p.circle = {
989
+ Math.abs(o) >= z - 1e-9 && d && this.uniform() && p && (p.circle = {
990
990
  x: c[0] * e + c[4],
991
991
  y: c[3] * t + c[5],
992
992
  r: n * Math.abs(c[0])
@@ -1025,7 +1025,7 @@ var z = new Set([
1025
1025
  this.path = [], e(), t(), this.path = n;
1026
1026
  }
1027
1027
  onPath(e, t) {
1028
- if (!(e instanceof I) || e.unsupported) return this.unsupported();
1028
+ if (!(e instanceof R) || e.unsupported) return this.unsupported();
1029
1029
  this.withPath(() => {
1030
1030
  for (let [t, n] of e.calls) t === "moveTo" ? this.moveTo(n[0], n[1]) : t === "lineTo" ? this.lineTo(n[0], n[1]) : t === "closePath" ? this.closePath() : t === "rect" ? this.rect(n[0], n[1], n[2], n[3]) : t === "arc" ? this.arc(n[0], n[1], n[2], n[3], n[4], !!n[5]) : t === "quadraticCurveTo" ? this.curve([n[0], n[1]], [n[2], n[3]]) : t === "bezierCurveTo" && this.curve([
1031
1031
  n[0],
@@ -1038,7 +1038,7 @@ var z = new Set([
1038
1038
  baseColor(e) {
1039
1039
  let t = this.solid;
1040
1040
  if (t && t.style === e) return t.color;
1041
- let n = _(g(e));
1041
+ let n = y(v(e));
1042
1042
  return this.solid = {
1043
1043
  style: e,
1044
1044
  color: n
@@ -1062,7 +1062,7 @@ var z = new Set([
1062
1062
  kind: "solid",
1063
1063
  color: this.solidColor(e)
1064
1064
  };
1065
- if (!(e instanceof P)) return null;
1065
+ if (!(e instanceof I)) return null;
1066
1066
  if (e.stops.length === 0) return {
1067
1067
  kind: "solid",
1068
1068
  color: [
@@ -1076,7 +1076,7 @@ var z = new Set([
1076
1076
  let n = this.state.transform, r = e.x0 === e.x1 || e.y0 === e.y1;
1077
1077
  if (!this.axisAligned() || !this.uniform() && !r) return null;
1078
1078
  let i = [...e.stops].sort((e, t) => e.offset - t.offset).map((e) => {
1079
- let n = g(e.color);
1079
+ let n = v(e.color);
1080
1080
  return {
1081
1081
  offset: e.offset,
1082
1082
  color: [
@@ -1098,17 +1098,17 @@ var z = new Set([
1098
1098
  }
1099
1099
  plain() {
1100
1100
  let e = this.state;
1101
- return e.globalCompositeOperation !== "source-over" || e.filter !== "none" ? !1 : e.shadowBlur === 0 && e.shadowOffsetX === 0 && e.shadowOffsetY === 0 ? !0 : !(g(e.shadowColor)[3] > 0);
1101
+ return e.globalCompositeOperation !== "source-over" || e.filter !== "none" ? !1 : e.shadowBlur === 0 && e.shadowOffsetX === 0 && e.shadowOffsetY === 0 ? !0 : !(v(e.shadowColor)[3] > 0);
1102
1102
  }
1103
1103
  fill(e = "nonzero") {
1104
1104
  if (!this.plain()) return this.unsupported();
1105
1105
  let t = this.paint(this.state.fillStyle);
1106
1106
  if (!t) return this.unsupported();
1107
- let n = this.path.filter(H);
1107
+ let n = this.path.filter(U);
1108
1108
  if (n.length === 0 || t.kind === "solid" && t.color[3] === 0) return;
1109
- if (n.length > 1 && N(n.map((e) => M(e.points)))) {
1110
- let r = t.kind === "solid" && t.color[3] >= 1, i = Math.sign(y(n[0].points));
1111
- if (!r || e !== "nonzero" || n.some((e) => Math.sign(y(e.points)) !== i)) return this.unsupported();
1109
+ if (n.length > 1 && F(n.map((e) => P(e.points)))) {
1110
+ let r = t.kind === "solid" && t.color[3] >= 1, i = Math.sign(S(n[0].points));
1111
+ if (!r || e !== "nonzero" || n.some((e) => Math.sign(S(e.points)) !== i)) return this.unsupported();
1112
1112
  }
1113
1113
  if (t.kind === "solid" && n.every((e) => e.rect)) return this.fillRects(n, t.color);
1114
1114
  if (t.kind === "solid" && n.every((e) => e.circle)) {
@@ -1123,17 +1123,17 @@ var z = new Set([
1123
1123
  }
1124
1124
  let r = [];
1125
1125
  for (let e of n) {
1126
- let t = te(e.points);
1126
+ let t = ee(e.points);
1127
1127
  if (!t) return this.unsupported();
1128
1128
  for (let e of t) r.push(e);
1129
1129
  }
1130
- let i = M(n.flatMap((e) => e.points)), a = A({
1130
+ let i = P(n.flatMap((e) => e.points)), a = M({
1131
1131
  x0: Math.floor(i.x0),
1132
1132
  y0: Math.floor(i.y0),
1133
1133
  x1: Math.ceil(i.x1),
1134
1134
  y1: Math.ceil(i.y1)
1135
1135
  }, this.state.clip);
1136
- r.length > 0 && !j(a) && this.commands.push({
1136
+ r.length > 0 && !N(a) && this.commands.push({
1137
1137
  type: "fill",
1138
1138
  spans: r,
1139
1139
  bounds: a,
@@ -1208,12 +1208,12 @@ var z = new Set([
1208
1208
  let r = this.state, i = t / 2;
1209
1209
  if (t > 1 && e.some((e) => fe(e, i, r.lineJoin, r.miterLimit))) return !1;
1210
1210
  let a = i + (r.lineCap === "butt" ? 0 : i);
1211
- return !(e.length > 1 && N(e.map((e) => M(e.points, a))) || n < 1 && e.some((e) => pe(e, t)));
1211
+ return !(e.length > 1 && F(e.map((e) => P(e.points, a))) || n < 1 && e.some((e) => pe(e, t)));
1212
1212
  }
1213
1213
  clip() {
1214
- let e = this.path.filter(H);
1214
+ let e = this.path.filter(U);
1215
1215
  if (e.length !== 1 || !e[0].rect) return this.unsupported();
1216
- this.state.clip = A(this.state.clip, e[0].rect);
1216
+ this.state.clip = M(this.state.clip, e[0].rect);
1217
1217
  }
1218
1218
  text(e, t, n, r, i) {
1219
1219
  let a = e ? this.state.strokeStyle : this.state.fillStyle;
@@ -1311,7 +1311,7 @@ var z = new Set([
1311
1311
  isIdentity: t === 1 && n === 0 && r === 0 && i === 1 && a === 0 && o === 0
1312
1312
  };
1313
1313
  },
1314
- createLinearGradient: (e, t, n, r) => new P(e, t, n, r)
1314
+ createLinearGradient: (e, t, n, r) => new I(e, t, n, r)
1315
1315
  }), t;
1316
1316
  }
1317
1317
  proxy() {
@@ -1320,10 +1320,10 @@ var z = new Set([
1320
1320
  get: (t, n) => {
1321
1321
  if (typeof n == "string") {
1322
1322
  if (n in e) return e[n];
1323
- if (z.has(n)) return this.state[n];
1324
- if (B.has(n)) return this.state.textExtras[n];
1323
+ if (B.has(n)) return this.state[n];
1324
+ if (V.has(n)) return this.state.textExtras[n];
1325
1325
  if (n === "canvas") return this.measure?.canvas;
1326
- if (!V.has(n)) return this.unsupported(), () => void 0;
1326
+ if (!H.has(n)) return this.unsupported(), () => void 0;
1327
1327
  }
1328
1328
  },
1329
1329
  set: (e, t, n) => (typeof t == "string" && this.setProp(t, n), !0)
@@ -1331,24 +1331,24 @@ var z = new Set([
1331
1331
  }
1332
1332
  setProp(e, t) {
1333
1333
  let n = this.state;
1334
- e === "lineWidth" || e === "miterLimit" ? typeof t == "number" && Number.isFinite(t) && t > 0 && (n[e] = t) : e === "globalAlpha" ? typeof t == "number" && Number.isFinite(t) && t >= 0 && t <= 1 && (n.globalAlpha = t) : e === "fillStyle" || e === "strokeStyle" ? t instanceof P ? n[e] = t : typeof t == "string" ? h(t) && (n[e] = t) : this.unsupported() : z.has(e) ? n[e] = t : B.has(e) ? this.state.textExtras[e] = t : V.has(e) || this.unsupported();
1334
+ e === "lineWidth" || e === "miterLimit" ? typeof t == "number" && Number.isFinite(t) && t > 0 && (n[e] = t) : e === "globalAlpha" ? typeof t == "number" && Number.isFinite(t) && t >= 0 && t <= 1 && (n.globalAlpha = t) : e === "fillStyle" || e === "strokeStyle" ? t instanceof I ? n[e] = t : typeof t == "string" ? _(t) && (n[e] = t) : this.unsupported() : B.has(e) ? n[e] = t : V.has(e) ? this.state.textExtras[e] = t : H.has(e) || this.unsupported();
1335
1335
  }
1336
1336
  };
1337
- function ge(e, t) {
1337
+ function _e(e, t) {
1338
1338
  for (let n of t) {
1339
1339
  let t = n.state;
1340
- if (j(t.clip)) continue;
1340
+ if (N(t.clip)) continue;
1341
1341
  e.save(), e.setTransform(1, 0, 0, 1, 0, 0), Number.isFinite(t.clip.x1) && Number.isFinite(t.clip.y1) && (e.beginPath(), e.rect(t.clip.x0, t.clip.y0, t.clip.x1 - t.clip.x0, t.clip.y1 - t.clip.y0), e.clip());
1342
1342
  let [r, i, a, o, s, c] = t.transform;
1343
1343
  e.setTransform(r, i, a, o, s, c), e.font = t.font, e.textAlign = t.textAlign, e.textBaseline = t.textBaseline, e.direction = t.direction, e.globalAlpha = t.globalAlpha, Object.assign(e, t.textExtras), n.stroke ? (e.strokeStyle = t.strokeStyle, e.lineWidth = t.lineWidth, e.strokeText(n.text, n.x, n.y, n.maxWidth)) : (e.fillStyle = t.fillStyle, e.fillText(n.text, n.x, n.y, n.maxWidth)), e.restore();
1344
1344
  }
1345
1345
  }
1346
- function _e(e, t) {
1347
- return new he(e, t);
1346
+ function ve(e, t) {
1347
+ return new ge(e, t);
1348
1348
  }
1349
1349
  //#endregion
1350
1350
  //#region src/webgl/shaders.ts
1351
- var U = `#version 300 es
1351
+ var W = `#version 300 es
1352
1352
  precision highp float;
1353
1353
  uniform vec2 u_canvas;
1354
1354
  uniform float u_dpr;
@@ -1374,7 +1374,7 @@ float cssY(float rel) {
1374
1374
  return u_yA + rel * u_yB;
1375
1375
  }
1376
1376
 
1377
- float snap(float v) { return floor(v + ${t.toFixed(4)}); }
1377
+ float snap(float v) { return floor(v + ${a.toFixed(4)}); }
1378
1378
 
1379
1379
  vec4 toClip(vec2 dev) {
1380
1380
  return vec4(dev.x / u_canvas.x * 2.0 - 1.0, 1.0 - dev.y / u_canvas.y * 2.0, 0.0, 1.0);
@@ -1390,7 +1390,7 @@ vec2 corner(int k) {
1390
1390
 
1391
1391
  // Nothing to draw: every vertex at one point off the canvas.
1392
1392
  const vec4 NOWHERE = vec4(-2.0, -2.0, 0.0, 1.0);
1393
- `, ve = `${U}
1393
+ `, ye = `${W}
1394
1394
  in vec4 a_ohlc;
1395
1395
  in vec2 a_vd;
1396
1396
  uniform float u_x0;
@@ -1431,7 +1431,7 @@ void main() {
1431
1431
  }
1432
1432
  gl_Position = toClip(vec2(left + cr.x * width, top + cr.y * height));
1433
1433
  }
1434
- `, ye = `${U}
1434
+ `, be = `${W}
1435
1435
  in vec4 a_ohlc;
1436
1436
  in vec2 a_vd;
1437
1437
  uniform float u_x0;
@@ -1453,7 +1453,7 @@ void main() {
1453
1453
  v_color = a_vd.y > 0.5 ? u_volUp : u_volDown;
1454
1454
  gl_Position = toClip(vec2(left + cr.x * u_body, top + cr.y * (bottom - top)));
1455
1455
  }
1456
- `, be = `${U}
1456
+ `, xe = `${W}
1457
1457
  in vec4 a_col;
1458
1458
  in float a_up;
1459
1459
  uniform vec4 u_upBody;
@@ -1468,7 +1468,7 @@ void main() {
1468
1468
  v_color = a_up > 0.5 ? u_upBody : u_downBody;
1469
1469
  gl_Position = toClip(vec2(left + cr.x * width, min(t, b) + cr.y * max(abs(b - t), 1.0)));
1470
1470
  }
1471
- `, xe = `${U}
1471
+ `, Se = `${W}
1472
1472
  in vec4 a_col;
1473
1473
  in float a_up;
1474
1474
  uniform float u_volBottom;
@@ -1486,7 +1486,7 @@ void main() {
1486
1486
  v_color = a_up > 0.5 ? u_volUp : u_volDown;
1487
1487
  gl_Position = toClip(vec2(left + cr.x * width, top + cr.y * (bottom - top)));
1488
1488
  }
1489
- `, Se = `${U}
1489
+ `, Ce = `${W}
1490
1490
  in vec4 a_rect;
1491
1491
  in vec4 a_color;
1492
1492
  in vec2 a_dash;
@@ -1500,7 +1500,7 @@ void main() {
1500
1500
  v_color = a_color;
1501
1501
  gl_Position = toClip(mix(floor(v_rect.xy), ceil(v_rect.zw), cr));
1502
1502
  }
1503
- `, Ce = "#version 300 es\nprecision highp float;\nuniform vec2 u_canvas;\nuniform int u_union;\nin vec4 v_color;\nflat in vec4 v_rect;\nflat in vec2 v_dash;\nout vec4 outColor;\n\n// The share of rows [y, y + 1] inside the rectangle and, dashed, on a dash.\nfloat rows(float y) {\n float lo = max(y, v_rect.y);\n float hi = min(y + 1.0, v_rect.w);\n if (hi <= lo) return 0.0;\n if (v_dash.x <= 0.0) return hi - lo;\n // A dash period is longer than a device pixel, so the row meets the dash\n // of the period it starts in and the next (a third to spare).\n float period = v_dash.x + v_dash.y;\n float first = v_rect.y + floor((lo - v_rect.y) / period) * period;\n float on = 0.0;\n for (int i = 0; i < 3; i++) {\n float start = first + float(i) * period;\n on += max(0.0, min(hi, start + v_dash.x) - max(lo, start));\n }\n return on;\n}\n\nvoid main() {\n // This pixel's top-left corner in device pixels, y down.\n vec2 p = vec2(floor(gl_FragCoord.x), u_canvas.y - floor(gl_FragCoord.y) - 1.0);\n float coverage = clamp(min(p.x + 1.0, v_rect.z) - max(p.x, v_rect.x), 0.0, 1.0) * rows(p.y);\n outColor = u_union == 1 ? vec4(v_color.rgb * coverage, coverage) : v_color * coverage;\n}\n", W = "#version 300 es\nprecision highp float;\nuniform vec2 u_canvas;\nuniform vec4 u_clip;\nin vec4 v_color;\nout vec4 outColor;\n\nvoid main() {\n vec2 p = vec2(floor(gl_FragCoord.x), u_canvas.y - floor(gl_FragCoord.y) - 1.0);\n vec2 c = clamp(min(p + 1.0, u_clip.zw) - max(p, u_clip.xy), 0.0, 1.0);\n outColor = v_color * (c.x * c.y);\n}\n", G = 24, K = 5, q = K * 4, J = 10, Y = J * 4, X = [
1503
+ `, we = "#version 300 es\nprecision highp float;\nuniform vec2 u_canvas;\nuniform int u_union;\nin vec4 v_color;\nflat in vec4 v_rect;\nflat in vec2 v_dash;\nout vec4 outColor;\n\n// The share of rows [y, y + 1] inside the rectangle and, dashed, on a dash.\nfloat rows(float y) {\n float lo = max(y, v_rect.y);\n float hi = min(y + 1.0, v_rect.w);\n if (hi <= lo) return 0.0;\n if (v_dash.x <= 0.0) return hi - lo;\n // A dash period is longer than a device pixel, so the row meets the dash\n // of the period it starts in and the next (a third to spare).\n float period = v_dash.x + v_dash.y;\n float first = v_rect.y + floor((lo - v_rect.y) / period) * period;\n float on = 0.0;\n for (int i = 0; i < 3; i++) {\n float start = first + float(i) * period;\n on += max(0.0, min(hi, start + v_dash.x) - max(lo, start));\n }\n return on;\n}\n\nvoid main() {\n // This pixel's top-left corner in device pixels, y down.\n vec2 p = vec2(floor(gl_FragCoord.x), u_canvas.y - floor(gl_FragCoord.y) - 1.0);\n float coverage = clamp(min(p.x + 1.0, v_rect.z) - max(p.x, v_rect.x), 0.0, 1.0) * rows(p.y);\n outColor = u_union == 1 ? vec4(v_color.rgb * coverage, coverage) : v_color * coverage;\n}\n", G = "#version 300 es\nprecision highp float;\nuniform vec2 u_canvas;\nuniform vec4 u_clip;\nin vec4 v_color;\nout vec4 outColor;\n\nvoid main() {\n vec2 p = vec2(floor(gl_FragCoord.x), u_canvas.y - floor(gl_FragCoord.y) - 1.0);\n vec2 c = clamp(min(p + 1.0, u_clip.zw) - max(p, u_clip.xy), 0.0, 1.0);\n outColor = v_color * (c.x * c.y);\n}\n", K = 24, q = 5, Te = q * 4, J = 10, Y = J * 4, X = () => {}, Z = [
1504
1504
  "a_ohlc",
1505
1505
  "a_vd",
1506
1506
  "a_col",
@@ -1508,7 +1508,7 @@ void main() {
1508
1508
  "a_rect",
1509
1509
  "a_color",
1510
1510
  "a_dash"
1511
- ], we = class t {
1511
+ ], Ee = class a {
1512
1512
  label;
1513
1513
  gl;
1514
1514
  kit;
@@ -1521,9 +1521,9 @@ void main() {
1521
1521
  seriesBuffer;
1522
1522
  columnBuffer;
1523
1523
  rectBuffer;
1524
- uploads = new s();
1524
+ uploads = new l();
1525
1525
  gpuFloats = 0;
1526
- columns = new Float32Array(4096 * K);
1526
+ columns = new Float32Array(4096 * q);
1527
1527
  rectValues = new Float32Array(64 * J);
1528
1528
  clip = [
1529
1529
  0,
@@ -1533,11 +1533,13 @@ void main() {
1533
1533
  ];
1534
1534
  lost = !1;
1535
1535
  lostCallback = null;
1536
+ restoredCallback = null;
1537
+ release = X;
1536
1538
  static create(e = {}) {
1537
1539
  if (typeof document > "u") return null;
1538
- let n = document.createElement("canvas"), r = null;
1540
+ let t = document.createElement("canvas"), n = null;
1539
1541
  try {
1540
- r = n.getContext("webgl2", {
1542
+ n = t.getContext("webgl2", {
1541
1543
  alpha: !0,
1542
1544
  premultipliedAlpha: !0,
1543
1545
  antialias: !1,
@@ -1549,19 +1551,35 @@ void main() {
1549
1551
  } catch (e) {
1550
1552
  return $(e), null;
1551
1553
  }
1552
- if (!r) return null;
1554
+ if (!n) return null;
1553
1555
  try {
1554
- return new t(n, r);
1556
+ let r = new a(t, n);
1557
+ return r.release = e.release ?? X, r;
1555
1558
  } catch (e) {
1556
- return $(e), Q(r), null;
1559
+ return $(e), Q(n), null;
1557
1560
  }
1558
1561
  }
1559
1562
  constructor(e, t) {
1560
- this.canvas = e, this.gl = t, this.kit = new ee(t);
1561
- let n = t.getExtension("WEBGL_debug_renderer_info");
1562
- this.label = String(n ? t.getParameter(n.UNMASKED_RENDERER_WEBGL) : t.getParameter(t.RENDERER));
1563
- let r = this.kit;
1564
- this.candleBars = r.program(ve, W, X), this.volumeBars = r.program(ye, W, X), this.candleColumns = r.program(be, W, X), this.volumeColumns = r.program(xe, W, X), this.rects = r.program(Se, Ce, X), this.seriesBuffer = r.buffer(), this.columnBuffer = r.buffer(), this.rectBuffer = r.buffer(), this.drawer = new le(r), e.addEventListener("webglcontextlost", this.handleLost);
1563
+ this.canvas = e, this.gl = t, this.kit = new x(t), this.label = Oe(t), this.build(), e.addEventListener("webglcontextlost", this.handleLost), e.addEventListener("webglcontextrestored", this.handleRestored);
1564
+ }
1565
+ build() {
1566
+ let e = this.kit;
1567
+ Object.assign(this, {
1568
+ candleBars: e.program(ye, G, Z),
1569
+ volumeBars: e.program(be, G, Z),
1570
+ candleColumns: e.program(xe, G, Z),
1571
+ volumeColumns: e.program(Se, G, Z),
1572
+ rects: e.program(Ce, we, Z),
1573
+ seriesBuffer: e.buffer(),
1574
+ columnBuffer: e.buffer(),
1575
+ rectBuffer: e.buffer(),
1576
+ drawer: new le(e),
1577
+ uploads: new l(),
1578
+ gpuFloats: 0
1579
+ });
1580
+ }
1581
+ onRestored(e) {
1582
+ this.restoredCallback = e;
1565
1583
  }
1566
1584
  onLost(e) {
1567
1585
  this.lostCallback = e, (this.lost || this.gl.isContextLost()) && (this.lost = !0, queueMicrotask(() => {
@@ -1569,7 +1587,7 @@ void main() {
1569
1587
  }));
1570
1588
  }
1571
1589
  recorder(e, t) {
1572
- return _e(e, t);
1590
+ return ve(e, t);
1573
1591
  }
1574
1592
  render(e) {
1575
1593
  let t = this.gl;
@@ -1580,7 +1598,7 @@ void main() {
1580
1598
  recorded: !1,
1581
1599
  under: !1
1582
1600
  };
1583
- let n = Z(e.recorded) ? e.recorded : null, r = Z(e.under) ? e.under : null, i = {
1601
+ let n = De(e.recorded) ? e.recorded : null, r = De(e.under) ? e.under : null, i = {
1584
1602
  series: e.candles,
1585
1603
  volume: e.volume !== null,
1586
1604
  background: e.background !== null,
@@ -1589,10 +1607,10 @@ void main() {
1589
1607
  };
1590
1608
  return t.viewport(0, 0, this.canvas.width, this.canvas.height), t.disable(t.SCISSOR_TEST), t.clearColor(0, 0, 0, 0), t.clear(t.COLOR_BUFFER_BIT), t.enable(t.BLEND), e.background && this.drawBackground(e, e.background), r && this.drawRecorded(e, r), this.drawSeries(e), n && this.drawRecorded(e, n), i;
1591
1609
  }
1592
- drawSeries(t) {
1593
- let n = this.gl, { data: r, viewport: i, dpr: a } = t;
1594
- if (r.length === 0 || !t.candles && !t.volume) return;
1595
- this.syncSeries(t);
1610
+ drawSeries(e) {
1611
+ let t = this.gl, { data: r, viewport: i, dpr: a } = e;
1612
+ if (r.length === 0 || !e.candles && !e.volume) return;
1613
+ this.syncSeries(e);
1596
1614
  let o = Math.max(0, i.visibleRange.from), s = Math.min(i.visibleRange.to, r.length - 1);
1597
1615
  if (s < o) return;
1598
1616
  let { chartRect: c } = i;
@@ -1603,11 +1621,11 @@ void main() {
1603
1621
  (c.y + c.height) * a
1604
1622
  ];
1605
1623
  let l = Math.floor(this.clip[0]), u = Math.floor(this.clip[1]), d = Math.ceil(this.clip[2]) - l, f = Math.ceil(this.clip[3]) - u;
1606
- n.enable(n.SCISSOR_TEST), n.scissor(l, this.canvas.height - u - f, Math.max(0, d), Math.max(0, f)), n.blendFunc(n.ONE, n.ONE_MINUS_SRC_ALPHA);
1607
- let p = e(i), m = p ? this.buildColumns(t, o, s) : 0;
1608
- t.volume && this.drawVolume(t, o, s, p, m);
1624
+ t.enable(t.SCISSOR_TEST), t.scissor(l, this.canvas.height - u - f, Math.max(0, d), Math.max(0, f)), t.blendFunc(t.ONE, t.ONE_MINUS_SRC_ALPHA);
1625
+ let p = n(i), m = p ? this.buildColumns(e, o, s) : 0;
1626
+ e.volume && this.drawVolume(e, o, s, p, m);
1609
1627
  let { min: h, max: g } = i.priceRange;
1610
- t.candles && g - h !== 0 && this.drawCandles(t, o, s, p, m), n.disable(n.SCISSOR_TEST);
1628
+ e.candles && g - h !== 0 && this.drawCandles(e, o, s, p, m), t.disable(t.SCISSOR_TEST);
1611
1629
  }
1612
1630
  drawRecorded(e, t) {
1613
1631
  t.commands.length !== 0 && this.drawer.draw(t.commands, this.canvas.width, this.canvas.height, (t, n) => this.drawRecordedRects(e, t, n));
@@ -1617,9 +1635,10 @@ void main() {
1617
1635
  this.kit.float(i, "u_dpr", 1), this.kit.int(i, "u_union", 0), r.bindBuffer(r.ARRAY_BUFFER, this.rectBuffer), r.bufferData(r.ARRAY_BUFFER, t, r.STREAM_DRAW), this.bindRects(i, 0), r.drawArraysInstanced(r.TRIANGLES, 0, 6, n);
1618
1636
  }
1619
1637
  destroy() {
1620
- this.canvas.removeEventListener("webglcontextlost", this.handleLost), this.lostCallback = null;
1638
+ this.canvas.removeEventListener("webglcontextlost", this.handleLost), this.canvas.removeEventListener("webglcontextrestored", this.handleRestored), this.lostCallback = null, this.restoredCallback = null, this.release(), this.release = X;
1621
1639
  let e = this.gl;
1622
- if (!e.isContextLost()) {
1640
+ if (e.isContextLost()) this.canvas.addEventListener("webglcontextrestored", () => Q(e), { once: !0 });
1641
+ else {
1623
1642
  for (let e of [
1624
1643
  this.candleBars,
1625
1644
  this.volumeBars,
@@ -1632,64 +1651,82 @@ void main() {
1632
1651
  this.canvas.remove();
1633
1652
  }
1634
1653
  handleLost = (e) => {
1635
- e.preventDefault(), !this.lost && (this.lost = !0, this.lostCallback?.());
1654
+ e.preventDefault(), !this.lost && (this.lost = !0, this.release(), this.release = X, this.lostCallback?.());
1655
+ };
1656
+ handleRestored = () => {
1657
+ if (!this.lost || this.gl.isContextLost()) return;
1658
+ let e = o();
1659
+ if (!e) {
1660
+ Q(this.gl);
1661
+ return;
1662
+ }
1663
+ try {
1664
+ this.build();
1665
+ } catch (t) {
1666
+ e(), $(t), Q(this.gl);
1667
+ return;
1668
+ }
1669
+ this.release = e, this.lost = !1, this.restoredCallback?.();
1636
1670
  };
1637
1671
  syncSeries(e) {
1638
1672
  let t = this.gl, n = this.uploads.sync(e.data), r = this.uploads.values;
1639
- t.bindBuffer(t.ARRAY_BUFFER, this.seriesBuffer), n.full || r.length !== this.gpuFloats ? (t.bufferData(t.ARRAY_BUFFER, r, t.DYNAMIC_DRAW), this.gpuFloats = r.length) : n.to > n.from && t.bufferSubData(t.ARRAY_BUFFER, n.from * G, r, n.from * 6, (n.to - n.from) * 6);
1673
+ t.bindBuffer(t.ARRAY_BUFFER, this.seriesBuffer), n.full || r.length !== this.gpuFloats ? (t.bufferData(t.ARRAY_BUFFER, r, t.DYNAMIC_DRAW), this.gpuFloats = r.length) : n.to > n.from && t.bufferSubData(t.ARRAY_BUFFER, n.from * K, r, n.from * 6, (n.to - n.from) * 6);
1640
1674
  }
1641
- buildColumns(e, t, r) {
1675
+ buildColumns(e, n, r) {
1642
1676
  let { viewport: i, data: a } = e, o = i.barWidth + i.barSpacing, s = -i.offset + i.chartRect.x + i.barWidth / 2, c = this.uploads.base, l = 0;
1643
- n(a, t, r, (e) => e * o + s, (e) => {
1644
- if ((l + 1) * K > this.columns.length) {
1677
+ t(a, n, r, (e) => e * o + s, (e) => {
1678
+ if ((l + 1) * q > this.columns.length) {
1645
1679
  let e = new Float32Array(this.columns.length * 2);
1646
1680
  e.set(this.columns), this.columns = e;
1647
1681
  }
1648
- let t = l * K;
1682
+ let t = l * q;
1649
1683
  this.columns[t] = e.x, this.columns[t + 1] = e.high - c, this.columns[t + 2] = e.low - c, this.columns[t + 3] = e.volume, this.columns[t + 4] = +(e.close >= e.open), l++;
1650
1684
  });
1651
1685
  let u = this.gl;
1652
- return u.bindBuffer(u.ARRAY_BUFFER, this.columnBuffer), u.bufferData(u.ARRAY_BUFFER, this.columns.subarray(0, l * K), u.STREAM_DRAW), l;
1686
+ return u.bindBuffer(u.ARRAY_BUFFER, this.columnBuffer), u.bufferData(u.ARRAY_BUFFER, this.columns.subarray(0, l * q), u.STREAM_DRAW), l;
1653
1687
  }
1654
- drawBackground(e, t) {
1655
- let { viewport: n, theme: r } = e, a = t.grid ? i(n) : {
1688
+ drawBackground(t, n) {
1689
+ let { viewport: r, theme: a } = t, o = e(a), s = n.grid ? i(r) : {
1656
1690
  horizontal: [],
1657
1691
  vertical: []
1658
- }, o = a.horizontal.length + a.vertical.length, s = o + t.rects.length;
1659
- if (s === 0) return;
1660
- this.rectValues.length < s * J && (this.rectValues = new Float32Array(s * J * 2));
1661
- let c = this.rectValues, l = 0, u = (e, t, n, r, i, a, o) => {
1662
- c[l++] = e, c[l++] = t, c[l++] = n, c[l++] = r;
1663
- for (let e = 0; e < 4; e++) c[l++] = i[e] * a;
1664
- c[l++] = o ? o[0] : 0, c[l++] = o ? o[1] : 0;
1665
- }, d = _(g(r.grid)), { chartRect: f } = n;
1666
- for (let e of a.horizontal) u(f.x, e - .5, f.x + f.width, e + .5, d, 1);
1667
- for (let e of a.vertical) u(e - .5, f.y, e + .5, f.y + f.height, d, 1);
1668
- let p = "", m = d;
1669
- for (let e of t.rects) e.color !== p && (p = e.color, m = _(g(e.color))), u(e.x, e.y, e.x + e.width, e.y + e.height, m, e.alpha, e.dash);
1670
- let h = this.gl, v = this.use(this.rects, e);
1671
- h.bindBuffer(h.ARRAY_BUFFER, this.rectBuffer), h.bufferData(h.ARRAY_BUFFER, c.subarray(0, l), h.STREAM_DRAW), o > 0 && (h.uniform1i(this.loc(v, "u_union"), 1), h.blendColor(0, 0, 0, d[3]), h.blendFuncSeparate(h.ONE, h.ONE_MINUS_SRC_ALPHA, h.CONSTANT_ALPHA, h.ONE_MINUS_SRC_ALPHA), this.bindRects(v, 0), h.drawArraysInstanced(h.TRIANGLES, 0, 6, o)), t.rects.length > 0 && (h.uniform1i(this.loc(v, "u_union"), 0), h.blendFunc(h.ONE, h.ONE_MINUS_SRC_ALPHA), this.bindRects(v, o), h.drawArraysInstanced(h.TRIANGLES, 0, 6, t.rects.length));
1692
+ }, c = {
1693
+ horizontal: o.horizontal.visible ? s.horizontal : [],
1694
+ vertical: o.vertical.visible ? s.vertical : []
1695
+ }, l = c.horizontal.length + c.vertical.length, u = l + n.rects.length;
1696
+ if (u === 0) return;
1697
+ this.rectValues.length < u * J && (this.rectValues = new Float32Array(u * J * 2));
1698
+ let d = this.rectValues, f = 0, p = (e, t, n, r, i, a, o) => {
1699
+ d[f++] = e, d[f++] = t, d[f++] = n, d[f++] = r;
1700
+ for (let e = 0; e < 4; e++) d[f++] = i[e] * a;
1701
+ d[f++] = o ? o[0] : 0, d[f++] = o ? o[1] : 0;
1702
+ }, m = y(v(o.horizontal.visible ? o.horizontal.color : o.vertical.color)), { chartRect: h } = r;
1703
+ for (let e of c.horizontal) p(h.x, e - .5, h.x + h.width, e + .5, m, 1);
1704
+ for (let e of c.vertical) p(e - .5, h.y, e + .5, h.y + h.height, m, 1);
1705
+ let g = "", _ = m;
1706
+ for (let e of n.rects) e.color !== g && (g = e.color, _ = y(v(e.color))), p(e.x, e.y, e.x + e.width, e.y + e.height, _, e.alpha, e.dash);
1707
+ let b = this.gl, x = this.use(this.rects, t);
1708
+ b.bindBuffer(b.ARRAY_BUFFER, this.rectBuffer), b.bufferData(b.ARRAY_BUFFER, d.subarray(0, f), b.STREAM_DRAW), l > 0 && (b.uniform1i(this.loc(x, "u_union"), 1), b.blendColor(0, 0, 0, m[3]), b.blendFuncSeparate(b.ONE, b.ONE_MINUS_SRC_ALPHA, b.CONSTANT_ALPHA, b.ONE_MINUS_SRC_ALPHA), this.bindRects(x, 0), b.drawArraysInstanced(b.TRIANGLES, 0, 6, l)), n.rects.length > 0 && (b.uniform1i(this.loc(x, "u_union"), 0), b.blendFunc(b.ONE, b.ONE_MINUS_SRC_ALPHA), this.bindRects(x, l), b.drawArraysInstanced(b.TRIANGLES, 0, 6, n.rects.length));
1672
1709
  }
1673
1710
  drawCandles(e, t, n, r, i) {
1674
- let { theme: a, viewport: o, dpr: s } = e, c = _(g(a.candleUp)), l = _(g(a.candleDown));
1711
+ let { theme: a, viewport: o, dpr: s } = e, c = y(v(a.candleUp)), l = y(v(a.candleDown));
1675
1712
  if (r) {
1676
1713
  let t = this.use(this.candleColumns, e);
1677
1714
  this.vec4(t, "u_upBody", c), this.vec4(t, "u_downBody", l), this.bindColumns(t), this.gl.drawArraysInstanced(this.gl.TRIANGLES, 0, 6, i);
1678
1715
  return;
1679
1716
  }
1680
1717
  let u = this.use(this.candleBars, e);
1681
- this.barUniforms(u, o, t, s), this.vec4(u, "u_upBody", c), this.vec4(u, "u_downBody", l), this.vec4(u, "u_upWick", _(g(a.candleUpWick))), this.vec4(u, "u_downWick", _(g(a.candleDownWick))), this.bindBars(u, t), this.gl.drawArraysInstanced(this.gl.TRIANGLES, 0, 12, n - t + 1);
1718
+ this.barUniforms(u, o, t, s), this.vec4(u, "u_upBody", c), this.vec4(u, "u_downBody", l), this.vec4(u, "u_upWick", y(v(a.candleUpWick))), this.vec4(u, "u_downWick", y(v(a.candleDownWick))), this.bindBars(u, t), this.gl.drawArraysInstanced(this.gl.TRIANGLES, 0, 12, n - t + 1);
1682
1719
  }
1683
1720
  drawVolume(e, t, n, r, i) {
1684
- let { data: o, viewport: s, theme: c, dpr: l } = e, u = 0;
1685
- for (let e = t; e <= n; e++) o[e].volume > u && (u = o[e].volume);
1721
+ let { data: a, viewport: o, theme: c, dpr: l } = e, u = 0;
1722
+ for (let e = t; e <= n; e++) a[e].volume > u && (u = a[e].volume);
1686
1723
  if (u === 0) return;
1687
- let { chartRect: d } = s, f = a(c), p = this.use(r ? this.volumeColumns : this.volumeBars, e);
1688
- if (this.float(p, "u_volBottom", d.y + d.height), this.float(p, "u_volScale", d.height * (e.volume?.heightRatio ?? .15) / u), this.vec4(p, "u_volUp", _(g(f.up))), this.vec4(p, "u_volDown", _(g(f.down))), r) {
1724
+ let { chartRect: d } = o, f = s(c), p = this.use(r ? this.volumeColumns : this.volumeBars, e);
1725
+ if (this.float(p, "u_volBottom", d.y + d.height), this.float(p, "u_volScale", d.height * (e.volume?.heightRatio ?? .15) / u), this.vec4(p, "u_volUp", y(v(f.up))), this.vec4(p, "u_volDown", y(v(f.down))), r) {
1689
1726
  this.bindColumns(p), this.gl.drawArraysInstanced(this.gl.TRIANGLES, 0, 6, i);
1690
1727
  return;
1691
1728
  }
1692
- this.barUniforms(p, s, t, l), this.bindBars(p, t), this.gl.drawArraysInstanced(this.gl.TRIANGLES, 0, 6, n - t + 1);
1729
+ this.barUniforms(p, o, t, l), this.bindBars(p, t), this.gl.drawArraysInstanced(this.gl.TRIANGLES, 0, 6, n - t + 1);
1693
1730
  }
1694
1731
  barUniforms(e, t, n, i) {
1695
1732
  let a = t.barWidth + t.barSpacing, o = -t.offset + t.chartRect.x + t.barWidth / 2, { body: s, wick: c } = r(t.barWidth, i);
@@ -1698,19 +1735,19 @@ void main() {
1698
1735
  use(e, t) {
1699
1736
  let n = this.gl;
1700
1737
  this.kit.use(e), n.uniform2f(this.loc(e, "u_canvas"), this.canvas.width, this.canvas.height), this.vec4(e, "u_clip", this.clip), this.float(e, "u_dpr", t.dpr);
1701
- let r = v(t.viewport, this.uploads.base);
1738
+ let r = b(t.viewport, this.uploads.base);
1702
1739
  return n.uniform1i(this.loc(e, "u_log"), r.log), n.uniform1i(this.loc(e, "u_invert"), r.invert), this.float(e, "u_yA", r.yA), this.float(e, "u_yB", r.yB), this.float(e, "u_logOffset", r.logOffset), this.float(e, "u_min", r.min), this.float(e, "u_logFloor", r.logFloor), this.float(e, "u_logK", r.logK), this.float(e, "u_top", r.top), this.float(e, "u_bottom", r.bottom), e;
1703
1740
  }
1704
1741
  bindBars(e, t) {
1705
1742
  let n = this.gl;
1706
- n.bindBuffer(n.ARRAY_BUFFER, this.seriesBuffer), this.attrib(e, "a_ohlc", 4, G, t * G), this.attrib(e, "a_vd", 2, G, t * G + 16);
1743
+ n.bindBuffer(n.ARRAY_BUFFER, this.seriesBuffer), this.attrib(e, "a_ohlc", 4, K, t * K), this.attrib(e, "a_vd", 2, K, t * K + 16);
1707
1744
  }
1708
1745
  bindRects(e, t) {
1709
1746
  this.attrib(e, "a_rect", 4, Y, t * Y), this.attrib(e, "a_color", 4, Y, t * Y + 16), this.attrib(e, "a_dash", 2, Y, t * Y + 32);
1710
1747
  }
1711
1748
  bindColumns(e) {
1712
1749
  let t = this.gl;
1713
- t.bindBuffer(t.ARRAY_BUFFER, this.columnBuffer), this.attrib(e, "a_col", 4, q, 0), this.attrib(e, "a_up", 1, q, 16);
1750
+ t.bindBuffer(t.ARRAY_BUFFER, this.columnBuffer), this.attrib(e, "a_col", 4, Te, 0), this.attrib(e, "a_up", 1, Te, 16);
1714
1751
  }
1715
1752
  attrib(e, t, n, r, i) {
1716
1753
  this.kit.attrib(e, t, n, r, i);
@@ -1725,9 +1762,15 @@ void main() {
1725
1762
  return this.kit.loc(e, t);
1726
1763
  }
1727
1764
  };
1728
- function Z(e) {
1765
+ function De(e) {
1729
1766
  return typeof e == "object" && !!e && Array.isArray(e.commands);
1730
1767
  }
1768
+ function Oe(e) {
1769
+ let t = String(e.getParameter(e.RENDERER));
1770
+ if (t && t !== "WebKit WebGL") return t;
1771
+ let n = e.getExtension("WEBGL_debug_renderer_info");
1772
+ return n ? String(e.getParameter(n.UNMASKED_RENDERER_WEBGL)) : t;
1773
+ }
1731
1774
  function Q(e) {
1732
1775
  e.getExtension("WEBGL_lose_context")?.loseContext();
1733
1776
  }
@@ -1735,6 +1778,6 @@ function $(e) {
1735
1778
  console.warn("TradeCanvas: WebGL renderer unavailable, drawing with Canvas 2D.", e);
1736
1779
  }
1737
1780
  //#endregion
1738
- export { we as WebGLSeriesRenderer };
1781
+ export { Ee as WebGLSeriesRenderer };
1739
1782
 
1740
- //# sourceMappingURL=WebGLSeriesRenderer-DVJBHdfm.js.map
1783
+ //# sourceMappingURL=WebGLSeriesRenderer-BNrnoMHq.js.map