@mechane-ai/elements 0.41.0 → 0.42.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 (65) hide show
  1. package/README.md +40 -9
  2. package/bin/catalog.d.mts +17 -0
  3. package/bin/mechane-elements-catalog.mjs +60 -0
  4. package/dist/agent.js +1 -1
  5. package/dist/ai.js +23 -23
  6. package/dist/catalog.json +1896 -0
  7. package/dist/{categorical-values-DnGR_pQx.js → categorical-values-B6lGI7BH.js} +3 -3
  8. package/dist/{chart-frame-BsyI1Zc8.js → chart-frame-D0enjyj9.js} +1 -1
  9. package/dist/{chart-input-r4S3-QCT.js → chart-input-D4_Awave.js} +2 -2
  10. package/dist/{chart-navigation-D7OkLdSx.js → chart-navigation-D4-pdgpj.js} +12 -1
  11. package/dist/charts/cartesian.js +263 -243
  12. package/dist/charts/distribution.js +4 -4
  13. package/dist/charts/graph.js +4 -4
  14. package/dist/charts/hierarchy.js +4 -4
  15. package/dist/charts/matrix.js +4 -4
  16. package/dist/charts/timeline.js +3 -3
  17. package/dist/charts.js +2 -2
  18. package/dist/{code-block-C4K1sM9O.js → code-block-Cpfr7B6a.js} +1 -1
  19. package/dist/collections.js +475 -354
  20. package/dist/content/code.js +1 -1
  21. package/dist/content/diff.js +3 -3
  22. package/dist/content/link.js +1 -1
  23. package/dist/content/markdown.js +2 -2
  24. package/dist/content/tree.js +2 -2
  25. package/dist/{content-link-CBDqSvgP.js → content-link-CGeFFb9F.js} +1 -1
  26. package/dist/content.js +1 -1
  27. package/dist/feedback.js +1 -1
  28. package/dist/forms/dates.js +11 -11
  29. package/dist/{forms-I-WMHTkr.js → forms-DeU0Tiv3.js} +6 -2
  30. package/dist/forms.js +3 -3
  31. package/dist/index.js +1 -1
  32. package/dist/layout.js +275 -249
  33. package/dist/mechane-elements-catalog.mjs +4 -0
  34. package/dist/navigation.js +2 -2
  35. package/dist/packages/charts/src/chart-inspection.d.ts +1 -0
  36. package/dist/packages/charts/src/chart-navigation.d.ts +2 -0
  37. package/dist/packages/charts/src/chart-surface.d.ts +2 -0
  38. package/dist/packages/collections/src/collection-controls.d.ts +2 -1
  39. package/dist/packages/collections/src/data-table.d.ts +12 -8
  40. package/dist/packages/collections/src/index.d.ts +1 -0
  41. package/dist/packages/collections/src/table-results.d.ts +26 -0
  42. package/dist/packages/core/src/actions.d.ts +6 -0
  43. package/dist/packages/core/src/index.d.ts +1 -1
  44. package/dist/packages/forms/src/form-status.d.ts +7 -0
  45. package/dist/packages/forms/src/forms.d.ts +3 -1
  46. package/dist/packages/forms/src/index.d.ts +2 -0
  47. package/dist/packages/foundations/src/agent/index.d.ts +2 -2
  48. package/dist/packages/layout/src/page-context.d.ts +4 -0
  49. package/dist/packages/navigation/src/index.d.ts +1 -0
  50. package/dist/packages/navigation/src/route-link.d.ts +2 -0
  51. package/dist/{pierre-diff-DJ3oOfPX.js → pierre-diff-B3tD3-6z.js} +1 -1
  52. package/dist/{src-D2OHco8V.js → src-Bk7M67zy.js} +3 -3
  53. package/dist/{src-DfOAlAd2.js → src-BpvnBWrF.js} +1 -1
  54. package/dist/{src-CQQvXi7a.js → src-DBNncL7_.js} +70 -50
  55. package/dist/{src-s3tWwnN4.js → src-DcW_gMX8.js} +178 -168
  56. package/dist/{src-CNV1ewzb.js → src-gqEebHEa.js} +319 -285
  57. package/package.json +9 -2
  58. package/recipes/consequential-form.tsx +132 -0
  59. package/recipes/searchable-collection.tsx +106 -0
  60. package/recipes/sectioned-report.tsx +58 -0
  61. package/recipes/tabbed-workspace.tsx +84 -0
  62. package/skills/extend-elements/SKILL.md +28 -0
  63. package/skills/use-elements/SKILL.md +36 -0
  64. package/skills/{elements-presentation/SKILL.md → use-elements/references/reports.md} +0 -6
  65. package/skills/{elements-workspace/SKILL.md → use-elements/references/workspace.md} +0 -6
@@ -1,12 +1,12 @@
1
- import { c as e, d as t, f as n } from "../src-DfOAlAd2.js";
2
- import { i as r, n as i, r as a, t as o } from "../categorical-values-DnGR_pQx.js";
3
- import { a as s, n as c, r as l, t as u } from "../chart-navigation-D7OkLdSx.js";
4
- import { a as d, i as f, n as p } from "../chart-frame-BsyI1Zc8.js";
5
- import { n as m, r as h, t as g } from "../chart-input-r4S3-QCT.js";
1
+ import { c as e, d as t, f as n } from "../src-BpvnBWrF.js";
2
+ import { i as r, n as i, r as a, t as o } from "../categorical-values-B6lGI7BH.js";
3
+ import { a as s, n as c, r as l, t as u } from "../chart-navigation-D4-pdgpj.js";
4
+ import { a as d, i as f, n as p } from "../chart-frame-D0enjyj9.js";
5
+ import { n as m, r as h, t as g } from "../chart-input-D4_Awave.js";
6
6
  import { r as _ } from "../tokens.stylex-dF5CACEJ.js";
7
7
  import { n as v, t as ee } from "../plot-width-BQQS-mw9.js";
8
- import { D as y } from "../src-s3tWwnN4.js";
9
- import { m as b } from "../src-CNV1ewzb.js";
8
+ import { O as y } from "../src-DcW_gMX8.js";
9
+ import { h as b } from "../src-gqEebHEa.js";
10
10
  import * as x from "@stylexjs/stylex";
11
11
  import { Button as te } from "@ui-sdk/react/button";
12
12
  import { useEffect as S, useId as C, useMemo as ne, useRef as w, useState as T } from "react";
@@ -120,13 +120,16 @@ function F({ title: e, detail: t }) {
120
120
  })]
121
121
  });
122
122
  }
123
- function ce({ 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 }) {
124
- 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 ? [] : [
123
+ function ce({ label: e, summary: t, rows: n, notes: r = [] }) {
124
+ if (e !== void 0) return [
125
+ e,
125
126
  t,
126
- n,
127
- ...a.map((e) => `${e.label}: ${e.value}`),
128
- ...u
129
- ].filter((e) => e !== void 0);
127
+ ...n.map((e) => `${e.label}: ${e.value}`),
128
+ ...r
129
+ ].filter((e) => e !== void 0).join(" · ");
130
+ }
131
+ 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 }) {
132
+ let p = Math.min(260, s), m = o > s / 2 ? o - p - c : o + c, h = Math.max(0, Math.min(s - p, m));
130
133
  return /* @__PURE__ */ O("div", {
131
134
  className: "xeuugli",
132
135
  children: [
@@ -162,7 +165,12 @@ function ce({ id: e, label: t, summary: n, legend: r, layoutLegend: i, rows: a,
162
165
  id: e,
163
166
  "aria-live": l === "keyboard" ? "polite" : "off",
164
167
  className: "x10l6tqk x1i1rx1s xjm9jq1 x1717udv xb3r6kr x1hyvwdk xuxw1ft",
165
- children: g.join(" · ")
168
+ children: ce({
169
+ label: t,
170
+ summary: n,
171
+ rows: a,
172
+ notes: u
173
+ })
166
174
  }),
167
175
  t !== void 0 && /* @__PURE__ */ D("div", {
168
176
  "aria-hidden": !0,
@@ -195,7 +203,7 @@ function ce({ id: e, label: t, summary: n, legend: r, layoutLegend: i, rows: a,
195
203
  });
196
204
  }
197
205
  // packages/charts/src/cartesian/bar-data.ts
198
- function le({ composition: e, series: t, categoryIds: n, domain: r }) {
206
+ function ue({ composition: e, series: t, categoryIds: n, domain: r }) {
199
207
  if (e === void 0) return;
200
208
  if (e.buckets.length !== n.length) return "Composition requires one explicit bucket per category.";
201
209
  let i = e.annotation;
@@ -213,7 +221,7 @@ function le({ composition: e, series: t, categoryIds: n, domain: r }) {
213
221
  }
214
222
  }
215
223
  // packages/charts/src/cartesian/composition-bars.tsx
216
- var ue = { mark: {
224
+ var I = { mark: {
217
225
  k3nNDw: "x1hj3fc7",
218
226
  k1ekBW: "xwcsmn1",
219
227
  kIyJzY: "xtitasy x12w9bfk",
@@ -233,7 +241,7 @@ function de({ bucket: t, series: n, focusedSeries: r, index: i, x: o, width: s,
233
241
  height: 1,
234
242
  vectorEffect: "non-scaling-stroke",
235
243
  fill: e.neutral,
236
- ...x.props(ue.mark, l && v.selected),
244
+ ...x.props(I.mark, l && v.selected),
237
245
  style: {
238
246
  transform: p(t.total, 0),
239
247
  opacity: d ? .18 : +(t.kind === "total")
@@ -249,7 +257,7 @@ function de({ bucket: t, series: n, focusedSeries: r, index: i, x: o, width: s,
249
257
  height: 1,
250
258
  vectorEffect: "non-scaling-stroke",
251
259
  fill: e[a(c.tone, f)],
252
- ...x.props(ue.mark, l && v.selected),
260
+ ...x.props(I.mark, l && v.selected),
253
261
  style: {
254
262
  transform: p(m, g),
255
263
  opacity: _ ? ee ? .3 : 1 : 0
@@ -258,7 +266,7 @@ function de({ bucket: t, series: n, focusedSeries: r, index: i, x: o, width: s,
258
266
  })] });
259
267
  }
260
268
  // packages/charts/src/cartesian/bar-chart.tsx
261
- var I = {
269
+ var L = {
262
270
  plot: {
263
271
  kqGvvJ: "x1we84gm",
264
272
  $$css: !0
@@ -268,16 +276,16 @@ var I = {
268
276
  $$css: !0
269
277
  }
270
278
  }, fe = 200;
271
- function L({ title: e, description: t, report: n, series: r, layoutSeries: i, children: o, inspectionId: c, label: l, detail: u, summary: d, rows: f = [], index: m = -1, formatValue: h = String, x: g = 0, width: _ = 0, offset: v, source: ee, data: y, isLoading: b = !1 }) {
272
- let x = r.map((e, t) => ({
279
+ function R({ title: e, description: t, report: n, series: r, layoutSeries: i, children: o, inspectionId: c, label: l, detail: u, summary: d, rows: f = [], x: m = 0, width: h = 0, offset: g, source: _, data: v, isLoading: ee = !1 }) {
280
+ let y = r.map((e, t) => ({
273
281
  id: e.id,
274
282
  label: e.label,
275
283
  tone: a(e.tone, t)
276
- })), te = i?.map((e, t) => ({
284
+ })), b = i?.map((e, t) => ({
277
285
  id: e.id,
278
286
  label: e.label,
279
287
  tone: a(e.tone, t)
280
- })), S = b && r.length === 0 && n?.seriesValues === void 0;
288
+ })), x = ee && r.length === 0 && n?.seriesValues === void 0;
281
289
  return /* @__PURE__ */ O(p, {
282
290
  title: /* @__PURE__ */ D(F, {
283
291
  title: e,
@@ -285,37 +293,32 @@ function L({ title: e, description: t, report: n, series: r, layoutSeries: i, ch
285
293
  }),
286
294
  description: t,
287
295
  report: n,
288
- series: x,
296
+ series: y,
289
297
  children: [
290
- y !== void 0 && /* @__PURE__ */ D(s, { ...y }),
291
- S ? /* @__PURE__ */ D(se, {}) : /* @__PURE__ */ D(ce, {
298
+ v !== void 0 && /* @__PURE__ */ D(s, { ...v }),
299
+ x ? /* @__PURE__ */ D(se, {}) : /* @__PURE__ */ D(le, {
292
300
  id: c,
293
301
  label: l,
294
302
  summary: d,
295
- legend: x,
303
+ legend: y,
296
304
  hasSeriesSummary: n?.seriesValues !== void 0,
297
- layoutLegend: te,
298
- rows: f.map((e, t) => ({
299
- id: e.id,
300
- label: e.label,
301
- tone: a(e.tone, t),
302
- value: e.values[m] === null || e.values[m] === void 0 ? "Unavailable" : h(e.values[m])
303
- })),
304
- x: g,
305
- width: _,
306
- offset: v,
307
- source: ee
305
+ layoutLegend: b,
306
+ rows: f,
307
+ x: m,
308
+ width: h,
309
+ offset: g,
310
+ source: _
308
311
  }),
309
312
  o
310
313
  ]
311
314
  });
312
315
  }
313
- function R({ title: e = "Loading chart", description: n, report: r, series: i = [], height: a = fe }) {
314
- let o = z(a), s = C();
316
+ function z({ title: e = "Loading chart", description: n, report: r, series: i = [], height: a = fe }) {
317
+ let o = B(a), s = C();
315
318
  return o === void 0 ? /* @__PURE__ */ D("div", {
316
319
  "aria-hidden": !0,
317
320
  inert: !0,
318
- children: /* @__PURE__ */ D(L, {
321
+ children: /* @__PURE__ */ D(R, {
319
322
  title: e,
320
323
  description: n,
321
324
  report: r,
@@ -323,7 +326,7 @@ function R({ title: e = "Loading chart", description: n, report: r, series: i =
323
326
  inspectionId: s,
324
327
  isLoading: !0,
325
328
  children: /* @__PURE__ */ D("div", {
326
- ...x.props(v.plot, I.plot),
329
+ ...x.props(v.plot, L.plot),
327
330
  children: /* @__PURE__ */ D(t, { height: a })
328
331
  })
329
332
  })
@@ -334,7 +337,7 @@ function R({ title: e = "Loading chart", description: n, report: r, series: i =
334
337
  message: o
335
338
  });
336
339
  }
337
- function z(e) {
340
+ function B(e) {
338
341
  if (!Number.isFinite(e) || e < 48) return "Chart height must be at least 48 pixels.";
339
342
  }
340
343
  function pe({ categories: e, series: t, domain: n, mode: r }) {
@@ -354,7 +357,7 @@ var me = {
354
357
  "x-default-marker": "x-default-marker",
355
358
  $$css: !0
356
359
  };
357
- function B({ title: t, description: n, report: r, categories: i, series: o, domain: s, mode: c = "grouped", formatValue: u, formatTick: d = u, highlightedSeriesId: f, selection: p, height: m = fe, composition: h }) {
360
+ function V({ title: t, description: n, report: r, categories: i, series: o, domain: s, mode: c = "grouped", formatValue: u, formatTick: d = u, highlightedSeriesId: f, selection: p, height: m = fe, composition: h }) {
358
361
  let _ = h?.focusedSeries, y = C(), b = _ === void 0 ? void 0 : pe({
359
362
  categories: i,
360
363
  series: [_],
@@ -365,12 +368,12 @@ function B({ title: t, description: n, report: r, categories: i, series: o, doma
365
368
  series: o,
366
369
  domain: s,
367
370
  mode: c
368
- }) ?? b, ne = le({
371
+ }) ?? b, ne = ue({
369
372
  composition: h,
370
373
  series: o,
371
374
  categoryIds: i.map((e) => e.id),
372
375
  domain: s
373
- }) ?? z(m), w = te ?? ne, E = h === void 0 ? void 0 : {
376
+ }) ?? B(m), w = te ?? ne, E = h === void 0 ? void 0 : {
374
377
  id: y,
375
378
  label: h.contextLabel,
376
379
  tone: "neutral",
@@ -379,55 +382,61 @@ function B({ title: t, description: n, report: r, categories: i, series: o, doma
379
382
  E,
380
383
  ...o,
381
384
  ..._ === void 0 || o.some((e) => e.id === _.id) ? [] : [_]
382
- ], re = _ !== void 0 && E !== void 0 ? [_, E] : o, { ref: ie, width: N, element: P } = ee(), oe = C(), [se, F] = T(), [ce, ue] = T();
385
+ ], re = _ !== void 0 && E !== void 0 ? [_, E] : o, { ref: ie, width: N, element: P } = ee(), oe = C(), [se, F] = T(), [le, I] = T();
383
386
  S(() => {
384
387
  function e(e) {
385
388
  e.target instanceof Node && P?.contains(e.target) !== !0 && F(void 0);
386
389
  }
387
390
  return document.addEventListener("pointerdown", e), () => document.removeEventListener("pointerdown", e);
388
391
  }, [P]);
389
- let R = i.findIndex((e) => e.id === se?.id), B = i[R], ge = i[i.findIndex((e) => e.id === p?.selectedId)], V = i.find((e) => e.id === ce) ?? ge ?? i[0], H = B, U = R, W = h?.buckets[U], G = _ !== void 0 && E !== void 0 ? [_, E] : E === void 0 || W?.kind === "parts" ? o : [], K = W === void 0 ? void 0 : W.kind === "gap" ? "No reported value" : u(W.total);
392
+ let z = i.findIndex((e) => e.id === se?.id), V = i[z], H = i[i.findIndex((e) => e.id === p?.selectedId)], ge = i.find((e) => e.id === le) ?? H ?? i[0], U = V, W = z, G = h?.buckets[W], K = _ !== void 0 && E !== void 0 ? [_, E] : E === void 0 || G?.kind === "parts" ? o : [], q = G === void 0 ? void 0 : G.kind === "gap" ? "No reported value" : u(G.total);
390
393
  if (w !== void 0) return /* @__PURE__ */ D(g, {
391
394
  title: t,
392
395
  description: n,
393
396
  report: r,
394
397
  message: w
395
398
  });
396
- let _e = m - 28, q = j({
399
+ let _e = K.map((e, t) => {
400
+ let n = e.values[W];
401
+ return {
402
+ id: e.id,
403
+ label: e.label,
404
+ tone: a(e.tone, t),
405
+ value: n == null ? "Unavailable" : u(n)
406
+ };
407
+ }), ve = m - 28, J = j({
397
408
  domain: [...s],
398
- range: [_e, 12]
399
- }), J = Math.max(44, ...q.ticks(3).map((e) => d(e).length * 7 + 12)), Y = Math.max(J + 1, N - 16), X = A({
409
+ range: [ve, 12]
410
+ }), Y = Math.max(44, ...J.ticks(3).map((e) => d(e).length * 7 + 12)), X = Math.max(Y + 1, N - 16), Z = A({
400
411
  domain: i.map((e) => e.id),
401
- range: [J, Y],
412
+ range: [Y, X],
402
413
  padding: .3
403
- }), Z = A({
414
+ }), Q = A({
404
415
  domain: o.map((e) => e.id),
405
- range: [0, X.bandwidth()],
416
+ range: [0, Z.bandwidth()],
406
417
  padding: .08
407
- }), ve = Math.min(120, Math.max(40, ...i.map((e) => (e.axisLabel ?? e.label).length * 7))), Q = Math.max(1, Math.ceil((ve + 16) / X.step())), $ = Math.max(1, Math.floor((X.step() * Q - 16) / 7));
408
- function ye(e) {
409
- let t = e.currentTarget.getBoundingClientRect(), n = (e.clientX - t.left) / t.width * N, r = Math.floor((n - J) / X.step()), a = i[Math.max(0, Math.min(i.length - 1, r))];
410
- a !== void 0 && (e.type === "pointerdown" && ue(a.id), F({
418
+ }), ye = Math.min(120, Math.max(40, ...i.map((e) => (e.axisLabel ?? e.label).length * 7))), $ = Math.max(1, Math.ceil((ye + 16) / Z.step())), be = Math.max(1, Math.floor((Z.step() * $ - 16) / 7));
419
+ function xe(e) {
420
+ let t = e.currentTarget.getBoundingClientRect(), n = (e.clientX - t.left) / t.width * N, r = Math.floor((n - Y) / Z.step()), a = i[Math.max(0, Math.min(i.length - 1, r))];
421
+ a !== void 0 && (e.type === "pointerdown" && I(a.id), F({
411
422
  id: a.id,
412
423
  source: "pointer"
413
424
  }));
414
425
  }
415
- return /* @__PURE__ */ D(L, {
426
+ return /* @__PURE__ */ D(R, {
416
427
  title: t,
417
428
  description: n,
418
429
  report: r,
419
430
  series: re,
420
431
  layoutSeries: o,
421
432
  inspectionId: oe,
422
- label: H?.label,
423
- detail: H === void 0 ? void 0 : [H.axisLabel ?? H.label, K].filter(Boolean).join(" · "),
424
- summary: K,
425
- rows: G,
426
- index: U,
427
- formatValue: u,
428
- x: (X(H?.id ?? "") ?? J) + X.bandwidth() / 2,
433
+ label: U?.label,
434
+ detail: U === void 0 ? void 0 : [U.axisLabel ?? U.label, q].filter(Boolean).join(" · "),
435
+ summary: q,
436
+ rows: _e,
437
+ x: (Z(U?.id ?? "") ?? Y) + Z.bandwidth() / 2,
429
438
  width: N,
430
- offset: X.bandwidth() / 2 + 8,
439
+ offset: Z.bandwidth() / 2 + 8,
431
440
  source: se?.source,
432
441
  data: {
433
442
  label: `${t} observations`,
@@ -445,7 +454,7 @@ function B({ title: t, description: n, report: r, categories: i, series: o, doma
445
454
  },
446
455
  children: /* @__PURE__ */ D("div", {
447
456
  ref: ie,
448
- ...x.props(v.plot, I.plot),
457
+ ...x.props(v.plot, L.plot),
449
458
  children: i.length === 0 || o.length === 0 && h === void 0 ? /* @__PURE__ */ D("p", {
450
459
  className: "x153jb6y x1ghz6dp xy8obcc",
451
460
  children: "No categories"
@@ -458,10 +467,16 @@ function B({ title: t, description: n, report: r, categories: i, series: o, doma
458
467
  height: m,
459
468
  controls: {
460
469
  items: i,
461
- cursor: V?.id,
462
- inspected: B?.id,
470
+ cursor: ge?.id,
471
+ inspected: V?.id,
472
+ selected: H?.id,
473
+ readout: ce({
474
+ label: V?.label,
475
+ summary: q,
476
+ rows: _e
477
+ }),
463
478
  onInspect: (e) => {
464
- ue(e), F({
479
+ I(e), F({
465
480
  id: e,
466
481
  source: "keyboard"
467
482
  });
@@ -471,50 +486,50 @@ function B({ title: t, description: n, report: r, categories: i, series: o, doma
471
486
  },
472
487
  onFocus: (e) => {
473
488
  if (e.currentTarget.matches(":focus-visible")) {
474
- let e = ge ?? i[0];
475
- ue(e?.id), F(e === void 0 ? void 0 : {
489
+ let e = H ?? i[0];
490
+ I(e?.id), F(e === void 0 ? void 0 : {
476
491
  id: e.id,
477
492
  source: "keyboard"
478
493
  });
479
494
  }
480
495
  },
481
496
  onPointerMove: (e) => {
482
- e.pointerType === "mouse" && ye(e);
497
+ e.pointerType === "mouse" && xe(e);
483
498
  },
484
- onPointerDown: ye,
499
+ onPointerDown: xe,
485
500
  onPointerLeave: (e) => {
486
501
  e.pointerType === "mouse" && se?.source === "pointer" && F(void 0);
487
502
  },
488
503
  onBlur: () => F(void 0),
489
504
  onClick: () => {
490
- B !== void 0 && p?.onSelect(B.id);
505
+ V !== void 0 && p?.onSelect(V.id);
491
506
  },
492
507
  ...x.props(v.svg, v.inspectable, me),
493
508
  children: [
494
- B !== void 0 && /* @__PURE__ */ D("rect", {
495
- x: (X(B.id) ?? J) - (X.step() - X.bandwidth()) / 2,
509
+ V !== void 0 && /* @__PURE__ */ D("rect", {
510
+ x: (Z(V.id) ?? Y) - (Z.step() - Z.bandwidth()) / 2,
496
511
  y: 12,
497
- width: X.step(),
498
- height: _e - 12,
512
+ width: Z.step(),
513
+ height: ve - 12,
499
514
  className: "x2wnxhi"
500
515
  }),
501
- q.ticks(3).map((e) => /* @__PURE__ */ O("g", { children: [/* @__PURE__ */ D("line", {
502
- x1: J,
503
- x2: Y,
504
- y1: q(e),
505
- y2: q(e),
516
+ J.ticks(3).map((e) => /* @__PURE__ */ O("g", { children: [/* @__PURE__ */ D("line", {
517
+ x1: Y,
518
+ x2: X,
519
+ y1: J(e),
520
+ y2: J(e),
506
521
  ...x.props(v.grid)
507
522
  }), /* @__PURE__ */ D("text", {
508
- x: J - 8,
509
- y: q(e),
523
+ x: Y - 8,
524
+ y: J(e),
510
525
  textAnchor: "end",
511
526
  dominantBaseline: "middle",
512
527
  ...x.props(v.label),
513
528
  children: d(e)
514
529
  })] }, e)),
515
530
  h?.annotation !== void 0 && i.some((e) => e.id === h.annotation?.categoryId) && /* @__PURE__ */ D("text", {
516
- x: X(h.annotation.categoryId),
517
- y: Math.max(12, q(h.annotation.value) - 8),
531
+ x: Z(h.annotation.categoryId),
532
+ y: Math.max(12, J(h.annotation.value) - 8),
518
533
  ...x.props(v.label),
519
534
  children: h.annotation.label
520
535
  }),
@@ -523,38 +538,38 @@ function B({ title: t, description: n, report: r, categories: i, series: o, doma
523
538
  return /* @__PURE__ */ O("g", { children: [i === void 0 ? o.map((r, i) => {
524
539
  let s = r.values[n];
525
540
  if (s == null) return null;
526
- let l = c === "stacked" ? o.slice(0, i).reduce((e, t) => e + (t.values[n] ?? 0), 0) : 0, u = q(l), d = q(l + s), m = p?.selectedId === t.id || B?.id === t.id;
541
+ let l = c === "stacked" ? o.slice(0, i).reduce((e, t) => e + (t.values[n] ?? 0), 0) : 0, u = J(l), d = J(l + s), m = p?.selectedId === t.id || V?.id === t.id;
527
542
  return /* @__PURE__ */ D(M, {
528
- x: (X(t.id) ?? J) + (c === "stacked" ? 0 : Z(r.id) ?? 0),
543
+ x: (Z(t.id) ?? Y) + (c === "stacked" ? 0 : Q(r.id) ?? 0),
529
544
  y: Math.min(u, d),
530
- width: c === "stacked" ? X.bandwidth() : Z.bandwidth(),
545
+ width: c === "stacked" ? Z.bandwidth() : Q.bandwidth(),
531
546
  height: Math.max(+(s === 0), Math.abs(d - u)),
532
547
  fill: e[a(r.tone, i)],
533
- ...x.props(m && v.selected, f !== void 0 && f !== r.id && I.mutedMark)
548
+ ...x.props(m && v.selected, f !== void 0 && f !== r.id && L.mutedMark)
534
549
  }, r.id);
535
550
  }) : /* @__PURE__ */ D(de, {
536
551
  bucket: i,
537
552
  series: o,
538
553
  focusedSeries: _,
539
554
  index: n,
540
- x: X(t.id) ?? J,
541
- width: X.bandwidth(),
542
- y: q,
543
- isHighlighted: p?.selectedId === t.id || B?.id === t.id,
555
+ x: Z(t.id) ?? Y,
556
+ width: Z.bandwidth(),
557
+ y: J,
558
+ isHighlighted: p?.selectedId === t.id || V?.id === t.id,
544
559
  highlightedSeriesId: f
545
- }), n % Q === 0 && /* @__PURE__ */ D("text", {
546
- x: (X(t.id) ?? J) + X.bandwidth() / 2,
560
+ }), n % $ === 0 && /* @__PURE__ */ D("text", {
561
+ x: (Z(t.id) ?? Y) + Z.bandwidth() / 2,
547
562
  y: m - 4,
548
563
  textAnchor: "middle",
549
564
  ...x.props(v.label),
550
- children: r.length > $ ? `${r.slice(0, $ - 1)}…` : r
565
+ children: r.length > be ? `${r.slice(0, be - 1)}…` : r
551
566
  })] }, t.id);
552
567
  }),
553
- V !== void 0 && /* @__PURE__ */ D(ae, {
554
- x: (X(V.id) ?? J) + X.bandwidth() / 2,
568
+ ge !== void 0 && /* @__PURE__ */ D(ae, {
569
+ x: (Z(ge.id) ?? Y) + Z.bandwidth() / 2,
555
570
  top: 12,
556
- bottom: _e,
557
- width: Math.max(8, X.bandwidth())
571
+ bottom: ve,
572
+ width: Math.max(8, Z.bandwidth())
558
573
  })
559
574
  ]
560
575
  })
@@ -568,12 +583,12 @@ function he(e, t, n) {
568
583
  }).join(" · ");
569
584
  }
570
585
  // packages/charts/src/cartesian/breakdown-bar.tsx
571
- var ge = {
586
+ var H = {
572
587
  kzqmXN: "x5lhr3w",
573
588
  kZKoxP: "x5yr21d",
574
589
  $$css: !0
575
- }, V = { segment: (e, t) => [
576
- ge,
590
+ }, ge = { segment: (e, t) => [
591
+ H,
577
592
  {
578
593
  kWkggS: t == null ? t : "xl8spv7",
579
594
  $$css: !0
@@ -583,7 +598,7 @@ var ge = {
583
598
  "--x-backgroundColor": t ?? void 0
584
599
  }
585
600
  ] };
586
- function H({ title: t, report: n, description: i, items: s, total: c, formatValue: l, selection: u }) {
601
+ function U({ title: t, report: n, description: i, items: s, total: c, formatValue: l, selection: u }) {
587
602
  let d = r(s), f = s.reduce((e, t) => e + (t.value ?? 0), 0), m = 2 ** -52 * Math.max(f, c, 1) * s.length;
588
603
  return d === void 0 ? !Number.isFinite(c) || c < 0 || f - c > m ? /* @__PURE__ */ D(g, {
589
604
  title: t,
@@ -601,7 +616,7 @@ function H({ title: t, report: n, description: i, items: s, total: c, formatValu
601
616
  /* @__PURE__ */ D("div", {
602
617
  "aria-hidden": !0,
603
618
  className: "x78zum5 x170jfvy xb3r6kr x1r7kqkb xmkeg23 x1y0btm7 x1ey3b81 x1jfksii",
604
- children: s.map((t, n) => t.value === null ? null : /* @__PURE__ */ D("span", { ...x.props(V.segment(c === 0 ? 0 : t.value / c * 100, e[a(t.tone, n)])) }, t.id))
619
+ children: s.map((t, n) => t.value === null ? null : /* @__PURE__ */ D("span", { ...x.props(ge.segment(c === 0 ? 0 : t.value / c * 100, e[a(t.tone, n)])) }, t.id))
605
620
  }),
606
621
  /* @__PURE__ */ D(o, {
607
622
  items: s.map((e, t) => ({
@@ -630,7 +645,7 @@ function H({ title: t, report: n, description: i, items: s, total: c, formatValu
630
645
  });
631
646
  }
632
647
  // packages/charts/src/cartesian/scatter-plot.tsx
633
- var U = 260, W = 56, G = 20, K = 12, _e = 1e3, q = {
648
+ var W = 260, G = 56, K = 20, q = 12, _e = 1e3, ve = {
634
649
  kzqmXN: "x1xc55vz",
635
650
  kZKoxP: "xdk7pt",
636
651
  kaIpWk: "x16rqkct",
@@ -673,7 +688,7 @@ var U = 260, W = 56, G = 20, K = 12, _e = 1e3, q = {
673
688
  "--x-top": ((e) => typeof e == "number" ? e + "px" : e ?? void 0)(t)
674
689
  }],
675
690
  dot: (e) => [
676
- q,
691
+ ve,
677
692
  {
678
693
  kWkggS: e == null ? e : "xl8spv7",
679
694
  $$css: !0
@@ -696,7 +711,7 @@ function Y(t) {
696
711
  id: e.id,
697
712
  label: `${e.label}, ${d}: ${h(e.x)}, ${m}: ${_(e.y)}`
698
713
  }))
699
- }), { ref: C, width: ne } = ee(), w = ve(t);
714
+ }), { ref: C, width: ne } = ee(), w = Q(t);
700
715
  if (w !== null) return /* @__PURE__ */ D(g, {
701
716
  title: n,
702
717
  report: r,
@@ -705,10 +720,10 @@ function Y(t) {
705
720
  });
706
721
  let T = j({
707
722
  domain: [...o],
708
- range: [W, Math.max(W, ne - G)]
723
+ range: [G, Math.max(G, ne - K)]
709
724
  }), E = j({
710
725
  domain: [...l],
711
- range: [216, K]
726
+ range: [216, q]
712
727
  });
713
728
  return /* @__PURE__ */ O(p, {
714
729
  title: n,
@@ -796,14 +811,14 @@ function X({ width: e, scaleX: t, scaleY: n, xLabel: r, yLabel: i, formatX: a, f
796
811
  function p(r, i, a) {
797
812
  return {
798
813
  x: t.copy().clamp(!0).invert((i - r.left) / r.width * e),
799
- y: n.copy().clamp(!0).invert((a - r.top) / r.height * U)
814
+ y: n.copy().clamp(!0).invert((a - r.top) / r.height * W)
800
815
  };
801
816
  }
802
817
  function m(t) {
803
818
  let n = t.button === 0 && t.pointerType !== "touch";
804
819
  if (s === void 0 || d.current !== null || !n) return;
805
- let r = t.currentTarget.getBoundingClientRect(), i = (t.clientX - r.left) / r.width * e, a = (t.clientY - r.top) / r.height * U;
806
- if (i < W || i > e - G || a < K || a > 216) return;
820
+ let r = t.currentTarget.getBoundingClientRect(), i = (t.clientX - r.left) / r.width * e, a = (t.clientY - r.top) / r.height * W;
821
+ if (i < G || i > e - K || a < q || a > 216) return;
807
822
  let o = t.currentTarget, c = o.parentElement;
808
823
  if (c === null) return;
809
824
  let l = p(r, t.clientX, t.clientY);
@@ -828,8 +843,8 @@ function X({ width: e, scaleX: t, scaleY: n, xLabel: r, yLabel: i, formatX: a, f
828
843
  }
829
844
  return /* @__PURE__ */ O("svg", {
830
845
  width: e,
831
- height: U,
832
- viewBox: `0 0 ${e} ${U}`,
846
+ height: W,
847
+ viewBox: `0 0 ${e} ${W}`,
833
848
  "aria-hidden": !0,
834
849
  onPointerDown: m,
835
850
  ...x.props(v.svg, s !== void 0 && J.brush),
@@ -837,16 +852,16 @@ function X({ width: e, scaleX: t, scaleY: n, xLabel: r, yLabel: i, formatX: a, f
837
852
  /* @__PURE__ */ D("defs", { children: /* @__PURE__ */ D("clipPath", {
838
853
  id: c,
839
854
  children: /* @__PURE__ */ D("rect", {
840
- x: W,
841
- y: K,
842
- width: Math.max(0, e - W - G),
855
+ x: G,
856
+ y: q,
857
+ width: Math.max(0, e - G - K),
843
858
  height: 204
844
859
  })
845
860
  }) }),
846
861
  t.ticks(5).map((e) => /* @__PURE__ */ O("g", { children: [/* @__PURE__ */ D("line", {
847
862
  x1: t(e),
848
863
  x2: t(e),
849
- y1: K,
864
+ y1: q,
850
865
  y2: 216,
851
866
  ...x.props(v.grid)
852
867
  }), /* @__PURE__ */ D("text", {
@@ -857,8 +872,8 @@ function X({ width: e, scaleX: t, scaleY: n, xLabel: r, yLabel: i, formatX: a, f
857
872
  children: a(e)
858
873
  })] }, e)),
859
874
  n.ticks(4).map((t) => /* @__PURE__ */ O("g", { children: [/* @__PURE__ */ D("line", {
860
- x1: W,
861
- x2: e - G,
875
+ x1: G,
876
+ x2: e - K,
862
877
  y1: n(t),
863
878
  y2: n(t),
864
879
  ...x.props(v.grid)
@@ -870,7 +885,7 @@ function X({ width: e, scaleX: t, scaleY: n, xLabel: r, yLabel: i, formatX: a, f
870
885
  children: o(t)
871
886
  })] }, t)),
872
887
  /* @__PURE__ */ D("text", {
873
- x: (W + e - G) / 2,
888
+ x: (G + e - K) / 2,
874
889
  y: 256,
875
890
  textAnchor: "middle",
876
891
  ...x.props(v.label),
@@ -978,7 +993,7 @@ function Z({ rangeSelection: e, xDomain: t, yDomain: n, xLabel: r, yLabel: i, fo
978
993
  ]
979
994
  });
980
995
  }
981
- function ve({ points: e, xDomain: t, yDomain: n, rangeSelection: r }) {
996
+ function Q({ points: e, xDomain: t, yDomain: n, rangeSelection: r }) {
982
997
  if (!h(t) || !h(n)) return "Scatter domains must contain finite, increasing endpoints.";
983
998
  if (e.length > 1e3) return `This plot exceeds the ${_e}-point render limit. Supply a smaller, labelled sample.`;
984
999
  if (!m(e)) return "Scatter points must have unique identifiers.";
@@ -991,9 +1006,9 @@ function ve({ points: e, xDomain: t, yDomain: n, rangeSelection: r }) {
991
1006
  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];
992
1007
  if (!i || !a) return "Range selection steps must be finite, positive, and no larger than their domain span.";
993
1008
  let o = r.value;
994
- return o === null ? null : !Q(o.x, t) || !Q(o.y, n) ? "The selected range must have finite, ordered bounds inside the declared domain." : null;
1009
+ return o === null ? null : !ye(o.x, t) || !ye(o.y, n) ? "The selected range must have finite, ordered bounds inside the declared domain." : null;
995
1010
  }
996
- function Q(e, t) {
1011
+ function ye(e, t) {
997
1012
  return !e.every(Number.isFinite) || e[0] > e[1] ? !1 : e[0] >= t[0] && e[1] <= t[1];
998
1013
  }
999
1014
  // packages/charts/src/cartesian/time-series-data.ts
@@ -1002,7 +1017,7 @@ var $ = {
1002
1017
  pointsPerSeries: 2e3,
1003
1018
  markers: 200,
1004
1019
  panels: 12
1005
- }, ye = .01, be = [
1020
+ }, be = .01, xe = [
1006
1021
  "series1",
1007
1022
  "series2",
1008
1023
  "series3",
@@ -1010,13 +1025,13 @@ var $ = {
1010
1025
  "series5",
1011
1026
  "series6"
1012
1027
  ];
1013
- function xe({ series: e, isStacked: t, markers: n }) {
1028
+ function Se({ series: e, isStacked: t, markers: n }) {
1014
1029
  let r = e[0]?.points.map((e) => e.timestamp) ?? [];
1015
1030
  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.`;
1016
1031
  if (!m(e) || !m(n)) return "Series and markers require unique identifiers.";
1017
1032
  for (let n of e) {
1018
1033
  if (n.points.length !== r.length) return "Every series must supply the same observation timestamps.";
1019
- let e = Te({
1034
+ let e = Ee({
1020
1035
  points: n.points,
1021
1036
  timestamps: r,
1022
1037
  isStacked: t
@@ -1034,7 +1049,7 @@ function xe({ series: e, isStacked: t, markers: n }) {
1034
1049
  if (!Number.isFinite(a) || !Number.isFinite(o)) return "The elapsed-time and value ranges must be finite.";
1035
1050
  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.";
1036
1051
  }
1037
- function Se({ series: e, markers: t, timestampUnit: n, isStacked: r }) {
1052
+ function Ce({ series: e, markers: t, timestampUnit: n, isStacked: r }) {
1038
1053
  return JSON.stringify([
1039
1054
  n,
1040
1055
  r,
@@ -1054,15 +1069,15 @@ function Se({ series: e, markers: t, timestampUnit: n, isStacked: r }) {
1054
1069
  ])
1055
1070
  ]);
1056
1071
  }
1057
- function Ce(e, t, n = !1) {
1072
+ function we(e, t, n = !1) {
1058
1073
  if (e !== t) return [e, t];
1059
- let r = Math.max(1, Math.abs(e) * ye), i = n ? 0 : e - r, a = t + r;
1074
+ let r = Math.max(1, Math.abs(e) * be), i = n ? 0 : e - r, a = t + r;
1060
1075
  return [Number.isFinite(i) ? i : e, Number.isFinite(a) ? a : t];
1061
1076
  }
1062
- function we(e, t) {
1077
+ function Te(e, t) {
1063
1078
  let n = e.filter((e) => e.tone === void 0);
1064
1079
  return e.map((r, i) => {
1065
- let a = n.findIndex((e) => e.id === r.id), o = r.tone ?? be[a % be.length] ?? "series1", s = r.points.map((n, r) => {
1080
+ let a = n.findIndex((e) => e.id === r.id), o = r.tone ?? xe[a % xe.length] ?? "series1", s = r.points.map((n, r) => {
1066
1081
  let a = t ? e.slice(0, i).reduce((e, t) => e + (t.points[r]?.value ?? 0), 0) : 0;
1067
1082
  return {
1068
1083
  ...n,
@@ -1077,7 +1092,7 @@ function we(e, t) {
1077
1092
  };
1078
1093
  });
1079
1094
  }
1080
- function Te({ points: e, timestamps: t, isStacked: n }) {
1095
+ function Ee({ points: e, timestamps: t, isStacked: n }) {
1081
1096
  for (let [r, i] of e.entries()) {
1082
1097
  let a = e[r - 1], o = a !== void 0 && i.timestamp <= a.timestamp;
1083
1098
  if (!Number.isFinite(i.timestamp) || i.timestamp !== t[r] || o) return "Observation timestamps must be finite, aligned, and strictly increasing.";
@@ -1086,7 +1101,7 @@ function Te({ points: e, timestamps: t, isStacked: n }) {
1086
1101
  }
1087
1102
  }
1088
1103
  // packages/charts/src/cartesian/time-series-line.tsx
1089
- function Ee({ series: t, x: n, y: r, inspectedTimestamp: i, pointRadius: a = 3 }) {
1104
+ function De({ series: t, x: n, y: r, inspectedTimestamp: i, pointRadius: a = 3 }) {
1090
1105
  return /* @__PURE__ */ O(E, { children: [/* @__PURE__ */ D(ie, {
1091
1106
  data: [...t.points],
1092
1107
  defined: (e) => e.value !== null,
@@ -1106,8 +1121,8 @@ function Ee({ series: t, x: n, y: r, inspectedTimestamp: i, pointRadius: a = 3 }
1106
1121
  }, i.timestamp))] });
1107
1122
  }
1108
1123
  // packages/charts/src/cartesian/sparkline.tsx
1109
- function De({ title: e, summary: t, unit: n, timestampUnit: r, series: i, valueDomain: a }) {
1110
- let o = C(), s = C(), c = Oe({
1124
+ function Oe({ title: e, summary: t, unit: n, timestampUnit: r, series: i, valueDomain: a }) {
1125
+ let o = C(), s = C(), c = ke({
1111
1126
  title: e,
1112
1127
  summary: t,
1113
1128
  unit: n,
@@ -1122,12 +1137,12 @@ function De({ title: e, summary: t, unit: n, timestampUnit: r, series: i, valueD
1122
1137
  children: c === void 0 ? "No data" : "Invalid trend"
1123
1138
  });
1124
1139
  let u = i.points[0]?.timestamp ?? 0, d = i.points.at(-1)?.timestamp ?? u, f = j({
1125
- domain: [...Ce(u, d)],
1140
+ domain: [...we(u, d)],
1126
1141
  range: [3, 125]
1127
1142
  }), p = j({
1128
1143
  domain: [...a],
1129
1144
  range: [29, 3]
1130
- }), m = we([i], !1)[0];
1145
+ }), m = Te([i], !1)[0];
1131
1146
  return /* @__PURE__ */ O("svg", {
1132
1147
  role: "img",
1133
1148
  "aria-labelledby": o,
@@ -1160,7 +1175,7 @@ function De({ title: e, summary: t, unit: n, timestampUnit: r, series: i, valueD
1160
1175
  "."
1161
1176
  ]
1162
1177
  }),
1163
- m !== void 0 && /* @__PURE__ */ D(Ee, {
1178
+ m !== void 0 && /* @__PURE__ */ D(De, {
1164
1179
  series: m,
1165
1180
  x: f,
1166
1181
  y: p,
@@ -1169,10 +1184,10 @@ function De({ title: e, summary: t, unit: n, timestampUnit: r, series: i, valueD
1169
1184
  ]
1170
1185
  });
1171
1186
  }
1172
- function Oe({ title: e, summary: t, unit: n, series: r, valueDomain: i }) {
1187
+ function ke({ title: e, summary: t, unit: n, series: r, valueDomain: i }) {
1173
1188
  if (e.trim() === "" || t.trim() === "" || n.trim() === "") return "A trend requires a title, a readable summary, and a value unit.";
1174
1189
  if (!h(i)) return "The displayed value domain must have finite, increasing bounds.";
1175
- let a = xe({
1190
+ let a = Se({
1176
1191
  series: [r],
1177
1192
  isStacked: !1,
1178
1193
  markers: []
@@ -1181,7 +1196,7 @@ function Oe({ title: e, summary: t, unit: n, series: r, valueDomain: i }) {
1181
1196
  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.";
1182
1197
  }
1183
1198
  // packages/charts/src/cartesian/time-series.tsx
1184
- var ke = {
1199
+ var Ae = {
1185
1200
  timeAxis: {
1186
1201
  k1xSpc: "x78zum5",
1187
1202
  kjj79g: "x1qughib",
@@ -1202,25 +1217,25 @@ var ke = {
1202
1217
  "--x-paddingInlineEnd": ((e) => typeof e == "number" ? e + "px" : e ?? void 0)(t)
1203
1218
  }]
1204
1219
  };
1205
- function Ae(e) {
1206
- return /* @__PURE__ */ D(Le, {
1220
+ function je(e) {
1221
+ return /* @__PURE__ */ D(Re, {
1207
1222
  ...e,
1208
1223
  kind: "line",
1209
1224
  isStacked: !1
1210
1225
  });
1211
1226
  }
1212
- function je({ isStacked: e = !1, ...t }) {
1213
- return /* @__PURE__ */ D(Le, {
1227
+ function Me({ isStacked: e = !1, ...t }) {
1228
+ return /* @__PURE__ */ D(Re, {
1214
1229
  ...t,
1215
1230
  kind: "area",
1216
1231
  isStacked: e
1217
1232
  });
1218
1233
  }
1219
- function Me(e) {
1220
- return /* @__PURE__ */ D(Ne, { ...e });
1234
+ function Ne(e) {
1235
+ return /* @__PURE__ */ D(Pe, { ...e });
1221
1236
  }
1222
- function Ne({ title: e, description: r, series: i, actions: a, report: o, height: s = 180, showTimeAxis: c = !0 }) {
1223
- let l = C(), u = we(i.map((e) => ({
1237
+ function Pe({ title: e, description: r, series: i, actions: a, report: o, height: s = 180, showTimeAxis: c = !0 }) {
1238
+ let l = C(), u = Te(i.map((e) => ({
1224
1239
  ...e,
1225
1240
  points: []
1226
1241
  })), !1);
@@ -1241,7 +1256,7 @@ function Ne({ title: e, description: r, series: i, actions: a, report: o, height
1241
1256
  actions: a,
1242
1257
  children: /* @__PURE__ */ O("div", {
1243
1258
  className: "xrvj5dj x1n8ia3y",
1244
- children: [/* @__PURE__ */ D(ce, {
1259
+ children: [/* @__PURE__ */ D(le, {
1245
1260
  id: l,
1246
1261
  label: void 0,
1247
1262
  legend: u,
@@ -1261,11 +1276,11 @@ function Ne({ title: e, description: r, series: i, actions: a, report: o, height
1261
1276
  })
1262
1277
  });
1263
1278
  }
1264
- function Pe({ charts: e, ...t }) {
1279
+ function Fe({ charts: e, ...t }) {
1265
1280
  let n = w(null), [r, i] = T(), a = JSON.stringify(e.map((e) => [
1266
1281
  e.id,
1267
1282
  e.title,
1268
- Se({
1283
+ Ce({
1269
1284
  series: e.series,
1270
1285
  markers: e.markers ?? [],
1271
1286
  timestampUnit: t.timestampUnit,
@@ -1304,7 +1319,7 @@ function Pe({ charts: e, ...t }) {
1304
1319
  0: {},
1305
1320
  1: { className: "x1y332i5" }
1306
1321
  }[!!(l && o > 0) | 0],
1307
- children: /* @__PURE__ */ D(Le, {
1322
+ children: /* @__PURE__ */ D(Re, {
1308
1323
  ...t,
1309
1324
  title: n.title,
1310
1325
  description: n.description,
@@ -1330,7 +1345,7 @@ function Pe({ charts: e, ...t }) {
1330
1345
  }, n.id))
1331
1346
  });
1332
1347
  }
1333
- function Fe({ charts: e, height: t }) {
1348
+ function Ie({ charts: e, height: t }) {
1334
1349
  if (!m(e) || e.length > $.panels) return /* @__PURE__ */ D(g, {
1335
1350
  title: "Small multiples",
1336
1351
  message: `Choose at most ${$.panels} panels with unique identifiers.`
@@ -1348,7 +1363,7 @@ function Fe({ charts: e, height: t }) {
1348
1363
  0: {},
1349
1364
  1: { className: "x1y332i5" }
1350
1365
  }[!!(n && i > 0) | 0],
1351
- children: /* @__PURE__ */ D(Ne, {
1366
+ children: /* @__PURE__ */ D(Pe, {
1352
1367
  ...r,
1353
1368
  height: t,
1354
1369
  showTimeAxis: i === e.length - 1
@@ -1356,37 +1371,37 @@ function Fe({ charts: e, height: t }) {
1356
1371
  }, r.id))
1357
1372
  });
1358
1373
  }
1359
- var Ie = {
1374
+ var Le = {
1360
1375
  "x-default-marker": "x-default-marker",
1361
1376
  $$css: !0
1362
1377
  };
1363
- function Le({ title: t, description: n, series: r, timestampUnit: i, formatTimestamp: a, formatValue: o, formatTick: c = o, markers: u = [], height: d = 180, actions: f, report: m, kind: h, isStacked: y, sharedInspection: b, axisWidth: te, showTimeAxis: E = !0 }) {
1364
- let k = !Number.isFinite(d) || d < 48 ? "Chart height must be at least 48 pixels." : xe({
1378
+ function Re({ title: t, description: n, series: r, timestampUnit: i, formatTimestamp: a, formatValue: o, formatTick: c = o, markers: u = [], height: d = 180, actions: f, report: m, kind: h, isStacked: y, sharedInspection: b, axisWidth: te, showTimeAxis: E = !0 }) {
1379
+ let k = !Number.isFinite(d) || d < 48 ? "Chart height must be at least 48 pixels." : Se({
1365
1380
  series: r,
1366
1381
  isStacked: y,
1367
1382
  markers: u
1368
- }), A = ne(() => k === void 0 ? we(r, y) : [], [
1383
+ }), A = ne(() => k === void 0 ? Te(r, y) : [], [
1369
1384
  r,
1370
1385
  y,
1371
1386
  k
1372
- ]), M = A[0]?.points ?? [], { ref: ie, width: N, element: P } = ee(), oe = w(null), [se, le] = T(), ue = ne(() => M.map(({ timestamp: e }) => ({
1387
+ ]), M = A[0]?.points ?? [], { ref: ie, width: N, element: P } = ee(), oe = w(null), [se, ue] = T(), I = ne(() => M.map(({ timestamp: e }) => ({
1373
1388
  id: String(e),
1374
1389
  label: a(e)
1375
- })), [M, a]), de = M.find((e) => e.timestamp === se) ?? M[0], [I, fe] = T(), L = Se({
1390
+ })), [M, a]), de = M.find((e) => e.timestamp === se) ?? M[0], [L, fe] = T(), R = Ce({
1376
1391
  series: r,
1377
1392
  markers: u,
1378
1393
  timestampUnit: i,
1379
1394
  isStacked: y
1380
- }), R = b === void 0 ? I?.signature === L ? I : void 0 : b.value, z = b === void 0 || b.isSource ? R : void 0, pe = m?.seriesValues !== void 0, me = C();
1381
- I !== void 0 && (I.signature !== L || k !== void 0) && fe(void 0);
1382
- let B = b !== void 0;
1395
+ }), z = b === void 0 ? L?.signature === R ? L : void 0 : b.value, B = b === void 0 || b.isSource ? z : void 0, pe = m?.seriesValues !== void 0, me = C();
1396
+ L !== void 0 && (L.signature !== R || k !== void 0) && fe(void 0);
1397
+ let V = b !== void 0;
1383
1398
  if (S(() => {
1384
- if (B) return;
1399
+ if (V) return;
1385
1400
  function e(e) {
1386
1401
  e.target instanceof Node && oe.current?.contains(e.target) !== !0 && fe(void 0);
1387
1402
  }
1388
1403
  return document.addEventListener("pointerdown", e), () => document.removeEventListener("pointerdown", e);
1389
- }, [B]), k !== void 0) return /* @__PURE__ */ D(g, {
1404
+ }, [V]), k !== void 0) return /* @__PURE__ */ D(g, {
1390
1405
  title: t,
1391
1406
  description: n,
1392
1407
  report: m,
@@ -1403,27 +1418,39 @@ function Le({ title: t, description: n, series: r, timestampUnit: i, formatTimes
1403
1418
  children: "No observations"
1404
1419
  })
1405
1420
  });
1406
- let he = d - 28, ge = he + 12, V = M[0]?.timestamp ?? 0, H = M.at(-1)?.timestamp ?? V, U = A.flatMap((e) => e.points.flatMap((e) => e.value === null ? [] : [e.value + e.base])), W = h === "area" ? Math.min(0, ...U) : Math.min(...U), G = h === "area" ? Math.max(0, ...U) : Math.max(...U), K = U.length === 0 ? 0 : W, _e = U.length === 0 ? 1 : G, q = j({
1407
- domain: [...Ce(K, _e, h === "area")],
1408
- range: [he, 12]
1409
- }), J = q.ticks(3), Y = te ?? Math.max(44, ...J.map((e) => c(e).length * 7 + 12)), X = Math.max(Y + 1, N - 16), Z = j({
1410
- domain: [...Ce(V, H)],
1411
- range: [Y, X]
1421
+ let he = {
1422
+ label: B === void 0 ? void 0 : a(B.timestamp),
1423
+ rows: A.map((e) => {
1424
+ let t = e.points.find((e) => e.timestamp === B?.timestamp);
1425
+ return {
1426
+ id: e.id,
1427
+ label: e.label,
1428
+ tone: e.tone,
1429
+ value: t?.value === null || t === void 0 ? "Unavailable" : o(t.value)
1430
+ };
1431
+ }),
1432
+ notes: u.filter((e) => e.timestamp === B?.timestamp).map((e) => e.label)
1433
+ }, H = d - 28, ge = H + 12, U = M[0]?.timestamp ?? 0, W = M.at(-1)?.timestamp ?? U, G = A.flatMap((e) => e.points.flatMap((e) => e.value === null ? [] : [e.value + e.base])), K = h === "area" ? Math.min(0, ...G) : Math.min(...G), q = h === "area" ? Math.max(0, ...G) : Math.max(...G), _e = G.length === 0 ? 0 : K, ve = G.length === 0 ? 1 : q, J = j({
1434
+ domain: [...we(_e, ve, h === "area")],
1435
+ range: [H, 12]
1436
+ }), Y = J.ticks(3), X = te ?? Math.max(44, ...Y.map((e) => c(e).length * 7 + 12)), Z = Math.max(X + 1, N - 16), Q = j({
1437
+ domain: [...we(U, W)],
1438
+ range: [X, Z]
1412
1439
  });
1413
- function ve(e) {
1440
+ function ye(e) {
1414
1441
  let t = P?.getBoundingClientRect();
1415
1442
  if (t === void 0) return;
1416
- let n = Z.invert(e - t.left), r = M.find((e, t) => {
1443
+ let n = Q.invert(e - t.left), r = M.find((e, t) => {
1417
1444
  let r = M[t + 1];
1418
1445
  return r === void 0 || n <= e.timestamp + (r.timestamp - e.timestamp) / 2;
1419
1446
  });
1420
- r !== void 0 && Q({
1421
- signature: L,
1447
+ r !== void 0 && $({
1448
+ signature: R,
1422
1449
  timestamp: r.timestamp,
1423
1450
  source: "pointer"
1424
1451
  });
1425
1452
  }
1426
- function Q(e) {
1453
+ function $(e) {
1427
1454
  b === void 0 ? fe(e) : b.onChange(e);
1428
1455
  }
1429
1456
  return /* @__PURE__ */ D("div", {
@@ -1432,7 +1459,7 @@ function Le({ title: t, description: n, series: r, timestampUnit: i, formatTimes
1432
1459
  children: /* @__PURE__ */ O(p, {
1433
1460
  title: pe ? t : /* @__PURE__ */ D(F, {
1434
1461
  title: t,
1435
- detail: z === void 0 ? void 0 : a(z.timestamp)
1462
+ detail: B === void 0 ? void 0 : a(B.timestamp)
1436
1463
  }),
1437
1464
  description: n,
1438
1465
  report: m,
@@ -1454,27 +1481,19 @@ function Le({ title: t, description: n, series: r, timestampUnit: i, formatTimes
1454
1481
  }), /* @__PURE__ */ O("div", {
1455
1482
  className: "xrvj5dj x1n8ia3y",
1456
1483
  children: [
1457
- /* @__PURE__ */ D(ce, {
1484
+ /* @__PURE__ */ D(le, {
1458
1485
  id: me,
1459
- label: z === void 0 ? void 0 : a(z.timestamp),
1486
+ label: he.label,
1460
1487
  legend: A.map(({ id: e, label: t, tone: n }) => ({
1461
1488
  id: e,
1462
1489
  label: t,
1463
1490
  tone: n
1464
1491
  })),
1465
- rows: A.map((e) => {
1466
- let t = e.points.find((e) => e.timestamp === z?.timestamp);
1467
- return {
1468
- id: e.id,
1469
- label: e.label,
1470
- tone: e.tone,
1471
- value: t?.value === null || t === void 0 ? "Unavailable" : o(t.value)
1472
- };
1473
- }),
1474
- x: Z(R?.timestamp ?? V),
1492
+ rows: he.rows,
1493
+ x: Q(z?.timestamp ?? U),
1475
1494
  width: N,
1476
- source: z?.source,
1477
- notes: u.filter((e) => e.timestamp === z?.timestamp).map((e) => e.label),
1495
+ source: B?.source,
1496
+ notes: he.notes,
1478
1497
  hasSeriesSummary: pe
1479
1498
  }),
1480
1499
  /* @__PURE__ */ O("div", {
@@ -1488,48 +1507,49 @@ function Le({ title: t, description: n, series: r, timestampUnit: i, formatTimes
1488
1507
  viewBox: `0 0 ${N} ${ge}`,
1489
1508
  height: ge,
1490
1509
  controls: {
1491
- items: ue,
1510
+ items: I,
1492
1511
  cursor: de === void 0 ? void 0 : String(de.timestamp),
1493
- inspected: R === void 0 ? void 0 : String(R.timestamp),
1512
+ inspected: B === void 0 ? void 0 : String(B.timestamp),
1513
+ readout: ce(he),
1494
1514
  onInspect: (e) => {
1495
1515
  let t = Number(e);
1496
- le(t), Q({
1497
- signature: L,
1516
+ ue(t), $({
1517
+ signature: R,
1498
1518
  timestamp: t,
1499
1519
  source: "keyboard"
1500
1520
  });
1501
1521
  },
1502
- onDismiss: () => Q(void 0)
1522
+ onDismiss: () => $(void 0)
1503
1523
  },
1504
1524
  onFocus: (e) => {
1505
1525
  if (e.currentTarget.matches(":focus-visible")) {
1506
- let e = R?.timestamp ?? V;
1507
- le(e), Q({
1508
- signature: L,
1526
+ let e = z?.timestamp ?? U;
1527
+ ue(e), $({
1528
+ signature: R,
1509
1529
  timestamp: e,
1510
1530
  source: "keyboard"
1511
1531
  });
1512
1532
  }
1513
1533
  },
1514
1534
  onPointerMove: (e) => {
1515
- e.pointerType === "mouse" && ve(e.clientX);
1535
+ e.pointerType === "mouse" && ye(e.clientX);
1516
1536
  },
1517
- onPointerDown: (e) => ve(e.clientX),
1537
+ onPointerDown: (e) => ye(e.clientX),
1518
1538
  onPointerLeave: (e) => {
1519
- e.pointerType === "mouse" && R?.source === "pointer" && Q(void 0);
1539
+ e.pointerType === "mouse" && z?.source === "pointer" && $(void 0);
1520
1540
  },
1521
- onBlur: () => Q(void 0),
1522
- ...x.props(v.svg, v.inspectable, Ie),
1541
+ onBlur: () => $(void 0),
1542
+ ...x.props(v.svg, v.inspectable, Le),
1523
1543
  children: [
1524
- J.map((e) => /* @__PURE__ */ O("g", { children: [/* @__PURE__ */ D("line", {
1525
- x1: Y,
1526
- x2: X,
1527
- y1: q(e),
1528
- y2: q(e),
1544
+ Y.map((e) => /* @__PURE__ */ O("g", { children: [/* @__PURE__ */ D("line", {
1545
+ x1: X,
1546
+ x2: Z,
1547
+ y1: J(e),
1548
+ y2: J(e),
1529
1549
  ...x.props(v.grid)
1530
1550
  }), /* @__PURE__ */ D("text", {
1531
- x: Y - 8,
1532
- y: q(e),
1551
+ x: X - 8,
1552
+ y: J(e),
1533
1553
  textAnchor: "end",
1534
1554
  dominantBaseline: "middle",
1535
1555
  ...x.props(v.label),
@@ -1538,54 +1558,54 @@ function Le({ title: t, description: n, series: r, timestampUnit: i, formatTimes
1538
1558
  A.map((t) => /* @__PURE__ */ O("g", { children: [h === "area" && /* @__PURE__ */ D(re, {
1539
1559
  data: [...t.points],
1540
1560
  defined: (e) => e.value !== null,
1541
- x: (e) => Z(e.timestamp),
1542
- y0: (e) => q(e.base),
1543
- y1: (e) => q((e.value ?? 0) + e.base),
1544
- yScale: q,
1561
+ x: (e) => Q(e.timestamp),
1562
+ y0: (e) => J(e.base),
1563
+ y1: (e) => J((e.value ?? 0) + e.base),
1564
+ yScale: J,
1545
1565
  fill: e[t.tone],
1546
1566
  fillOpacity: y ? .65 : .15
1547
- }), /* @__PURE__ */ D(Ee, {
1567
+ }), /* @__PURE__ */ D(De, {
1548
1568
  series: t,
1549
- x: Z,
1550
- y: q,
1551
- inspectedTimestamp: R?.timestamp
1569
+ x: Q,
1570
+ y: J,
1571
+ inspectedTimestamp: z?.timestamp
1552
1572
  })] }, t.id)),
1553
1573
  u.map((e) => /* @__PURE__ */ O("g", { children: [e.kind === "time" ? /* @__PURE__ */ D("line", {
1554
- x1: Z(e.timestamp),
1555
- x2: Z(e.timestamp),
1574
+ x1: Q(e.timestamp),
1575
+ x2: Q(e.timestamp),
1556
1576
  y1: 12,
1557
- y2: he,
1577
+ y2: H,
1558
1578
  className: "xhq4mlf x1ntoi03 x13efnbd"
1559
1579
  }) : /* @__PURE__ */ D("circle", {
1560
- cx: Z(e.timestamp),
1561
- cy: q(e.value + (A.find((t) => t.id === e.seriesId)?.points.find((t) => t.timestamp === e.timestamp)?.base ?? 0)),
1580
+ cx: Q(e.timestamp),
1581
+ cy: J(e.value + (A.find((t) => t.id === e.seriesId)?.points.find((t) => t.timestamp === e.timestamp)?.base ?? 0)),
1562
1582
  r: 4,
1563
1583
  fill: _.surface,
1564
1584
  ...x.props(v.selected)
1565
1585
  }), /* @__PURE__ */ D("title", { children: e.kind === "point" ? `${e.label}: ${o(e.value)}` : e.label })] }, e.id)),
1566
- R !== void 0 && /* @__PURE__ */ D("line", {
1567
- x1: Z(R.timestamp),
1568
- x2: Z(R.timestamp),
1586
+ z !== void 0 && /* @__PURE__ */ D("line", {
1587
+ x1: Q(z.timestamp),
1588
+ x2: Q(z.timestamp),
1569
1589
  y1: 12,
1570
- y2: he,
1590
+ y2: H,
1571
1591
  className: "xhq4mlf x1ntoi03 x13efnbd"
1572
1592
  }),
1573
1593
  de !== void 0 && /* @__PURE__ */ D(ae, {
1574
- x: Z(de.timestamp),
1594
+ x: Q(de.timestamp),
1575
1595
  top: 12,
1576
- bottom: he,
1577
- width: Math.min(16, (X - Y) / 2)
1596
+ bottom: H,
1597
+ width: Math.min(16, (Z - X) / 2)
1578
1598
  })
1579
1599
  ]
1580
1600
  }), E && /* @__PURE__ */ O("div", {
1581
1601
  "aria-hidden": !0,
1582
- ...x.props(ke.timeAxis, ke.timeAxisInset(Y, Math.max(0, N - X))),
1602
+ ...x.props(Ae.timeAxis, Ae.timeAxisInset(X, Math.max(0, N - Z))),
1583
1603
  children: [/* @__PURE__ */ D("span", {
1584
1604
  className: "x1cqoux5 xeuugli xj0a0fe",
1585
- children: a(V)
1586
- }), H !== V && /* @__PURE__ */ D("span", {
1605
+ children: a(U)
1606
+ }), W !== U && /* @__PURE__ */ D("span", {
1587
1607
  className: "x1cqoux5 xeuugli xj0a0fe xp4054r",
1588
- children: a(H)
1608
+ children: a(W)
1589
1609
  })]
1590
1610
  })]
1591
1611
  }),
@@ -1603,4 +1623,4 @@ function Le({ title: t, description: n, series: r, timestampUnit: i, formatTimes
1603
1623
  })
1604
1624
  });
1605
1625
  }
1606
- export { je as AreaChart, B as BarChart, R as BarChartPlaceholder, H as BreakdownBar, Ae as LineChart, _e as MAX_SCATTER_POINTS, Y as ScatterPlot, Pe as SmallMultiples, Fe as SmallMultiplesPlaceholder, De as Sparkline, Me as TimeSeriesChartPlaceholder, $ as timeSeriesLimits };
1626
+ export { Me as AreaChart, V as BarChart, z as BarChartPlaceholder, U as BreakdownBar, je as LineChart, _e as MAX_SCATTER_POINTS, Y as ScatterPlot, Fe as SmallMultiples, Ie as SmallMultiplesPlaceholder, Oe as Sparkline, Ne as TimeSeriesChartPlaceholder, $ as timeSeriesLimits };