@lilt-ui/charts 0.12.2 → 0.13.1

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 (72) hide show
  1. package/CHANGELOG.md +288 -270
  2. package/README.md +21 -59
  3. package/dist/cards/arc-bridges-card.d.ts +17 -0
  4. package/dist/cards/area-chart-card.d.ts +1 -10
  5. package/dist/cards/block-city-card.d.ts +21 -0
  6. package/dist/cards/calendar-heatmap-card.d.ts +31 -1
  7. package/dist/cards/cartesian-card.d.ts +9 -27
  8. package/dist/cards/chart-card.d.ts +1 -12
  9. package/dist/cards/chord-loom-card.d.ts +17 -0
  10. package/dist/cards/circle-archipelago-card.d.ts +9 -0
  11. package/dist/cards/cluster-constellation-card.d.ts +16 -0
  12. package/dist/cards/comparison-forms.d.ts +30 -0
  13. package/dist/cards/composition-forms.d.ts +10 -0
  14. package/dist/cards/contour-islands-card.d.ts +25 -0
  15. package/dist/cards/density-contours.d.ts +3 -0
  16. package/dist/cards/distribution-forms.d.ts +37 -0
  17. package/dist/cards/event-helix-card.d.ts +26 -0
  18. package/dist/cards/helix-ribbons-card.d.ts +14 -0
  19. package/dist/cards/hex-city-card.d.ts +25 -0
  20. package/dist/cards/hierarchy-layouts.d.ts +21 -0
  21. package/dist/cards/horizon-folds-card.d.ts +10 -0
  22. package/dist/cards/horizontal-bar-chart-card.d.ts +1 -1
  23. package/dist/cards/intersection-towers-card.d.ts +9 -0
  24. package/dist/cards/line-chart-card.d.ts +4 -11
  25. package/dist/cards/link-readings.d.ts +26 -0
  26. package/dist/cards/marimekko-blocks-card.d.ts +10 -0
  27. package/dist/cards/observations-card.d.ts +45 -2
  28. package/dist/cards/parallel-ribbons-card.d.ts +27 -0
  29. package/dist/cards/prism-grid.d.ts +58 -0
  30. package/dist/cards/prism.d.ts +42 -0
  31. package/dist/cards/progress-forms.d.ts +21 -0
  32. package/dist/cards/rank-ribbons-card.d.ts +22 -0
  33. package/dist/cards/ridgeline-card.d.ts +24 -0
  34. package/dist/cards/scatter-chart-card.d.ts +19 -1
  35. package/dist/cards/sculpted-geometry.d.ts +18 -0
  36. package/dist/cards/skyline-card.d.ts +12 -0
  37. package/dist/cards/spatial-composition-layouts.d.ts +14 -0
  38. package/dist/cards/spatial-geometry.d.ts +34 -0
  39. package/dist/cards/spatial-hierarchy.d.ts +10 -0
  40. package/dist/cards/spatial-point-layouts.d.ts +16 -0
  41. package/dist/cards/spatial-series-layouts.d.ts +12 -0
  42. package/dist/cards/spiral-year-card.d.ts +17 -0
  43. package/dist/cards/sunburst-terraces-card.d.ts +10 -0
  44. package/dist/cards/ternary-prism-card.d.ts +13 -0
  45. package/dist/cards/terrain-card.d.ts +21 -0
  46. package/dist/cards/treemap-chart-card.d.ts +3 -1
  47. package/dist/cards/trend-forms.d.ts +11 -0
  48. package/dist/cards/voxel-cloud-card.d.ts +16 -0
  49. package/dist/cards/voxel-waffle-card.d.ts +18 -0
  50. package/dist/cards/wind-rose-card.d.ts +11 -0
  51. package/dist/engine/domains.d.ts +0 -1
  52. package/dist/finance.js +310 -311
  53. package/dist/index.d.ts +39 -4
  54. package/dist/index.js +8919 -2948
  55. package/dist/{skeleton-block-DIgcA9t6.js → skeleton-block-BPoUJvcR.js} +3596 -2971
  56. package/dist/styles.css +1 -1
  57. package/package.json +79 -85
  58. package/dist/report-context-CIUa6iiD.js +0 -1101
  59. package/dist/watch/board/board-state.d.ts +0 -72
  60. package/dist/watch/board/board-toast.d.ts +0 -19
  61. package/dist/watch/board/chart-board.d.ts +0 -93
  62. package/dist/watch/board/report-context.d.ts +0 -3
  63. package/dist/watch/engine/describe.d.ts +0 -9
  64. package/dist/watch/engine/explain.d.ts +0 -48
  65. package/dist/watch/engine/normal.d.ts +0 -114
  66. package/dist/watch/engine/robust.d.ts +0 -7
  67. package/dist/watch/engine/rules.d.ts +0 -22
  68. package/dist/watch/engine/status.d.ts +0 -39
  69. package/dist/watch/index.d.ts +0 -14
  70. package/dist/watch/normal-layer.d.ts +0 -18
  71. package/dist/watch.d.ts +0 -2
  72. package/dist/watch.js +0 -636
package/dist/finance.js CHANGED
@@ -1,6 +1,5 @@
1
1
  "use client";
2
- import { $ as e, A as t, C as n, I as r, J as i, L as a, P as o, Q as s, R as c, S as l, T as u, X as d, Z as f, _ as p, a as m, b as h, bt as g, dt as _, f as v, i as y, n as b, rt as x, st as S, t as C, u as w, v as T, w as E, x as D, y as O, z as k } from "./skeleton-block-DIgcA9t6.js";
3
- import { C as A, d as j, g as ee, h as M, p as N, u as P } from "./report-context-CIUa6iiD.js";
2
+ import { A as e, B as t, D as n, F as r, J as i, K as a, M as o, N as s, Nt as c, O as l, P as u, S as d, W as f, Y as p, _ as m, a as h, b as g, bt as _, d as v, dt as y, f as b, ft as x, g as S, gt as C, i as w, it as T, j as E, k as D, lt as O, m as k, n as A, q as j, st as ee, t as M, ut as N, wt as P } from "./skeleton-block-BPoUJvcR.js";
4
3
  import { useEffect as F, useMemo as I, useRef as L, useState as R } from "react";
5
4
  import { Fragment as z, jsx as B, jsxs as V } from "react/jsx-runtime";
6
5
  import { min as H } from "d3-array";
@@ -28,42 +27,42 @@ function te(e, t, n) {
28
27
  }
29
28
  }
30
29
  function ne(e, t, n, r, i = !1) {
31
- let a = Math.max(1, n.columnWidth), s = a / 2, c = G(e), l = G(n.y(t.high)), u = G(n.y(t.low));
30
+ let a = Math.max(1, n.columnWidth), o = a / 2, s = G(e), c = G(n.y(t.high)), l = G(n.y(t.low));
32
31
  if (r === "ohlc") {
33
- let r = G(n.y(t.open)), i = G(n.y(t.close)), a = G(Math.max(2, s));
32
+ let r = G(n.y(t.open)), i = G(n.y(t.close)), a = G(Math.max(2, o));
34
33
  return {
35
34
  body: null,
36
35
  hollow: null,
37
- stroke: `M${c},${l}V${u}M${G(e - a)},${r}H${c}M${c},${i}H${G(e + a)}`,
36
+ stroke: `M${s},${c}V${l}M${G(e - a)},${r}H${s}M${s},${i}H${G(e + a)}`,
38
37
  side: null,
39
38
  top: null
40
39
  };
41
40
  }
42
- let d = n.y(Math.max(t.open, t.close)), f = n.y(Math.min(t.open, t.close));
43
- if (f - d < 1) {
44
- let e = (d + f) / 2;
45
- d = e - .5, f = e + .5;
41
+ let u = n.y(Math.max(t.open, t.close)), d = n.y(Math.min(t.open, t.close));
42
+ if (d - u < 1) {
43
+ let e = (u + d) / 2;
44
+ u = e - .5, d = e + .5;
46
45
  }
47
- let p = r === "hollow" && t.up && a >= 3, m = p ? .5 : 0, h = i ? S(e, d, a, f - d) : null, g = h ? e - h.frontWidth / 2 : e - s, _ = o(g + m, d + m, Math.max(1, (h ? h.frontWidth : a) - m * 2), Math.max(1, f - d - m * 2), !h && a >= 6 ? 1.5 : 0), v = (l < d ? `M${c},${l}V${G(d)}` : "") + (u > f ? `M${c},${G(f)}V${u}` : "");
46
+ let p = r === "hollow" && t.up && a >= 3, m = p ? .5 : 0, h = i ? _(e, u, a, d - u) : null, g = h ? e - h.frontWidth / 2 : e - o, v = f(g + m, u + m, Math.max(1, (h ? h.frontWidth : a) - m * 2), Math.max(1, d - u - m * 2), !h && a >= 6 ? 1.5 : 0), y = (c < u ? `M${s},${c}V${G(u)}` : "") + (l > d ? `M${s},${G(d)}V${l}` : "");
48
47
  return {
49
- body: p ? null : _,
50
- hollow: p ? _ : null,
51
- stroke: v,
48
+ body: p ? null : v,
49
+ hollow: p ? v : null,
50
+ stroke: y,
52
51
  side: h?.side ?? null,
53
52
  top: h?.top ?? null
54
53
  };
55
54
  }
56
- function re(e, n, r, i, a, o, s = !1) {
57
- let c = new u(), l = new u(), d = new u(), f = new u(), p = new u();
58
- for (let { row: u, cx: m } of t(e, i)) {
59
- let e = K(u, n, r);
55
+ function re(e, n, i, a, o, s, c = !1) {
56
+ let l = new r(), u = new r(), d = new r(), f = new r(), p = new r();
57
+ for (let { row: r, cx: m } of t(e, a)) {
58
+ let e = K(r, n, i);
60
59
  if (!e) continue;
61
- let t = o(u, e), h = ne(m, e, i, a, s);
62
- h.side && f.add(t, h.side), h.top && p.add(t, h.top), h.body && c.add(t, h.body), h.hollow && l.add(t, h.hollow), h.stroke && d.add(t, h.stroke);
60
+ let t = s(r, e), h = ne(m, e, a, o, c);
61
+ 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);
63
62
  }
64
63
  return {
65
- bodies: c.entries(),
66
- hollow: l.entries(),
64
+ bodies: l.entries(),
65
+ hollow: u.entries(),
67
66
  strokes: d.entries(),
68
67
  sides: f.entries(),
69
68
  tops: p.entries()
@@ -72,7 +71,7 @@ function re(e, n, r, i, a, o, s = !1) {
72
71
  //#endregion
73
72
  //#region src/finance/candles.tsx
74
73
  function q(e, t, n) {
75
- return k(e, t, n.up ? U : W);
74
+ return p(e, t, n.up ? U : W);
76
75
  }
77
76
  function ie({ paths: e, display: t }) {
78
77
  let n = t === "ohlc" ? 1.5 : 1;
@@ -86,11 +85,11 @@ function ie({ paths: e, display: t }) {
86
85
  }, `stroke-${e}`)),
87
86
  e.sides.map(({ color: e, d: t }) => /* @__PURE__ */ B("path", {
88
87
  d: t,
89
- style: { fill: x(e).side }
88
+ style: { fill: C(e).side }
90
89
  }, `side-${e}`)),
91
90
  e.tops.map(({ color: e, d: t }) => /* @__PURE__ */ B("path", {
92
91
  d: t,
93
- style: { fill: x(e).top }
92
+ style: { fill: C(e).top }
94
93
  }, `top-${e}`)),
95
94
  e.bodies.map(({ color: e, d: t }) => /* @__PURE__ */ B("path", {
96
95
  d: t,
@@ -106,43 +105,43 @@ function ie({ paths: e, display: t }) {
106
105
  }, `hollow-${e}`))
107
106
  ] });
108
107
  }
109
- var ae = c(function({ series: t, open: n, high: r, low: i, display: a = "candle", depth: o = !1, className: s }) {
110
- let c = E("Candles", t, [
108
+ var ae = i(function({ series: e, open: t, high: n, low: r, display: i = "candle", depth: a = !1, className: o }) {
109
+ let s = u("Candles", e, [
110
+ t,
111
111
  n,
112
- r,
113
- i
114
- ], "column"), { snapshot: l, descriptor: u, scales: d } = c, f = I(() => {
115
- let e = {
116
- open: n,
117
- high: r,
118
- low: i
112
+ r
113
+ ], "column"), { snapshot: c, descriptor: l, scales: d } = s, f = I(() => {
114
+ let o = {
115
+ open: t,
116
+ high: n,
117
+ low: r
119
118
  };
120
- return te(l.data.rows, t, e), re(l.data.rows, t, e, d, a, (e, t) => q(u, e, t), o);
119
+ return te(c.data.rows, e, o), re(c.data.rows, e, o, d, i, (e, t) => q(l, e, t), a);
121
120
  }, [
122
- l,
121
+ c,
122
+ e,
123
123
  t,
124
124
  n,
125
125
  r,
126
- i,
127
126
  d,
128
- a,
129
- u,
130
- o
127
+ i,
128
+ l,
129
+ a
131
130
  ]);
132
131
  return /* @__PURE__ */ V("g", {
133
132
  "aria-hidden": "true",
134
- className: ["lilt-chart__candles", s].filter(Boolean).join(" "),
135
- "data-series": t,
136
- "data-display": a,
137
- clipPath: o ? `url(#${c.depthClip.id})` : c.clipPath,
138
- mask: c.mask,
133
+ className: ["lilt-chart__candles", o].filter(Boolean).join(" "),
134
+ "data-series": e,
135
+ "data-display": i,
136
+ clipPath: a ? `url(#${s.depthClip.id})` : s.clipPath,
137
+ mask: s.mask,
139
138
  style: {
140
- opacity: c.opacity,
141
- transition: c.reducedMotion ? void 0 : "opacity 160ms ease-out"
139
+ opacity: s.opacity,
140
+ transition: s.reducedMotion ? void 0 : "opacity 160ms ease-out"
142
141
  },
143
- children: [o ? /* @__PURE__ */ B(e, { clip: c.depthClip }) : null, /* @__PURE__ */ B(ie, {
142
+ children: [a ? /* @__PURE__ */ B(x, { clip: s.depthClip }) : null, /* @__PURE__ */ B(ie, {
144
143
  paths: f,
145
- display: a
144
+ display: i
146
145
  })]
147
146
  });
148
147
  }, {
@@ -157,7 +156,7 @@ var ae = c(function({ series: t, open: n, high: r, low: i, display: a = "candle"
157
156
  open: n + (r - n) * .28,
158
157
  close: r - (r - n) * .23,
159
158
  up: !0
160
- }, i, e.display ?? "candle", e.depth), c = x(o);
159
+ }, i, e.display ?? "candle", e.depth), c = C(o);
161
160
  return /* @__PURE__ */ V(z, { children: [
162
161
  s.stroke ? /* @__PURE__ */ B("path", {
163
162
  d: s.stroke,
@@ -195,14 +194,14 @@ var ae = c(function({ series: t, open: n, high: r, low: i, display: a = "candle"
195
194
  let r = K(t, e.series, e);
196
195
  return r ? q(n, t, r) : void 0;
197
196
  },
198
- highlight: (e, { row: t, snapshot: r, descriptor: i }) => {
199
- let a = K(t, e.series, e);
200
- if (!a) return null;
201
- let o = e.display ?? "candle", s = n(r, e.series), c = ne(s.x(t.x), a, s, o, e.depth), l = q(i, t, a);
197
+ highlight: (e, { row: t, snapshot: n, descriptor: r }) => {
198
+ let i = K(t, e.series, e);
199
+ if (!i) return null;
200
+ let a = e.display ?? "candle", o = s(n, e.series), c = ne(o.x(t.x), i, o, a, e.depth), l = q(r, t, i);
202
201
  return /* @__PURE__ */ B("g", {
203
202
  className: "lilt-chart__candle-highlight",
204
203
  children: /* @__PURE__ */ B(ie, {
205
- display: o,
204
+ display: a,
206
205
  paths: {
207
206
  bodies: c.body ? [{
208
207
  color: l,
@@ -231,43 +230,43 @@ var ae = c(function({ series: t, open: n, high: r, low: i, display: a = "candle"
231
230
  });
232
231
  //#endregion
233
232
  //#region src/finance/cards/pane.tsx
234
- function J({ context: e, label: t, caption: n, readout: r, series: i, height: o, y: s, bars: c, xAxis: l = !1, children: u }) {
235
- let [d, f] = R(null), m = d ?? e.data.at(-1) ?? null;
233
+ function J({ context: e, label: t, caption: r, readout: i, series: a, height: o, y: s, bars: l, xAxis: u = !1, children: d }) {
234
+ let [f, p] = R(null), m = f ?? e.data.at(-1) ?? null;
236
235
  return /* @__PURE__ */ V("div", {
237
236
  className: "lilt-card__pane",
238
- children: [n ? /* @__PURE__ */ V("span", {
237
+ children: [r ? /* @__PURE__ */ V("span", {
239
238
  className: "lilt-card__pane-caption",
240
239
  "aria-hidden": "true",
241
240
  children: [/* @__PURE__ */ B("span", {
242
241
  className: "lilt-card__pane-name",
243
- children: n
244
- }), r && m && !e.loading ? r(m) : null]
245
- }) : null, /* @__PURE__ */ B(g, {
242
+ children: r
243
+ }), i && m && !e.loading ? i(m) : null]
244
+ }) : null, /* @__PURE__ */ B(c, {
246
245
  className: "lilt-card__chart",
247
246
  "aria-label": t,
248
247
  data: e.data,
249
248
  x: e.x,
250
249
  y: s,
251
- series: i,
250
+ series: a,
252
251
  controller: e.controller,
253
- onSelectionChange: r ? (e) => f(e?.row ?? null) : void 0,
252
+ onSelectionChange: i ? (e) => p(e?.row ?? null) : void 0,
254
253
  motion: e.motion,
255
254
  status: e.loading ? "loading" : "ready",
256
255
  loadingStyle: e.loadingStyle,
257
- children: /* @__PURE__ */ V(a, {
256
+ children: /* @__PURE__ */ V(j, {
258
257
  height: o,
259
258
  margins: {
260
259
  ...e.margins,
261
260
  top: 6,
262
- bottom: l ? 28 : 4
261
+ bottom: u ? 28 : 4
263
262
  },
264
263
  axis: e.axis,
265
264
  pill: e.hoverStyle,
266
265
  axisInset: e.axisInset,
267
- slots: e.slots || !!c,
268
- bars: c,
266
+ slots: e.slots || !!l,
267
+ bars: l,
269
268
  background: "none",
270
- children: [u, l ? /* @__PURE__ */ B(p, { labels: "fit" }) : null]
269
+ children: [d, u ? /* @__PURE__ */ B(n, { labels: "fit" }) : null]
271
270
  })
272
271
  })]
273
272
  });
@@ -292,71 +291,71 @@ var se = {
292
291
  minimumFractionDigits: 2,
293
292
  maximumFractionDigits: 2
294
293
  };
295
- function ce({ open: e, high: t, low: n, 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: m = se, locale: g = "en-US", volumeHeight: _ = 64, ...v }) {
296
- let x = I(() => y(g, m).full, [g, JSON.stringify(m)]), S = I(() => y(g).compact, [g]), C = I(() => f?.map((t) => ({
297
- ...t,
298
- delta: t.delta ?? X(t.data, e, i)
294
+ function ce({ open: t, high: n, low: r, close: i, volume: o, display: s = "candle", depth: c = !1, scale: l = "linear", label: u = "Price", live: d = !1, data: f, ranges: p, delta: m, valueFormat: h = se, locale: g = "en-US", volumeHeight: _ = 64, ...v }) {
295
+ let y = I(() => w(g, h).full, [g, JSON.stringify(h)]), b = I(() => w(g).compact, [g]), x = I(() => p?.map((e) => ({
296
+ ...e,
297
+ delta: e.delta ?? X(e.data, t, i)
299
298
  })), [
300
- f,
301
- e,
299
+ p,
300
+ t,
302
301
  i
303
- ]), w = (X(d ?? f?.[0]?.data ?? [], e, i) ?? 0) >= 0, T = (t) => (Y(t, i) ?? 0) >= (Y(t, e) ?? 0), E = o === "area", O = {
302
+ ]), S = (X(f ?? p?.[0]?.data ?? [], t, i) ?? 0) >= 0, C = (e) => (Y(e, i) ?? 0) >= (Y(e, t) ?? 0), T = s === "area", D = {
304
303
  open: {
305
304
  label: "Open",
306
- accessor: (t) => Y(t, e)
305
+ accessor: (e) => Y(e, t)
307
306
  },
308
307
  high: {
309
308
  label: "High",
310
- accessor: (e) => Y(e, t)
309
+ accessor: (e) => Y(e, n)
311
310
  },
312
311
  low: {
313
312
  label: "Low",
314
- accessor: (e) => Y(e, n)
313
+ accessor: (e) => Y(e, r)
315
314
  }
316
315
  };
317
- return /* @__PURE__ */ B(b, {
316
+ return /* @__PURE__ */ B(A, {
318
317
  ...v,
319
- depth: s,
320
- data: d,
321
- ranges: C,
322
- delta: p ?? (d ? X(d, e, i) : void 0),
323
- valueFormat: m,
318
+ depth: c,
319
+ data: f,
320
+ ranges: x,
321
+ delta: m ?? (f ? X(f, t, i) : void 0),
322
+ valueFormat: h,
324
323
  locale: g,
325
324
  aggregate: "last",
326
325
  tiles: !1,
327
- live: u,
326
+ live: d,
328
327
  series: [{
329
328
  key: i,
330
- label: l,
331
- color: E ? w ? U : W : void 0
329
+ label: u,
330
+ color: T ? S ? U : W : void 0
332
331
  }],
333
332
  shape: {
334
333
  kind: "marks",
335
- id: `candles:${o}:${s}:${c}:${e}:${t}:${n}:${!!a}`,
334
+ id: `candles:${s}:${c}:${l}:${t}:${n}:${r}:${!!o}`,
336
335
  includeZero: !1,
337
- scale: c,
336
+ scale: l,
338
337
  slots: !0,
339
- xAxis: !a,
340
- series: () => E ? {
341
- fields: O,
338
+ xAxis: !o,
339
+ series: () => T ? {
340
+ fields: D,
342
341
  area: { treatment: "fade" },
343
342
  curve: "linear"
344
343
  } : {
345
- fields: O,
344
+ fields: D,
346
345
  line: { showInspectionPoint: !1 }
347
346
  },
348
- describe: oe(x),
349
- draw: (e) => e.map((e) => E ? [/* @__PURE__ */ B(r, { series: e }, `area-${e}`), /* @__PURE__ */ B(D, { series: e }, `line-${e}`)] : /* @__PURE__ */ B(ae, {
347
+ describe: oe(y),
348
+ draw: (e) => e.map((e) => T ? [/* @__PURE__ */ B(a, { series: e }, `area-${e}`), /* @__PURE__ */ B(E, { series: e }, `line-${e}`)] : /* @__PURE__ */ B(ae, {
350
349
  series: e,
351
350
  open: "open",
352
351
  high: "high",
353
352
  low: "low",
354
- display: o,
355
- depth: s
353
+ display: s,
354
+ depth: c
356
355
  }, e))
357
356
  },
358
- panes: a ? (e) => /* @__PURE__ */ B(J, {
359
- context: e,
357
+ panes: o ? (t) => /* @__PURE__ */ B(J, {
358
+ context: t,
360
359
  label: `${v.title} volume`,
361
360
  caption: "Volume",
362
361
  height: _,
@@ -364,18 +363,18 @@ function ce({ open: e, high: t, low: n, close: i, volume: a, display: o = "candl
364
363
  y: {
365
364
  includeZero: !0,
366
365
  ticks: 2,
367
- format: S
366
+ format: b
368
367
  },
369
368
  bars: { series: ["volume"] },
370
369
  series: [{
371
370
  id: "volume",
372
371
  label: "Volume",
373
- accessor: (e) => Y(e, a),
374
- formatValue: S,
375
- 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
+ accessor: (e) => Y(e, o),
373
+ formatValue: b,
374
+ colorAt: (e) => C(e) ? "color-mix(in srgb, var(--lilt-candle-up) 42%, transparent)" : "color-mix(in srgb, var(--lilt-candle-down) 42%, transparent)",
376
375
  bar: { radius: 1 }
377
376
  }],
378
- children: /* @__PURE__ */ B(h, { series: "volume" })
377
+ children: /* @__PURE__ */ B(e, { series: "volume" })
379
378
  }) : void 0
380
379
  });
381
380
  }
@@ -562,57 +561,57 @@ var xe = {
562
561
  "var(--lilt-series-3)",
563
562
  "var(--lilt-series-5)"
564
563
  ];
565
- function Ce({ close: e, open: t, high: n, low: r, volume: i, display: a, overlays: o = [], panes: s = ["rsi", "macd"], label: c = "Price", scale: u = "linear", live: d = !1, data: f, ranges: p, delta: m, valueFormat: g = xe, locale: _ = "en-US", paneHeight: x = 72, ...S }) {
566
- let C = !!(t && n && r), T = a ?? (C ? "candle" : "line");
567
- if (T !== "line" && !C) throw Error("Lilt IndicatorChartCard candles need open, high and low fields.");
568
- let E = JSON.stringify(o), O = JSON.stringify(s), k = I(() => ve(o), [E]), A = I(() => ye(s), [O]);
569
- if (A.some((e) => e.kind === "volume") && !i) throw Error("Lilt IndicatorChartCard needs a `volume` field for a volume pane.");
570
- let j = I(() => f ? be(f, e, k, A) : void 0, [
571
- f,
572
- e,
573
- k,
574
- A
575
- ]), ee = I(() => p?.map((n) => ({
576
- ...n,
577
- data: be(n.data, e, k, A),
578
- delta: n.delta ?? (t ? X(n.data, t, e) : void 0)
564
+ function Ce({ close: t, open: n, high: r, low: i, volume: a, display: s, overlays: c = [], panes: l = ["rsi", "macd"], label: u = "Price", scale: f = "linear", live: p = !1, data: m, ranges: h, delta: _, valueFormat: v = xe, locale: y = "en-US", paneHeight: b = 72, ...x }) {
565
+ let S = !!(n && r && i), C = s ?? (S ? "candle" : "line");
566
+ if (C !== "line" && !S) throw Error("Lilt IndicatorChartCard candles need open, high and low fields.");
567
+ let T = JSON.stringify(c), D = JSON.stringify(l), O = I(() => ve(c), [T]), k = I(() => ye(l), [D]);
568
+ if (k.some((e) => e.kind === "volume") && !a) throw Error("Lilt IndicatorChartCard needs a `volume` field for a volume pane.");
569
+ let j = I(() => m ? be(m, t, O, k) : void 0, [
570
+ m,
571
+ t,
572
+ O,
573
+ k
574
+ ]), ee = I(() => h?.map((e) => ({
575
+ ...e,
576
+ data: be(e.data, t, O, k),
577
+ delta: e.delta ?? (n ? X(e.data, n, t) : void 0)
579
578
  })), [
580
- p,
581
- e,
579
+ h,
582
580
  t,
583
- k,
584
- A
585
- ]), M = I(() => y(_, g).full, [_, JSON.stringify(g)]), N = I(() => y(_, { maximumFractionDigits: 2 }).full, [_]), P = I(() => y(_).compact, [_]), F = C ? {
581
+ n,
582
+ O,
583
+ k
584
+ ]), M = I(() => w(y, v).full, [y, JSON.stringify(v)]), N = I(() => w(y, { maximumFractionDigits: 2 }).full, [y]), P = I(() => w(y).compact, [y]), F = S ? {
586
585
  open: {
587
586
  label: "Open",
588
- accessor: (e) => $(e, t)
587
+ accessor: (e) => $(e, n)
589
588
  },
590
589
  high: {
591
590
  label: "High",
592
- accessor: (e) => $(e, n)
591
+ accessor: (e) => $(e, r)
593
592
  },
594
593
  low: {
595
594
  label: "Low",
596
- accessor: (e) => $(e, r)
595
+ accessor: (e) => $(e, i)
597
596
  }
598
- } : void 0, L = new Map(k.map((e) => [e.id, e])), R = f?.length ? $(f[0], e) : null, H = f?.length ? $(f.at(-1), e) : null, G = R === null || H === null || H >= R, K = A.at(-1)?.id, te = (n, r) => {
599
- let a = n.id === K, o = (e) => (t) => $(t, e), s = (e, t, n) => {
597
+ } : void 0, L = new Map(O.map((e) => [e.id, e])), R = m?.length ? $(m[0], t) : null, H = m?.length ? $(m.at(-1), t) : null, G = R === null || H === null || H >= R, K = k.at(-1)?.id, te = (r, i) => {
598
+ let o = r.id === K, s = (e) => (t) => $(t, e), c = (e, t, n) => {
600
599
  let r = $(e, t);
601
600
  return /* @__PURE__ */ V("span", {
602
601
  className: "lilt-card__pane-value",
603
602
  children: [n ? `${n} ` : "", r === null ? "—" : N(r)]
604
603
  }, t);
605
604
  };
606
- if (n.kind === "volume") return /* @__PURE__ */ B(J, {
607
- context: r,
608
- label: `${S.title} volume`,
605
+ if (r.kind === "volume") return /* @__PURE__ */ B(J, {
606
+ context: i,
607
+ label: `${x.title} volume`,
609
608
  caption: "Volume",
610
609
  readout: (e) => /* @__PURE__ */ B("span", {
611
610
  className: "lilt-card__pane-value",
612
- children: $(e, i) === null ? "—" : P($(e, i))
611
+ children: $(e, a) === null ? "—" : P($(e, a))
613
612
  }),
614
- height: x,
615
- xAxis: a,
613
+ height: b,
614
+ xAxis: o,
616
615
  y: {
617
616
  includeZero: !0,
618
617
  ticks: 2,
@@ -622,92 +621,92 @@ function Ce({ close: e, open: t, high: n, low: r, volume: i, display: a, overlay
622
621
  series: [{
623
622
  id: "volume",
624
623
  label: "Volume",
625
- accessor: o(i),
624
+ accessor: s(a),
626
625
  formatValue: P,
627
- 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)",
626
+ colorAt: (e) => ($(e, t) ?? 0) >= ($(e, n) ?? $(e, t) ?? 0) ? "color-mix(in srgb, var(--lilt-candle-up) 42%, transparent)" : "color-mix(in srgb, var(--lilt-candle-down) 42%, transparent)",
628
627
  bar: { radius: 1 }
629
628
  }],
630
- children: /* @__PURE__ */ B(h, { series: "volume" })
631
- }, n.id);
632
- if (n.kind === "rsi") return /* @__PURE__ */ V(J, {
633
- context: r,
634
- label: `${S.title} RSI ${n.period}`,
635
- caption: `RSI ${n.period}`,
636
- readout: (e) => s(e, n.id),
637
- height: x,
638
- xAxis: a,
629
+ children: /* @__PURE__ */ B(e, { series: "volume" })
630
+ }, r.id);
631
+ if (r.kind === "rsi") return /* @__PURE__ */ V(J, {
632
+ context: i,
633
+ label: `${x.title} RSI ${r.period}`,
634
+ caption: `RSI ${r.period}`,
635
+ readout: (e) => c(e, r.id),
636
+ height: b,
637
+ xAxis: o,
639
638
  y: {
640
639
  domain: [0, 100],
641
640
  ticks: 2,
642
641
  format: (e) => String(Math.round(e))
643
642
  },
644
643
  series: [{
645
- id: n.id,
646
- label: `RSI ${n.period}`,
647
- accessor: o(n.id),
644
+ id: r.id,
645
+ label: `RSI ${r.period}`,
646
+ accessor: s(r.id),
648
647
  color: "var(--lilt-series-1)",
649
648
  formatValue: N,
650
649
  line: {
651
650
  width: 1.5,
652
- depth: S.depth
651
+ depth: x.depth
653
652
  }
654
653
  }],
655
654
  children: [
656
- /* @__PURE__ */ B(v, {
655
+ /* @__PURE__ */ B(d, {
657
656
  axis: "y",
658
657
  from: 30,
659
658
  to: 70,
660
659
  color: "var(--lilt-series-1)"
661
660
  }),
662
- /* @__PURE__ */ B(w, {
661
+ /* @__PURE__ */ B(g, {
663
662
  value: 70,
664
663
  color: "var(--lilt-muted)"
665
664
  }),
666
- /* @__PURE__ */ B(w, {
665
+ /* @__PURE__ */ B(g, {
667
666
  value: 30,
668
667
  color: "var(--lilt-muted)"
669
668
  }),
670
- /* @__PURE__ */ B(D, { series: n.id })
669
+ /* @__PURE__ */ B(E, { series: r.id })
671
670
  ]
672
- }, n.id);
673
- let c = `${n.id}Macd`, l = `${n.id}Signal`, u = `${n.id}Histogram`;
671
+ }, r.id);
672
+ let l = `${r.id}Macd`, u = `${r.id}Signal`, f = `${r.id}Histogram`;
674
673
  return /* @__PURE__ */ V(J, {
675
- context: r,
676
- label: `${S.title} MACD`,
677
- caption: `MACD ${n.fast} · ${n.slow} · ${n.signal}`,
678
- readout: (e) => [s(e, c), s(e, l, "Signal")],
679
- height: x,
680
- xAxis: a,
674
+ context: i,
675
+ label: `${x.title} MACD`,
676
+ caption: `MACD ${r.fast} · ${r.slow} · ${r.signal}`,
677
+ readout: (e) => [c(e, l), c(e, u, "Signal")],
678
+ height: b,
679
+ xAxis: o,
681
680
  y: {
682
681
  includeZero: !0,
683
682
  ticks: 2,
684
683
  format: N
685
684
  },
686
- bars: { series: [u] },
685
+ bars: { series: [f] },
687
686
  series: [
688
687
  {
689
- id: u,
688
+ id: f,
690
689
  label: "Histogram",
691
- accessor: o(u),
690
+ accessor: s(f),
692
691
  formatValue: N,
693
- 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)",
692
+ colorAt: (e) => ($(e, f) ?? 0) >= 0 ? "color-mix(in srgb, var(--lilt-candle-up) 55%, transparent)" : "color-mix(in srgb, var(--lilt-candle-down) 55%, transparent)",
694
693
  bar: { radius: 1 }
695
694
  },
696
695
  {
697
- id: c,
696
+ id: l,
698
697
  label: "MACD",
699
- accessor: o(c),
698
+ accessor: s(l),
700
699
  color: "var(--lilt-series-4)",
701
700
  formatValue: N,
702
701
  line: {
703
702
  width: 1.5,
704
- depth: S.depth
703
+ depth: x.depth
705
704
  }
706
705
  },
707
706
  {
708
- id: l,
707
+ id: u,
709
708
  label: "Signal",
710
- accessor: o(l),
709
+ accessor: s(u),
711
710
  color: "var(--lilt-series-3)",
712
711
  formatValue: N,
713
712
  line: {
@@ -717,40 +716,40 @@ function Ce({ close: e, open: t, high: n, low: r, volume: i, display: a, overlay
717
716
  }
718
717
  ],
719
718
  children: [
720
- /* @__PURE__ */ B(h, { series: u }),
721
- /* @__PURE__ */ B(D, { series: c }),
722
- /* @__PURE__ */ B(D, { series: l })
719
+ /* @__PURE__ */ B(e, { series: f }),
720
+ /* @__PURE__ */ B(E, { series: l }),
721
+ /* @__PURE__ */ B(E, { series: u })
723
722
  ]
724
- }, n.id);
723
+ }, r.id);
725
724
  };
726
- return /* @__PURE__ */ B(b, {
727
- ...S,
725
+ return /* @__PURE__ */ B(A, {
726
+ ...x,
728
727
  data: j,
729
728
  ranges: ee,
730
- delta: m ?? (f && t ? X(f, t, e) : void 0),
731
- valueFormat: g,
732
- locale: _,
729
+ delta: _ ?? (m && n ? X(m, n, t) : void 0),
730
+ valueFormat: v,
731
+ locale: y,
733
732
  aggregate: "last",
734
- headlineSeries: e,
735
- pillSeries: e,
733
+ headlineSeries: t,
734
+ pillSeries: t,
736
735
  tiles: !1,
737
- live: d,
736
+ live: p,
738
737
  series: [{
739
- key: e,
740
- label: c,
741
- color: T === "line" ? G ? U : W : void 0
742
- }, ...k.map((e, t) => ({
738
+ key: t,
739
+ label: u,
740
+ color: C === "line" ? G ? U : W : void 0
741
+ }, ...O.map((e, t) => ({
743
742
  key: e.id,
744
743
  label: e.label,
745
744
  color: Se[t % Se.length]
746
745
  }))],
747
746
  shape: {
748
747
  kind: "marks",
749
- id: `indicator:${T}:${u}:${t}:${n}:${r}:${E}:${O}`,
748
+ id: `indicator:${C}:${f}:${n}:${r}:${i}:${T}:${D}`,
750
749
  includeZero: !1,
751
- scale: u,
750
+ scale: f,
752
751
  slots: !0,
753
- xAxis: A.length === 0,
752
+ xAxis: k.length === 0,
754
753
  series: (e) => {
755
754
  let t = L.get(e);
756
755
  return t ? {
@@ -758,7 +757,7 @@ function Ce({ close: e, open: t, high: n, low: r, volume: i, display: a, overlay
758
757
  line: {
759
758
  width: 1.5,
760
759
  showInspectionPoint: !1,
761
- depth: S.depth
760
+ depth: x.depth
762
761
  },
763
762
  ...t.kind === "bollinger" ? { fields: {
764
763
  upper: {
@@ -770,39 +769,39 @@ function Ce({ close: e, open: t, high: n, low: r, volume: i, display: a, overlay
770
769
  accessor: (e) => $(e, `${t.id}Lower`)
771
770
  }
772
771
  } } : {}
773
- } : T === "line" ? {
772
+ } : C === "line" ? {
774
773
  fields: F,
775
774
  curve: "linear",
776
775
  line: {
777
776
  width: 2,
778
- depth: S.depth
777
+ depth: x.depth
779
778
  }
780
779
  } : { fields: F };
781
780
  },
782
- describe: C ? oe(M) : void 0,
781
+ describe: S ? oe(M) : void 0,
783
782
  draw: (e) => e.map((e) => {
784
783
  let t = L.get(e);
785
- return t ? t.kind === "bollinger" ? [/* @__PURE__ */ B(l, {
784
+ return t ? t.kind === "bollinger" ? [/* @__PURE__ */ B(o, {
786
785
  series: e,
787
786
  lower: "lower",
788
787
  upper: "upper"
789
- }, `band-${e}`), /* @__PURE__ */ B(D, { series: e }, `line-${e}`)] : /* @__PURE__ */ B(D, { series: e }, e) : T === "line" ? /* @__PURE__ */ B(D, { series: e }, e) : /* @__PURE__ */ B(ae, {
788
+ }, `band-${e}`), /* @__PURE__ */ B(E, { series: e }, `line-${e}`)] : /* @__PURE__ */ B(E, { series: e }, e) : C === "line" ? /* @__PURE__ */ B(E, { series: e }, e) : /* @__PURE__ */ B(ae, {
790
789
  series: e,
791
790
  open: "open",
792
791
  high: "high",
793
792
  low: "low",
794
- display: T,
795
- depth: S.depth
793
+ display: C,
794
+ depth: x.depth
796
795
  }, e);
797
796
  })
798
797
  },
799
- panes: A.length ? (e) => /* @__PURE__ */ B(z, { children: A.map((t) => te(t, e)) }) : void 0
798
+ panes: k.length ? (e) => /* @__PURE__ */ B(z, { children: k.map((t) => te(t, e)) }) : void 0
800
799
  });
801
800
  }
802
801
  //#endregion
803
802
  //#region src/finance/cards/depth-chart-card.tsx
804
803
  function we({ price: e, label: t }) {
805
- let { snapshot: n } = _();
804
+ let { snapshot: n } = P();
806
805
  if (e < n.xDomain[0] || e > n.xDomain[1]) return null;
807
806
  let r = n.xToPixel(e);
808
807
  return /* @__PURE__ */ V("g", {
@@ -829,11 +828,11 @@ var Te = {
829
828
  minimumFractionDigits: 2,
830
829
  maximumFractionDigits: 2
831
830
  };
832
- function Ee({ title: e, header: t = !0, "aria-label": n = e || "Depth chart", bids: i, asks: o, valueFormat: s = Te, sizeFormat: c, locale: l = "en-US", height: u = 220, axis: d = "minimal", background: f = "dots", hoverStyle: m = "soft", surface: h, numberStyle: _, loading: v = !1, loadingStyle: b = "shimmer", empty: x = "dots", motion: S, className: C, style: w, depth: E = !1 }) {
833
- let k = I(() => _e(i, o), [i, o]), A = JSON.stringify(s), F = JSON.stringify(c ?? null), L = I(() => y(l, s), [l, A]), H = I(() => y(l, c), [l, F]), G = I(() => y(l, {
831
+ function Ee({ title: e, header: t = !0, "aria-label": r = e || "Depth chart", bids: i, asks: o, valueFormat: s = Te, sizeFormat: u, locale: d = "en-US", height: f = 220, axis: p = "minimal", background: h = "dots", hoverStyle: g = "soft", surface: _, numberStyle: y, loading: x = !1, loadingStyle: C = "shimmer", empty: T = "dots", motion: O, className: A, style: ee, depth: M = !1 }) {
832
+ let N = I(() => _e(i, o), [i, o]), P = JSON.stringify(s), F = JSON.stringify(u ?? null), L = I(() => w(d, s), [d, P]), H = I(() => w(d, u), [d, F]), G = I(() => w(d, {
834
833
  style: "percent",
835
834
  maximumFractionDigits: 3
836
- }).full, [l]), [K, te] = R(null), ne = I(() => [{
835
+ }).full, [d]), [K, te] = R(null), ne = I(() => [{
837
836
  id: "bid",
838
837
  label: "Bids",
839
838
  accessor: (e) => e.bid,
@@ -842,7 +841,7 @@ function Ee({ title: e, header: t = !0, "aria-label": n = e || "Depth chart", bi
842
841
  area: { treatment: "fade" },
843
842
  line: {
844
843
  width: 1.5,
845
- depth: E
844
+ depth: M
846
845
  },
847
846
  formatValue: H.full
848
847
  }, {
@@ -854,47 +853,47 @@ function Ee({ title: e, header: t = !0, "aria-label": n = e || "Depth chart", bi
854
853
  area: { treatment: "fade" },
855
854
  line: {
856
855
  width: 1.5,
857
- depth: E
856
+ depth: M
858
857
  },
859
858
  formatValue: H.full
860
- }], [H, E]), re = k.spread !== null && k.mid ? `${L.full(k.spread)} (${G(k.spread / k.mid)})` : "—", q = K ? K.bid ?? K.ask : null;
861
- return /* @__PURE__ */ V(P, {
862
- "aria-label": n,
863
- surface: h,
864
- numberStyle: _,
865
- motion: S,
866
- className: ["lilt-card--depth", C].filter(Boolean).join(" "),
867
- style: w,
868
- children: [t ? /* @__PURE__ */ V(z, { children: [/* @__PURE__ */ V(N, { children: [e ? /* @__PURE__ */ B(M, { children: e }) : null, /* @__PURE__ */ B(ee, {
869
- value: k.mid,
859
+ }], [H, M]), re = N.spread !== null && N.mid ? `${L.full(N.spread)} (${G(N.spread / N.mid)})` : "—", q = K ? K.bid ?? K.ask : null;
860
+ return /* @__PURE__ */ V(v, {
861
+ "aria-label": r,
862
+ surface: _,
863
+ numberStyle: y,
864
+ motion: O,
865
+ className: ["lilt-card--depth", A].filter(Boolean).join(" "),
866
+ style: ee,
867
+ children: [t ? /* @__PURE__ */ V(z, { children: [/* @__PURE__ */ V(k, { children: [e ? /* @__PURE__ */ B(S, { children: e }) : null, /* @__PURE__ */ B(m, {
868
+ value: N.mid,
870
869
  format: L.full,
871
- loading: v,
872
- motion: S,
873
- children: v ? null : K && q !== null ? /* @__PURE__ */ V(j, { children: [
870
+ loading: x,
871
+ motion: O,
872
+ children: x ? null : K && q !== null ? /* @__PURE__ */ V(b, { children: [
874
873
  H.full(q),
875
874
  " ",
876
875
  K.side === "bid" ? "bid" : "ask",
877
876
  " depth at",
878
877
  " ",
879
878
  L.full(K.price)
880
- ] }) : /* @__PURE__ */ B(j, { children: "Mid price" })
879
+ ] }) : /* @__PURE__ */ B(b, { children: "Mid price" })
881
880
  })] }), /* @__PURE__ */ V("dl", {
882
881
  className: "lilt-card__stats",
883
882
  children: [
884
- /* @__PURE__ */ V("div", { children: [/* @__PURE__ */ B("dt", { children: "Spread" }), /* @__PURE__ */ B("dd", { children: v ? "—" : re })] }),
883
+ /* @__PURE__ */ V("div", { children: [/* @__PURE__ */ B("dt", { children: "Spread" }), /* @__PURE__ */ B("dd", { children: x ? "—" : re })] }),
885
884
  /* @__PURE__ */ V("div", {
886
885
  "data-side": "bid",
887
- children: [/* @__PURE__ */ B("dt", { children: "Bid depth" }), /* @__PURE__ */ B("dd", { children: v ? "—" : H.compact(k.bidDepth) })]
886
+ children: [/* @__PURE__ */ B("dt", { children: "Bid depth" }), /* @__PURE__ */ B("dd", { children: x ? "—" : H.compact(N.bidDepth) })]
888
887
  }),
889
888
  /* @__PURE__ */ V("div", {
890
889
  "data-side": "ask",
891
- children: [/* @__PURE__ */ B("dt", { children: "Ask depth" }), /* @__PURE__ */ B("dd", { children: v ? "—" : H.compact(k.askDepth) })]
890
+ children: [/* @__PURE__ */ B("dt", { children: "Ask depth" }), /* @__PURE__ */ B("dd", { children: x ? "—" : H.compact(N.askDepth) })]
892
891
  })
893
892
  ]
894
- })] }) : null, /* @__PURE__ */ B(g, {
893
+ })] }) : null, /* @__PURE__ */ B(c, {
895
894
  className: "lilt-card__chart",
896
- "aria-label": `${n} depth by price`,
897
- data: k.levels,
895
+ "aria-label": `${r} depth by price`,
896
+ data: N.levels,
898
897
  x: {
899
898
  type: "number",
900
899
  accessor: (e) => e.price,
@@ -907,15 +906,15 @@ function Ee({ title: e, header: t = !0, "aria-label": n = e || "Depth chart", bi
907
906
  },
908
907
  series: ne,
909
908
  onSelectionChange: (e) => te(e?.row ?? null),
910
- motion: S,
911
- status: v ? "loading" : "ready",
912
- loadingStyle: b,
913
- empty: x,
914
- children: /* @__PURE__ */ V(a, {
915
- height: u,
916
- axis: d,
917
- background: f,
918
- pill: m,
909
+ motion: O,
910
+ status: x ? "loading" : "ready",
911
+ loadingStyle: C,
912
+ empty: T,
913
+ children: /* @__PURE__ */ V(j, {
914
+ height: f,
915
+ axis: p,
916
+ background: h,
917
+ pill: g,
919
918
  margins: {
920
919
  top: 8,
921
920
  right: 4,
@@ -923,17 +922,17 @@ function Ee({ title: e, header: t = !0, "aria-label": n = e || "Depth chart", bi
923
922
  left: 4
924
923
  },
925
924
  children: [
926
- /* @__PURE__ */ B(O, { pattern: "lines" }),
927
- /* @__PURE__ */ B(r, { series: "bid" }),
928
- /* @__PURE__ */ B(r, { series: "ask" }),
929
- /* @__PURE__ */ B(D, { series: "bid" }),
930
- /* @__PURE__ */ B(D, { series: "ask" }),
931
- k.mid === null ? null : /* @__PURE__ */ B(we, {
932
- price: k.mid,
933
- label: `Mid ${L.full(k.mid)}`
925
+ /* @__PURE__ */ B(D, { pattern: "lines" }),
926
+ /* @__PURE__ */ B(a, { series: "bid" }),
927
+ /* @__PURE__ */ B(a, { series: "ask" }),
928
+ /* @__PURE__ */ B(E, { series: "bid" }),
929
+ /* @__PURE__ */ B(E, { series: "ask" }),
930
+ N.mid === null ? null : /* @__PURE__ */ B(we, {
931
+ price: N.mid,
932
+ label: `Mid ${L.full(N.mid)}`
934
933
  }),
935
- /* @__PURE__ */ B(p, { labels: "fit" }),
936
- /* @__PURE__ */ B(T, {})
934
+ /* @__PURE__ */ B(n, { labels: "fit" }),
935
+ /* @__PURE__ */ B(l, {})
937
936
  ]
938
937
  })
939
938
  })]
@@ -950,7 +949,7 @@ function Oe(e, t, n) {
950
949
  let r = e.at(-1), i = De(r, t), a = De(r, n);
951
950
  return i !== null && a ? i / a - 1 : void 0;
952
951
  }
953
- function ke({ value: e, basis: t, label: n = "Value", drawdown: i = !0, drawdownHeight: a = 64, data: o, ranges: s, delta: c, locale: l = "en-US", ...u }) {
952
+ function ke({ value: e, basis: t, label: n = "Value", drawdown: r = !0, drawdownHeight: i = 64, data: o, ranges: s, delta: c, locale: l = "en-US", ...u }) {
954
953
  let d = o ?? s?.[0]?.data ?? [], f = I(() => s?.map((n) => ({
955
954
  ...n,
956
955
  delta: n.delta ?? Oe(n.data, e, t)
@@ -958,7 +957,7 @@ function ke({ value: e, basis: t, label: n = "Value", drawdown: i = !0, drawdown
958
957
  s,
959
958
  e,
960
959
  t
961
- ]), p = I(() => y(l, {
960
+ ]), p = I(() => w(l, {
962
961
  style: "percent",
963
962
  minimumFractionDigits: 1,
964
963
  maximumFractionDigits: 1
@@ -966,7 +965,7 @@ function ke({ value: e, basis: t, label: n = "Value", drawdown: i = !0, drawdown
966
965
  let t = me(d.map((t) => De(t, e))).filter((e) => e !== null);
967
966
  return H(t) ?? null;
968
967
  }, [d, e]);
969
- return /* @__PURE__ */ B(b, {
968
+ return /* @__PURE__ */ B(A, {
970
969
  ...u,
971
970
  data: o,
972
971
  ranges: f,
@@ -987,9 +986,9 @@ function ke({ value: e, basis: t, label: n = "Value", drawdown: i = !0, drawdown
987
986
  }] : []],
988
987
  shape: {
989
988
  kind: "marks",
990
- id: `portfolio:${e}:${t}:${i}:${u.depth}`,
989
+ id: `portfolio:${e}:${t}:${r}:${u.depth}`,
991
990
  includeZero: !1,
992
- xAxis: !i,
991
+ xAxis: !r,
993
992
  series: (e) => e === t ? {
994
993
  curve: "step-after",
995
994
  color: "var(--lilt-muted)"
@@ -997,22 +996,22 @@ function ke({ value: e, basis: t, label: n = "Value", drawdown: i = !0, drawdown
997
996
  area: { treatment: "fade" },
998
997
  curve: "monotone"
999
998
  },
1000
- draw: (e) => e.map((e) => [/* @__PURE__ */ B(r, { series: e }, `area-${e}`), /* @__PURE__ */ B(D, { series: e }, e)])
999
+ draw: (e) => e.map((e) => [/* @__PURE__ */ B(a, { series: e }, `area-${e}`), /* @__PURE__ */ B(E, { series: e }, e)])
1001
1000
  },
1002
- panes: i ? (t) => {
1003
- let n = me(t.data.map((t) => De(t, e))), i = new Map(t.data.map((e, t) => [e, n[t] ?? null]));
1001
+ panes: r ? (t) => {
1002
+ let n = me(t.data.map((t) => De(t, e))), r = new Map(t.data.map((e, t) => [e, n[t] ?? null]));
1004
1003
  return /* @__PURE__ */ V(J, {
1005
1004
  context: t,
1006
1005
  label: `${u.title} drawdown`,
1007
1006
  caption: "Drawdown",
1008
1007
  readout: (e) => /* @__PURE__ */ V(z, { children: [/* @__PURE__ */ B("span", {
1009
1008
  className: "lilt-card__pane-value",
1010
- children: i.get(e) == null ? "—" : p(i.get(e))
1009
+ children: r.get(e) == null ? "—" : p(r.get(e))
1011
1010
  }), m === null ? null : /* @__PURE__ */ V("span", {
1012
1011
  className: "lilt-card__pane-value",
1013
1012
  children: ["Max ", p(m)]
1014
1013
  })] }),
1015
- height: a,
1014
+ height: i,
1016
1015
  xAxis: !0,
1017
1016
  y: {
1018
1017
  includeZero: !0,
@@ -1022,14 +1021,14 @@ function ke({ value: e, basis: t, label: n = "Value", drawdown: i = !0, drawdown
1022
1021
  series: [{
1023
1022
  id: "drawdown",
1024
1023
  label: "Drawdown",
1025
- accessor: (e) => i.get(e) ?? null,
1024
+ accessor: (e) => r.get(e) ?? null,
1026
1025
  color: "var(--lilt-candle-down)",
1027
1026
  formatValue: p,
1028
1027
  area: { treatment: "fade" },
1029
1028
  line: { width: 1.5 },
1030
1029
  curve: "monotone"
1031
1030
  }],
1032
- children: [/* @__PURE__ */ B(r, { series: "drawdown" }), /* @__PURE__ */ B(D, { series: "drawdown" })]
1031
+ children: [/* @__PURE__ */ B(a, { series: "drawdown" }), /* @__PURE__ */ B(E, { series: "drawdown" })]
1033
1032
  });
1034
1033
  } : void 0
1035
1034
  });
@@ -1058,33 +1057,33 @@ var Ne = {
1058
1057
  minimumFractionDigits: 2,
1059
1058
  maximumFractionDigits: 2
1060
1059
  };
1061
- function Pe({ price: e, symbol: t, name: n, icon: i, display: a = "area", versus: o, data: s, ranges: c, delta: l, valueFormat: u = Ne, locale: d = "en-US", title: f, ...p }) {
1062
- let h = !!o?.length, g = I(() => [e, ...(o ?? []).map((e) => e.key)], [e, o]), _ = I(() => s ? h ? Me(s, g) : s : void 0, [
1060
+ function Pe({ price: e, symbol: t, name: n, icon: r, display: i = "area", versus: o, data: s, ranges: c, delta: l, valueFormat: u = Ne, locale: d = "en-US", title: f, ...p }) {
1061
+ let m = !!o?.length, g = I(() => [e, ...(o ?? []).map((e) => e.key)], [e, o]), _ = I(() => s ? m ? Me(s, g) : s : void 0, [
1063
1062
  s,
1064
- h,
1063
+ m,
1065
1064
  g
1066
1065
  ]), v = I(() => c?.map((t) => {
1067
1066
  let n = je(t.data, e);
1068
1067
  return {
1069
1068
  ...t,
1070
- data: h ? Me(t.data, g) : t.data,
1069
+ data: m ? Me(t.data, g) : t.data,
1071
1070
  delta: t.delta ?? (n && n.first ? n.last / n.first - 1 : void 0)
1072
1071
  };
1073
1072
  }), [
1074
1073
  c,
1075
- h,
1074
+ m,
1076
1075
  g,
1077
1076
  e
1078
- ]), x = je(s ?? c?.[0]?.data ?? [], e), S = !x || x.last >= x.first, C = I(() => y(d, u).full, [d, JSON.stringify(u)]), w = I(() => y(d, {
1077
+ ]), y = je(s ?? c?.[0]?.data ?? [], e), b = !y || y.last >= y.first, x = I(() => w(d, u).full, [d, JSON.stringify(u)]), S = I(() => w(d, {
1079
1078
  style: "percent",
1080
1079
  minimumFractionDigits: 1,
1081
1080
  maximumFractionDigits: 1
1082
- }).full, [d]), T = (e) => h ? `__rebased${e}` : e, E = /* @__PURE__ */ V("span", {
1081
+ }).full, [d]), C = (e) => m ? `__rebased${e}` : e, T = /* @__PURE__ */ V("span", {
1083
1082
  className: "lilt-card__ticker",
1084
1083
  children: [
1085
- i ? /* @__PURE__ */ B("span", {
1084
+ r ? /* @__PURE__ */ B("span", {
1086
1085
  className: "lilt-card__ticker-icon",
1087
- children: i
1086
+ children: r
1088
1087
  }) : null,
1089
1088
  /* @__PURE__ */ B("span", {
1090
1089
  className: "lilt-card__ticker-symbol",
@@ -1096,45 +1095,45 @@ function Pe({ price: e, symbol: t, name: n, icon: i, display: a = "area", versus
1096
1095
  }) : null
1097
1096
  ]
1098
1097
  });
1099
- return /* @__PURE__ */ B(b, {
1098
+ return /* @__PURE__ */ B(A, {
1100
1099
  ...p,
1101
1100
  title: f,
1102
1101
  "aria-label": p["aria-label"] ?? f ?? t ?? n ?? "Price chart",
1103
- heading: f || t || n || i ? E : void 0,
1102
+ heading: f || t || n || r ? T : void 0,
1104
1103
  data: _,
1105
1104
  ranges: v,
1106
- delta: h ? void 0 : l ?? (s && x && x.first ? x.last / x.first - 1 : void 0),
1107
- valueFormat: h ? {
1105
+ delta: m ? void 0 : l ?? (s && y && y.first ? y.last / y.first - 1 : void 0),
1106
+ valueFormat: m ? {
1108
1107
  style: "percent",
1109
1108
  maximumFractionDigits: 1
1110
1109
  } : u,
1111
- formatValue: h ? (e) => m(w)(e) : void 0,
1110
+ formatValue: m ? (e) => h(S)(e) : p.formatValue,
1112
1111
  locale: d,
1113
1112
  aggregate: "last",
1114
- headlineSeries: T(e),
1115
- pillSeries: h ? "nearest" : T(e),
1116
- tiles: h,
1117
- restCaption: h ? void 0 : (t) => {
1113
+ headlineSeries: C(e),
1114
+ pillSeries: m ? "nearest" : C(e),
1115
+ tiles: m,
1116
+ restCaption: m ? void 0 : (t) => {
1118
1117
  let n = je(t, e);
1119
- return n ? m(C)(n.last - n.first) : null;
1118
+ return n ? h(x)(n.last - n.first) : null;
1120
1119
  },
1121
1120
  series: [{
1122
- key: T(e),
1121
+ key: C(e),
1123
1122
  label: t ?? f,
1124
- color: h ? void 0 : S ? U : W
1123
+ color: m ? void 0 : b ? U : W
1125
1124
  }, ...(o ?? []).map((e) => ({
1126
1125
  ...e,
1127
- key: T(e.key)
1126
+ key: C(e.key)
1128
1127
  }))],
1129
1128
  shape: {
1130
1129
  kind: "marks",
1131
- id: `price:${a}:${g.join()}:${h}`,
1132
- includeZero: h,
1133
- series: () => a === "area" && !h ? {
1130
+ id: `price:${i}:${g.join()}:${m}`,
1131
+ includeZero: m,
1132
+ series: () => i === "area" && !m ? {
1134
1133
  area: { treatment: "fade" },
1135
1134
  curve: "monotone"
1136
1135
  } : { curve: "monotone" },
1137
- draw: (e) => e.map((e) => a === "area" && !h ? [/* @__PURE__ */ B(r, { series: e }, `area-${e}`), /* @__PURE__ */ B(D, { series: e }, e)] : /* @__PURE__ */ B(D, { series: e }, e))
1136
+ draw: (e) => e.map((e) => i === "area" && !m ? [/* @__PURE__ */ B(a, { series: e }, `area-${e}`), /* @__PURE__ */ B(E, { series: e }, e)] : /* @__PURE__ */ B(E, { series: e }, e))
1138
1137
  },
1139
1138
  bleed: p.bleed ?? !0
1140
1139
  });
@@ -1166,14 +1165,14 @@ function Ie(e, t) {
1166
1165
  return () => window.clearTimeout(s);
1167
1166
  }, [e, t]), r;
1168
1167
  }
1169
- function Le({ title: e, header: t = !0, "aria-label": n = e || "Order book", bids: r, asks: a, levels: o = 8, depth: c = !1, valueFormat: l = {
1168
+ function Le({ title: e, header: t = !0, "aria-label": n = e || "Order book", bids: r, asks: i, levels: a = 8, depth: o = !1, valueFormat: s = {
1170
1169
  minimumFractionDigits: 2,
1171
1170
  maximumFractionDigits: 2
1172
- }, sizeFormat: u, locale: p = "en-US", flash: m = !0, surface: h, loading: g = !1, loadingStyle: _ = "shimmer", empty: v = "dots", motion: b, className: x, style: S }) {
1173
- let w = A(b ?? "auto"), T = s(g, _), E = f(g, w), D = JSON.stringify(l), O = JSON.stringify(u ?? null), k = I(() => y(p, l).full, [p, D]), j = I(() => y(p, u).compact, [p, O]), ee = I(() => y(p, {
1171
+ }, sizeFormat: c, locale: l = "en-US", flash: u = !0, surface: d, loading: f = !1, loadingStyle: p = "shimmer", empty: m = "dots", motion: h, className: g, style: _ }) {
1172
+ let b = T(h ?? "auto"), x = y(f, p), S = N(f, b), C = JSON.stringify(s), E = JSON.stringify(c ?? null), D = I(() => w(l, s).full, [l, C]), k = I(() => w(l, c).compact, [l, E]), A = I(() => w(l, {
1174
1173
  style: "percent",
1175
1174
  maximumFractionDigits: 3
1176
- }).full, [p]), M = I(() => Fe(r, "bid", o), [r, o]), N = I(() => Fe(a, "ask", o), [a, o]), F = !g && N.length === 0 && M.length === 0, L = Ie(I(() => [...N, ...M], [N, M]), m && !w && !g), R = Math.max(1, N.at(-1)?.total ?? 0, M.at(-1)?.total ?? 0), H = M[0]?.price, U = N[0]?.price, W = H !== void 0 && U !== void 0 ? {
1175
+ }).full, [l]), j = I(() => Fe(r, "bid", a), [r, a]), P = I(() => Fe(i, "ask", a), [i, a]), F = !f && P.length === 0 && j.length === 0, L = Ie(I(() => [...P, ...j], [P, j]), u && !b && !f), R = Math.max(1, P.at(-1)?.total ?? 0, j.at(-1)?.total ?? 0), H = j[0]?.price, U = P[0]?.price, W = H !== void 0 && U !== void 0 ? {
1177
1176
  value: U - H,
1178
1177
  mid: (U + H) / 2
1179
1178
  } : null, G = (e) => /* @__PURE__ */ V("tr", {
@@ -1184,48 +1183,48 @@ function Le({ title: e, header: t = !0, "aria-label": n = e || "Order book", bid
1184
1183
  children: [
1185
1184
  /* @__PURE__ */ V("th", {
1186
1185
  scope: "row",
1187
- children: [c ? /* @__PURE__ */ B("span", {
1186
+ children: [o ? /* @__PURE__ */ B("span", {
1188
1187
  className: "lilt-order-book__bar",
1189
1188
  "aria-hidden": "true"
1190
- }) : null, k(e.price)]
1189
+ }) : null, D(e.price)]
1191
1190
  }),
1192
- /* @__PURE__ */ B("td", { children: j(e.size) }),
1193
- /* @__PURE__ */ B("td", { children: j(e.total) })
1191
+ /* @__PURE__ */ B("td", { children: k(e.size) }),
1192
+ /* @__PURE__ */ B("td", { children: k(e.total) })
1194
1193
  ]
1195
- }, `${e.side}:${e.price}`), K = (e) => Array.from({ length: Math.max(1, Math.min(50, o)) }, (t, n) => /* @__PURE__ */ V("tr", {
1194
+ }, `${e.side}:${e.price}`), K = (e) => Array.from({ length: Math.max(1, Math.min(50, a)) }, (t, n) => /* @__PURE__ */ V("tr", {
1196
1195
  className: "lilt-order-book__placeholder",
1197
1196
  "aria-hidden": "true",
1198
1197
  children: [
1199
- /* @__PURE__ */ B("td", { children: /* @__PURE__ */ B(C, {
1198
+ /* @__PURE__ */ B("td", { children: /* @__PURE__ */ B(M, {
1200
1199
  width: `${86 - n * 4}%`,
1201
1200
  step: n
1202
1201
  }) }),
1203
- /* @__PURE__ */ B("td", { children: /* @__PURE__ */ B(C, {
1202
+ /* @__PURE__ */ B("td", { children: /* @__PURE__ */ B(M, {
1204
1203
  width: "60%",
1205
1204
  step: n
1206
1205
  }) }),
1207
- /* @__PURE__ */ B("td", { children: /* @__PURE__ */ B(C, {
1206
+ /* @__PURE__ */ B("td", { children: /* @__PURE__ */ B(M, {
1208
1207
  width: "72%",
1209
1208
  step: n
1210
1209
  }) })
1211
1210
  ]
1212
1211
  }, `${e}-${n}`));
1213
- return /* @__PURE__ */ V(P, {
1212
+ return /* @__PURE__ */ V(v, {
1214
1213
  "aria-label": n,
1215
- surface: h,
1216
- motion: b,
1217
- className: ["lilt-card--order-book", x].filter(Boolean).join(" "),
1218
- style: S,
1219
- children: [/* @__PURE__ */ B(d, {
1220
- leaving: E,
1214
+ surface: d,
1215
+ motion: h,
1216
+ className: ["lilt-card--order-book", g].filter(Boolean).join(" "),
1217
+ style: _,
1218
+ children: [/* @__PURE__ */ B(O, {
1219
+ leaving: S,
1221
1220
  origin: "center",
1222
1221
  children: /* @__PURE__ */ V("table", {
1223
- ref: T,
1224
- className: g ? "lilt-order-book lilt-skeleton" : "lilt-order-book",
1225
- "data-depth": c || void 0,
1226
- "data-style": g ? _ : void 0,
1227
- "data-reduced-motion": w || void 0,
1228
- "aria-busy": g,
1222
+ ref: x,
1223
+ className: f ? "lilt-order-book lilt-skeleton" : "lilt-order-book",
1224
+ "data-depth": o || void 0,
1225
+ "data-style": f ? p : void 0,
1226
+ "data-reduced-motion": b || void 0,
1227
+ "aria-busy": f,
1229
1228
  "aria-label": n,
1230
1229
  children: [
1231
1230
  t && e ? /* @__PURE__ */ B("caption", { children: e }) : null,
@@ -1246,7 +1245,7 @@ function Le({ title: e, header: t = !0, "aria-label": n = e || "Order book", bid
1246
1245
  F ? null : /* @__PURE__ */ V(z, { children: [
1247
1246
  /* @__PURE__ */ B("tbody", {
1248
1247
  "aria-label": "Asks",
1249
- children: g ? K("ask") : [...N].reverse().map(G)
1248
+ children: f ? K("ask") : [...P].reverse().map(G)
1250
1249
  }),
1251
1250
  /* @__PURE__ */ B("tbody", {
1252
1251
  "aria-label": "Spread",
@@ -1254,23 +1253,23 @@ function Le({ title: e, header: t = !0, "aria-label": n = e || "Order book", bid
1254
1253
  className: "lilt-order-book__spread",
1255
1254
  children: [/* @__PURE__ */ B("th", {
1256
1255
  scope: "row",
1257
- children: g ? "—" : W ? k(W.mid) : "—"
1256
+ children: f ? "—" : W ? D(W.mid) : "—"
1258
1257
  }), /* @__PURE__ */ B("td", {
1259
1258
  colSpan: 2,
1260
- children: g ? "Loading order book" : W ? `Spread ${k(W.value)} · ${ee(W.value / W.mid)}` : "No spread"
1259
+ children: f ? "Loading order book" : W ? `Spread ${D(W.value)} · ${A(W.value / W.mid)}` : "No spread"
1261
1260
  })]
1262
1261
  })
1263
1262
  }),
1264
1263
  /* @__PURE__ */ B("tbody", {
1265
1264
  "aria-label": "Bids",
1266
- children: g ? K("bid") : M.map(G)
1265
+ children: f ? K("bid") : j.map(G)
1267
1266
  })
1268
1267
  ] })
1269
1268
  ]
1270
1269
  })
1271
- }), F ? /* @__PURE__ */ B(i, {
1270
+ }), F ? /* @__PURE__ */ B(ee, {
1272
1271
  block: !0,
1273
- state: v,
1272
+ state: m,
1274
1273
  shape: "rows"
1275
1274
  }) : null]
1276
1275
  });