@mechane-ai/elements 0.9.0 → 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 (71) hide show
  1. package/NOTICE +24 -0
  2. package/README.md +7 -1
  3. package/dist/ai.js +129 -125
  4. package/dist/{categorical-values-DYRiw5Qd.js → categorical-values-DLRE4EEW.js} +4 -4
  5. package/dist/{chart-frame-RL1hCWBC.js → chart-frame-et6f6Vhg.js} +22 -14
  6. package/dist/{chart-input-Bm3ot1yD.js → chart-input-CdLkFomi.js} +2 -2
  7. package/dist/charts/cartesian.js +529 -450
  8. package/dist/charts/distribution.js +302 -261
  9. package/dist/charts/graph.js +137 -103
  10. package/dist/charts/hierarchy.js +7 -7
  11. package/dist/charts/matrix.js +187 -174
  12. package/dist/charts/timeline.js +118 -92
  13. package/dist/charts.js +1 -1
  14. package/dist/code-block-D77maJBB.js +180 -0
  15. package/dist/collections.js +280 -236
  16. package/dist/content/code.js +1 -1
  17. package/dist/content/diff.js +81 -63
  18. package/dist/content/link.js +1 -1
  19. package/dist/content/markdown.js +115 -96
  20. package/dist/content/tree.js +43 -38
  21. package/dist/{content-link-BrPrpBof.js → content-link-BpSZeTNK.js} +6 -2
  22. package/dist/content.js +172 -153
  23. package/dist/{assets/stylex.css → elements.css} +471 -185
  24. package/dist/feedback.js +1 -1
  25. package/dist/forms/dates.js +25 -25
  26. package/dist/forms.js +1 -1
  27. package/dist/index.js +1 -1
  28. package/dist/layout.js +239 -192
  29. package/dist/navigation/commands.js +45 -42
  30. package/dist/{navigation-yxK3iQXo.js → navigation-D2_sGy3C.js} +2 -2
  31. package/dist/navigation.js +10 -10
  32. package/dist/overlays.js +1 -1
  33. package/dist/packages/charts/src/cartesian/bar-chart.d.ts +5 -0
  34. package/dist/packages/charts/src/cartesian/index.d.ts +2 -2
  35. package/dist/packages/charts/src/chart-frame.d.ts +3 -0
  36. package/dist/packages/charts/src/chart-theme.d.ts +2 -1
  37. package/dist/packages/charts/src/distribution/distribution-plot.d.ts +22 -2
  38. package/dist/packages/collections/src/collection-scroll.d.ts +2 -1
  39. package/dist/packages/content/src/diff/pierre-diff.d.ts +2 -1
  40. package/dist/packages/content/src/viewer-styles.d.ts +64 -0
  41. package/dist/packages/core/src/index.d.ts +1 -1
  42. package/dist/packages/core/src/surfaces.d.ts +5 -0
  43. package/dist/packages/feedback/src/index.d.ts +4 -1
  44. package/dist/packages/feedback/src/toast.d.ts +5 -27
  45. package/dist/packages/forms/src/field-styles.d.ts +9 -0
  46. package/dist/packages/forms/src/selection-styles.d.ts +18 -2
  47. package/dist/packages/foundations/src/overlay-styles.d.ts +3 -1
  48. package/dist/packages/foundations/src/popup-styles.d.ts +7 -0
  49. package/dist/packages/foundations/src/tokens.stylex.d.ts +9 -0
  50. package/dist/packages/layout/src/frame.stylex.d.ts +1 -0
  51. package/dist/packages/layout/src/sidebar.d.ts +3 -1
  52. package/dist/packages/overlays/src/alert-dialog.d.ts +5 -2
  53. package/dist/packages/overlays/src/dialog.d.ts +7 -3
  54. package/dist/pierre-diff--zsiHCCB.js +71 -0
  55. package/dist/pierre-theme-D9hnHv3Z.js +126 -0
  56. package/dist/{pierre-tree-CRk09rx7.js → pierre-tree-BFxEuxwb.js} +3 -3
  57. package/dist/{src-Cc0Sadzr.js → src-Be7NLG8c.js} +238 -186
  58. package/dist/src-CBspCKfO.js +969 -0
  59. package/dist/src-Cs0dRc4X.js +617 -0
  60. package/dist/{src-elMBQ2Dh.js → src-sU9b0oZW.js} +224 -143
  61. package/dist/tokens.js +9 -1
  62. package/dist/viewer-styles-CpHqp5Qv.js +70 -0
  63. package/package.json +2 -1
  64. package/packages/foundations/src/tokens.stylex.ts +7 -0
  65. package/styles.css +1 -1
  66. package/dist/code-block-B30xQKqg.js +0 -175
  67. package/dist/pierre-diff-CZdzgiYm.js +0 -66
  68. package/dist/pierre-theme-BpESNIsV.js +0 -96
  69. package/dist/popup-styles-CvtZDE2t.js +0 -135
  70. package/dist/src-CfDf8TY8.js +0 -466
  71. package/dist/src-DuuAmS-c.js +0 -360
@@ -1,200 +1,257 @@
1
- import { i as e, n as t, r as n, t as r } from "../categorical-values-DYRiw5Qd.js";
2
- import { a as i, i as a, n as o, o as s, r as c, t as l } from "../chart-frame-RL1hCWBC.js";
3
- import { n as u, r as d, t as f } from "../chart-input-Bm3ot1yD.js";
4
- import { t as p } from "../plot-width--OgdohB5.js";
5
- import { T as m } from "../src-elMBQ2Dh.js";
6
- import { h } from "../src-Cc0Sadzr.js";
7
- import { colors as g } from "../tokens.js";
8
- import * as _ from "@stylexjs/stylex";
9
- import { useEffect as v, useId as y, useMemo as b, useRef as x, useState as S } from "react";
10
- import { Fragment as C, jsx as w, jsxs as T } from "react/jsx-runtime";
11
- import { scaleBand as E, scaleLinear as D } from "@visx/scale";
12
- import { AreaClosed as O, Bar as k, LinePath as A } from "@visx/shape";
1
+ import { c as e } from "../src-CBspCKfO.js";
2
+ import { i as t, n, r, t as i } from "../categorical-values-DLRE4EEW.js";
3
+ import { a, i as o, n as s, o as c, r as l, s as u, t as d } from "../chart-frame-et6f6Vhg.js";
4
+ import { n as f, r as p, t as m } from "../chart-input-CdLkFomi.js";
5
+ import { t as h } from "../plot-width--OgdohB5.js";
6
+ import { E as g } from "../src-sU9b0oZW.js";
7
+ import { h as _ } from "../src-Be7NLG8c.js";
8
+ import { colors as v } from "../tokens.js";
9
+ import * as y from "@stylexjs/stylex";
10
+ import { useEffect as b, useId as x, useMemo as S, useRef as C, useState as w } from "react";
11
+ import { Fragment as T, jsx as E, jsxs as D } from "react/jsx-runtime";
12
+ import { scaleBand as O, scaleLinear as k } from "@visx/scale";
13
+ import { AreaClosed as A, Bar as ee, LinePath as j } from "@visx/shape";
13
14
  // packages/charts/src/cartesian/bar-chart.tsx
14
- var ee = { plot: {
15
+ var M = { plot: {
15
16
  kqGvvJ: "x1we84gm",
16
17
  $$css: !0
17
- } }, j = /* @__PURE__ */ new Set(["Enter", " "]);
18
- function M({ categories: e, series: n, domain: r, mode: i }) {
19
- if (e.length > t.items || n.length > t.series) return `Choose a window with at most ${t.items} categories and ${t.series} series.`;
20
- if (!d(r) || r[0] > 0 || r[1] < 0) return "The bar domain must be finite, increasing, and include zero.";
21
- if (!u(e) || !u(n)) return "Bar categories and series require unique identifiers.";
22
- for (let t of n) {
23
- if (t.values.length !== e.length) return "Every series requires one explicit value per category.";
24
- for (let e of t.values) {
18
+ } }, N = /* @__PURE__ */ new Set(["Enter", " "]), te = 200, P = "Point, tap, or use the arrow keys to inspect values.";
19
+ function ne({ title: e, description: t, series: n, children: i }) {
20
+ let a = n.map((e, t) => ({
21
+ id: e.id,
22
+ label: e.label,
23
+ tone: r(e.tone, t)
24
+ }));
25
+ return /* @__PURE__ */ D(l, {
26
+ title: e,
27
+ description: t,
28
+ children: [/* @__PURE__ */ E(o, { items: a }), i]
29
+ });
30
+ }
31
+ function F({ title: t = "Loading chart", description: n, series: r = [], height: i = te }) {
32
+ let a = I(i);
33
+ return a === void 0 ? /* @__PURE__ */ E("div", {
34
+ "aria-hidden": !0,
35
+ inert: !0,
36
+ children: /* @__PURE__ */ D(ne, {
37
+ title: t,
38
+ description: n,
39
+ series: r,
40
+ children: [
41
+ /* @__PURE__ */ E("div", {
42
+ ...y.props(c.plot, M.plot),
43
+ children: /* @__PURE__ */ E(e, { height: i })
44
+ }),
45
+ /* @__PURE__ */ E("div", {
46
+ className: "x78zum5 x1a02dak x8zbtdt x1gkm1c7 x1mqbd49 xy8obcc xas2l8k xss6m8b xj0a0fe",
47
+ children: /* @__PURE__ */ D("span", {
48
+ className: "x1n2onr6 xeuugli",
49
+ children: [/* @__PURE__ */ E("span", {
50
+ className: "xlshs6z",
51
+ children: P
52
+ }), /* @__PURE__ */ E("span", {
53
+ className: "x10l6tqk x10a8y8t",
54
+ children: /* @__PURE__ */ E(e, { height: "100%" })
55
+ })]
56
+ })
57
+ }),
58
+ /* @__PURE__ */ E("div", {
59
+ className: "xlshs6z",
60
+ children: /* @__PURE__ */ E(d, { children: null })
61
+ })
62
+ ]
63
+ })
64
+ }) : /* @__PURE__ */ E(m, {
65
+ title: t,
66
+ description: n,
67
+ message: a
68
+ });
69
+ }
70
+ function I(e) {
71
+ if (!Number.isFinite(e) || e < 48) return "Chart height must be at least 48 pixels.";
72
+ }
73
+ function L({ categories: e, series: t, domain: r, mode: i }) {
74
+ if (e.length > n.items || t.length > n.series) return `Choose a window with at most ${n.items} categories and ${n.series} series.`;
75
+ if (!p(r) || r[0] > 0 || r[1] < 0) return "The bar domain must be finite, increasing, and include zero.";
76
+ if (!f(e) || !f(t)) return "Bar categories and series require unique identifiers.";
77
+ for (let n of t) {
78
+ if (n.values.length !== e.length) return "Every series requires one explicit value per category.";
79
+ for (let e of n.values) {
25
80
  if (e !== null && (!Number.isFinite(e) || e < r[0] || e > r[1])) return "Bar values must be finite and within the supplied domain.";
26
81
  if (i === "stacked" && (e === null || e < 0)) return "Stacked bars require present nonnegative values.";
27
82
  }
28
83
  }
29
- if (i === "stacked" && e.some((e, t) => n.reduce((e, n) => e + (n.values[t] ?? 0), 0) > r[1])) return "Stacked bar totals must fit the supplied domain.";
84
+ if (i === "stacked" && e.some((e, n) => t.reduce((e, t) => e + (t.values[n] ?? 0), 0) > r[1])) return "Stacked bar totals must fit the supplied domain.";
30
85
  }
31
- function N({ title: e, description: t, categories: o, series: u, domain: d, mode: m = "grouped", formatValue: h, selection: g, height: v = 200 }) {
32
- let b = M({
33
- categories: o,
34
- series: u,
35
- domain: d,
36
- mode: m
37
- }), { ref: x, width: O } = p(), A = y(), [N, P] = S(), F = o.findIndex((e) => e.id === N?.id), I = o[F];
38
- if (b !== void 0 || !Number.isFinite(v) || v < 48) return /* @__PURE__ */ w(f, {
86
+ function R({ title: e, description: t, categories: n, series: a, domain: o, mode: s = "grouped", formatValue: l, selection: f, height: p = te }) {
87
+ let g = L({
88
+ categories: n,
89
+ series: a,
90
+ domain: o,
91
+ mode: s
92
+ }) ?? I(p), { ref: _, width: v } = h(), b = x(), [S, C] = w(), A = n.findIndex((e) => e.id === S?.id), j = n[A], F = n.findIndex((e) => e.id === f?.selectedId), R = n[F], B = j ?? R, V = j === void 0 ? F : A;
93
+ if (g !== void 0) return /* @__PURE__ */ E(m, {
39
94
  title: e,
40
95
  description: t,
41
- message: b ?? "Chart height must be at least 48 pixels."
96
+ message: g
42
97
  });
43
- let L = v - 28, R = D({
44
- domain: [...d],
45
- range: [L, 12]
46
- }), z = Math.max(52, ...R.ticks(3).map((e) => h(e).length * 7 + 12)), B = Math.max(z + 1, O - 16), V = E({
47
- domain: o.map((e) => e.id),
48
- range: [z, B],
98
+ let H = p - 28, U = k({
99
+ domain: [...o],
100
+ range: [H, 12]
101
+ }), W = Math.max(52, ...U.ticks(3).map((e) => l(e).length * 7 + 12)), G = Math.max(W + 1, v - 16), K = O({
102
+ domain: n.map((e) => e.id),
103
+ range: [W, G],
49
104
  padding: .3
50
- }), H = E({
51
- domain: u.map((e) => e.id),
52
- range: [0, V.bandwidth()],
105
+ }), q = O({
106
+ domain: a.map((e) => e.id),
107
+ range: [0, K.bandwidth()],
53
108
  padding: .08
54
- }), U = Math.min(120, Math.max(40, ...o.map((e) => (e.axisLabel ?? e.label).length * 7))), W = Math.max(1, Math.ceil((U + 16) / V.step())), G = Math.max(1, Math.floor((V.step() * W - 16) / 7)), K = u.map((e, t) => ({
55
- id: e.id,
56
- label: e.label,
57
- tone: n(e.tone, t)
58
- }));
59
- function q(e) {
60
- let t = e.currentTarget.getBoundingClientRect(), n = (e.clientX - t.left) / t.width * O, r = Math.floor((n - z) / V.step()), i = o[Math.max(0, Math.min(o.length - 1, r))];
61
- i !== void 0 && P({
62
- id: i.id,
109
+ }), re = Math.min(120, Math.max(40, ...n.map((e) => (e.axisLabel ?? e.label).length * 7))), J = Math.max(1, Math.ceil((re + 16) / K.step())), ie = Math.max(1, Math.floor((K.step() * J - 16) / 7));
110
+ function Y(e) {
111
+ let t = e.currentTarget.getBoundingClientRect(), r = (e.clientX - t.left) / t.width * v, i = Math.floor((r - W) / K.step()), a = n[Math.max(0, Math.min(n.length - 1, i))];
112
+ a !== void 0 && C({
113
+ id: a.id,
63
114
  source: "pointer"
64
115
  });
65
116
  }
66
- function J(e) {
117
+ function ae(e) {
67
118
  if (e.altKey || e.ctrlKey || e.metaKey) return;
68
119
  if (e.key === "Escape") {
69
- e.preventDefault(), e.stopPropagation(), P(void 0);
120
+ e.preventDefault(), e.stopPropagation(), C(void 0);
70
121
  return;
71
122
  }
72
- if (j.has(e.key)) {
73
- I !== void 0 && g !== void 0 && (e.preventDefault(), g.onSelect(I.id));
123
+ if (N.has(e.key)) {
124
+ j !== void 0 && f !== void 0 && (e.preventDefault(), f.onSelect(j.id));
74
125
  return;
75
126
  }
76
127
  let t = {
77
- ArrowRight: Math.min(o.length - 1, F + 1),
78
- ArrowLeft: Math.max(0, F - 1),
128
+ ArrowRight: Math.min(n.length - 1, A + 1),
129
+ ArrowLeft: Math.max(0, A - 1),
79
130
  Home: 0,
80
- End: o.length - 1
81
- }[e.key], n = t === void 0 ? void 0 : o[t];
82
- n !== void 0 && (e.preventDefault(), P({
83
- id: n.id,
131
+ End: n.length - 1
132
+ }[e.key], r = t === void 0 ? void 0 : n[t];
133
+ r !== void 0 && (e.preventDefault(), C({
134
+ id: r.id,
84
135
  source: "keyboard"
85
136
  }));
86
137
  }
87
- return /* @__PURE__ */ T(c, {
138
+ return /* @__PURE__ */ D(ne, {
88
139
  title: e,
89
140
  description: t,
141
+ series: a,
90
142
  children: [
91
- /* @__PURE__ */ w(a, { items: K }),
92
- /* @__PURE__ */ w("div", {
93
- ref: x,
94
- ..._.props(i.plot, ee.plot),
95
- children: o.length === 0 || u.length === 0 ? /* @__PURE__ */ w("p", {
143
+ /* @__PURE__ */ E("div", {
144
+ ref: _,
145
+ ...y.props(c.plot, M.plot),
146
+ children: n.length === 0 || a.length === 0 ? /* @__PURE__ */ E("p", {
96
147
  className: "x153jb6y x1ghz6dp xy8obcc",
97
148
  children: "No categories"
98
- }) : /* @__PURE__ */ T("svg", {
149
+ }) : /* @__PURE__ */ D("svg", {
99
150
  role: "img",
100
- "aria-label": `${e}. Use arrow keys to inspect categories.${g === void 0 ? "" : " Press Enter to select."}`,
101
- "aria-describedby": A,
151
+ "aria-label": `${e}. Use arrow keys to inspect categories.${f === void 0 ? "" : " Press Enter to select."}`,
152
+ "aria-describedby": b,
102
153
  tabIndex: 0,
103
- viewBox: `0 0 ${O} ${v}`,
104
- height: v,
105
- onKeyDown: J,
154
+ viewBox: `0 0 ${v} ${p}`,
155
+ height: p,
156
+ onKeyDown: ae,
106
157
  onPointerMove: (e) => {
107
- e.pointerType === "mouse" && q(e);
158
+ e.pointerType === "mouse" && Y(e);
108
159
  },
109
- onPointerDown: q,
160
+ onPointerDown: Y,
110
161
  onPointerLeave: (e) => {
111
- e.pointerType === "mouse" && N?.source === "pointer" && P(void 0);
162
+ e.pointerType === "mouse" && S?.source === "pointer" && C(void 0);
112
163
  },
113
- onBlur: () => P(void 0),
164
+ onBlur: () => C(void 0),
114
165
  onClick: () => {
115
- I !== void 0 && g?.onSelect(I.id);
166
+ j !== void 0 && f?.onSelect(j.id);
116
167
  },
117
- ..._.props(i.svg, i.focus),
168
+ ...y.props(c.svg, c.focus),
118
169
  children: [
119
- I !== void 0 && /* @__PURE__ */ w("rect", {
120
- x: (V(I.id) ?? z) - (V.step() - V.bandwidth()) / 2,
170
+ j !== void 0 && /* @__PURE__ */ E("rect", {
171
+ x: (K(j.id) ?? W) - (K.step() - K.bandwidth()) / 2,
121
172
  y: 12,
122
- width: V.step(),
123
- height: L - 12,
173
+ width: K.step(),
174
+ height: H - 12,
124
175
  className: "x2wnxhi"
125
176
  }),
126
- R.ticks(3).map((e) => /* @__PURE__ */ T("g", { children: [/* @__PURE__ */ w("line", {
127
- x1: z,
128
- x2: B,
129
- y1: R(e),
130
- y2: R(e),
131
- ..._.props(i.grid)
132
- }), /* @__PURE__ */ w("text", {
133
- x: z - 8,
134
- y: R(e),
177
+ U.ticks(3).map((e) => /* @__PURE__ */ D("g", { children: [/* @__PURE__ */ E("line", {
178
+ x1: W,
179
+ x2: G,
180
+ y1: U(e),
181
+ y2: U(e),
182
+ ...y.props(c.grid)
183
+ }), /* @__PURE__ */ E("text", {
184
+ x: W - 8,
185
+ y: U(e),
135
186
  textAnchor: "end",
136
187
  dominantBaseline: "middle",
137
- ..._.props(i.label),
138
- children: h(e)
188
+ ...y.props(c.label),
189
+ children: l(e)
139
190
  })] }, e)),
140
- o.map((e, t) => {
141
- let r = e.axisLabel ?? e.label;
142
- return /* @__PURE__ */ T("g", { children: [u.map((r, a) => {
143
- let o = r.values[t];
191
+ n.map((e, t) => {
192
+ let n = e.axisLabel ?? e.label;
193
+ return /* @__PURE__ */ D("g", { children: [a.map((n, i) => {
194
+ let o = n.values[t];
144
195
  if (o == null) return null;
145
- let c = m === "stacked" ? u.slice(0, a).reduce((e, n) => e + (n.values[t] ?? 0), 0) : 0, l = R(c), d = R(c + o), f = g?.selectedId === e.id || I?.id === e.id;
146
- return /* @__PURE__ */ w(k, {
147
- x: (V(e.id) ?? z) + (m === "stacked" ? 0 : H(r.id) ?? 0),
148
- y: Math.min(l, d),
149
- width: m === "stacked" ? V.bandwidth() : H.bandwidth(),
150
- height: Math.max(+(o === 0), Math.abs(d - l)),
151
- fill: s[n(r.tone, a)],
152
- ..._.props(f && i.selected)
153
- }, r.id);
154
- }), t % W === 0 && /* @__PURE__ */ w("text", {
155
- x: (V(e.id) ?? z) + V.bandwidth() / 2,
156
- y: v - 4,
196
+ let l = s === "stacked" ? a.slice(0, i).reduce((e, n) => e + (n.values[t] ?? 0), 0) : 0, d = U(l), p = U(l + o), m = f?.selectedId === e.id || j?.id === e.id;
197
+ return /* @__PURE__ */ E(ee, {
198
+ x: (K(e.id) ?? W) + (s === "stacked" ? 0 : q(n.id) ?? 0),
199
+ y: Math.min(d, p),
200
+ width: s === "stacked" ? K.bandwidth() : q.bandwidth(),
201
+ height: Math.max(+(o === 0), Math.abs(p - d)),
202
+ fill: u[r(n.tone, i)],
203
+ ...y.props(m && c.selected)
204
+ }, n.id);
205
+ }), t % J === 0 && /* @__PURE__ */ E("text", {
206
+ x: (K(e.id) ?? W) + K.bandwidth() / 2,
207
+ y: p - 4,
157
208
  textAnchor: "middle",
158
- ..._.props(i.label),
159
- children: r.length > G ? `${r.slice(0, G - 1)}…` : r
209
+ ...y.props(c.label),
210
+ children: n.length > ie ? `${n.slice(0, ie - 1)}…` : n
160
211
  })] }, e.id);
161
212
  })
162
213
  ]
163
214
  })
164
215
  }),
165
- o.length > 0 && u.length > 0 && /* @__PURE__ */ w("div", {
166
- id: A,
167
- "aria-live": N?.source === "keyboard" ? "polite" : "off",
168
- className: "x78zum5 x1a02dak x1n8ia3y x1mqbd49 xy8obcc xas2l8k xss6m8b",
169
- children: I === void 0 ? /* @__PURE__ */ w("span", {
216
+ n.length > 0 && a.length > 0 && /* @__PURE__ */ E("div", {
217
+ id: b,
218
+ "aria-live": S?.source === "pointer" ? "off" : "polite",
219
+ className: "x78zum5 x1a02dak x8zbtdt x1gkm1c7 x1mqbd49 xy8obcc xas2l8k xss6m8b xj0a0fe",
220
+ children: B === void 0 ? /* @__PURE__ */ E("span", {
170
221
  className: "x153jb6y x1ghz6dp xy8obcc",
171
- children: "Point, tap, or use the arrow keys to inspect values."
172
- }) : /* @__PURE__ */ T(C, { children: [/* @__PURE__ */ w("span", { children: I.label }), u.map((e) => /* @__PURE__ */ T("span", { children: [
222
+ children: P
223
+ }) : /* @__PURE__ */ D(T, { children: [/* @__PURE__ */ E("span", { children: B.label }), a.map((e) => /* @__PURE__ */ D("span", { children: [
173
224
  e.label,
174
225
  ":",
175
226
  " ",
176
- e.values[F] === null || e.values[F] === void 0 ? "Unavailable" : h(e.values[F])
227
+ e.values[V] === null || e.values[V] === void 0 ? "Unavailable" : l(e.values[V])
177
228
  ] }, e.id))] })
178
229
  }),
179
- /* @__PURE__ */ w(l, { children: /* @__PURE__ */ w(r, {
180
- items: o.map((e, t) => ({
230
+ /* @__PURE__ */ E(d, { children: /* @__PURE__ */ E(i, {
231
+ items: n.map((e, t) => ({
181
232
  id: e.id,
182
233
  label: e.label,
183
- valueLabel: u.map((e) => `${e.label}: ${e.values[t] === null || e.values[t] === void 0 ? "Unavailable" : h(e.values[t])}`).join(" · "),
234
+ valueLabel: z(a, t, l),
184
235
  tone: "neutral"
185
236
  })),
186
- selection: g
237
+ selection: f
187
238
  }) })
188
239
  ]
189
240
  });
190
241
  }
242
+ function z(e, t, n) {
243
+ return e.map((e) => {
244
+ let r = e.values[t];
245
+ return `${e.label}: ${r == null ? "Unavailable" : n(r)}`;
246
+ }).join(" · ");
247
+ }
191
248
  // packages/charts/src/cartesian/breakdown-bar.tsx
192
- var P = {
249
+ var B = {
193
250
  kzqmXN: "x5lhr3w",
194
251
  kZKoxP: "x5yr21d",
195
252
  $$css: !0
196
- }, F = { segment: (e, t) => [
197
- P,
253
+ }, V = { segment: (e, t) => [
254
+ B,
198
255
  {
199
256
  kWkggS: t == null ? t : "xl8spv7",
200
257
  $$css: !0
@@ -204,56 +261,56 @@ var P = {
204
261
  "--x-backgroundColor": t ?? void 0
205
262
  }
206
263
  ] };
207
- function I({ title: t, description: i, items: a, total: o, formatValue: l, selection: u }) {
208
- let d = e(a), p = a.reduce((e, t) => e + (t.value ?? 0), 0), m = 2 ** -52 * Math.max(p, o, 1) * a.length;
209
- return d === void 0 ? !Number.isFinite(o) || o < 0 || p - o > m ? /* @__PURE__ */ w(f, {
210
- title: t,
211
- description: i,
264
+ function H({ title: e, description: n, items: a, total: o, formatValue: s, selection: c }) {
265
+ let d = t(a), f = a.reduce((e, t) => e + (t.value ?? 0), 0), p = 2 ** -52 * Math.max(f, o, 1) * a.length;
266
+ return d === void 0 ? !Number.isFinite(o) || o < 0 || f - o > p ? /* @__PURE__ */ E(m, {
267
+ title: e,
268
+ description: n,
212
269
  message: "The total must be finite and at least the sum of recorded values."
213
- }) : /* @__PURE__ */ w(c, {
214
- title: t,
215
- description: i,
216
- children: a.length === 0 ? /* @__PURE__ */ w("p", {
270
+ }) : /* @__PURE__ */ E(l, {
271
+ title: e,
272
+ description: n,
273
+ children: a.length === 0 ? /* @__PURE__ */ E("p", {
217
274
  className: "x153jb6y x1ghz6dp xy8obcc",
218
275
  children: "No values"
219
- }) : /* @__PURE__ */ T(C, { children: [
220
- /* @__PURE__ */ w("div", {
276
+ }) : /* @__PURE__ */ D(T, { children: [
277
+ /* @__PURE__ */ E("div", {
221
278
  "aria-hidden": !0,
222
279
  className: "x78zum5 x170jfvy xb3r6kr x1r7kqkb xmkeg23 x1y0btm7 x1ey3b81 x1jfksii",
223
- children: a.map((e, t) => e.value === null ? null : /* @__PURE__ */ w("span", { ..._.props(F.segment(o === 0 ? 0 : e.value / o * 100, s[n(e.tone, t)])) }, e.id))
280
+ children: a.map((e, t) => e.value === null ? null : /* @__PURE__ */ E("span", { ...y.props(V.segment(o === 0 ? 0 : e.value / o * 100, u[r(e.tone, t)])) }, e.id))
224
281
  }),
225
- /* @__PURE__ */ w(r, {
282
+ /* @__PURE__ */ E(i, {
226
283
  items: a.map((e, t) => ({
227
284
  id: e.id,
228
285
  label: e.label,
229
- valueLabel: e.value === null ? "Unavailable" : l(e.value),
230
- tone: n(e.tone, t)
286
+ valueLabel: e.value === null ? "Unavailable" : s(e.value),
287
+ tone: r(e.tone, t)
231
288
  })),
232
- selection: u
289
+ selection: c
233
290
  }),
234
- o - p > m && /* @__PURE__ */ T("p", {
291
+ o - f > p && /* @__PURE__ */ D("p", {
235
292
  className: "x153jb6y x1ghz6dp xy8obcc",
236
293
  children: [
237
294
  "Unassigned portion: ",
238
- l(o - p),
295
+ s(o - f),
239
296
  " of ",
240
- l(o)
297
+ s(o)
241
298
  ]
242
299
  })
243
300
  ] })
244
- }) : /* @__PURE__ */ w(f, {
245
- title: t,
246
- description: i,
301
+ }) : /* @__PURE__ */ E(m, {
302
+ title: e,
303
+ description: n,
247
304
  message: d
248
305
  });
249
306
  }
250
307
  // packages/charts/src/cartesian/scatter-plot.tsx
251
- var L = 260, R = 56, z = 20, B = 12, V = 1e3, H = {
308
+ var U = 260, W = 56, G = 20, K = 12, q = 1e3, re = {
252
309
  kzqmXN: "x1xc55vz",
253
310
  kZKoxP: "xdk7pt",
254
311
  kaIpWk: "x16rqkct",
255
312
  $$css: !0
256
- }, U = {
313
+ }, J = {
257
314
  brush: {
258
315
  kFalU9: "xx69xxh",
259
316
  kkrTdU: "xsid9ct",
@@ -271,14 +328,15 @@ var L = 260, R = 56, z = 20, B = 12, V = 1e3, H = {
271
328
  kWkggS: "xjbqb8w",
272
329
  kkrTdU: "x1ypdohk",
273
330
  kfzvcC: "x67bb7w",
331
+ k3XXqK: "x1t137rt",
274
332
  kPJHz1: "x13qnu6",
275
333
  kZs9gx: "x19rmrnh",
276
334
  k7shQP: "x9v5kkp",
277
335
  kiEn40: "x175ew0f",
278
- kguI0P: "xisywhd",
279
- kUjPgX: "xakijqq",
280
- kFU1ZQ: "xzbfamy",
281
- kRG58y: "x1cdmj33",
336
+ kmCx7Z: "x1e7sry0",
337
+ kJrEVn: "xehdg9o",
338
+ kLz2MD: "xp9r5ej",
339
+ k1CtGv: "xzgvv12",
282
340
  $$css: !0
283
341
  },
284
342
  location: (e, t) => [{
@@ -290,7 +348,7 @@ var L = 260, R = 56, z = 20, B = 12, V = 1e3, H = {
290
348
  "--x-top": ((e) => typeof e == "number" ? e + "px" : e ?? void 0)(t)
291
349
  }],
292
350
  dot: (e) => [
293
- H,
351
+ re,
294
352
  {
295
353
  kWkggS: e == null ? e : "xl8spv7",
296
354
  $$css: !0
@@ -305,73 +363,74 @@ var L = 260, R = 56, z = 20, B = 12, V = 1e3, H = {
305
363
  $$css: !0
306
364
  }
307
365
  };
308
- function W(e) {
309
- let { title: t, description: n, points: r, xDomain: i, yDomain: a, xLabel: u, yLabel: d, formatX: m, formatY: h, selection: g, rangeSelection: v, emptyLabel: y } = e, { ref: b, width: x } = p(), S = q(e);
310
- if (S !== null) return /* @__PURE__ */ w(f, {
366
+ function ie(e) {
367
+ let { title: t, description: n, points: r, xDomain: i, yDomain: o, xLabel: c, yLabel: f, formatX: p, formatY: g, selection: _, rangeSelection: v, emptyLabel: b } = e, { ref: x, width: S } = h(), C = X(e);
368
+ if (C !== null) return /* @__PURE__ */ E(m, {
311
369
  title: t,
312
370
  description: n,
313
- message: S
371
+ message: C
314
372
  });
315
- let C = D({
373
+ let w = k({
316
374
  domain: [...i],
317
- range: [R, Math.max(R, x - z)]
318
- }), E = D({
319
- domain: [...a],
320
- range: [216, B]
321
- });
322
- return /* @__PURE__ */ T(c, {
375
+ range: [W, Math.max(W, S - G)]
376
+ }), T = k({
377
+ domain: [...o],
378
+ range: [216, K]
379
+ }), O = r.find((e) => e.id === _?.selectedId);
380
+ return /* @__PURE__ */ D(l, {
323
381
  title: t,
324
382
  description: n,
383
+ footer: _ !== void 0 && r.length > 0 ? /* @__PURE__ */ E(a, { children: O === void 0 ? "Select a point to inspect its label and coordinates." : `${O.label}, ${c}: ${p(O.x)}, ${f}: ${g(O.y)}` }) : void 0,
325
384
  children: [
326
- r.length === 0 ? /* @__PURE__ */ w("p", {
385
+ r.length === 0 ? /* @__PURE__ */ E("p", {
327
386
  className: "x1ghz6dp x153jb6y",
328
- children: y
329
- }) : /* @__PURE__ */ T("div", {
330
- ref: b,
387
+ children: b
388
+ }) : /* @__PURE__ */ D("div", {
389
+ ref: x,
331
390
  className: "x1n2onr6 xeuugli",
332
- children: [/* @__PURE__ */ w(G, {
333
- width: x,
334
- scaleX: C,
335
- scaleY: E,
391
+ children: [/* @__PURE__ */ E(Y, {
392
+ width: S,
393
+ scaleX: w,
394
+ scaleY: T,
336
395
  ...e
337
- }, `${i[0]}:${i[1]}:${a[0]}:${a[1]}:${x}`), g !== void 0 && /* @__PURE__ */ w("div", {
396
+ }, `${i[0]}:${i[1]}:${o[0]}:${o[1]}:${S}`), _ !== void 0 && /* @__PURE__ */ E("div", {
338
397
  className: "x10l6tqk x10a8y8t x1n71m9f x47corl",
339
- children: r.map((e) => /* @__PURE__ */ w("button", {
398
+ children: r.map((e) => /* @__PURE__ */ E("button", {
340
399
  type: "button",
341
400
  title: e.label,
342
- "aria-label": `${e.label}, ${u}: ${m(e.x)}, ${d}: ${h(e.y)}`,
343
- "aria-pressed": g.selectedId === e.id,
344
- onClick: () => g.onSelect(e.id),
345
- ..._.props(U.target, U.location(C(e.x), E(e.y))),
346
- children: /* @__PURE__ */ w("span", {
401
+ "aria-label": `${e.label}, ${c}: ${p(e.x)}, ${f}: ${g(e.y)}`,
402
+ "aria-pressed": _.selectedId === e.id,
403
+ onClick: () => _.onSelect(e.id),
404
+ ...y.props(J.target, J.location(w(e.x), T(e.y))),
405
+ children: /* @__PURE__ */ E("span", {
347
406
  "aria-hidden": !0,
348
- ..._.props(U.dot(s[e.tone]), g.selectedId === e.id && U.selected)
407
+ ...y.props(J.dot(u[e.tone]), _.selectedId === e.id && J.selected)
349
408
  })
350
409
  }, e.id))
351
410
  })]
352
411
  }),
353
- v !== void 0 && /* @__PURE__ */ w(K, {
412
+ v !== void 0 && /* @__PURE__ */ E(ae, {
354
413
  ...e,
355
414
  rangeSelection: v
356
415
  }),
357
- r.length > 0 && /* @__PURE__ */ w(l, { children: r.map((e) => /* @__PURE__ */ T(o, {
358
- label: `${e.label}, ${u}: ${m(e.x)}, ${d}: ${h(e.y)}`,
359
- selected: g?.selectedId === e.id,
360
- onSelect: g === void 0 ? void 0 : () => g.onSelect(e.id),
361
- children: [/* @__PURE__ */ w("span", { children: e.label }), /* @__PURE__ */ T("span", {
362
- className: "xss6m8b xuxw1ft x153jb6y",
416
+ r.length > 0 && /* @__PURE__ */ E(d, { children: r.map((e) => /* @__PURE__ */ D(s, {
417
+ label: `${e.label}, ${c}: ${p(e.x)}, ${f}: ${g(e.y)}`,
418
+ selected: _?.selectedId === e.id,
419
+ onSelect: _ === void 0 ? void 0 : () => _.onSelect(e.id),
420
+ children: [/* @__PURE__ */ E("span", { children: e.label }), /* @__PURE__ */ D("span", {
421
+ className: "xeuugli xss6m8b xj0a0fe x153jb6y",
363
422
  children: [
364
- m(e.x),
423
+ p(e.x),
365
424
  " · ",
366
- h(e.y)
425
+ g(e.y)
367
426
  ]
368
427
  })]
369
428
  }, e.id)) })
370
429
  ]
371
430
  });
372
431
  }
373
- function G({ width: e, scaleX: t, scaleY: n, points: r, xLabel: a, yLabel: o, formatX: c, formatY: l, selection: u, rangeSelection: d }) {
374
- let f = y(), [p, m] = S(null), h = p === null ? d?.value : {
432
+ function Y({ width: e, scaleX: t, scaleY: n, points: r, xLabel: i, yLabel: a, formatX: o, formatY: s, selection: l, rangeSelection: d }) {
433
+ let f = x(), [p, m] = w(null), h = p === null ? d?.value : {
375
434
  x: [Math.min(p.start.x, p.end.x), Math.max(p.start.x, p.end.x)],
376
435
  y: [Math.min(p.start.y, p.end.y), Math.max(p.start.y, p.end.y)]
377
436
  };
@@ -379,13 +438,13 @@ function G({ width: e, scaleX: t, scaleY: n, points: r, xLabel: a, yLabel: o, fo
379
438
  let i = r.currentTarget.getBoundingClientRect();
380
439
  return {
381
440
  x: t.copy().clamp(!0).invert((r.clientX - i.left) / i.width * e),
382
- y: n.copy().clamp(!0).invert((r.clientY - i.top) / i.height * L)
441
+ y: n.copy().clamp(!0).invert((r.clientY - i.top) / i.height * U)
383
442
  };
384
443
  }
385
- function v(t) {
444
+ function _(t) {
386
445
  if (d === void 0 || t.button !== 0 || t.pointerType === "touch") return;
387
- let n = t.currentTarget.getBoundingClientRect(), r = (t.clientX - n.left) / n.width * e, i = (t.clientY - n.top) / n.height * L;
388
- if (r < R || r > e - z || i < B || i > 216) return;
446
+ let n = t.currentTarget.getBoundingClientRect(), r = (t.clientX - n.left) / n.width * e, i = (t.clientY - n.top) / n.height * U;
447
+ if (r < W || r > e - G || i < K || i > 216) return;
389
448
  let a = g(t);
390
449
  t.currentTarget.setPointerCapture(t.pointerId), m({
391
450
  start: a,
@@ -393,13 +452,13 @@ function G({ width: e, scaleX: t, scaleY: n, points: r, xLabel: a, yLabel: o, fo
393
452
  pointerId: t.pointerId
394
453
  });
395
454
  }
396
- function b(e) {
455
+ function v(e) {
397
456
  p !== null && p.pointerId === e.pointerId && m({
398
457
  ...p,
399
458
  end: g(e)
400
459
  });
401
460
  }
402
- function x(e) {
461
+ function b(e) {
403
462
  if (p === null || p.pointerId !== e.pointerId) return;
404
463
  let t = g(e), n = {
405
464
  x: [Math.min(p.start.x, t.x), Math.max(p.start.x, t.x)],
@@ -407,99 +466,99 @@ function G({ width: e, scaleX: t, scaleY: n, points: r, xLabel: a, yLabel: o, fo
407
466
  };
408
467
  m(null), e.currentTarget.releasePointerCapture(e.pointerId), d?.onChange(n);
409
468
  }
410
- return /* @__PURE__ */ T("svg", {
469
+ return /* @__PURE__ */ D("svg", {
411
470
  width: e,
412
- height: L,
413
- viewBox: `0 0 ${e} ${L}`,
471
+ height: U,
472
+ viewBox: `0 0 ${e} ${U}`,
414
473
  "aria-hidden": !0,
415
- onPointerDown: v,
416
- onPointerMove: b,
417
- onPointerUp: x,
474
+ onPointerDown: _,
475
+ onPointerMove: v,
476
+ onPointerUp: b,
418
477
  onPointerCancel: () => m(null),
419
478
  onLostPointerCapture: () => m(null),
420
- ..._.props(i.svg, d !== void 0 && U.brush),
479
+ ...y.props(c.svg, d !== void 0 && J.brush),
421
480
  children: [
422
- /* @__PURE__ */ w("defs", { children: /* @__PURE__ */ w("clipPath", {
481
+ /* @__PURE__ */ E("defs", { children: /* @__PURE__ */ E("clipPath", {
423
482
  id: f,
424
- children: /* @__PURE__ */ w("rect", {
425
- x: R,
426
- y: B,
427
- width: Math.max(0, e - R - z),
483
+ children: /* @__PURE__ */ E("rect", {
484
+ x: W,
485
+ y: K,
486
+ width: Math.max(0, e - W - G),
428
487
  height: 204
429
488
  })
430
489
  }) }),
431
- t.ticks(5).map((e) => /* @__PURE__ */ T("g", { children: [/* @__PURE__ */ w("line", {
490
+ t.ticks(5).map((e) => /* @__PURE__ */ D("g", { children: [/* @__PURE__ */ E("line", {
432
491
  x1: t(e),
433
492
  x2: t(e),
434
- y1: B,
493
+ y1: K,
435
494
  y2: 216,
436
- ..._.props(i.grid)
437
- }), /* @__PURE__ */ w("text", {
495
+ ...y.props(c.grid)
496
+ }), /* @__PURE__ */ E("text", {
438
497
  x: t(e),
439
498
  y: 234,
440
499
  textAnchor: "middle",
441
- ..._.props(i.label),
442
- children: c(e)
500
+ ...y.props(c.label),
501
+ children: o(e)
443
502
  })] }, e)),
444
- n.ticks(4).map((t) => /* @__PURE__ */ T("g", { children: [/* @__PURE__ */ w("line", {
445
- x1: R,
446
- x2: e - z,
503
+ n.ticks(4).map((t) => /* @__PURE__ */ D("g", { children: [/* @__PURE__ */ E("line", {
504
+ x1: W,
505
+ x2: e - G,
447
506
  y1: n(t),
448
507
  y2: n(t),
449
- ..._.props(i.grid)
450
- }), /* @__PURE__ */ w("text", {
508
+ ...y.props(c.grid)
509
+ }), /* @__PURE__ */ E("text", {
451
510
  x: 48,
452
511
  y: n(t) + 4,
453
512
  textAnchor: "end",
454
- ..._.props(i.label),
455
- children: l(t)
513
+ ...y.props(c.label),
514
+ children: s(t)
456
515
  })] }, t)),
457
- /* @__PURE__ */ w("text", {
458
- x: (R + e - z) / 2,
516
+ /* @__PURE__ */ E("text", {
517
+ x: (W + e - G) / 2,
459
518
  y: 256,
460
519
  textAnchor: "middle",
461
- ..._.props(i.label),
462
- children: a
520
+ ...y.props(c.label),
521
+ children: i
463
522
  }),
464
- /* @__PURE__ */ w("text", {
523
+ /* @__PURE__ */ E("text", {
465
524
  x: 12,
466
525
  y: 108,
467
526
  textAnchor: "middle",
468
527
  transform: "rotate(-90 12 108)",
469
- ..._.props(i.label),
470
- children: o
528
+ ...y.props(c.label),
529
+ children: a
471
530
  }),
472
- /* @__PURE__ */ T("g", {
531
+ /* @__PURE__ */ D("g", {
473
532
  clipPath: `url(#${f})`,
474
- children: [h != null && /* @__PURE__ */ w("rect", {
533
+ children: [h != null && /* @__PURE__ */ E("rect", {
475
534
  x: t(h.x[0]),
476
535
  y: n(h.y[1]),
477
536
  width: t(h.x[1]) - t(h.x[0]),
478
537
  height: n(h.y[0]) - n(h.y[1]),
479
538
  className: "x1e0kj8g xv7c1pl x1tg5nk6 xnpr05h x15lqr97 x47corl"
480
- }), u === void 0 && r.map((e) => /* @__PURE__ */ w("circle", {
539
+ }), l === void 0 && r.map((e) => /* @__PURE__ */ E("circle", {
481
540
  cx: t(e.x),
482
541
  cy: n(e.y),
483
542
  r: 4,
484
- fill: s[e.tone]
543
+ fill: u[e.tone]
485
544
  }, e.id))]
486
545
  })
487
546
  ]
488
547
  });
489
548
  }
490
- function K({ rangeSelection: e, xDomain: t, yDomain: n, xLabel: r, yLabel: i, formatX: a, formatY: o }) {
549
+ function ae({ rangeSelection: e, xDomain: t, yDomain: n, xLabel: r, yLabel: i, formatX: a, formatY: o }) {
491
550
  let s = e.value ?? {
492
551
  x: t,
493
552
  y: n
494
553
  };
495
- return /* @__PURE__ */ T("fieldset", {
554
+ return /* @__PURE__ */ D("fieldset", {
496
555
  className: "xrvj5dj x1n8ia3y x1xxf3xd xc342km x1717udv xeuugli",
497
556
  children: [
498
- /* @__PURE__ */ w("legend", {
557
+ /* @__PURE__ */ E("legend", {
499
558
  className: "x153jb6y xy8obcc x1jfksii",
500
559
  children: "Drag with a mouse, or adjust these bounds to select a coordinate range."
501
560
  }),
502
- /* @__PURE__ */ T(h.Root, {
561
+ /* @__PURE__ */ D(_.Root, {
503
562
  value: s.x,
504
563
  min: t[0],
505
564
  max: t[1],
@@ -510,28 +569,28 @@ function K({ rangeSelection: e, xDomain: t, yDomain: n, xLabel: r, yLabel: i, fo
510
569
  x: t,
511
570
  y: s.y
512
571
  }),
513
- children: [/* @__PURE__ */ T("div", {
514
- className: "x78zum5 x1qughib x1hnptsi x153jb6y xy8obcc",
515
- children: [/* @__PURE__ */ w(h.Label, { children: r }), /* @__PURE__ */ T("span", { children: [
572
+ children: [/* @__PURE__ */ D("div", {
573
+ className: "x78zum5 x1a02dak x1qughib x1hnptsi x153jb6y xy8obcc xj0a0fe",
574
+ children: [/* @__PURE__ */ E(_.Label, { children: r }), /* @__PURE__ */ D("span", { children: [
516
575
  a(s.x[0]),
517
576
  " – ",
518
577
  a(s.x[1])
519
578
  ] })]
520
- }), /* @__PURE__ */ w(h.Control, { children: /* @__PURE__ */ T(h.Track, { children: [
521
- /* @__PURE__ */ w(h.Indicator, {}),
522
- /* @__PURE__ */ w(h.Thumb, {
579
+ }), /* @__PURE__ */ E(_.Control, { children: /* @__PURE__ */ D(_.Track, { children: [
580
+ /* @__PURE__ */ E(_.Indicator, {}),
581
+ /* @__PURE__ */ E(_.Thumb, {
523
582
  index: 0,
524
583
  "aria-label": `${r} minimum`,
525
584
  getAriaValueText: (e, t) => a(t)
526
585
  }),
527
- /* @__PURE__ */ w(h.Thumb, {
586
+ /* @__PURE__ */ E(_.Thumb, {
528
587
  index: 1,
529
588
  "aria-label": `${r} maximum`,
530
589
  getAriaValueText: (e, t) => a(t)
531
590
  })
532
591
  ] }) })]
533
592
  }),
534
- /* @__PURE__ */ T(h.Root, {
593
+ /* @__PURE__ */ D(_.Root, {
535
594
  value: s.y,
536
595
  min: n[0],
537
596
  max: n[1],
@@ -542,28 +601,28 @@ function K({ rangeSelection: e, xDomain: t, yDomain: n, xLabel: r, yLabel: i, fo
542
601
  x: s.x,
543
602
  y: t
544
603
  }),
545
- children: [/* @__PURE__ */ T("div", {
546
- className: "x78zum5 x1qughib x1hnptsi x153jb6y xy8obcc",
547
- children: [/* @__PURE__ */ w(h.Label, { children: i }), /* @__PURE__ */ T("span", { children: [
604
+ children: [/* @__PURE__ */ D("div", {
605
+ className: "x78zum5 x1a02dak x1qughib x1hnptsi x153jb6y xy8obcc xj0a0fe",
606
+ children: [/* @__PURE__ */ E(_.Label, { children: i }), /* @__PURE__ */ D("span", { children: [
548
607
  o(s.y[0]),
549
608
  " – ",
550
609
  o(s.y[1])
551
610
  ] })]
552
- }), /* @__PURE__ */ w(h.Control, { children: /* @__PURE__ */ T(h.Track, { children: [
553
- /* @__PURE__ */ w(h.Indicator, {}),
554
- /* @__PURE__ */ w(h.Thumb, {
611
+ }), /* @__PURE__ */ E(_.Control, { children: /* @__PURE__ */ D(_.Track, { children: [
612
+ /* @__PURE__ */ E(_.Indicator, {}),
613
+ /* @__PURE__ */ E(_.Thumb, {
555
614
  index: 0,
556
615
  "aria-label": `${i} minimum`,
557
616
  getAriaValueText: (e, t) => o(t)
558
617
  }),
559
- /* @__PURE__ */ w(h.Thumb, {
618
+ /* @__PURE__ */ E(_.Thumb, {
560
619
  index: 1,
561
620
  "aria-label": `${i} maximum`,
562
621
  getAriaValueText: (e, t) => o(t)
563
622
  })
564
623
  ] }) })]
565
624
  }),
566
- /* @__PURE__ */ w(m, {
625
+ /* @__PURE__ */ E(g, {
567
626
  type: "button",
568
627
  disabled: e.value === null,
569
628
  onClick: () => e.onChange(null),
@@ -572,10 +631,10 @@ function K({ rangeSelection: e, xDomain: t, yDomain: n, xLabel: r, yLabel: i, fo
572
631
  ]
573
632
  });
574
633
  }
575
- function q({ points: e, xDomain: t, yDomain: n, rangeSelection: r }) {
576
- if (!d(t) || !d(n)) return "Scatter domains must contain finite, increasing endpoints.";
577
- if (e.length > 1e3) return `This plot exceeds the ${V}-point render limit. Supply a smaller, labelled sample.`;
578
- if (!u(e)) return "Scatter points must have unique identifiers.";
634
+ function X({ points: e, xDomain: t, yDomain: n, rangeSelection: r }) {
635
+ if (!p(t) || !p(n)) return "Scatter domains must contain finite, increasing endpoints.";
636
+ if (e.length > 1e3) return `This plot exceeds the ${q}-point render limit. Supply a smaller, labelled sample.`;
637
+ if (!f(e)) return "Scatter points must have unique identifiers.";
579
638
  if (e.some((e) => !Number.isFinite(e.x) || !Number.isFinite(e.y))) return "Scatter coordinates must be finite.";
580
639
  if (e.some((e) => {
581
640
  let r = e.x < t[0] || e.x > t[1], i = e.y < n[0] || e.y > n[1];
@@ -585,18 +644,18 @@ function q({ points: e, xDomain: t, yDomain: n, rangeSelection: r }) {
585
644
  let i = Number.isFinite(r.xStep) && r.xStep > 0 && r.xStep <= t[1] - t[0], a = Number.isFinite(r.yStep) && r.yStep > 0 && r.yStep <= n[1] - n[0];
586
645
  if (!i || !a) return "Range selection steps must be finite, positive, and no larger than their domain span.";
587
646
  let o = r.value;
588
- return o === null ? null : !J(o.x, t) || !J(o.y, n) ? "The selected range must have finite, ordered bounds inside the declared domain." : null;
647
+ return o === null ? null : !Z(o.x, t) || !Z(o.y, n) ? "The selected range must have finite, ordered bounds inside the declared domain." : null;
589
648
  }
590
- function J(e, t) {
649
+ function Z(e, t) {
591
650
  return !e.every(Number.isFinite) || e[0] > e[1] ? !1 : e[0] >= t[0] && e[1] <= t[1];
592
651
  }
593
652
  // packages/charts/src/cartesian/time-series-data.ts
594
- var Y = {
653
+ var Q = {
595
654
  series: 12,
596
655
  pointsPerSeries: 2e3,
597
656
  markers: 200,
598
657
  panels: 12
599
- }, te = .01, ne = [
658
+ }, oe = .01, $ = [
600
659
  "series1",
601
660
  "series2",
602
661
  "series3",
@@ -604,13 +663,13 @@ var Y = {
604
663
  "series5",
605
664
  "series6"
606
665
  ];
607
- function re({ series: e, isStacked: t, markers: n }) {
666
+ function se({ series: e, isStacked: t, markers: n }) {
608
667
  let r = e[0]?.points.map((e) => e.timestamp) ?? [];
609
- if (e.length > Y.series || r.length > Y.pointsPerSeries || n.length > Y.markers) return `Choose a window with at most ${Y.series} series, ${Y.pointsPerSeries} observations per series, and ${Y.markers} markers.`;
610
- if (!u(e) || !u(n)) return "Series and markers require unique identifiers.";
668
+ if (e.length > Q.series || r.length > Q.pointsPerSeries || n.length > Q.markers) return `Choose a window with at most ${Q.series} series, ${Q.pointsPerSeries} observations per series, and ${Q.markers} markers.`;
669
+ if (!f(e) || !f(n)) return "Series and markers require unique identifiers.";
611
670
  for (let n of e) {
612
671
  if (n.points.length !== r.length) return "Every series must supply the same observation timestamps.";
613
- let e = X({
672
+ let e = de({
614
673
  points: n.points,
615
674
  timestamps: r,
616
675
  isStacked: t
@@ -628,7 +687,7 @@ function re({ series: e, isStacked: t, markers: n }) {
628
687
  if (!Number.isFinite(a) || !Number.isFinite(o)) return "The elapsed-time and value ranges must be finite.";
629
688
  if (t && r.some((t, n) => !Number.isFinite(e.reduce((e, t) => e + (t.points[n]?.value ?? 0), 0)))) return "Stacked observation totals must be finite.";
630
689
  }
631
- function ie({ series: e, markers: t, timestampUnit: n, isStacked: r }) {
690
+ function ce({ series: e, markers: t, timestampUnit: n, isStacked: r }) {
632
691
  return JSON.stringify([
633
692
  n,
634
693
  r,
@@ -648,15 +707,15 @@ function ie({ series: e, markers: t, timestampUnit: n, isStacked: r }) {
648
707
  ])
649
708
  ]);
650
709
  }
651
- function ae(e, t, n = !1) {
710
+ function le(e, t, n = !1) {
652
711
  if (e !== t) return [e, t];
653
- let r = Math.max(1, Math.abs(e) * te), i = n ? 0 : e - r, a = t + r;
712
+ let r = Math.max(1, Math.abs(e) * oe), i = n ? 0 : e - r, a = t + r;
654
713
  return [Number.isFinite(i) ? i : e, Number.isFinite(a) ? a : t];
655
714
  }
656
- function oe(e, t) {
715
+ function ue(e, t) {
657
716
  let n = e.filter((e) => e.tone === void 0);
658
717
  return e.map((r, i) => {
659
- let a = n.findIndex((e) => e.id === r.id), o = r.tone ?? ne[a % ne.length] ?? "series1", s = r.points.map((n, r) => {
718
+ let a = n.findIndex((e) => e.id === r.id), o = r.tone ?? $[a % $.length] ?? "series1", s = r.points.map((n, r) => {
660
719
  let a = t ? e.slice(0, i).reduce((e, t) => e + (t.points[r]?.value ?? 0), 0) : 0;
661
720
  return {
662
721
  ...n,
@@ -671,7 +730,7 @@ function oe(e, t) {
671
730
  };
672
731
  });
673
732
  }
674
- function X({ points: e, timestamps: t, isStacked: n }) {
733
+ function de({ points: e, timestamps: t, isStacked: n }) {
675
734
  for (let [r, i] of e.entries()) {
676
735
  let a = e[r - 1], o = a !== void 0 && i.timestamp <= a.timestamp;
677
736
  if (!Number.isFinite(i.timestamp) || i.timestamp !== t[r] || o) return "Observation timestamps must be finite, aligned, and strictly increasing.";
@@ -680,49 +739,49 @@ function X({ points: e, timestamps: t, isStacked: n }) {
680
739
  }
681
740
  }
682
741
  // packages/charts/src/cartesian/time-series-line.tsx
683
- function se({ series: e, x: t, y: n, inspectedTimestamp: r, pointRadius: a = 3 }) {
684
- return /* @__PURE__ */ T(C, { children: [/* @__PURE__ */ w(A, {
742
+ function fe({ series: e, x: t, y: n, inspectedTimestamp: r, pointRadius: i = 3 }) {
743
+ return /* @__PURE__ */ D(T, { children: [/* @__PURE__ */ E(j, {
685
744
  data: [...e.points],
686
745
  defined: (e) => e.value !== null,
687
746
  x: (e) => t(e.timestamp),
688
747
  y: (e) => n((e.value ?? 0) + e.base),
689
- stroke: s[e.tone],
690
- ..._.props(i.mark)
748
+ stroke: u[e.tone],
749
+ ...y.props(c.mark)
691
750
  }), e.points.filter((t, n) => {
692
751
  if (t.value === null) return !1;
693
752
  let i = e.points[n - 1]?.value === null || e.points[n + 1]?.value === null;
694
753
  return e.points.length === 1 || i || t.timestamp === r;
695
- }).map((r) => /* @__PURE__ */ w("circle", {
754
+ }).map((r) => /* @__PURE__ */ E("circle", {
696
755
  cx: t(r.timestamp),
697
756
  cy: n((r.value ?? 0) + r.base),
698
- r: a,
699
- fill: s[e.tone]
757
+ r: i,
758
+ fill: u[e.tone]
700
759
  }, r.timestamp))] });
701
760
  }
702
761
  // packages/charts/src/cartesian/sparkline.tsx
703
- function ce({ title: e, summary: t, unit: n, timestampUnit: r, series: i, valueDomain: a }) {
704
- let o = y(), s = y(), c = Z({
762
+ function pe({ title: e, summary: t, unit: n, timestampUnit: r, series: i, valueDomain: a }) {
763
+ let o = x(), s = x(), c = me({
705
764
  title: e,
706
765
  summary: t,
707
766
  unit: n,
708
767
  series: i,
709
768
  valueDomain: a
710
769
  }), l = i.points.some((e) => e.value !== null);
711
- if (c !== void 0 || !l) return /* @__PURE__ */ w("span", {
770
+ if (c !== void 0 || !l) return /* @__PURE__ */ E("span", {
712
771
  role: "img",
713
- "aria-label": `${e}. ${c ?? "No recorded values. Missing observations remain unavailable."}`,
772
+ "aria-label": `${e}. ${t} Values in ${n}; timestamps in ${r}. ${c ?? "No recorded values. Missing observations remain unavailable."}`,
714
773
  title: c ?? "No recorded values",
715
774
  className: "x2pejg6 x10w6t97 x2lah0s xxymvpz x3nfvp2 x6s0dn4 xl56j7k x153jb6y x1hz01jw xy8obcc",
716
775
  children: c === void 0 ? "No data" : "Invalid trend"
717
776
  });
718
- let u = i.points[0]?.timestamp ?? 0, d = i.points.at(-1)?.timestamp ?? u, f = D({
719
- domain: [...ae(u, d)],
777
+ let u = i.points[0]?.timestamp ?? 0, d = i.points.at(-1)?.timestamp ?? u, f = k({
778
+ domain: [...le(u, d)],
720
779
  range: [3, 125]
721
- }), p = D({
780
+ }), p = k({
722
781
  domain: [...a],
723
782
  range: [29, 3]
724
- }), m = oe([i], !1)[0];
725
- return /* @__PURE__ */ T("svg", {
783
+ }), m = ue([i], !1)[0];
784
+ return /* @__PURE__ */ D("svg", {
726
785
  role: "img",
727
786
  "aria-labelledby": o,
728
787
  "aria-describedby": s,
@@ -732,11 +791,11 @@ function ce({ title: e, summary: t, unit: n, timestampUnit: r, series: i, valueD
732
791
  height: 32,
733
792
  className: "x1rg5ohu x2pejg6 x10w6t97 x2lah0s xxymvpz",
734
793
  children: [
735
- /* @__PURE__ */ w("title", {
794
+ /* @__PURE__ */ E("title", {
736
795
  id: o,
737
796
  children: e
738
797
  }),
739
- /* @__PURE__ */ T("desc", {
798
+ /* @__PURE__ */ D("desc", {
740
799
  id: s,
741
800
  children: [
742
801
  t,
@@ -754,7 +813,7 @@ function ce({ title: e, summary: t, unit: n, timestampUnit: r, series: i, valueD
754
813
  "."
755
814
  ]
756
815
  }),
757
- m !== void 0 && /* @__PURE__ */ w(se, {
816
+ m !== void 0 && /* @__PURE__ */ E(fe, {
758
817
  series: m,
759
818
  x: f,
760
819
  y: p,
@@ -763,10 +822,10 @@ function ce({ title: e, summary: t, unit: n, timestampUnit: r, series: i, valueD
763
822
  ]
764
823
  });
765
824
  }
766
- function Z({ title: e, summary: t, unit: n, series: r, valueDomain: i }) {
825
+ function me({ title: e, summary: t, unit: n, series: r, valueDomain: i }) {
767
826
  if (e.trim() === "" || t.trim() === "" || n.trim() === "") return "A trend requires a title, a readable summary, and a value unit.";
768
- if (!d(i)) return "The displayed value domain must have finite, increasing bounds.";
769
- let a = re({
827
+ if (!p(i)) return "The displayed value domain must have finite, increasing bounds.";
828
+ let a = se({
770
829
  series: [r],
771
830
  isStacked: !1,
772
831
  markers: []
@@ -775,71 +834,92 @@ function Z({ title: e, summary: t, unit: n, series: r, valueDomain: i }) {
775
834
  if (r.points.some((e) => e.value !== null && (e.value < i[0] || e.value > i[1]))) return "Every recorded value must be inside the declared value domain.";
776
835
  }
777
836
  // packages/charts/src/cartesian/time-series.tsx
778
- var le = { plot: {
779
- k7Eaqz: "xeuugli",
780
- k3XXqK: "x1t137rt",
781
- kInvED: "x1hl8ikr",
782
- kZs9gx: "x19rmrnh",
783
- k7shQP: "x9v5kkp",
784
- kPJHz1: "x13qnu6",
785
- $$css: !0
786
- } };
787
- function ue(e) {
788
- return /* @__PURE__ */ w($, {
837
+ var he = {
838
+ plot: {
839
+ k7Eaqz: "xeuugli",
840
+ k3XXqK: "x1t137rt",
841
+ kInvED: "x2ssjo2",
842
+ kZs9gx: "x19rmrnh",
843
+ k7shQP: "x9v5kkp",
844
+ kPJHz1: "x13qnu6",
845
+ $$css: !0
846
+ },
847
+ timeAxis: {
848
+ k1xSpc: "x78zum5",
849
+ kjj79g: "x1qughib",
850
+ k1C7PZ: "x8zbtdt",
851
+ keoZOQ: "x1c87qhr",
852
+ kGuDYH: "xy8obcc",
853
+ kLWn49: "xas2l8k",
854
+ kMwMTN: "x153jb6y",
855
+ kcqcaj: "xss6m8b",
856
+ $$css: !0
857
+ },
858
+ timeAxisInset: (e, t) => [{
859
+ kZCmMZ: e == null ? e : "xnvo3vl",
860
+ kwRFfy: t == null ? t : "x120eax6",
861
+ $$css: !0
862
+ }, {
863
+ "--x-paddingInlineStart": ((e) => typeof e == "number" ? e + "px" : e ?? void 0)(e),
864
+ "--x-paddingInlineEnd": ((e) => typeof e == "number" ? e + "px" : e ?? void 0)(t)
865
+ }]
866
+ };
867
+ function ge(e) {
868
+ return /* @__PURE__ */ E(ye, {
789
869
  ...e,
790
870
  kind: "line",
791
871
  stacked: !1
792
872
  });
793
873
  }
794
- function Q({ stacked: e = !1, ...t }) {
795
- return /* @__PURE__ */ w($, {
874
+ function _e({ stacked: e = !1, ...t }) {
875
+ return /* @__PURE__ */ E(ye, {
796
876
  ...t,
797
877
  kind: "area",
798
878
  stacked: e
799
879
  });
800
880
  }
801
- function de({ charts: e, ...t }) {
802
- let n = x(null), [r, i] = S(), a = JSON.stringify(e.map((e) => [
881
+ function ve({ charts: e, ...t }) {
882
+ let n = C(null), [r, i] = w(), a = JSON.stringify(e.map((e) => [
803
883
  e.id,
804
884
  e.title,
805
- ie({
885
+ ce({
806
886
  series: e.series,
807
887
  markers: e.markers ?? [],
808
888
  timestampUnit: t.timestampUnit,
809
889
  isStacked: !1
810
890
  })
811
891
  ])), o = JSON.stringify(e[0]?.series[0]?.points.map((e) => e.timestamp) ?? []), s = e.every((e) => JSON.stringify(e.series[0]?.points.map((e) => e.timestamp) ?? []) === o);
812
- if (r !== void 0 && r.signature !== a && i(void 0), v(() => {
892
+ if (r !== void 0 && r.signature !== a && i(void 0), b(() => {
813
893
  function e(e) {
814
894
  e.target instanceof Node && n.current?.contains(e.target) !== !0 && i(void 0);
815
895
  }
816
896
  return document.addEventListener("pointerdown", e), () => document.removeEventListener("pointerdown", e);
817
- }, []), !s || !u(e)) return /* @__PURE__ */ w(f, {
897
+ }, []), !s || !f(e)) return /* @__PURE__ */ E(m, {
818
898
  title: "Small multiples",
819
899
  message: "Charts need unique identifiers and aligned observation timestamps."
820
900
  });
821
- if (e.length > Y.panels) return /* @__PURE__ */ w(f, {
901
+ if (e.length > Q.panels) return /* @__PURE__ */ E(m, {
822
902
  title: "Small multiples",
823
- message: `Choose at most ${Y.panels} panels.`
903
+ message: `Choose at most ${Q.panels} panels.`
824
904
  });
825
- if (e.length === 0) return /* @__PURE__ */ w(c, {
905
+ if (e.length === 0) return /* @__PURE__ */ E(l, {
826
906
  title: "Small multiples",
827
- children: /* @__PURE__ */ w("p", {
907
+ children: /* @__PURE__ */ E("p", {
828
908
  className: "x153jb6y",
829
909
  children: "No charts"
830
910
  })
831
911
  });
832
- let l = {
912
+ let c = {
833
913
  value: r?.signature === a ? r : void 0,
834
914
  onChange: (e) => i(e === void 0 ? void 0 : {
835
915
  ...e,
836
916
  signature: a
837
917
  })
838
- }, d = Math.max(52, ...e.flatMap((e) => e.series.flatMap((t) => t.points.flatMap((t) => t.value === null || !Number.isFinite(t.value) ? [] : [e.formatValue(t.value).length * 7 + 12]))));
839
- return /* @__PURE__ */ w("div", {
918
+ }, u = Math.max(52, ...e.flatMap((e) => e.series.flatMap((t) => t.points.flatMap((t) => t.value === null || !Number.isFinite(t.value) ? [] : [e.formatValue(t.value).length * 7 + 12]))));
919
+ return /* @__PURE__ */ E("div", {
840
920
  ref: n,
841
921
  className: "xrvj5dj x1j825kq",
842
- children: e.map((e) => /* @__PURE__ */ w($, {
922
+ children: e.map((e) => /* @__PURE__ */ E(ye, {
843
923
  ...t,
844
924
  title: e.title,
845
925
  description: e.description,
@@ -848,73 +928,74 @@ function de({ charts: e, ...t }) {
848
928
  markers: e.markers,
849
929
  kind: "line",
850
930
  stacked: !1,
851
- sharedInspection: l,
852
- axisWidth: d
931
+ sharedInspection: c,
932
+ axisWidth: u
853
933
  }, e.id))
854
934
  });
855
935
  }
856
- function $({ title: e, description: t, series: n, timestampUnit: r, formatTimestamp: o, formatValue: u, markers: d = [], height: m = 180, actions: h, kind: E, stacked: k, sharedInspection: A, axisWidth: ee }) {
857
- let j = !Number.isFinite(m) || m < 48 ? "Chart height must be at least 48 pixels." : re({
936
+ function ye({ title: e, description: t, series: n, timestampUnit: r, formatTimestamp: i, formatValue: a, markers: s = [], height: f = 180, actions: p, kind: g, stacked: _, sharedInspection: O, axisWidth: ee }) {
937
+ let j = !Number.isFinite(f) || f < 48 ? "Chart height must be at least 48 pixels." : se({
858
938
  series: n,
859
- isStacked: k,
860
- markers: d
861
- }), M = b(() => j === void 0 ? oe(n, k) : [], [
939
+ isStacked: _,
940
+ markers: s
941
+ }), M = S(() => j === void 0 ? ue(n, _) : [], [
862
942
  n,
863
- k,
943
+ _,
864
944
  j
865
- ]), N = M[0]?.points ?? [], { ref: P, width: F, element: I } = p(), L = x(null), [R, z] = S(), B = ie({
945
+ ]), N = M[0]?.points ?? [], { ref: te, width: P, element: ne } = h(), F = C(null), [I, L] = w(), R = ce({
866
946
  series: n,
867
- markers: d,
947
+ markers: s,
868
948
  timestampUnit: r,
869
- isStacked: k
870
- }), V = A === void 0 ? R?.signature === B ? R : void 0 : A.value, H = y();
871
- R !== void 0 && (R.signature !== B || j !== void 0) && z(void 0);
872
- let U = A !== void 0;
873
- if (v(() => {
874
- if (U) return;
949
+ isStacked: _
950
+ }), z = O === void 0 ? I?.signature === R ? I : void 0 : O.value, B = x();
951
+ I !== void 0 && (I.signature !== R || j !== void 0) && L(void 0);
952
+ let V = O !== void 0;
953
+ if (b(() => {
954
+ if (V) return;
875
955
  function e(e) {
876
- e.target instanceof Node && L.current?.contains(e.target) !== !0 && z(void 0);
956
+ e.target instanceof Node && F.current?.contains(e.target) !== !0 && L(void 0);
877
957
  }
878
958
  return document.addEventListener("pointerdown", e), () => document.removeEventListener("pointerdown", e);
879
- }, [U]), j !== void 0) return /* @__PURE__ */ w(f, {
959
+ }, [V]), j !== void 0) return /* @__PURE__ */ E(m, {
880
960
  title: e,
881
961
  description: t,
882
962
  message: j
883
963
  });
884
- if (N.length === 0) return /* @__PURE__ */ w(c, {
964
+ if (N.length === 0) return /* @__PURE__ */ E(l, {
885
965
  title: e,
886
966
  description: t,
887
- actions: h,
888
- children: /* @__PURE__ */ w("p", {
967
+ actions: p,
968
+ children: /* @__PURE__ */ E("p", {
889
969
  className: "x153jb6y",
890
970
  children: "No observations"
891
971
  })
892
972
  });
893
- let W = m - 28, G = N[0]?.timestamp ?? 0, K = N.at(-1)?.timestamp ?? G, q = M.flatMap((e) => e.points.flatMap((e) => e.value === null ? [] : [e.value + e.base])), J = E === "area" ? Math.min(0, ...q) : Math.min(...q), Y = E === "area" ? Math.max(0, ...q) : Math.max(...q), te = q.length === 0 ? 0 : J, ne = q.length === 0 ? 1 : Y, X = D({
894
- domain: [...ae(te, ne, E === "area")],
895
- range: [W, 12]
896
- }), ce = X.ticks(3), Z = ee ?? Math.max(52, ...ce.map((e) => u(e).length * 7 + 12)), ue = Math.max(Z + 1, F - 16), Q = D({
897
- domain: [...ae(G, K)],
898
- range: [Z, ue]
973
+ let H = f - 28, U = H + 12, W = N[0]?.timestamp ?? 0, G = N.at(-1)?.timestamp ?? W, K = M.flatMap((e) => e.points.flatMap((e) => e.value === null ? [] : [e.value + e.base])), q = g === "area" ? Math.min(0, ...K) : Math.min(...K), re = g === "area" ? Math.max(0, ...K) : Math.max(...K), J = K.length === 0 ? 0 : q, ie = K.length === 0 ? 1 : re, Y = k({
974
+ domain: [...le(J, ie, g === "area")],
975
+ range: [H, 12]
976
+ }), ae = Y.ticks(3), X = ee ?? Math.max(52, ...ae.map((e) => a(e).length * 7 + 12)), Z = Math.max(X + 1, P - 16), Q = k({
977
+ domain: [...le(W, G)],
978
+ range: [X, Z]
899
979
  });
900
- function de(e) {
901
- let t = I?.getBoundingClientRect();
980
+ function oe(e) {
981
+ let t = ne?.getBoundingClientRect();
902
982
  if (t === void 0) return;
903
983
  let n = Q.invert(e - t.left), r = N.find((e, t) => {
904
984
  let r = N[t + 1];
905
985
  return r === void 0 || n <= e.timestamp + (r.timestamp - e.timestamp) / 2;
906
986
  });
907
987
  r !== void 0 && $({
908
- signature: B,
988
+ signature: R,
909
989
  timestamp: r.timestamp,
910
990
  source: "pointer"
911
991
  });
912
992
  }
913
993
  function $(e) {
914
- A === void 0 ? z(e) : A.onChange(e);
994
+ O === void 0 ? L(e) : O.onChange(e);
915
995
  }
916
- function fe(e) {
917
- let t = N.findIndex((e) => e.timestamp === V?.timestamp), n = {
996
+ function de(e) {
997
+ if (e.altKey || e.ctrlKey || e.metaKey) return;
998
+ let t = N.findIndex((e) => e.timestamp === z?.timestamp), n = {
918
999
  ArrowRight: Math.min(N.length - 1, t + 1),
919
1000
  ArrowLeft: Math.max(0, t - 1),
920
1001
  Home: 0,
@@ -922,7 +1003,7 @@ function $({ title: e, description: t, series: n, timestampUnit: r, formatTimest
922
1003
  };
923
1004
  switch (e.key) {
924
1005
  case "Escape":
925
- e.preventDefault(), $(void 0);
1006
+ e.preventDefault(), e.stopPropagation(), $(void 0);
926
1007
  break;
927
1008
  case "ArrowRight":
928
1009
  case "ArrowLeft":
@@ -931,7 +1012,7 @@ function $({ title: e, description: t, series: n, timestampUnit: r, formatTimest
931
1012
  e.preventDefault();
932
1013
  let t = N[n[e.key]];
933
1014
  t !== void 0 && $({
934
- signature: B,
1015
+ signature: R,
935
1016
  timestamp: t.timestamp,
936
1017
  source: "keyboard"
937
1018
  });
@@ -939,165 +1020,163 @@ function $({ title: e, description: t, series: n, timestampUnit: r, formatTimest
939
1020
  }
940
1021
  }
941
1022
  }
942
- return /* @__PURE__ */ w("div", {
943
- ref: L,
1023
+ return /* @__PURE__ */ E("div", {
1024
+ ref: F,
944
1025
  className: "xeuugli",
945
- children: /* @__PURE__ */ T(c, {
1026
+ children: /* @__PURE__ */ D(l, {
946
1027
  title: e,
947
1028
  description: t,
948
- actions: h,
949
- children: [/* @__PURE__ */ T("div", {
1029
+ actions: p,
1030
+ children: [/* @__PURE__ */ D("div", {
950
1031
  className: "xrvj5dj x1n8ia3y",
951
1032
  children: [
952
- /* @__PURE__ */ w(a, { items: M.map(({ id: e, label: t, tone: n }) => ({
1033
+ /* @__PURE__ */ E(o, { items: M.map(({ id: e, label: t, tone: n }) => ({
953
1034
  id: e,
954
1035
  label: t,
955
1036
  tone: n
956
1037
  })) }),
957
- /* @__PURE__ */ w("div", {
958
- ref: P,
959
- ..._.props(i.plot),
960
- children: /* @__PURE__ */ T("svg", {
1038
+ /* @__PURE__ */ D("div", {
1039
+ ref: te,
1040
+ ...y.props(c.plot),
1041
+ children: [/* @__PURE__ */ D("svg", {
961
1042
  role: "img",
962
1043
  "aria-label": `${e}. Use arrow keys to inspect observations.`,
963
- "aria-describedby": H,
1044
+ "aria-describedby": B,
964
1045
  tabIndex: 0,
965
- viewBox: `0 0 ${F} ${m}`,
966
- height: m,
967
- onKeyDown: fe,
1046
+ viewBox: `0 0 ${P} ${U}`,
1047
+ height: U,
1048
+ onKeyDown: de,
968
1049
  onPointerMove: (e) => {
969
- e.pointerType === "mouse" && de(e.clientX);
1050
+ e.pointerType === "mouse" && oe(e.clientX);
970
1051
  },
971
- onPointerDown: (e) => de(e.clientX),
972
- ..._.props(i.svg, le.plot),
1052
+ onPointerDown: (e) => oe(e.clientX),
1053
+ ...y.props(c.svg, he.plot),
973
1054
  children: [
974
- ce.map((e) => /* @__PURE__ */ T("g", { children: [/* @__PURE__ */ w("line", {
975
- x1: Z,
976
- x2: ue,
977
- y1: X(e),
978
- y2: X(e),
979
- ..._.props(i.grid)
980
- }), /* @__PURE__ */ w("text", {
981
- x: Z - 8,
982
- y: X(e),
1055
+ ae.map((e) => /* @__PURE__ */ D("g", { children: [/* @__PURE__ */ E("line", {
1056
+ x1: X,
1057
+ x2: Z,
1058
+ y1: Y(e),
1059
+ y2: Y(e),
1060
+ ...y.props(c.grid)
1061
+ }), /* @__PURE__ */ E("text", {
1062
+ x: X - 8,
1063
+ y: Y(e),
983
1064
  textAnchor: "end",
984
1065
  dominantBaseline: "middle",
985
- ..._.props(i.label),
986
- children: u(e)
1066
+ ...y.props(c.label),
1067
+ children: a(e)
987
1068
  })] }, e)),
988
- M.map((e) => /* @__PURE__ */ T("g", { children: [E === "area" && /* @__PURE__ */ w(O, {
1069
+ M.map((e) => /* @__PURE__ */ D("g", { children: [g === "area" && /* @__PURE__ */ E(A, {
989
1070
  data: [...e.points],
990
1071
  defined: (e) => e.value !== null,
991
1072
  x: (e) => Q(e.timestamp),
992
- y0: (e) => X(e.base),
993
- y1: (e) => X((e.value ?? 0) + e.base),
994
- yScale: X,
995
- fill: s[e.tone],
996
- fillOpacity: k ? .65 : .15
997
- }), /* @__PURE__ */ w(se, {
1073
+ y0: (e) => Y(e.base),
1074
+ y1: (e) => Y((e.value ?? 0) + e.base),
1075
+ yScale: Y,
1076
+ fill: u[e.tone],
1077
+ fillOpacity: _ ? .65 : .15
1078
+ }), /* @__PURE__ */ E(fe, {
998
1079
  series: e,
999
1080
  x: Q,
1000
- y: X,
1001
- inspectedTimestamp: V?.timestamp
1081
+ y: Y,
1082
+ inspectedTimestamp: z?.timestamp
1002
1083
  })] }, e.id)),
1003
- d.map((e) => /* @__PURE__ */ T("g", { children: [e.kind === "time" ? /* @__PURE__ */ w("line", {
1084
+ s.map((e) => /* @__PURE__ */ D("g", { children: [e.kind === "time" ? /* @__PURE__ */ E("line", {
1004
1085
  x1: Q(e.timestamp),
1005
1086
  x2: Q(e.timestamp),
1006
1087
  y1: 12,
1007
- y2: W,
1088
+ y2: H,
1008
1089
  className: "xhq4mlf x1ntoi03 x13efnbd"
1009
- }) : /* @__PURE__ */ w("circle", {
1090
+ }) : /* @__PURE__ */ E("circle", {
1010
1091
  cx: Q(e.timestamp),
1011
- cy: X(e.value + (M.find((t) => t.id === e.seriesId)?.points.find((t) => t.timestamp === e.timestamp)?.base ?? 0)),
1092
+ cy: Y(e.value + (M.find((t) => t.id === e.seriesId)?.points.find((t) => t.timestamp === e.timestamp)?.base ?? 0)),
1012
1093
  r: 4,
1013
- fill: g.surface,
1014
- ..._.props(i.selected)
1015
- }), /* @__PURE__ */ w("title", { children: e.kind === "point" ? `${e.label}: ${u(e.value)}` : e.label })] }, e.id)),
1016
- V !== void 0 && /* @__PURE__ */ w("line", {
1017
- x1: Q(V.timestamp),
1018
- x2: Q(V.timestamp),
1094
+ fill: v.surface,
1095
+ ...y.props(c.selected)
1096
+ }), /* @__PURE__ */ E("title", { children: e.kind === "point" ? `${e.label}: ${a(e.value)}` : e.label })] }, e.id)),
1097
+ z !== void 0 && /* @__PURE__ */ E("line", {
1098
+ x1: Q(z.timestamp),
1099
+ x2: Q(z.timestamp),
1019
1100
  y1: 12,
1020
- y2: W,
1101
+ y2: H,
1021
1102
  className: "xhq4mlf x1ntoi03 x13efnbd"
1022
- }),
1023
- /* @__PURE__ */ w("text", {
1024
- x: Z,
1025
- y: m - 4,
1026
- ..._.props(i.label),
1027
- children: o(G)
1028
- }),
1029
- K !== G && /* @__PURE__ */ w("text", {
1030
- x: ue,
1031
- y: m - 4,
1032
- textAnchor: "end",
1033
- ..._.props(i.label),
1034
- children: o(K)
1035
1103
  })
1036
1104
  ]
1037
- })
1105
+ }), /* @__PURE__ */ D("div", {
1106
+ "aria-hidden": !0,
1107
+ ...y.props(he.timeAxis, he.timeAxisInset(X, Math.max(0, P - Z))),
1108
+ children: [/* @__PURE__ */ E("span", {
1109
+ className: "x1cqoux5 xeuugli xj0a0fe",
1110
+ children: i(W)
1111
+ }), G !== W && /* @__PURE__ */ E("span", {
1112
+ className: "x1cqoux5 xeuugli xj0a0fe xp4054r",
1113
+ children: i(G)
1114
+ })]
1115
+ })]
1038
1116
  }),
1039
- /* @__PURE__ */ w("div", {
1040
- id: H,
1041
- "aria-live": V?.source === "keyboard" ? "polite" : "off",
1042
- className: "x78zum5 x1a02dak x1pha0wt x8zbtdt x1gkm1c7 xy8obcc xas2l8k x1mqbd49",
1043
- children: V === void 0 ? /* @__PURE__ */ w("span", {
1117
+ /* @__PURE__ */ E("div", {
1118
+ id: B,
1119
+ "aria-live": z?.source === "keyboard" ? "polite" : "off",
1120
+ className: "x78zum5 x1a02dak x1pha0wt x8zbtdt x1gkm1c7 xy8obcc xas2l8k x1mqbd49 xj0a0fe",
1121
+ children: z === void 0 ? /* @__PURE__ */ E("span", {
1044
1122
  className: "x153jb6y",
1045
1123
  children: "Point, tap, or use the arrow keys to inspect values."
1046
- }) : /* @__PURE__ */ T(C, { children: [
1047
- /* @__PURE__ */ w("span", { children: o(V.timestamp) }),
1048
- /* @__PURE__ */ w("dl", {
1049
- className: "x78zum5 x1a02dak x1n8ia3y x1ghz6dp",
1124
+ }) : /* @__PURE__ */ D(T, { children: [
1125
+ /* @__PURE__ */ E("span", { children: i(z.timestamp) }),
1126
+ /* @__PURE__ */ E("dl", {
1127
+ className: "x78zum5 x1a02dak x8zbtdt x1gkm1c7 x1ghz6dp xeuugli",
1050
1128
  children: M.map((e) => {
1051
- let t = e.points.find((e) => e.timestamp === V.timestamp);
1052
- return /* @__PURE__ */ T("div", {
1053
- className: "x78zum5 xunmzkg x1ghz6dp xss6m8b",
1054
- children: [/* @__PURE__ */ w("dt", { children: e.label }), /* @__PURE__ */ w("dd", {
1129
+ let t = e.points.find((e) => e.timestamp === z.timestamp);
1130
+ return /* @__PURE__ */ D("div", {
1131
+ className: "x78zum5 x1a02dak xunmzkg x1ghz6dp xeuugli xss6m8b",
1132
+ children: [/* @__PURE__ */ E("dt", { children: e.label }), /* @__PURE__ */ E("dd", {
1055
1133
  className: "x1ghz6dp xbixft",
1056
- children: t?.value === null || t === void 0 ? "Unavailable" : u(t.value)
1134
+ children: t?.value === null || t === void 0 ? "Unavailable" : a(t.value)
1057
1135
  })]
1058
1136
  }, e.id);
1059
1137
  })
1060
1138
  }),
1061
- d.filter((e) => e.timestamp === V.timestamp).map((e) => /* @__PURE__ */ w("span", { children: e.label }, e.id))
1139
+ s.filter((e) => e.timestamp === z.timestamp).map((e) => /* @__PURE__ */ E("span", { children: e.label }, e.id))
1062
1140
  ] })
1063
1141
  }),
1064
- d.length > 0 && /* @__PURE__ */ w("ul", {
1065
- className: "x78zum5 x1a02dak x1n8ia3y x1ghz6dp x1717udv xe8uvvx xy8obcc x153jb6y",
1066
- children: d.map((e) => /* @__PURE__ */ T("li", { children: [
1067
- o(e.timestamp),
1142
+ s.length > 0 && /* @__PURE__ */ E("ul", {
1143
+ className: "x78zum5 x1a02dak x1n8ia3y x1ghz6dp x1717udv xe8uvvx xy8obcc x153jb6y xj0a0fe",
1144
+ children: s.map((e) => /* @__PURE__ */ D("li", { children: [
1145
+ i(e.timestamp),
1068
1146
  " · ",
1069
1147
  e.label,
1070
- e.kind === "point" && ` · ${u(e.value)}`
1148
+ e.kind === "point" && ` · ${a(e.value)}`
1071
1149
  ] }, e.id))
1072
1150
  })
1073
1151
  ]
1074
- }), /* @__PURE__ */ w(l, { children: /* @__PURE__ */ T("table", {
1152
+ }), /* @__PURE__ */ E(d, { children: /* @__PURE__ */ D("table", {
1075
1153
  className: "xh8yej3 x1mwwwfo xy8obcc x1yc453h xss6m8b",
1076
1154
  children: [
1077
- /* @__PURE__ */ T("caption", { children: [e, " observations"] }),
1078
- /* @__PURE__ */ w("thead", { children: /* @__PURE__ */ T("tr", { children: [/* @__PURE__ */ T("th", {
1079
- className: "x69ldcm x1yc453h xso031l x1q0q8m5 x1qndepd xo1l8bm",
1155
+ /* @__PURE__ */ D("caption", { children: [e, " observations"] }),
1156
+ /* @__PURE__ */ E("thead", { children: /* @__PURE__ */ D("tr", { children: [/* @__PURE__ */ D("th", {
1157
+ scope: "col",
1158
+ className: "x69ldcm x1yc453h xso031l x1q0q8m5 x1qndepd xj57cvi",
1080
1159
  children: [
1081
1160
  "Time (",
1082
1161
  r,
1083
1162
  ")"
1084
1163
  ]
1085
- }), M.map((e) => /* @__PURE__ */ w("th", {
1164
+ }), M.map((e) => /* @__PURE__ */ E("th", {
1086
1165
  scope: "col",
1087
- className: "x69ldcm x1yc453h xso031l x1q0q8m5 x1qndepd xo1l8bm",
1166
+ className: "x69ldcm x1yc453h xso031l x1q0q8m5 x1qndepd xj57cvi",
1088
1167
  children: e.label
1089
1168
  }, e.id))] }) }),
1090
- /* @__PURE__ */ w("tbody", { children: N.map((e, t) => /* @__PURE__ */ T("tr", { children: [/* @__PURE__ */ w("th", {
1169
+ /* @__PURE__ */ E("tbody", { children: N.map((e, t) => /* @__PURE__ */ D("tr", { children: [/* @__PURE__ */ E("th", {
1091
1170
  scope: "row",
1092
- className: "x69ldcm x1yc453h xso031l x1q0q8m5 x1qndepd xo1l8bm",
1093
- children: o(e.timestamp)
1094
- }), M.map((e) => /* @__PURE__ */ w("td", {
1095
- className: "x69ldcm x1yc453h xso031l x1q0q8m5 x1qndepd xo1l8bm",
1096
- children: e.points[t]?.value === null || e.points[t]?.value === void 0 ? "Unavailable" : u(e.points[t].value)
1171
+ className: "x69ldcm x1yc453h xso031l x1q0q8m5 x1qndepd xj57cvi",
1172
+ children: i(e.timestamp)
1173
+ }), M.map((e) => /* @__PURE__ */ E("td", {
1174
+ className: "x69ldcm x1yc453h xso031l x1q0q8m5 x1qndepd xj57cvi",
1175
+ children: e.points[t]?.value === null || e.points[t]?.value === void 0 ? "Unavailable" : a(e.points[t].value)
1097
1176
  }, e.id))] }, e.timestamp)) })
1098
1177
  ]
1099
1178
  }) })]
1100
1179
  })
1101
1180
  });
1102
1181
  }
1103
- export { Q as AreaChart, N as BarChart, I as BreakdownBar, ue as LineChart, V as MAX_SCATTER_POINTS, W as ScatterPlot, de as SmallMultiples, ce as Sparkline, Y as timeSeriesLimits };
1182
+ export { _e as AreaChart, R as BarChart, F as BarChartPlaceholder, H as BreakdownBar, ge as LineChart, q as MAX_SCATTER_POINTS, ie as ScatterPlot, ve as SmallMultiples, pe as Sparkline, Q as timeSeriesLimits };