@mechane-ai/elements 0.35.1 → 0.36.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 (39) hide show
  1. package/dist/ai.js +4 -4
  2. package/dist/chart-frame-C0UBu4ku.js +213 -0
  3. package/dist/{chart-input-CN8PMrni.js → chart-input-Ccr2NJ6J.js} +2 -2
  4. package/dist/{categorical-values-DpnNvPkc.js → chart-theme-Bwr9YSP1.js} +56 -5
  5. package/dist/charts/cartesian.js +613 -616
  6. package/dist/charts/distribution.js +77 -76
  7. package/dist/charts/graph.js +29 -28
  8. package/dist/charts/hierarchy.js +32 -31
  9. package/dist/charts/matrix.js +48 -47
  10. package/dist/charts/timeline.js +2 -2
  11. package/dist/charts.js +3 -1
  12. package/dist/collections.js +314 -267
  13. package/dist/elements.css +14 -0
  14. package/dist/feedback.js +1 -1
  15. package/dist/forms/dates.js +86 -63
  16. package/dist/forms.js +2 -2
  17. package/dist/packages/charts/src/cartesian/bar-data.d.ts +1 -1
  18. package/dist/packages/charts/src/cartesian/scatter-plot.d.ts +1 -1
  19. package/dist/packages/charts/src/cartesian/time-series-data.d.ts +1 -1
  20. package/dist/packages/charts/src/categorical-values.d.ts +1 -1
  21. package/dist/packages/charts/src/chart-series-marker.d.ts +7 -0
  22. package/dist/packages/charts/src/chart-theme.d.ts +1 -2
  23. package/dist/packages/charts/src/distribution/ecdf.d.ts +1 -1
  24. package/dist/packages/charts/src/distribution/histogram.d.ts +1 -1
  25. package/dist/packages/charts/src/distribution/interval-plot.d.ts +1 -1
  26. package/dist/packages/charts/src/distribution/ranked-bars.d.ts +1 -1
  27. package/dist/packages/charts/src/graph/relation-graph.d.ts +1 -1
  28. package/dist/packages/charts/src/index.d.ts +4 -2
  29. package/dist/packages/collections/src/data-table.d.ts +6 -4
  30. package/dist/packages/feedback/src/progress.d.ts +8 -2
  31. package/dist/packages/forms/src/dates/civil.d.ts +6 -4
  32. package/dist/packages/forms/src/dates/index.d.ts +1 -0
  33. package/dist/packages/forms/src/index.d.ts +2 -0
  34. package/dist/packages/forms/src/select-control.d.ts +26 -0
  35. package/dist/packages/foundations/src/chart-tones.d.ts +2 -0
  36. package/dist/{src-BYKjPC-0.js → src-CoFxE4Cj.js} +282 -227
  37. package/dist/{src-BHllGfI8.js → src-DXdsMc_Z.js} +415 -307
  38. package/package.json +1 -1
  39. package/dist/chart-frame-BV0IPZtQ.js +0 -270
@@ -1,29 +1,29 @@
1
- import { d as e, u as t } from "../src-BHllGfI8.js";
2
- import { i as n, n as r, r as i, t as a } from "../categorical-values-DpnNvPkc.js";
3
- import { t as o } from "../accessibility-C-aIZ1Yx.js";
4
- import { a as s, n as c, o as l, r as u, s as d, t as f } from "../chart-frame-BV0IPZtQ.js";
5
- import { n as p, r as m, t as h } from "../chart-input-CN8PMrni.js";
6
- import { r as g } from "../tokens.stylex-CJbIDPB9.js";
7
- import { t as _ } from "../plot-width--OgdohB5.js";
8
- import { D as v } from "../src-C-Sx37kz.js";
9
- import { p as y } from "../src-BYKjPC-0.js";
10
- import * as b from "@stylexjs/stylex";
11
- import { useEffect as x, useId as S, useMemo as C, useRef as ee, useState as w } from "react";
12
- import { Fragment as T, jsx as E, jsxs as D } from "react/jsx-runtime";
13
- import { scaleBand as O, scaleLinear as k } from "@visx/scale";
14
- import { AreaClosed as te, Bar as A, LinePath as j } from "@visx/shape";
1
+ import { c as e, d as t, f as n } from "../src-DXdsMc_Z.js";
2
+ import { a as r, i, n as a, r as o, t as s } from "../chart-theme-Bwr9YSP1.js";
3
+ import { t as c } from "../accessibility-C-aIZ1Yx.js";
4
+ import { a as l, n as u, o as d, r as f, t as p } from "../chart-frame-C0UBu4ku.js";
5
+ import { n as m, r as h, t as g } from "../chart-input-Ccr2NJ6J.js";
6
+ import { r as _ } from "../tokens.stylex-CJbIDPB9.js";
7
+ import { t as v } from "../plot-width--OgdohB5.js";
8
+ import { D as y } from "../src-C-Sx37kz.js";
9
+ import { m as b } from "../src-CoFxE4Cj.js";
10
+ import * as x from "@stylexjs/stylex";
11
+ import { useEffect as ee, useId as S, useMemo as te, useRef as ne, useState as C } from "react";
12
+ import { Fragment as w, jsx as T, jsxs as E } from "react/jsx-runtime";
13
+ import { scaleBand as D, scaleLinear as O } from "@visx/scale";
14
+ import { AreaClosed as re, Bar as k, LinePath as A } from "@visx/shape";
15
15
  // packages/charts/src/chart-cursor.tsx
16
- function ne({ x: e, top: t, bottom: n, width: r }) {
17
- return /* @__PURE__ */ D("g", {
16
+ function ie({ x: e, top: t, bottom: n, width: r }) {
17
+ return /* @__PURE__ */ E("g", {
18
18
  "aria-hidden": !0,
19
19
  className: "xlshs6z xgs60n x17y187c xbabvq0 x47corl",
20
- children: [/* @__PURE__ */ E("line", {
20
+ children: [/* @__PURE__ */ T("line", {
21
21
  x1: e,
22
22
  x2: e,
23
23
  y1: t,
24
24
  y2: n,
25
25
  className: "xnpr05h x1ntoi03 x13efnbd"
26
- }), /* @__PURE__ */ E("line", {
26
+ }), /* @__PURE__ */ T("line", {
27
27
  x1: e - r / 2,
28
28
  x2: e + r / 2,
29
29
  y1: n + 4,
@@ -33,21 +33,21 @@ function ne({ x: e, top: t, bottom: n, width: r }) {
33
33
  });
34
34
  }
35
35
  // packages/charts/src/chart-data.tsx
36
- function M({ children: e }) {
37
- return /* @__PURE__ */ E("div", {
38
- ...b.props(o.hidden),
36
+ function ae({ children: e }) {
37
+ return /* @__PURE__ */ T("div", {
38
+ ...x.props(c.hidden),
39
39
  children: e
40
40
  });
41
41
  }
42
42
  // packages/charts/src/chart-inspection.tsx
43
- var N = {
43
+ var oe = {
44
44
  kzqmXN: "x1xc55vz",
45
45
  kZKoxP: "xdk7pt",
46
46
  kmuXW: "x2lah0s",
47
47
  $$css: !0
48
- }, P = {
48
+ }, j = {
49
49
  swatch: (e) => [
50
- N,
50
+ oe,
51
51
  {
52
52
  kWkggS: e == null ? e : "xl8spv7",
53
53
  $$css: !0
@@ -87,78 +87,75 @@ var N = {
87
87
  "--x-left": ((e) => typeof e == "number" ? e + "px" : e ?? void 0)(e),
88
88
  "--x-width": ((e) => typeof e == "number" ? e + "px" : e ?? void 0)(t)
89
89
  }]
90
- }, re = 4;
91
- function ie() {
92
- return /* @__PURE__ */ E("ul", {
90
+ }, M = 4;
91
+ function se() {
92
+ return /* @__PURE__ */ T("ul", {
93
93
  "aria-hidden": !0,
94
94
  inert: !0,
95
95
  className: "x78zum5 x1xnx9c1 xnby9oq x1a02dak x8zbtdt x1gkm1c7 x1ghz6dp x1717udv xe8uvvx x153jb6y xy8obcc xas2l8k",
96
- children: Array.from({ length: re }, (t, n) => /* @__PURE__ */ D("li", {
96
+ children: Array.from({ length: M }, (e, t) => /* @__PURE__ */ E("li", {
97
97
  className: "x78zum5 x1pha0wt xunmzkg xeuugli xj0a0fe x1f394nn x43dure",
98
- children: [/* @__PURE__ */ E("span", { ...b.props(P.swatch(g.line)) }), /* @__PURE__ */ D("span", {
98
+ children: [/* @__PURE__ */ T("span", { ...x.props(j.swatch(_.line)) }), /* @__PURE__ */ E("span", {
99
99
  className: "x1cqoux5 xeuugli",
100
100
  children: [
101
- /* @__PURE__ */ E(e, {}),
102
- /* @__PURE__ */ E("span", {
101
+ /* @__PURE__ */ T(n, {}),
102
+ /* @__PURE__ */ T("span", {
103
103
  className: "x1s85apg xannxpe",
104
- children: /* @__PURE__ */ E(e, {})
104
+ children: /* @__PURE__ */ T(n, {})
105
105
  }),
106
- /* @__PURE__ */ E("span", {
106
+ /* @__PURE__ */ T("span", {
107
107
  className: "x1s85apg xannxpe x1mqbd49 xbixft xss6m8b",
108
- children: /* @__PURE__ */ E(e, {})
108
+ children: /* @__PURE__ */ T(n, {})
109
109
  })
110
110
  ]
111
111
  })]
112
- }, n))
112
+ }, t))
113
113
  });
114
114
  }
115
- function ae({ title: e, detail: t }) {
116
- return t === void 0 ? e : /* @__PURE__ */ D("span", {
115
+ function ce({ title: e, detail: t }) {
116
+ return t === void 0 ? e : /* @__PURE__ */ E("span", {
117
117
  "aria-label": e,
118
118
  className: "x1lliihq xb3r6kr xlyipyv xuxw1ft",
119
- children: [/* @__PURE__ */ E("span", {
119
+ children: [/* @__PURE__ */ T("span", {
120
120
  className: "xt0psk2 x1boff50",
121
121
  children: e
122
- }), /* @__PURE__ */ E("span", {
122
+ }), /* @__PURE__ */ T("span", {
123
123
  className: "x1s85apg xfodcyb",
124
124
  children: t
125
125
  })]
126
126
  });
127
127
  }
128
- function oe({ id: e, label: t, summary: n, legend: r, layoutLegend: i, rows: a, x: o, width: s, offset: c = 16, source: l, notes: u = [], hasSeriesSummary: f = !1 }) {
128
+ function le({ id: e, label: t, summary: n, legend: r, layoutLegend: i, rows: a, x: o, width: s, offset: c = 16, source: l, notes: u = [], hasSeriesSummary: f = !1 }) {
129
129
  let p = Math.min(260, s), m = o > s / 2 ? o - p - c : o + c, h = Math.max(0, Math.min(s - p, m)), g = t === void 0 ? [] : [
130
130
  t,
131
131
  n,
132
132
  ...a.map((e) => `${e.label}: ${e.value}`),
133
133
  ...u
134
134
  ].filter((e) => e !== void 0);
135
- return /* @__PURE__ */ D("div", {
135
+ return /* @__PURE__ */ E("div", {
136
136
  className: "xeuugli",
137
137
  children: [
138
- !f && /* @__PURE__ */ D("div", {
138
+ !f && /* @__PURE__ */ E("div", {
139
139
  className: "xrvj5dj xeuugli",
140
- children: [i !== void 0 && /* @__PURE__ */ E("ul", {
140
+ children: [i !== void 0 && /* @__PURE__ */ T("ul", {
141
141
  "aria-hidden": !0,
142
142
  inert: !0,
143
143
  className: "x78zum5 x1xnx9c1 xnby9oq x1a02dak x8zbtdt x1gkm1c7 x1ghz6dp x1717udv xe8uvvx x153jb6y xy8obcc xas2l8k x15r89dc xlshs6z x47corl",
144
- children: i.map((e) => /* @__PURE__ */ D("li", {
144
+ children: i.map((e) => /* @__PURE__ */ E("li", {
145
145
  className: "x78zum5 x1pha0wt xunmzkg xeuugli xj0a0fe",
146
- children: [/* @__PURE__ */ E("span", { ...b.props(P.swatch(d[e.tone])) }), /* @__PURE__ */ D("span", {
146
+ children: [/* @__PURE__ */ T(d, { tone: e.tone }), /* @__PURE__ */ E("span", {
147
147
  className: "xeuugli",
148
- children: [e.label, /* @__PURE__ */ E("span", { className: "x1s85apg xannxpe x1mqbd49 xbixft xss6m8b" })]
148
+ children: [e.label, /* @__PURE__ */ T("span", { className: "x1s85apg xannxpe x1mqbd49 xbixft xss6m8b" })]
149
149
  })]
150
150
  }, e.id))
151
- }), /* @__PURE__ */ E("ul", {
151
+ }), /* @__PURE__ */ T("ul", {
152
152
  "aria-label": "Legend",
153
153
  className: "x78zum5 x1xnx9c1 xnby9oq x1a02dak x8zbtdt x1gkm1c7 x1ghz6dp x1717udv xe8uvvx x153jb6y xy8obcc xas2l8k x15r89dc",
154
- children: r.map((e) => /* @__PURE__ */ D("li", {
154
+ children: r.map((e) => /* @__PURE__ */ E("li", {
155
155
  className: "x78zum5 x1pha0wt xunmzkg xeuugli xj0a0fe",
156
- children: [/* @__PURE__ */ E("span", {
157
- "aria-hidden": !0,
158
- ...b.props(P.swatch(d[e.tone]))
159
- }), /* @__PURE__ */ D("span", {
156
+ children: [/* @__PURE__ */ T(d, { tone: e.tone }), /* @__PURE__ */ E("span", {
160
157
  className: "xeuugli",
161
- children: [e.label, /* @__PURE__ */ E("span", {
158
+ children: [e.label, /* @__PURE__ */ T("span", {
162
159
  className: "x1s85apg xannxpe x1mqbd49 xbixft xss6m8b",
163
160
  children: t === void 0 ? "" : a.find((t) => t.id === e.id)?.value ?? "—"
164
161
  })]
@@ -166,36 +163,36 @@ function oe({ id: e, label: t, summary: n, legend: r, layoutLegend: i, rows: a,
166
163
  }, e.id))
167
164
  })]
168
165
  }),
169
- /* @__PURE__ */ E("span", {
166
+ /* @__PURE__ */ T("span", {
170
167
  id: e,
171
168
  "aria-live": l === "keyboard" ? "polite" : "off",
172
169
  className: "x10l6tqk x1i1rx1s xjm9jq1 x1717udv xb3r6kr x1hyvwdk xuxw1ft",
173
170
  children: g.join(" · ")
174
171
  }),
175
- t !== void 0 && /* @__PURE__ */ E("div", {
172
+ t !== void 0 && /* @__PURE__ */ T("div", {
176
173
  "aria-hidden": !0,
177
174
  className: "x1n2onr6 xqtp20y x1vjfegm",
178
- children: /* @__PURE__ */ D("div", {
179
- ...b.props(P.inspector, f && P.summaryInspector, P.position(h, p)),
175
+ children: /* @__PURE__ */ E("div", {
176
+ ...x.props(j.inspector, f && j.summaryInspector, j.position(h, p)),
180
177
  children: [
181
- /* @__PURE__ */ D("div", {
178
+ /* @__PURE__ */ E("div", {
182
179
  className: "x78zum5 x1qughib x1hnptsi xk4h15q",
183
- children: [/* @__PURE__ */ E("span", { children: t }), n !== void 0 && /* @__PURE__ */ E("span", { children: n })]
180
+ children: [/* @__PURE__ */ T("span", { children: t }), n !== void 0 && /* @__PURE__ */ T("span", { children: n })]
184
181
  }),
185
- /* @__PURE__ */ E("dl", {
182
+ /* @__PURE__ */ T("dl", {
186
183
  className: "xrvj5dj xunmzkg x1ghz6dp",
187
- children: a.map((e) => /* @__PURE__ */ D("div", {
184
+ children: a.map((e) => /* @__PURE__ */ E("div", {
188
185
  className: "x78zum5 x1qughib x1pha0wt x1hnptsi",
189
- children: [/* @__PURE__ */ D("dt", {
186
+ children: [/* @__PURE__ */ E("dt", {
190
187
  className: "x78zum5 x1pha0wt xunmzkg xeuugli xj0a0fe",
191
- children: [/* @__PURE__ */ E("span", { ...b.props(P.swatch(d[e.tone])) }), e.label]
192
- }), /* @__PURE__ */ E("dd", {
188
+ children: [/* @__PURE__ */ T(d, { tone: e.tone }), e.label]
189
+ }), /* @__PURE__ */ T("dd", {
193
190
  className: "x1ghz6dp xuxw1ft",
194
191
  children: e.value
195
192
  })]
196
193
  }, e.id))
197
194
  }),
198
- u.map((e) => /* @__PURE__ */ E("span", { children: e }, e))
195
+ u.map((e) => /* @__PURE__ */ T("span", { children: e }, e))
199
196
  ]
200
197
  })
201
198
  })
@@ -203,7 +200,7 @@ function oe({ id: e, label: t, summary: n, legend: r, layoutLegend: i, rows: a,
203
200
  });
204
201
  }
205
202
  // packages/charts/src/cartesian/bar-data.ts
206
- function se({ composition: e, series: t, categoryIds: n, domain: r }) {
203
+ function ue({ composition: e, series: t, categoryIds: n, domain: r }) {
207
204
  if (e === void 0) return;
208
205
  if (e.buckets.length !== n.length) return "Composition requires one explicit bucket per category.";
209
206
  let i = e.annotation;
@@ -221,52 +218,52 @@ function se({ composition: e, series: t, categoryIds: n, domain: r }) {
221
218
  }
222
219
  }
223
220
  // packages/charts/src/cartesian/composition-bars.tsx
224
- var ce = { mark: {
221
+ var N = { mark: {
225
222
  k3nNDw: "x1hj3fc7",
226
223
  k1ekBW: "xwcsmn1",
227
224
  kIyJzY: "xtitasy x12w9bfk",
228
225
  kAMwcw: "x1faw7qm",
229
226
  $$css: !0
230
227
  } };
231
- function le({ bucket: e, series: t, focusedSeries: n, index: r, x: a, width: o, y: s, isHighlighted: c, highlightedSeriesId: u }) {
232
- let f = n !== void 0, p = n !== void 0 && !t.some((e) => e.id === n.id) ? [...t, n] : t;
228
+ function de({ bucket: t, series: n, focusedSeries: r, index: a, x: o, width: c, y: l, isHighlighted: u, highlightedSeriesId: d }) {
229
+ let f = r !== void 0, p = r !== void 0 && !n.some((e) => e.id === r.id) ? [...n, r] : n;
233
230
  function m(e, t) {
234
- let n = s(t), r = s(t + e);
231
+ let n = l(t), r = l(t + e);
235
232
  return `translateY(${Math.min(n, r)}px) scaleY(${Math.max(+(e === 0), Math.abs(r - n))})`;
236
233
  }
237
- return /* @__PURE__ */ D(T, { children: [e.kind !== "gap" && /* @__PURE__ */ E("rect", {
238
- x: a,
234
+ return /* @__PURE__ */ E(w, { children: [t.kind !== "gap" && /* @__PURE__ */ T("rect", {
235
+ x: o,
239
236
  y: 0,
240
- width: o,
237
+ width: c,
241
238
  height: 1,
242
239
  vectorEffect: "non-scaling-stroke",
243
- fill: d.neutral,
244
- ...b.props(ce.mark, c && l.selected),
240
+ fill: e.neutral,
241
+ ...x.props(N.mark, u && s.selected),
245
242
  style: {
246
- transform: m(e.total, 0),
247
- opacity: f ? .18 : +(e.kind === "total")
243
+ transform: m(t.total, 0),
244
+ opacity: f ? .18 : +(t.kind === "total")
248
245
  }
249
- }), p.map((s, p) => {
250
- let h = s.values[r];
246
+ }), p.map((l, p) => {
247
+ let h = l.values[a];
251
248
  if (h == null) return null;
252
- let g = n?.id === s.id, _ = f ? 0 : t.slice(0, p).reduce((e, t) => e + (t.values[r] ?? 0), 0), v = f ? g : e.kind === "parts", y = !f && u !== void 0 && u !== s.id;
253
- return /* @__PURE__ */ E("rect", {
254
- x: a,
249
+ let g = r?.id === l.id, _ = f ? 0 : n.slice(0, p).reduce((e, t) => e + (t.values[a] ?? 0), 0), v = f ? g : t.kind === "parts", y = !f && d !== void 0 && d !== l.id;
250
+ return /* @__PURE__ */ T("rect", {
251
+ x: o,
255
252
  y: 0,
256
- width: o,
253
+ width: c,
257
254
  height: 1,
258
255
  vectorEffect: "non-scaling-stroke",
259
- fill: d[i(s.tone, p)],
260
- ...b.props(ce.mark, c && l.selected),
256
+ fill: e[i(l.tone, p)],
257
+ ...x.props(N.mark, u && s.selected),
261
258
  style: {
262
259
  transform: m(h, _),
263
260
  opacity: v ? y ? .3 : 1 : 0
264
261
  }
265
- }, s.id);
262
+ }, l.id);
266
263
  })] });
267
264
  }
268
265
  // packages/charts/src/cartesian/bar-chart.tsx
269
- var ue = {
266
+ var P = {
270
267
  plot: {
271
268
  kqGvvJ: "x1we84gm",
272
269
  $$css: !0
@@ -275,19 +272,19 @@ var ue = {
275
272
  kSiTet: "xuzhngd",
276
273
  $$css: !0
277
274
  }
278
- }, de = /* @__PURE__ */ new Set(["Enter", " "]), fe = 200;
279
- function F({ title: e, description: t, report: n, series: r, layoutSeries: a, children: o, inspectionId: s, label: c, detail: l, summary: d, rows: f = [], index: p = -1, formatValue: m = String, x: h = 0, width: g = 0, offset: _, source: v, data: y, isLoading: b = !1 }) {
275
+ }, fe = /* @__PURE__ */ new Set(["Enter", " "]), F = 200;
276
+ function I({ title: e, description: t, report: n, series: r, layoutSeries: a, children: o, inspectionId: s, label: c, detail: l, summary: u, rows: d = [], index: p = -1, formatValue: m = String, x: h = 0, width: g = 0, offset: _, source: v, data: y, isLoading: b = !1 }) {
280
277
  let x = r.map((e, t) => ({
281
278
  id: e.id,
282
279
  label: e.label,
283
280
  tone: i(e.tone, t)
284
- })), S = a?.map((e, t) => ({
281
+ })), ee = a?.map((e, t) => ({
285
282
  id: e.id,
286
283
  label: e.label,
287
284
  tone: i(e.tone, t)
288
- })), C = b && r.length === 0 && n?.seriesValues === void 0;
289
- return /* @__PURE__ */ D(u, {
290
- title: /* @__PURE__ */ E(ae, {
285
+ })), S = b && r.length === 0 && n?.seriesValues === void 0;
286
+ return /* @__PURE__ */ E(f, {
287
+ title: /* @__PURE__ */ T(ce, {
291
288
  title: e,
292
289
  detail: l
293
290
  }),
@@ -295,15 +292,15 @@ function F({ title: e, description: t, report: n, series: r, layoutSeries: a, ch
295
292
  report: n,
296
293
  series: x,
297
294
  children: [
298
- /* @__PURE__ */ E(M, { children: y }),
299
- C ? /* @__PURE__ */ E(ie, {}) : /* @__PURE__ */ E(oe, {
295
+ /* @__PURE__ */ T(ae, { children: y }),
296
+ S ? /* @__PURE__ */ T(se, {}) : /* @__PURE__ */ T(le, {
300
297
  id: s,
301
298
  label: c,
302
- summary: d,
299
+ summary: u,
303
300
  legend: x,
304
301
  hasSeriesSummary: n?.seriesValues !== void 0,
305
- layoutLegend: S,
306
- rows: f.map((e, t) => ({
302
+ layoutLegend: ee,
303
+ rows: d.map((e, t) => ({
307
304
  id: e.id,
308
305
  label: e.label,
309
306
  tone: i(e.tone, t),
@@ -318,170 +315,170 @@ function F({ title: e, description: t, report: n, series: r, layoutSeries: a, ch
318
315
  ]
319
316
  });
320
317
  }
321
- function I({ title: e = "Loading chart", description: n, report: r, series: i = [], height: a = fe }) {
322
- let o = L(a), s = S();
323
- return o === void 0 ? /* @__PURE__ */ E("div", {
318
+ function L({ title: e = "Loading chart", description: n, report: r, series: i = [], height: a = F }) {
319
+ let o = pe(a), c = S();
320
+ return o === void 0 ? /* @__PURE__ */ T("div", {
324
321
  "aria-hidden": !0,
325
322
  inert: !0,
326
- children: /* @__PURE__ */ E(F, {
323
+ children: /* @__PURE__ */ T(I, {
327
324
  title: e,
328
325
  description: n,
329
326
  report: r,
330
327
  series: i,
331
- inspectionId: s,
328
+ inspectionId: c,
332
329
  isLoading: !0,
333
- children: /* @__PURE__ */ E("div", {
334
- ...b.props(l.plot, ue.plot),
335
- children: /* @__PURE__ */ E(t, { height: a })
330
+ children: /* @__PURE__ */ T("div", {
331
+ ...x.props(s.plot, P.plot),
332
+ children: /* @__PURE__ */ T(t, { height: a })
336
333
  })
337
334
  })
338
- }) : /* @__PURE__ */ E(h, {
335
+ }) : /* @__PURE__ */ T(g, {
339
336
  title: e,
340
337
  description: n,
341
338
  report: r,
342
339
  message: o
343
340
  });
344
341
  }
345
- function L(e) {
342
+ function pe(e) {
346
343
  if (!Number.isFinite(e) || e < 48) return "Chart height must be at least 48 pixels.";
347
344
  }
348
- function pe({ categories: e, series: t, domain: n, mode: i }) {
349
- if (e.length > r.items || t.length > r.series) return `Choose a window with at most ${r.items} categories and ${r.series} series.`;
350
- if (!m(n) || n[0] > 0 || n[1] < 0) return "The bar domain must be finite, increasing, and include zero.";
351
- if (!p(e) || !p(t)) return "Bar categories and series require unique identifiers.";
352
- for (let r of t) {
353
- if (r.values.length !== e.length) return "Every series requires one explicit value per category.";
354
- for (let e of r.values) {
345
+ function me({ categories: e, series: t, domain: n, mode: r }) {
346
+ if (e.length > o.items || t.length > o.series) return `Choose a window with at most ${o.items} categories and ${o.series} series.`;
347
+ if (!h(n) || n[0] > 0 || n[1] < 0) return "The bar domain must be finite, increasing, and include zero.";
348
+ if (!m(e) || !m(t)) return "Bar categories and series require unique identifiers.";
349
+ for (let i of t) {
350
+ if (i.values.length !== e.length) return "Every series requires one explicit value per category.";
351
+ for (let e of i.values) {
355
352
  if (e !== null && (!Number.isFinite(e) || e < n[0] || e > n[1])) return "Bar values must be finite and within the supplied domain.";
356
- if (i === "stacked" && (e === null || e < 0)) return "Stacked bars require present nonnegative values.";
353
+ if (r === "stacked" && (e === null || e < 0)) return "Stacked bars require present nonnegative values.";
357
354
  }
358
355
  }
359
- if (i === "stacked" && e.some((e, r) => t.reduce((e, t) => e + (t.values[r] ?? 0), 0) > n[1])) return "Stacked bar totals must fit the supplied domain.";
356
+ if (r === "stacked" && e.some((e, r) => t.reduce((e, t) => e + (t.values[r] ?? 0), 0) > n[1])) return "Stacked bar totals must fit the supplied domain.";
360
357
  }
361
- var me = {
358
+ var he = {
362
359
  "x-default-marker": "x-default-marker",
363
360
  $$css: !0
364
361
  };
365
- function he({ title: e, description: t, report: n, categories: r, series: o, domain: s, mode: c = "grouped", formatValue: u, formatTick: f = u, highlightedSeriesId: p, selection: m, height: g = fe, composition: v }) {
366
- let y = v?.focusedSeries, C = S(), ee = y === void 0 ? void 0 : pe({
367
- categories: r,
362
+ function R({ title: t, description: n, report: r, categories: o, series: c, domain: l, mode: u = "grouped", formatValue: d, formatTick: f = d, highlightedSeriesId: p, selection: m, height: h = F, composition: _ }) {
363
+ let y = _?.focusedSeries, b = S(), te = y === void 0 ? void 0 : me({
364
+ categories: o,
368
365
  series: [y],
369
- domain: s,
366
+ domain: l,
370
367
  mode: "grouped"
371
- }), T = pe({
372
- categories: r,
373
- series: o,
374
- domain: s,
375
- mode: c
376
- }) ?? ee, te = se({
377
- composition: v,
378
- series: o,
379
- categoryIds: r.map((e) => e.id),
380
- domain: s
381
- }) ?? L(g), j = T ?? te, M = v === void 0 ? void 0 : {
382
- id: C,
383
- label: v.contextLabel,
368
+ }), ne = me({
369
+ categories: o,
370
+ series: c,
371
+ domain: l,
372
+ mode: u
373
+ }) ?? te, w = ue({
374
+ composition: _,
375
+ series: c,
376
+ categoryIds: o.map((e) => e.id),
377
+ domain: l
378
+ }) ?? pe(h), re = ne ?? w, A = _ === void 0 ? void 0 : {
379
+ id: b,
380
+ label: _.contextLabel,
384
381
  tone: "neutral",
385
- values: v.buckets.map((e) => e.kind === "gap" ? null : e.total)
386
- }, N = M === void 0 ? o : [
387
- M,
388
- ...o,
389
- ...y === void 0 || o.some((e) => e.id === y.id) ? [] : [y]
390
- ], P = y !== void 0 && M !== void 0 ? [y, M] : o, { ref: re, width: ie, element: ae } = _(), oe = S(), [ce, I] = w(), [he, z] = w();
391
- x(() => {
382
+ values: _.buckets.map((e) => e.kind === "gap" ? null : e.total)
383
+ }, ae = A === void 0 ? c : [
384
+ A,
385
+ ...c,
386
+ ...y === void 0 || c.some((e) => e.id === y.id) ? [] : [y]
387
+ ], oe = y !== void 0 && A !== void 0 ? [y, A] : c, { ref: j, width: M, element: se } = v(), ce = S(), [le, N] = C(), [L, R] = C();
388
+ ee(() => {
392
389
  function e(e) {
393
- e.target instanceof Node && ae?.contains(e.target) !== !0 && I(void 0);
390
+ e.target instanceof Node && se?.contains(e.target) !== !0 && N(void 0);
394
391
  }
395
392
  return document.addEventListener("pointerdown", e), () => document.removeEventListener("pointerdown", e);
396
- }, [ae]);
397
- let B = r.findIndex((e) => e.id === ce?.id), V = r[B], H = r[r.findIndex((e) => e.id === m?.selectedId)], U = r.find((e) => e.id === he) ?? H ?? r[0], W = r.findIndex((e) => e.id === U?.id), G = V, ge = B, K = v?.buckets[ge], q = y !== void 0 && M !== void 0 ? [y, M] : M === void 0 || K?.kind === "parts" ? o : [], J = K === void 0 ? void 0 : K.kind === "gap" ? "No reported value" : u(K.total);
398
- if (j !== void 0) return /* @__PURE__ */ E(h, {
399
- title: e,
400
- description: t,
401
- report: n,
402
- message: j
393
+ }, [se]);
394
+ let z = o.findIndex((e) => e.id === le?.id), B = o[z], V = o[o.findIndex((e) => e.id === m?.selectedId)], H = o.find((e) => e.id === L) ?? V ?? o[0], U = o.findIndex((e) => e.id === H?.id), W = B, G = z, K = _?.buckets[G], _e = y !== void 0 && A !== void 0 ? [y, A] : A === void 0 || K?.kind === "parts" ? c : [], q = K === void 0 ? void 0 : K.kind === "gap" ? "No reported value" : d(K.total);
395
+ if (re !== void 0) return /* @__PURE__ */ T(g, {
396
+ title: t,
397
+ description: n,
398
+ report: r,
399
+ message: re
403
400
  });
404
- let Y = g - 28, X = k({
405
- domain: [...s],
406
- range: [Y, 12]
407
- }), Z = Math.max(44, ...X.ticks(3).map((e) => f(e).length * 7 + 12)), Q = Math.max(Z + 1, ie - 16), $ = O({
408
- domain: r.map((e) => e.id),
409
- range: [Z, Q],
410
- padding: .3
411
- }), _e = O({
401
+ let J = h - 28, Y = O({
402
+ domain: [...l],
403
+ range: [J, 12]
404
+ }), X = Math.max(44, ...Y.ticks(3).map((e) => f(e).length * 7 + 12)), Z = Math.max(X + 1, M - 16), Q = D({
412
405
  domain: o.map((e) => e.id),
413
- range: [0, $.bandwidth()],
406
+ range: [X, Z],
407
+ padding: .3
408
+ }), $ = D({
409
+ domain: c.map((e) => e.id),
410
+ range: [0, Q.bandwidth()],
414
411
  padding: .08
415
- }), ve = Math.min(120, Math.max(40, ...r.map((e) => (e.axisLabel ?? e.label).length * 7))), ye = Math.max(1, Math.ceil((ve + 16) / $.step())), be = Math.max(1, Math.floor(($.step() * ye - 16) / 7));
412
+ }), ve = Math.min(120, Math.max(40, ...o.map((e) => (e.axisLabel ?? e.label).length * 7))), ye = Math.max(1, Math.ceil((ve + 16) / Q.step())), be = Math.max(1, Math.floor((Q.step() * ye - 16) / 7));
416
413
  function xe(e) {
417
- let t = e.currentTarget.getBoundingClientRect(), n = (e.clientX - t.left) / t.width * ie, i = Math.floor((n - Z) / $.step()), a = r[Math.max(0, Math.min(r.length - 1, i))];
418
- a !== void 0 && (e.type === "pointerdown" && z(a.id), I({
419
- id: a.id,
414
+ let t = e.currentTarget.getBoundingClientRect(), n = (e.clientX - t.left) / t.width * M, r = Math.floor((n - X) / Q.step()), i = o[Math.max(0, Math.min(o.length - 1, r))];
415
+ i !== void 0 && (e.type === "pointerdown" && R(i.id), N({
416
+ id: i.id,
420
417
  source: "pointer"
421
418
  }));
422
419
  }
423
420
  function Se(e) {
424
421
  if (e.altKey || e.ctrlKey || e.metaKey) return;
425
422
  if (e.key === "Escape") {
426
- e.preventDefault(), e.stopPropagation(), I(void 0);
423
+ e.preventDefault(), e.stopPropagation(), N(void 0);
427
424
  return;
428
425
  }
429
- if (de.has(e.key)) {
430
- U !== void 0 && m !== void 0 && (e.preventDefault(), m.onSelect(U.id));
426
+ if (fe.has(e.key)) {
427
+ H !== void 0 && m !== void 0 && (e.preventDefault(), m.onSelect(H.id));
431
428
  return;
432
429
  }
433
430
  let t = {
434
- ArrowRight: Math.min(r.length - 1, W + 1),
435
- ArrowLeft: Math.max(0, W - 1),
431
+ ArrowRight: Math.min(o.length - 1, U + 1),
432
+ ArrowLeft: Math.max(0, U - 1),
436
433
  Home: 0,
437
- End: r.length - 1
438
- }[e.key], n = t === void 0 ? void 0 : r[t];
439
- n !== void 0 && (e.preventDefault(), z(n.id), I({
434
+ End: o.length - 1
435
+ }[e.key], n = t === void 0 ? void 0 : o[t];
436
+ n !== void 0 && (e.preventDefault(), R(n.id), N({
440
437
  id: n.id,
441
438
  source: "keyboard"
442
439
  }));
443
440
  }
444
- return /* @__PURE__ */ E(F, {
445
- title: e,
446
- description: t,
447
- report: n,
448
- series: P,
449
- layoutSeries: o,
450
- inspectionId: oe,
451
- label: G?.label,
452
- detail: G === void 0 ? void 0 : [G.axisLabel ?? G.label, J].filter(Boolean).join(" · "),
453
- summary: J,
454
- rows: q,
455
- index: ge,
456
- formatValue: u,
457
- x: ($(G?.id ?? "") ?? Z) + $.bandwidth() / 2,
458
- width: ie,
459
- offset: $.bandwidth() / 2 + 8,
460
- source: ce?.source,
461
- data: /* @__PURE__ */ E(a, { items: r.map((e, t) => ({
441
+ return /* @__PURE__ */ T(I, {
442
+ title: t,
443
+ description: n,
444
+ report: r,
445
+ series: oe,
446
+ layoutSeries: c,
447
+ inspectionId: ce,
448
+ label: W?.label,
449
+ detail: W === void 0 ? void 0 : [W.axisLabel ?? W.label, q].filter(Boolean).join(" · "),
450
+ summary: q,
451
+ rows: _e,
452
+ index: G,
453
+ formatValue: d,
454
+ x: (Q(W?.id ?? "") ?? X) + Q.bandwidth() / 2,
455
+ width: M,
456
+ offset: Q.bandwidth() / 2 + 8,
457
+ source: le?.source,
458
+ data: /* @__PURE__ */ T(a, { items: o.map((e, t) => ({
462
459
  id: e.id,
463
460
  label: e.label,
464
- valueLabel: R(N, t, u),
461
+ valueLabel: ge(ae, t, d),
465
462
  tone: "neutral"
466
463
  })) }),
467
- children: /* @__PURE__ */ E("div", {
468
- ref: re,
469
- ...b.props(l.plot, ue.plot),
470
- children: r.length === 0 || o.length === 0 && v === void 0 ? /* @__PURE__ */ E("p", {
464
+ children: /* @__PURE__ */ T("div", {
465
+ ref: j,
466
+ ...x.props(s.plot, P.plot),
467
+ children: o.length === 0 || c.length === 0 && _ === void 0 ? /* @__PURE__ */ T("p", {
471
468
  className: "x153jb6y x1ghz6dp xy8obcc",
472
469
  children: "No categories"
473
- }) : /* @__PURE__ */ D("svg", {
470
+ }) : /* @__PURE__ */ E("svg", {
474
471
  role: "img",
475
- "aria-label": `${e}. Use arrow keys to inspect categories.${m === void 0 ? "" : " Press Enter to select."}`,
476
- "aria-describedby": oe,
472
+ "aria-label": `${t}. Use arrow keys to inspect categories.${m === void 0 ? "" : " Press Enter to select."}`,
473
+ "aria-describedby": ce,
477
474
  tabIndex: 0,
478
- viewBox: `0 0 ${ie} ${g}`,
479
- height: g,
475
+ viewBox: `0 0 ${M} ${h}`,
476
+ height: h,
480
477
  onKeyDown: Se,
481
478
  onFocus: (e) => {
482
479
  if (e.currentTarget.matches(":focus-visible")) {
483
- let e = H ?? r[0];
484
- z(e?.id), I(e === void 0 ? void 0 : {
480
+ let e = V ?? o[0];
481
+ R(e?.id), N(e === void 0 ? void 0 : {
485
482
  id: e.id,
486
483
  source: "keyboard"
487
484
  });
@@ -492,85 +489,85 @@ function he({ title: e, description: t, report: n, categories: r, series: o, dom
492
489
  },
493
490
  onPointerDown: xe,
494
491
  onPointerLeave: (e) => {
495
- e.pointerType === "mouse" && ce?.source === "pointer" && I(void 0);
492
+ e.pointerType === "mouse" && le?.source === "pointer" && N(void 0);
496
493
  },
497
- onBlur: () => I(void 0),
494
+ onBlur: () => N(void 0),
498
495
  onClick: () => {
499
- V !== void 0 && m?.onSelect(V.id);
496
+ B !== void 0 && m?.onSelect(B.id);
500
497
  },
501
- ...b.props(l.svg, l.inspectable, me),
498
+ ...x.props(s.svg, s.inspectable, he),
502
499
  children: [
503
- V !== void 0 && /* @__PURE__ */ E("rect", {
504
- x: ($(V.id) ?? Z) - ($.step() - $.bandwidth()) / 2,
500
+ B !== void 0 && /* @__PURE__ */ T("rect", {
501
+ x: (Q(B.id) ?? X) - (Q.step() - Q.bandwidth()) / 2,
505
502
  y: 12,
506
- width: $.step(),
507
- height: Y - 12,
503
+ width: Q.step(),
504
+ height: J - 12,
508
505
  className: "x2wnxhi"
509
506
  }),
510
- X.ticks(3).map((e) => /* @__PURE__ */ D("g", { children: [/* @__PURE__ */ E("line", {
511
- x1: Z,
512
- x2: Q,
513
- y1: X(e),
514
- y2: X(e),
515
- ...b.props(l.grid)
516
- }), /* @__PURE__ */ E("text", {
517
- x: Z - 8,
518
- y: X(e),
507
+ Y.ticks(3).map((e) => /* @__PURE__ */ E("g", { children: [/* @__PURE__ */ T("line", {
508
+ x1: X,
509
+ x2: Z,
510
+ y1: Y(e),
511
+ y2: Y(e),
512
+ ...x.props(s.grid)
513
+ }), /* @__PURE__ */ T("text", {
514
+ x: X - 8,
515
+ y: Y(e),
519
516
  textAnchor: "end",
520
517
  dominantBaseline: "middle",
521
- ...b.props(l.label),
518
+ ...x.props(s.label),
522
519
  children: f(e)
523
520
  })] }, e)),
524
- v?.annotation !== void 0 && r.some((e) => e.id === v.annotation?.categoryId) && /* @__PURE__ */ E("text", {
525
- x: $(v.annotation.categoryId),
526
- y: Math.max(12, X(v.annotation.value) - 8),
527
- ...b.props(l.label),
528
- children: v.annotation.label
521
+ _?.annotation !== void 0 && o.some((e) => e.id === _.annotation?.categoryId) && /* @__PURE__ */ T("text", {
522
+ x: Q(_.annotation.categoryId),
523
+ y: Math.max(12, Y(_.annotation.value) - 8),
524
+ ...x.props(s.label),
525
+ children: _.annotation.label
529
526
  }),
530
- r.map((e, t) => {
531
- let n = e.axisLabel ?? e.label, r = v?.buckets[t];
532
- return /* @__PURE__ */ D("g", { children: [r === void 0 ? o.map((n, r) => {
533
- let a = n.values[t];
534
- if (a == null) return null;
535
- let s = c === "stacked" ? o.slice(0, r).reduce((e, n) => e + (n.values[t] ?? 0), 0) : 0, u = X(s), f = X(s + a), h = m?.selectedId === e.id || V?.id === e.id;
536
- return /* @__PURE__ */ E(A, {
537
- x: ($(e.id) ?? Z) + (c === "stacked" ? 0 : _e(n.id) ?? 0),
538
- y: Math.min(u, f),
539
- width: c === "stacked" ? $.bandwidth() : _e.bandwidth(),
540
- height: Math.max(+(a === 0), Math.abs(f - u)),
541
- fill: d[i(n.tone, r)],
542
- ...b.props(h && l.selected, p !== void 0 && p !== n.id && ue.mutedMark)
543
- }, n.id);
544
- }) : /* @__PURE__ */ E(le, {
545
- bucket: r,
546
- series: o,
527
+ o.map((t, n) => {
528
+ let r = t.axisLabel ?? t.label, a = _?.buckets[n];
529
+ return /* @__PURE__ */ E("g", { children: [a === void 0 ? c.map((r, a) => {
530
+ let o = r.values[n];
531
+ if (o == null) return null;
532
+ let l = u === "stacked" ? c.slice(0, a).reduce((e, t) => e + (t.values[n] ?? 0), 0) : 0, d = Y(l), f = Y(l + o), h = m?.selectedId === t.id || B?.id === t.id;
533
+ return /* @__PURE__ */ T(k, {
534
+ x: (Q(t.id) ?? X) + (u === "stacked" ? 0 : $(r.id) ?? 0),
535
+ y: Math.min(d, f),
536
+ width: u === "stacked" ? Q.bandwidth() : $.bandwidth(),
537
+ height: Math.max(+(o === 0), Math.abs(f - d)),
538
+ fill: e[i(r.tone, a)],
539
+ ...x.props(h && s.selected, p !== void 0 && p !== r.id && P.mutedMark)
540
+ }, r.id);
541
+ }) : /* @__PURE__ */ T(de, {
542
+ bucket: a,
543
+ series: c,
547
544
  focusedSeries: y,
548
- index: t,
549
- x: $(e.id) ?? Z,
550
- width: $.bandwidth(),
551
- y: X,
552
- isHighlighted: m?.selectedId === e.id || V?.id === e.id,
545
+ index: n,
546
+ x: Q(t.id) ?? X,
547
+ width: Q.bandwidth(),
548
+ y: Y,
549
+ isHighlighted: m?.selectedId === t.id || B?.id === t.id,
553
550
  highlightedSeriesId: p
554
- }), t % ye === 0 && /* @__PURE__ */ E("text", {
555
- x: ($(e.id) ?? Z) + $.bandwidth() / 2,
556
- y: g - 4,
551
+ }), n % ye === 0 && /* @__PURE__ */ T("text", {
552
+ x: (Q(t.id) ?? X) + Q.bandwidth() / 2,
553
+ y: h - 4,
557
554
  textAnchor: "middle",
558
- ...b.props(l.label),
559
- children: n.length > be ? `${n.slice(0, be - 1)}…` : n
560
- })] }, e.id);
555
+ ...x.props(s.label),
556
+ children: r.length > be ? `${r.slice(0, be - 1)}…` : r
557
+ })] }, t.id);
561
558
  }),
562
- U !== void 0 && /* @__PURE__ */ E(ne, {
563
- x: ($(U.id) ?? Z) + $.bandwidth() / 2,
559
+ H !== void 0 && /* @__PURE__ */ T(ie, {
560
+ x: (Q(H.id) ?? X) + Q.bandwidth() / 2,
564
561
  top: 12,
565
- bottom: Y,
566
- width: Math.max(8, $.bandwidth())
562
+ bottom: J,
563
+ width: Math.max(8, Q.bandwidth())
567
564
  })
568
565
  ]
569
566
  })
570
567
  })
571
568
  });
572
569
  }
573
- function R(e, t, n) {
570
+ function ge(e, t, n) {
574
571
  return e.map((e) => {
575
572
  let r = e.values[t];
576
573
  return `${e.label}: ${r == null ? "Unavailable" : n(r)}`;
@@ -592,54 +589,54 @@ var z = {
592
589
  "--x-backgroundColor": t ?? void 0
593
590
  }
594
591
  ] };
595
- function V({ title: e, report: t, description: r, items: o, total: s, formatValue: c, selection: l }) {
596
- let f = n(o), p = o.reduce((e, t) => e + (t.value ?? 0), 0), m = 2 ** -52 * Math.max(p, s, 1) * o.length;
597
- return f === void 0 ? !Number.isFinite(s) || s < 0 || p - s > m ? /* @__PURE__ */ E(h, {
598
- title: e,
599
- report: t,
600
- description: r,
592
+ function V({ title: t, report: n, description: o, items: s, total: c, formatValue: l, selection: u }) {
593
+ let d = r(s), p = s.reduce((e, t) => e + (t.value ?? 0), 0), m = 2 ** -52 * Math.max(p, c, 1) * s.length;
594
+ return d === void 0 ? !Number.isFinite(c) || c < 0 || p - c > m ? /* @__PURE__ */ T(g, {
595
+ title: t,
596
+ report: n,
597
+ description: o,
601
598
  message: "The total must be finite and at least the sum of recorded values."
602
- }) : /* @__PURE__ */ E(u, {
603
- title: e,
604
- report: t,
605
- description: r,
606
- children: o.length === 0 ? /* @__PURE__ */ E("p", {
599
+ }) : /* @__PURE__ */ T(f, {
600
+ title: t,
601
+ report: n,
602
+ description: o,
603
+ children: s.length === 0 ? /* @__PURE__ */ T("p", {
607
604
  className: "x153jb6y x1ghz6dp xy8obcc",
608
605
  children: "No values"
609
- }) : /* @__PURE__ */ D(T, { children: [
610
- /* @__PURE__ */ E("div", {
606
+ }) : /* @__PURE__ */ E(w, { children: [
607
+ /* @__PURE__ */ T("div", {
611
608
  "aria-hidden": !0,
612
609
  className: "x78zum5 x170jfvy xb3r6kr x1r7kqkb xmkeg23 x1y0btm7 x1ey3b81 x1jfksii",
613
- children: o.map((e, t) => e.value === null ? null : /* @__PURE__ */ E("span", { ...b.props(B.segment(s === 0 ? 0 : e.value / s * 100, d[i(e.tone, t)])) }, e.id))
610
+ children: s.map((t, n) => t.value === null ? null : /* @__PURE__ */ T("span", { ...x.props(B.segment(c === 0 ? 0 : t.value / c * 100, e[i(t.tone, n)])) }, t.id))
614
611
  }),
615
- /* @__PURE__ */ E(a, {
616
- items: o.map((e, t) => ({
612
+ /* @__PURE__ */ T(a, {
613
+ items: s.map((e, t) => ({
617
614
  id: e.id,
618
615
  label: e.label,
619
- valueLabel: e.value === null ? "Unavailable" : c(e.value),
616
+ valueLabel: e.value === null ? "Unavailable" : l(e.value),
620
617
  tone: i(e.tone, t)
621
618
  })),
622
- selection: l
619
+ selection: u
623
620
  }),
624
- s - p > m && /* @__PURE__ */ D("p", {
621
+ c - p > m && /* @__PURE__ */ E("p", {
625
622
  className: "x153jb6y x1ghz6dp xy8obcc",
626
623
  children: [
627
624
  "Unassigned portion: ",
628
- c(s - p),
625
+ l(c - p),
629
626
  " of ",
630
- c(s)
627
+ l(c)
631
628
  ]
632
629
  })
633
630
  ] })
634
- }) : /* @__PURE__ */ E(h, {
635
- title: e,
636
- report: t,
637
- description: r,
638
- message: f
631
+ }) : /* @__PURE__ */ T(g, {
632
+ title: t,
633
+ report: n,
634
+ description: o,
635
+ message: d
639
636
  });
640
637
  }
641
638
  // packages/charts/src/cartesian/scatter-plot.tsx
642
- var H = 260, U = 56, W = 20, G = 12, ge = 1e3, K = {
639
+ var H = 260, U = 56, W = 20, G = 12, K = 1e3, _e = {
643
640
  kzqmXN: "x1xc55vz",
644
641
  kZKoxP: "xdk7pt",
645
642
  kaIpWk: "x16rqkct",
@@ -682,7 +679,7 @@ var H = 260, U = 56, W = 20, G = 12, ge = 1e3, K = {
682
679
  "--x-top": ((e) => typeof e == "number" ? e + "px" : e ?? void 0)(t)
683
680
  }],
684
681
  dot: (e) => [
685
- K,
682
+ _e,
686
683
  {
687
684
  kWkggS: e == null ? e : "xl8spv7",
688
685
  $$css: !0
@@ -697,95 +694,95 @@ var H = 260, U = 56, W = 20, G = 12, ge = 1e3, K = {
697
694
  $$css: !0
698
695
  }
699
696
  };
700
- function J(e) {
701
- let { title: t, report: n, description: r, points: i, xDomain: a, yDomain: o, xLabel: l, yLabel: p, formatX: m, formatY: g, selection: v, rangeSelection: y, emptyLabel: x } = e, { ref: S, width: C } = _(), ee = Z(e);
702
- if (ee !== null) return /* @__PURE__ */ E(h, {
703
- title: t,
704
- report: n,
705
- description: r,
706
- message: ee
697
+ function J(t) {
698
+ let { title: n, report: r, description: i, points: a, xDomain: o, yDomain: s, xLabel: c, yLabel: d, formatX: m, formatY: h, selection: _, rangeSelection: y, emptyLabel: b } = t, { ref: ee, width: S } = v(), te = Z(t);
699
+ if (te !== null) return /* @__PURE__ */ T(g, {
700
+ title: n,
701
+ report: r,
702
+ description: i,
703
+ message: te
707
704
  });
708
- let w = k({
709
- domain: [...a],
710
- range: [U, Math.max(U, C - W)]
711
- }), T = k({
705
+ let ne = O({
712
706
  domain: [...o],
707
+ range: [U, Math.max(U, S - W)]
708
+ }), C = O({
709
+ domain: [...s],
713
710
  range: [216, G]
714
- }), O = i.find((e) => e.id === v?.selectedId);
715
- return /* @__PURE__ */ D(u, {
716
- title: t,
717
- report: n,
718
- description: r,
719
- footer: v !== void 0 && i.length > 0 ? /* @__PURE__ */ E(s, { children: O === void 0 ? "Select a point to inspect its label and coordinates." : `${O.label}, ${l}: ${m(O.x)}, ${p}: ${g(O.y)}` }) : void 0,
711
+ }), w = a.find((e) => e.id === _?.selectedId);
712
+ return /* @__PURE__ */ E(f, {
713
+ title: n,
714
+ report: r,
715
+ description: i,
716
+ footer: _ !== void 0 && a.length > 0 ? /* @__PURE__ */ T(l, { children: w === void 0 ? "Select a point to inspect its label and coordinates." : `${w.label}, ${c}: ${m(w.x)}, ${d}: ${h(w.y)}` }) : void 0,
720
717
  children: [
721
- i.length === 0 ? /* @__PURE__ */ E("p", {
718
+ a.length === 0 ? /* @__PURE__ */ T("p", {
722
719
  className: "x1ghz6dp x153jb6y",
723
- children: x
724
- }) : /* @__PURE__ */ D("div", {
725
- ref: S,
720
+ children: b
721
+ }) : /* @__PURE__ */ E("div", {
722
+ ref: ee,
726
723
  className: "x1n2onr6 xeuugli",
727
- children: [/* @__PURE__ */ E(Y, {
728
- width: C,
729
- scaleX: w,
730
- scaleY: T,
731
- ...e
732
- }, `${a[0]}:${a[1]}:${o[0]}:${o[1]}:${C}`), v !== void 0 && /* @__PURE__ */ E("div", {
724
+ children: [/* @__PURE__ */ T(Y, {
725
+ width: S,
726
+ scaleX: ne,
727
+ scaleY: C,
728
+ ...t
729
+ }, `${o[0]}:${o[1]}:${s[0]}:${s[1]}:${S}`), _ !== void 0 && /* @__PURE__ */ T("div", {
733
730
  className: "x10l6tqk x10a8y8t x1n71m9f x47corl",
734
- children: i.map((e) => /* @__PURE__ */ E("button", {
731
+ children: a.map((t) => /* @__PURE__ */ T("button", {
735
732
  type: "button",
736
- title: e.label,
737
- "aria-label": `${e.label}, ${l}: ${m(e.x)}, ${p}: ${g(e.y)}`,
738
- "aria-pressed": v.selectedId === e.id,
739
- onClick: () => v.onSelect(e.id),
740
- ...b.props(q.target, q.location(w(e.x), T(e.y))),
741
- children: /* @__PURE__ */ E("span", {
733
+ title: t.label,
734
+ "aria-label": `${t.label}, ${c}: ${m(t.x)}, ${d}: ${h(t.y)}`,
735
+ "aria-pressed": _.selectedId === t.id,
736
+ onClick: () => _.onSelect(t.id),
737
+ ...x.props(q.target, q.location(ne(t.x), C(t.y))),
738
+ children: /* @__PURE__ */ T("span", {
742
739
  "aria-hidden": !0,
743
- ...b.props(q.dot(d[e.tone]), v.selectedId === e.id && q.selected)
740
+ ...x.props(q.dot(e[t.tone]), _.selectedId === t.id && q.selected)
744
741
  })
745
- }, e.id))
742
+ }, t.id))
746
743
  })]
747
744
  }),
748
- y !== void 0 && /* @__PURE__ */ E(X, {
749
- ...e,
745
+ y !== void 0 && /* @__PURE__ */ T(X, {
746
+ ...t,
750
747
  rangeSelection: y
751
748
  }),
752
- i.length > 0 && /* @__PURE__ */ E(f, { children: i.map((e) => /* @__PURE__ */ D(c, {
753
- label: `${e.label}, ${l}: ${m(e.x)}, ${p}: ${g(e.y)}`,
754
- isSelected: v?.selectedId === e.id,
755
- onSelect: v === void 0 ? void 0 : () => v.onSelect(e.id),
756
- children: [/* @__PURE__ */ E("span", { children: e.label }), /* @__PURE__ */ D("span", {
749
+ a.length > 0 && /* @__PURE__ */ T(p, { children: a.map((e) => /* @__PURE__ */ E(u, {
750
+ label: `${e.label}, ${c}: ${m(e.x)}, ${d}: ${h(e.y)}`,
751
+ isSelected: _?.selectedId === e.id,
752
+ onSelect: _ === void 0 ? void 0 : () => _.onSelect(e.id),
753
+ children: [/* @__PURE__ */ T("span", { children: e.label }), /* @__PURE__ */ E("span", {
757
754
  className: "xeuugli xss6m8b xj0a0fe x153jb6y",
758
755
  children: [
759
756
  m(e.x),
760
757
  " · ",
761
- g(e.y)
758
+ h(e.y)
762
759
  ]
763
760
  })]
764
761
  }, e.id)) })
765
762
  ]
766
763
  });
767
764
  }
768
- function Y({ width: e, scaleX: t, scaleY: n, points: r, xLabel: i, yLabel: a, formatX: o, formatY: s, selection: c, rangeSelection: u }) {
769
- let f = S(), [p, m] = w(null), h = p === null ? u?.value : {
765
+ function Y({ width: t, scaleX: n, scaleY: r, points: i, xLabel: a, yLabel: o, formatX: c, formatY: l, selection: u, rangeSelection: d }) {
766
+ let f = S(), [p, m] = C(null), h = p === null ? d?.value : {
770
767
  x: [Math.min(p.start.x, p.end.x), Math.max(p.start.x, p.end.x)],
771
768
  y: [Math.min(p.start.y, p.end.y), Math.max(p.start.y, p.end.y)]
772
769
  };
773
- function g(r) {
774
- let i = r.currentTarget.getBoundingClientRect();
770
+ function g(e) {
771
+ let i = e.currentTarget.getBoundingClientRect();
775
772
  return {
776
- x: t.copy().clamp(!0).invert((r.clientX - i.left) / i.width * e),
777
- y: n.copy().clamp(!0).invert((r.clientY - i.top) / i.height * H)
773
+ x: n.copy().clamp(!0).invert((e.clientX - i.left) / i.width * t),
774
+ y: r.copy().clamp(!0).invert((e.clientY - i.top) / i.height * H)
778
775
  };
779
776
  }
780
- function _(t) {
781
- if (u === void 0 || t.button !== 0 || t.pointerType === "touch") return;
782
- let n = t.currentTarget.getBoundingClientRect(), r = (t.clientX - n.left) / n.width * e, i = (t.clientY - n.top) / n.height * H;
783
- if (r < U || r > e - W || i < G || i > 216) return;
784
- let a = g(t);
785
- t.currentTarget.setPointerCapture(t.pointerId), m({
777
+ function _(e) {
778
+ if (d === void 0 || e.button !== 0 || e.pointerType === "touch") return;
779
+ let n = e.currentTarget.getBoundingClientRect(), r = (e.clientX - n.left) / n.width * t, i = (e.clientY - n.top) / n.height * H;
780
+ if (r < U || r > t - W || i < G || i > 216) return;
781
+ let a = g(e);
782
+ e.currentTarget.setPointerCapture(e.pointerId), m({
786
783
  start: a,
787
784
  end: a,
788
- pointerId: t.pointerId
785
+ pointerId: e.pointerId
789
786
  });
790
787
  }
791
788
  function v(e) {
@@ -800,84 +797,84 @@ function Y({ width: e, scaleX: t, scaleY: n, points: r, xLabel: i, yLabel: a, fo
800
797
  x: [Math.min(p.start.x, t.x), Math.max(p.start.x, t.x)],
801
798
  y: [Math.min(p.start.y, t.y), Math.max(p.start.y, t.y)]
802
799
  };
803
- m(null), e.currentTarget.releasePointerCapture(e.pointerId), u?.onChange(n);
800
+ m(null), e.currentTarget.releasePointerCapture(e.pointerId), d?.onChange(n);
804
801
  }
805
- return /* @__PURE__ */ D("svg", {
806
- width: e,
802
+ return /* @__PURE__ */ E("svg", {
803
+ width: t,
807
804
  height: H,
808
- viewBox: `0 0 ${e} ${H}`,
805
+ viewBox: `0 0 ${t} ${H}`,
809
806
  "aria-hidden": !0,
810
807
  onPointerDown: _,
811
808
  onPointerMove: v,
812
809
  onPointerUp: y,
813
810
  onPointerCancel: () => m(null),
814
811
  onLostPointerCapture: () => m(null),
815
- ...b.props(l.svg, u !== void 0 && q.brush),
812
+ ...x.props(s.svg, d !== void 0 && q.brush),
816
813
  children: [
817
- /* @__PURE__ */ E("defs", { children: /* @__PURE__ */ E("clipPath", {
814
+ /* @__PURE__ */ T("defs", { children: /* @__PURE__ */ T("clipPath", {
818
815
  id: f,
819
- children: /* @__PURE__ */ E("rect", {
816
+ children: /* @__PURE__ */ T("rect", {
820
817
  x: U,
821
818
  y: G,
822
- width: Math.max(0, e - U - W),
819
+ width: Math.max(0, t - U - W),
823
820
  height: 204
824
821
  })
825
822
  }) }),
826
- t.ticks(5).map((e) => /* @__PURE__ */ D("g", { children: [/* @__PURE__ */ E("line", {
827
- x1: t(e),
828
- x2: t(e),
823
+ n.ticks(5).map((e) => /* @__PURE__ */ E("g", { children: [/* @__PURE__ */ T("line", {
824
+ x1: n(e),
825
+ x2: n(e),
829
826
  y1: G,
830
827
  y2: 216,
831
- ...b.props(l.grid)
832
- }), /* @__PURE__ */ E("text", {
833
- x: t(e),
828
+ ...x.props(s.grid)
829
+ }), /* @__PURE__ */ T("text", {
830
+ x: n(e),
834
831
  y: 234,
835
832
  textAnchor: "middle",
836
- ...b.props(l.label),
837
- children: o(e)
833
+ ...x.props(s.label),
834
+ children: c(e)
838
835
  })] }, e)),
839
- n.ticks(4).map((t) => /* @__PURE__ */ D("g", { children: [/* @__PURE__ */ E("line", {
836
+ r.ticks(4).map((e) => /* @__PURE__ */ E("g", { children: [/* @__PURE__ */ T("line", {
840
837
  x1: U,
841
- x2: e - W,
842
- y1: n(t),
843
- y2: n(t),
844
- ...b.props(l.grid)
845
- }), /* @__PURE__ */ E("text", {
838
+ x2: t - W,
839
+ y1: r(e),
840
+ y2: r(e),
841
+ ...x.props(s.grid)
842
+ }), /* @__PURE__ */ T("text", {
846
843
  x: 48,
847
- y: n(t) + 4,
844
+ y: r(e) + 4,
848
845
  textAnchor: "end",
849
- ...b.props(l.label),
850
- children: s(t)
851
- })] }, t)),
852
- /* @__PURE__ */ E("text", {
853
- x: (U + e - W) / 2,
846
+ ...x.props(s.label),
847
+ children: l(e)
848
+ })] }, e)),
849
+ /* @__PURE__ */ T("text", {
850
+ x: (U + t - W) / 2,
854
851
  y: 256,
855
852
  textAnchor: "middle",
856
- ...b.props(l.label),
857
- children: i
853
+ ...x.props(s.label),
854
+ children: a
858
855
  }),
859
- /* @__PURE__ */ E("text", {
856
+ /* @__PURE__ */ T("text", {
860
857
  x: 12,
861
858
  y: 108,
862
859
  textAnchor: "middle",
863
860
  transform: "rotate(-90 12 108)",
864
- ...b.props(l.label),
865
- children: a
861
+ ...x.props(s.label),
862
+ children: o
866
863
  }),
867
- /* @__PURE__ */ D("g", {
864
+ /* @__PURE__ */ E("g", {
868
865
  clipPath: `url(#${f})`,
869
- children: [h != null && /* @__PURE__ */ E("rect", {
870
- x: t(h.x[0]),
871
- y: n(h.y[1]),
872
- width: t(h.x[1]) - t(h.x[0]),
873
- height: n(h.y[0]) - n(h.y[1]),
866
+ children: [h != null && /* @__PURE__ */ T("rect", {
867
+ x: n(h.x[0]),
868
+ y: r(h.y[1]),
869
+ width: n(h.x[1]) - n(h.x[0]),
870
+ height: r(h.y[0]) - r(h.y[1]),
874
871
  className: "x1e0kj8g xv7c1pl x1tg5nk6 xnpr05h x15lqr97 x47corl"
875
- }), c === void 0 && r.map((e) => /* @__PURE__ */ E("circle", {
876
- cx: t(e.x),
877
- cy: n(e.y),
872
+ }), u === void 0 && i.map((t) => /* @__PURE__ */ T("circle", {
873
+ cx: n(t.x),
874
+ cy: r(t.y),
878
875
  r: 4,
879
- fill: d[e.tone]
880
- }, e.id))]
876
+ fill: e[t.tone]
877
+ }, t.id))]
881
878
  })
882
879
  ]
883
880
  });
@@ -887,14 +884,14 @@ function X({ rangeSelection: e, xDomain: t, yDomain: n, xLabel: r, yLabel: i, fo
887
884
  x: t,
888
885
  y: n
889
886
  };
890
- return /* @__PURE__ */ D("fieldset", {
887
+ return /* @__PURE__ */ E("fieldset", {
891
888
  className: "xrvj5dj x1n8ia3y x1xxf3xd xc342km x1717udv xeuugli",
892
889
  children: [
893
- /* @__PURE__ */ E("legend", {
890
+ /* @__PURE__ */ T("legend", {
894
891
  className: "x153jb6y xy8obcc x1jfksii",
895
892
  children: "Drag with a mouse, or adjust these bounds to select a coordinate range."
896
893
  }),
897
- /* @__PURE__ */ D(y.Root, {
894
+ /* @__PURE__ */ E(b.Root, {
898
895
  value: s.x,
899
896
  min: t[0],
900
897
  max: t[1],
@@ -905,28 +902,28 @@ function X({ rangeSelection: e, xDomain: t, yDomain: n, xLabel: r, yLabel: i, fo
905
902
  x: t,
906
903
  y: s.y
907
904
  }),
908
- children: [/* @__PURE__ */ D("div", {
905
+ children: [/* @__PURE__ */ E("div", {
909
906
  className: "x78zum5 x1a02dak x1qughib x1hnptsi x153jb6y xy8obcc xj0a0fe",
910
- children: [/* @__PURE__ */ E(y.Label, { children: r }), /* @__PURE__ */ D("span", { children: [
907
+ children: [/* @__PURE__ */ T(b.Label, { children: r }), /* @__PURE__ */ E("span", { children: [
911
908
  a(s.x[0]),
912
909
  " – ",
913
910
  a(s.x[1])
914
911
  ] })]
915
- }), /* @__PURE__ */ E(y.Control, { children: /* @__PURE__ */ D(y.Track, { children: [
916
- /* @__PURE__ */ E(y.Indicator, {}),
917
- /* @__PURE__ */ E(y.Thumb, {
912
+ }), /* @__PURE__ */ T(b.Control, { children: /* @__PURE__ */ E(b.Track, { children: [
913
+ /* @__PURE__ */ T(b.Indicator, {}),
914
+ /* @__PURE__ */ T(b.Thumb, {
918
915
  index: 0,
919
916
  "aria-label": `${r} minimum`,
920
917
  getAriaValueText: (e, t) => a(t)
921
918
  }),
922
- /* @__PURE__ */ E(y.Thumb, {
919
+ /* @__PURE__ */ T(b.Thumb, {
923
920
  index: 1,
924
921
  "aria-label": `${r} maximum`,
925
922
  getAriaValueText: (e, t) => a(t)
926
923
  })
927
924
  ] }) })]
928
925
  }),
929
- /* @__PURE__ */ D(y.Root, {
926
+ /* @__PURE__ */ E(b.Root, {
930
927
  value: s.y,
931
928
  min: n[0],
932
929
  max: n[1],
@@ -937,28 +934,28 @@ function X({ rangeSelection: e, xDomain: t, yDomain: n, xLabel: r, yLabel: i, fo
937
934
  x: s.x,
938
935
  y: t
939
936
  }),
940
- children: [/* @__PURE__ */ D("div", {
937
+ children: [/* @__PURE__ */ E("div", {
941
938
  className: "x78zum5 x1a02dak x1qughib x1hnptsi x153jb6y xy8obcc xj0a0fe",
942
- children: [/* @__PURE__ */ E(y.Label, { children: i }), /* @__PURE__ */ D("span", { children: [
939
+ children: [/* @__PURE__ */ T(b.Label, { children: i }), /* @__PURE__ */ E("span", { children: [
943
940
  o(s.y[0]),
944
941
  " – ",
945
942
  o(s.y[1])
946
943
  ] })]
947
- }), /* @__PURE__ */ E(y.Control, { children: /* @__PURE__ */ D(y.Track, { children: [
948
- /* @__PURE__ */ E(y.Indicator, {}),
949
- /* @__PURE__ */ E(y.Thumb, {
944
+ }), /* @__PURE__ */ T(b.Control, { children: /* @__PURE__ */ E(b.Track, { children: [
945
+ /* @__PURE__ */ T(b.Indicator, {}),
946
+ /* @__PURE__ */ T(b.Thumb, {
950
947
  index: 0,
951
948
  "aria-label": `${i} minimum`,
952
949
  getAriaValueText: (e, t) => o(t)
953
950
  }),
954
- /* @__PURE__ */ E(y.Thumb, {
951
+ /* @__PURE__ */ T(b.Thumb, {
955
952
  index: 1,
956
953
  "aria-label": `${i} maximum`,
957
954
  getAriaValueText: (e, t) => o(t)
958
955
  })
959
956
  ] }) })]
960
957
  }),
961
- /* @__PURE__ */ E(v, {
958
+ /* @__PURE__ */ T(y, {
962
959
  type: "button",
963
960
  disabled: e.value === null,
964
961
  onClick: () => e.onChange(null),
@@ -968,9 +965,9 @@ function X({ rangeSelection: e, xDomain: t, yDomain: n, xLabel: r, yLabel: i, fo
968
965
  });
969
966
  }
970
967
  function Z({ points: e, xDomain: t, yDomain: n, rangeSelection: r }) {
971
- if (!m(t) || !m(n)) return "Scatter domains must contain finite, increasing endpoints.";
972
- if (e.length > 1e3) return `This plot exceeds the ${ge}-point render limit. Supply a smaller, labelled sample.`;
973
- if (!p(e)) return "Scatter points must have unique identifiers.";
968
+ if (!h(t) || !h(n)) return "Scatter domains must contain finite, increasing endpoints.";
969
+ if (e.length > 1e3) return `This plot exceeds the ${K}-point render limit. Supply a smaller, labelled sample.`;
970
+ if (!m(e)) return "Scatter points must have unique identifiers.";
974
971
  if (e.some((e) => !Number.isFinite(e.x) || !Number.isFinite(e.y))) return "Scatter coordinates must be finite.";
975
972
  if (e.some((e) => {
976
973
  let r = e.x < t[0] || e.x > t[1], i = e.y < n[0] || e.y > n[1];
@@ -991,7 +988,7 @@ var $ = {
991
988
  pointsPerSeries: 2e3,
992
989
  markers: 200,
993
990
  panels: 12
994
- }, _e = .01, ve = [
991
+ }, ve = .01, ye = [
995
992
  "series1",
996
993
  "series2",
997
994
  "series3",
@@ -999,13 +996,13 @@ var $ = {
999
996
  "series5",
1000
997
  "series6"
1001
998
  ];
1002
- function ye({ series: e, isStacked: t, markers: n }) {
999
+ function be({ series: e, isStacked: t, markers: n }) {
1003
1000
  let r = e[0]?.points.map((e) => e.timestamp) ?? [];
1004
1001
  if (e.length > $.series || r.length > $.pointsPerSeries || n.length > $.markers) return `Choose a window with at most ${$.series} series, ${$.pointsPerSeries} observations per series, and ${$.markers} markers.`;
1005
- if (!p(e) || !p(n)) return "Series and markers require unique identifiers.";
1002
+ if (!m(e) || !m(n)) return "Series and markers require unique identifiers.";
1006
1003
  for (let n of e) {
1007
1004
  if (n.points.length !== r.length) return "Every series must supply the same observation timestamps.";
1008
- let e = Ce({
1005
+ let e = we({
1009
1006
  points: n.points,
1010
1007
  timestamps: r,
1011
1008
  isStacked: t
@@ -1023,7 +1020,7 @@ function ye({ series: e, isStacked: t, markers: n }) {
1023
1020
  if (!Number.isFinite(a) || !Number.isFinite(o)) return "The elapsed-time and value ranges must be finite.";
1024
1021
  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.";
1025
1022
  }
1026
- function be({ series: e, markers: t, timestampUnit: n, isStacked: r }) {
1023
+ function xe({ series: e, markers: t, timestampUnit: n, isStacked: r }) {
1027
1024
  return JSON.stringify([
1028
1025
  n,
1029
1026
  r,
@@ -1043,15 +1040,15 @@ function be({ series: e, markers: t, timestampUnit: n, isStacked: r }) {
1043
1040
  ])
1044
1041
  ]);
1045
1042
  }
1046
- function xe(e, t, n = !1) {
1043
+ function Se(e, t, n = !1) {
1047
1044
  if (e !== t) return [e, t];
1048
- let r = Math.max(1, Math.abs(e) * _e), i = n ? 0 : e - r, a = t + r;
1045
+ let r = Math.max(1, Math.abs(e) * ve), i = n ? 0 : e - r, a = t + r;
1049
1046
  return [Number.isFinite(i) ? i : e, Number.isFinite(a) ? a : t];
1050
1047
  }
1051
- function Se(e, t) {
1048
+ function Ce(e, t) {
1052
1049
  let n = e.filter((e) => e.tone === void 0);
1053
1050
  return e.map((r, i) => {
1054
- let a = n.findIndex((e) => e.id === r.id), o = r.tone ?? ve[a % ve.length] ?? "series1", s = r.points.map((n, r) => {
1051
+ let a = n.findIndex((e) => e.id === r.id), o = r.tone ?? ye[a % ye.length] ?? "series1", s = r.points.map((n, r) => {
1055
1052
  let a = t ? e.slice(0, i).reduce((e, t) => e + (t.points[r]?.value ?? 0), 0) : 0;
1056
1053
  return {
1057
1054
  ...n,
@@ -1066,7 +1063,7 @@ function Se(e, t) {
1066
1063
  };
1067
1064
  });
1068
1065
  }
1069
- function Ce({ points: e, timestamps: t, isStacked: n }) {
1066
+ function we({ points: e, timestamps: t, isStacked: n }) {
1070
1067
  for (let [r, i] of e.entries()) {
1071
1068
  let a = e[r - 1], o = a !== void 0 && i.timestamp <= a.timestamp;
1072
1069
  if (!Number.isFinite(i.timestamp) || i.timestamp !== t[r] || o) return "Observation timestamps must be finite, aligned, and strictly increasing.";
@@ -1075,49 +1072,49 @@ function Ce({ points: e, timestamps: t, isStacked: n }) {
1075
1072
  }
1076
1073
  }
1077
1074
  // packages/charts/src/cartesian/time-series-line.tsx
1078
- function we({ series: e, x: t, y: n, inspectedTimestamp: r, pointRadius: i = 3 }) {
1079
- return /* @__PURE__ */ D(T, { children: [/* @__PURE__ */ E(j, {
1080
- data: [...e.points],
1075
+ function Te({ series: t, x: n, y: r, inspectedTimestamp: i, pointRadius: a = 3 }) {
1076
+ return /* @__PURE__ */ E(w, { children: [/* @__PURE__ */ T(A, {
1077
+ data: [...t.points],
1081
1078
  defined: (e) => e.value !== null,
1082
- x: (e) => t(e.timestamp),
1083
- y: (e) => n((e.value ?? 0) + e.base),
1084
- stroke: d[e.tone],
1085
- ...b.props(l.mark)
1086
- }), e.points.filter((t, n) => {
1087
- if (t.value === null) return !1;
1088
- let i = e.points[n - 1]?.value === null || e.points[n + 1]?.value === null;
1089
- return e.points.length === 1 || i || t.timestamp === r;
1090
- }).map((r) => /* @__PURE__ */ E("circle", {
1091
- cx: t(r.timestamp),
1092
- cy: n((r.value ?? 0) + r.base),
1093
- r: i,
1094
- fill: d[e.tone]
1095
- }, r.timestamp))] });
1079
+ x: (e) => n(e.timestamp),
1080
+ y: (e) => r((e.value ?? 0) + e.base),
1081
+ stroke: e[t.tone],
1082
+ ...x.props(s.mark)
1083
+ }), t.points.filter((e, n) => {
1084
+ if (e.value === null) return !1;
1085
+ let r = t.points[n - 1]?.value === null || t.points[n + 1]?.value === null;
1086
+ return t.points.length === 1 || r || e.timestamp === i;
1087
+ }).map((i) => /* @__PURE__ */ T("circle", {
1088
+ cx: n(i.timestamp),
1089
+ cy: r((i.value ?? 0) + i.base),
1090
+ r: a,
1091
+ fill: e[t.tone]
1092
+ }, i.timestamp))] });
1096
1093
  }
1097
1094
  // packages/charts/src/cartesian/sparkline.tsx
1098
- function Te({ title: e, summary: t, unit: n, timestampUnit: r, series: i, valueDomain: a }) {
1099
- let o = S(), s = S(), c = Ee({
1095
+ function Ee({ title: e, summary: t, unit: n, timestampUnit: r, series: i, valueDomain: a }) {
1096
+ let o = S(), s = S(), c = De({
1100
1097
  title: e,
1101
1098
  summary: t,
1102
1099
  unit: n,
1103
1100
  series: i,
1104
1101
  valueDomain: a
1105
1102
  }), l = i.points.some((e) => e.value !== null);
1106
- if (c !== void 0 || !l) return /* @__PURE__ */ E("span", {
1103
+ if (c !== void 0 || !l) return /* @__PURE__ */ T("span", {
1107
1104
  role: "img",
1108
1105
  "aria-label": `${e}. ${t} Values in ${n}; timestamps in ${r}. ${c ?? "No recorded values. Missing observations remain unavailable."}`,
1109
1106
  title: c ?? "No recorded values",
1110
1107
  className: "x2pejg6 x10w6t97 x2lah0s xxymvpz x3nfvp2 x6s0dn4 xl56j7k x153jb6y x1hz01jw xy8obcc",
1111
1108
  children: c === void 0 ? "No data" : "Invalid trend"
1112
1109
  });
1113
- let u = i.points[0]?.timestamp ?? 0, d = i.points.at(-1)?.timestamp ?? u, f = k({
1114
- domain: [...xe(u, d)],
1110
+ let u = i.points[0]?.timestamp ?? 0, d = i.points.at(-1)?.timestamp ?? u, f = O({
1111
+ domain: [...Se(u, d)],
1115
1112
  range: [3, 125]
1116
- }), p = k({
1113
+ }), p = O({
1117
1114
  domain: [...a],
1118
1115
  range: [29, 3]
1119
- }), m = Se([i], !1)[0];
1120
- return /* @__PURE__ */ D("svg", {
1116
+ }), m = Ce([i], !1)[0];
1117
+ return /* @__PURE__ */ E("svg", {
1121
1118
  role: "img",
1122
1119
  "aria-labelledby": o,
1123
1120
  "aria-describedby": s,
@@ -1127,11 +1124,11 @@ function Te({ title: e, summary: t, unit: n, timestampUnit: r, series: i, valueD
1127
1124
  height: 32,
1128
1125
  className: "x1rg5ohu x2pejg6 x10w6t97 x2lah0s xxymvpz",
1129
1126
  children: [
1130
- /* @__PURE__ */ E("title", {
1127
+ /* @__PURE__ */ T("title", {
1131
1128
  id: o,
1132
1129
  children: e
1133
1130
  }),
1134
- /* @__PURE__ */ D("desc", {
1131
+ /* @__PURE__ */ E("desc", {
1135
1132
  id: s,
1136
1133
  children: [
1137
1134
  t,
@@ -1149,7 +1146,7 @@ function Te({ title: e, summary: t, unit: n, timestampUnit: r, series: i, valueD
1149
1146
  "."
1150
1147
  ]
1151
1148
  }),
1152
- m !== void 0 && /* @__PURE__ */ E(we, {
1149
+ m !== void 0 && /* @__PURE__ */ T(Te, {
1153
1150
  series: m,
1154
1151
  x: f,
1155
1152
  y: p,
@@ -1158,10 +1155,10 @@ function Te({ title: e, summary: t, unit: n, timestampUnit: r, series: i, valueD
1158
1155
  ]
1159
1156
  });
1160
1157
  }
1161
- function Ee({ title: e, summary: t, unit: n, series: r, valueDomain: i }) {
1158
+ function De({ title: e, summary: t, unit: n, series: r, valueDomain: i }) {
1162
1159
  if (e.trim() === "" || t.trim() === "" || n.trim() === "") return "A trend requires a title, a readable summary, and a value unit.";
1163
- if (!m(i)) return "The displayed value domain must have finite, increasing bounds.";
1164
- let a = ye({
1160
+ if (!h(i)) return "The displayed value domain must have finite, increasing bounds.";
1161
+ let a = be({
1165
1162
  series: [r],
1166
1163
  isStacked: !1,
1167
1164
  markers: []
@@ -1170,7 +1167,7 @@ function Ee({ title: e, summary: t, unit: n, series: r, valueDomain: i }) {
1170
1167
  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.";
1171
1168
  }
1172
1169
  // packages/charts/src/cartesian/time-series.tsx
1173
- var De = {
1170
+ var Oe = {
1174
1171
  timeAxis: {
1175
1172
  k1xSpc: "x78zum5",
1176
1173
  kjj79g: "x1qughib",
@@ -1191,109 +1188,109 @@ var De = {
1191
1188
  "--x-paddingInlineEnd": ((e) => typeof e == "number" ? e + "px" : e ?? void 0)(t)
1192
1189
  }]
1193
1190
  };
1194
- function Oe(e) {
1195
- return /* @__PURE__ */ E(Fe, {
1191
+ function ke(e) {
1192
+ return /* @__PURE__ */ T(Ie, {
1196
1193
  ...e,
1197
1194
  kind: "line",
1198
1195
  isStacked: !1
1199
1196
  });
1200
1197
  }
1201
- function ke({ isStacked: e = !1, ...t }) {
1202
- return /* @__PURE__ */ E(Fe, {
1198
+ function Ae({ isStacked: e = !1, ...t }) {
1199
+ return /* @__PURE__ */ T(Ie, {
1203
1200
  ...t,
1204
1201
  kind: "area",
1205
1202
  isStacked: e
1206
1203
  });
1207
1204
  }
1208
- function Ae(e) {
1209
- return /* @__PURE__ */ E(je, { ...e });
1205
+ function je(e) {
1206
+ return /* @__PURE__ */ T(Me, { ...e });
1210
1207
  }
1211
- function je({ title: n, description: r, series: i, actions: a, report: o, height: s = 180, showTimeAxis: c = !0 }) {
1212
- let d = S(), f = Se(i.map((e) => ({
1208
+ function Me({ title: e, description: r, series: i, actions: a, report: o, height: c = 180, showTimeAxis: l = !0 }) {
1209
+ let u = S(), d = Ce(i.map((e) => ({
1213
1210
  ...e,
1214
1211
  points: []
1215
1212
  })), !1);
1216
- return !Number.isFinite(s) || s < 48 ? /* @__PURE__ */ E(h, {
1217
- title: n,
1213
+ return !Number.isFinite(c) || c < 48 ? /* @__PURE__ */ T(g, {
1214
+ title: e,
1218
1215
  description: r,
1219
1216
  report: o,
1220
1217
  message: "Chart height must be at least 48 pixels."
1221
- }) : /* @__PURE__ */ E("div", {
1218
+ }) : /* @__PURE__ */ T("div", {
1222
1219
  "aria-hidden": !0,
1223
1220
  inert: !0,
1224
1221
  className: "xeuugli",
1225
- children: /* @__PURE__ */ E(u, {
1226
- title: n,
1222
+ children: /* @__PURE__ */ T(f, {
1223
+ title: e,
1227
1224
  description: r,
1228
1225
  report: o,
1229
- series: f,
1226
+ series: d,
1230
1227
  actions: a,
1231
- children: /* @__PURE__ */ D("div", {
1228
+ children: /* @__PURE__ */ E("div", {
1232
1229
  className: "xrvj5dj x1n8ia3y",
1233
- children: [/* @__PURE__ */ E(oe, {
1234
- id: d,
1230
+ children: [/* @__PURE__ */ T(le, {
1231
+ id: u,
1235
1232
  label: void 0,
1236
- legend: f,
1233
+ legend: d,
1237
1234
  rows: [],
1238
1235
  x: 0,
1239
1236
  width: 0,
1240
1237
  source: void 0,
1241
1238
  hasSeriesSummary: o?.seriesValues !== void 0
1242
- }), /* @__PURE__ */ D("div", {
1243
- ...b.props(l.plot),
1244
- children: [/* @__PURE__ */ E(t, { height: s - 16 }), c && /* @__PURE__ */ D("div", {
1239
+ }), /* @__PURE__ */ E("div", {
1240
+ ...x.props(s.plot),
1241
+ children: [/* @__PURE__ */ T(t, { height: c - 16 }), l && /* @__PURE__ */ E("div", {
1245
1242
  className: "x78zum5 x1qughib x8zbtdt x1c87qhr xy8obcc xas2l8k x153jb6y xss6m8b",
1246
- children: [/* @__PURE__ */ E(e, { width: "8ch" }), /* @__PURE__ */ E(e, { width: "8ch" })]
1243
+ children: [/* @__PURE__ */ T(n, { width: "8ch" }), /* @__PURE__ */ T(n, { width: "8ch" })]
1247
1244
  })]
1248
1245
  })]
1249
1246
  })
1250
1247
  })
1251
1248
  });
1252
1249
  }
1253
- function Me({ charts: e, ...t }) {
1254
- let n = ee(null), [r, i] = w(), a = JSON.stringify(e.map((e) => [
1250
+ function Ne({ charts: e, ...t }) {
1251
+ let n = ne(null), [r, i] = C(), a = JSON.stringify(e.map((e) => [
1255
1252
  e.id,
1256
1253
  e.title,
1257
- be({
1254
+ xe({
1258
1255
  series: e.series,
1259
1256
  markers: e.markers ?? [],
1260
1257
  timestampUnit: t.timestampUnit,
1261
1258
  isStacked: !1
1262
1259
  })
1263
1260
  ])), 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);
1264
- if (r !== void 0 && r.signature !== a && i(void 0), x(() => {
1261
+ if (r !== void 0 && r.signature !== a && i(void 0), ee(() => {
1265
1262
  function e(e) {
1266
1263
  e.target instanceof Node && n.current?.contains(e.target) !== !0 && i(void 0);
1267
1264
  }
1268
1265
  return document.addEventListener("pointerdown", e), () => document.removeEventListener("pointerdown", e);
1269
- }, []), !s || !p(e)) return /* @__PURE__ */ E(h, {
1266
+ }, []), !s || !m(e)) return /* @__PURE__ */ T(g, {
1270
1267
  title: "Small multiples",
1271
1268
  message: "Charts need unique identifiers and aligned observation timestamps."
1272
1269
  });
1273
- if (e.length > $.panels) return /* @__PURE__ */ E(h, {
1270
+ if (e.length > $.panels) return /* @__PURE__ */ T(g, {
1274
1271
  title: "Small multiples",
1275
1272
  message: `Choose at most ${$.panels} panels.`
1276
1273
  });
1277
- if (e.length === 0) return /* @__PURE__ */ E(u, {
1274
+ if (e.length === 0) return /* @__PURE__ */ T(f, {
1278
1275
  title: "Small multiples",
1279
- children: /* @__PURE__ */ E("p", {
1276
+ children: /* @__PURE__ */ T("p", {
1280
1277
  className: "x153jb6y",
1281
1278
  children: "No charts"
1282
1279
  })
1283
1280
  });
1284
1281
  let c = Math.max(52, ...e.flatMap((e) => e.series.flatMap((t) => t.points.flatMap((t) => t.value === null || !Number.isFinite(t.value) ? [] : [(e.formatTick ?? e.formatValue)(t.value).length * 7 + 12])))), l = e.every((e) => e.report !== void 0);
1285
- return /* @__PURE__ */ E("div", {
1282
+ return /* @__PURE__ */ T("div", {
1286
1283
  ref: n,
1287
1284
  ...{
1288
1285
  0: { className: "xrvj5dj x1j825kq" },
1289
1286
  1: { className: "xrvj5dj xxhr3t" }
1290
1287
  }[!!l | 0],
1291
- children: e.map((n, o) => /* @__PURE__ */ E("div", {
1288
+ children: e.map((n, o) => /* @__PURE__ */ T("div", {
1292
1289
  ...{
1293
1290
  0: {},
1294
1291
  1: { className: "x1y332i5" }
1295
1292
  }[!!(l && o > 0) | 0],
1296
- children: /* @__PURE__ */ E(Fe, {
1293
+ children: /* @__PURE__ */ T(Ie, {
1297
1294
  ...t,
1298
1295
  title: n.title,
1299
1296
  description: n.description,
@@ -1319,25 +1316,25 @@ function Me({ charts: e, ...t }) {
1319
1316
  }, n.id))
1320
1317
  });
1321
1318
  }
1322
- function Ne({ charts: e, height: t }) {
1323
- if (!p(e) || e.length > $.panels) return /* @__PURE__ */ E(h, {
1319
+ function Pe({ charts: e, height: t }) {
1320
+ if (!m(e) || e.length > $.panels) return /* @__PURE__ */ T(g, {
1324
1321
  title: "Small multiples",
1325
1322
  message: `Choose at most ${$.panels} panels with unique identifiers.`
1326
1323
  });
1327
1324
  let n = e.every((e) => e.report !== void 0);
1328
- return /* @__PURE__ */ E("div", {
1325
+ return /* @__PURE__ */ T("div", {
1329
1326
  "aria-hidden": !0,
1330
1327
  inert: !0,
1331
1328
  ...{
1332
1329
  0: { className: "xrvj5dj x1j825kq" },
1333
1330
  1: { className: "xrvj5dj xxhr3t" }
1334
1331
  }[!!n | 0],
1335
- children: e.map((r, i) => /* @__PURE__ */ E("div", {
1332
+ children: e.map((r, i) => /* @__PURE__ */ T("div", {
1336
1333
  ...{
1337
1334
  0: {},
1338
1335
  1: { className: "x1y332i5" }
1339
1336
  }[!!(n && i > 0) | 0],
1340
- children: /* @__PURE__ */ E(je, {
1337
+ children: /* @__PURE__ */ T(Me, {
1341
1338
  ...r,
1342
1339
  height: t,
1343
1340
  showTimeAxis: i === e.length - 1
@@ -1345,92 +1342,92 @@ function Ne({ charts: e, height: t }) {
1345
1342
  }, r.id))
1346
1343
  });
1347
1344
  }
1348
- var Pe = {
1345
+ var Fe = {
1349
1346
  "x-default-marker": "x-default-marker",
1350
1347
  $$css: !0
1351
1348
  };
1352
- function Fe({ title: e, description: t, series: n, timestampUnit: r, formatTimestamp: i, formatValue: a, formatTick: o = a, markers: s = [], height: c = 180, actions: f, report: p, kind: m, isStacked: v, sharedInspection: y, axisWidth: T, showTimeAxis: O = !0 }) {
1353
- let A = !Number.isFinite(c) || c < 48 ? "Chart height must be at least 48 pixels." : ye({
1354
- series: n,
1355
- isStacked: v,
1356
- markers: s
1357
- }), j = C(() => A === void 0 ? Se(n, v) : [], [
1358
- n,
1359
- v,
1360
- A
1361
- ]), N = j[0]?.points ?? [], { ref: P, width: re, element: ie } = _(), se = ee(null), [ce, le] = w(), ue = N.find((e) => e.timestamp === ce) ?? N[0], [de, fe] = w(), F = be({
1362
- series: n,
1363
- markers: s,
1364
- timestampUnit: r,
1365
- isStacked: v
1366
- }), I = y === void 0 ? de?.signature === F ? de : void 0 : y.value, L = y === void 0 || y.isSource ? I : void 0, pe = p?.seriesValues !== void 0, me = S();
1367
- de !== void 0 && (de.signature !== F || A !== void 0) && fe(void 0);
1349
+ function Ie({ title: t, description: n, series: r, timestampUnit: i, formatTimestamp: a, formatValue: o, formatTick: c = o, markers: l = [], height: u = 180, actions: d, report: p, kind: m, isStacked: h, sharedInspection: y, axisWidth: b, showTimeAxis: w = !0 }) {
1350
+ let D = !Number.isFinite(u) || u < 48 ? "Chart height must be at least 48 pixels." : be({
1351
+ series: r,
1352
+ isStacked: h,
1353
+ markers: l
1354
+ }), k = te(() => D === void 0 ? Ce(r, h) : [], [
1355
+ r,
1356
+ h,
1357
+ D
1358
+ ]), A = k[0]?.points ?? [], { ref: oe, width: j, element: M } = v(), se = ne(null), [ue, N] = C(), de = A.find((e) => e.timestamp === ue) ?? A[0], [P, fe] = C(), F = xe({
1359
+ series: r,
1360
+ markers: l,
1361
+ timestampUnit: i,
1362
+ isStacked: h
1363
+ }), I = y === void 0 ? P?.signature === F ? P : void 0 : y.value, L = y === void 0 || y.isSource ? I : void 0, pe = p?.seriesValues !== void 0, me = S();
1364
+ P !== void 0 && (P.signature !== F || D !== void 0) && fe(void 0);
1368
1365
  let he = y !== void 0;
1369
- if (x(() => {
1366
+ if (ee(() => {
1370
1367
  if (he) return;
1371
1368
  function e(e) {
1372
1369
  e.target instanceof Node && se.current?.contains(e.target) !== !0 && fe(void 0);
1373
1370
  }
1374
1371
  return document.addEventListener("pointerdown", e), () => document.removeEventListener("pointerdown", e);
1375
- }, [he]), A !== void 0) return /* @__PURE__ */ E(h, {
1376
- title: e,
1377
- description: t,
1372
+ }, [he]), D !== void 0) return /* @__PURE__ */ T(g, {
1373
+ title: t,
1374
+ description: n,
1378
1375
  report: p,
1379
- message: A
1376
+ message: D
1380
1377
  });
1381
- if (N.length === 0) return /* @__PURE__ */ E(u, {
1382
- title: e,
1383
- description: t,
1384
- actions: f,
1378
+ if (A.length === 0) return /* @__PURE__ */ T(f, {
1379
+ title: t,
1380
+ description: n,
1381
+ actions: d,
1385
1382
  report: p,
1386
- series: j,
1387
- children: /* @__PURE__ */ E("p", {
1383
+ series: k,
1384
+ children: /* @__PURE__ */ T("p", {
1388
1385
  className: "x153jb6y",
1389
1386
  children: "No observations"
1390
1387
  })
1391
1388
  });
1392
- let R = c - 28, z = R + 12, B = N[0]?.timestamp ?? 0, V = N.at(-1)?.timestamp ?? B, H = j.flatMap((e) => e.points.flatMap((e) => e.value === null ? [] : [e.value + e.base])), U = m === "area" ? Math.min(0, ...H) : Math.min(...H), W = m === "area" ? Math.max(0, ...H) : Math.max(...H), G = H.length === 0 ? 0 : U, ge = H.length === 0 ? 1 : W, K = k({
1393
- domain: [...xe(G, ge, m === "area")],
1389
+ let R = u - 28, ge = R + 12, z = A[0]?.timestamp ?? 0, B = A.at(-1)?.timestamp ?? z, V = k.flatMap((e) => e.points.flatMap((e) => e.value === null ? [] : [e.value + e.base])), H = m === "area" ? Math.min(0, ...V) : Math.min(...V), U = m === "area" ? Math.max(0, ...V) : Math.max(...V), W = V.length === 0 ? 0 : H, G = V.length === 0 ? 1 : U, K = O({
1390
+ domain: [...Se(W, G, m === "area")],
1394
1391
  range: [R, 12]
1395
- }), q = K.ticks(3), J = T ?? Math.max(44, ...q.map((e) => o(e).length * 7 + 12)), Y = Math.max(J + 1, re - 16), X = k({
1396
- domain: [...xe(B, V)],
1397
- range: [J, Y]
1392
+ }), _e = K.ticks(3), q = b ?? Math.max(44, ..._e.map((e) => c(e).length * 7 + 12)), J = Math.max(q + 1, j - 16), Y = O({
1393
+ domain: [...Se(z, B)],
1394
+ range: [q, J]
1398
1395
  });
1399
- function Z(e) {
1400
- let t = ie?.getBoundingClientRect();
1396
+ function X(e) {
1397
+ let t = M?.getBoundingClientRect();
1401
1398
  if (t === void 0) return;
1402
- let n = X.invert(e - t.left), r = N.find((e, t) => {
1403
- let r = N[t + 1];
1399
+ let n = Y.invert(e - t.left), r = A.find((e, t) => {
1400
+ let r = A[t + 1];
1404
1401
  return r === void 0 || n <= e.timestamp + (r.timestamp - e.timestamp) / 2;
1405
1402
  });
1406
- r !== void 0 && Q({
1403
+ r !== void 0 && Z({
1407
1404
  signature: F,
1408
1405
  timestamp: r.timestamp,
1409
1406
  source: "pointer"
1410
1407
  });
1411
1408
  }
1412
- function Q(e) {
1409
+ function Z(e) {
1413
1410
  y === void 0 ? fe(e) : y.onChange(e);
1414
1411
  }
1415
- function $(e) {
1412
+ function Q(e) {
1416
1413
  if (e.altKey || e.ctrlKey || e.metaKey) return;
1417
- let t = N.findIndex((e) => e.timestamp === ue?.timestamp), n = {
1418
- ArrowRight: Math.min(N.length - 1, t + 1),
1414
+ let t = A.findIndex((e) => e.timestamp === de?.timestamp), n = {
1415
+ ArrowRight: Math.min(A.length - 1, t + 1),
1419
1416
  ArrowLeft: Math.max(0, t - 1),
1420
1417
  Home: 0,
1421
- End: N.length - 1
1418
+ End: A.length - 1
1422
1419
  };
1423
1420
  switch (e.key) {
1424
1421
  case "Escape":
1425
- e.preventDefault(), e.stopPropagation(), Q(void 0);
1422
+ e.preventDefault(), e.stopPropagation(), Z(void 0);
1426
1423
  break;
1427
1424
  case "ArrowRight":
1428
1425
  case "ArrowLeft":
1429
1426
  case "Home":
1430
1427
  case "End": {
1431
1428
  e.preventDefault();
1432
- let t = N[n[e.key]];
1433
- t !== void 0 && (le(t.timestamp), Q({
1429
+ let t = A[n[e.key]];
1430
+ t !== void 0 && (N(t.timestamp), Z({
1434
1431
  signature: F,
1435
1432
  timestamp: t.timestamp,
1436
1433
  source: "keyboard"
@@ -1439,85 +1436,85 @@ function Fe({ title: e, description: t, series: n, timestampUnit: r, formatTimes
1439
1436
  }
1440
1437
  }
1441
1438
  }
1442
- return /* @__PURE__ */ E("div", {
1439
+ return /* @__PURE__ */ T("div", {
1443
1440
  ref: se,
1444
1441
  className: "xeuugli",
1445
- children: /* @__PURE__ */ D(u, {
1446
- title: pe ? e : /* @__PURE__ */ E(ae, {
1447
- title: e,
1448
- detail: L === void 0 ? void 0 : i(L.timestamp)
1442
+ children: /* @__PURE__ */ E(f, {
1443
+ title: pe ? t : /* @__PURE__ */ T(ce, {
1444
+ title: t,
1445
+ detail: L === void 0 ? void 0 : a(L.timestamp)
1449
1446
  }),
1450
- description: t,
1447
+ description: n,
1451
1448
  report: p,
1452
- series: j,
1453
- actions: f,
1454
- children: [/* @__PURE__ */ E(M, { children: /* @__PURE__ */ D("table", {
1449
+ series: k,
1450
+ actions: d,
1451
+ children: [/* @__PURE__ */ T(ae, { children: /* @__PURE__ */ E("table", {
1455
1452
  className: "xh8yej3 x1mwwwfo xy8obcc x1yc453h xss6m8b",
1456
1453
  children: [
1457
- /* @__PURE__ */ D("caption", { children: [e, " observations"] }),
1458
- /* @__PURE__ */ E("thead", { children: /* @__PURE__ */ D("tr", { children: [/* @__PURE__ */ D("th", {
1454
+ /* @__PURE__ */ E("caption", { children: [t, " observations"] }),
1455
+ /* @__PURE__ */ T("thead", { children: /* @__PURE__ */ E("tr", { children: [/* @__PURE__ */ E("th", {
1459
1456
  scope: "col",
1460
1457
  className: "x69ldcm x1yc453h xso031l x1q0q8m5 x1qndepd xj57cvi",
1461
1458
  children: [
1462
1459
  "Time (",
1463
- r,
1460
+ i,
1464
1461
  ")"
1465
1462
  ]
1466
- }), j.map((e) => /* @__PURE__ */ E("th", {
1463
+ }), k.map((e) => /* @__PURE__ */ T("th", {
1467
1464
  scope: "col",
1468
1465
  className: "x69ldcm x1yc453h xso031l x1q0q8m5 x1qndepd xj57cvi",
1469
1466
  children: e.label
1470
1467
  }, e.id))] }) }),
1471
- /* @__PURE__ */ E("tbody", { children: N.map((e, t) => /* @__PURE__ */ D("tr", { children: [/* @__PURE__ */ E("th", {
1468
+ /* @__PURE__ */ T("tbody", { children: A.map((e, t) => /* @__PURE__ */ E("tr", { children: [/* @__PURE__ */ T("th", {
1472
1469
  scope: "row",
1473
1470
  className: "x69ldcm x1yc453h xso031l x1q0q8m5 x1qndepd xj57cvi",
1474
- children: i(e.timestamp)
1475
- }), j.map((e) => /* @__PURE__ */ E("td", {
1471
+ children: a(e.timestamp)
1472
+ }), k.map((e) => /* @__PURE__ */ T("td", {
1476
1473
  className: "x69ldcm x1yc453h xso031l x1q0q8m5 x1qndepd xj57cvi",
1477
- children: e.points[t]?.value === null || e.points[t]?.value === void 0 ? "Unavailable" : a(e.points[t].value)
1474
+ children: e.points[t]?.value === null || e.points[t]?.value === void 0 ? "Unavailable" : o(e.points[t].value)
1478
1475
  }, e.id))] }, e.timestamp)) })
1479
1476
  ]
1480
- }) }), /* @__PURE__ */ D("div", {
1477
+ }) }), /* @__PURE__ */ E("div", {
1481
1478
  className: "xrvj5dj x1n8ia3y",
1482
1479
  children: [
1483
- /* @__PURE__ */ E(oe, {
1480
+ /* @__PURE__ */ T(le, {
1484
1481
  id: me,
1485
- label: L === void 0 ? void 0 : i(L.timestamp),
1486
- legend: j.map(({ id: e, label: t, tone: n }) => ({
1482
+ label: L === void 0 ? void 0 : a(L.timestamp),
1483
+ legend: k.map(({ id: e, label: t, tone: n }) => ({
1487
1484
  id: e,
1488
1485
  label: t,
1489
1486
  tone: n
1490
1487
  })),
1491
- rows: j.map((e) => {
1488
+ rows: k.map((e) => {
1492
1489
  let t = e.points.find((e) => e.timestamp === L?.timestamp);
1493
1490
  return {
1494
1491
  id: e.id,
1495
1492
  label: e.label,
1496
1493
  tone: e.tone,
1497
- value: t?.value === null || t === void 0 ? "Unavailable" : a(t.value)
1494
+ value: t?.value === null || t === void 0 ? "Unavailable" : o(t.value)
1498
1495
  };
1499
1496
  }),
1500
- x: X(I?.timestamp ?? B),
1501
- width: re,
1497
+ x: Y(I?.timestamp ?? z),
1498
+ width: j,
1502
1499
  source: L?.source,
1503
- notes: s.filter((e) => e.timestamp === L?.timestamp).map((e) => e.label),
1500
+ notes: l.filter((e) => e.timestamp === L?.timestamp).map((e) => e.label),
1504
1501
  hasSeriesSummary: pe
1505
1502
  }),
1506
- /* @__PURE__ */ D("div", {
1507
- ref: P,
1508
- ...b.props(l.plot),
1509
- children: [/* @__PURE__ */ D("svg", {
1503
+ /* @__PURE__ */ E("div", {
1504
+ ref: oe,
1505
+ ...x.props(s.plot),
1506
+ children: [/* @__PURE__ */ E("svg", {
1510
1507
  role: "img",
1511
- "aria-label": `${e}. Use arrow keys to inspect observations.`,
1508
+ "aria-label": `${t}. Use arrow keys to inspect observations.`,
1512
1509
  "aria-describedby": me,
1513
1510
  tabIndex: 0,
1514
- viewBox: `0 0 ${re} ${z}`,
1515
- height: z,
1516
- onKeyDown: $,
1511
+ viewBox: `0 0 ${j} ${ge}`,
1512
+ height: ge,
1513
+ onKeyDown: Q,
1517
1514
  onFocus: (e) => {
1518
1515
  if (e.currentTarget.matches(":focus-visible")) {
1519
- let e = I?.timestamp ?? B;
1520
- le(e), Q({
1516
+ let e = I?.timestamp ?? z;
1517
+ N(e), Z({
1521
1518
  signature: F,
1522
1519
  timestamp: e,
1523
1520
  source: "keyboard"
@@ -1525,90 +1522,90 @@ function Fe({ title: e, description: t, series: n, timestampUnit: r, formatTimes
1525
1522
  }
1526
1523
  },
1527
1524
  onPointerMove: (e) => {
1528
- e.pointerType === "mouse" && Z(e.clientX);
1525
+ e.pointerType === "mouse" && X(e.clientX);
1529
1526
  },
1530
- onPointerDown: (e) => Z(e.clientX),
1527
+ onPointerDown: (e) => X(e.clientX),
1531
1528
  onPointerLeave: (e) => {
1532
- e.pointerType === "mouse" && I?.source === "pointer" && Q(void 0);
1529
+ e.pointerType === "mouse" && I?.source === "pointer" && Z(void 0);
1533
1530
  },
1534
- onBlur: () => Q(void 0),
1535
- ...b.props(l.svg, l.inspectable, Pe),
1531
+ onBlur: () => Z(void 0),
1532
+ ...x.props(s.svg, s.inspectable, Fe),
1536
1533
  children: [
1537
- q.map((e) => /* @__PURE__ */ D("g", { children: [/* @__PURE__ */ E("line", {
1538
- x1: J,
1539
- x2: Y,
1534
+ _e.map((e) => /* @__PURE__ */ E("g", { children: [/* @__PURE__ */ T("line", {
1535
+ x1: q,
1536
+ x2: J,
1540
1537
  y1: K(e),
1541
1538
  y2: K(e),
1542
- ...b.props(l.grid)
1543
- }), /* @__PURE__ */ E("text", {
1544
- x: J - 8,
1539
+ ...x.props(s.grid)
1540
+ }), /* @__PURE__ */ T("text", {
1541
+ x: q - 8,
1545
1542
  y: K(e),
1546
1543
  textAnchor: "end",
1547
1544
  dominantBaseline: "middle",
1548
- ...b.props(l.label),
1549
- children: o(e)
1545
+ ...x.props(s.label),
1546
+ children: c(e)
1550
1547
  })] }, e)),
1551
- j.map((e) => /* @__PURE__ */ D("g", { children: [m === "area" && /* @__PURE__ */ E(te, {
1552
- data: [...e.points],
1548
+ k.map((t) => /* @__PURE__ */ E("g", { children: [m === "area" && /* @__PURE__ */ T(re, {
1549
+ data: [...t.points],
1553
1550
  defined: (e) => e.value !== null,
1554
- x: (e) => X(e.timestamp),
1551
+ x: (e) => Y(e.timestamp),
1555
1552
  y0: (e) => K(e.base),
1556
1553
  y1: (e) => K((e.value ?? 0) + e.base),
1557
1554
  yScale: K,
1558
- fill: d[e.tone],
1559
- fillOpacity: v ? .65 : .15
1560
- }), /* @__PURE__ */ E(we, {
1561
- series: e,
1562
- x: X,
1555
+ fill: e[t.tone],
1556
+ fillOpacity: h ? .65 : .15
1557
+ }), /* @__PURE__ */ T(Te, {
1558
+ series: t,
1559
+ x: Y,
1563
1560
  y: K,
1564
1561
  inspectedTimestamp: I?.timestamp
1565
- })] }, e.id)),
1566
- s.map((e) => /* @__PURE__ */ D("g", { children: [e.kind === "time" ? /* @__PURE__ */ E("line", {
1567
- x1: X(e.timestamp),
1568
- x2: X(e.timestamp),
1562
+ })] }, t.id)),
1563
+ l.map((e) => /* @__PURE__ */ E("g", { children: [e.kind === "time" ? /* @__PURE__ */ T("line", {
1564
+ x1: Y(e.timestamp),
1565
+ x2: Y(e.timestamp),
1569
1566
  y1: 12,
1570
1567
  y2: R,
1571
1568
  className: "xhq4mlf x1ntoi03 x13efnbd"
1572
- }) : /* @__PURE__ */ E("circle", {
1573
- cx: X(e.timestamp),
1574
- cy: K(e.value + (j.find((t) => t.id === e.seriesId)?.points.find((t) => t.timestamp === e.timestamp)?.base ?? 0)),
1569
+ }) : /* @__PURE__ */ T("circle", {
1570
+ cx: Y(e.timestamp),
1571
+ cy: K(e.value + (k.find((t) => t.id === e.seriesId)?.points.find((t) => t.timestamp === e.timestamp)?.base ?? 0)),
1575
1572
  r: 4,
1576
- fill: g.surface,
1577
- ...b.props(l.selected)
1578
- }), /* @__PURE__ */ E("title", { children: e.kind === "point" ? `${e.label}: ${a(e.value)}` : e.label })] }, e.id)),
1579
- I !== void 0 && /* @__PURE__ */ E("line", {
1580
- x1: X(I.timestamp),
1581
- x2: X(I.timestamp),
1573
+ fill: _.surface,
1574
+ ...x.props(s.selected)
1575
+ }), /* @__PURE__ */ T("title", { children: e.kind === "point" ? `${e.label}: ${o(e.value)}` : e.label })] }, e.id)),
1576
+ I !== void 0 && /* @__PURE__ */ T("line", {
1577
+ x1: Y(I.timestamp),
1578
+ x2: Y(I.timestamp),
1582
1579
  y1: 12,
1583
1580
  y2: R,
1584
1581
  className: "xhq4mlf x1ntoi03 x13efnbd"
1585
1582
  }),
1586
- ue !== void 0 && /* @__PURE__ */ E(ne, {
1587
- x: X(ue.timestamp),
1583
+ de !== void 0 && /* @__PURE__ */ T(ie, {
1584
+ x: Y(de.timestamp),
1588
1585
  top: 12,
1589
1586
  bottom: R,
1590
- width: Math.min(16, (Y - J) / 2)
1587
+ width: Math.min(16, (J - q) / 2)
1591
1588
  })
1592
1589
  ]
1593
- }), O && /* @__PURE__ */ D("div", {
1590
+ }), w && /* @__PURE__ */ E("div", {
1594
1591
  "aria-hidden": !0,
1595
- ...b.props(De.timeAxis, De.timeAxisInset(J, Math.max(0, re - Y))),
1596
- children: [/* @__PURE__ */ E("span", {
1592
+ ...x.props(Oe.timeAxis, Oe.timeAxisInset(q, Math.max(0, j - J))),
1593
+ children: [/* @__PURE__ */ T("span", {
1597
1594
  className: "x1cqoux5 xeuugli xj0a0fe",
1598
- children: i(B)
1599
- }), V !== B && /* @__PURE__ */ E("span", {
1595
+ children: a(z)
1596
+ }), B !== z && /* @__PURE__ */ T("span", {
1600
1597
  className: "x1cqoux5 xeuugli xj0a0fe xp4054r",
1601
- children: i(V)
1598
+ children: a(B)
1602
1599
  })]
1603
1600
  })]
1604
1601
  }),
1605
- s.length > 0 && /* @__PURE__ */ E("ul", {
1602
+ l.length > 0 && /* @__PURE__ */ T("ul", {
1606
1603
  className: "x78zum5 x1a02dak x1n8ia3y x1ghz6dp x1717udv xe8uvvx xy8obcc x153jb6y xj0a0fe",
1607
- children: s.map((e) => /* @__PURE__ */ D("li", { children: [
1608
- i(e.timestamp),
1604
+ children: l.map((e) => /* @__PURE__ */ E("li", { children: [
1605
+ a(e.timestamp),
1609
1606
  " · ",
1610
1607
  e.label,
1611
- e.kind === "point" && ` · ${a(e.value)}`
1608
+ e.kind === "point" && ` · ${o(e.value)}`
1612
1609
  ] }, e.id))
1613
1610
  })
1614
1611
  ]
@@ -1616,4 +1613,4 @@ function Fe({ title: e, description: t, series: n, timestampUnit: r, formatTimes
1616
1613
  })
1617
1614
  });
1618
1615
  }
1619
- export { ke as AreaChart, he as BarChart, I as BarChartPlaceholder, V as BreakdownBar, Oe as LineChart, ge as MAX_SCATTER_POINTS, J as ScatterPlot, Me as SmallMultiples, Ne as SmallMultiplesPlaceholder, Te as Sparkline, Ae as TimeSeriesChartPlaceholder, $ as timeSeriesLimits };
1616
+ export { Ae as AreaChart, R as BarChart, L as BarChartPlaceholder, V as BreakdownBar, ke as LineChart, K as MAX_SCATTER_POINTS, J as ScatterPlot, Ne as SmallMultiples, Pe as SmallMultiplesPlaceholder, Ee as Sparkline, je as TimeSeriesChartPlaceholder, $ as timeSeriesLimits };