@nivaro/react 0.3.111 → 0.3.113

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. package/dist/full.css +1 -1
  2. package/dist/hooks/useSessionRecorder.js +1 -1
  3. package/dist/index.d.ts +207 -3
  4. package/dist/index.js +745 -728
  5. package/dist/shared/components/CollectionBrowserView.js +3133 -2954
  6. package/dist/shared/components/CollectionImportBanner.js +135 -0
  7. package/dist/shared/components/ItemEditForm.js +2235 -2218
  8. package/dist/shared/components/JobsTray.js +54 -47
  9. package/dist/shared/components/ViewAsPersonButton.js +109 -0
  10. package/dist/shared/components/bulk/BulkFieldUpdate.js +228 -150
  11. package/dist/shared/components/bulk/BulkFieldUpdateButton.js +35 -41
  12. package/dist/shared/components/bulk/BulkLinksValue.js +91 -0
  13. package/dist/shared/components/bulk/bulk-field-options.js +20 -19
  14. package/dist/shared/components/bulk/bulk-update-preview.js +39 -0
  15. package/dist/shared/components/cbv/ColumnHeaderMenu.js +130 -0
  16. package/dist/shared/components/cbv/column-totals.js +163 -0
  17. package/dist/shared/components/collections-directory/CollectionHoverCard.js +108 -81
  18. package/dist/shared/components/collections-directory/CollectionRow.js +164 -148
  19. package/dist/shared/components/collections-directory/CollectionsDirectory.js +167 -166
  20. package/dist/shared/components/collections-directory/directory-data.js +70 -58
  21. package/dist/shared/components/imports/CollectionImportPanel.js +120 -118
  22. package/dist/shared/components/imports/DefinitionsPanel.js +24 -24
  23. package/dist/shared/components/imports/ImportDuplicatesNotice.js +65 -0
  24. package/dist/shared/components/item-edit/CatalogPickerField.js +631 -639
  25. package/dist/shared/components/item-edit/DuplicateNotice.js +168 -0
  26. package/dist/shared/components/item-edit/FieldRow.js +248 -246
  27. package/dist/shared/components/item-edit/InlineGridField.js +34 -33
  28. package/dist/shared/components/item-edit/InlineTableField.js +3002 -2825
  29. package/dist/shared/components/item-edit/MembershipSetField.js +165 -169
  30. package/dist/shared/components/item-edit/NestedRelationEditor.js +184 -189
  31. package/dist/shared/components/item-edit/PlanGrid.js +2 -1
  32. package/dist/shared/components/item-edit/QuickPickerDialog.js +35 -34
  33. package/dist/shared/components/item-edit/RecordLiveSync.js +32 -30
  34. package/dist/shared/components/item-edit/RelationCombobox.js +101 -100
  35. package/dist/shared/components/item-edit/RowHistorySheet.js +28 -27
  36. package/dist/shared/components/item-edit/SummaryPanel.js +133 -135
  37. package/dist/shared/components/item-edit/UserChip.js +262 -239
  38. package/dist/shared/components/item-edit/ViewAsRole.js +129 -52
  39. package/dist/shared/components/item-edit/grid-search.js +375 -0
  40. package/dist/shared/components/item-edit/render-stability.js +61 -54
  41. package/dist/shared/components/notifications/NotificationRulesEditor.js +25 -20
  42. package/dist/shared/components/ops-report/DigestSections.js +163 -144
  43. package/dist/shared/components/ops-report/drill.js +97 -97
  44. package/dist/shared/components/panels/AddendumLinesDiff.js +52 -51
  45. package/dist/shared/components/panels/AddendumPanel.js +92 -91
  46. package/dist/shared/components/panels/AsyncUserPicker.js +108 -0
  47. package/dist/shared/components/panels/CommentPanel.js +265 -252
  48. package/dist/shared/components/panels/OwnersSlot.js +47 -35
  49. package/dist/shared/components/panels/PipelineInsight.js +186 -0
  50. package/dist/shared/components/panels/PipelinePanel.js +1440 -1397
  51. package/dist/shared/components/panels/RecordIntegrityBanner.js +39 -38
  52. package/dist/shared/components/panels/RevisionsPanel.js +261 -260
  53. package/dist/shared/components/panels/StandInReason.js +69 -0
  54. package/dist/shared/components/pipeline/FieldPicker.js +41 -40
  55. package/dist/shared/components/pipeline/OwnerMatrix.js +829 -700
  56. package/dist/shared/components/pipeline/OwnerRecordTrial.js +362 -0
  57. package/dist/shared/components/pipeline/PipelineEditorView.js +483 -467
  58. package/dist/shared/components/pipeline/PipelineStateOwners.js +65 -64
  59. package/dist/shared/components/pipeline/owner-matrix-draft.js +178 -0
  60. package/dist/shared/components/profile/MyDefaultsCard.js +36 -35
  61. package/dist/shared/components/profile/PersonHeader.js +29 -29
  62. package/dist/shared/components/profile/PersonProfile.js +30 -28
  63. package/dist/shared/components/profile/SlowScreensCard.js +286 -0
  64. package/dist/shared/components/queue/QueueWorklist.js +1090 -1071
  65. package/dist/shared/components/quick-filters/useQuickFilterEditing.js +45 -44
  66. package/dist/shared/components/support/TicketDetailSheet.js +25 -16
  67. package/dist/shared/components/support/TicketSlowScreens.js +32 -0
  68. package/dist/shared/lib/activity-sentence.js +224 -178
  69. package/dist/shared/lib/collection-import-banner.js +27 -0
  70. package/dist/shared/lib/crash-report.js +112 -0
  71. package/dist/shared/lib/export-runs.js +99 -0
  72. package/dist/shared/lib/jobs-tray.js +89 -67
  73. package/dist/shared/lib/list-link.js +76 -69
  74. package/dist/shared/lib/nav-trail.js +180 -76
  75. package/dist/shared/lib/query-keys.js +26 -0
  76. package/dist/shared/lib/view-as.js +16 -11
  77. package/package.json +1 -1
@@ -4,35 +4,35 @@ import { ArrowLeft as z, ChevronRight as B, ExternalLink as j } from "lucide-rea
4
4
  import { useState as A, useCallback as U, useMemo as X, Suspense as V, createContext as W, useEffect as Y, lazy as Z, useContext as ee } from "react";
5
5
  import { useNavigation as te, useNivaroClient as re } from "../../context.js";
6
6
  import { get as ne } from "../../lib/commands.js";
7
- import { cn as k } from "../../lib/utils.js";
7
+ import { cn as f } from "../../lib/utils.js";
8
8
  import { QueryErrorState as ae } from "../QueryErrorState.js";
9
9
  import { Sheet as le, SheetContent as ie, SheetTitle as oe, SheetDescription as de } from "../ui/sheet.js";
10
10
  import { Skeleton as q } from "../ui/skeleton.js";
11
11
  import { Chip as se } from "./chip.js";
12
12
  import { num as S, ms as H } from "./format.js";
13
13
  const ce = Z(
14
- () => import("../RecordDrilldownSheet.js").then((a) => ({ default: a.RecordDrilldownSheet }))
14
+ () => import("../RecordDrilldownSheet.js").then((l) => ({ default: l.RecordDrilldownSheet }))
15
15
  ), M = W(null);
16
16
  function me() {
17
17
  return ee(M);
18
18
  }
19
19
  function Pe({
20
- target: a,
20
+ target: l,
21
21
  children: r,
22
- className: l,
22
+ className: i,
23
23
  tip: c
24
24
  }) {
25
25
  const n = me();
26
- return !n || !a ? /* @__PURE__ */ e(y, { children: r }) : /* @__PURE__ */ e(
26
+ return !n || !l ? /* @__PURE__ */ e(y, { children: r }) : /* @__PURE__ */ e(
27
27
  "button",
28
28
  {
29
29
  type: "button",
30
- "data-ops-drill": a.metric,
30
+ "data-ops-drill": l.metric,
31
31
  "data-tip": c ?? "Show the rows behind this",
32
- onClick: () => n.open(a),
33
- className: k(
32
+ onClick: () => n.open(l),
33
+ className: f(
34
34
  "cursor-pointer text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan/50",
35
- l
35
+ i
36
36
  ),
37
37
  children: r
38
38
  }
@@ -52,27 +52,27 @@ const ue = [
52
52
  "border-emerald-200 bg-emerald-50 text-emerald-800 dark:border-emerald-500/30 dark:bg-emerald-500/10 dark:text-emerald-300"
53
53
  ]
54
54
  ], T = /* @__PURE__ */ new Set(["number", "ms", "usd"]), pe = /^(GET|POST|PUT|PATCH|DELETE|HEAD|OPTIONS)\s+(\S.*)$/, xe = 90;
55
- function be(a) {
56
- return a >= 500 ? "border-red-200 bg-red-50 text-red-800 dark:border-red-500/30 dark:bg-red-500/10 dark:text-red-300" : a >= 400 ? "border-amber-200 bg-amber-50 text-amber-800 dark:border-amber-500/30 dark:bg-amber-500/10 dark:text-amber-300" : "border-slate-200 bg-slate-50 text-slate-600 dark:border-border dark:bg-muted dark:text-muted-foreground";
55
+ function be(l) {
56
+ return l >= 500 ? "border-red-200 bg-red-50 text-red-800 dark:border-red-500/30 dark:bg-red-500/10 dark:text-red-300" : l >= 400 ? "border-amber-200 bg-amber-50 text-amber-800 dark:border-amber-500/30 dark:bg-amber-500/10 dark:text-amber-300" : "border-slate-200 bg-slate-50 text-slate-600 dark:border-border dark:bg-muted dark:text-muted-foreground";
57
57
  }
58
- function he({ col: a, value: r }) {
58
+ function he({ col: l, value: r }) {
59
59
  var c;
60
60
  if (r == null || r === "" || r === "–" || r === "-")
61
61
  return /* @__PURE__ */ e("span", { className: "text-slate-300 dark:text-muted-foreground/50", children: "–" });
62
- const l = typeof r == "number" ? r : Number(r);
63
- switch (a.type) {
62
+ const i = typeof r == "number" ? r : Number(r);
63
+ switch (l.type) {
64
64
  case "number":
65
- return /* @__PURE__ */ e(y, { children: Number.isFinite(l) ? S(l, Number.isInteger(l) ? 0 : 1) : String(r) });
65
+ return /* @__PURE__ */ e(y, { children: Number.isFinite(i) ? S(i, Number.isInteger(i) ? 0 : 1) : String(r) });
66
66
  case "ms":
67
- return Number.isFinite(l) ? /* @__PURE__ */ e("span", { className: k(l >= 5e3 && "font-medium text-amber-700 dark:text-amber-400"), children: H(l) }) : /* @__PURE__ */ e(y, { children: String(r) });
67
+ return Number.isFinite(i) ? /* @__PURE__ */ e("span", { className: f(i >= 5e3 && "font-medium text-amber-700 dark:text-amber-400"), children: H(i) }) : /* @__PURE__ */ e(y, { children: String(r) });
68
68
  case "usd":
69
- return /* @__PURE__ */ e(y, { children: Number.isFinite(l) ? `$${l.toLocaleString("en-US", { maximumFractionDigits: l < 10 ? 2 : 0 })}` : String(r) });
69
+ return /* @__PURE__ */ e(y, { children: Number.isFinite(i) ? `$${i.toLocaleString("en-US", { maximumFractionDigits: i < 10 ? 2 : 0 })}` : String(r) });
70
70
  case "status": {
71
- const n = String(r), s = /^\d{3}$/.test(n) ? be(Number(n)) : (c = ue.find(([h]) => h.test(n))) == null ? void 0 : c[1];
71
+ const n = String(r), s = /^\d{3}$/.test(n) ? be(Number(n)) : (c = ue.find(([b]) => b.test(n))) == null ? void 0 : c[1];
72
72
  return /* @__PURE__ */ e(
73
73
  se,
74
74
  {
75
- className: k(
75
+ className: f(
76
76
  "tabular-nums",
77
77
  s ?? "border-slate-200 bg-slate-50 text-slate-700 dark:border-border dark:bg-muted dark:text-muted-foreground"
78
78
  ),
@@ -91,79 +91,79 @@ function he({ col: a, value: r }) {
91
91
  }
92
92
  }
93
93
  }
94
- function ge(a, r, l, c) {
95
- const n = a._drill_metric, s = a._drill_key, h = r[0] ? a[r[0].key] : null, b = h == null ? void 0 : String(h), g = a._record_collection, o = a._record_id;
96
- if (typeof g == "string" && g !== "" && o != null && o !== "")
97
- return () => c(g, String(o), b);
98
- if (n) return () => l({ metric: n, key: s == null ? null : String(s), label: b });
94
+ function ge(l, r, i, c) {
95
+ const n = l._drill_metric, s = l._drill_key, b = r[0] ? l[r[0].key] : null, x = b == null ? void 0 : String(b), h = l._record_collection, a = l._record_id;
96
+ if (typeof h == "string" && h !== "" && a != null && a !== "")
97
+ return () => c(h, String(a), x);
98
+ if (n) return () => i({ metric: n, key: s == null ? null : String(s), label: x });
99
99
  }
100
- function fe({ stats: a }) {
101
- const r = a.length === 6 ? "grid-cols-3 sm:grid-cols-6" : a.length === 4 ? "grid-cols-2 sm:grid-cols-4" : a.length <= 3 ? "grid-cols-3" : "grid-cols-2 sm:grid-cols-3";
100
+ function fe({ stats: l }) {
101
+ const r = l.length === 6 ? "grid-cols-3 sm:grid-cols-6" : l.length === 4 ? "grid-cols-2 sm:grid-cols-4" : l.length <= 3 ? "grid-cols-3" : "grid-cols-2 sm:grid-cols-3";
102
102
  return /* @__PURE__ */ e(
103
103
  "dl",
104
104
  {
105
105
  "data-ops-drill-stats": "",
106
- className: k(
106
+ className: f(
107
107
  "grid gap-px overflow-hidden rounded-lg border border-slate-200 bg-slate-200 dark:border-border dark:bg-border",
108
108
  r
109
109
  ),
110
- children: a.map((l) => {
111
- const c = typeof l.value == "number" ? l.value : Number(l.value), n = l.value != null && l.value !== "" && Number.isFinite(c), s = n ? l.format === "ms" ? H(c) : S(c, Number.isInteger(c) ? 0 : 1) : l.value ?? "–";
110
+ children: l.map((i) => {
111
+ const c = typeof i.value == "number" ? i.value : Number(i.value), n = i.value != null && i.value !== "" && Number.isFinite(c), s = n ? i.format === "ms" ? H(c) : S(c, Number.isInteger(c) ? 0 : 1) : i.value ?? "–";
112
112
  return /* @__PURE__ */ d("div", { className: "bg-white px-3 py-2.5 dark:bg-card", children: [
113
- /* @__PURE__ */ e("dt", { className: "truncate text-[11px] text-slate-500 dark:text-muted-foreground", children: l.label }),
113
+ /* @__PURE__ */ e("dt", { className: "truncate text-[11px] text-slate-500 dark:text-muted-foreground", children: i.label }),
114
114
  /* @__PURE__ */ e(
115
115
  "dd",
116
116
  {
117
- className: k(
117
+ className: f(
118
118
  "mt-0.5 text-[17px] font-semibold leading-tight tabular-nums",
119
- l.tone && n && c === 0 ? "text-slate-400 dark:text-muted-foreground" : l.tone === "bad" && n ? "text-red-600 dark:text-red-400" : l.tone === "warn" && n ? "text-amber-600 dark:text-amber-400" : "text-slate-900 dark:text-foreground"
119
+ i.tone && n && c === 0 ? "text-slate-400 dark:text-muted-foreground" : i.tone === "bad" && n ? "text-red-600 dark:text-red-400" : i.tone === "warn" && n ? "text-amber-600 dark:text-amber-400" : "text-slate-900 dark:text-foreground"
120
120
  ),
121
121
  children: s
122
122
  }
123
123
  )
124
- ] }, l.label);
124
+ ] }, i.label);
125
125
  })
126
126
  }
127
127
  );
128
128
  }
129
- function ke(a, r) {
130
- if (r !== "json") return a;
129
+ function ke(l, r) {
130
+ if (r !== "json") return l;
131
131
  try {
132
- return JSON.stringify(JSON.parse(a), null, 2);
132
+ return JSON.stringify(JSON.parse(l), null, 2);
133
133
  } catch {
134
- return a;
134
+ return l;
135
135
  }
136
136
  }
137
137
  function Ne({
138
- reportId: a,
138
+ reportId: l,
139
139
  target: r,
140
- onTitle: l,
140
+ onTitle: i,
141
141
  onDrill: c,
142
142
  onLink: n,
143
143
  onRecord: s
144
144
  }) {
145
145
  var L, P, R;
146
- const h = re(), b = Q({
147
- queryKey: ["ops-drill", a, r.metric, r.key ?? null],
148
- queryFn: () => h.request(
149
- ne(`/ops-reports/${a}/drill`, {
146
+ const b = re(), x = Q({
147
+ queryKey: ["ops-drill", l, r.metric, r.key ?? null],
148
+ queryFn: () => b.request(
149
+ ne(`/ops-reports/${l}/drill`, {
150
150
  metric: r.metric,
151
151
  ...r.key ? { key: r.key } : {},
152
152
  limit: 200
153
153
  })
154
154
  ).then((t) => t.data),
155
155
  staleTime: 6e4
156
- }), g = (L = b.data) == null ? void 0 : L.title;
156
+ }), h = (L = x.data) == null ? void 0 : L.title;
157
157
  if (Y(() => {
158
- g && l(g);
159
- }, [g]), b.isLoading)
158
+ h && i(h);
159
+ }, [h]), x.isLoading)
160
160
  return /* @__PURE__ */ d("div", { className: "space-y-2 p-5", "aria-busy": "true", children: [
161
161
  /* @__PURE__ */ e(q, { className: "h-4 w-2/3" }),
162
162
  /* @__PURE__ */ e(q, { className: "h-32 w-full" })
163
163
  ] });
164
- if (b.error || !b.data)
165
- return /* @__PURE__ */ e("div", { className: "p-5", children: /* @__PURE__ */ e(ae, { error: b.error, what: "these rows", onRetry: () => void b.refetch() }) });
166
- const o = b.data, x = o.columns ?? [], f = o.rows ?? [], i = f.map((t) => ge(t, x, c, s)), u = f.some((t) => typeof t._link == "string" && t._link) || i.some(Boolean), w = ((P = o.detail) == null ? void 0 : P.fields) ?? [], _ = w.filter((t) => t.kind === "meta" && t.value != null && t.value !== ""), G = _.filter((t) => !t.link), D = _.filter((t) => t.link), C = w.filter((t) => t.kind === "stat"), $ = w.filter((t) => !t.kind), E = o.truncated ? `Showing the first ${S(f.length)} of ${S(o.total)}` : `${S(o.total || f.length)} ${(o.total || f.length) === 1 ? "row" : "rows"}`, O = (t) => /* @__PURE__ */ d(
164
+ if (x.error || !x.data)
165
+ return /* @__PURE__ */ e("div", { className: "p-5", children: /* @__PURE__ */ e(ae, { error: x.error, what: "these rows", onRetry: () => void x.refetch() }) });
166
+ const a = x.data, k = a.columns ?? [], g = a.rows ?? [], o = g.map((t) => ge(t, k, c, s)), u = g.some((t) => typeof t._link == "string" && t._link) || o.some(Boolean), w = ((P = a.detail) == null ? void 0 : P.fields) ?? [], _ = w.filter((t) => t.kind === "meta" && t.value != null && t.value !== ""), G = _.filter((t) => !t.link), D = _.filter((t) => t.link), C = w.filter((t) => t.kind === "stat"), $ = w.filter((t) => !t.kind), E = a.truncated ? `Showing the first ${S(g.length)} of ${S(a.total)}` : `${S(a.total || g.length)} ${(a.total || g.length) === 1 ? "row" : "rows"}`, O = (t) => /* @__PURE__ */ d(
167
167
  "button",
168
168
  {
169
169
  type: "button",
@@ -175,7 +175,7 @@ function Ne({
175
175
  ]
176
176
  }
177
177
  );
178
- return /* @__PURE__ */ d("div", { className: "space-y-5 p-5", "data-ops-drill-level": o.metric, children: [
178
+ return /* @__PURE__ */ d("div", { className: "space-y-5 p-5", "data-ops-drill-level": a.metric, children: [
179
179
  _.length > 0 && /* @__PURE__ */ d(
180
180
  "div",
181
181
  {
@@ -184,18 +184,18 @@ function Ne({
184
184
  children: [
185
185
  /* @__PURE__ */ e("p", { className: "flex min-w-0 flex-wrap items-center gap-x-2 gap-y-0.5 text-slate-600 dark:text-muted-foreground", children: G.map((t, v) => /* @__PURE__ */ d("span", { className: "inline-flex items-center gap-2", children: [
186
186
  v > 0 && /* @__PURE__ */ e("span", { "aria-hidden": !0, className: "text-slate-300 dark:text-muted-foreground/40", children: "·" }),
187
- /* @__PURE__ */ e("span", { className: k(v === 0 && "text-slate-800 dark:text-foreground"), children: t.value })
187
+ /* @__PURE__ */ e("span", { className: f(v === 0 && "text-slate-800 dark:text-foreground"), children: t.value })
188
188
  ] }, t.label)) }),
189
189
  D.length > 0 && /* @__PURE__ */ e("span", { className: "flex shrink-0 items-center gap-3", children: D.map((t) => /* @__PURE__ */ e("span", { children: O(t) }, t.label)) })
190
190
  ]
191
191
  }
192
192
  ),
193
- o.description && /* @__PURE__ */ e(de, { className: "max-w-[70ch] text-[12.5px] leading-relaxed text-slate-600 dark:text-muted-foreground", children: o.description }),
193
+ a.description && /* @__PURE__ */ e(de, { className: "max-w-[70ch] text-[12.5px] leading-relaxed text-slate-600 dark:text-muted-foreground", children: a.description }),
194
194
  C.length > 0 && /* @__PURE__ */ e(fe, { stats: C }),
195
195
  $.length > 0 && /* @__PURE__ */ e(
196
196
  "dl",
197
197
  {
198
- className: k(
198
+ className: f(
199
199
  "grid grid-cols-[minmax(96px,max-content)_1fr] gap-x-6 gap-y-1.5 text-[12.5px]",
200
200
  C.length === 0 && "rounded-lg border border-slate-200 px-3.5 py-3 dark:border-border"
201
201
  ),
@@ -205,7 +205,7 @@ function Ne({
205
205
  ] }, t.label))
206
206
  }
207
207
  ),
208
- (((R = o.detail) == null ? void 0 : R.blocks) ?? []).map((t) => /* @__PURE__ */ d("div", { children: [
208
+ (((R = a.detail) == null ? void 0 : R.blocks) ?? []).map((t) => /* @__PURE__ */ d("div", { children: [
209
209
  /* @__PURE__ */ e("h4", { className: "mb-1 text-[10.5px] font-semibold uppercase tracking-wide text-slate-500 dark:text-muted-foreground", children: t.title }),
210
210
  t.kind === "text" ? /* @__PURE__ */ e("p", { className: "whitespace-pre-wrap text-[12px] text-slate-800 dark:text-foreground", children: t.text }) : /* @__PURE__ */ e(
211
211
  "pre",
@@ -216,9 +216,9 @@ function Ne({
216
216
  }
217
217
  )
218
218
  ] }, t.title)),
219
- f.length > 0 && /* @__PURE__ */ d("section", { "aria-label": o.rows_title ?? void 0, children: [
220
- o.rows_title && /* @__PURE__ */ d("div", { className: "mb-2 flex flex-wrap items-baseline justify-between gap-x-3", children: [
221
- /* @__PURE__ */ e("h3", { className: "text-[13px] font-semibold text-slate-900 dark:text-foreground", children: o.rows_title }),
219
+ g.length > 0 && /* @__PURE__ */ d("section", { "aria-label": a.rows_title ?? void 0, children: [
220
+ a.rows_title && /* @__PURE__ */ d("div", { className: "mb-2 flex flex-wrap items-baseline justify-between gap-x-3", children: [
221
+ /* @__PURE__ */ e("h3", { className: "text-[13px] font-semibold text-slate-900 dark:text-foreground", children: a.rows_title }),
222
222
  /* @__PURE__ */ e(
223
223
  "span",
224
224
  {
@@ -230,10 +230,10 @@ function Ne({
230
230
  ] }),
231
231
  /* @__PURE__ */ e("div", { className: "overflow-x-auto rounded-lg border border-slate-200 dark:border-border", children: /* @__PURE__ */ d("table", { className: "w-full text-[12.5px]", children: [
232
232
  /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ d("tr", { className: "border-b border-slate-200 bg-slate-50 text-left text-[10.5px] uppercase tracking-wide text-slate-500 dark:border-border dark:bg-muted/40 dark:text-muted-foreground", children: [
233
- x.map((t) => /* @__PURE__ */ e(
233
+ k.map((t) => /* @__PURE__ */ e(
234
234
  "th",
235
235
  {
236
- className: k(
236
+ className: f(
237
237
  "whitespace-nowrap px-3 py-2 font-medium",
238
238
  T.has(t.type ?? "") && "text-right"
239
239
  ),
@@ -243,8 +243,8 @@ function Ne({
243
243
  )),
244
244
  u && /* @__PURE__ */ e("th", { className: "w-8", children: /* @__PURE__ */ e("span", { className: "sr-only", children: "Open" }) })
245
245
  ] }) }),
246
- /* @__PURE__ */ e("tbody", { children: f.map((t, v) => {
247
- const J = t._drill_metric, F = typeof t._link == "string" && t._link ? t._link : null, I = t._record_collection, K = typeof I == "string" && I !== "", N = i[v];
246
+ /* @__PURE__ */ e("tbody", { children: g.map((t, v) => {
247
+ const J = t._drill_metric, F = typeof t._link == "string" && t._link ? t._link : null, I = t._record_collection, K = typeof I == "string" && I !== "", N = o[v];
248
248
  return /* @__PURE__ */ d(
249
249
  "tr",
250
250
  {
@@ -254,15 +254,15 @@ function Ne({
254
254
  onKeyDown: N ? (p) => {
255
255
  (p.key === "Enter" || p.key === " ") && (p.preventDefault(), N());
256
256
  } : void 0,
257
- className: k(
257
+ className: f(
258
258
  "group border-b border-slate-100 last:border-0 dark:border-border/60",
259
259
  N && "cursor-pointer hover:bg-slate-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-nvr-cyan/50 dark:hover:bg-muted/60"
260
260
  ),
261
261
  children: [
262
- x.map((p) => /* @__PURE__ */ e(
262
+ k.map((p) => /* @__PURE__ */ e(
263
263
  "td",
264
264
  {
265
- className: k(
265
+ className: f(
266
266
  "px-3 py-2 align-top text-slate-700 dark:text-foreground",
267
267
  T.has(p.type ?? "") && "text-right tabular-nums",
268
268
  (T.has(p.type ?? "") || p.type === "time" || p.type === "status") && "whitespace-nowrap",
@@ -298,7 +298,7 @@ function Ne({
298
298
  );
299
299
  }) })
300
300
  ] }) }),
301
- !o.rows_title && /* @__PURE__ */ e(
301
+ !a.rows_title && /* @__PURE__ */ e(
302
302
  "p",
303
303
  {
304
304
  className: "mt-1.5 text-[11px] text-slate-500 dark:text-muted-foreground",
@@ -307,25 +307,25 @@ function Ne({
307
307
  }
308
308
  )
309
309
  ] }),
310
- f.length === 0 && !o.detail && /* @__PURE__ */ e("p", { className: "py-6 text-center text-[12.5px] text-slate-500 dark:text-muted-foreground", children: "Nothing behind this number." })
310
+ g.length === 0 && !a.detail && /* @__PURE__ */ e("p", { className: "py-6 text-center text-[12.5px] text-slate-500 dark:text-muted-foreground", children: "Nothing behind this number." })
311
311
  ] });
312
312
  }
313
313
  function Re({
314
- reportId: a,
314
+ reportId: l,
315
315
  linkTo: r,
316
- children: l
316
+ children: i
317
317
  }) {
318
- const c = te(), [n, s] = A([]), [h, b] = A(null), g = U((i) => s([i]), []), o = X(() => ({ open: g }), [g]), x = n[n.length - 1], f = U(
319
- (i) => {
320
- let m = i;
321
- const u = i.match(/^\/collections\/([^/?#]+)\/([^/?#]+)/);
322
- u && c.itemUrl && (m = c.itemUrl({ collection: u[1], itemId: u[2] })), r && (m = r(i) ?? (u ? m : null)), m && window.open(m, "_blank", "noopener");
318
+ const c = te(), [n, s] = A([]), [b, x] = A(null), h = U((o) => s([o]), []), a = n[n.length - 1], k = U(
319
+ (o) => {
320
+ let m = o;
321
+ const u = o.match(/^\/collections\/([^/?#]+)\/([^/?#]+)/);
322
+ u && c.itemUrl && (m = c.itemUrl({ collection: u[1], itemId: u[2] })), r && (m = r(o) ?? (u ? m : null)), m && window.open(m, "_blank", "noopener");
323
323
  },
324
324
  [c, r]
325
- );
326
- return /* @__PURE__ */ d(M.Provider, { value: o, children: [
327
- l,
328
- /* @__PURE__ */ e(le, { open: n.length > 0, onOpenChange: (i) => !i && s([]), children: /* @__PURE__ */ d(
325
+ ), g = X(() => ({ open: h, link: k }), [h, k]);
326
+ return /* @__PURE__ */ d(M.Provider, { value: g, children: [
327
+ i,
328
+ /* @__PURE__ */ e(le, { open: n.length > 0, onOpenChange: (o) => !o && s([]), children: /* @__PURE__ */ d(
329
329
  ie,
330
330
  {
331
331
  side: "right",
@@ -345,7 +345,7 @@ function Re({
345
345
  {
346
346
  type: "button",
347
347
  "data-ops-drill-back": "",
348
- onClick: () => s((i) => i.slice(0, -1)),
348
+ onClick: () => s((o) => o.slice(0, -1)),
349
349
  className: "mr-1 inline-flex items-center gap-1 rounded px-1 py-0.5 font-medium text-sky-700 hover:bg-muted dark:text-nvr-cyan",
350
350
  children: [
351
351
  /* @__PURE__ */ e(z, { className: "h-3 w-3", "aria-hidden": !0 }),
@@ -353,7 +353,7 @@ function Re({
353
353
  ]
354
354
  }
355
355
  ),
356
- n.map((i, m) => /* @__PURE__ */ d(
356
+ n.map((o, m) => /* @__PURE__ */ d(
357
357
  "span",
358
358
  {
359
359
  className: "inline-flex items-center gap-1",
@@ -365,44 +365,44 @@ function Re({
365
365
  type: "button",
366
366
  onClick: () => s((u) => u.slice(0, m + 1)),
367
367
  className: "max-w-[160px] truncate hover:text-slate-800 hover:underline dark:hover:text-foreground",
368
- children: i.title ?? i.label ?? i.metric
368
+ children: o.title ?? o.label ?? o.metric
369
369
  }
370
- ) : /* @__PURE__ */ e("span", { className: "max-w-[220px] truncate font-medium text-slate-700 dark:text-foreground", children: i.title ?? i.label ?? i.metric })
370
+ ) : /* @__PURE__ */ e("span", { className: "max-w-[220px] truncate font-medium text-slate-700 dark:text-foreground", children: o.title ?? o.label ?? o.metric })
371
371
  ]
372
372
  },
373
- `${i.metric}:${i.key ?? ""}:${m}`
373
+ `${o.metric}:${o.key ?? ""}:${m}`
374
374
  ))
375
375
  ]
376
376
  }
377
377
  ),
378
- /* @__PURE__ */ e(oe, { className: "truncate text-[16px] font-semibold tracking-[-0.01em]", children: (x == null ? void 0 : x.title) ?? (x == null ? void 0 : x.label) ?? "Loading…" })
378
+ /* @__PURE__ */ e(oe, { className: "truncate text-[16px] font-semibold tracking-[-0.01em]", children: (a == null ? void 0 : a.title) ?? (a == null ? void 0 : a.label) ?? "Loading…" })
379
379
  ] }),
380
- /* @__PURE__ */ e("div", { className: "min-h-0 flex-1 overflow-y-auto bg-white dark:bg-background", children: x && /* @__PURE__ */ e(
380
+ /* @__PURE__ */ e("div", { className: "min-h-0 flex-1 overflow-y-auto bg-white dark:bg-background", children: a && /* @__PURE__ */ e(
381
381
  Ne,
382
382
  {
383
- reportId: a,
384
- target: x,
385
- onTitle: (i) => s(
383
+ reportId: l,
384
+ target: a,
385
+ onTitle: (o) => s(
386
386
  (m) => m.map(
387
- (u, w) => w === m.length - 1 && u.title !== i ? { ...u, title: i } : u
387
+ (u, w) => w === m.length - 1 && u.title !== o ? { ...u, title: o } : u
388
388
  )
389
389
  ),
390
- onDrill: (i) => s((m) => [...m, i]),
391
- onLink: f,
392
- onRecord: (i, m, u) => b({ collection: i, itemId: m, title: u })
390
+ onDrill: (o) => s((m) => [...m, o]),
391
+ onLink: k,
392
+ onRecord: (o, m, u) => x({ collection: o, itemId: m, title: u })
393
393
  },
394
- `${x.metric}:${x.key ?? ""}:${n.length}`
394
+ `${a.metric}:${a.key ?? ""}:${n.length}`
395
395
  ) })
396
396
  ]
397
397
  }
398
398
  ) }),
399
- h && /* @__PURE__ */ e(V, { fallback: null, children: /* @__PURE__ */ e(
399
+ b && /* @__PURE__ */ e(V, { fallback: null, children: /* @__PURE__ */ e(
400
400
  ce,
401
401
  {
402
- collection: h.collection,
403
- itemId: h.itemId,
404
- title: h.title,
405
- onClose: () => b(null)
402
+ collection: b.collection,
403
+ itemId: b.itemId,
404
+ title: b.title,
405
+ onClose: () => x(null)
406
406
  }
407
407
  ) })
408
408
  ] });