@lilt-ui/charts 0.9.1 → 0.10.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 (40) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/README.md +40 -10
  3. package/dist/cards/activity-ring-card.d.ts +7 -2
  4. package/dist/cards/calendar-heatmap-card.d.ts +18 -0
  5. package/dist/cards/cartesian-card.d.ts +9 -3
  6. package/dist/cards/chart-card.d.ts +7 -3
  7. package/dist/cards/funnel-chart-card.d.ts +9 -3
  8. package/dist/cards/heatmap-chart-card.d.ts +7 -2
  9. package/dist/cards/horizontal-bar-chart-card.d.ts +7 -2
  10. package/dist/cards/keys.d.ts +2 -0
  11. package/dist/cards/observations-card.d.ts +82 -0
  12. package/dist/cards/progress-card.d.ts +7 -2
  13. package/dist/cards/radar-chart-card.d.ts +9 -3
  14. package/dist/cards/radial-chart-card.d.ts +9 -3
  15. package/dist/cards/range-select.d.ts +28 -0
  16. package/dist/cards/sankey-chart-card.d.ts +7 -2
  17. package/dist/cards/scatter-chart-card.d.ts +9 -3
  18. package/dist/cards/slope-chart-card.d.ts +7 -2
  19. package/dist/cards/stat-card.d.ts +7 -2
  20. package/dist/cards/strip-chart-card.d.ts +15 -0
  21. package/dist/cards/timeline-chart-card.d.ts +18 -0
  22. package/dist/cards/treemap-chart-card.d.ts +24 -0
  23. package/dist/engine/keyed.d.ts +19 -0
  24. package/dist/engine/lifecycle.d.ts +1 -1
  25. package/dist/engine/sankey.d.ts +16 -0
  26. package/dist/finance/cards/depth-chart-card.d.ts +7 -2
  27. package/dist/finance/order-book.d.ts +7 -2
  28. package/dist/finance.js +324 -326
  29. package/dist/index.d.ts +11 -1
  30. package/dist/index.js +3258 -2144
  31. package/dist/marks/contract.d.ts +0 -2
  32. package/dist/motion/use-chart-motion.d.ts +5 -0
  33. package/dist/motion/use-departing.d.ts +7 -0
  34. package/dist/motion/use-snap-bars.d.ts +27 -0
  35. package/dist/{report-context-CkzH-r8B.js → report-context-UrwaoLYZ.js} +416 -238
  36. package/dist/{skeleton-block-CHH5SIAo.js → skeleton-block-C8gOUsxn.js} +1672 -1422
  37. package/dist/styles.css +1 -1
  38. package/dist/watch/board/board-state.d.ts +0 -2
  39. package/dist/watch.js +129 -127
  40. package/package.json +1 -1
package/dist/finance.js CHANGED
@@ -1,15 +1,15 @@
1
1
  "use client";
2
- import { A as e, C as t, I as n, J as r, L as i, P as a, R as o, S as s, T as c, X as l, Y as u, _ as d, _t as f, a as p, b as m, ct as h, et as g, f as _, i as v, it as y, n as b, q as x, t as S, u as C, v as w, w as T, x as E, y as D, z as O } from "./skeleton-block-CHH5SIAo.js";
3
- import { S as k, d as A, g as ee, h as te, p as j, u as M } from "./report-context-CkzH-r8B.js";
4
- import { useEffect as N, useMemo as P, useRef as F, useState as I } from "react";
5
- import { Fragment as L, jsx as R, jsxs as z } from "react/jsx-runtime";
6
- import { min as B } from "d3-array";
2
+ import { A as e, C as t, I as n, J as r, L as i, P as a, R as o, S as s, T as c, X as l, Y as u, _ as d, _t as f, a as p, b as m, ct as h, et as g, f as _, i as v, it as y, n as b, q as x, t as S, u as C, v as w, w as T, x as E, y as D, z as O } from "./skeleton-block-C8gOUsxn.js";
3
+ import { C as k, d as A, g as j, h as M, p as ee, u as N } from "./report-context-UrwaoLYZ.js";
4
+ import { useEffect as P, useMemo as F, useRef as I, useState as L } from "react";
5
+ import { Fragment as R, jsx as z, jsxs as B } from "react/jsx-runtime";
6
+ import { min as V } from "d3-array";
7
7
  //#region src/finance/candle-geometry.ts
8
- var V = "var(--lilt-candle-up)", H = "var(--lilt-candle-down)";
9
- function U(e) {
8
+ var H = "var(--lilt-candle-up)", U = "var(--lilt-candle-down)";
9
+ function W(e) {
10
10
  return Math.round(e * 100) / 100;
11
11
  }
12
- function W(e, t, n) {
12
+ function G(e, t, n) {
13
13
  let r = e.fields[t], i = r?.[n.open], a = r?.[n.high], o = r?.[n.low], s = e.values[t];
14
14
  return i == null || a == null || o == null || s == null ? null : {
15
15
  open: i,
@@ -19,22 +19,22 @@ function W(e, t, n) {
19
19
  up: s >= i
20
20
  };
21
21
  }
22
- function G(e, t, n) {
22
+ function te(e, t, n) {
23
23
  for (let r of e) {
24
- let e = W(r, t, n);
24
+ let e = G(r, t, n);
25
25
  if (!e) continue;
26
26
  let i = Math.max(e.open, e.close), a = Math.min(e.open, e.close);
27
27
  if (e.high < i || e.low > a) throw Error(`Lilt Candles on series "${t}" expects low ≤ open, close ≤ high at row ${r.sourceIndex + 1}.`);
28
28
  }
29
29
  }
30
30
  function K(e, t, n, r, i = !1) {
31
- let o = Math.max(1, n.columnWidth), s = o / 2, c = U(e), l = U(n.y(t.high)), u = U(n.y(t.low));
31
+ let o = Math.max(1, n.columnWidth), s = o / 2, c = W(e), l = W(n.y(t.high)), u = W(n.y(t.low));
32
32
  if (r === "ohlc") {
33
- let r = U(n.y(t.open)), i = U(n.y(t.close)), a = U(Math.max(2, s));
33
+ let r = W(n.y(t.open)), i = W(n.y(t.close)), a = W(Math.max(2, s));
34
34
  return {
35
35
  body: null,
36
36
  hollow: null,
37
- stroke: `M${c},${l}V${u}M${U(e - a)},${r}H${c}M${c},${i}H${U(e + a)}`,
37
+ stroke: `M${c},${l}V${u}M${W(e - a)},${r}H${c}M${c},${i}H${W(e + a)}`,
38
38
  side: null,
39
39
  top: null
40
40
  };
@@ -44,7 +44,7 @@ function K(e, t, n, r, i = !1) {
44
44
  let e = (d + f) / 2;
45
45
  d = e - .5, f = e + .5;
46
46
  }
47
- let p = r === "hollow" && t.up && o >= 3, m = p ? .5 : 0, h = i ? y(e, d, o, f - d) : null, g = h ? e - h.frontWidth / 2 : e - s, _ = a(g + m, d + m, Math.max(1, (h ? h.frontWidth : o) - m * 2), Math.max(1, f - d - m * 2), !h && o >= 6 ? 1.5 : 0), v = (l < d ? `M${c},${l}V${U(d)}` : "") + (u > f ? `M${c},${U(f)}V${u}` : "");
47
+ let p = r === "hollow" && t.up && o >= 3, m = p ? .5 : 0, h = i ? y(e, d, o, f - d) : null, g = h ? e - h.frontWidth / 2 : e - s, _ = a(g + m, d + m, Math.max(1, (h ? h.frontWidth : o) - m * 2), Math.max(1, f - d - m * 2), !h && o >= 6 ? 1.5 : 0), v = (l < d ? `M${c},${l}V${W(d)}` : "") + (u > f ? `M${c},${W(f)}V${u}` : "");
48
48
  return {
49
49
  body: p ? null : _,
50
50
  hollow: p ? _ : null,
@@ -56,7 +56,7 @@ function K(e, t, n, r, i = !1) {
56
56
  function ne(t, n, r, i, a, o, s = !1) {
57
57
  let l = new c(), u = new c(), d = new c(), f = new c(), p = new c();
58
58
  for (let { row: c, cx: m } of e(t, i)) {
59
- let e = W(c, n, r);
59
+ let e = G(c, n, r);
60
60
  if (!e) continue;
61
61
  let t = o(c, e), h = K(m, e, i, a, s);
62
62
  h.side && f.add(t, h.side), h.top && p.add(t, h.top), h.body && l.add(t, h.body), h.hollow && u.add(t, h.hollow), h.stroke && d.add(t, h.stroke);
@@ -71,32 +71,32 @@ function ne(t, n, r, i, a, o, s = !1) {
71
71
  }
72
72
  //#endregion
73
73
  //#region src/finance/candles.tsx
74
- function re(e, t, n) {
75
- return O(e, t, n.up ? V : H);
74
+ function q(e, t, n) {
75
+ return O(e, t, n.up ? H : U);
76
76
  }
77
- function ie({ paths: e, display: t }) {
77
+ function re({ paths: e, display: t }) {
78
78
  let n = t === "ohlc" ? 1.5 : 1;
79
- return /* @__PURE__ */ z(L, { children: [
80
- e.strokes.map(({ color: e, d: r }) => /* @__PURE__ */ R("path", {
79
+ return /* @__PURE__ */ B(R, { children: [
80
+ e.strokes.map(({ color: e, d: r }) => /* @__PURE__ */ z("path", {
81
81
  d: r,
82
82
  fill: "none",
83
83
  strokeWidth: n,
84
84
  strokeLinecap: t === "ohlc" ? "round" : "butt",
85
85
  style: { stroke: e }
86
86
  }, `stroke-${e}`)),
87
- e.sides.map(({ color: e, d: t }) => /* @__PURE__ */ R("path", {
87
+ e.sides.map(({ color: e, d: t }) => /* @__PURE__ */ z("path", {
88
88
  d: t,
89
89
  style: { fill: g(e).side }
90
90
  }, `side-${e}`)),
91
- e.tops.map(({ color: e, d: t }) => /* @__PURE__ */ R("path", {
91
+ e.tops.map(({ color: e, d: t }) => /* @__PURE__ */ z("path", {
92
92
  d: t,
93
93
  style: { fill: g(e).top }
94
94
  }, `top-${e}`)),
95
- e.bodies.map(({ color: e, d: t }) => /* @__PURE__ */ R("path", {
95
+ e.bodies.map(({ color: e, d: t }) => /* @__PURE__ */ z("path", {
96
96
  d: t,
97
97
  style: { fill: e }
98
98
  }, `body-${e}`)),
99
- e.hollow.map(({ color: e, d: t }) => /* @__PURE__ */ R("path", {
99
+ e.hollow.map(({ color: e, d: t }) => /* @__PURE__ */ z("path", {
100
100
  d: t,
101
101
  strokeWidth: 1,
102
102
  style: {
@@ -106,18 +106,18 @@ function ie({ paths: e, display: t }) {
106
106
  }, `hollow-${e}`))
107
107
  ] });
108
108
  }
109
- var ae = o(function({ series: e, open: t, high: n, low: r, display: i = "candle", depth: a = !1, className: o }) {
109
+ var ie = o(function({ series: e, open: t, high: n, low: r, display: i = "candle", depth: a = !1, className: o }) {
110
110
  let s = T("Candles", e, [
111
111
  t,
112
112
  n,
113
113
  r
114
- ], "column"), { snapshot: c, descriptor: u, scales: d } = s, f = P(() => {
114
+ ], "column"), { snapshot: c, descriptor: u, scales: d } = s, f = F(() => {
115
115
  let o = {
116
116
  open: t,
117
117
  high: n,
118
118
  low: r
119
119
  };
120
- return G(c.data.rows, e, o), ne(c.data.rows, e, o, d, i, (e, t) => re(u, e, t), a);
120
+ return te(c.data.rows, e, o), ne(c.data.rows, e, o, d, i, (e, t) => q(u, e, t), a);
121
121
  }, [
122
122
  c,
123
123
  e,
@@ -129,7 +129,7 @@ var ae = o(function({ series: e, open: t, high: n, low: r, display: i = "candle"
129
129
  u,
130
130
  a
131
131
  ]);
132
- return /* @__PURE__ */ z("g", {
132
+ return /* @__PURE__ */ B("g", {
133
133
  "aria-hidden": "true",
134
134
  className: ["lilt-chart__candles", o].filter(Boolean).join(" "),
135
135
  "data-series": e,
@@ -140,7 +140,7 @@ var ae = o(function({ series: e, open: t, high: n, low: r, display: i = "candle"
140
140
  opacity: s.opacity,
141
141
  transition: s.reducedMotion ? void 0 : "opacity 160ms ease-out"
142
142
  },
143
- children: [a ? /* @__PURE__ */ R(l, { clip: s.depthClip }) : null, /* @__PURE__ */ R(ie, {
143
+ children: [a ? /* @__PURE__ */ z(l, { clip: s.depthClip }) : null, /* @__PURE__ */ z(re, {
144
144
  paths: f,
145
145
  display: i
146
146
  })]
@@ -158,26 +158,26 @@ var ae = o(function({ series: e, open: t, high: n, low: r, display: i = "candle"
158
158
  close: r - (r - n) * .23,
159
159
  up: !0
160
160
  }, i, e.display ?? "candle", e.depth), c = g(o);
161
- return /* @__PURE__ */ z(L, { children: [
162
- s.stroke ? /* @__PURE__ */ R("path", {
161
+ return /* @__PURE__ */ B(R, { children: [
162
+ s.stroke ? /* @__PURE__ */ z("path", {
163
163
  d: s.stroke,
164
164
  fill: "none",
165
165
  stroke: o,
166
166
  strokeWidth: 1.5
167
167
  }) : null,
168
- s.side ? /* @__PURE__ */ R("path", {
168
+ s.side ? /* @__PURE__ */ z("path", {
169
169
  d: s.side,
170
170
  fill: a ? o : c.side
171
171
  }) : null,
172
- s.top ? /* @__PURE__ */ R("path", {
172
+ s.top ? /* @__PURE__ */ z("path", {
173
173
  d: s.top,
174
174
  fill: a ? o : c.top
175
175
  }) : null,
176
- s.body ? /* @__PURE__ */ R("path", {
176
+ s.body ? /* @__PURE__ */ z("path", {
177
177
  d: s.body,
178
178
  fill: o
179
179
  }) : null,
180
- s.hollow ? /* @__PURE__ */ R("path", {
180
+ s.hollow ? /* @__PURE__ */ z("path", {
181
181
  d: s.hollow,
182
182
  fill: a ? "black" : "var(--lilt-surface)",
183
183
  stroke: o
@@ -192,12 +192,12 @@ var ae = o(function({ series: e, open: t, high: n, low: r, display: i = "candle"
192
192
  e.low
193
193
  ],
194
194
  highlight: (e, { row: n, snapshot: r, descriptor: i }) => {
195
- let a = W(n, e.series, e);
195
+ let a = G(n, e.series, e);
196
196
  if (!a) return null;
197
- let o = e.display ?? "candle", s = t(r, e.series), c = K(s.x(n.x), a, s, o, e.depth), l = re(i, n, a);
198
- return /* @__PURE__ */ R("g", {
197
+ let o = e.display ?? "candle", s = t(r, e.series), c = K(s.x(n.x), a, s, o, e.depth), l = q(i, n, a);
198
+ return /* @__PURE__ */ z("g", {
199
199
  className: "lilt-chart__candle-highlight",
200
- children: /* @__PURE__ */ R(ie, {
200
+ children: /* @__PURE__ */ z(re, {
201
201
  display: o,
202
202
  paths: {
203
203
  bodies: c.body ? [{
@@ -227,18 +227,18 @@ var ae = o(function({ series: e, open: t, high: n, low: r, display: i = "candle"
227
227
  });
228
228
  //#endregion
229
229
  //#region src/finance/cards/pane.tsx
230
- function q({ context: e, label: t, caption: n, readout: r, series: a, height: o, y: s, bars: c, xAxis: l = !1, children: u }) {
231
- let [p, m] = I(null), h = p ?? e.data.at(-1) ?? null;
232
- return /* @__PURE__ */ z("div", {
230
+ function J({ context: e, label: t, caption: n, readout: r, series: a, height: o, y: s, bars: c, xAxis: l = !1, children: u }) {
231
+ let [p, m] = L(null), h = p ?? e.data.at(-1) ?? null;
232
+ return /* @__PURE__ */ B("div", {
233
233
  className: "lilt-card__pane",
234
- children: [n ? /* @__PURE__ */ z("span", {
234
+ children: [n ? /* @__PURE__ */ B("span", {
235
235
  className: "lilt-card__pane-caption",
236
236
  "aria-hidden": "true",
237
- children: [/* @__PURE__ */ R("span", {
237
+ children: [/* @__PURE__ */ z("span", {
238
238
  className: "lilt-card__pane-name",
239
239
  children: n
240
240
  }), r && h && !e.loading ? r(h) : null]
241
- }) : null, /* @__PURE__ */ R(f, {
241
+ }) : null, /* @__PURE__ */ z(f, {
242
242
  className: "lilt-card__chart",
243
243
  "aria-label": t,
244
244
  data: e.data,
@@ -250,7 +250,7 @@ function q({ context: e, label: t, caption: n, readout: r, series: a, height: o,
250
250
  motion: e.motion,
251
251
  status: e.loading ? "loading" : "ready",
252
252
  loadingStyle: e.loadingStyle,
253
- children: /* @__PURE__ */ z(i, {
253
+ children: /* @__PURE__ */ B(i, {
254
254
  height: o,
255
255
  margins: {
256
256
  ...e.margins,
@@ -263,59 +263,59 @@ function q({ context: e, label: t, caption: n, readout: r, series: a, height: o,
263
263
  slots: e.slots || !!c,
264
264
  bars: c,
265
265
  background: "none",
266
- children: [u, l ? /* @__PURE__ */ R(d, { labels: "fit" }) : null]
266
+ children: [u, l ? /* @__PURE__ */ z(d, { labels: "fit" }) : null]
267
267
  })
268
268
  })]
269
269
  });
270
270
  }
271
271
  //#endregion
272
272
  //#region src/finance/cards/candlestick-chart-card.tsx
273
- function J(e, t) {
273
+ function Y(e, t) {
274
274
  let n = e[t];
275
275
  return typeof n == "number" && Number.isFinite(n) ? n : null;
276
276
  }
277
- function Y(e, t, n) {
278
- let r = e.length ? J(e[0], t) : null, i = e.length ? J(e.at(-1), n) : null;
277
+ function X(e, t, n) {
278
+ let r = e.length ? Y(e[0], t) : null, i = e.length ? Y(e.at(-1), n) : null;
279
279
  return r && i !== null ? i / r - 1 : void 0;
280
280
  }
281
- function oe(e) {
281
+ function ae(e) {
282
282
  return (t) => {
283
283
  let n = t.series[0]?.fields;
284
284
  return !n?.length || n.some((e) => e.value === null) ? null : n.map((t) => `${t.label[0]} ${e(t.value)}`).join(" ");
285
285
  };
286
286
  }
287
- var se = {
287
+ var oe = {
288
288
  minimumFractionDigits: 2,
289
289
  maximumFractionDigits: 2
290
290
  };
291
- function ce({ open: e, high: t, low: r, close: i, volume: a, display: o = "candle", depth: s = !1, scale: c = "linear", label: l = "Price", live: u = !1, data: d, ranges: f, delta: p, valueFormat: h = se, locale: g = "en-US", volumeHeight: _ = 64, ...y }) {
292
- let x = P(() => v(g, h).full, [g, JSON.stringify(h)]), S = P(() => v(g).compact, [g]), C = P(() => f?.map((t) => ({
291
+ function se({ open: e, high: t, low: r, close: i, volume: a, display: o = "candle", depth: s = !1, scale: c = "linear", label: l = "Price", live: u = !1, data: d, ranges: f, delta: p, valueFormat: h = oe, locale: g = "en-US", volumeHeight: _ = 64, ...y }) {
292
+ let x = F(() => v(g, h).full, [g, JSON.stringify(h)]), S = F(() => v(g).compact, [g]), C = F(() => f?.map((t) => ({
293
293
  ...t,
294
- delta: t.delta ?? Y(t.data, e, i)
294
+ delta: t.delta ?? X(t.data, e, i)
295
295
  })), [
296
296
  f,
297
297
  e,
298
298
  i
299
- ]), w = (Y(d ?? f?.[0]?.data ?? [], e, i) ?? 0) >= 0, T = (t) => (J(t, i) ?? 0) >= (J(t, e) ?? 0), D = o === "area", O = {
299
+ ]), w = (X(d ?? f?.[0]?.data ?? [], e, i) ?? 0) >= 0, T = (t) => (Y(t, i) ?? 0) >= (Y(t, e) ?? 0), D = o === "area", O = {
300
300
  open: {
301
301
  label: "Open",
302
- accessor: (t) => J(t, e)
302
+ accessor: (t) => Y(t, e)
303
303
  },
304
304
  high: {
305
305
  label: "High",
306
- accessor: (e) => J(e, t)
306
+ accessor: (e) => Y(e, t)
307
307
  },
308
308
  low: {
309
309
  label: "Low",
310
- accessor: (e) => J(e, r)
310
+ accessor: (e) => Y(e, r)
311
311
  }
312
312
  };
313
- return /* @__PURE__ */ R(b, {
313
+ return /* @__PURE__ */ z(b, {
314
314
  ...y,
315
315
  depth: s,
316
316
  data: d,
317
317
  ranges: C,
318
- delta: p ?? (d ? Y(d, e, i) : void 0),
318
+ delta: p ?? (d ? X(d, e, i) : void 0),
319
319
  valueFormat: h,
320
320
  locale: g,
321
321
  aggregate: "last",
@@ -324,7 +324,7 @@ function ce({ open: e, high: t, low: r, close: i, volume: a, display: o = "candl
324
324
  series: [{
325
325
  key: i,
326
326
  label: l,
327
- color: D ? w ? V : H : void 0
327
+ color: D ? w ? H : U : void 0
328
328
  }],
329
329
  shape: {
330
330
  kind: "marks",
@@ -341,8 +341,8 @@ function ce({ open: e, high: t, low: r, close: i, volume: a, display: o = "candl
341
341
  fields: O,
342
342
  line: { showInspectionPoint: !1 }
343
343
  },
344
- describe: oe(x),
345
- draw: (e) => e.map((e) => D ? [/* @__PURE__ */ R(n, { series: e }, `area-${e}`), /* @__PURE__ */ R(E, { series: e }, `line-${e}`)] : /* @__PURE__ */ R(ae, {
344
+ describe: ae(x),
345
+ draw: (e) => e.map((e) => D ? [/* @__PURE__ */ z(n, { series: e }, `area-${e}`), /* @__PURE__ */ z(E, { series: e }, `line-${e}`)] : /* @__PURE__ */ z(ie, {
346
346
  series: e,
347
347
  open: "open",
348
348
  high: "high",
@@ -351,7 +351,7 @@ function ce({ open: e, high: t, low: r, close: i, volume: a, display: o = "candl
351
351
  depth: s
352
352
  }, e))
353
353
  },
354
- panes: a ? (e) => /* @__PURE__ */ R(q, {
354
+ panes: a ? (e) => /* @__PURE__ */ z(J, {
355
355
  context: e,
356
356
  label: `${y.title} volume`,
357
357
  caption: "Volume",
@@ -366,39 +366,39 @@ function ce({ open: e, high: t, low: r, close: i, volume: a, display: o = "candl
366
366
  series: [{
367
367
  id: "volume",
368
368
  label: "Volume",
369
- accessor: (e) => J(e, a),
369
+ accessor: (e) => Y(e, a),
370
370
  formatValue: S,
371
371
  colorAt: (e) => T(e) ? "color-mix(in srgb, var(--lilt-candle-up) 42%, transparent)" : "color-mix(in srgb, var(--lilt-candle-down) 42%, transparent)",
372
372
  bar: { radius: 1 }
373
373
  }],
374
- children: /* @__PURE__ */ R(m, { series: "volume" })
374
+ children: /* @__PURE__ */ z(m, { series: "volume" })
375
375
  }) : void 0
376
376
  });
377
377
  }
378
378
  //#endregion
379
379
  //#region src/finance/indicators.ts
380
- function X(e) {
380
+ function Z(e) {
381
381
  return typeof e == "number" && Number.isFinite(e);
382
382
  }
383
- function le(e, t) {
383
+ function ce(e, t) {
384
384
  if (!Number.isInteger(t) || t < 1) throw Error(`Lilt ${e} period must be a positive integer; received ${t}.`);
385
385
  }
386
- function ue(e, t) {
387
- le("sma", t);
386
+ function le(e, t) {
387
+ ce("sma", t);
388
388
  let n = [], r = 0, i = 0;
389
389
  for (let a = 0; a < e.length; a += 1) {
390
390
  let o = e[a];
391
- X(o) && (r += o, i += 1);
391
+ Z(o) && (r += o, i += 1);
392
392
  let s = a - t >= 0 ? e[a - t] : void 0;
393
- a - t >= 0 && X(s) && (r -= s, --i), n.push(a >= t - 1 && i === t ? r / t : null);
393
+ a - t >= 0 && Z(s) && (r -= s, --i), n.push(a >= t - 1 && i === t ? r / t : null);
394
394
  }
395
395
  return n;
396
396
  }
397
- function Z(e, t) {
398
- le("ema", t);
397
+ function Q(e, t) {
398
+ ce("ema", t);
399
399
  let n = 2 / (t + 1), r = [], i = null, a = [];
400
400
  for (let o of e) {
401
- if (!X(o)) {
401
+ if (!Z(o)) {
402
402
  r.push(null);
403
403
  continue;
404
404
  }
@@ -410,11 +410,11 @@ function Z(e, t) {
410
410
  }
411
411
  return r;
412
412
  }
413
- function de(e, t = 14) {
414
- le("rsi", t);
413
+ function ue(e, t = 14) {
414
+ ce("rsi", t);
415
415
  let n = e.map(() => null), r = null, i = 0, a = 0, o = 0, s = 0, c = 0;
416
416
  return e.forEach((e, l) => {
417
- if (!X(e)) return;
417
+ if (!Z(e)) return;
418
418
  if (r === null) {
419
419
  r = e;
420
420
  return;
@@ -429,12 +429,12 @@ function de(e, t = 14) {
429
429
  n[l] = c === 0 ? s === 0 ? 50 : 100 : 100 - 100 / (1 + s / c);
430
430
  }), n;
431
431
  }
432
- function fe(e, t = 12, n = 26, r = 9) {
432
+ function de(e, t = 12, n = 26, r = 9) {
433
433
  if (t >= n) throw Error("Lilt macd needs a fast period shorter than the slow period.");
434
- let i = Z(e, t), a = Z(e, n), o = e.map((e, t) => {
434
+ let i = Q(e, t), a = Q(e, n), o = e.map((e, t) => {
435
435
  let n = i[t], r = a[t];
436
436
  return n === null || r === null ? null : n - r;
437
- }), s = Z(o, r);
437
+ }), s = Q(o, r);
438
438
  return {
439
439
  macd: o,
440
440
  signal: s,
@@ -444,8 +444,8 @@ function fe(e, t = 12, n = 26, r = 9) {
444
444
  })
445
445
  };
446
446
  }
447
- function pe(e, t = 20, n = 2) {
448
- let r = ue(e, t), i = [], a = [];
447
+ function fe(e, t = 20, n = 2) {
448
+ let r = le(e, t), i = [], a = [];
449
449
  return r.forEach((r, o) => {
450
450
  if (r === null) {
451
451
  i.push(null), a.push(null);
@@ -461,19 +461,19 @@ function pe(e, t = 20, n = 2) {
461
461
  lower: a
462
462
  };
463
463
  }
464
- function me(e) {
464
+ function pe(e) {
465
465
  let t = -Infinity;
466
- return e.map((e) => X(e) ? (t = Math.max(t, e), t > 0 ? e / t - 1 : 0) : null);
466
+ return e.map((e) => Z(e) ? (t = Math.max(t, e), t > 0 ? e / t - 1 : 0) : null);
467
467
  }
468
- function he(e) {
469
- let t = e.find(X);
470
- return e.map((e) => X(e) && t !== void 0 && t !== 0 ? e / t - 1 : null);
468
+ function me(e) {
469
+ let t = e.find(Z);
470
+ return e.map((e) => Z(e) && t !== void 0 && t !== 0 ? e / t - 1 : null);
471
471
  }
472
- function ge(e, t) {
473
- for (let n of t) if (!X(n.price) || !X(n.size) || n.size < 0) throw Error(`Lilt order book ${e} need finite prices and non-negative sizes; received ${n.price} × ${n.size}.`);
472
+ function he(e, t) {
473
+ for (let n of t) if (!Z(n.price) || !Z(n.size) || n.size < 0) throw Error(`Lilt order book ${e} need finite prices and non-negative sizes; received ${n.price} × ${n.size}.`);
474
474
  }
475
- function _e(e, t) {
476
- ge("bids", e), ge("asks", t);
475
+ function ge(e, t) {
476
+ he("bids", e), he("asks", t);
477
477
  let n = (e) => {
478
478
  let t = /* @__PURE__ */ new Map();
479
479
  for (let n of e) t.set(n.price, (t.get(n.price) ?? 0) + n.size);
@@ -508,7 +508,7 @@ function _e(e, t) {
508
508
  }
509
509
  //#endregion
510
510
  //#region src/finance/cards/indicator-chart-card.tsx
511
- function ve(e) {
511
+ function _e(e) {
512
512
  return e.map((e, t) => {
513
513
  let n = typeof e == "string" ? { kind: e } : e, r = "period" in n && n.period !== void 0 ? n.period : (n.kind, 20), i = "deviations" in n && n.deviations !== void 0 ? n.deviations : 2, a = n.kind === "bollinger" ? "BB" : n.kind.toUpperCase();
514
514
  return {
@@ -520,7 +520,7 @@ function ve(e) {
520
520
  };
521
521
  });
522
522
  }
523
- function ye(e) {
523
+ function ve(e) {
524
524
  return e.map((e, t) => {
525
525
  let n = typeof e == "string" ? { kind: e } : e;
526
526
  return {
@@ -533,99 +533,99 @@ function ye(e) {
533
533
  };
534
534
  });
535
535
  }
536
- function Q(e, t) {
536
+ function $(e, t) {
537
537
  if (!t) return null;
538
538
  let n = e[t];
539
539
  return typeof n == "number" && Number.isFinite(n) ? n : null;
540
540
  }
541
- function be(e, t, n, r) {
542
- let i = e.map((e) => Q(e, t)), a = e.map((e) => ({ ...e })), o = (e, t) => t.forEach((t, n) => a[n][e] = t);
541
+ function ye(e, t, n, r) {
542
+ let i = e.map((e) => $(e, t)), a = e.map((e) => ({ ...e })), o = (e, t) => t.forEach((t, n) => a[n][e] = t);
543
543
  for (let e of n) if (e.kind === "bollinger") {
544
- let t = pe(i, e.period, e.deviations);
544
+ let t = fe(i, e.period, e.deviations);
545
545
  o(e.id, t.middle), o(`${e.id}Upper`, t.upper), o(`${e.id}Lower`, t.lower);
546
- } else o(e.id, (e.kind === "sma" ? ue : Z)(i, e.period));
547
- for (let e of r) if (e.kind === "rsi" && o(e.id, de(i, e.period)), e.kind === "macd") {
548
- let t = fe(i, e.fast, e.slow, e.signal);
546
+ } else o(e.id, (e.kind === "sma" ? le : Q)(i, e.period));
547
+ for (let e of r) if (e.kind === "rsi" && o(e.id, ue(i, e.period)), e.kind === "macd") {
548
+ let t = de(i, e.fast, e.slow, e.signal);
549
549
  o(`${e.id}Macd`, t.macd), o(`${e.id}Signal`, t.signal), o(`${e.id}Histogram`, t.histogram);
550
550
  }
551
551
  return a;
552
552
  }
553
- var xe = {
553
+ var be = {
554
554
  minimumFractionDigits: 2,
555
555
  maximumFractionDigits: 2
556
- }, Se = [
556
+ }, xe = [
557
557
  "var(--lilt-series-4)",
558
558
  "var(--lilt-series-3)",
559
559
  "var(--lilt-series-5)"
560
560
  ];
561
- function Ce({ close: e, open: t, high: n, low: r, volume: i, display: a, overlays: o = [], panes: c = ["rsi", "macd"], label: l = "Price", scale: u = "linear", live: d = !1, data: f, ranges: p, delta: h, valueFormat: g = xe, locale: y = "en-US", paneHeight: x = 72, ...S }) {
561
+ function Se({ close: e, open: t, high: n, low: r, volume: i, display: a, overlays: o = [], panes: c = ["rsi", "macd"], label: l = "Price", scale: u = "linear", live: d = !1, data: f, ranges: p, delta: h, valueFormat: g = be, locale: y = "en-US", paneHeight: x = 72, ...S }) {
562
562
  let w = !!(t && n && r), T = a ?? (w ? "candle" : "line");
563
563
  if (T !== "line" && !w) throw Error("Lilt IndicatorChartCard candles need open, high and low fields.");
564
- let D = JSON.stringify(o), O = JSON.stringify(c), k = P(() => ve(o), [D]), A = P(() => ye(c), [O]);
564
+ let D = JSON.stringify(o), O = JSON.stringify(c), k = F(() => _e(o), [D]), A = F(() => ve(c), [O]);
565
565
  if (A.some((e) => e.kind === "volume") && !i) throw Error("Lilt IndicatorChartCard needs a `volume` field for a volume pane.");
566
- let ee = P(() => f ? be(f, e, k, A) : void 0, [
566
+ let j = F(() => f ? ye(f, e, k, A) : void 0, [
567
567
  f,
568
568
  e,
569
569
  k,
570
570
  A
571
- ]), te = P(() => p?.map((n) => ({
571
+ ]), M = F(() => p?.map((n) => ({
572
572
  ...n,
573
- data: be(n.data, e, k, A),
574
- delta: n.delta ?? (t ? Y(n.data, t, e) : void 0)
573
+ data: ye(n.data, e, k, A),
574
+ delta: n.delta ?? (t ? X(n.data, t, e) : void 0)
575
575
  })), [
576
576
  p,
577
577
  e,
578
578
  t,
579
579
  k,
580
580
  A
581
- ]), j = P(() => v(y, g).full, [y, JSON.stringify(g)]), M = P(() => v(y, { maximumFractionDigits: 2 }).full, [y]), N = P(() => v(y).compact, [y]), F = w ? {
581
+ ]), ee = F(() => v(y, g).full, [y, JSON.stringify(g)]), N = F(() => v(y, { maximumFractionDigits: 2 }).full, [y]), P = F(() => v(y).compact, [y]), I = w ? {
582
582
  open: {
583
583
  label: "Open",
584
- accessor: (e) => Q(e, t)
584
+ accessor: (e) => $(e, t)
585
585
  },
586
586
  high: {
587
587
  label: "High",
588
- accessor: (e) => Q(e, n)
588
+ accessor: (e) => $(e, n)
589
589
  },
590
590
  low: {
591
591
  label: "Low",
592
- accessor: (e) => Q(e, r)
592
+ accessor: (e) => $(e, r)
593
593
  }
594
- } : void 0, I = new Map(k.map((e) => [e.id, e])), B = f?.length ? Q(f[0], e) : null, U = f?.length ? Q(f.at(-1), e) : null, W = B === null || U === null || U >= B, G = A.at(-1)?.id, K = (n, r) => {
595
- let a = n.id === G, o = (e) => (t) => Q(t, e), s = (e, t, n) => {
596
- let r = Q(e, t);
597
- return /* @__PURE__ */ z("span", {
594
+ } : void 0, L = new Map(k.map((e) => [e.id, e])), V = f?.length ? $(f[0], e) : null, W = f?.length ? $(f.at(-1), e) : null, G = V === null || W === null || W >= V, te = A.at(-1)?.id, K = (n, r) => {
595
+ let a = n.id === te, o = (e) => (t) => $(t, e), s = (e, t, n) => {
596
+ let r = $(e, t);
597
+ return /* @__PURE__ */ B("span", {
598
598
  className: "lilt-card__pane-value",
599
- children: [n ? `${n} ` : "", r === null ? "—" : M(r)]
599
+ children: [n ? `${n} ` : "", r === null ? "—" : N(r)]
600
600
  }, t);
601
601
  };
602
- if (n.kind === "volume") return /* @__PURE__ */ R(q, {
602
+ if (n.kind === "volume") return /* @__PURE__ */ z(J, {
603
603
  context: r,
604
604
  label: `${S.title} volume`,
605
605
  caption: "Volume",
606
- readout: (e) => /* @__PURE__ */ R("span", {
606
+ readout: (e) => /* @__PURE__ */ z("span", {
607
607
  className: "lilt-card__pane-value",
608
- children: Q(e, i) === null ? "—" : N(Q(e, i))
608
+ children: $(e, i) === null ? "—" : P($(e, i))
609
609
  }),
610
610
  height: x,
611
611
  xAxis: a,
612
612
  y: {
613
613
  includeZero: !0,
614
614
  ticks: 2,
615
- format: N
615
+ format: P
616
616
  },
617
617
  bars: { series: ["volume"] },
618
618
  series: [{
619
619
  id: "volume",
620
620
  label: "Volume",
621
621
  accessor: o(i),
622
- formatValue: N,
623
- colorAt: (n) => (Q(n, e) ?? 0) >= (Q(n, t) ?? Q(n, e) ?? 0) ? "color-mix(in srgb, var(--lilt-candle-up) 42%, transparent)" : "color-mix(in srgb, var(--lilt-candle-down) 42%, transparent)",
622
+ formatValue: P,
623
+ colorAt: (n) => ($(n, e) ?? 0) >= ($(n, t) ?? $(n, e) ?? 0) ? "color-mix(in srgb, var(--lilt-candle-up) 42%, transparent)" : "color-mix(in srgb, var(--lilt-candle-down) 42%, transparent)",
624
624
  bar: { radius: 1 }
625
625
  }],
626
- children: /* @__PURE__ */ R(m, { series: "volume" })
626
+ children: /* @__PURE__ */ z(m, { series: "volume" })
627
627
  }, n.id);
628
- if (n.kind === "rsi") return /* @__PURE__ */ z(q, {
628
+ if (n.kind === "rsi") return /* @__PURE__ */ B(J, {
629
629
  context: r,
630
630
  label: `${S.title} RSI ${n.period}`,
631
631
  caption: `RSI ${n.period}`,
@@ -642,32 +642,32 @@ function Ce({ close: e, open: t, high: n, low: r, volume: i, display: a, overlay
642
642
  label: `RSI ${n.period}`,
643
643
  accessor: o(n.id),
644
644
  color: "var(--lilt-series-1)",
645
- formatValue: M,
645
+ formatValue: N,
646
646
  line: {
647
647
  width: 1.5,
648
648
  depth: S.depth
649
649
  }
650
650
  }],
651
651
  children: [
652
- /* @__PURE__ */ R(_, {
652
+ /* @__PURE__ */ z(_, {
653
653
  axis: "y",
654
654
  from: 30,
655
655
  to: 70,
656
656
  color: "var(--lilt-series-1)"
657
657
  }),
658
- /* @__PURE__ */ R(C, {
658
+ /* @__PURE__ */ z(C, {
659
659
  value: 70,
660
660
  color: "var(--lilt-muted)"
661
661
  }),
662
- /* @__PURE__ */ R(C, {
662
+ /* @__PURE__ */ z(C, {
663
663
  value: 30,
664
664
  color: "var(--lilt-muted)"
665
665
  }),
666
- /* @__PURE__ */ R(E, { series: n.id })
666
+ /* @__PURE__ */ z(E, { series: n.id })
667
667
  ]
668
668
  }, n.id);
669
669
  let c = `${n.id}Macd`, l = `${n.id}Signal`, u = `${n.id}Histogram`;
670
- return /* @__PURE__ */ z(q, {
670
+ return /* @__PURE__ */ B(J, {
671
671
  context: r,
672
672
  label: `${S.title} MACD`,
673
673
  caption: `MACD ${n.fast} · ${n.slow} · ${n.signal}`,
@@ -677,7 +677,7 @@ function Ce({ close: e, open: t, high: n, low: r, volume: i, display: a, overlay
677
677
  y: {
678
678
  includeZero: !0,
679
679
  ticks: 2,
680
- format: M
680
+ format: N
681
681
  },
682
682
  bars: { series: [u] },
683
683
  series: [
@@ -685,8 +685,8 @@ function Ce({ close: e, open: t, high: n, low: r, volume: i, display: a, overlay
685
685
  id: u,
686
686
  label: "Histogram",
687
687
  accessor: o(u),
688
- formatValue: M,
689
- colorAt: (e) => (Q(e, u) ?? 0) >= 0 ? "color-mix(in srgb, var(--lilt-candle-up) 55%, transparent)" : "color-mix(in srgb, var(--lilt-candle-down) 55%, transparent)",
688
+ formatValue: N,
689
+ colorAt: (e) => ($(e, u) ?? 0) >= 0 ? "color-mix(in srgb, var(--lilt-candle-up) 55%, transparent)" : "color-mix(in srgb, var(--lilt-candle-down) 55%, transparent)",
690
690
  bar: { radius: 1 }
691
691
  },
692
692
  {
@@ -694,7 +694,7 @@ function Ce({ close: e, open: t, high: n, low: r, volume: i, display: a, overlay
694
694
  label: "MACD",
695
695
  accessor: o(c),
696
696
  color: "var(--lilt-series-4)",
697
- formatValue: M,
697
+ formatValue: N,
698
698
  line: {
699
699
  width: 1.5,
700
700
  depth: S.depth
@@ -705,7 +705,7 @@ function Ce({ close: e, open: t, high: n, low: r, volume: i, display: a, overlay
705
705
  label: "Signal",
706
706
  accessor: o(l),
707
707
  color: "var(--lilt-series-3)",
708
- formatValue: M,
708
+ formatValue: N,
709
709
  line: {
710
710
  width: 1.5,
711
711
  dasharray: "3 3"
@@ -713,17 +713,17 @@ function Ce({ close: e, open: t, high: n, low: r, volume: i, display: a, overlay
713
713
  }
714
714
  ],
715
715
  children: [
716
- /* @__PURE__ */ R(m, { series: u }),
717
- /* @__PURE__ */ R(E, { series: c }),
718
- /* @__PURE__ */ R(E, { series: l })
716
+ /* @__PURE__ */ z(m, { series: u }),
717
+ /* @__PURE__ */ z(E, { series: c }),
718
+ /* @__PURE__ */ z(E, { series: l })
719
719
  ]
720
720
  }, n.id);
721
721
  };
722
- return /* @__PURE__ */ R(b, {
722
+ return /* @__PURE__ */ z(b, {
723
723
  ...S,
724
- data: ee,
725
- ranges: te,
726
- delta: h ?? (f && t ? Y(f, t, e) : void 0),
724
+ data: j,
725
+ ranges: M,
726
+ delta: h ?? (f && t ? X(f, t, e) : void 0),
727
727
  valueFormat: g,
728
728
  locale: y,
729
729
  aggregate: "last",
@@ -734,11 +734,11 @@ function Ce({ close: e, open: t, high: n, low: r, volume: i, display: a, overlay
734
734
  series: [{
735
735
  key: e,
736
736
  label: l,
737
- color: T === "line" ? W ? V : H : void 0
737
+ color: T === "line" ? G ? H : U : void 0
738
738
  }, ...k.map((e, t) => ({
739
739
  key: e.id,
740
740
  label: e.label,
741
- color: Se[t % Se.length]
741
+ color: xe[t % xe.length]
742
742
  }))],
743
743
  shape: {
744
744
  kind: "marks",
@@ -748,7 +748,7 @@ function Ce({ close: e, open: t, high: n, low: r, volume: i, display: a, overlay
748
748
  slots: !0,
749
749
  xAxis: A.length === 0,
750
750
  series: (e) => {
751
- let t = I.get(e);
751
+ let t = L.get(e);
752
752
  return t ? {
753
753
  curve: "monotone",
754
754
  line: {
@@ -759,30 +759,30 @@ function Ce({ close: e, open: t, high: n, low: r, volume: i, display: a, overlay
759
759
  ...t.kind === "bollinger" ? { fields: {
760
760
  upper: {
761
761
  label: "Upper",
762
- accessor: (e) => Q(e, `${t.id}Upper`)
762
+ accessor: (e) => $(e, `${t.id}Upper`)
763
763
  },
764
764
  lower: {
765
765
  label: "Lower",
766
- accessor: (e) => Q(e, `${t.id}Lower`)
766
+ accessor: (e) => $(e, `${t.id}Lower`)
767
767
  }
768
768
  } } : {}
769
769
  } : T === "line" ? {
770
- fields: F,
770
+ fields: I,
771
771
  curve: "linear",
772
772
  line: {
773
773
  width: 2,
774
774
  depth: S.depth
775
775
  }
776
- } : { fields: F };
776
+ } : { fields: I };
777
777
  },
778
- describe: w ? oe(j) : void 0,
778
+ describe: w ? ae(ee) : void 0,
779
779
  draw: (e) => e.map((e) => {
780
- let t = I.get(e);
781
- return t ? t.kind === "bollinger" ? [/* @__PURE__ */ R(s, {
780
+ let t = L.get(e);
781
+ return t ? t.kind === "bollinger" ? [/* @__PURE__ */ z(s, {
782
782
  series: e,
783
783
  lower: "lower",
784
784
  upper: "upper"
785
- }, `band-${e}`), /* @__PURE__ */ R(E, { series: e }, `line-${e}`)] : /* @__PURE__ */ R(E, { series: e }, e) : T === "line" ? /* @__PURE__ */ R(E, { series: e }, e) : /* @__PURE__ */ R(ae, {
785
+ }, `band-${e}`), /* @__PURE__ */ z(E, { series: e }, `line-${e}`)] : /* @__PURE__ */ z(E, { series: e }, e) : T === "line" ? /* @__PURE__ */ z(E, { series: e }, e) : /* @__PURE__ */ z(ie, {
786
786
  series: e,
787
787
  open: "open",
788
788
  high: "high",
@@ -792,26 +792,26 @@ function Ce({ close: e, open: t, high: n, low: r, volume: i, display: a, overlay
792
792
  }, e);
793
793
  })
794
794
  },
795
- panes: A.length ? (e) => /* @__PURE__ */ R(L, { children: A.map((t) => K(t, e)) }) : void 0
795
+ panes: A.length ? (e) => /* @__PURE__ */ z(R, { children: A.map((t) => K(t, e)) }) : void 0
796
796
  });
797
797
  }
798
798
  //#endregion
799
799
  //#region src/finance/cards/depth-chart-card.tsx
800
- function we({ price: e, label: t }) {
800
+ function Ce({ price: e, label: t }) {
801
801
  let { snapshot: n } = h();
802
802
  if (e < n.xDomain[0] || e > n.xDomain[1]) return null;
803
803
  let r = n.xToPixel(e);
804
- return /* @__PURE__ */ z("g", {
804
+ return /* @__PURE__ */ B("g", {
805
805
  className: "lilt-card__depth-mid",
806
806
  "aria-hidden": "true",
807
- children: [/* @__PURE__ */ R("line", {
807
+ children: [/* @__PURE__ */ z("line", {
808
808
  x1: r,
809
809
  x2: r,
810
810
  y1: n.plot.top + 18,
811
811
  y2: n.plot.bottom,
812
812
  strokeDasharray: "2 4",
813
813
  vectorEffect: "non-scaling-stroke"
814
- }), /* @__PURE__ */ R("text", {
814
+ }), /* @__PURE__ */ z("text", {
815
815
  x: r,
816
816
  y: n.plot.top + 10,
817
817
  textAnchor: "middle",
@@ -819,153 +819,149 @@ function we({ price: e, label: t }) {
819
819
  })]
820
820
  });
821
821
  }
822
- var Te = {
822
+ var we = {
823
823
  style: "currency",
824
824
  currency: "USD",
825
825
  minimumFractionDigits: 2,
826
826
  maximumFractionDigits: 2
827
827
  };
828
- function Ee({ title: e, bids: t, asks: r, valueFormat: a = Te, sizeFormat: o, locale: s = "en-US", height: c = 220, axis: l = "minimal", background: u = "dots", hoverStyle: p = "soft", surface: m, numberStyle: h, loading: g = !1, loadingStyle: _ = "shimmer", motion: y, className: b, style: x, depth: S = !1 }) {
829
- let C = P(() => _e(t, r), [t, r]), T = JSON.stringify(a), O = JSON.stringify(o ?? null), k = P(() => v(s, a), [s, T]), N = P(() => v(s, o), [s, O]), F = P(() => v(s, {
828
+ function Te({ title: e, header: t = !0, "aria-label": r = e || "Depth chart", bids: a, asks: o, valueFormat: s = we, sizeFormat: c, locale: l = "en-US", height: u = 220, axis: p = "minimal", background: m = "dots", hoverStyle: h = "soft", surface: g, numberStyle: _, loading: y = !1, loadingStyle: b = "shimmer", motion: x, className: S, style: C, depth: T = !1 }) {
829
+ let O = F(() => ge(a, o), [a, o]), k = JSON.stringify(s), P = JSON.stringify(c ?? null), I = F(() => v(l, s), [l, k]), V = F(() => v(l, c), [l, P]), W = F(() => v(l, {
830
830
  style: "percent",
831
831
  maximumFractionDigits: 3
832
- }).full, [s]), [L, B] = I(null), U = P(() => [{
832
+ }).full, [l]), [G, te] = L(null), K = F(() => [{
833
833
  id: "bid",
834
834
  label: "Bids",
835
835
  accessor: (e) => e.bid,
836
- color: V,
836
+ color: H,
837
837
  curve: "step-before",
838
838
  area: { treatment: "fade" },
839
839
  line: {
840
840
  width: 1.5,
841
- depth: S
841
+ depth: T
842
842
  },
843
- formatValue: N.full
843
+ formatValue: V.full
844
844
  }, {
845
845
  id: "ask",
846
846
  label: "Asks",
847
847
  accessor: (e) => e.ask,
848
- color: H,
848
+ color: U,
849
849
  curve: "step-after",
850
850
  area: { treatment: "fade" },
851
851
  line: {
852
852
  width: 1.5,
853
- depth: S
853
+ depth: T
854
854
  },
855
- formatValue: N.full
856
- }], [N, S]), W = C.spread !== null && C.mid ? `${k.full(C.spread)} (${F(C.spread / C.mid)})` : "—", G = L ? L.bid ?? L.ask : null;
857
- return /* @__PURE__ */ z(M, {
858
- "aria-label": e,
859
- surface: m,
860
- numberStyle: h,
861
- motion: y,
862
- className: ["lilt-card--depth", b].filter(Boolean).join(" "),
863
- style: x,
864
- children: [
865
- /* @__PURE__ */ z(j, { children: [/* @__PURE__ */ R(te, { children: e }), /* @__PURE__ */ R(ee, {
866
- value: C.mid,
867
- format: k.full,
868
- loading: g,
869
- motion: y,
870
- children: g ? null : L && G !== null ? /* @__PURE__ */ z(A, { children: [
871
- N.full(G),
872
- " ",
873
- L.side === "bid" ? "bid" : "ask",
874
- " depth at",
875
- " ",
876
- k.full(L.price)
877
- ] }) : /* @__PURE__ */ R(A, { children: "Mid price" })
878
- })] }),
879
- /* @__PURE__ */ z("dl", {
880
- className: "lilt-card__stats",
855
+ formatValue: V.full
856
+ }], [V, T]), ne = O.spread !== null && O.mid ? `${I.full(O.spread)} (${W(O.spread / O.mid)})` : "—", q = G ? G.bid ?? G.ask : null;
857
+ return /* @__PURE__ */ B(N, {
858
+ "aria-label": r,
859
+ surface: g,
860
+ numberStyle: _,
861
+ motion: x,
862
+ className: ["lilt-card--depth", S].filter(Boolean).join(" "),
863
+ style: C,
864
+ children: [t ? /* @__PURE__ */ B(R, { children: [/* @__PURE__ */ B(ee, { children: [e ? /* @__PURE__ */ z(M, { children: e }) : null, /* @__PURE__ */ z(j, {
865
+ value: O.mid,
866
+ format: I.full,
867
+ loading: y,
868
+ motion: x,
869
+ children: y ? null : G && q !== null ? /* @__PURE__ */ B(A, { children: [
870
+ V.full(q),
871
+ " ",
872
+ G.side === "bid" ? "bid" : "ask",
873
+ " depth at",
874
+ " ",
875
+ I.full(G.price)
876
+ ] }) : /* @__PURE__ */ z(A, { children: "Mid price" })
877
+ })] }), /* @__PURE__ */ B("dl", {
878
+ className: "lilt-card__stats",
879
+ children: [
880
+ /* @__PURE__ */ B("div", { children: [/* @__PURE__ */ z("dt", { children: "Spread" }), /* @__PURE__ */ z("dd", { children: y ? "—" : ne })] }),
881
+ /* @__PURE__ */ B("div", {
882
+ "data-side": "bid",
883
+ children: [/* @__PURE__ */ z("dt", { children: "Bid depth" }), /* @__PURE__ */ z("dd", { children: y ? "—" : V.compact(O.bidDepth) })]
884
+ }),
885
+ /* @__PURE__ */ B("div", {
886
+ "data-side": "ask",
887
+ children: [/* @__PURE__ */ z("dt", { children: "Ask depth" }), /* @__PURE__ */ z("dd", { children: y ? "—" : V.compact(O.askDepth) })]
888
+ })
889
+ ]
890
+ })] }) : null, /* @__PURE__ */ z(f, {
891
+ className: "lilt-card__chart",
892
+ "aria-label": `${r} depth by price`,
893
+ data: O.levels,
894
+ x: {
895
+ type: "number",
896
+ accessor: (e) => e.price,
897
+ format: I.full
898
+ },
899
+ y: {
900
+ includeZero: !0,
901
+ ticks: 3,
902
+ format: V.compact
903
+ },
904
+ series: K,
905
+ onSelectionChange: (e) => te(e?.row ?? null),
906
+ motion: x,
907
+ status: y ? "loading" : "ready",
908
+ loadingStyle: b,
909
+ children: /* @__PURE__ */ B(i, {
910
+ height: u,
911
+ axis: p,
912
+ background: m,
913
+ pill: h,
914
+ margins: {
915
+ top: 8,
916
+ right: 4,
917
+ bottom: 28,
918
+ left: 4
919
+ },
881
920
  children: [
882
- /* @__PURE__ */ z("div", { children: [/* @__PURE__ */ R("dt", { children: "Spread" }), /* @__PURE__ */ R("dd", { children: g ? "—" : W })] }),
883
- /* @__PURE__ */ z("div", {
884
- "data-side": "bid",
885
- children: [/* @__PURE__ */ R("dt", { children: "Bid depth" }), /* @__PURE__ */ R("dd", { children: g ? "—" : N.compact(C.bidDepth) })]
921
+ /* @__PURE__ */ z(D, { pattern: "lines" }),
922
+ /* @__PURE__ */ z(n, { series: "bid" }),
923
+ /* @__PURE__ */ z(n, { series: "ask" }),
924
+ /* @__PURE__ */ z(E, { series: "bid" }),
925
+ /* @__PURE__ */ z(E, { series: "ask" }),
926
+ O.mid === null ? null : /* @__PURE__ */ z(Ce, {
927
+ price: O.mid,
928
+ label: `Mid ${I.full(O.mid)}`
886
929
  }),
887
- /* @__PURE__ */ z("div", {
888
- "data-side": "ask",
889
- children: [/* @__PURE__ */ R("dt", { children: "Ask depth" }), /* @__PURE__ */ R("dd", { children: g ? "—" : N.compact(C.askDepth) })]
890
- })
930
+ /* @__PURE__ */ z(d, { labels: "fit" }),
931
+ /* @__PURE__ */ z(w, {})
891
932
  ]
892
- }),
893
- /* @__PURE__ */ R(f, {
894
- className: "lilt-card__chart",
895
- "aria-label": `${e} depth by price`,
896
- data: C.levels,
897
- x: {
898
- type: "number",
899
- accessor: (e) => e.price,
900
- format: k.full
901
- },
902
- y: {
903
- includeZero: !0,
904
- ticks: 3,
905
- format: N.compact
906
- },
907
- series: U,
908
- onSelectionChange: (e) => B(e?.row ?? null),
909
- motion: y,
910
- status: g ? "loading" : "ready",
911
- loadingStyle: _,
912
- children: /* @__PURE__ */ z(i, {
913
- height: c,
914
- axis: l,
915
- background: u,
916
- pill: p,
917
- margins: {
918
- top: 8,
919
- right: 4,
920
- bottom: 28,
921
- left: 4
922
- },
923
- children: [
924
- /* @__PURE__ */ R(D, { pattern: "lines" }),
925
- /* @__PURE__ */ R(n, { series: "bid" }),
926
- /* @__PURE__ */ R(n, { series: "ask" }),
927
- /* @__PURE__ */ R(E, { series: "bid" }),
928
- /* @__PURE__ */ R(E, { series: "ask" }),
929
- C.mid === null ? null : /* @__PURE__ */ R(we, {
930
- price: C.mid,
931
- label: `Mid ${k.full(C.mid)}`
932
- }),
933
- /* @__PURE__ */ R(d, { labels: "fit" }),
934
- /* @__PURE__ */ R(w, {})
935
- ]
936
- })
937
933
  })
938
- ]
934
+ })]
939
935
  });
940
936
  }
941
937
  //#endregion
942
938
  //#region src/finance/cards/portfolio-chart-card.tsx
943
- function $(e, t) {
939
+ function Ee(e, t) {
944
940
  if (!t) return null;
945
941
  let n = e[t];
946
942
  return typeof n == "number" && Number.isFinite(n) ? n : null;
947
943
  }
948
944
  function De(e, t, n) {
949
- let r = e.at(-1), i = $(r, t), a = $(r, n);
945
+ let r = e.at(-1), i = Ee(r, t), a = Ee(r, n);
950
946
  return i !== null && a ? i / a - 1 : void 0;
951
947
  }
952
948
  function Oe({ value: e, basis: t, label: r = "Value", drawdown: i = !0, drawdownHeight: a = 64, data: o, ranges: s, delta: c, locale: l = "en-US", ...u }) {
953
- let d = o ?? s?.[0]?.data ?? [], f = P(() => s?.map((n) => ({
949
+ let d = o ?? s?.[0]?.data ?? [], f = F(() => s?.map((n) => ({
954
950
  ...n,
955
951
  delta: n.delta ?? De(n.data, e, t)
956
952
  })), [
957
953
  s,
958
954
  e,
959
955
  t
960
- ]), p = P(() => v(l, {
956
+ ]), p = F(() => v(l, {
961
957
  style: "percent",
962
958
  minimumFractionDigits: 1,
963
959
  maximumFractionDigits: 1
964
- }).full, [l]), m = P(() => {
965
- let t = me(d.map((t) => $(t, e))).filter((e) => e !== null);
966
- return B(t) ?? null;
960
+ }).full, [l]), m = F(() => {
961
+ let t = pe(d.map((t) => Ee(t, e))).filter((e) => e !== null);
962
+ return V(t) ?? null;
967
963
  }, [d, e]);
968
- return /* @__PURE__ */ R(b, {
964
+ return /* @__PURE__ */ z(b, {
969
965
  ...u,
970
966
  data: o,
971
967
  ranges: f,
@@ -996,18 +992,18 @@ function Oe({ value: e, basis: t, label: r = "Value", drawdown: i = !0, drawdown
996
992
  area: { treatment: "fade" },
997
993
  curve: "monotone"
998
994
  },
999
- draw: (e) => e.map((e) => [/* @__PURE__ */ R(n, { series: e }, `area-${e}`), /* @__PURE__ */ R(E, { series: e }, e)])
995
+ draw: (e) => e.map((e) => [/* @__PURE__ */ z(n, { series: e }, `area-${e}`), /* @__PURE__ */ z(E, { series: e }, e)])
1000
996
  },
1001
997
  panes: i ? (t) => {
1002
- let r = me(t.data.map((t) => $(t, e))), i = new Map(t.data.map((e, t) => [e, r[t] ?? null]));
1003
- return /* @__PURE__ */ z(q, {
998
+ let r = pe(t.data.map((t) => Ee(t, e))), i = new Map(t.data.map((e, t) => [e, r[t] ?? null]));
999
+ return /* @__PURE__ */ B(J, {
1004
1000
  context: t,
1005
1001
  label: `${u.title} drawdown`,
1006
1002
  caption: "Drawdown",
1007
- readout: (e) => /* @__PURE__ */ z(L, { children: [/* @__PURE__ */ R("span", {
1003
+ readout: (e) => /* @__PURE__ */ B(R, { children: [/* @__PURE__ */ z("span", {
1008
1004
  className: "lilt-card__pane-value",
1009
1005
  children: i.get(e) == null ? "—" : p(i.get(e))
1010
- }), m === null ? null : /* @__PURE__ */ z("span", {
1006
+ }), m === null ? null : /* @__PURE__ */ B("span", {
1011
1007
  className: "lilt-card__pane-value",
1012
1008
  children: ["Max ", p(m)]
1013
1009
  })] }),
@@ -1028,7 +1024,7 @@ function Oe({ value: e, basis: t, label: r = "Value", drawdown: i = !0, drawdown
1028
1024
  line: { width: 1.5 },
1029
1025
  curve: "monotone"
1030
1026
  }],
1031
- children: [/* @__PURE__ */ R(n, { series: "drawdown" }), /* @__PURE__ */ R(E, { series: "drawdown" })]
1027
+ children: [/* @__PURE__ */ z(n, { series: "drawdown" }), /* @__PURE__ */ z(E, { series: "drawdown" })]
1032
1028
  });
1033
1029
  } : void 0
1034
1030
  });
@@ -1048,7 +1044,7 @@ function Ae(e, t) {
1048
1044
  }
1049
1045
  function je(e, t) {
1050
1046
  let n = e.map((e) => ({ ...e }));
1051
- for (let r of t) he(e.map((e) => ke(e, r))).forEach((e, t) => n[t][`__rebased${r}`] = e);
1047
+ for (let r of t) me(e.map((e) => ke(e, r))).forEach((e, t) => n[t][`__rebased${r}`] = e);
1052
1048
  return n;
1053
1049
  }
1054
1050
  var Me = {
@@ -1058,11 +1054,11 @@ var Me = {
1058
1054
  maximumFractionDigits: 2
1059
1055
  };
1060
1056
  function Ne({ price: e, symbol: t, name: r, icon: i, display: a = "area", versus: o, data: s, ranges: c, delta: l, valueFormat: u = Me, locale: d = "en-US", title: f, ...m }) {
1061
- let h = !!o?.length, g = P(() => [e, ...(o ?? []).map((e) => e.key)], [e, o]), _ = P(() => s ? h ? je(s, g) : s : void 0, [
1057
+ let h = !!o?.length, g = F(() => [e, ...(o ?? []).map((e) => e.key)], [e, o]), _ = F(() => s ? h ? je(s, g) : s : void 0, [
1062
1058
  s,
1063
1059
  h,
1064
1060
  g
1065
- ]), y = P(() => c?.map((t) => {
1061
+ ]), y = F(() => c?.map((t) => {
1066
1062
  let n = Ae(t.data, e);
1067
1063
  return {
1068
1064
  ...t,
@@ -1074,31 +1070,32 @@ function Ne({ price: e, symbol: t, name: r, icon: i, display: a = "area", versus
1074
1070
  h,
1075
1071
  g,
1076
1072
  e
1077
- ]), x = Ae(s ?? c?.[0]?.data ?? [], e), S = !x || x.last >= x.first, C = P(() => v(d, u).full, [d, JSON.stringify(u)]), w = P(() => v(d, {
1073
+ ]), x = Ae(s ?? c?.[0]?.data ?? [], e), S = !x || x.last >= x.first, C = F(() => v(d, u).full, [d, JSON.stringify(u)]), w = F(() => v(d, {
1078
1074
  style: "percent",
1079
1075
  minimumFractionDigits: 1,
1080
1076
  maximumFractionDigits: 1
1081
- }).full, [d]), T = (e) => h ? `__rebased${e}` : e, D = /* @__PURE__ */ z("span", {
1077
+ }).full, [d]), T = (e) => h ? `__rebased${e}` : e, D = /* @__PURE__ */ B("span", {
1082
1078
  className: "lilt-card__ticker",
1083
1079
  children: [
1084
- i ? /* @__PURE__ */ R("span", {
1080
+ i ? /* @__PURE__ */ z("span", {
1085
1081
  className: "lilt-card__ticker-icon",
1086
1082
  children: i
1087
1083
  }) : null,
1088
- /* @__PURE__ */ R("span", {
1084
+ /* @__PURE__ */ z("span", {
1089
1085
  className: "lilt-card__ticker-symbol",
1090
1086
  children: t ?? f
1091
1087
  }),
1092
- r ? /* @__PURE__ */ R("span", {
1088
+ r ? /* @__PURE__ */ z("span", {
1093
1089
  className: "lilt-card__ticker-name",
1094
1090
  children: r
1095
1091
  }) : null
1096
1092
  ]
1097
1093
  });
1098
- return /* @__PURE__ */ R(b, {
1094
+ return /* @__PURE__ */ z(b, {
1099
1095
  ...m,
1100
1096
  title: f,
1101
- heading: D,
1097
+ "aria-label": m["aria-label"] ?? f ?? t ?? r ?? "Price chart",
1098
+ heading: f || t || r || i ? D : void 0,
1102
1099
  data: _,
1103
1100
  ranges: y,
1104
1101
  delta: h ? void 0 : l ?? (s && x && x.first ? x.last / x.first - 1 : void 0),
@@ -1119,7 +1116,7 @@ function Ne({ price: e, symbol: t, name: r, icon: i, display: a = "area", versus
1119
1116
  series: [{
1120
1117
  key: T(e),
1121
1118
  label: t ?? f,
1122
- color: h ? void 0 : S ? V : H
1119
+ color: h ? void 0 : S ? H : U
1123
1120
  }, ...(o ?? []).map((e) => ({
1124
1121
  ...e,
1125
1122
  key: T(e.key)
@@ -1132,7 +1129,7 @@ function Ne({ price: e, symbol: t, name: r, icon: i, display: a = "area", versus
1132
1129
  area: { treatment: "fade" },
1133
1130
  curve: "monotone"
1134
1131
  } : { curve: "monotone" },
1135
- draw: (e) => e.map((e) => a === "area" && !h ? [/* @__PURE__ */ R(n, { series: e }, `area-${e}`), /* @__PURE__ */ R(E, { series: e }, e)] : /* @__PURE__ */ R(E, { series: e }, e))
1132
+ draw: (e) => e.map((e) => a === "area" && !h ? [/* @__PURE__ */ z(n, { series: e }, `area-${e}`), /* @__PURE__ */ z(E, { series: e }, e)] : /* @__PURE__ */ z(E, { series: e }, e))
1136
1133
  },
1137
1134
  bleed: m.bleed ?? !0
1138
1135
  });
@@ -1153,8 +1150,8 @@ function Pe(e, t, n) {
1153
1150
  }));
1154
1151
  }
1155
1152
  function Fe(e, t) {
1156
- let n = F(null), [r, i] = I(/* @__PURE__ */ new Set());
1157
- return N(() => {
1153
+ let n = I(null), [r, i] = L(/* @__PURE__ */ new Set());
1154
+ return P(() => {
1158
1155
  let r = new Map(e.map((e) => [`${e.side}:${e.price}`, e.size])), a = n.current;
1159
1156
  if (n.current = r, !t || !a) return;
1160
1157
  let o = new Set([...r].filter(([e, t]) => a.get(e) !== t).map(([e]) => e));
@@ -1164,102 +1161,103 @@ function Fe(e, t) {
1164
1161
  return () => window.clearTimeout(s);
1165
1162
  }, [e, t]), r;
1166
1163
  }
1167
- function Ie({ title: e, bids: t, asks: n, levels: i = 8, depth: a = !1, valueFormat: o = {
1164
+ function Ie({ title: e, header: t = !0, "aria-label": n = e || "Order book", bids: i, asks: a, levels: o = 8, depth: s = !1, valueFormat: c = {
1168
1165
  minimumFractionDigits: 2,
1169
1166
  maximumFractionDigits: 2
1170
- }, sizeFormat: s, locale: c = "en-US", flash: l = !0, surface: d, loading: f = !1, loadingStyle: p = "shimmer", motion: m, className: h, style: g }) {
1171
- let _ = k(m ?? "auto"), y = u(f, p), b = r(f, _), C = JSON.stringify(o), w = JSON.stringify(s ?? null), T = P(() => v(c, o).full, [c, C]), E = P(() => v(c, s).compact, [c, w]), D = P(() => v(c, {
1167
+ }, sizeFormat: l, locale: d = "en-US", flash: f = !0, surface: p, loading: m = !1, loadingStyle: h = "shimmer", motion: g, className: _, style: y }) {
1168
+ let b = k(g ?? "auto"), C = u(m, h), w = r(m, b), T = JSON.stringify(c), E = JSON.stringify(l ?? null), D = F(() => v(d, c).full, [d, T]), O = F(() => v(d, l).compact, [d, E]), A = F(() => v(d, {
1172
1169
  style: "percent",
1173
1170
  maximumFractionDigits: 3
1174
- }).full, [c]), O = P(() => Pe(t, "bid", i), [t, i]), A = P(() => Pe(n, "ask", i), [n, i]), ee = Fe(P(() => [...A, ...O], [A, O]), l && !_ && !f), te = Math.max(1, A.at(-1)?.total ?? 0, O.at(-1)?.total ?? 0), j = O[0]?.price, N = A[0]?.price, F = j !== void 0 && N !== void 0 ? {
1175
- value: N - j,
1176
- mid: (N + j) / 2
1177
- } : null, I = (e) => /* @__PURE__ */ z("tr", {
1171
+ }).full, [d]), j = F(() => Pe(i, "bid", o), [i, o]), M = F(() => Pe(a, "ask", o), [a, o]), ee = Fe(F(() => [...M, ...j], [M, j]), f && !b && !m), P = Math.max(1, M.at(-1)?.total ?? 0, j.at(-1)?.total ?? 0), I = j[0]?.price, L = M[0]?.price, R = I !== void 0 && L !== void 0 ? {
1172
+ value: L - I,
1173
+ mid: (L + I) / 2
1174
+ } : null, V = (e) => /* @__PURE__ */ B("tr", {
1178
1175
  className: "lilt-order-book__level",
1179
1176
  "data-side": e.side,
1180
1177
  "data-flash": ee.has(`${e.side}:${e.price}`) || void 0,
1181
- style: { "--lilt-depth": `${e.total / te * 100}%` },
1178
+ style: { "--lilt-depth": `${e.total / P * 100}%` },
1182
1179
  children: [
1183
- /* @__PURE__ */ z("th", {
1180
+ /* @__PURE__ */ B("th", {
1184
1181
  scope: "row",
1185
- children: [a ? /* @__PURE__ */ R("span", {
1182
+ children: [s ? /* @__PURE__ */ z("span", {
1186
1183
  className: "lilt-order-book__bar",
1187
1184
  "aria-hidden": "true"
1188
- }) : null, T(e.price)]
1185
+ }) : null, D(e.price)]
1189
1186
  }),
1190
- /* @__PURE__ */ R("td", { children: E(e.size) }),
1191
- /* @__PURE__ */ R("td", { children: E(e.total) })
1187
+ /* @__PURE__ */ z("td", { children: O(e.size) }),
1188
+ /* @__PURE__ */ z("td", { children: O(e.total) })
1192
1189
  ]
1193
- }, `${e.side}:${e.price}`), L = (e) => Array.from({ length: Math.max(1, Math.min(50, i)) }, (t, n) => /* @__PURE__ */ z("tr", {
1190
+ }, `${e.side}:${e.price}`), H = (e) => Array.from({ length: Math.max(1, Math.min(50, o)) }, (t, n) => /* @__PURE__ */ B("tr", {
1194
1191
  className: "lilt-order-book__placeholder",
1195
1192
  "aria-hidden": "true",
1196
1193
  children: [
1197
- /* @__PURE__ */ R("td", { children: /* @__PURE__ */ R(S, {
1194
+ /* @__PURE__ */ z("td", { children: /* @__PURE__ */ z(S, {
1198
1195
  width: `${86 - n * 4}%`,
1199
1196
  step: n
1200
1197
  }) }),
1201
- /* @__PURE__ */ R("td", { children: /* @__PURE__ */ R(S, {
1198
+ /* @__PURE__ */ z("td", { children: /* @__PURE__ */ z(S, {
1202
1199
  width: "60%",
1203
1200
  step: n
1204
1201
  }) }),
1205
- /* @__PURE__ */ R("td", { children: /* @__PURE__ */ R(S, {
1202
+ /* @__PURE__ */ z("td", { children: /* @__PURE__ */ z(S, {
1206
1203
  width: "72%",
1207
1204
  step: n
1208
1205
  }) })
1209
1206
  ]
1210
1207
  }, `${e}-${n}`));
1211
- return /* @__PURE__ */ R(M, {
1212
- "aria-label": e,
1213
- surface: d,
1214
- motion: m,
1215
- className: ["lilt-card--order-book", h].filter(Boolean).join(" "),
1216
- style: g,
1217
- children: /* @__PURE__ */ R(x, {
1218
- leaving: b,
1208
+ return /* @__PURE__ */ z(N, {
1209
+ "aria-label": n,
1210
+ surface: p,
1211
+ motion: g,
1212
+ className: ["lilt-card--order-book", _].filter(Boolean).join(" "),
1213
+ style: y,
1214
+ children: /* @__PURE__ */ z(x, {
1215
+ leaving: w,
1219
1216
  origin: "center",
1220
- children: /* @__PURE__ */ z("table", {
1221
- ref: y,
1222
- className: f ? "lilt-order-book lilt-skeleton" : "lilt-order-book",
1223
- "data-depth": a || void 0,
1224
- "data-style": f ? p : void 0,
1225
- "data-reduced-motion": _ || void 0,
1226
- "aria-busy": f,
1217
+ children: /* @__PURE__ */ B("table", {
1218
+ ref: C,
1219
+ className: m ? "lilt-order-book lilt-skeleton" : "lilt-order-book",
1220
+ "data-depth": s || void 0,
1221
+ "data-style": m ? h : void 0,
1222
+ "data-reduced-motion": b || void 0,
1223
+ "aria-busy": m,
1224
+ "aria-label": n,
1227
1225
  children: [
1228
- /* @__PURE__ */ R("caption", { children: e }),
1229
- /* @__PURE__ */ R("thead", { children: /* @__PURE__ */ z("tr", { children: [
1230
- /* @__PURE__ */ R("th", {
1226
+ t && e ? /* @__PURE__ */ z("caption", { children: e }) : null,
1227
+ /* @__PURE__ */ z("thead", { children: /* @__PURE__ */ B("tr", { children: [
1228
+ /* @__PURE__ */ z("th", {
1231
1229
  scope: "col",
1232
1230
  children: "Price"
1233
1231
  }),
1234
- /* @__PURE__ */ R("th", {
1232
+ /* @__PURE__ */ z("th", {
1235
1233
  scope: "col",
1236
1234
  children: "Size"
1237
1235
  }),
1238
- /* @__PURE__ */ R("th", {
1236
+ /* @__PURE__ */ z("th", {
1239
1237
  scope: "col",
1240
1238
  children: "Total"
1241
1239
  })
1242
1240
  ] }) }),
1243
- /* @__PURE__ */ R("tbody", {
1241
+ /* @__PURE__ */ z("tbody", {
1244
1242
  "aria-label": "Asks",
1245
- children: f ? L("ask") : [...A].reverse().map(I)
1243
+ children: m ? H("ask") : [...M].reverse().map(V)
1246
1244
  }),
1247
- /* @__PURE__ */ R("tbody", {
1245
+ /* @__PURE__ */ z("tbody", {
1248
1246
  "aria-label": "Spread",
1249
- children: /* @__PURE__ */ z("tr", {
1247
+ children: /* @__PURE__ */ B("tr", {
1250
1248
  className: "lilt-order-book__spread",
1251
- children: [/* @__PURE__ */ R("th", {
1249
+ children: [/* @__PURE__ */ z("th", {
1252
1250
  scope: "row",
1253
- children: f ? "—" : F ? T(F.mid) : "—"
1254
- }), /* @__PURE__ */ R("td", {
1251
+ children: m ? "—" : R ? D(R.mid) : "—"
1252
+ }), /* @__PURE__ */ z("td", {
1255
1253
  colSpan: 2,
1256
- children: f ? "Loading order book" : F ? `Spread ${T(F.value)} · ${D(F.value / F.mid)}` : "No spread"
1254
+ children: m ? "Loading order book" : R ? `Spread ${D(R.value)} · ${A(R.value / R.mid)}` : "No spread"
1257
1255
  })]
1258
1256
  })
1259
1257
  }),
1260
- /* @__PURE__ */ R("tbody", {
1258
+ /* @__PURE__ */ z("tbody", {
1261
1259
  "aria-label": "Bids",
1262
- children: f ? L("bid") : O.map(I)
1260
+ children: m ? H("bid") : j.map(V)
1263
1261
  })
1264
1262
  ]
1265
1263
  })
@@ -1267,4 +1265,4 @@ function Ie({ title: e, bids: t, asks: n, levels: i = 8, depth: a = !1, valueFor
1267
1265
  });
1268
1266
  }
1269
1267
  //#endregion
1270
- export { ae as Candles, ce as CandlestickChartCard, Ee as DepthChartCard, Ce as IndicatorChartCard, Ie as OrderBook, Oe as PortfolioChartCard, Ne as PriceChartCard, pe as bollinger, _e as depthLevels, me as drawdown, Z as ema, fe as macd, he as rebase, de as rsi, ue as sma };
1268
+ export { ie as Candles, se as CandlestickChartCard, Te as DepthChartCard, Se as IndicatorChartCard, Ie as OrderBook, Oe as PortfolioChartCard, Ne as PriceChartCard, fe as bollinger, ge as depthLevels, pe as drawdown, Q as ema, de as macd, me as rebase, ue as rsi, le as sma };