@umriss-ui/table 0.3.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/table.js CHANGED
@@ -1,27 +1,27 @@
1
1
  import "./table.css";
2
- var Xt = Object.defineProperty;
3
- var Jt = (e, t, n) => t in e ? Xt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
4
- var P = (e, t, n) => Jt(e, typeof t != "symbol" ? t + "" : t, n);
5
- import { useState as z, useCallback as X, useMemo as j, useRef as Z, useId as se, useContext as Ue, useSyncExternalStore as Le, createContext as yt, useLayoutEffect as K } from "react";
6
- import { DEFAULT_FORMATS as Ct, useVirtual as Qt, useFormats as ue, useWording as U, Checkbox as Se, DateRangePicker as Zt, FormField as rt, NumberInput as st, Popover as St, Button as ee, TagGroup as Nt, Tag as xt, Menu as At, MenuItem as Fe, MenuSeparator as en, VisuallyHidden as Re, useDensityFor as Tt, assess as tn, verdictWeight as Be, Select as nn, Input as on, DEFAULT_WORDING as rn, Badge as Ie, useFreshness as sn } from "@umriss-ui/core";
7
- import { jsx as l, jsxs as L, Fragment as J } from "react/jsx-runtime";
2
+ var Jt = Object.defineProperty;
3
+ var Xt = (e, t, n) => t in e ? Jt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
4
+ var B = (e, t, n) => Xt(e, typeof t != "symbol" ? t + "" : t, n);
5
+ import { useState as H, useCallback as X, useMemo as $, useRef as re, useId as se, useContext as Ue, useSyncExternalStore as Le, createContext as yt, useLayoutEffect as W } from "react";
6
+ import { DEFAULT_FORMATS as Ct, useVirtual as Qt, useFormats as ue, useWording as U, Checkbox as Se, DateRangePicker as Zt, FormField as rt, NumberInput as st, Popover as St, Button as ee, TagGroup as Nt, Tag as xt, Menu as At, MenuItem as Fe, MenuSeparator as en, VisuallyHidden as Re, useDensityFor as Tt, assess as tn, verdictWeight as Ee, Select as nn, Input as on, DEFAULT_WORDING as rn, Badge as Ie, useFreshness as sn } from "@umriss-ui/core";
7
+ import { jsx as l, jsxs as O, Fragment as Q } from "react/jsx-runtime";
8
8
  import { createPortal as an } from "react-dom";
9
9
  function ln(e) {
10
- const [t, n] = z(/* @__PURE__ */ new Set()), o = X((u) => t.has(u), [t]), r = X((u) => {
10
+ const [t, n] = H(/* @__PURE__ */ new Set()), o = X((u) => t.has(u), [t]), r = X((u) => {
11
11
  n((h) => {
12
- const f = new Set(h);
13
- return f.has(u) ? f.delete(u) : f.add(u), f;
12
+ const d = new Set(h);
13
+ return d.has(u) ? d.delete(u) : d.add(u), d;
14
14
  });
15
- }, []), s = j(
15
+ }, []), s = $(
16
16
  () => e.length > 0 && e.every((u) => t.has(u)),
17
17
  [e, t]
18
- ), i = j(
18
+ ), i = $(
19
19
  () => !s && e.some((u) => t.has(u)),
20
20
  [e, t, s]
21
21
  ), a = X(() => {
22
22
  n((u) => {
23
23
  const h = new Set(u);
24
- return e.length > 0 && e.every((b) => h.has(b)) ? e.forEach((b) => h.delete(b)) : e.forEach((b) => h.add(b)), h;
24
+ return e.length > 0 && e.every((m) => h.has(m)) ? e.forEach((m) => h.delete(m)) : e.forEach((m) => h.add(m)), h;
25
25
  });
26
26
  }, [e]), c = X(() => n(/* @__PURE__ */ new Set()), []);
27
27
  return { selected: t, isSelected: o, toggle: r, toggleAll: a, clear: c, allSelected: s, someSelected: i, count: t.size };
@@ -91,8 +91,8 @@ function Lt(e, t) {
91
91
  }
92
92
  }
93
93
  }
94
- const Xe = "absent", ge = (e) => Y(e) ? Xe : e instanceof Date ? `value:${e.getTime()}` : `value:${String(e)}`, it = (e) => e instanceof Date ? e.getTime() : typeof e == "number" && !Number.isNaN(e) ? e : void 0;
95
- function Je(e, t) {
94
+ const Je = "absent", ge = (e) => Y(e) ? Je : e instanceof Date ? `value:${e.getTime()}` : `value:${String(e)}`, it = (e) => e instanceof Date ? e.getTime() : typeof e == "number" && !Number.isNaN(e) ? e : void 0;
95
+ function Xe(e, t) {
96
96
  const n = t.map(e.read).filter((c) => !Y(c) && !(c instanceof Date && Number.isNaN(c.getTime()))), o = e.aggregate;
97
97
  if (typeof o == "function") return o(n, t);
98
98
  if (o === "count") return n.length;
@@ -117,54 +117,54 @@ const Qe = 3, Ce = (e) => {
117
117
  if (!Y(e))
118
118
  return e instanceof Date ? e.getTime() : typeof e == "boolean" ? e ? 1 : 0 : typeof e == "number" ? e : String(e);
119
119
  };
120
- function Pe(e, t, n) {
120
+ function Be(e, t, n) {
121
121
  const o = Ce(e), r = Ce(t);
122
122
  return o === void 0 || r === void 0 ? o === r ? 0 : o === void 0 ? 1 : -1 : typeof o == "number" && typeof r == "number" ? o - r : n(String(o), String(r));
123
123
  }
124
124
  function dn(e, t) {
125
125
  const n = t.compareText ?? Ct.compareText, o = (r, s, i) => {
126
- var w;
126
+ var b;
127
127
  const a = /* @__PURE__ */ new Map(), c = t.levels[s];
128
128
  if (!c) return [];
129
129
  const u = /* @__PURE__ */ new Map();
130
130
  for (const g of r) {
131
- const v = c.value(g), N = ge(v);
132
- let C = u.get(N);
133
- C || (C = {
134
- path: JSON.stringify([...i, N]),
135
- value: Y(v) ? void 0 : v,
131
+ const _ = c.value(g), C = ge(_);
132
+ let S = u.get(C);
133
+ S || (S = {
134
+ path: JSON.stringify([...i, C]),
135
+ value: Y(_) ? void 0 : _,
136
136
  level: s,
137
137
  rows: [],
138
138
  groups: [],
139
139
  aggregates: {}
140
- }, u.set(N, C), a.set(C, [...i, N])), C.rows.push(g);
140
+ }, u.set(C, S), a.set(S, [...i, C])), S.rows.push(g);
141
141
  }
142
142
  for (const g of u.values())
143
- for (const v of t.aggregates ?? []) g.aggregates[v.id] = Je(v, g.rows);
144
- const h = (w = t.sort) == null ? void 0 : w.find(
143
+ for (const _ of t.aggregates ?? []) g.aggregates[_.id] = Xe(_, g.rows);
144
+ const h = (b = t.sort) == null ? void 0 : b.find(
145
145
  (g) => {
146
- var v;
147
- return g.column === c.id || ((v = t.aggregates) == null ? void 0 : v.some((N) => N.id === g.column));
146
+ var _;
147
+ return g.column === c.id || ((_ = t.aggregates) == null ? void 0 : _.some((C) => C.id === g.column));
148
148
  }
149
- ), f = (h == null ? void 0 : h.direction) === "desc" ? -1 : 1, b = h !== void 0 && h.column !== c.id ? h.column : void 0, p = (g) => {
150
- let v;
151
- for (const N of g.rows) {
152
- const C = c.order(N);
153
- Ce(C) !== void 0 && (v === void 0 || Pe(C, v, n) < 0) && (v = C);
149
+ ), d = (h == null ? void 0 : h.direction) === "desc" ? -1 : 1, m = h !== void 0 && h.column !== c.id ? h.column : void 0, w = (g) => {
150
+ let _;
151
+ for (const C of g.rows) {
152
+ const S = c.order(C);
153
+ Ce(S) !== void 0 && (_ === void 0 || Be(S, _, n) < 0) && (_ = S);
154
154
  }
155
- return v;
155
+ return _;
156
156
  }, k = (g) => {
157
- if (b === void 0) return c.order ? p(g) : g.value;
158
- const v = g.aggregates[b];
159
- return Array.isArray(v) ? v[0] : v;
160
- }, m = [...u.values()].sort((g, v) => {
161
- if (g.value === void 0 || v.value === void 0) return Pe(g.value, v.value, n);
162
- const N = k(g), C = k(v), D = Pe(N, C, n);
163
- return Ce(N) === void 0 || Ce(C) === void 0 ? D : D * f;
157
+ if (m === void 0) return c.order ? w(g) : g.value;
158
+ const _ = g.aggregates[m];
159
+ return Array.isArray(_) ? _[0] : _;
160
+ }, p = [...u.values()].sort((g, _) => {
161
+ if (g.value === void 0 || _.value === void 0) return Be(g.value, _.value, n);
162
+ const C = k(g), S = k(_), I = Be(C, S, n);
163
+ return Ce(C) === void 0 || Ce(S) === void 0 ? I : I * d;
164
164
  });
165
- for (const g of m)
165
+ for (const g of p)
166
166
  g.groups = o(g.rows, s + 1, a.get(g));
167
- return m;
167
+ return p;
168
168
  };
169
169
  return o(e, 0, []);
170
170
  }
@@ -229,7 +229,7 @@ function et(e, t) {
229
229
  }
230
230
  const ke = (e) => e == null || typeof e == "number" && Number.isNaN(e), bn = (e, t) => typeof e == "number" && typeof t == "number" ? e - t : Ct.compareText(String(e), String(t));
231
231
  function tt(e, t, n) {
232
- var T;
232
+ var x;
233
233
  const {
234
234
  search: o = "",
235
235
  filter: r,
@@ -238,202 +238,202 @@ function tt(e, t, n) {
238
238
  pageSize: a,
239
239
  hidden: c,
240
240
  order: u
241
- } = n, h = et(t, u), f = c != null && c.length ? h.filter((x) => x.hideable === !1 || !c.includes(x.id)) : h, b = o.trim().toLowerCase(), p = t.filter((x) => x.searchable && x.value), k = (x) => !b || p.some((_) => {
242
- const S = _.value(x);
243
- return !ke(S) && String(S).toLowerCase().includes(b);
244
- }), m = e.filter((x) => k(x) && (r ? r(x) : !0)), w = Array.isArray(s) ? s : s ? [s] : [], g = w.map((x) => {
245
- const _ = t.find((I) => I.id === x.column);
246
- if (!_ || !_.compare && !_.value) return null;
247
- const S = x.direction === "asc" ? 1 : -1, O = _.compare, A = _.value;
248
- return A ? (I, $) => {
249
- const G = A(I), W = A($);
250
- return ke(G) || ke(W) ? ke(G) === ke(W) ? 0 : ke(G) ? 1 : -1 : (O ? O(I, $) : bn(G, W)) * S;
251
- } : (I, $) => O(I, $) * S;
252
- }).filter((x) => x !== null);
253
- if (g.length > 0 && m.sort((x, _) => {
254
- for (const S of g) {
255
- const O = S(x, _);
256
- if (O !== 0) return O;
241
+ } = n, h = et(t, u), d = c != null && c.length ? h.filter((A) => A.hideable === !1 || !c.includes(A.id)) : h, m = o.trim().toLowerCase(), w = t.filter((A) => A.searchable && A.value), k = (A) => !m || w.some((v) => {
242
+ const F = v.value(A);
243
+ return !ke(F) && String(F).toLowerCase().includes(m);
244
+ }), p = e.filter((A) => k(A) && (r ? r(A) : !0)), b = Array.isArray(s) ? s : s ? [s] : [], g = b.map((A) => {
245
+ const v = t.find((V) => V.id === A.column);
246
+ if (!v || !v.compare && !v.value) return null;
247
+ const F = A.direction === "asc" ? 1 : -1, L = v.compare, N = v.value;
248
+ return N ? (V, z) => {
249
+ const P = N(V), q = N(z);
250
+ return ke(P) || ke(q) ? ke(P) === ke(q) ? 0 : ke(P) ? 1 : -1 : (L ? L(V, z) : bn(P, q)) * F;
251
+ } : (V, z) => L(V, z) * F;
252
+ }).filter((A) => A !== null);
253
+ if (g.length > 0 && p.sort((A, v) => {
254
+ for (const F of g) {
255
+ const L = F(A, v);
256
+ if (L !== 0) return L;
257
257
  }
258
258
  return 0;
259
- }), (T = n.grouping) != null && T.levels.length) {
260
- const { folded: x, ..._ } = n.grouping, S = dn(m, { ..._, sort: w }), O = mn(S, x), A = wn(O, i, a ?? 0);
259
+ }), (x = n.grouping) != null && x.levels.length) {
260
+ const { folded: A, ...v } = n.grouping, F = dn(p, { ...v, sort: b }), L = mn(F, A), N = wn(L, i, a ?? 0);
261
261
  return {
262
- columns: f,
263
- filtered: m,
264
- visible: Ze(A.lines),
265
- groups: S,
266
- lines: O,
267
- visibleLines: A.lines,
268
- page: A.page,
269
- pageCount: A.pageCount,
270
- columnCount: f.length
262
+ columns: d,
263
+ filtered: p,
264
+ visible: Ze(N.lines),
265
+ groups: F,
266
+ lines: L,
267
+ visibleLines: N.lines,
268
+ page: N.page,
269
+ pageCount: N.pageCount,
270
+ columnCount: d.length
271
271
  };
272
272
  }
273
- const v = a && a > 0 ? a : m.length || 1, N = Math.max(1, Math.ceil(m.length / v)), C = Math.min(Math.max(1, i), N), D = m.slice((C - 1) * v, C * v);
273
+ const _ = a && a > 0 ? a : p.length || 1, C = Math.max(1, Math.ceil(p.length / _)), S = Math.min(Math.max(1, i), C), I = p.slice((S - 1) * _, S * _);
274
274
  return {
275
- columns: f,
276
- filtered: m,
277
- visible: D,
278
- page: C,
279
- pageCount: N,
280
- columnCount: f.length
275
+ columns: d,
276
+ filtered: p,
277
+ visible: I,
278
+ page: S,
279
+ pageCount: C,
280
+ columnCount: d.length
281
281
  };
282
282
  }
283
283
  function kn(e, t, n) {
284
- const { rowKey: o, filter: r, defaultSort: s = null, initialView: i, virtual: a, grouping: c } = n, [u, h] = z((i == null ? void 0 : i.search) ?? ""), [f, b] = z(() => {
285
- var F;
286
- return (F = i == null ? void 0 : i.sort) != null && F.length ? [...i.sort] : s ? Array.isArray(s) ? [...s] : [s] : [];
287
- }), [p, k] = z((i == null ? void 0 : i.page) ?? 1), [m, w] = z(
284
+ const { rowKey: o, filter: r, defaultSort: s = null, initialView: i, virtual: a, grouping: c } = n, [u, h] = H((i == null ? void 0 : i.search) ?? ""), [d, m] = H(() => {
285
+ var T;
286
+ return (T = i == null ? void 0 : i.sort) != null && T.length ? [...i.sort] : s ? Array.isArray(s) ? [...s] : [s] : [];
287
+ }), [w, k] = H((i == null ? void 0 : i.page) ?? 1), [p, b] = H(
288
288
  (i == null ? void 0 : i.pageSize) ?? n.pageSize ?? 10
289
- ), [g, v] = z([]), [N, C] = z((i == null ? void 0 : i.hidden) ?? []), [D, T] = z((i == null ? void 0 : i.order) ?? []), [x, _] = z(() => {
289
+ ), [g, _] = H([]), [C, S] = H((i == null ? void 0 : i.hidden) ?? []), [I, x] = H((i == null ? void 0 : i.order) ?? []), [A, v] = H(() => {
290
290
  if (i != null && i.widths) return { ...i.widths };
291
- const F = {};
292
- for (const V of t)
293
- V.width !== void 0 && (F[V.id] = V.width);
294
- return F;
295
- }), S = a ? 0 : m, O = j(
291
+ const T = {};
292
+ for (const D of t)
293
+ D.width !== void 0 && (T[D.id] = D.width);
294
+ return T;
295
+ }), F = a ? 0 : p, L = $(
296
296
  () => tt(e, t, {
297
297
  search: u,
298
298
  filter: r,
299
- sort: f,
300
- page: p,
301
- pageSize: S,
302
- hidden: N,
303
- order: D,
299
+ sort: d,
300
+ page: w,
301
+ pageSize: F,
302
+ hidden: C,
303
+ order: I,
304
304
  grouping: c
305
305
  }),
306
- [e, t, u, r, f, p, S, N, D, c]
307
- ), A = Qt(a ? (O.lines ?? O.filtered).length : 0, {
306
+ [e, t, u, r, d, w, F, C, I, c]
307
+ ), N = Qt(a ? (L.lines ?? L.filtered).length : 0, {
308
308
  rowHeight: (a == null ? void 0 : a.rowHeight) ?? 0,
309
309
  overscan: a == null ? void 0 : a.overscan
310
- }), I = j(
311
- () => a && O.lines ? O.lines.slice(A.from, A.to) : O.visibleLines,
312
- [a, O.lines, O.visibleLines, A.from, A.to]
313
- ), $ = j(
314
- () => a ? I ? Ze(I) : O.filtered.slice(A.from, A.to) : O.visible,
315
- [a, I, O.filtered, O.visible, A.from, A.to]
316
- ), G = j(() => O.filtered.map(o), [O.filtered, o]), W = ln(G), ie = X((F) => {
317
- h(F), k(1);
318
- }, []), ae = X((F) => {
319
- w(F), k(1);
320
- }, []), de = X((F, V = !1) => {
321
- b((B) => {
322
- const oe = B.find((he) => he.column === F);
323
- if (!V) {
324
- const he = B.length === 1 && (oe == null ? void 0 : oe.direction) === "asc" ? "desc" : "asc";
325
- return [{ column: F, direction: he }];
310
+ }), V = $(
311
+ () => a && L.lines ? L.lines.slice(N.from, N.to) : L.visibleLines,
312
+ [a, L.lines, L.visibleLines, N.from, N.to]
313
+ ), z = $(
314
+ () => a ? V ? Ze(V) : L.filtered.slice(N.from, N.to) : L.visible,
315
+ [a, V, L.filtered, L.visible, N.from, N.to]
316
+ ), P = $(() => L.filtered.map(o), [L.filtered, o]), q = ln(P), ie = X((T) => {
317
+ h(T), k(1);
318
+ }, []), ae = X((T) => {
319
+ b(T), k(1);
320
+ }, []), de = X((T, D = !1) => {
321
+ m((E) => {
322
+ const ne = E.find((he) => he.column === T);
323
+ if (!D) {
324
+ const he = E.length === 1 && (ne == null ? void 0 : ne.direction) === "asc" ? "desc" : "asc";
325
+ return [{ column: T, direction: he }];
326
326
  }
327
- return oe ? oe.direction === "asc" ? B.map(
328
- (he) => he.column === F ? { column: F, direction: "desc" } : he
329
- ) : B.filter((he) => he.column !== F) : [...B, { column: F, direction: "asc" }];
327
+ return ne ? ne.direction === "asc" ? E.map(
328
+ (he) => he.column === T ? { column: T, direction: "desc" } : he
329
+ ) : E.filter((he) => he.column !== T) : [...E, { column: T, direction: "asc" }];
330
330
  }), k(1);
331
- }, []), fe = X((F) => {
332
- v(
333
- (V) => V.includes(F) ? V.filter((B) => B !== F) : [...V, F]
331
+ }, []), fe = X((T) => {
332
+ _(
333
+ (D) => D.includes(T) ? D.filter((E) => E !== T) : [...D, T]
334
334
  );
335
335
  }, []), we = X(
336
- (F) => g.includes(F),
336
+ (T) => g.includes(T),
337
337
  [g]
338
- ), be = X((F) => {
339
- C(
340
- (V) => V.includes(F) ? V.filter((B) => B !== F) : [...V, F]
338
+ ), be = X((T) => {
339
+ S(
340
+ (D) => D.includes(T) ? D.filter((E) => E !== T) : [...D, T]
341
341
  );
342
- }, []), ye = X((F, V) => {
343
- _((B) => {
344
- if (V === void 0) {
345
- if (!(F in B)) return B;
346
- const oe = { ...B };
347
- return delete oe[F], oe;
342
+ }, []), ye = X((T, D) => {
343
+ v((E) => {
344
+ if (D === void 0) {
345
+ if (!(T in E)) return E;
346
+ const ne = { ...E };
347
+ return delete ne[T], ne;
348
348
  }
349
- return { ...B, [F]: V };
349
+ return { ...E, [T]: D };
350
350
  });
351
351
  }, []), le = X(
352
- (F) => {
353
- var V;
354
- return (V = f.find((B) => B.column === F)) == null ? void 0 : V.direction;
352
+ (T) => {
353
+ var D;
354
+ return (D = d.find((E) => E.column === T)) == null ? void 0 : D.direction;
355
355
  },
356
- [f]
356
+ [d]
357
357
  ), te = X(
358
- (F) => {
359
- if (f.length < 2) return;
360
- const V = f.findIndex((B) => B.column === F);
361
- return V === -1 ? void 0 : V + 1;
358
+ (T) => {
359
+ if (d.length < 2) return;
360
+ const D = d.findIndex((E) => E.column === T);
361
+ return D === -1 ? void 0 : D + 1;
362
362
  },
363
- [f]
364
- ), y = j(
365
- () => et(t, D).filter((F) => F.label !== void 0 && F.hideable !== !1).map((F) => ({ id: F.id, label: F.label, visible: !N.includes(F.id) })),
366
- [t, D, N]
367
- ), R = n.pageSize ?? 10, q = j(() => {
368
- const F = {};
369
- for (const V of t)
370
- V.width !== void 0 && (F[V.id] = V.width);
371
- return F;
372
- }, [t]), H = j(() => {
373
- const F = {};
374
- for (const [V, B] of Object.entries(x))
375
- q[V] !== B && (F[V] = B);
376
- return F;
377
- }, [x, q]), M = j(
363
+ [d]
364
+ ), y = $(
365
+ () => et(t, I).filter((T) => T.label !== void 0 && T.hideable !== !1).map((T) => ({ id: T.id, label: T.label, visible: !C.includes(T.id) })),
366
+ [t, I, C]
367
+ ), R = n.pageSize ?? 10, K = $(() => {
368
+ const T = {};
369
+ for (const D of t)
370
+ D.width !== void 0 && (T[D.id] = D.width);
371
+ return T;
372
+ }, [t]), j = $(() => {
373
+ const T = {};
374
+ for (const [D, E] of Object.entries(A))
375
+ K[D] !== E && (T[D] = E);
376
+ return T;
377
+ }, [A, K]), M = $(
378
378
  () => s ? Array.isArray(s) ? s : [s] : [],
379
379
  [s]
380
- ), Q = f.length === M.length && f.every(
381
- (F, V) => {
382
- var B, oe;
383
- return F.column === ((B = M[V]) == null ? void 0 : B.column) && F.direction === ((oe = M[V]) == null ? void 0 : oe.direction);
380
+ ), J = d.length === M.length && d.every(
381
+ (T, D) => {
382
+ var E, ne;
383
+ return T.column === ((E = M[D]) == null ? void 0 : E.column) && T.direction === ((ne = M[D]) == null ? void 0 : ne.direction);
384
384
  }
385
- ), ne = j(
385
+ ), Z = $(
386
386
  () => ({
387
387
  ...u ? { search: u } : {},
388
- ...f.length && !Q ? { sort: f } : {},
388
+ ...d.length && !J ? { sort: d } : {},
389
389
  /* Without paging there is no page a view could carry - a page three in
390
390
  the view of a virtualised table would be a promise nobody redeems on
391
391
  opening. */
392
- ...!a && O.page > 1 ? { page: O.page } : {},
393
- ...!a && m !== R ? { pageSize: m } : {},
394
- ...N.length ? { hidden: N } : {},
395
- ...D.length ? { order: D } : {},
396
- ...Object.keys(H).length ? { widths: H } : {}
392
+ ...!a && L.page > 1 ? { page: L.page } : {},
393
+ ...!a && p !== R ? { pageSize: p } : {},
394
+ ...C.length ? { hidden: C } : {},
395
+ ...I.length ? { order: I } : {},
396
+ ...Object.keys(j).length ? { widths: j } : {}
397
397
  }),
398
398
  [
399
399
  a,
400
400
  u,
401
- f,
402
- Q,
403
- O.page,
404
- m,
401
+ d,
402
+ J,
403
+ L.page,
404
+ p,
405
405
  R,
406
- N,
407
- D,
408
- H
406
+ C,
407
+ I,
408
+ j
409
409
  ]
410
410
  );
411
411
  return {
412
- ...O,
413
- visible: $,
414
- visibleLines: I,
415
- virtual: a ? A : void 0,
416
- view: ne,
412
+ ...L,
413
+ visible: z,
414
+ visibleLines: V,
415
+ virtual: a ? N : void 0,
416
+ view: Z,
417
417
  search: u,
418
418
  setSearch: ie,
419
- sort: f,
419
+ sort: d,
420
420
  toggleSort: de,
421
421
  sortDirectionOf: le,
422
422
  sortRankOf: te,
423
423
  setPage: k,
424
- pageSize: m,
424
+ pageSize: p,
425
425
  setPageSize: ae,
426
426
  expanded: g,
427
427
  toggleRow: fe,
428
428
  isExpanded: we,
429
- hidden: N,
429
+ hidden: C,
430
430
  toggleColumn: be,
431
431
  columnChoices: y,
432
- order: D,
433
- setOrder: T,
434
- widths: x,
432
+ order: I,
433
+ setOrder: x,
434
+ widths: A,
435
435
  setWidth: ye,
436
- selection: W
436
+ selection: q
437
437
  };
438
438
  }
439
439
  function vn() {
@@ -445,7 +445,7 @@ const Mt = vn(), at = /* @__PURE__ */ new Set();
445
445
  function pe(e, t) {
446
446
  !Mt || at.has(e) || (at.add(e), console.warn(`@umriss-ui/table: ${t}`));
447
447
  }
448
- const _n = "_frame_1wkkr_11 _text_1hv7a_23", yn = "_children_1wkkr_23", Cn = "_scroll_1wkkr_29 _scroll_1hv7a_40", Sn = "_footerTarget_1wkkr_36", Nn = "_table_1wkkr_40", xn = "_th_1wkkr_48 _ring_1hv7a_65", An = "_sticky_1wkkr_63", Tn = "_td_1wkkr_71", Fn = "_rowHeader_1wkkr_83", On = "_compact_1wkkr_99", Ln = "_numeric_1wkkr_114", Rn = "_absent_1wkkr_126", Mn = "_striped_1wkkr_130", Vn = "_stickyCell_1wkkr_154", Dn = "_sortButton_1wkkr_166 _ring_1hv7a_65", In = "_sortIndicator_1wkkr_191", Pn = "_sortArrow_1wkkr_198", Gn = "_sortArrowDesc_1wkkr_202", En = "_sortActive_1wkkr_210", Bn = "_sortRank_1wkkr_216", zn = "_thFlex_1wkkr_224", jn = "_footerKind_1wkkr_245", Hn = "_emptyCell_1wkkr_253", $n = "_empty_1wkkr_253", Kn = "_emptyTitle_1wkkr_269", Wn = "_skeleton_1wkkr_276", qn = "_toolbar_1wkkr_304 _text_1hv7a_23", Yn = "_toolbarGroup_1wkkr_318", Un = "_toolbarInfo_1wkkr_335", Xn = "_pagination_1wkkr_341 _text_1hv7a_23", Jn = "_paginationControls_1wkkr_354", Qn = "_pageSize_1wkkr_361", Zn = "_paginationStatus_1wkkr_373", eo = "_filterButton_1wkkr_382 _ring_1hv7a_65", to = "_filterActive_1wkkr_405", no = "_filterPanel_1wkkr_410", oo = "_filterContent_1wkkr_423 _scroll_1hv7a_40", ro = "_filterFooter_1wkkr_434", so = "_filterLabel_1wkkr_448", io = "_filterValue_1wkkr_458", ao = "_filteredCount_1wkkr_464", lo = "_rangeFields_1wkkr_475", co = "_rangePeriod_1wkkr_485", uo = "_conditions_1wkkr_491", fo = "_conditionButton_1wkkr_497", ho = "_condition_1wkkr_491", go = "_columnsPanel_1wkkr_521", po = "_columnsList_1wkkr_529", mo = "_columnsEntry_1wkkr_538", wo = "_move_1wkkr_550", bo = "_groupingChoice_1wkkr_585", ko = "_groupingHeading_1wkkr_591", vo = "_groupingOptions_1wkkr_600", _o = "_groupingOption_1wkkr_600 _ring_1hv7a_65", yo = "_groupingLevel_1wkkr_639", Co = "_groupingTag_1wkkr_644", So = "_groupingTrigger_1wkkr_651", No = "_groupingPrefix_1wkkr_656", xo = "_groupingPath_1wkkr_661", Ao = "_groupingSeparator_1wkkr_665", To = "_groupHeader_1wkkr_682", Fo = "_spanCell_1wkkr_723", Oo = "_groupFolded_1wkkr_772", Lo = "_spanValue_1wkkr_776", Ro = "_groupLabel_1wkkr_777", Mo = "_spanText_1wkkr_789", Vo = "_groupValue_1wkkr_790", Do = "_groupCount_1wkkr_797", Io = "_continued_1wkkr_811", Po = "_spanSelect_1wkkr_842", Go = "_fold_1wkkr_856", Eo = "_foldClosed_1wkkr_888", Bo = "_foldedCount_1wkkr_898", zo = "_shareHost_1wkkr_906", jo = "_shareBar_1wkkr_913", Ho = "_expander_1wkkr_925", $o = "_expanderOpen_1wkkr_956", Ko = "_detailRow_1wkkr_960", Wo = "_detailCell_1wkkr_960", qo = "_actionsCell_1wkkr_968", Yo = "_actions_1wkkr_968", Uo = "_grip_1wkkr_996", Xo = "_virtualBody_1wkkr_1037", Jo = "_virtualRow_1wkkr_1045", Qo = "_fillerRow_1wkkr_1050", Zo = "_control_1wkkr_145", d = {
448
+ const _n = "_frame_1wkkr_11 _text_1hv7a_23", yn = "_children_1wkkr_23", Cn = "_scroll_1wkkr_29 _scroll_1hv7a_40", Sn = "_footerTarget_1wkkr_36", Nn = "_table_1wkkr_40", xn = "_th_1wkkr_48 _ring_1hv7a_65", An = "_sticky_1wkkr_63", Tn = "_td_1wkkr_71", Fn = "_rowHeader_1wkkr_83", On = "_compact_1wkkr_99", Ln = "_numeric_1wkkr_114", Rn = "_absent_1wkkr_126", Mn = "_striped_1wkkr_130", Vn = "_stickyCell_1wkkr_154", Dn = "_sortButton_1wkkr_166 _ring_1hv7a_65", In = "_sortIndicator_1wkkr_191", Bn = "_sortArrow_1wkkr_198", Pn = "_sortArrowDesc_1wkkr_202", Gn = "_sortActive_1wkkr_210", En = "_sortRank_1wkkr_216", zn = "_thFlex_1wkkr_224", jn = "_footerKind_1wkkr_245", Hn = "_emptyCell_1wkkr_253", $n = "_empty_1wkkr_253", Kn = "_emptyTitle_1wkkr_269", Wn = "_skeleton_1wkkr_276", qn = "_toolbar_1wkkr_304 _text_1hv7a_23", Yn = "_toolbarGroup_1wkkr_318", Un = "_toolbarInfo_1wkkr_335", Jn = "_pagination_1wkkr_341 _text_1hv7a_23", Xn = "_paginationControls_1wkkr_354", Qn = "_pageSize_1wkkr_361", Zn = "_paginationStatus_1wkkr_373", eo = "_filterButton_1wkkr_382 _ring_1hv7a_65", to = "_filterActive_1wkkr_405", no = "_filterPanel_1wkkr_410", oo = "_filterContent_1wkkr_423 _scroll_1hv7a_40", ro = "_filterFooter_1wkkr_434", so = "_filterLabel_1wkkr_448", io = "_filterValue_1wkkr_458", ao = "_filteredCount_1wkkr_464", lo = "_rangeFields_1wkkr_475", co = "_rangePeriod_1wkkr_485", uo = "_conditions_1wkkr_491", fo = "_conditionButton_1wkkr_497", ho = "_condition_1wkkr_491", go = "_columnsPanel_1wkkr_521", po = "_columnsList_1wkkr_529", mo = "_columnsEntry_1wkkr_538", wo = "_move_1wkkr_550", bo = "_groupingChoice_1wkkr_585", ko = "_groupingHeading_1wkkr_591", vo = "_groupingOptions_1wkkr_600", _o = "_groupingOption_1wkkr_600 _ring_1hv7a_65", yo = "_groupingLevel_1wkkr_639", Co = "_groupingTag_1wkkr_644", So = "_groupingTrigger_1wkkr_651", No = "_groupingPrefix_1wkkr_656", xo = "_groupingPath_1wkkr_661", Ao = "_groupingSeparator_1wkkr_665", To = "_groupHeader_1wkkr_682", Fo = "_spanCell_1wkkr_723", Oo = "_groupFolded_1wkkr_772", Lo = "_spanValue_1wkkr_776", Ro = "_groupLabel_1wkkr_777", Mo = "_spanText_1wkkr_789", Vo = "_groupValue_1wkkr_790", Do = "_groupCount_1wkkr_797", Io = "_continued_1wkkr_811", Bo = "_spanSelect_1wkkr_842", Po = "_fold_1wkkr_856", Go = "_foldClosed_1wkkr_888", Eo = "_foldedCount_1wkkr_898", zo = "_shareHost_1wkkr_906", jo = "_shareBar_1wkkr_913", Ho = "_expander_1wkkr_925", $o = "_expanderOpen_1wkkr_956", Ko = "_detailRow_1wkkr_960", Wo = "_detailCell_1wkkr_960", qo = "_actionsCell_1wkkr_968", Yo = "_actions_1wkkr_968", Uo = "_grip_1wkkr_996", Jo = "_virtualBody_1wkkr_1037", Xo = "_virtualRow_1wkkr_1045", Qo = "_fillerRow_1wkkr_1050", Zo = "_control_1wkkr_145", f = {
449
449
  frame: _n,
450
450
  children: yn,
451
451
  scroll: Cn,
@@ -462,10 +462,10 @@ const _n = "_frame_1wkkr_11 _text_1hv7a_23", yn = "_children_1wkkr_23", Cn = "_s
462
462
  stickyCell: Vn,
463
463
  sortButton: Dn,
464
464
  sortIndicator: In,
465
- sortArrow: Pn,
466
- sortArrowDesc: Gn,
467
- sortActive: En,
468
- sortRank: Bn,
465
+ sortArrow: Bn,
466
+ sortArrowDesc: Pn,
467
+ sortActive: Gn,
468
+ sortRank: En,
469
469
  thFlex: zn,
470
470
  footerKind: jn,
471
471
  emptyCell: Hn,
@@ -475,8 +475,8 @@ const _n = "_frame_1wkkr_11 _text_1hv7a_23", yn = "_children_1wkkr_23", Cn = "_s
475
475
  toolbar: qn,
476
476
  toolbarGroup: Yn,
477
477
  toolbarInfo: Un,
478
- pagination: Xn,
479
- paginationControls: Jn,
478
+ pagination: Jn,
479
+ paginationControls: Xn,
480
480
  pageSize: Qn,
481
481
  paginationStatus: Zn,
482
482
  filterButton: eo,
@@ -515,10 +515,10 @@ const _n = "_frame_1wkkr_11 _text_1hv7a_23", yn = "_children_1wkkr_23", Cn = "_s
515
515
  groupValue: Vo,
516
516
  groupCount: Do,
517
517
  continued: Io,
518
- spanSelect: Po,
519
- fold: Go,
520
- foldClosed: Eo,
521
- foldedCount: Bo,
518
+ spanSelect: Bo,
519
+ fold: Po,
520
+ foldClosed: Go,
521
+ foldedCount: Eo,
522
522
  shareHost: zo,
523
523
  shareBar: jo,
524
524
  expander: Ho,
@@ -528,12 +528,12 @@ const _n = "_frame_1wkkr_11 _text_1hv7a_23", yn = "_children_1wkkr_23", Cn = "_s
528
528
  actionsCell: qo,
529
529
  actions: Yo,
530
530
  grip: Uo,
531
- virtualBody: Xo,
532
- virtualRow: Jo,
531
+ virtualBody: Jo,
532
+ virtualRow: Xo,
533
533
  fillerRow: Qo,
534
534
  control: Zo
535
535
  };
536
- function Xs(e) {
536
+ function Js(e) {
537
537
  return e;
538
538
  }
539
539
  const Ne = /* @__PURE__ */ new WeakMap();
@@ -588,23 +588,23 @@ function rr({
588
588
  absentOccurs: o = !1,
589
589
  format: r
590
590
  }) {
591
- const s = ue(), i = U(), a = j(() => e ?? [], [e]), c = j(() => {
592
- const f = { formats: s, wording: i, format: r }, b = n.map((w) => ({ key: ge(w), text: He(w, f), value: w }));
593
- b.sort(It(s));
594
- const p = new Set(b.map((w) => w.key)), k = a.filter((w) => !Y(w) && !p.has(ge(w))).map((w) => ({ key: ge(w), text: He(w, f), value: w })), m = o || a.some(Y) ? [{ key: Xe, text: i.cellAbsentValue, value: null }] : [];
595
- return [...b, ...k, ...m];
596
- }, [n, a, o, r, s, i]), u = je(a), h = (f) => {
597
- const b = u.has(f.key) ? a.filter((p) => ge(p) !== f.key) : [...a, f.value];
598
- t(b.length > 0 ? b : null);
591
+ const s = ue(), i = U(), a = $(() => e ?? [], [e]), c = $(() => {
592
+ const d = { formats: s, wording: i, format: r }, m = n.map((b) => ({ key: ge(b), text: He(b, d), value: b }));
593
+ m.sort(It(s));
594
+ const w = new Set(m.map((b) => b.key)), k = a.filter((b) => !Y(b) && !w.has(ge(b))).map((b) => ({ key: ge(b), text: He(b, d), value: b })), p = o || a.some(Y) ? [{ key: Je, text: i.cellAbsentValue, value: null }] : [];
595
+ return [...m, ...k, ...p];
596
+ }, [n, a, o, r, s, i]), u = je(a), h = (d) => {
597
+ const m = u.has(d.key) ? a.filter((w) => ge(w) !== d.key) : [...a, d.value];
598
+ t(m.length > 0 ? m : null);
599
599
  };
600
- return /* @__PURE__ */ l("div", { className: d.filterContent, children: c.map((f) => /* @__PURE__ */ l(
600
+ return /* @__PURE__ */ l("div", { className: f.filterContent, children: c.map((d) => /* @__PURE__ */ l(
601
601
  Se,
602
602
  {
603
- label: f.text,
604
- checked: u.has(f.key),
605
- onChange: () => h(f)
603
+ label: d.text,
604
+ checked: u.has(d.key),
605
+ onChange: () => h(d)
606
606
  },
607
- f.key
607
+ d.key
608
608
  )) });
609
609
  }
610
610
  const sr = Vt(
@@ -616,7 +616,7 @@ const sr = Vt(
616
616
  {
617
617
  isCondition: (e) => Array.isArray(e),
618
618
  isEmpty: (e) => e.length === 0,
619
- absentMatches: (e) => je(e).has(Xe),
619
+ absentMatches: (e) => je(e).has(Je),
620
620
  /* From three values on the first two and how many more: a condition is one
621
621
  line in the table toolbar, not a list. */
622
622
  describeIn: (e, t) => {
@@ -628,29 +628,29 @@ const sr = Vt(
628
628
  }
629
629
  ), ir = (e) => new Date(e.getFullYear(), e.getMonth(), e.getDate()).getTime(), ar = (e) => new Date(e.getFullYear(), e.getMonth(), e.getDate() + 1).getTime(), ve = (e) => typeof e == "number" && Number.isFinite(e), ce = (e) => e instanceof Date && !Number.isNaN(e.getTime()), lr = (e) => ce(e) ? ir(e) : ve(e) ? e : void 0, cr = (e) => ce(e) ? { value: ar(e), open: !0 } : ve(e) ? { value: e, open: !1 } : void 0, Ae = (e, t) => ce(e) ? t.formats.date(e) : _e(e, t.format, t.formats, t.wording) ?? String(e);
630
630
  function ur({ condition: e, setCondition: t }) {
631
- const n = U(), [o, r] = z(null), s = o !== null, i = o ? o.from : ve(e == null ? void 0 : e.from) ? e.from : null, a = o ? o.to : ve(e == null ? void 0 : e.to) ? e.to : null, c = (u, h) => {
632
- const f = { from: i, to: a, [u]: h };
633
- if (f.from !== null && f.to !== null && f.from > f.to) {
634
- r(f);
631
+ const n = U(), [o, r] = H(null), s = o !== null, i = o ? o.from : ve(e == null ? void 0 : e.from) ? e.from : null, a = o ? o.to : ve(e == null ? void 0 : e.to) ? e.to : null, c = (u, h) => {
632
+ const d = { from: i, to: a, [u]: h };
633
+ if (d.from !== null && d.to !== null && d.from > d.to) {
634
+ r(d);
635
635
  return;
636
636
  }
637
- if (r(null), f.from === null && f.to === null) {
637
+ if (r(null), d.from === null && d.to === null) {
638
638
  t(null);
639
639
  return;
640
640
  }
641
641
  t({
642
- ...f.from !== null ? { from: f.from } : {},
643
- ...f.to !== null ? { to: f.to } : {}
642
+ ...d.from !== null ? { from: d.from } : {},
643
+ ...d.to !== null ? { to: d.to } : {}
644
644
  });
645
645
  };
646
- return /* @__PURE__ */ L("div", { className: d.rangeFields, children: [
646
+ return /* @__PURE__ */ O("div", { className: f.rangeFields, children: [
647
647
  /* @__PURE__ */ l(rt, { label: n.filterFrom, children: /* @__PURE__ */ l(st, { size: "sm", value: i, invalid: s, onChange: (u) => c("from", u) }) }),
648
648
  /* @__PURE__ */ l(rt, { label: n.filterTo, error: s ? n.rangeInvalid : void 0, children: /* @__PURE__ */ l(st, { size: "sm", value: a, onChange: (u) => c("to", u) }) })
649
649
  ] });
650
650
  }
651
651
  function dr({ condition: e, setCondition: t }) {
652
652
  const n = ce(e == null ? void 0 : e.from) && ce(e == null ? void 0 : e.to) ? { from: e.from, to: e.to } : null;
653
- return /* @__PURE__ */ l("div", { className: d.rangePeriod, children: /* @__PURE__ */ l(
653
+ return /* @__PURE__ */ l("div", { className: f.rangePeriod, children: /* @__PURE__ */ l(
654
654
  Zt,
655
655
  {
656
656
  size: "sm",
@@ -693,13 +693,13 @@ const hr = Vt(
693
693
  }
694
694
  }
695
695
  );
696
- class Ge {
696
+ class Pe {
697
697
  constructor(t) {
698
- P(this, "entries", /* @__PURE__ */ new Map());
698
+ B(this, "entries", /* @__PURE__ */ new Map());
699
699
  /** Keys in the order of the running pass. */
700
- P(this, "pass", []);
700
+ B(this, "pass", []);
701
701
  /** Order from the markers in the DOM, after the last commit. */
702
- P(this, "dom", []);
702
+ B(this, "dom", []);
703
703
  this.markerAttribute = t;
704
704
  }
705
705
  note(t) {
@@ -745,55 +745,56 @@ const ut = (e) => JSON.stringify([
745
745
  ]), dt = (e, t) => e == null ? void 0 : e[t];
746
746
  class gr {
747
747
  constructor() {
748
- P(this, "columns", new Ge("data-umriss-column"));
749
- P(this, "actions", new Ge("data-umriss-action"));
748
+ B(this, "columns", new Pe("data-umriss-column"));
749
+ B(this, "actions", new Pe("data-umriss-action"));
750
750
  /** The group keys: values to group by that are no column. */
751
- P(this, "groupKeys", new Ge("data-umriss-groupkey"));
752
- P(this, "signatures", /* @__PURE__ */ new Map());
751
+ B(this, "groupKeys", new Pe("data-umriss-groupkey"));
752
+ B(this, "signatures", /* @__PURE__ */ new Map());
753
753
  /** The row detail: the presentation of the `RowDetail` that registered last. */
754
- P(this, "detail", null);
754
+ B(this, "detail", null);
755
755
  /** How many `RowActions` stand right now. */
756
- P(this, "actionGroups", /* @__PURE__ */ new Set());
756
+ B(this, "actionGroups", /* @__PURE__ */ new Set());
757
757
  /** Whether the row header column sticks - it then stands first, on screen, in
758
758
  the column menu and in the export alike. */
759
- P(this, "stickyRowHeader", !1);
759
+ B(this, "stickyRowHeader", !1);
760
760
  /* Without a pagination bar the table does not page: one that stops quietly at
761
761
  the tenth row because nobody put one there is a trap (found at the alarm
762
762
  list, umriss-table 13). Without a table toolbar, but with a search or a
763
763
  column filter, the table puts one there itself (table-filters 04):
764
764
  conditions and the ratio need a place, and a place that came into being
765
765
  only with the first condition would shift the table. */
766
- P(this, "parts", /* @__PURE__ */ new Map());
766
+ B(this, "parts", /* @__PURE__ */ new Map());
767
767
  /** The element the table's children stand in - for the markers. */
768
- P(this, "children", null);
769
- P(this, "hook", null);
770
- P(this, "structure", 0);
771
- P(this, "values", 0);
772
- P(this, "presentation", 0);
773
- P(this, "hookVersion", 0);
774
- P(this, "reported", "");
775
- P(this, "listeners", /* @__PURE__ */ new Set());
768
+ B(this, "children", null);
769
+ B(this, "hook", null);
770
+ B(this, "structure", 0);
771
+ B(this, "values", 0);
772
+ B(this, "presentation", 0);
773
+ B(this, "hookVersion", 0);
774
+ B(this, "reported", "");
775
+ B(this, "listeners", /* @__PURE__ */ new Set());
776
776
  /* --- Subscription ------------------------------------------------------------- */
777
- P(this, "subscribe", (t) => (this.listeners.add(t), () => {
777
+ B(this, "subscribe", (t) => (this.listeners.add(t), () => {
778
778
  this.listeners.delete(t);
779
779
  }));
780
780
  /** What the hook reads. */
781
- P(this, "structureVersion", () => this.structure);
781
+ B(this, "structureVersion", () => this.structure);
782
782
  /** What body and unbound parts read. Every counter only rises, so the sum
783
783
  rises exactly when one of them rises. */
784
- P(this, "bodyVersion", () => this.structure + this.values + this.presentation + this.hookVersion);
785
- /** The group whose fold takes the focus after its line was drawn anew - a
786
- folded span is a new row, and the focus would otherwise be lost. */
787
- P(this, "pendingFoldFocus", null);
784
+ B(this, "bodyVersion", () => this.structure + this.values + this.presentation + this.hookVersion);
785
+ /** The focus a fold may hide: the focused element of a grouped line, the
786
+ group that line stands in, and its table - noted before the fold, since
787
+ afterwards the element may be gone and the focus lost. */
788
+ B(this, "focusBeforeFold", null);
788
789
  /** Whether the table lets itself be grouped at all (`<Table groupable>`). */
789
- P(this, "tableGroupable", !0);
790
- P(this, "groupingCache", null);
790
+ B(this, "tableGroupable", !0);
791
+ B(this, "groupingCache", null);
791
792
  /* --- The kind of a column ------------------------------------------------------- */
792
- P(this, "kinds", /* @__PURE__ */ new Map());
793
+ B(this, "kinds", /* @__PURE__ */ new Map());
793
794
  /* --- The model ------------------------------------------------------------------ */
794
- P(this, "modelCache", null);
795
- P(this, "projectionCache", null);
796
- P(this, "unpaged", null);
795
+ B(this, "modelCache", null);
796
+ B(this, "projectionCache", null);
797
+ B(this, "unpaged", null);
797
798
  }
798
799
  /** Reports from a layout effect what has changed since the last report.
799
800
  Without a change nothing happens. */
@@ -898,12 +899,17 @@ class gr {
898
899
  removeGroupKey(t) {
899
900
  this.groupKeys.entries.delete(t) && (this.signatures.delete(t), this.kinds.delete(t), this.structure++);
900
901
  }
901
- requestFoldFocus(t) {
902
- this.pendingFoldFocus = t;
902
+ /** Notes where the focus stands - from the event that folds, never in a
903
+ render. */
904
+ noteFocusBeforeFold() {
905
+ var o;
906
+ const t = document.activeElement, n = (o = t == null ? void 0 : t.closest("tr[data-group]")) == null ? void 0 : o.dataset.group;
907
+ this.focusBeforeFold = t && n !== void 0 ? { element: t, group: n, table: t.closest("table") } : null;
903
908
  }
904
- /** Whether this group's fold is to take the focus now - once. */
905
- takeFoldFocus(t) {
906
- return this.pendingFoldFocus !== t ? !1 : (this.pendingFoldFocus = null, !0);
909
+ /** The focus noted before the last fold - once. */
910
+ takeFocusBeforeFold() {
911
+ const t = this.focusBeforeFold;
912
+ return this.focusBeforeFold = null, t;
907
913
  }
908
914
  setTableGroupable(t) {
909
915
  this.tableGroupable !== t && (this.tableGroupable = t, this.structure++);
@@ -936,8 +942,8 @@ class gr {
936
942
  value: (u) => {
937
943
  const h = c.read(u);
938
944
  if (h == null) return;
939
- const { ownGroupValue: f, group: b } = c.spec;
940
- return f ? f(h) : b ? hn(b)(h) : h;
945
+ const { ownGroupValue: d, group: m } = c.spec;
946
+ return d ? d(h) : m ? hn(m)(h) : h;
941
947
  },
942
948
  /* A value of one's own is a name; its groups stand by what they hold. */
943
949
  order: c.spec.ownGroupValue ? (u) => ze(c.read(u), c.spec.ownSortValue) : void 0
@@ -984,15 +990,15 @@ class gr {
984
990
  if (((i = this.modelCache) == null ? void 0 : i.key) === r && this.modelCache.rows === t && this.modelCache.formats === n)
985
991
  return this.modelCache.columns;
986
992
  const s = o.map((a) => {
987
- const { spec: c } = a, u = this.kindOf(a, t), h = this.isSortable(a, t), f = c.searchable ?? u === "text", b = (p) => ze(a.read(p), c.ownSortValue);
993
+ const { spec: c } = a, u = this.kindOf(a, t), h = this.isSortable(a, t), d = c.searchable ?? u === "text", m = (w) => ze(a.read(w), c.ownSortValue);
988
994
  return {
989
995
  id: c.id,
990
996
  label: c.label,
991
- value: h || f ? b : void 0,
997
+ value: h || d ? m : void 0,
992
998
  /* Text sorts with the provider's comparison, not with the built-in
993
999
  German one (spec, the table of defaults). */
994
- compare: u === "text" && !c.ownSortValue ? (p, k) => n.compareText(String(b(p)), String(b(k))) : void 0,
995
- searchable: f,
1000
+ compare: u === "text" && !c.ownSortValue ? (w, k) => n.compareText(String(m(w)), String(m(k))) : void 0,
1001
+ searchable: d,
996
1002
  hideable: !c.rowHeader,
997
1003
  resizable: c.resizable,
998
1004
  width: c.width
@@ -1103,10 +1109,10 @@ function pr(e, t, n) {
1103
1109
  const o = e.lines.slice(t, n);
1104
1110
  return { ...e, visibleLines: o, visible: Ze(o) };
1105
1111
  }
1106
- const Pt = /* @__PURE__ */ new WeakMap(), mr = (e, t) => {
1107
- Pt.set(e, t);
1108
- }, wr = (e) => typeof e == "function" || typeof e == "object" && e !== null ? Pt.get(e) : void 0, E = (...e) => e.filter(Boolean).join(" ");
1109
- function Gt({
1112
+ const Bt = /* @__PURE__ */ new WeakMap(), mr = (e, t) => {
1113
+ Bt.set(e, t);
1114
+ }, wr = (e) => typeof e == "function" || typeof e == "object" && e !== null ? Bt.get(e) : void 0, G = (...e) => e.filter(Boolean).join(" ");
1115
+ function Pt({
1110
1116
  entry: e,
1111
1117
  registry: t,
1112
1118
  hook: n,
@@ -1116,13 +1122,13 @@ function Gt({
1116
1122
  setOpen: i,
1117
1123
  panelId: a
1118
1124
  }) {
1119
- const c = U(), u = ue(), { id: h, label: f, format: b } = e.spec, { values: p, absent: k } = j(() => or(n.admitted, e.read, u), [n.admitted, e, u]), m = me(e.spec.filter);
1120
- if (!m) return null;
1121
- const w = n.publicSnapshot, g = m.Input, v = er(m) ? { absentOccurs: k, format: b, kind: t.kindOf(e, n.rows) } : {}, N = () => {
1122
- var C;
1123
- i(!1), (C = (r ?? o).current) == null || C.focus();
1125
+ const c = U(), u = ue(), { id: h, label: d, format: m } = e.spec, { values: w, absent: k } = $(() => or(n.admitted, e.read, u), [n.admitted, e, u]), p = me(e.spec.filter);
1126
+ if (!p) return null;
1127
+ const b = n.publicSnapshot, g = p.Input, _ = er(p) ? { absentOccurs: k, format: m, kind: t.kindOf(e, n.rows) } : {}, C = () => {
1128
+ var S;
1129
+ i(!1), (S = (r ?? o).current) == null || S.focus();
1124
1130
  };
1125
- return /* @__PURE__ */ L(
1131
+ return /* @__PURE__ */ O(
1126
1132
  St,
1127
1133
  {
1128
1134
  open: s,
@@ -1130,23 +1136,23 @@ function Gt({
1130
1136
  anchorRef: o,
1131
1137
  align: "end",
1132
1138
  role: "dialog",
1133
- ariaLabel: c.filterColumn(f),
1139
+ ariaLabel: c.filterColumn(d),
1134
1140
  id: a,
1135
- className: d.filterPanel,
1141
+ className: f.filterPanel,
1136
1142
  children: [
1137
1143
  /* @__PURE__ */ l(
1138
1144
  g,
1139
1145
  {
1140
- condition: w.filter[h] ?? null,
1141
- setCondition: (C) => w.setFilter(h, C),
1142
- values: p,
1143
- column: { id: h, label: f },
1144
- ...v
1146
+ condition: b.filter[h] ?? null,
1147
+ setCondition: (S) => b.setFilter(h, S),
1148
+ values: w,
1149
+ column: { id: h, label: d },
1150
+ ..._
1145
1151
  }
1146
1152
  ),
1147
- /* @__PURE__ */ L("div", { className: d.filterFooter, children: [
1148
- /* @__PURE__ */ l(ee, { size: "sm", variant: "ghost", onClick: () => w.setFilter(h, null), children: c.filterReset }),
1149
- /* @__PURE__ */ l(ee, { size: "sm", onClick: N, children: c.filterDone })
1153
+ /* @__PURE__ */ O("div", { className: f.filterFooter, children: [
1154
+ /* @__PURE__ */ l(ee, { size: "sm", variant: "ghost", onClick: () => b.setFilter(h, null), children: c.filterReset }),
1155
+ /* @__PURE__ */ l(ee, { size: "sm", onClick: C, children: c.filterDone })
1150
1156
  ] })
1151
1157
  ]
1152
1158
  }
@@ -1157,14 +1163,14 @@ function br({
1157
1163
  registry: t,
1158
1164
  hook: n
1159
1165
  }) {
1160
- const o = U(), [r, s] = z(!1), i = Z(null), a = se(), { id: c, label: u } = e.spec, h = c in n.publicSnapshot.filter;
1161
- return /* @__PURE__ */ L(J, { children: [
1166
+ const o = U(), [r, s] = H(!1), i = re(null), a = se(), { id: c, label: u } = e.spec, h = c in n.publicSnapshot.filter;
1167
+ return /* @__PURE__ */ O(Q, { children: [
1162
1168
  /* @__PURE__ */ l(
1163
1169
  "button",
1164
1170
  {
1165
1171
  ref: i,
1166
1172
  type: "button",
1167
- className: E(d.filterButton, h && d.filterActive),
1173
+ className: G(f.filterButton, h && f.filterActive),
1168
1174
  "aria-label": o.filterColumn(u),
1169
1175
  "aria-haspopup": "dialog",
1170
1176
  "aria-expanded": r,
@@ -1184,7 +1190,7 @@ function br({
1184
1190
  }
1185
1191
  ),
1186
1192
  /* @__PURE__ */ l(
1187
- Gt,
1193
+ Pt,
1188
1194
  {
1189
1195
  entry: e,
1190
1196
  registry: t,
@@ -1204,7 +1210,7 @@ function kr({ registry: e, hook: t }) {
1204
1210
  const u = { formats: o, wording: n, format: a.spec.format, kind: e.kindOf(a, t.rows) };
1205
1211
  return [{ entry: a, text: nr(c, i, u) }];
1206
1212
  });
1207
- return r.length === 0 ? null : /* @__PURE__ */ l(Nt, { "aria-label": n.conditions, className: d.conditions, children: r.map(({ entry: s, text: i }) => /* @__PURE__ */ l(vr, { entry: s, text: i, registry: e, hook: t }, s.spec.id)) });
1213
+ return r.length === 0 ? null : /* @__PURE__ */ l(Nt, { "aria-label": n.conditions, className: f.conditions, children: r.map(({ entry: s, text: i }) => /* @__PURE__ */ l(vr, { entry: s, text: i, registry: e, hook: t }, s.spec.id)) });
1208
1214
  }
1209
1215
  function vr({
1210
1216
  entry: e,
@@ -1212,36 +1218,36 @@ function vr({
1212
1218
  registry: n,
1213
1219
  hook: o
1214
1220
  }) {
1215
- const r = U(), [s, i] = z(!1), a = Z(null), c = Z(null), u = se(), { id: h, label: f } = e.spec;
1216
- return /* @__PURE__ */ L(J, { children: [
1221
+ const r = U(), [s, i] = H(!1), a = re(null), c = re(null), u = se(), { id: h, label: d } = e.spec;
1222
+ return /* @__PURE__ */ O(Q, { children: [
1217
1223
  /* @__PURE__ */ l(
1218
1224
  xt,
1219
1225
  {
1220
1226
  ref: a,
1221
- className: d.condition,
1227
+ className: f.condition,
1222
1228
  onRemove: () => o.publicSnapshot.setFilter(h, null),
1223
- removeLabel: r.removeConditionNamed(f, t),
1224
- children: /* @__PURE__ */ L(
1229
+ removeLabel: r.removeConditionNamed(d, t),
1230
+ children: /* @__PURE__ */ O(
1225
1231
  "button",
1226
1232
  {
1227
1233
  ref: c,
1228
1234
  type: "button",
1229
- className: d.conditionButton,
1230
- "aria-label": r.editConditionNamed(f, t),
1235
+ className: f.conditionButton,
1236
+ "aria-label": r.editConditionNamed(d, t),
1231
1237
  "aria-haspopup": "dialog",
1232
1238
  "aria-expanded": s,
1233
1239
  "aria-controls": s ? u : void 0,
1234
1240
  onClick: () => i(!s),
1235
1241
  children: [
1236
- /* @__PURE__ */ l("span", { className: d.filterLabel, children: f }),
1237
- /* @__PURE__ */ l("span", { className: d.filterValue, children: t })
1242
+ /* @__PURE__ */ l("span", { className: f.filterLabel, children: d }),
1243
+ /* @__PURE__ */ l("span", { className: f.filterValue, children: t })
1238
1244
  ]
1239
1245
  }
1240
1246
  )
1241
1247
  }
1242
1248
  ),
1243
1249
  /* @__PURE__ */ l(
1244
- Gt,
1250
+ Pt,
1245
1251
  {
1246
1252
  entry: e,
1247
1253
  registry: n,
@@ -1256,16 +1262,16 @@ function vr({
1256
1262
  ] });
1257
1263
  }
1258
1264
  const ft = ";", _r = `\r
1259
- `, yr = "\uFEFF", Cr = (e) => String(e).replace(".", ","), Et = (e) => /[";\r\n]/.test(e) ? `"${e.replace(/"/g, '""')}"` : e, Sr = (e, t) => {
1265
+ `, yr = "\uFEFF", Cr = (e) => String(e).replace(".", ","), Gt = (e) => /[";\r\n]/.test(e) ? `"${e.replace(/"/g, '""')}"` : e, Sr = (e, t) => {
1260
1266
  var o;
1261
1267
  const n = (o = t.value) == null ? void 0 : o.call(t, e);
1262
- return n == null ? "" : Et(typeof n == "number" ? Cr(n) : String(n));
1268
+ return n == null ? "" : Gt(typeof n == "number" ? Cr(n) : String(n));
1263
1269
  };
1264
1270
  function Nr(e, t) {
1265
- const n = t.map((r) => Et(r.label ?? r.id)).join(ft), o = e.map((r) => t.map((s) => Sr(r, s)).join(ft));
1271
+ const n = t.map((r) => Gt(r.label ?? r.id)).join(ft), o = e.map((r) => t.map((s) => Sr(r, s)).join(ft));
1266
1272
  return yr + [n, ...o].join(_r);
1267
1273
  }
1268
- function Bt(e) {
1274
+ function Et(e) {
1269
1275
  const t = new Map(e.orderedColumns().map((o) => [o.spec.id, o])), n = e.projection().columns.map((o) => t.get(o.id)).filter((o) => o !== void 0);
1270
1276
  return e.withStickyHeaderFirst(n.map((o) => ({ id: o.spec.id, e: o }))).map(({ e: o }) => o);
1271
1277
  }
@@ -1276,7 +1282,7 @@ function zt(e) {
1276
1282
  function xr(e) {
1277
1283
  const t = e.hook;
1278
1284
  if (!t) return "";
1279
- const n = Bt(e).filter((o) => e.kindOf(o, t.rows) !== "other" || o.spec.ownExportValue).map(
1285
+ const n = Et(e).filter((o) => e.kindOf(o, t.rows) !== "other" || o.spec.ownExportValue).map(
1280
1286
  (o) => ({
1281
1287
  id: o.spec.id,
1282
1288
  label: o.spec.label,
@@ -1293,21 +1299,21 @@ function Tr({ registry: e, hook: t }) {
1293
1299
  const n = U(), o = e.groupingEntries(t.rows);
1294
1300
  if (o.length === 0) return null;
1295
1301
  const { grouping: r, setGrouping: s } = t.publicSnapshot;
1296
- return /* @__PURE__ */ L("section", { className: d.groupingChoice, "aria-label": n.grouping, children: [
1297
- /* @__PURE__ */ l("h3", { className: d.groupingHeading, children: n.grouping }),
1298
- /* @__PURE__ */ l("div", { className: d.groupingOptions, children: o.map((i) => {
1302
+ return /* @__PURE__ */ O("section", { className: f.groupingChoice, "aria-label": n.grouping, children: [
1303
+ /* @__PURE__ */ l("h3", { className: f.groupingHeading, children: n.grouping }),
1304
+ /* @__PURE__ */ l("div", { className: f.groupingOptions, children: o.map((i) => {
1299
1305
  const { id: a, label: c } = i.spec, u = r.indexOf(a), h = u !== -1;
1300
- return /* @__PURE__ */ L(
1306
+ return /* @__PURE__ */ O(
1301
1307
  "button",
1302
1308
  {
1303
1309
  type: "button",
1304
- className: d.groupingOption,
1310
+ className: f.groupingOption,
1305
1311
  "aria-label": n.groupBy(c),
1306
1312
  "aria-pressed": h,
1307
1313
  disabled: !h && r.length >= Qe,
1308
- onClick: () => s(h ? r.filter((f) => f !== a) : [...r, a]),
1314
+ onClick: () => s(h ? r.filter((d) => d !== a) : [...r, a]),
1309
1315
  children: [
1310
- h && /* @__PURE__ */ l("span", { className: d.groupingLevel, "aria-hidden": "true", children: u + 1 }),
1316
+ h && /* @__PURE__ */ l("span", { className: f.groupingLevel, "aria-hidden": "true", children: u + 1 }),
1311
1317
  c
1312
1318
  ]
1313
1319
  },
@@ -1323,13 +1329,13 @@ function Fr({ registry: e, hook: t }) {
1323
1329
  return (
1324
1330
  /* In a tag group, as the conditions stand: the tag is one stop, its button
1325
1331
  the thing one tabs to, and the ring stands on the tag. */
1326
- /* @__PURE__ */ l(Nt, { "aria-label": n.groupedBy, className: d.groupingTag, children: /* @__PURE__ */ l(xt, { onRemove: () => o.setGrouping([]), removeLabel: n.removeGrouping, children: /* @__PURE__ */ L(
1332
+ /* @__PURE__ */ l(Nt, { "aria-label": n.groupedBy, className: f.groupingTag, children: /* @__PURE__ */ l(xt, { onRemove: () => o.setGrouping([]), removeLabel: n.removeGrouping, children: /* @__PURE__ */ O(
1327
1333
  At,
1328
1334
  {
1329
- trigger: /* @__PURE__ */ L("button", { type: "button", className: E(d.conditionButton, d.groupingTrigger), children: [
1330
- /* @__PURE__ */ l("span", { className: d.groupingPrefix, children: n.groupedBy }),
1331
- s.map((i, a) => /* @__PURE__ */ L("span", { className: d.groupingPath, children: [
1332
- a > 0 && /* @__PURE__ */ l("span", { className: d.groupingSeparator, "aria-hidden": "true", children: "›" }),
1335
+ trigger: /* @__PURE__ */ O("button", { type: "button", className: G(f.conditionButton, f.groupingTrigger), children: [
1336
+ /* @__PURE__ */ l("span", { className: f.groupingPrefix, children: n.groupedBy }),
1337
+ s.map((i, a) => /* @__PURE__ */ O("span", { className: f.groupingPath, children: [
1338
+ a > 0 && /* @__PURE__ */ l("span", { className: f.groupingSeparator, "aria-hidden": "true", children: "›" }),
1333
1339
  i
1334
1340
  ] }, r[a]))
1335
1341
  ] }),
@@ -1352,30 +1358,30 @@ function jt({
1352
1358
  const r = U(), s = ue(), i = (e == null ? void 0 : e.hook) ?? null;
1353
1359
  let a = null, c = null;
1354
1360
  if (e && i) {
1355
- const u = i.publicSnapshot, h = u.search !== "" || Object.keys(u.filter).length > 0, f = o ? [] : u.filtered.filter((p) => u.selection.isSelected(i.rowKey(p))), b = e.hasRowActions() ? e.actions.ordered().filter((p) => p.spec.bulk) : [];
1356
- a = /* @__PURE__ */ L(J, { children: [
1361
+ const u = i.publicSnapshot, h = u.search !== "" || Object.keys(u.filter).length > 0, d = o ? [] : u.filtered.filter((w) => u.selection.isSelected(i.rowKey(w))), m = e.hasRowActions() ? e.actions.ordered().filter((w) => w.spec.bulk) : [];
1362
+ a = /* @__PURE__ */ O(Q, { children: [
1357
1363
  /* @__PURE__ */ l(Fr, { registry: e, hook: i }),
1358
1364
  /* @__PURE__ */ l(kr, { registry: e, hook: i })
1359
- ] }), c = /* @__PURE__ */ L("div", { className: d.toolbarGroup, children: [
1360
- /* @__PURE__ */ l("span", { role: "status", className: d.filteredCount, children: h ? r.filteredOfTotal(s.count(u.filtered.length), s.count(i.admitted.length)) : "" }),
1365
+ ] }), c = /* @__PURE__ */ O("div", { className: f.toolbarGroup, children: [
1366
+ /* @__PURE__ */ l("span", { role: "status", className: f.filteredCount, children: h ? r.filteredOfTotal(s.count(u.filtered.length), s.count(i.admitted.length)) : "" }),
1361
1367
  h && /* @__PURE__ */ l(ee, { size: "sm", variant: "ghost", onClick: () => zt(u), children: r.resetAll }),
1362
- f.length > 0 && /* @__PURE__ */ L(J, { children: [
1363
- /* @__PURE__ */ l("span", { className: d.toolbarInfo, children: r.selectedCount(f.length, s.count(f.length)) }),
1364
- b.map(({ key: p, spec: k }) => /* @__PURE__ */ l(
1368
+ d.length > 0 && /* @__PURE__ */ O(Q, { children: [
1369
+ /* @__PURE__ */ l("span", { className: f.toolbarInfo, children: r.selectedCount(d.length, s.count(d.length)) }),
1370
+ m.map(({ key: w, spec: k }) => /* @__PURE__ */ l(
1365
1371
  ee,
1366
1372
  {
1367
1373
  size: "sm",
1368
1374
  variant: k.tone === "danger" ? "danger" : "secondary",
1369
- onClick: () => k.onSelect(f),
1375
+ onClick: () => k.onSelect(d),
1370
1376
  children: k.label
1371
1377
  },
1372
- p
1378
+ w
1373
1379
  ))
1374
1380
  ] })
1375
1381
  ] });
1376
1382
  }
1377
- return /* @__PURE__ */ L("div", { className: E(d.toolbar, t), children: [
1378
- /* @__PURE__ */ L("div", { className: d.toolbarGroup, children: [
1383
+ return /* @__PURE__ */ O("div", { className: G(f.toolbar, t), children: [
1384
+ /* @__PURE__ */ O("div", { className: f.toolbarGroup, children: [
1379
1385
  n,
1380
1386
  a
1381
1387
  ] }),
@@ -1396,8 +1402,8 @@ function xe(e) {
1396
1402
  return !n || !o ? null : { registry: n, snapshot: o, inside: !e && t !== null, footerTarget: e ? null : (t == null ? void 0 : t.footerTarget) ?? null };
1397
1403
  }
1398
1404
  function Ht({ wording: e }) {
1399
- return /* @__PURE__ */ L(J, { children: [
1400
- /* @__PURE__ */ l("span", { "aria-hidden": "true", className: d.absent, children: "—" }),
1405
+ return /* @__PURE__ */ O(Q, { children: [
1406
+ /* @__PURE__ */ l("span", { "aria-hidden": "true", className: f.absent, children: "—" }),
1401
1407
  /* @__PURE__ */ l(Re, { children: e.cellAbsentValue })
1402
1408
  ] });
1403
1409
  }
@@ -1419,25 +1425,25 @@ function Ke({
1419
1425
  }) {
1420
1426
  const { aggregate: s, format: i, presentation: a } = e.spec;
1421
1427
  if (!s) return null;
1422
- const c = typeof s == "function" ? "own" : s, u = Je({ id: e.spec.id, read: e.read, aggregate: s }, t), h = (p) => _e(p, i, n, o);
1423
- let f;
1424
- if (Y(u)) f = /* @__PURE__ */ l(Ht, { wording: o });
1428
+ const c = typeof s == "function" ? "own" : s, u = Xe({ id: e.spec.id, read: e.read, aggregate: s }, t), h = (w) => _e(w, i, n, o);
1429
+ let d;
1430
+ if (Y(u)) d = /* @__PURE__ */ l(Ht, { wording: o });
1425
1431
  else if (c === "range" && i === "date" && Mr(u)) {
1426
- const [p, k] = u;
1427
- f = p.getTime() === k.getTime() ? n.date(p) : o.rangeFromTo(n.dateShort(p), n.dateShort(k));
1428
- } else if (c === "count" || c === "distinct") f = n.count(u);
1432
+ const [w, k] = u;
1433
+ d = w.getTime() === k.getTime() ? n.date(w) : o.rangeFromTo(n.dateShort(w), n.dateShort(k));
1434
+ } else if (c === "count" || c === "distinct") d = n.count(u);
1429
1435
  else if (c === "range") {
1430
- const [p, k] = u;
1431
- f = h(p) === h(k) ? h(p) : o.rangeFromTo(h(p) ?? "", h(k) ?? "");
1432
- } else c === "own" && a ? f = a(u, t[0]) : f = h(u);
1433
- const b = Lr[c];
1434
- return /* @__PURE__ */ L(J, { children: [
1435
- r && b && /* @__PURE__ */ l("span", { "aria-hidden": "true", className: d.footerKind, children: b }),
1436
- r && /* @__PURE__ */ L(Re, { children: [
1436
+ const [w, k] = u;
1437
+ d = h(w) === h(k) ? h(w) : o.rangeFromTo(h(w) ?? "", h(k) ?? "");
1438
+ } else c === "own" && a ? d = a(u, t[0]) : d = h(u);
1439
+ const m = Lr[c];
1440
+ return /* @__PURE__ */ O(Q, { children: [
1441
+ r && m && /* @__PURE__ */ l("span", { "aria-hidden": "true", className: f.footerKind, children: m }),
1442
+ r && /* @__PURE__ */ O(Re, { children: [
1437
1443
  Rr(c, o),
1438
1444
  " "
1439
1445
  ] }),
1440
- f
1446
+ d
1441
1447
  ] });
1442
1448
  }
1443
1449
  const Mr = ([e, t]) => e instanceof Date && t instanceof Date && e.getFullYear() === t.getFullYear();
@@ -1464,8 +1470,8 @@ const Dr = (e) => {
1464
1470
  return t;
1465
1471
  };
1466
1472
  function Ir(e, t) {
1467
- const n = Z(null);
1468
- K(() => {
1473
+ const n = re(null);
1474
+ W(() => {
1469
1475
  const o = e.current;
1470
1476
  if (!o) return;
1471
1477
  const r = Dr(o), s = n.current;
@@ -1474,22 +1480,22 @@ function Ir(e, t) {
1474
1480
  if (i === 0 || typeof o.animate != "function") return;
1475
1481
  const a = getComputedStyle(o).getPropertyValue("--u-ease-out").trim() || "ease-out", c = Vr(s.positions, r);
1476
1482
  for (const u of Array.from(o.querySelectorAll("tbody > tr[data-motion]"))) {
1477
- const h = u.dataset.motion, f = c.get(h);
1478
- f !== void 0 ? u.animate([{ transform: `translateY(${f}px)` }, { transform: "none" }], { duration: i, easing: a }) : s.positions.has(h) || u.animate([{ opacity: 0, transform: "translateY(-4px)" }, { opacity: 1, transform: "none" }], { duration: i, easing: a });
1483
+ const h = u.dataset.motion, d = c.get(h);
1484
+ d !== void 0 ? u.animate([{ transform: `translateY(${d}px)` }, { transform: "none" }], { duration: i, easing: a }) : s.positions.has(h) || u.animate([{ opacity: 0, transform: "translateY(-4px)" }, { opacity: 1, transform: "none" }], { duration: i, easing: a });
1479
1485
  }
1480
1486
  });
1481
1487
  }
1482
- function Pr(e, t, n) {
1483
- const o = Z(t);
1484
- K(() => {
1488
+ function Br(e, t, n) {
1489
+ const o = re(t);
1490
+ W(() => {
1485
1491
  const r = e.current, s = o.current;
1486
1492
  if (o.current = t, !r || s === t || typeof r.animate != "function") return;
1487
1493
  const i = Kt(r, "--u-duration-medium");
1488
1494
  if (i === 0) return;
1489
1495
  const a = performance.now();
1490
1496
  let c = requestAnimationFrame(function u(h) {
1491
- const f = Math.min(1, (h - a) / i), b = 1 - (1 - f) ** 3;
1492
- r.textContent = n(Math.round(s + (t - s) * b)), f < 1 && (c = requestAnimationFrame(u));
1497
+ const d = Math.min(1, (h - a) / i), m = 1 - (1 - d) ** 3;
1498
+ r.textContent = n(Math.round(s + (t - s) * m)), d < 1 && (c = requestAnimationFrame(u));
1493
1499
  });
1494
1500
  return () => {
1495
1501
  cancelAnimationFrame(c), r.textContent = n(t);
@@ -1505,62 +1511,54 @@ function Ve(e, t, n, o) {
1505
1511
  }
1506
1512
  function We({ entry: e, group: t, formats: n, wording: o }) {
1507
1513
  const r = e == null ? void 0 : e.spec;
1508
- return t.value !== void 0 && (r != null && r.presentation) && !r.ownGroupValue && !r.group ? /* @__PURE__ */ l(J, { children: r.presentation(t.value, t.rows[0]) }) : /* @__PURE__ */ l(J, { children: Ve(e, t.value, n, o) });
1514
+ return t.value !== void 0 && (r != null && r.presentation) && !r.ownGroupValue && !r.group ? /* @__PURE__ */ l(Q, { children: r.presentation(t.value, t.rows[0]) }) : /* @__PURE__ */ l(Q, { children: Ve(e, t.value, n, o) });
1509
1515
  }
1510
1516
  function qe({
1511
1517
  group: e,
1512
1518
  parent: t,
1513
1519
  entry: n,
1514
1520
  open: o,
1515
- registry: r,
1516
- hook: s,
1517
- formats: i,
1518
- wording: a
1521
+ hook: r,
1522
+ formats: s,
1523
+ wording: i
1519
1524
  }) {
1520
- const c = Z(null);
1521
- K(() => {
1522
- c.current && r.takeFoldFocus(e.path) && c.current.focus();
1523
- });
1524
- const u = Ve(n, e.value, i, a), h = i.count(e.rows.length), f = () => {
1525
- r.requestFoldFocus(e.path), s.publicSnapshot.toggleFold(e.path);
1526
- }, b = (p) => {
1527
- if (p.altKey && (p.key === "ArrowLeft" || p.key === "ArrowRight")) {
1528
- p.preventDefault(), r.requestFoldFocus(e.path), gt(e, p.key === "ArrowLeft", s);
1525
+ const a = Ve(n, e.value, s, i), c = s.count(e.rows.length), u = () => r.publicSnapshot.toggleFold(e.path), h = (d) => {
1526
+ if (d.altKey && (d.key === "ArrowLeft" || d.key === "ArrowRight")) {
1527
+ d.preventDefault(), gt(e, d.key === "ArrowLeft", r);
1529
1528
  return;
1530
1529
  }
1531
- if (p.key === "ArrowRight" && !o)
1532
- p.preventDefault(), f();
1533
- else if (p.key === "ArrowLeft") {
1534
- if (p.preventDefault(), o) f();
1530
+ if (d.key === "ArrowRight" && !o)
1531
+ d.preventDefault(), u();
1532
+ else if (d.key === "ArrowLeft") {
1533
+ if (d.preventDefault(), o) u();
1535
1534
  else if (t) {
1536
- const k = p.currentTarget.closest("table"), m = Array.from((k == null ? void 0 : k.querySelectorAll("[data-fold-path]")) ?? []).find(
1537
- (w) => w.dataset.foldPath === t.path
1535
+ const m = d.currentTarget.closest("table"), w = Array.from((m == null ? void 0 : m.querySelectorAll("[data-fold-path]")) ?? []).find(
1536
+ (k) => k.dataset.foldPath === t.path
1538
1537
  );
1539
- m == null || m.focus();
1538
+ w == null || w.focus();
1540
1539
  }
1541
1540
  }
1542
1541
  };
1543
1542
  return /* @__PURE__ */ l(
1544
1543
  "button",
1545
1544
  {
1546
- ref: c,
1547
1545
  type: "button",
1548
- className: E(d.fold, !o && d.foldClosed),
1546
+ className: G(f.fold, !o && f.foldClosed),
1549
1547
  "data-fold-path": e.path,
1550
1548
  "aria-expanded": o,
1551
- "aria-label": o ? a.foldGroup(u, h) : a.unfoldGroup(u, h),
1552
- onKeyDown: b,
1553
- onClick: (p) => {
1554
- if (!p.altKey) return f();
1555
- r.requestFoldFocus(e.path), gt(e, o, s);
1549
+ "aria-label": o ? i.foldGroup(a, c) : i.unfoldGroup(a, c),
1550
+ onKeyDown: h,
1551
+ onClick: (d) => {
1552
+ if (!d.altKey) return u();
1553
+ gt(e, o, r);
1556
1554
  },
1557
1555
  children: /* @__PURE__ */ l("svg", { viewBox: "0 0 12 12", width: "12", height: "12", "aria-hidden": "true", children: /* @__PURE__ */ l("path", { d: "M3 4.5 6 7.5 9 4.5", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) })
1558
1556
  }
1559
1557
  );
1560
1558
  }
1561
- function Gr({ value: e, formats: t }) {
1562
- const n = Z(null);
1563
- return Pr(n, e, t.count), /* @__PURE__ */ l("span", { ref: n, className: d.groupCount, children: t.count(e) });
1559
+ function Pr({ value: e, formats: t }) {
1560
+ const n = re(null);
1561
+ return Br(n, e, t.count), /* @__PURE__ */ l("span", { ref: n, className: f.groupCount, children: t.count(e) });
1564
1562
  }
1565
1563
  function Ye({ group: e, entry: t, hook: n, formats: o, wording: r }) {
1566
1564
  const { selection: s } = n.publicSnapshot, i = e.rows.map(n.rowKey), a = i.filter((u) => s.isSelected(u)).length, c = a === i.length;
@@ -1585,24 +1583,23 @@ function gt(e, t, n) {
1585
1583
  for (const i of r)
1586
1584
  o.folded.includes(i.path) !== t && o.toggleFold(i.path);
1587
1585
  }
1588
- function Er({
1586
+ function Gr({
1589
1587
  line: e,
1590
1588
  entry: t,
1591
1589
  selectable: n,
1592
- registry: o,
1593
- hook: r,
1594
- formats: s,
1595
- wording: i
1590
+ hook: o,
1591
+ formats: r,
1592
+ wording: s
1596
1593
  }) {
1597
- const a = e.span;
1598
- return /* @__PURE__ */ l("td", { className: E(d.td, d.spanCell), children: e.first && /* @__PURE__ */ L("span", { className: d.spanValue, children: [
1599
- n && /* @__PURE__ */ l("span", { className: d.spanSelect, children: /* @__PURE__ */ l(Ye, { group: a, entry: t, hook: r, formats: s, wording: i }) }),
1600
- /* @__PURE__ */ l(qe, { group: a, parent: e.parents.at(-1), entry: t, open: !0, registry: o, hook: r, formats: s, wording: i }),
1601
- /* @__PURE__ */ L("span", { className: d.spanText, title: Ve(t, a.value, s, i), children: [
1602
- /* @__PURE__ */ l(We, { entry: t, group: a, formats: s, wording: i }),
1603
- e.continued && /* @__PURE__ */ l("span", { className: d.continued, children: i.groupContinued })
1594
+ const i = e.span;
1595
+ return /* @__PURE__ */ l("td", { className: G(f.td, f.spanCell), children: e.first && /* @__PURE__ */ O("span", { className: f.spanValue, children: [
1596
+ n && /* @__PURE__ */ l("span", { className: f.spanSelect, children: /* @__PURE__ */ l(Ye, { group: i, entry: t, hook: o, formats: r, wording: s }) }),
1597
+ /* @__PURE__ */ l(qe, { group: i, parent: e.parents.at(-1), entry: t, open: !0, hook: o, formats: r, wording: s }),
1598
+ /* @__PURE__ */ O("span", { className: f.spanText, title: Ve(t, i.value, r, s), children: [
1599
+ /* @__PURE__ */ l(We, { entry: t, group: i, formats: r, wording: s }),
1600
+ e.continued && /* @__PURE__ */ l("span", { className: f.continued, children: s.groupContinued })
1604
1601
  ] }),
1605
- /* @__PURE__ */ l("span", { className: d.groupCount, children: s.count(a.rows.length) })
1602
+ /* @__PURE__ */ l("span", { className: f.groupCount, children: r.count(i.rows.length) })
1606
1603
  ] }) });
1607
1604
  }
1608
1605
  function pt({
@@ -1617,64 +1614,64 @@ function pt({
1617
1614
  hasActions: c,
1618
1615
  total: u,
1619
1616
  siblings: h,
1620
- depth: f,
1621
- registry: b,
1622
- hook: p,
1623
- formats: k,
1624
- wording: m
1617
+ depth: d,
1618
+ hook: m,
1619
+ formats: w,
1620
+ wording: k
1625
1621
  }) {
1626
- const { group: w } = e, g = e.kind === "header", v = g && !p.publicSnapshot.folded.includes(w.path), N = s.findIndex((S) => S.spec.aggregate !== void 0), C = N === -1 ? s.length : N, D = s.slice(C), T = s.find((S) => S.spec.aggregate === "sum" && S.spec.share !== !1), x = n !== void 0, _ = /* @__PURE__ */ L("span", { className: d.groupLabel, children: [
1627
- /* @__PURE__ */ l(qe, { group: w, parent: e.parents.at(-1), entry: r, open: v, registry: b, hook: p, formats: k, wording: m }),
1628
- /* @__PURE__ */ l("span", { className: d.groupValue, children: /* @__PURE__ */ l(We, { entry: r, group: w, formats: k, wording: m }) }),
1629
- /* @__PURE__ */ l(Gr, { value: w.rows.length, formats: k }),
1630
- g && e.continued && /* @__PURE__ */ l("span", { className: d.continued, children: m.groupContinued })
1622
+ const { group: p } = e, b = e.kind === "header", g = b && !m.publicSnapshot.folded.includes(p.path), _ = s.findIndex((v) => v.spec.aggregate !== void 0), C = _ === -1 ? s.length : _, S = s.slice(C), I = s.find((v) => v.spec.aggregate === "sum" && v.spec.share !== !1), x = n !== void 0, A = /* @__PURE__ */ O("span", { className: f.groupLabel, children: [
1623
+ /* @__PURE__ */ l(qe, { group: p, parent: e.parents.at(-1), entry: r, open: g, hook: m, formats: w, wording: k }),
1624
+ /* @__PURE__ */ l("span", { className: f.groupValue, children: /* @__PURE__ */ l(We, { entry: r, group: p, formats: w, wording: k }) }),
1625
+ /* @__PURE__ */ l(Pr, { value: p.rows.length, formats: w }),
1626
+ b && e.continued && /* @__PURE__ */ l("span", { className: f.continued, children: k.groupContinued })
1631
1627
  ] });
1632
- return /* @__PURE__ */ L(
1628
+ return /* @__PURE__ */ O(
1633
1629
  "tr",
1634
1630
  {
1635
- className: E(g ? d.groupHeader : d.groupFolded, x && d.virtualRow),
1631
+ className: G(b ? f.groupHeader : f.groupFolded, x && f.virtualRow),
1636
1632
  "data-line": e.kind,
1637
- "data-level": w.level,
1638
- "data-motion": n !== void 0 || !(g && e.continued) ? `${e.kind}:${w.path}` : void 0,
1639
- "data-continued": g && e.continued ? "" : void 0,
1640
- "data-group-first": g ? void 0 : "",
1633
+ "data-level": p.level,
1634
+ "data-motion": n !== void 0 || !(b && e.continued) ? `${e.kind}:${p.path}` : void 0,
1635
+ "data-continued": b && e.continued ? "" : void 0,
1636
+ "data-group-first": b ? void 0 : "",
1637
+ "data-group": p.path,
1641
1638
  "data-row": x ? n : void 0,
1642
1639
  "aria-rowindex": x ? n + 2 : void 0,
1643
1640
  "data-index": t,
1644
- style: g ? { "--u-header-level": w.level } : void 0,
1645
- "aria-level": g ? w.level + 1 : f,
1646
- "aria-expanded": v,
1647
- "aria-posinset": h.indexOf(w) + 1 || void 0,
1641
+ style: b ? { "--u-header-level": p.level } : void 0,
1642
+ "aria-level": b ? p.level + 1 : d,
1643
+ "aria-expanded": g,
1644
+ "aria-posinset": h.indexOf(p) + 1 || void 0,
1648
1645
  "aria-setsize": h.length || void 0,
1649
1646
  children: [
1650
- Array.from({ length: i }, (S, O) => /* @__PURE__ */ l("td", { className: E(d.td, d.control), children: O === 0 && a && g && /* @__PURE__ */ l(Ye, { group: w, entry: r, hook: p, formats: k, wording: m }) }, `c${O}`)),
1651
- g ? /* @__PURE__ */ l("td", { className: d.td, colSpan: (o ? 1 : 0) + C, style: { paddingLeft: `calc(var(--u-space-3) + ${w.level * 20}px)` }, children: _ }) : /* @__PURE__ */ L(J, { children: [
1652
- /* @__PURE__ */ l("td", { className: E(d.td, d.spanCell), children: /* @__PURE__ */ L("span", { className: d.spanValue, children: [
1653
- a && /* @__PURE__ */ l("span", { className: d.spanSelect, children: /* @__PURE__ */ l(Ye, { group: w, entry: o, hook: p, formats: k, wording: m }) }),
1654
- /* @__PURE__ */ l(qe, { group: w, parent: e.parents.at(-1), entry: o, open: !1, registry: b, hook: p, formats: k, wording: m }),
1655
- /* @__PURE__ */ l("span", { className: d.spanText, children: /* @__PURE__ */ l(We, { entry: o, group: w, formats: k, wording: m }) }),
1656
- /* @__PURE__ */ l("span", { className: d.groupCount, children: k.count(w.rows.length) })
1647
+ Array.from({ length: i }, (v, F) => /* @__PURE__ */ l("td", { className: G(f.td, f.control), children: F === 0 && a && b && /* @__PURE__ */ l(Ye, { group: p, entry: r, hook: m, formats: w, wording: k }) }, `c${F}`)),
1648
+ b ? /* @__PURE__ */ l("td", { className: f.td, colSpan: (o ? 1 : 0) + C, style: { paddingLeft: `calc(var(--u-space-3) + ${p.level * 20}px)` }, children: A }) : /* @__PURE__ */ O(Q, { children: [
1649
+ /* @__PURE__ */ l("td", { className: G(f.td, f.spanCell), children: /* @__PURE__ */ O("span", { className: f.spanValue, children: [
1650
+ a && /* @__PURE__ */ l("span", { className: f.spanSelect, children: /* @__PURE__ */ l(Ye, { group: p, entry: o, hook: m, formats: w, wording: k }) }),
1651
+ /* @__PURE__ */ l(qe, { group: p, parent: e.parents.at(-1), entry: o, open: !1, hook: m, formats: w, wording: k }),
1652
+ /* @__PURE__ */ l("span", { className: f.spanText, children: /* @__PURE__ */ l(We, { entry: o, group: p, formats: w, wording: k }) }),
1653
+ /* @__PURE__ */ l("span", { className: f.groupCount, children: w.count(p.rows.length) })
1657
1654
  ] }) }),
1658
- C > 0 && /* @__PURE__ */ l("td", { className: E(d.td, d.foldedCount), colSpan: C, children: m.entries(w.rows.length, k.count(w.rows.length)) })
1655
+ C > 0 && /* @__PURE__ */ l("td", { className: G(f.td, f.foldedCount), colSpan: C, children: k.entries(p.rows.length, w.count(p.rows.length)) })
1659
1656
  ] }),
1660
- D.map((S) => /* @__PURE__ */ l(
1661
- Br,
1657
+ S.map((v) => /* @__PURE__ */ l(
1658
+ Er,
1662
1659
  {
1663
- entry: S,
1664
- group: w,
1665
- share: g && S === T,
1660
+ entry: v,
1661
+ group: p,
1662
+ share: b && v === I,
1666
1663
  total: u,
1667
- formats: k,
1668
- wording: m
1664
+ formats: w,
1665
+ wording: k
1669
1666
  },
1670
- S.key
1667
+ v.key
1671
1668
  )),
1672
- c && /* @__PURE__ */ l("td", { className: d.td })
1669
+ c && /* @__PURE__ */ l("td", { className: f.td })
1673
1670
  ]
1674
1671
  }
1675
1672
  );
1676
1673
  }
1677
- function Br({
1674
+ function Er({
1678
1675
  entry: e,
1679
1676
  group: t,
1680
1677
  share: n,
@@ -1683,16 +1680,16 @@ function Br({
1683
1680
  wording: s
1684
1681
  }) {
1685
1682
  const { spec: i } = e;
1686
- if (!i.aggregate) return /* @__PURE__ */ l("td", { className: d.td });
1683
+ if (!i.aggregate) return /* @__PURE__ */ l("td", { className: f.td });
1687
1684
  let a = null;
1688
1685
  if (n && i.aggregate === "sum" && i.share !== !1) {
1689
- const c = Je({ id: i.id, read: e.read, aggregate: "sum" }, o), u = t.aggregates[i.id];
1686
+ const c = Xe({ id: i.id, read: e.read, aggregate: "sum" }, o), u = t.aggregates[i.id];
1690
1687
  if (typeof c == "number" && c > 0 && typeof u == "number" && u > 0) {
1691
1688
  const h = Math.min(1, u / c);
1692
- a = /* @__PURE__ */ l("span", { className: d.shareBar, style: { width: `${Math.max(2, Math.round(h * 64))}px` }, "aria-hidden": "true" });
1689
+ a = /* @__PURE__ */ l("span", { className: f.shareBar, style: { width: `${Math.max(2, Math.round(h * 64))}px` }, "aria-hidden": "true" });
1693
1690
  }
1694
1691
  }
1695
- return /* @__PURE__ */ l("td", { className: E(d.td, $t(e, t.rows) && d.numeric, d.aggregateCell), "data-aggregate": typeof i.aggregate == "function" ? "own" : i.aggregate, children: a ? /* @__PURE__ */ L("span", { className: d.shareHost, children: [
1692
+ return /* @__PURE__ */ l("td", { className: G(f.td, $t(e, t.rows) && f.numeric, f.aggregateCell), "data-aggregate": typeof i.aggregate == "function" ? "own" : i.aggregate, children: a ? /* @__PURE__ */ O("span", { className: f.shareHost, children: [
1696
1693
  /* @__PURE__ */ l(Ke, { entry: e, rows: t.rows, formats: r, wording: s }),
1697
1694
  a
1698
1695
  ] }) : /* @__PURE__ */ l(Ke, { entry: e, rows: t.rows, formats: r, wording: s }) });
@@ -1730,40 +1727,40 @@ function jr(e, t, n, o, r) {
1730
1727
  const Oe = 34;
1731
1728
  function Hr(e) {
1732
1729
  function t(c) {
1733
- const u = se(), h = Ue($e), f = zr(c);
1734
- return e.registerColumn(u, f), K(
1730
+ const u = se(), h = Ue($e), d = zr(c);
1731
+ return e.registerColumn(u, d), W(
1735
1732
  () => () => {
1736
1733
  e.removeColumn(u), e.commit();
1737
1734
  },
1738
1735
  [u]
1739
- ), K(() => {
1740
- e.ensureColumn(u, f), e.checkOrder(), e.commit();
1736
+ ), W(() => {
1737
+ e.ensureColumn(u, d), e.checkOrder(), e.commit();
1741
1738
  }), Mt && h && h.registry !== e && pe(
1742
- `foreign:${f.id}`,
1743
- `The column "${f.id}" comes from a different useTable call than the table it stands in. It reads the rows of its own hook.`
1739
+ `foreign:${d.id}`,
1740
+ `The column "${d.id}" comes from a different useTable call than the table it stands in. It reads the rows of its own hook.`
1744
1741
  ), /* @__PURE__ */ l("span", { hidden: !0, "data-umriss-column": u });
1745
1742
  }
1746
1743
  function n({ children: c }) {
1747
1744
  const u = se();
1748
- return e.registerDetail(u, c), K(
1745
+ return e.registerDetail(u, c), W(
1749
1746
  () => () => {
1750
1747
  e.removeDetail(u), e.commit();
1751
1748
  },
1752
1749
  [u]
1753
- ), K(() => {
1750
+ ), W(() => {
1754
1751
  e.detail || e.registerDetail(u, c), e.commit();
1755
1752
  }), null;
1756
1753
  }
1757
1754
  function o({ children: c }) {
1758
1755
  const u = se();
1759
- return e.registerActionGroup(u), K(
1756
+ return e.registerActionGroup(u), W(
1760
1757
  () => () => {
1761
1758
  e.removeActionGroup(u), e.commit();
1762
1759
  },
1763
1760
  [u]
1764
- ), K(() => {
1761
+ ), W(() => {
1765
1762
  e.registerActionGroup(u), e.commit();
1766
- }), /* @__PURE__ */ l(J, { children: c });
1763
+ }), /* @__PURE__ */ l(Q, { children: c });
1767
1764
  }
1768
1765
  function r(c) {
1769
1766
  const u = se(), h = {
@@ -1772,17 +1769,17 @@ function Hr(e) {
1772
1769
  tone: c.tone ?? "default",
1773
1770
  onSelect: c.onSelect
1774
1771
  };
1775
- return e.registerAction(u, h), K(
1772
+ return e.registerAction(u, h), W(
1776
1773
  () => () => {
1777
1774
  e.removeAction(u), e.commit();
1778
1775
  },
1779
1776
  [u]
1780
- ), K(() => {
1777
+ ), W(() => {
1781
1778
  e.ensureAction(u, h), e.checkOrder(), e.commit();
1782
1779
  }), /* @__PURE__ */ l("span", { hidden: !0, "data-umriss-action": u });
1783
1780
  }
1784
1781
  function s(c) {
1785
- const u = se(), h = typeof c.value == "string" ? c.value : void 0, b = {
1782
+ const u = se(), h = typeof c.value == "string" ? c.value : void 0, m = {
1786
1783
  id: c.id ?? h ?? c.label,
1787
1784
  label: c.label,
1788
1785
  value: c.value,
@@ -1792,27 +1789,27 @@ function Hr(e) {
1792
1789
  group: c.group,
1793
1790
  groupable: !0
1794
1791
  };
1795
- return e.registerGroupKey(u, b), K(
1792
+ return e.registerGroupKey(u, m), W(
1796
1793
  () => () => {
1797
1794
  e.removeGroupKey(u), e.commit();
1798
1795
  },
1799
1796
  [u]
1800
- ), K(() => {
1801
- e.ensureGroupKey(u, b), e.checkOrder(), e.commit();
1797
+ ), W(() => {
1798
+ e.ensureGroupKey(u, m), e.checkOrder(), e.commit();
1802
1799
  }), /* @__PURE__ */ l("span", { hidden: !0, "data-umriss-groupkey": u });
1803
1800
  }
1804
1801
  function i(c) {
1805
1802
  e.beginPass(), e.setStickyRowHeader(c.stickyRowHeader === !0), e.setTableGroupable(c.groupable !== !1);
1806
- const u = Z(null), [h, f] = z(null);
1807
- K(() => {
1803
+ const u = re(null), [h, d] = H(null);
1804
+ W(() => {
1808
1805
  e.children = u.current, e.checkOrder(), e.commit();
1809
1806
  });
1810
- const b = j(() => ({ registry: e, footerTarget: h }), [h]);
1811
- return /* @__PURE__ */ l($e.Provider, { value: b, children: /* @__PURE__ */ L("div", { className: E(d.frame, c.className), children: [
1812
- /* @__PURE__ */ l("div", { ref: u, className: d.children, children: c.children }),
1807
+ const m = $(() => ({ registry: e, footerTarget: h }), [h]);
1808
+ return /* @__PURE__ */ l($e.Provider, { value: m, children: /* @__PURE__ */ O("div", { className: G(f.frame, c.className), children: [
1809
+ /* @__PURE__ */ l("div", { ref: u, className: f.children, children: c.children }),
1813
1810
  /* @__PURE__ */ l($r, { registry: e }),
1814
1811
  /* @__PURE__ */ l(Kr, { registry: e, props: c }),
1815
- /* @__PURE__ */ l("div", { ref: f, className: d.footerTarget })
1812
+ /* @__PURE__ */ l("div", { ref: d, className: f.footerTarget })
1816
1813
  ] }) });
1817
1814
  }
1818
1815
  const a = { Table: i, Column: t, RowDetail: n, RowActions: o, Action: r, GroupBy: s };
@@ -1832,199 +1829,205 @@ function Kr({ registry: e, props: t }) {
1832
1829
  empty: c,
1833
1830
  loading: u = !1,
1834
1831
  rowProps: h,
1835
- ariaLabel: f
1832
+ ariaLabel: d
1836
1833
  } = t;
1837
1834
  Le(e.subscribe, e.bodyVersion, e.bodyVersion);
1838
- const b = U(), p = ue(), k = Tt(i, "regular"), m = se(), w = Z(null);
1839
- K(() => {
1840
- var H, M;
1841
- const y = w.current;
1835
+ const m = U(), w = ue(), k = Tt(i, "regular"), p = se(), b = re(null);
1836
+ W(() => {
1837
+ var j, M;
1838
+ const y = b.current;
1842
1839
  if (!y || !o) return;
1843
- const R = ((H = y.tHead) == null ? void 0 : H.getBoundingClientRect().height) ?? 0, q = ((M = y.querySelector("tr[data-line='header']")) == null ? void 0 : M.getBoundingClientRect().height) ?? 0;
1844
- y.style.setProperty("--u-table-head", `${R}px`), y.style.setProperty("--u-table-group-header", `${q}px`), y.parentElement && mt(y.parentElement);
1840
+ const R = ((j = y.tHead) == null ? void 0 : j.getBoundingClientRect().height) ?? 0, K = ((M = y.querySelector("tr[data-line='header']")) == null ? void 0 : M.getBoundingClientRect().height) ?? 0;
1841
+ y.style.setProperty("--u-table-head", `${R}px`), y.style.setProperty("--u-table-group-header", `${K}px`), y.parentElement && mt(y.parentElement);
1842
+ }), W(() => {
1843
+ const y = e.takeFocusBeforeFold(), R = b.current;
1844
+ if (!y || !R || y.table !== R || y.element.isConnected) return;
1845
+ const K = Array.from(R.querySelectorAll("[data-fold-path]")), j = JSON.parse(y.group);
1846
+ for (let M = j.length; M > 0; M--) {
1847
+ const J = JSON.stringify(j.slice(0, M)), Z = K.find((T) => T.dataset.foldPath === J);
1848
+ if (Z) return Z.focus();
1849
+ }
1845
1850
  });
1846
1851
  const g = e.hook && !e.hook.companion.virtual ? e.hook.publicSnapshot : null;
1847
- Ir(w, g ? `${g.grouping.join("|")}#${g.folded.join("|")}` : "");
1848
- const v = e.hook;
1849
- if (!v) return null;
1850
- const N = v.publicSnapshot, C = e.projection(), D = e.rowHeader(), T = Bt(e), x = e.detail, _ = e.hasRowActions() ? e.actions.ordered() : [], S = v.companion.virtual, O = N.grouping, A = O.length > 0 ? C.visibleLines : void 0, I = A ? e.groupingEntries(v.rows) : [], $ = (y) => I.find((R) => R.spec.id === y), G = A && O.length > 1 ? $(O.at(-1)) : void 0, W = A ? T.filter((y) => !O.includes(y.spec.id)) : T, ie = (n ? 1 : 0) + (x ? 1 : 0), ae = ie + (G ? 1 : 0) + W.length + (_.length > 0 ? 1 : 0), de = ie * Oe, fe = (y) => r && y === D, we = C.visible, be = !u && W.some((y) => y.spec.aggregate), ye = N.search !== "" || Object.keys(N.filter).length > 0, le = (y, R, q, H) => /* @__PURE__ */ l(
1852
+ Ir(b, g ? `${g.grouping.join("|")}#${g.folded.join("|")}` : "");
1853
+ const _ = e.hook;
1854
+ if (!_) return null;
1855
+ const C = _.publicSnapshot, S = e.projection(), I = e.rowHeader(), x = Et(e), A = e.detail, v = e.hasRowActions() ? e.actions.ordered() : [], F = _.companion.virtual, L = C.grouping, N = L.length > 0 ? S.visibleLines : void 0, V = N ? e.groupingEntries(_.rows) : [], z = (y) => V.find((R) => R.spec.id === y), P = N && L.length > 1 ? z(L.at(-1)) : void 0, q = N ? x.filter((y) => !L.includes(y.spec.id)) : x, ie = (n ? 1 : 0) + (A ? 1 : 0), ae = ie + (P ? 1 : 0) + q.length + (v.length > 0 ? 1 : 0), de = ie * Oe, fe = (y) => r && y === I, we = S.visible, be = !u && q.some((y) => y.spec.aggregate), ye = C.search !== "" || Object.keys(C.filter).length > 0, le = (y, R, K, j) => /* @__PURE__ */ l(
1851
1856
  Wr,
1852
1857
  {
1853
1858
  row: y,
1854
1859
  index: R,
1855
- absolute: S ? q : void 0,
1860
+ absolute: F ? K : void 0,
1856
1861
  registry: e,
1857
- hook: v,
1858
- columns: W,
1859
- line: H,
1860
- spanEntry: G,
1861
- header: D,
1862
+ hook: _,
1863
+ columns: q,
1864
+ line: j,
1865
+ spanEntry: P,
1866
+ header: I,
1862
1867
  selectable: n,
1863
- actions: _,
1868
+ actions: v,
1864
1869
  stickyRowHeader: r,
1865
1870
  rowHeaderLeft: de,
1866
1871
  columnCount: ae,
1867
1872
  rowProps: h,
1868
- baseId: m,
1869
- formats: p,
1870
- wording: b
1873
+ baseId: p,
1874
+ formats: w,
1875
+ wording: m
1871
1876
  },
1872
- v.rowKey(y)
1877
+ _.rowKey(y)
1873
1878
  );
1874
1879
  let te;
1875
1880
  if (u)
1876
- te = /* @__PURE__ */ l("tbody", { children: /* @__PURE__ */ l(Jr, { columns: ae }) });
1877
- else if (C.filtered.length === 0)
1878
- te = /* @__PURE__ */ l("tbody", { children: /* @__PURE__ */ l("tr", { children: /* @__PURE__ */ l("td", { colSpan: ae, className: d.emptyCell, children: /* @__PURE__ */ l("div", { className: d.empty, children: v.admitted.length > 0 && ye ? /* @__PURE__ */ L(J, { children: [
1879
- /* @__PURE__ */ l("p", { className: d.emptyTitle, children: b.nothingMatchesFilters }),
1880
- /* @__PURE__ */ l(ee, { size: "sm", variant: "ghost", onClick: () => zt(N), children: b.resetAll })
1881
- ] }) : c ?? /* @__PURE__ */ l("p", { className: d.emptyTitle, children: b.noEntries }) }) }) }) });
1882
- else if (A) {
1883
- const y = S ? Rt(A).map((M) => M.kind === "folded" || !M.continued ? M : { ...M, continued: !1 }) : A, R = y.length - A.length, q = S && S.from > 0 ? S.fillerBefore / S.from : 0, H = (M, Q) => {
1884
- var V, B;
1885
- const ne = Q - R, F = S ? S.from + ne : ne;
1886
- return ne < 0 ? M.kind === "row" ? null : /* @__PURE__ */ l(
1881
+ te = /* @__PURE__ */ l("tbody", { children: /* @__PURE__ */ l(Xr, { columns: ae }) });
1882
+ else if (S.filtered.length === 0)
1883
+ te = /* @__PURE__ */ l("tbody", { children: /* @__PURE__ */ l("tr", { children: /* @__PURE__ */ l("td", { colSpan: ae, className: f.emptyCell, children: /* @__PURE__ */ l("div", { className: f.empty, children: _.admitted.length > 0 && ye ? /* @__PURE__ */ O(Q, { children: [
1884
+ /* @__PURE__ */ l("p", { className: f.emptyTitle, children: m.nothingMatchesFilters }),
1885
+ /* @__PURE__ */ l(ee, { size: "sm", variant: "ghost", onClick: () => zt(C), children: m.resetAll })
1886
+ ] }) : c ?? /* @__PURE__ */ l("p", { className: f.emptyTitle, children: m.noEntries }) }) }) }) });
1887
+ else if (N) {
1888
+ const y = F ? Rt(N).map((M) => M.kind === "folded" || !M.continued ? M : { ...M, continued: !1 }) : N, R = y.length - N.length, K = F && F.from > 0 ? F.fillerBefore / F.from : 0, j = (M, J) => {
1889
+ var D, E;
1890
+ const Z = J - R, T = F ? F.from + Z : Z;
1891
+ return Z < 0 ? M.kind === "row" ? null : /* @__PURE__ */ l(
1887
1892
  pt,
1888
1893
  {
1889
1894
  line: M,
1890
- index: Q,
1895
+ index: J,
1891
1896
  absolute: void 0,
1892
- spanEntry: G,
1893
- levelEntry: $(O[M.group.level]),
1894
- columns: W,
1897
+ spanEntry: P,
1898
+ levelEntry: z(L[M.group.level]),
1899
+ columns: q,
1895
1900
  controlColumns: ie,
1896
1901
  selectable: n,
1897
- hasActions: _.length > 0,
1898
- total: C.filtered,
1899
- siblings: ((V = M.parents.at(-1)) == null ? void 0 : V.groups) ?? C.groups ?? [],
1900
- depth: O.length,
1901
- registry: e,
1902
- hook: v,
1903
- formats: p,
1904
- wording: b
1902
+ hasActions: v.length > 0,
1903
+ total: S.filtered,
1904
+ siblings: ((D = M.parents.at(-1)) == null ? void 0 : D.groups) ?? S.groups ?? [],
1905
+ depth: L.length,
1906
+ hook: _,
1907
+ formats: w,
1908
+ wording: m
1905
1909
  },
1906
1910
  `${M.kind}:${M.group.path}:repeated`
1907
- ) : M.kind === "row" ? le(M.row, ne, F, M) : /* @__PURE__ */ l(
1911
+ ) : M.kind === "row" ? le(M.row, Z, T, M) : /* @__PURE__ */ l(
1908
1912
  pt,
1909
1913
  {
1910
1914
  line: M,
1911
- index: ne,
1912
- absolute: S ? F : void 0,
1913
- spanEntry: G,
1914
- levelEntry: $(O[M.group.level]),
1915
- columns: W,
1915
+ index: Z,
1916
+ absolute: F ? T : void 0,
1917
+ spanEntry: P,
1918
+ levelEntry: z(L[M.group.level]),
1919
+ columns: q,
1916
1920
  controlColumns: ie,
1917
1921
  selectable: n,
1918
- hasActions: _.length > 0,
1919
- total: C.filtered,
1920
- siblings: ((B = M.parents.at(-1)) == null ? void 0 : B.groups) ?? C.groups ?? [],
1921
- depth: O.length,
1922
- registry: e,
1923
- hook: v,
1924
- formats: p,
1925
- wording: b
1922
+ hasActions: v.length > 0,
1923
+ total: S.filtered,
1924
+ siblings: ((E = M.parents.at(-1)) == null ? void 0 : E.groups) ?? S.groups ?? [],
1925
+ depth: L.length,
1926
+ hook: _,
1927
+ formats: w,
1928
+ wording: m
1926
1929
  },
1927
1930
  `${M.kind}:${M.group.path}${M.kind === "header" && M.continued ? ":continued" : ""}`
1928
1931
  );
1929
1932
  };
1930
- te = S ? /* @__PURE__ */ l(
1933
+ te = F ? /* @__PURE__ */ l(
1931
1934
  kt,
1932
1935
  {
1933
- virtual: { ...S, fillerBefore: Math.max(0, S.fillerBefore - R * q) },
1936
+ virtual: { ...F, fillerBefore: Math.max(0, F.fillerBefore - R * K) },
1934
1937
  colSpan: ae,
1935
- children: y.map(H)
1938
+ children: y.map(j)
1936
1939
  }
1937
- ) : /* @__PURE__ */ l("tbody", { children: A.map(H) });
1938
- } else S ? te = /* @__PURE__ */ l(kt, { virtual: S, colSpan: ae, children: we.map((y, R) => le(y, R, S.from + R)) }) : te = /* @__PURE__ */ l("tbody", { children: we.map((y, R) => le(y, R, R)) });
1940
+ ) : /* @__PURE__ */ l("tbody", { children: N.map(j) });
1941
+ } else F ? te = /* @__PURE__ */ l(kt, { virtual: F, colSpan: ae, children: we.map((y, R) => le(y, R, F.from + R)) }) : te = /* @__PURE__ */ l("tbody", { children: we.map((y, R) => le(y, R, R)) });
1939
1942
  return /* @__PURE__ */ l(
1940
1943
  "div",
1941
1944
  {
1942
- ref: S == null ? void 0 : S.scrollRef,
1945
+ ref: F == null ? void 0 : F.scrollRef,
1943
1946
  onScroll: (y) => {
1944
- S == null || S.onScroll(), A && o && mt(y.currentTarget);
1947
+ F == null || F.onScroll(), N && o && mt(y.currentTarget);
1945
1948
  },
1946
- className: d.scroll,
1949
+ className: f.scroll,
1947
1950
  style: a ? { maxHeight: a } : void 0,
1948
- children: /* @__PURE__ */ L(
1951
+ children: /* @__PURE__ */ O(
1949
1952
  "table",
1950
1953
  {
1951
- ref: w,
1952
- role: A ? "treegrid" : void 0,
1953
- "data-depth": A ? O.length : void 0,
1954
- style: A ? { "--u-header-levels": O.length - 1 } : void 0,
1955
- "aria-label": f,
1956
- "aria-rowcount": S ? (C.lines ?? C.filtered).length + 1 + (be ? 1 : 0) : void 0,
1954
+ ref: b,
1955
+ role: N ? "treegrid" : void 0,
1956
+ "data-depth": N ? L.length : void 0,
1957
+ style: N ? { "--u-header-levels": L.length - 1 } : void 0,
1958
+ "aria-label": d,
1959
+ "aria-rowcount": F ? (S.lines ?? S.filtered).length + 1 + (be ? 1 : 0) : void 0,
1957
1960
  "aria-busy": u || void 0,
1958
- className: E(
1959
- d.table,
1960
- k === "compact" && d.compact,
1961
- o && d.sticky,
1962
- s && d.striped
1961
+ className: G(
1962
+ f.table,
1963
+ k === "compact" && f.compact,
1964
+ o && f.sticky,
1965
+ s && f.striped
1963
1966
  ),
1964
1967
  children: [
1965
- /* @__PURE__ */ l("thead", { children: /* @__PURE__ */ L("tr", { "aria-rowindex": S ? 1 : void 0, children: [
1968
+ /* @__PURE__ */ l("thead", { children: /* @__PURE__ */ O("tr", { "aria-rowindex": F ? 1 : void 0, children: [
1966
1969
  n && /* @__PURE__ */ l(
1967
1970
  "th",
1968
1971
  {
1969
1972
  scope: "col",
1970
- className: E(d.th, d.control, r && d.stickyCell),
1973
+ className: G(f.th, f.control, r && f.stickyCell),
1971
1974
  style: r ? { left: 0 } : void 0,
1972
1975
  children: /* @__PURE__ */ l(
1973
1976
  Se,
1974
1977
  {
1975
- "aria-label": b.selectAllRows,
1976
- checked: N.selection.allSelected,
1977
- indeterminate: N.selection.someSelected,
1978
- onChange: N.selection.toggleAll
1978
+ "aria-label": m.selectAllRows,
1979
+ checked: C.selection.allSelected,
1980
+ indeterminate: C.selection.someSelected,
1981
+ onChange: C.selection.toggleAll
1979
1982
  }
1980
1983
  )
1981
1984
  }
1982
1985
  ),
1983
- x && /* @__PURE__ */ l(
1986
+ A && /* @__PURE__ */ l(
1984
1987
  "td",
1985
1988
  {
1986
- className: E(d.th, d.control, r && d.stickyCell),
1989
+ className: G(f.th, f.control, r && f.stickyCell),
1987
1990
  style: r ? { left: (n ? 1 : 0) * Oe } : void 0
1988
1991
  }
1989
1992
  ),
1990
- G && (e.columnById(G.spec.id) === G ? /* @__PURE__ */ l(wt, { entry: G, registry: e, hook: v, sticky: !1, left: de }) : /* @__PURE__ */ l("th", { scope: "col", className: d.th, children: G.spec.label })),
1991
- W.map((y) => /* @__PURE__ */ l(
1993
+ P && (e.columnById(P.spec.id) === P ? /* @__PURE__ */ l(wt, { entry: P, registry: e, hook: _, sticky: !1, left: de }) : /* @__PURE__ */ l("th", { scope: "col", className: f.th, children: P.spec.label })),
1994
+ q.map((y) => /* @__PURE__ */ l(
1992
1995
  wt,
1993
1996
  {
1994
1997
  entry: y,
1995
1998
  registry: e,
1996
- hook: v,
1999
+ hook: _,
1997
2000
  sticky: fe(y),
1998
2001
  left: de
1999
2002
  },
2000
2003
  y.key
2001
2004
  )),
2002
- _.length > 0 && /* @__PURE__ */ l("th", { scope: "col", className: E(d.th, d.actionsCell), children: /* @__PURE__ */ l(Re, { children: b.rowActions }) })
2005
+ v.length > 0 && /* @__PURE__ */ l("th", { scope: "col", className: G(f.th, f.actionsCell), children: /* @__PURE__ */ l(Re, { children: m.rowActions }) })
2003
2006
  ] }) }),
2004
2007
  te,
2005
- be && /* @__PURE__ */ l("tfoot", { children: /* @__PURE__ */ L("tr", { "aria-rowindex": S ? (C.lines ?? C.filtered).length + 2 : void 0, children: [
2008
+ be && /* @__PURE__ */ l("tfoot", { children: /* @__PURE__ */ O("tr", { "aria-rowindex": F ? (S.lines ?? S.filtered).length + 2 : void 0, children: [
2006
2009
  Array.from({ length: ie }, (y, R) => /* @__PURE__ */ l(
2007
2010
  "td",
2008
2011
  {
2009
- className: E(d.td, d.control, r && d.stickyCell),
2012
+ className: G(f.td, f.control, r && f.stickyCell),
2010
2013
  style: r ? { left: R * Oe } : void 0
2011
2014
  },
2012
2015
  R
2013
2016
  )),
2014
- G && /* @__PURE__ */ l("td", { className: d.td }),
2015
- W.map((y) => /* @__PURE__ */ l(
2017
+ P && /* @__PURE__ */ l("td", { className: f.td }),
2018
+ q.map((y) => /* @__PURE__ */ l(
2016
2019
  Yr,
2017
2020
  {
2018
2021
  entry: y,
2019
- rows: C.filtered,
2020
- formats: p,
2021
- wording: b,
2022
+ rows: S.filtered,
2023
+ formats: w,
2024
+ wording: m,
2022
2025
  sticky: fe(y),
2023
2026
  left: de
2024
2027
  },
2025
2028
  y.key
2026
2029
  )),
2027
- _.length > 0 && /* @__PURE__ */ l("td", { className: d.td })
2030
+ v.length > 0 && /* @__PURE__ */ l("td", { className: f.td })
2028
2031
  ] }) })
2029
2032
  ]
2030
2033
  }
@@ -2045,85 +2048,85 @@ function wt({
2045
2048
  sticky: o,
2046
2049
  left: r
2047
2050
  }) {
2048
- const { spec: s } = e, i = n.publicSnapshot, a = t.kindOf(e, n.rows), c = Ot(a, s.rightAligned), u = t.isSortable(e, n.rows), h = s.id, f = i.sort.findIndex((T) => T.column === h), b = f === -1 ? void 0 : i.sort[f].direction, p = i.sort.length > 1 && f !== -1 ? f + 1 : void 0, k = i.widths[h], m = 48, w = (T) => {
2049
- T.stopPropagation(), T.preventDefault();
2050
- const x = T.currentTarget, _ = x.closest("th");
2051
- if (!_) return;
2052
- const S = T.clientX, O = _.getBoundingClientRect().width, A = T.pointerId;
2053
- x.setPointerCapture(A);
2054
- const I = (G) => {
2055
- G.pointerId === A && i.setWidth(h, Math.max(m, O + (G.clientX - S)));
2056
- }, $ = (G) => {
2057
- G.pointerId === A && (x.removeEventListener("pointermove", I), x.removeEventListener("pointerup", $), x.removeEventListener("pointercancel", $), x.hasPointerCapture(A) && x.releasePointerCapture(A));
2051
+ const { spec: s } = e, i = n.publicSnapshot, a = t.kindOf(e, n.rows), c = Ot(a, s.rightAligned), u = t.isSortable(e, n.rows), h = s.id, d = i.sort.findIndex((x) => x.column === h), m = d === -1 ? void 0 : i.sort[d].direction, w = i.sort.length > 1 && d !== -1 ? d + 1 : void 0, k = i.widths[h], p = 48, b = (x) => {
2052
+ x.stopPropagation(), x.preventDefault();
2053
+ const A = x.currentTarget, v = A.closest("th");
2054
+ if (!v) return;
2055
+ const F = x.clientX, L = v.getBoundingClientRect().width, N = x.pointerId;
2056
+ A.setPointerCapture(N);
2057
+ const V = (P) => {
2058
+ P.pointerId === N && i.setWidth(h, Math.max(p, L + (P.clientX - F)));
2059
+ }, z = (P) => {
2060
+ P.pointerId === N && (A.removeEventListener("pointermove", V), A.removeEventListener("pointerup", z), A.removeEventListener("pointercancel", z), A.hasPointerCapture(N) && A.releasePointerCapture(N));
2058
2061
  };
2059
- x.addEventListener("pointermove", I), x.addEventListener("pointerup", $), x.addEventListener("pointercancel", $);
2060
- }, g = (T) => {
2061
- const x = T == null ? void 0 : T.parentElement, _ = T == null ? void 0 : T.closest("table");
2062
- if (!T || !x || !_) return;
2063
- const S = Array.from(x.children).indexOf(T), O = x.children.length, A = { cell: T.style.width, table: _.style.width };
2064
- T.style.width = "", _.style.width = "auto";
2065
- let I = 0;
2066
- for (const $ of Array.from(_.rows)) {
2067
- if ($.cells.length !== O) continue;
2068
- const G = $.cells[S];
2069
- G && (I = Math.max(I, G.scrollWidth));
2062
+ A.addEventListener("pointermove", V), A.addEventListener("pointerup", z), A.addEventListener("pointercancel", z);
2063
+ }, g = (x) => {
2064
+ const A = x == null ? void 0 : x.parentElement, v = x == null ? void 0 : x.closest("table");
2065
+ if (!x || !A || !v) return;
2066
+ const F = Array.from(A.children).indexOf(x), L = A.children.length, N = { cell: x.style.width, table: v.style.width };
2067
+ x.style.width = "", v.style.width = "auto";
2068
+ let V = 0;
2069
+ for (const z of Array.from(v.rows)) {
2070
+ if (z.cells.length !== L) continue;
2071
+ const P = z.cells[F];
2072
+ P && (V = Math.max(V, P.scrollWidth));
2070
2073
  }
2071
- T.style.width = A.cell, _.style.width = A.table, I > 0 && i.setWidth(h, Math.max(m, I + 1));
2072
- }, v = (T) => {
2073
- if (!s.resizable || !T.altKey) return;
2074
- const x = T.key === "ArrowRight", _ = T.key === "ArrowLeft", S = T.key === "Home";
2075
- if (!x && !_ && !S) return;
2076
- T.preventDefault();
2077
- const O = T.currentTarget;
2078
- if (S) {
2079
- g(O);
2074
+ x.style.width = N.cell, v.style.width = N.table, V > 0 && i.setWidth(h, Math.max(p, V + 1));
2075
+ }, _ = (x) => {
2076
+ if (!s.resizable || !x.altKey) return;
2077
+ const A = x.key === "ArrowRight", v = x.key === "ArrowLeft", F = x.key === "Home";
2078
+ if (!A && !v && !F) return;
2079
+ x.preventDefault();
2080
+ const L = x.currentTarget;
2081
+ if (F) {
2082
+ g(L);
2080
2083
  return;
2081
2084
  }
2082
- const A = O.getBoundingClientRect().width, I = T.shiftKey ? 32 : 8;
2083
- i.setWidth(h, Math.max(m, A + (x ? I : -I)));
2084
- }, N = u ? /* @__PURE__ */ L(
2085
+ const N = L.getBoundingClientRect().width, V = x.shiftKey ? 32 : 8;
2086
+ i.setWidth(h, Math.max(p, N + (A ? V : -V)));
2087
+ }, C = u ? /* @__PURE__ */ O(
2085
2088
  "button",
2086
2089
  {
2087
2090
  type: "button",
2088
- className: d.sortButton,
2089
- onClick: (T) => i.toggleSort(h, T.shiftKey || T.metaKey),
2091
+ className: f.sortButton,
2092
+ onClick: (x) => i.toggleSort(h, x.shiftKey || x.metaKey),
2090
2093
  children: [
2091
2094
  /* @__PURE__ */ l("span", { children: s.label }),
2092
- p !== void 0 && /* @__PURE__ */ l("span", { className: d.sortRank, "aria-hidden": "true", children: p }),
2093
- /* @__PURE__ */ l("span", { className: E(d.sortIndicator, b && d.sortActive), "aria-hidden": "true", children: b ? /* @__PURE__ */ l("svg", { viewBox: "0 0 10 10", width: "10", height: "10", className: E(d.sortArrow, b === "desc" && d.sortArrowDesc), children: /* @__PURE__ */ l("path", { d: "M2.2 6.2 5 3.4l2.8 2.8", fill: "none", stroke: "currentColor", strokeWidth: "1.6", strokeLinecap: "round", strokeLinejoin: "round" }) }) : /* @__PURE__ */ L("svg", { viewBox: "0 0 10 12", width: "10", height: "12", children: [
2095
+ w !== void 0 && /* @__PURE__ */ l("span", { className: f.sortRank, "aria-hidden": "true", children: w }),
2096
+ /* @__PURE__ */ l("span", { className: G(f.sortIndicator, m && f.sortActive), "aria-hidden": "true", children: m ? /* @__PURE__ */ l("svg", { viewBox: "0 0 10 10", width: "10", height: "10", className: G(f.sortArrow, m === "desc" && f.sortArrowDesc), children: /* @__PURE__ */ l("path", { d: "M2.2 6.2 5 3.4l2.8 2.8", fill: "none", stroke: "currentColor", strokeWidth: "1.6", strokeLinecap: "round", strokeLinejoin: "round" }) }) : /* @__PURE__ */ O("svg", { viewBox: "0 0 10 12", width: "10", height: "12", children: [
2094
2097
  /* @__PURE__ */ l("path", { d: "M2.4 4.4 5 1.8l2.6 2.6", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }),
2095
2098
  /* @__PURE__ */ l("path", { d: "M2.4 7.6 5 10.2l2.6-2.6", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" })
2096
2099
  ] }) })
2097
2100
  ]
2098
2101
  }
2099
- ) : s.label, C = b === "asc" ? "ascending" : b === "desc" ? "descending" : "none", D = me(s.filter) !== void 0 && !(s.filter === "list" && a === "other");
2100
- return /* @__PURE__ */ L(
2102
+ ) : s.label, S = m === "asc" ? "ascending" : m === "desc" ? "descending" : "none", I = me(s.filter) !== void 0 && !(s.filter === "list" && a === "other");
2103
+ return /* @__PURE__ */ O(
2101
2104
  "th",
2102
2105
  {
2103
2106
  scope: "col",
2104
2107
  "data-column": h,
2105
- "aria-sort": u ? C : void 0,
2108
+ "aria-sort": u ? S : void 0,
2106
2109
  tabIndex: s.resizable && !u ? 0 : void 0,
2107
- onKeyDown: v,
2108
- className: E(d.th, c && d.numeric, o && d.stickyCell),
2110
+ onKeyDown: _,
2111
+ className: G(f.th, c && f.numeric, o && f.stickyCell),
2109
2112
  style: {
2110
2113
  ...k !== void 0 ? { width: k } : {},
2111
2114
  ...o ? { left: r } : {}
2112
2115
  },
2113
2116
  children: [
2114
- D ? /* @__PURE__ */ L("span", { className: d.thFlex, children: [
2115
- N,
2117
+ I ? /* @__PURE__ */ O("span", { className: f.thFlex, children: [
2118
+ C,
2116
2119
  /* @__PURE__ */ l(br, { entry: e, registry: t, hook: n })
2117
- ] }) : N,
2120
+ ] }) : C,
2118
2121
  s.resizable && /* @__PURE__ */ l(
2119
2122
  "span",
2120
2123
  {
2121
2124
  role: "presentation",
2122
- className: d.grip,
2123
- onPointerDown: w,
2124
- onClick: (T) => T.stopPropagation(),
2125
- onDoubleClick: (T) => {
2126
- T.stopPropagation(), g(T.currentTarget.closest("th"));
2125
+ className: f.grip,
2126
+ onPointerDown: b,
2127
+ onClick: (x) => x.stopPropagation(),
2128
+ onDoubleClick: (x) => {
2129
+ x.stopPropagation(), g(x.currentTarget.closest("th"));
2127
2130
  }
2128
2131
  }
2129
2132
  )
@@ -2143,85 +2146,86 @@ function Wr({
2143
2146
  actions: c,
2144
2147
  stickyRowHeader: u,
2145
2148
  rowHeaderLeft: h,
2146
- columnCount: f,
2147
- rowProps: b,
2148
- baseId: p,
2149
+ columnCount: d,
2150
+ rowProps: m,
2151
+ baseId: w,
2149
2152
  formats: k,
2150
- wording: m,
2151
- line: w,
2153
+ wording: p,
2154
+ line: b,
2152
2155
  spanEntry: g
2153
2156
  }) {
2154
- const v = Ue(Wt), N = r.publicSnapshot, C = r.rowKey(e), D = jr(e, i, r, k, m), T = o.detail, x = T !== null && N.expanded.includes(C), _ = `${p}-detail-${t}`, { className: S, ...O } = (b == null ? void 0 : b(e)) ?? {}, A = n !== void 0;
2155
- return /* @__PURE__ */ L(J, { children: [
2156
- /* @__PURE__ */ L(
2157
+ const _ = Ue(Wt), C = r.publicSnapshot, S = r.rowKey(e), I = jr(e, i, r, k, p), x = o.detail, A = x !== null && C.expanded.includes(S), v = `${w}-detail-${t}`, { className: F, ...L } = (m == null ? void 0 : m(e)) ?? {}, N = n !== void 0, V = b ? b.span ?? b.parents.at(-1) : void 0;
2158
+ return /* @__PURE__ */ O(Q, { children: [
2159
+ /* @__PURE__ */ O(
2157
2160
  "tr",
2158
2161
  {
2159
- ...O,
2160
- className: E(S, A && d.virtualRow),
2161
- "data-row": A ? n : void 0,
2162
- "data-line": w ? "row" : void 0,
2163
- "data-motion": C,
2164
- "data-group-first": w != null && w.first ? "" : void 0,
2165
- "aria-level": w ? w.parents.length + 1 : void 0,
2166
- "aria-posinset": w ? (w.span ?? w.parents.at(-1)).rows.indexOf(e) + 1 : void 0,
2167
- "aria-setsize": w ? (w.span ?? w.parents.at(-1)).rows.length : void 0,
2168
- tabIndex: A ? n === v ? 0 : -1 : void 0,
2169
- "data-even": A && n % 2 === 1 ? "" : void 0,
2170
- "aria-rowindex": A ? n + 2 : void 0,
2162
+ ...L,
2163
+ className: G(F, N && f.virtualRow),
2164
+ "data-row": N ? n : void 0,
2165
+ "data-line": b ? "row" : void 0,
2166
+ "data-motion": S,
2167
+ "data-group-first": b != null && b.first ? "" : void 0,
2168
+ "data-group": V == null ? void 0 : V.path,
2169
+ "aria-level": b ? b.parents.length + 1 : void 0,
2170
+ "aria-posinset": V ? V.rows.indexOf(e) + 1 : void 0,
2171
+ "aria-setsize": V == null ? void 0 : V.rows.length,
2172
+ tabIndex: N ? n === _ ? 0 : -1 : void 0,
2173
+ "data-even": N && n % 2 === 1 ? "" : void 0,
2174
+ "aria-rowindex": N ? n + 2 : void 0,
2171
2175
  children: [
2172
2176
  a && /* @__PURE__ */ l(
2173
2177
  "td",
2174
2178
  {
2175
- className: E(d.td, d.control, u && d.stickyCell),
2179
+ className: G(f.td, f.control, u && f.stickyCell),
2176
2180
  style: u ? { left: 0 } : void 0,
2177
2181
  children: /* @__PURE__ */ l(
2178
2182
  Se,
2179
2183
  {
2180
- "aria-label": m.selectRow(D),
2181
- checked: N.selection.isSelected(C),
2182
- onChange: () => N.selection.toggle(C)
2184
+ "aria-label": p.selectRow(I),
2185
+ checked: C.selection.isSelected(S),
2186
+ onChange: () => C.selection.toggle(S)
2183
2187
  }
2184
2188
  )
2185
2189
  }
2186
2190
  ),
2187
- T && /* @__PURE__ */ l(
2191
+ x && /* @__PURE__ */ l(
2188
2192
  "td",
2189
2193
  {
2190
- className: E(d.td, d.control, u && d.stickyCell),
2194
+ className: G(f.td, f.control, u && f.stickyCell),
2191
2195
  style: u ? { left: (a ? 1 : 0) * Oe } : void 0,
2192
2196
  children: /* @__PURE__ */ l(
2193
2197
  "button",
2194
2198
  {
2195
2199
  type: "button",
2196
- "aria-expanded": x,
2197
- "aria-controls": x ? _ : void 0,
2198
- "aria-label": x ? m.collapseRowNamed(D) : m.expandRowNamed(D),
2199
- className: E(d.expander, x && d.expanderOpen),
2200
- onClick: () => N.toggleRow(C),
2200
+ "aria-expanded": A,
2201
+ "aria-controls": A ? v : void 0,
2202
+ "aria-label": A ? p.collapseRowNamed(I) : p.expandRowNamed(I),
2203
+ className: G(f.expander, A && f.expanderOpen),
2204
+ onClick: () => C.toggleRow(S),
2201
2205
  children: /* @__PURE__ */ l("svg", { viewBox: "0 0 10 10", width: "10", height: "10", "aria-hidden": "true", children: /* @__PURE__ */ l("path", { d: "M3.5 1.5 7 5l-3.5 3.5", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) })
2202
2206
  }
2203
2207
  )
2204
2208
  }
2205
2209
  ),
2206
- w && w.span && /* @__PURE__ */ l(Er, { line: { ...w, span: w.span }, entry: g, selectable: a, registry: o, hook: r, formats: k, wording: m }),
2207
- s.map((I) => /* @__PURE__ */ l(
2210
+ b && b.span && /* @__PURE__ */ l(Gr, { line: { ...b, span: b.span }, entry: g, selectable: a, hook: r, formats: k, wording: p }),
2211
+ s.map((z) => /* @__PURE__ */ l(
2208
2212
  qr,
2209
2213
  {
2210
- entry: I,
2214
+ entry: z,
2211
2215
  row: e,
2212
- kind: o.kindOf(I, r.rows),
2213
- sticky: u && I === i,
2216
+ kind: o.kindOf(z, r.rows),
2217
+ sticky: u && z === i,
2214
2218
  left: h,
2215
2219
  formats: k,
2216
- wording: m
2220
+ wording: p
2217
2221
  },
2218
- I.key
2222
+ z.key
2219
2223
  )),
2220
- c.length > 0 && /* @__PURE__ */ l("td", { className: E(d.td, d.actionsCell), children: /* @__PURE__ */ l(Xr, { actions: c, row: e, name: D, wording: m }) })
2224
+ c.length > 0 && /* @__PURE__ */ l("td", { className: G(f.td, f.actionsCell), children: /* @__PURE__ */ l(Jr, { actions: c, row: e, name: I, wording: p }) })
2221
2225
  ]
2222
2226
  }
2223
2227
  ),
2224
- x && T && /* @__PURE__ */ l("tr", { id: _, className: d.detailRow, children: /* @__PURE__ */ l("td", { colSpan: f, className: d.detailCell, children: T.presentation(e) }) })
2228
+ A && x && /* @__PURE__ */ l("tr", { id: v, className: f.detailRow, "data-group": V == null ? void 0 : V.path, children: /* @__PURE__ */ l("td", { colSpan: d, className: f.detailCell, children: x.presentation(e) }) })
2225
2229
  ] });
2226
2230
  }
2227
2231
  function qr({
@@ -2236,12 +2240,12 @@ function qr({
2236
2240
  const { spec: a } = e, c = e.read(t), u = Ot(n, a.rightAligned);
2237
2241
  let h;
2238
2242
  Y(c) ? h = /* @__PURE__ */ l(Ht, { wording: i }) : a.presentation ? h = a.presentation(c, t) : h = _e(c, a.format, s, i);
2239
- const f = a.rowHeader ? "th" : "td";
2243
+ const d = a.rowHeader ? "th" : "td";
2240
2244
  return /* @__PURE__ */ l(
2241
- f,
2245
+ d,
2242
2246
  {
2243
2247
  scope: a.rowHeader ? "row" : void 0,
2244
- className: E(d.td, u && d.numeric, a.rowHeader && d.rowHeader, o && d.stickyCell),
2248
+ className: G(f.td, u && f.numeric, a.rowHeader && f.rowHeader, o && f.stickyCell),
2245
2249
  style: o ? { left: r } : void 0,
2246
2250
  children: h
2247
2251
  }
@@ -2256,12 +2260,12 @@ function Yr({
2256
2260
  left: s
2257
2261
  }) {
2258
2262
  const i = r ? { left: s } : void 0;
2259
- if (!e.spec.aggregate) return /* @__PURE__ */ l("td", { className: E(d.td, r && d.stickyCell), style: i });
2263
+ if (!e.spec.aggregate) return /* @__PURE__ */ l("td", { className: G(f.td, r && f.stickyCell), style: i });
2260
2264
  const a = typeof e.spec.aggregate == "function" ? "own" : e.spec.aggregate;
2261
- return /* @__PURE__ */ l("td", { className: E(d.td, $t(e, t) && d.numeric, r && d.stickyCell), style: i, "data-footer": a, children: /* @__PURE__ */ l(Ke, { entry: e, rows: t, formats: n, wording: o, signed: !0 }) });
2265
+ return /* @__PURE__ */ l("td", { className: G(f.td, $t(e, t) && f.numeric, r && f.stickyCell), style: i, "data-footer": a, children: /* @__PURE__ */ l(Ke, { entry: e, rows: t, formats: n, wording: o, signed: !0 }) });
2262
2266
  }
2263
2267
  const Ur = 2;
2264
- function Xr({
2268
+ function Jr({
2265
2269
  actions: e,
2266
2270
  row: t,
2267
2271
  name: n,
@@ -2271,7 +2275,7 @@ function Xr({
2271
2275
  const i = s.onSelect;
2272
2276
  i(s.bulk ? [t] : t);
2273
2277
  };
2274
- return e.length <= Ur ? /* @__PURE__ */ l("div", { className: d.actions, children: e.map(({ key: s, spec: i }) => /* @__PURE__ */ l(
2278
+ return e.length <= Ur ? /* @__PURE__ */ l("div", { className: f.actions, children: e.map(({ key: s, spec: i }) => /* @__PURE__ */ l(
2275
2279
  ee,
2276
2280
  {
2277
2281
  size: "sm",
@@ -2281,7 +2285,7 @@ function Xr({
2281
2285
  children: i.label
2282
2286
  },
2283
2287
  s
2284
- )) }) : /* @__PURE__ */ l("div", { className: d.actions, children: /* @__PURE__ */ l(
2288
+ )) }) : /* @__PURE__ */ l("div", { className: f.actions, children: /* @__PURE__ */ l(
2285
2289
  At,
2286
2290
  {
2287
2291
  align: "end",
@@ -2290,42 +2294,42 @@ function Xr({
2290
2294
  }
2291
2295
  ) });
2292
2296
  }
2293
- function Jr({ columns: e, rows: t = 4 }) {
2297
+ function Xr({ columns: e, rows: t = 4 }) {
2294
2298
  const n = [72, 48, 60, 40, 56, 64];
2295
- return /* @__PURE__ */ l(J, { children: Array.from({ length: t }, (o, r) => /* @__PURE__ */ l("tr", { "aria-hidden": "true", children: Array.from({ length: e }, (s, i) => /* @__PURE__ */ l("td", { className: d.td, children: /* @__PURE__ */ l("span", { className: d.skeleton, style: { width: `${n[(r + i) % n.length]}%` } }) }, i)) }, r)) });
2299
+ return /* @__PURE__ */ l(Q, { children: Array.from({ length: t }, (o, r) => /* @__PURE__ */ l("tr", { "aria-hidden": "true", children: Array.from({ length: e }, (s, i) => /* @__PURE__ */ l("td", { className: f.td, children: /* @__PURE__ */ l("span", { className: f.skeleton, style: { width: `${n[(r + i) % n.length]}%` } }) }, i)) }, r)) });
2296
2300
  }
2297
2301
  const Wt = yt(0);
2298
2302
  function bt({ height: e, colSpan: t }) {
2299
- return e <= 0 ? null : /* @__PURE__ */ l("tr", { "aria-hidden": "true", "data-filler": "", className: d.fillerRow, children: /* @__PURE__ */ l("td", { colSpan: t, style: { height: e } }) });
2303
+ return e <= 0 ? null : /* @__PURE__ */ l("tr", { "aria-hidden": "true", "data-filler": "", className: f.fillerRow, children: /* @__PURE__ */ l("td", { colSpan: t, style: { height: e } }) });
2300
2304
  }
2301
2305
  function kt({
2302
2306
  virtual: e,
2303
2307
  colSpan: t,
2304
2308
  children: n
2305
2309
  }) {
2306
- const { count: o, fillerBefore: r, fillerAfter: s, showRow: i } = e, a = Z(null), [c, u] = z(0), h = (p, k) => {
2310
+ const { count: o, fillerBefore: r, fillerAfter: s, showRow: i } = e, a = re(null), [c, u] = H(0), h = (w, k) => {
2307
2311
  a.current = k, u(k), i(k), requestAnimationFrame(() => {
2308
- var m;
2309
- (m = p.querySelector(`[data-row="${k}"]`)) == null || m.focus();
2312
+ var p;
2313
+ (p = w.querySelector(`[data-row="${k}"]`)) == null || p.focus();
2310
2314
  });
2311
- }, f = c >= e.from && c < e.to ? c : e.from, b = (p) => {
2312
- if (p.defaultPrevented || o === 0) return;
2313
- const k = p.target, m = k.closest("[data-row]");
2314
- if (m && k !== m) return;
2315
- const w = m ? Number(m.dataset.row) : a.current ?? -1;
2315
+ }, d = c >= e.from && c < e.to ? c : e.from, m = (w) => {
2316
+ if (w.defaultPrevented || o === 0) return;
2317
+ const k = w.target, p = k.closest("[data-row]");
2318
+ if (p && k !== p) return;
2319
+ const b = p ? Number(p.dataset.row) : a.current ?? -1;
2316
2320
  let g = null;
2317
- p.key === "ArrowDown" ? g = Math.min(o - 1, w + 1) : p.key === "ArrowUp" ? g = Math.max(0, w - 1) : p.key === "Home" ? g = 0 : p.key === "End" && (g = o - 1), !(g === null || g === w) && (p.preventDefault(), h(p.currentTarget, g));
2321
+ w.key === "ArrowDown" ? g = Math.min(o - 1, b + 1) : w.key === "ArrowUp" ? g = Math.max(0, b - 1) : w.key === "Home" ? g = 0 : w.key === "End" && (g = o - 1), !(g === null || g === b) && (w.preventDefault(), h(w.currentTarget, g));
2318
2322
  };
2319
2323
  return /* @__PURE__ */ l(
2320
2324
  "tbody",
2321
2325
  {
2322
- className: d.virtualBody,
2323
- onKeyDown: b,
2324
- onFocus: (p) => {
2325
- const k = p.target.closest("[data-row]");
2326
+ className: f.virtualBody,
2327
+ onKeyDown: m,
2328
+ onFocus: (w) => {
2329
+ const k = w.target.closest("[data-row]");
2326
2330
  k && u(Number(k.dataset.row));
2327
2331
  },
2328
- children: /* @__PURE__ */ L(Wt.Provider, { value: f, children: [
2332
+ children: /* @__PURE__ */ O(Wt.Provider, { value: d, children: [
2329
2333
  /* @__PURE__ */ l(bt, { height: r, colSpan: t }),
2330
2334
  n,
2331
2335
  /* @__PURE__ */ l(bt, { height: s, colSpan: t })
@@ -2333,7 +2337,7 @@ function kt({
2333
2337
  }
2334
2338
  );
2335
2339
  }
2336
- const Qr = "_verdict_a8pbv_6", Zr = "_glyph_a8pbv_13", es = "_value_a8pbv_23", ts = "_excess_a8pbv_28", Te = {
2340
+ const Qr = "_verdict_yxa4g_6", Zr = "_glyph_yxa4g_13", es = "_value_yxa4g_23", ts = "_excess_yxa4g_28", Te = {
2337
2341
  verdict: Qr,
2338
2342
  glyph: Zr,
2339
2343
  value: es,
@@ -2346,10 +2350,10 @@ const Qr = "_verdict_a8pbv_6", Zr = "_glyph_a8pbv_13", es = "_value_a8pbv_23", t
2346
2350
  };
2347
2351
  function rs({ reading: e, format: t }) {
2348
2352
  const n = ue(), o = U(), { measured: r, assessment: s } = e, i = ns(s.verdict, o);
2349
- return /* @__PURE__ */ L("span", { className: Te.verdict, "data-verdict": s.verdict, title: i, children: [
2353
+ return /* @__PURE__ */ O("span", { className: Te.verdict, "data-verdict": s.verdict, title: i, children: [
2350
2354
  /* @__PURE__ */ l("span", { "aria-hidden": "true", className: Te.glyph, children: os[s.verdict] }),
2351
2355
  /* @__PURE__ */ l("span", { className: Te.value, children: r === null ? o.statAbsentValue : vt(r, t, n) }),
2352
- s.excess !== void 0 && /* @__PURE__ */ L("span", { className: Te.excess, children: [
2356
+ s.excess !== void 0 && /* @__PURE__ */ O("span", { className: Te.excess, children: [
2353
2357
  "+",
2354
2358
  vt(s.excess, t, n)
2355
2359
  ] }),
@@ -2357,22 +2361,22 @@ function rs({ reading: e, format: t }) {
2357
2361
  ] });
2358
2362
  }
2359
2363
  const ss = (e) => e.measured, is = (e) => e.reduce(
2360
- (t, n) => !t || Be(n.assessment.verdict) > Be(t.assessment.verdict) ? n : t,
2364
+ (t, n) => !t || Ee(n.assessment.verdict) > Ee(t.assessment.verdict) ? n : t,
2361
2365
  void 0
2362
2366
  );
2363
2367
  function as(e) {
2364
2368
  return function({ id: n, value: o, label: r, limits: s, format: i, sortBy: a = "verdict", width: c, resizable: u, aggregate: h }) {
2365
- const f = JSON.stringify(s), b = j(() => {
2366
- const k = JSON.parse(f);
2367
- return (m) => {
2368
- const w = typeof o == "string" ? m == null ? void 0 : m[o] : o(m);
2369
+ const d = JSON.stringify(s), m = $(() => {
2370
+ const k = JSON.parse(d);
2371
+ return (p) => {
2372
+ const b = typeof o == "string" ? p == null ? void 0 : p[o] : o(p);
2369
2373
  return {
2370
- measured: typeof w == "number" && Number.isFinite(w) ? w : null,
2371
- assessment: tn(w, k)
2374
+ measured: typeof b == "number" && Number.isFinite(b) ? b : null,
2375
+ assessment: tn(b, k)
2372
2376
  };
2373
2377
  };
2374
- }, [o, f]), p = X(
2375
- (k) => a === "value" ? k.measured : Be(k.assessment.verdict),
2378
+ }, [o, d]), w = X(
2379
+ (k) => a === "value" ? k.measured : Ee(k.assessment.verdict),
2376
2380
  [a]
2377
2381
  );
2378
2382
  return /* @__PURE__ */ l(
@@ -2383,8 +2387,8 @@ function as(e) {
2383
2387
  numeric: !0,
2384
2388
  width: c,
2385
2389
  resizable: u,
2386
- value: b,
2387
- sortValue: p,
2390
+ value: m,
2391
+ sortValue: w,
2388
2392
  exportValue: ss,
2389
2393
  aggregate: h === "worst" ? is : void 0,
2390
2394
  children: (k) => /* @__PURE__ */ l(rs, { reading: k, format: i })
@@ -2420,16 +2424,16 @@ function ls(e, t) {
2420
2424
  };
2421
2425
  }
2422
2426
  function cs(e, t) {
2423
- const n = j(() => t ? e.filter((i) => t(i)) : e, [e, t]), [o, r] = z(() => ({ source: e, result: n }));
2427
+ const n = $(() => t ? e.filter((i) => t(i)) : e, [e, t]), [o, r] = H(() => ({ source: e, result: n }));
2424
2428
  if (!t) return e;
2425
2429
  const s = o.source === e && (o.result === n || o.result.length === n.length && o.result.every((i, a) => i === n[a]));
2426
2430
  return s || r({ source: e, result: n }), s ? o.result : n;
2427
2431
  }
2428
2432
  function us(e, t) {
2429
- var a, c, u, h, f, b;
2433
+ var a, c, u, h, d, m;
2430
2434
  if (t.size === 0) return e;
2431
- const n = (a = e.sort) == null ? void 0 : a.filter((p) => t.has(p.column)), o = (c = e.hidden) == null ? void 0 : c.filter((p) => t.has(p)), r = (u = e.order) == null ? void 0 : u.filter((p) => t.has(p)), s = e.widths ? Object.fromEntries(Object.entries(e.widths).filter(([p]) => t.has(p))) : void 0;
2432
- return (n == null ? void 0 : n.length) === ((h = e.sort) == null ? void 0 : h.length) && (o == null ? void 0 : o.length) === ((f = e.hidden) == null ? void 0 : f.length) && (r == null ? void 0 : r.length) === ((b = e.order) == null ? void 0 : b.length) && Object.keys(s ?? {}).length === Object.keys(e.widths ?? {}).length ? e : {
2435
+ const n = (a = e.sort) == null ? void 0 : a.filter((w) => t.has(w.column)), o = (c = e.hidden) == null ? void 0 : c.filter((w) => t.has(w)), r = (u = e.order) == null ? void 0 : u.filter((w) => t.has(w)), s = e.widths ? Object.fromEntries(Object.entries(e.widths).filter(([w]) => t.has(w))) : void 0;
2436
+ return (n == null ? void 0 : n.length) === ((h = e.sort) == null ? void 0 : h.length) && (o == null ? void 0 : o.length) === ((d = e.hidden) == null ? void 0 : d.length) && (r == null ? void 0 : r.length) === ((m = e.order) == null ? void 0 : m.length) && Object.keys(s ?? {}).length === Object.keys(e.widths ?? {}).length ? e : {
2433
2437
  ...e.search ? { search: e.search } : {},
2434
2438
  ...e.page ? { page: e.page } : {},
2435
2439
  ...e.pageSize ? { pageSize: e.pageSize } : {},
@@ -2439,7 +2443,7 @@ function us(e, t) {
2439
2443
  ...s && Object.keys(s).length ? { widths: s } : {}
2440
2444
  };
2441
2445
  }
2442
- const Ee = (e) => e === void 0 ? [] : typeof e == "string" ? [e] : [...e], ds = (e, t) => e.length === t.length && e.every((n, o) => n === t[o]);
2446
+ const Ge = (e) => e === void 0 ? [] : typeof e == "string" ? [e] : [...e], ds = (e, t) => e.length === t.length && e.every((n, o) => n === t[o]);
2443
2447
  function _t(e) {
2444
2448
  const t = [], n = (o) => {
2445
2449
  for (const r of o)
@@ -2454,116 +2458,120 @@ function hs(e, t) {
2454
2458
  return { ...n, ...t };
2455
2459
  }
2456
2460
  function gs(e, t) {
2457
- const [n] = z(() => new gr()), [o] = z(() => {
2461
+ const [n] = H(() => new gr()), [o] = H(() => {
2458
2462
  const y = Hr(n);
2459
2463
  return { ...y, VerdictColumn: as(y.Column) };
2460
2464
  });
2461
2465
  Le(n.subscribe, n.structureVersion, n.structureVersion);
2462
- const r = ue(), s = e, i = n.modelColumns(s, r), [a] = z(() => t.initialView), [c, u] = z(() => Object.entries((a == null ? void 0 : a.conditions) ?? {})), h = j(() => ls(c, n), [c, n]), f = t.preFilter ?? t.filter, b = cs(s, f), [p, k] = z(
2463
- () => a != null && a.grouping ? [...a.grouping] : Ee(t.defaultGrouping)
2464
- ), [m, w] = z(() => (a == null ? void 0 : a.folded) ?? []), g = n.orderedColumns().length + n.groupKeys.entries.size > 0, v = g ? n.effectiveGrouping(p, s) : p.slice(0, Qe), N = v.join("|"), C = j(() => new Set(m), [m]), D = v.length ? n.groupingModel(v, s) : null, T = j(
2465
- () => D && D.levels.length ? { ...D, folded: C, compareText: r.compareText } : void 0,
2466
+ const r = ue(), s = e, i = n.modelColumns(s, r), [a] = H(() => t.initialView), [c, u] = H(() => Object.entries((a == null ? void 0 : a.conditions) ?? {})), h = $(() => ls(c, n), [c, n]), d = t.preFilter ?? t.filter, m = cs(s, d), [w, k] = H(
2467
+ () => a != null && a.grouping ? [...a.grouping] : Ge(t.defaultGrouping)
2468
+ ), [p, b] = H(() => (a == null ? void 0 : a.folded) ?? []), g = n.orderedColumns().length + n.groupKeys.entries.size > 0, _ = g ? n.effectiveGrouping(w, s) : w.slice(0, Qe), C = _.join("|"), S = $(() => new Set(p), [p]), I = _.length ? n.groupingModel(_, s) : null, x = $(
2469
+ () => I && I.levels.length ? { ...I, folded: S, compareText: r.compareText } : void 0,
2466
2470
  // eslint-disable-next-line react-hooks/exhaustive-deps -- the model's identity carries the ids and the columns
2467
- [D, C, r.compareText, N]
2468
- ), x = t.rowKey, _ = kn(b, i, {
2469
- rowKey: x,
2471
+ [I, S, r.compareText, C]
2472
+ ), A = t.rowKey, v = kn(m, i, {
2473
+ rowKey: A,
2470
2474
  pageSize: t.pageSize,
2471
2475
  defaultSort: t.defaultSort,
2472
2476
  filter: h,
2473
2477
  initialView: a,
2474
2478
  virtual: t.virtual,
2475
- grouping: T
2476
- }), { setPage: S } = _, O = X(
2479
+ grouping: x
2480
+ }), { setPage: F } = v, L = X(
2477
2481
  (y, R) => {
2478
- let q = R == null;
2479
- if (!q && n.orderedColumns().length > 0) {
2480
- const H = n.columnById(y), M = H ? me(H.spec.filter) : void 0;
2482
+ let K = R == null;
2483
+ if (!K && n.orderedColumns().length > 0) {
2484
+ const j = n.columnById(y), M = j ? me(j.spec.filter) : void 0;
2481
2485
  if (!M) {
2482
2486
  pe(
2483
2487
  `condition-without-filter:${y}`,
2484
- H ? `The column "${y}" has no filter; its condition is passed over.` : `No column is called "${y}"; its condition is passed over.`
2488
+ j ? `The column "${y}" has no filter; its condition is passed over.` : `No column is called "${y}"; its condition is passed over.`
2485
2489
  );
2486
2490
  return;
2487
2491
  }
2488
- const Q = Dt(M, R);
2489
- if (Q === "foreign") {
2492
+ const J = Dt(M, R);
2493
+ if (J === "foreign") {
2490
2494
  qt(y);
2491
2495
  return;
2492
2496
  }
2493
- q = Q === "empty";
2497
+ K = J === "empty";
2494
2498
  }
2495
- u((H) => {
2496
- const M = H.findIndex(([Q]) => Q === y);
2497
- return q ? M === -1 ? H : H.filter((Q, ne) => ne !== M) : M === -1 ? [...H, [y, R]] : H.map((Q, ne) => ne === M ? [y, R] : Q);
2498
- }), S(1);
2499
+ u((j) => {
2500
+ const M = j.findIndex(([J]) => J === y);
2501
+ return K ? M === -1 ? j : j.filter((J, Z) => Z !== M) : M === -1 ? [...j, [y, R]] : j.map((J, Z) => Z === M ? [y, R] : J);
2502
+ }), F(1);
2499
2503
  },
2500
- [n, S]
2501
- ), A = new Set(n.orderedColumns().map((y) => y.spec.id)), [I, $] = z(() => /* @__PURE__ */ new Set());
2502
- if (!fs(I, A)) {
2503
- const y = new Set([...I].filter((R) => !A.has(R)));
2504
- $(A), c.some(([R]) => y.has(R)) && u((R) => R.filter(([q]) => !y.has(q)));
2504
+ [n, F]
2505
+ ), N = new Set(n.orderedColumns().map((y) => y.spec.id)), [V, z] = H(() => /* @__PURE__ */ new Set());
2506
+ if (!fs(V, N)) {
2507
+ const y = new Set([...V].filter((R) => !N.has(R)));
2508
+ z(N), c.some(([R]) => y.has(R)) && u((R) => R.filter(([K]) => !y.has(K)));
2505
2509
  }
2506
- const G = A.size === 0 ? c : c.filter(([y, R]) => Yt(n, y, R)), W = us(_.view, A), ie = G.length > 0 ? { ...W, conditions: Object.fromEntries(G) } : W, ae = A.size === 0 ? _.sort : _.sort.filter((y) => A.has(y.column)), de = g ? n.effectiveGrouping(Ee(t.defaultGrouping), s) : Ee(t.defaultGrouping), fe = _.groups ? fn(_.groups, m) : g ? [] : [...m], we = {
2510
+ const P = N.size === 0 ? c : c.filter(([y, R]) => Yt(n, y, R)), q = us(v.view, N), ie = P.length > 0 ? { ...q, conditions: Object.fromEntries(P) } : q, ae = N.size === 0 ? v.sort : v.sort.filter((y) => N.has(y.column)), de = g ? n.effectiveGrouping(Ge(t.defaultGrouping), s) : Ge(t.defaultGrouping), fe = v.groups ? fn(v.groups, p) : g ? [] : [...p], we = {
2507
2511
  ...ie,
2508
- ...ds(v, de) ? {} : { grouping: v },
2512
+ ...ds(_, de) ? {} : { grouping: _ },
2509
2513
  ...fe.length ? { folded: fe } : {}
2510
2514
  }, be = (y) => {
2511
- k([...y]), S(1);
2515
+ k([...y]), F(1);
2512
2516
  }, ye = (y) => {
2513
- _t(_.groups).includes(y) && w((R) => R.includes(y) ? R.filter((q) => q !== y) : [...R, y]);
2517
+ _t(v.groups).includes(y) && (n.noteFocusBeforeFold(), b((R) => R.includes(y) ? R.filter((K) => K !== y) : [...R, y]));
2514
2518
  }, le = n.paginates() || t.virtual !== void 0, te = {
2515
2519
  rows: e,
2516
- filtered: _.filtered,
2517
- visible: le ? _.visible : _.filtered,
2518
- page: le ? _.page : 1,
2519
- pageCount: le ? _.pageCount : 1,
2520
- pageSize: _.pageSize,
2521
- setPage: _.setPage,
2522
- setPageSize: _.setPageSize,
2523
- search: _.search,
2524
- setSearch: _.setSearch,
2520
+ filtered: v.filtered,
2521
+ visible: le ? v.visible : v.filtered,
2522
+ page: le ? v.page : 1,
2523
+ pageCount: le ? v.pageCount : 1,
2524
+ pageSize: v.pageSize,
2525
+ setPage: v.setPage,
2526
+ setPageSize: v.setPageSize,
2527
+ search: v.search,
2528
+ setSearch: v.setSearch,
2525
2529
  sort: ae,
2526
- toggleSort: _.toggleSort,
2527
- hidden: _.hidden,
2528
- toggleColumn: _.toggleColumn,
2529
- order: _.order,
2530
- setOrder: _.setOrder,
2531
- widths: hs(i, _.widths),
2532
- setWidth: _.setWidth,
2533
- expanded: _.expanded,
2534
- toggleRow: _.toggleRow,
2535
- filter: Object.fromEntries(G),
2536
- setFilter: O,
2537
- selection: t.selection ?? _.selection,
2530
+ toggleSort: v.toggleSort,
2531
+ hidden: v.hidden,
2532
+ toggleColumn: v.toggleColumn,
2533
+ order: v.order,
2534
+ setOrder: v.setOrder,
2535
+ widths: hs(i, v.widths),
2536
+ setWidth: v.setWidth,
2537
+ expanded: v.expanded,
2538
+ toggleRow: v.toggleRow,
2539
+ filter: Object.fromEntries(P),
2540
+ setFilter: L,
2541
+ selection: t.selection ?? v.selection,
2538
2542
  view: we,
2539
- grouping: v,
2543
+ grouping: _,
2540
2544
  setGrouping: be,
2541
2545
  folded: fe,
2542
2546
  toggleFold: ye,
2543
- foldAll: () => w(_t(_.groups)),
2544
- unfoldAll: () => w([]),
2547
+ foldAll: () => {
2548
+ n.noteFocusBeforeFold(), b(_t(v.groups));
2549
+ },
2550
+ unfoldAll: () => {
2551
+ n.noteFocusBeforeFold(), b([]);
2552
+ },
2545
2553
  asCsv: () => xr(n),
2546
2554
  virtual: t.virtual !== void 0
2547
2555
  };
2548
2556
  return n.setHook({
2549
2557
  rows: s,
2550
- admitted: b,
2558
+ admitted: m,
2551
2559
  modelColumns: i,
2552
- companion: _,
2560
+ companion: v,
2553
2561
  filter: h,
2554
- grouping: T,
2555
- folded: C,
2562
+ grouping: x,
2563
+ folded: S,
2556
2564
  publicSnapshot: te,
2557
- rowKey: x,
2565
+ rowKey: A,
2558
2566
  formats: r
2559
2567
  }), { ...te, ...o };
2560
2568
  }
2561
- function Js(e) {
2569
+ function Xs(e) {
2562
2570
  return e;
2563
2571
  }
2564
2572
  function nt(e, t) {
2565
2573
  const n = se();
2566
- e == null || e.register(t, n), K(() => {
2574
+ e == null || e.register(t, n), W(() => {
2567
2575
  if (e)
2568
2576
  return e.register(t, n), e.commit(), () => {
2569
2577
  e.remove(t, n), e.commit();
@@ -2596,25 +2604,25 @@ function Zs({ placeholder: e, "aria-label": t, className: n, of: o }) {
2596
2604
  );
2597
2605
  }
2598
2606
  function ei({ of: e }) {
2599
- var w;
2600
- const t = xe(e), n = U(), [o, r] = z(!1), s = Z(null), i = Z(null), a = se(), [c, u] = z(null);
2601
- if (K(() => {
2602
- var C;
2607
+ var b;
2608
+ const t = xe(e), n = U(), [o, r] = H(!1), s = re(null), i = re(null), a = se(), [c, u] = H(null);
2609
+ if (W(() => {
2610
+ var S;
2603
2611
  if (!c || !i.current) return;
2604
2612
  const g = Array.from(i.current.children).find(
2605
- (D) => D.dataset.column === c.id
2606
- ), v = g == null ? void 0 : g.querySelector(`[data-direction="${c.direction}"]`), N = g == null ? void 0 : g.querySelector(
2613
+ (I) => I.dataset.column === c.id
2614
+ ), _ = g == null ? void 0 : g.querySelector(`[data-direction="${c.direction}"]`), C = g == null ? void 0 : g.querySelector(
2607
2615
  `[data-direction="${c.direction === "forward" ? "backward" : "forward"}"]`
2608
2616
  );
2609
- (C = v && !v.disabled ? v : N) == null || C.focus();
2617
+ (S = _ && !_.disabled ? _ : C) == null || S.focus();
2610
2618
  }, [c]), !t) return null;
2611
- const { registry: h, snapshot: f } = t, b = h.hook, p = h.withStickyHeaderFirst(
2612
- et(h.modelColumns(b.rows, b.formats), f.order)
2613
- ), k = h.stickyRowHeader ? ((w = p[0]) == null ? void 0 : w.hideable) === !1 : !1, m = (g, v) => {
2614
- const N = p.map((D) => D.id), C = g + v;
2615
- C < 0 || C >= N.length || ([N[g], N[C]] = [N[C], N[g]], f.setOrder(N), u({ id: p[g].id, direction: v < 0 ? "forward" : "backward" }));
2619
+ const { registry: h, snapshot: d } = t, m = h.hook, w = h.withStickyHeaderFirst(
2620
+ et(h.modelColumns(m.rows, m.formats), d.order)
2621
+ ), k = h.stickyRowHeader ? ((b = w[0]) == null ? void 0 : b.hideable) === !1 : !1, p = (g, _) => {
2622
+ const C = w.map((I) => I.id), S = g + _;
2623
+ S < 0 || S >= C.length || ([C[g], C[S]] = [C[S], C[g]], d.setOrder(C), u({ id: w[g].id, direction: _ < 0 ? "forward" : "backward" }));
2616
2624
  };
2617
- return /* @__PURE__ */ L(J, { children: [
2625
+ return /* @__PURE__ */ O(Q, { children: [
2618
2626
  /* @__PURE__ */ l(
2619
2627
  ee,
2620
2628
  {
@@ -2627,7 +2635,7 @@ function ei({ of: e }) {
2627
2635
  children: n.columns
2628
2636
  }
2629
2637
  ),
2630
- /* @__PURE__ */ L(
2638
+ /* @__PURE__ */ O(
2631
2639
  St,
2632
2640
  {
2633
2641
  open: o,
@@ -2637,29 +2645,29 @@ function ei({ of: e }) {
2637
2645
  role: "dialog",
2638
2646
  ariaLabel: n.arrangeColumns,
2639
2647
  id: a,
2640
- className: d.columnsPanel,
2648
+ className: f.columnsPanel,
2641
2649
  children: [
2642
- /* @__PURE__ */ l("ul", { ref: i, className: d.columnsList, "aria-label": n.arrangeColumns, children: p.map((g, v) => {
2643
- const N = g.label ?? g.id;
2644
- return /* @__PURE__ */ L("li", { className: d.columnsEntry, "data-column": g.id, children: [
2650
+ /* @__PURE__ */ l("ul", { ref: i, className: f.columnsList, "aria-label": n.arrangeColumns, children: w.map((g, _) => {
2651
+ const C = g.label ?? g.id;
2652
+ return /* @__PURE__ */ O("li", { className: f.columnsEntry, "data-column": g.id, children: [
2645
2653
  /* @__PURE__ */ l(
2646
2654
  Se,
2647
2655
  {
2648
- label: N,
2649
- checked: !f.hidden.includes(g.id),
2656
+ label: C,
2657
+ checked: !d.hidden.includes(g.id),
2650
2658
  disabled: g.hideable === !1,
2651
- onChange: () => f.toggleColumn(g.id)
2659
+ onChange: () => d.toggleColumn(g.id)
2652
2660
  }
2653
2661
  ),
2654
2662
  /* @__PURE__ */ l(
2655
2663
  "button",
2656
2664
  {
2657
2665
  type: "button",
2658
- className: d.move,
2666
+ className: f.move,
2659
2667
  "data-direction": "forward",
2660
- "aria-label": n.columnForward(N),
2661
- disabled: v === 0 || k && v <= 1,
2662
- onClick: () => m(v, -1),
2668
+ "aria-label": n.columnForward(C),
2669
+ disabled: _ === 0 || k && _ <= 1,
2670
+ onClick: () => p(_, -1),
2663
2671
  children: /* @__PURE__ */ l("svg", { viewBox: "0 0 10 10", width: "10", height: "10", "aria-hidden": "true", children: /* @__PURE__ */ l("path", { d: "M2 6.5 5 3.5l3 3", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) })
2664
2672
  }
2665
2673
  ),
@@ -2667,17 +2675,17 @@ function ei({ of: e }) {
2667
2675
  "button",
2668
2676
  {
2669
2677
  type: "button",
2670
- className: d.move,
2678
+ className: f.move,
2671
2679
  "data-direction": "backward",
2672
- "aria-label": n.columnBackward(N),
2673
- disabled: v === p.length - 1 || k && v === 0,
2674
- onClick: () => m(v, 1),
2680
+ "aria-label": n.columnBackward(C),
2681
+ disabled: _ === w.length - 1 || k && _ === 0,
2682
+ onClick: () => p(_, 1),
2675
2683
  children: /* @__PURE__ */ l("svg", { viewBox: "0 0 10 10", width: "10", height: "10", "aria-hidden": "true", children: /* @__PURE__ */ l("path", { d: "M2 3.5 5 6.5l3-3", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) })
2676
2684
  }
2677
2685
  )
2678
2686
  ] }, g.id);
2679
2687
  }) }),
2680
- /* @__PURE__ */ l(Tr, { registry: h, hook: b })
2688
+ /* @__PURE__ */ l(Tr, { registry: h, hook: m })
2681
2689
  ]
2682
2690
  }
2683
2691
  )
@@ -2700,10 +2708,10 @@ function ti({ filename: e, onExport: t, of: n }) {
2700
2708
  function ni({ pageSizes: e = [10, 25, 50], className: t, of: n }) {
2701
2709
  const o = xe(n), r = U(), s = ue();
2702
2710
  if (nt(o == null ? void 0 : o.registry, "pagination"), !o || o.snapshot.virtual) return null;
2703
- const { snapshot: i } = o, a = i.filtered.length, c = e.includes(i.pageSize) ? e : [...e, i.pageSize].sort((h, f) => h - f), u = /* @__PURE__ */ L("nav", { "aria-label": r.pagination, className: E(d.pagination, t), children: [
2711
+ const { snapshot: i } = o, a = i.filtered.length, c = e.includes(i.pageSize) ? e : [...e, i.pageSize].sort((h, d) => h - d), u = /* @__PURE__ */ O("nav", { "aria-label": r.pagination, className: G(f.pagination, t), children: [
2704
2712
  /* @__PURE__ */ l("span", { children: r.entries(a, s.count(a)) }),
2705
- /* @__PURE__ */ L("div", { className: d.paginationControls, children: [
2706
- /* @__PURE__ */ L("label", { className: d.pageSize, children: [
2713
+ /* @__PURE__ */ O("div", { className: f.paginationControls, children: [
2714
+ /* @__PURE__ */ O("label", { className: f.pageSize, children: [
2707
2715
  r.rows,
2708
2716
  /* @__PURE__ */ l(
2709
2717
  nn,
@@ -2716,7 +2724,7 @@ function ni({ pageSizes: e = [10, 25, 50], className: t, of: n }) {
2716
2724
  }
2717
2725
  )
2718
2726
  ] }),
2719
- /* @__PURE__ */ l("span", { className: d.paginationStatus, children: r.pageOfPages(i.page, i.pageCount) }),
2727
+ /* @__PURE__ */ l("span", { className: f.paginationStatus, children: r.pageOfPages(i.page, i.pageCount) }),
2720
2728
  /* @__PURE__ */ l(ee, { size: "sm", disabled: i.page <= 1, onClick: () => i.setPage(i.page - 1), children: r.previousPage }),
2721
2729
  /* @__PURE__ */ l(ee, { size: "sm", disabled: i.page >= i.pageCount, onClick: () => i.setPage(i.page + 1), children: r.nextPage })
2722
2730
  ] })
@@ -2812,35 +2820,35 @@ function ii(e, t = {}) {
2812
2820
  flood: i,
2813
2821
  keepDone: a = !1,
2814
2822
  columns: c = xs
2815
- } = e, u = new Map(o.map((m) => [m.id, m])), h = vs(n, (s == null ? void 0 : s.windowMs) ?? 1 / 0, r), f = i ? Cs(n, i, r) : null, b = new Set((f == null ? void 0 : f.alarms) ?? []), p = n.filter((m) => a || !bs(m.lifecycle)).map((m) => {
2816
- const w = u.get(m.type) ?? Ts(m.type), g = h.get(m.type) ?? 0;
2823
+ } = e, u = new Map(o.map((p) => [p.id, p])), h = vs(n, (s == null ? void 0 : s.windowMs) ?? 1 / 0, r), d = i ? Cs(n, i, r) : null, m = new Set((d == null ? void 0 : d.alarms) ?? []), w = n.filter((p) => a || !bs(p.lifecycle)).map((p) => {
2824
+ const b = u.get(p.type) ?? Ts(p.type), g = h.get(p.type) ?? 0;
2817
2825
  return {
2818
- id: m.id,
2819
- alarm: m,
2820
- type: w,
2821
- lifecycle: m.lifecycle,
2822
- priority: w.priority,
2823
- rank: ms(w.priority),
2824
- age: r - m.raised,
2825
- duration: (m.cleared ?? r) - m.raised,
2826
+ id: p.id,
2827
+ alarm: p,
2828
+ type: b,
2829
+ lifecycle: p.lifecycle,
2830
+ priority: b.priority,
2831
+ rank: ms(b.priority),
2832
+ age: r - p.raised,
2833
+ duration: (p.cleared ?? r) - p.raised,
2826
2834
  frequency: g,
2827
2835
  chatters: s !== void 0 && g >= s.atLeast,
2828
- inFlood: b.has(m.id)
2836
+ inFlood: m.has(p.id)
2829
2837
  };
2830
- }), k = tt(p, c, {
2838
+ }), k = tt(w, c, {
2831
2839
  ...t,
2832
2840
  sort: t.sort === void 0 ? As : t.sort
2833
2841
  });
2834
2842
  return {
2835
2843
  ...k,
2836
- flood: f,
2844
+ flood: d,
2837
2845
  standingUnacknowledged: k.filtered.reduce(
2838
- (m, w) => m + (w.lifecycle === "standing-unacknowledged" ? 1 : 0),
2846
+ (p, b) => p + (b.lifecycle === "standing-unacknowledged" ? 1 : 0),
2839
2847
  0
2840
2848
  )
2841
2849
  };
2842
2850
  }
2843
- const Fs = "_list_alpwk_4 _text_1hv7a_23", Os = "_bar_alpwk_12", Ls = "_heading_alpwk_19", Rs = "_filler_alpwk_25", Ms = "_asOf_alpwk_29", Vs = "_live_alpwk_46", Ds = "_label_alpwk_51", Is = "_counter_alpwk_55", Ps = "_lifecycle_alpwk_59", Gs = "_empty_alpwk_63", Es = "_row_alpwk_70", re = {
2851
+ const Fs = "_list_17f0w_4 _text_1hv7a_23", Os = "_bar_17f0w_12", Ls = "_heading_17f0w_19", Rs = "_filler_17f0w_25", Ms = "_asOf_17f0w_29", Vs = "_live_17f0w_46", Ds = "_label_17f0w_51", Is = "_counter_17f0w_55", Bs = "_lifecycle_17f0w_59", Ps = "_empty_17f0w_63", Gs = "_row_17f0w_70", oe = {
2844
2852
  list: Fs,
2845
2853
  bar: Os,
2846
2854
  heading: Ls,
@@ -2849,11 +2857,11 @@ const Fs = "_list_alpwk_4 _text_1hv7a_23", Os = "_bar_alpwk_12", Ls = "_heading_
2849
2857
  live: Vs,
2850
2858
  label: Ds,
2851
2859
  counter: Is,
2852
- lifecycle: Ps,
2853
- empty: Gs,
2854
- row: Es
2860
+ lifecycle: Bs,
2861
+ empty: Ps,
2862
+ row: Gs
2855
2863
  };
2856
- function Bs(e, t) {
2864
+ function Es(e, t) {
2857
2865
  switch (e) {
2858
2866
  case "standing-unacknowledged":
2859
2867
  return t.lifecycleStandingUnacknowledged;
@@ -2896,37 +2904,37 @@ function Ut({
2896
2904
  freshness: s,
2897
2905
  ...i
2898
2906
  }) {
2899
- const a = U(), c = ue(), u = s !== null, h = (s == null ? void 0 : s.freshness) === "lost", { Table: f, Column: b } = gs(e.visible, { rowKey: (g) => g.id, selection: t }), p = j(() => e.filtered.map((g) => g.alarm), [e.filtered]), k = j(() => t === void 0 ? [] : e.filtered.map((g) => g.id).filter((g) => t.selected.has(g)), [e.filtered, t]), m = j(() => Ss(p, k), [p, k]), w = Tt(o, "compact");
2900
- return /* @__PURE__ */ L("div", { className: [re.list, r].filter(Boolean).join(" "), ...i, children: [
2901
- /* @__PURE__ */ L("div", { className: re.bar, children: [
2902
- /* @__PURE__ */ l("span", { className: re.heading, children: a.alarms }),
2907
+ const a = U(), c = ue(), u = s !== null, h = (s == null ? void 0 : s.freshness) === "lost", { Table: d, Column: m } = gs(e.visible, { rowKey: (g) => g.id, selection: t }), w = $(() => e.filtered.map((g) => g.alarm), [e.filtered]), k = $(() => t === void 0 ? [] : e.filtered.map((g) => g.id).filter((g) => t.selected.has(g)), [e.filtered, t]), p = $(() => Ss(w, k), [w, k]), b = Tt(o, "compact");
2908
+ return /* @__PURE__ */ O("div", { className: [oe.list, r].filter(Boolean).join(" "), ...i, children: [
2909
+ /* @__PURE__ */ O("div", { className: oe.bar, children: [
2910
+ /* @__PURE__ */ l("span", { className: oe.heading, children: a.alarms }),
2903
2911
  e.flood !== null && /* @__PURE__ */ l(Ie, { tone: "warning", children: a.floodHint(e.flood.count) }),
2904
- u && s !== null && /* @__PURE__ */ L("span", { className: re.asOf, "data-freshness": s.freshness, children: [
2912
+ u && s !== null && /* @__PURE__ */ O("span", { className: oe.asOf, "data-freshness": s.freshness, children: [
2905
2913
  s.freshness === "lost" ? a.freshnessDisconnected : s.freshness === "stale" ? a.freshnessStale : a.freshnessFresh,
2906
2914
  s.age !== null && ` · ${c.relative(s.age)}`
2907
2915
  ] }),
2908
- /* @__PURE__ */ l("span", { className: re.filler }),
2909
- t !== void 0 && n !== void 0 && /* @__PURE__ */ l(ee, { variant: "primary", size: "sm", disabled: m === 0, onClick: () => n(k), children: m === 0 ? a.acknowledgeAlarm : a.acknowledgeAlarms(m) })
2916
+ /* @__PURE__ */ l("span", { className: oe.filler }),
2917
+ t !== void 0 && n !== void 0 && /* @__PURE__ */ l(ee, { variant: "primary", size: "sm", disabled: p === 0, onClick: () => n(k), children: p === 0 ? a.acknowledgeAlarm : a.acknowledgeAlarms(p) })
2910
2918
  ] }),
2911
- /* @__PURE__ */ l("div", { "aria-live": "polite", "aria-atomic": "true", className: re.live, children: a.standingUnacknowledged(e.standingUnacknowledged) }),
2912
- /* @__PURE__ */ L(
2913
- f,
2919
+ /* @__PURE__ */ l("div", { "aria-live": "polite", "aria-atomic": "true", className: oe.live, children: a.standingUnacknowledged(e.standingUnacknowledged) }),
2920
+ /* @__PURE__ */ O(
2921
+ d,
2914
2922
  {
2915
2923
  ariaLabel: a.alarms,
2916
2924
  selectable: t !== void 0,
2917
- density: w,
2925
+ density: b,
2918
2926
  stickyHeader: !0,
2919
- rowProps: (g) => ({ className: re.row, "data-lifecycle": g.lifecycle, "data-priority": g.priority }),
2920
- empty: /* @__PURE__ */ l("span", { className: re.empty, children: h ? a.noAlarmsDisconnected : a.noAlarms }),
2927
+ rowProps: (g) => ({ className: oe.row, "data-lifecycle": g.lifecycle, "data-priority": g.priority }),
2928
+ empty: /* @__PURE__ */ l("span", { className: oe.empty, children: h ? a.noAlarmsDisconnected : a.noAlarms }),
2921
2929
  children: [
2922
- /* @__PURE__ */ l(b, { id: "type", label: a.columnAlarm, value: (g) => g.type.label, rowHeader: !0, sortable: !1, children: (g, v) => /* @__PURE__ */ L(J, { children: [
2923
- /* @__PURE__ */ l("span", { className: re.label, children: g }),
2924
- v.chatters && /* @__PURE__ */ l(Ie, { tone: "warning", pill: !0, className: re.counter, children: a.chatterHint(v.frequency) })
2930
+ /* @__PURE__ */ l(m, { id: "type", label: a.columnAlarm, value: (g) => g.type.label, rowHeader: !0, sortable: !1, children: (g, _) => /* @__PURE__ */ O(Q, { children: [
2931
+ /* @__PURE__ */ l("span", { className: oe.label, children: g }),
2932
+ _.chatters && /* @__PURE__ */ l(Ie, { tone: "warning", pill: !0, className: oe.counter, children: a.chatterHint(_.frequency) })
2925
2933
  ] }) }),
2926
- /* @__PURE__ */ l(b, { value: "lifecycle", label: a.columnLifecycleState, sortable: !1, children: (g) => /* @__PURE__ */ l("span", { className: re.lifecycle, children: Bs(g, a) }) }),
2927
- /* @__PURE__ */ l(b, { value: "priority", label: a.columnPriority, sortable: !1, children: (g) => /* @__PURE__ */ l(Ie, { tone: js(g), children: zs(g, a) }) }),
2934
+ /* @__PURE__ */ l(m, { value: "lifecycle", label: a.columnLifecycleState, sortable: !1, children: (g) => /* @__PURE__ */ l("span", { className: oe.lifecycle, children: Es(g, a) }) }),
2935
+ /* @__PURE__ */ l(m, { value: "priority", label: a.columnPriority, sortable: !1, children: (g) => /* @__PURE__ */ l(Ie, { tone: js(g), children: zs(g, a) }) }),
2928
2936
  /* @__PURE__ */ l(
2929
- b,
2937
+ m,
2930
2938
  {
2931
2939
  id: "raised",
2932
2940
  label: a.columnRaised,
@@ -2935,8 +2943,8 @@ function Ut({
2935
2943
  sortable: !1
2936
2944
  }
2937
2945
  ),
2938
- /* @__PURE__ */ l(b, { value: "duration", label: a.columnDuration, sortable: !1, children: (g) => Hs(g, a) }),
2939
- /* @__PURE__ */ l(b, { value: "frequency", label: a.columnFrequency, format: "count", sortable: !1 })
2946
+ /* @__PURE__ */ l(m, { value: "duration", label: a.columnDuration, sortable: !1, children: (g) => Hs(g, a) }),
2947
+ /* @__PURE__ */ l(m, { value: "frequency", label: a.columnFrequency, format: "count", sortable: !1 })
2940
2948
  ]
2941
2949
  }
2942
2950
  )
@@ -2955,8 +2963,8 @@ export {
2955
2963
  si as acknowledge,
2956
2964
  Ns as alarmColumns,
2957
2965
  ii as alarmModel,
2958
- Js as column,
2959
- Xs as columnFilter,
2966
+ Xs as column,
2967
+ Js as columnFilter,
2960
2968
  Ss as countAcknowledgeable,
2961
2969
  ri as countInWindow,
2962
2970
  Cs as detectFlood,