@nivaro/react 0.3.134 → 0.3.135

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.
@@ -1,25 +1,34 @@
1
- import { jsx as e, jsxs as n, Fragment as S } from "react/jsx-runtime";
1
+ import { jsx as e, jsxs as r, Fragment as S } from "react/jsx-runtime";
2
2
  import { useInfiniteQuery as ce, useQuery as P } from "@tanstack/react-query";
3
- import { X as me, Download as he, ExternalLink as K, Mail as ue, ListFilter as pe, ChevronRight as X, ArrowLeft as be } from "lucide-react";
4
- import { useState as G, useMemo as xe } from "react";
3
+ import { X as me, Download as he, ExternalLink as M, Mail as ue, ListFilter as pe, ChevronRight as G, ArrowLeft as be } from "lucide-react";
4
+ import { useState as V, useMemo as xe } from "react";
5
5
  import { useNivaroClient as A, useApiFetchConfig as fe, useNavigation as ge, useItemNavigation as Ne } from "../../context.js";
6
- import { get as B } from "../../lib/commands.js";
7
- import { cn as b } from "../../lib/utils.js";
6
+ import { get as F } from "../../lib/commands.js";
7
+ import { cn as x } from "../../lib/utils.js";
8
8
  import { ErrorDetails as Z } from "../ErrorNotice.js";
9
- import { QueryErrorState as V } from "../QueryErrorState.js";
10
- import { Sheet as we, SheetContent as ke, SheetTitle as D, SheetDescription as ee } from "../ui/sheet.js";
9
+ import { QueryErrorState as K } from "../QueryErrorState.js";
10
+ import { Sheet as we, SheetContent as ve, SheetTitle as j, SheetDescription as ee } from "../ui/sheet.js";
11
11
  import { Skeleton as $ } from "../ui/skeleton.js";
12
- import { FilterPicker as ye, OutcomeChip as q, ShareBar as ve } from "./ui.js";
13
- import { readDrill as _e, drillQuery as $e, fmtRange as J, titleize as w, fmtInt as I, clearDrill as Ce, fmtWhen as v, mins as te, encodeCond as Se } from "./url.js";
14
- const Le = { n: "notifications", m: "emails", x: "mutes" };
12
+ import { FilterPicker as ke, OutcomeChip as E, ShareBar as ye } from "./ui.js";
13
+ import { readDrill as _e, drillQuery as $e, fmtRange as J, titleize as v, fmtInt as U, clearDrill as Ce, fmtWhen as k, mins as te, encodeCond as Se } from "./url.js";
14
+ const Le = { n: "notifications", m: "emails", x: "mutes" }, Te = {
15
+ acted: "Acted on it.",
16
+ read_no_action: "Read it, then did nothing on the record in that time.",
17
+ unread_no_action: "Neither read it nor did anything on the record in that time.",
18
+ window_open: "Not counted yet.",
19
+ not_record: "Not about a record they could act on, so it does not count either way."
20
+ }, Re = `<meta http-equiv="Content-Security-Policy" content="default-src 'none'; img-src data: cid:; style-src 'unsafe-inline'">`;
21
+ function qe(a) {
22
+ return `${Re}${a}`;
23
+ }
15
24
  function W() {
16
25
  const a = ge(), m = Ne();
17
26
  return {
18
- record: (o, l) => o && l && !/^(nivaro|directus)_/i.test(o) ? m.urlFor({ collection: o, itemId: l }) : null,
27
+ record: (o, s) => o && s && !/^(nivaro|directus)_/i.test(o) && !o.startsWith("__") ? m.urlFor({ collection: o, itemId: s }) : null,
19
28
  person: (o) => o ? a.userUrl ? a.userUrl(o) : `/users/${o.toLowerCase()}` : null,
20
29
  mailLog: (o) => a.consoleUrl ? a.consoleUrl(`/delivery?id=${o}`) : `/delivery?id=${o}`,
21
- go: (o) => (l) => {
22
- l.metaKey || l.ctrlKey || l.shiftKey || l.button !== 0 || (l.preventDefault(), a.navigate(o));
30
+ go: (o) => (s) => {
31
+ s.metaKey || s.ctrlKey || s.shiftKey || s.button !== 0 || (s.preventDefault(), a.navigate(o));
23
32
  }
24
33
  };
25
34
  }
@@ -38,31 +47,31 @@ function _({
38
47
  }
39
48
  ) : /* @__PURE__ */ e(S, { children: m });
40
49
  }
41
- function Xe({
50
+ function Ze({
42
51
  params: a,
43
52
  setParams: m,
44
53
  summary: c,
45
54
  labels: o
46
55
  }) {
47
- const l = _e(a), s = !!l, r = () => m(Ce);
48
- return /* @__PURE__ */ e(we, { open: s, onOpenChange: (u) => !u && r(), children: /* @__PURE__ */ n(
49
- ke,
56
+ const s = _e(a), n = !!s, d = () => m(Ce);
57
+ return /* @__PURE__ */ e(we, { open: n, onOpenChange: (u) => !u && d(), children: /* @__PURE__ */ r(
58
+ ve,
50
59
  {
51
60
  side: "right",
52
61
  "data-da-drill": "",
53
62
  "aria-describedby": void 0,
54
63
  className: "flex w-[96vw] flex-col gap-0 p-0 sm:max-w-[860px]",
55
64
  children: [
56
- l && !c && /* @__PURE__ */ n("div", { className: "space-y-2 p-5", "aria-busy": "true", children: [
57
- /* @__PURE__ */ e(D, { className: "sr-only", children: "Loading" }),
65
+ s && !c && /* @__PURE__ */ r("div", { className: "space-y-2 p-5", "aria-busy": "true", children: [
66
+ /* @__PURE__ */ e(j, { className: "sr-only", children: "Loading" }),
58
67
  /* @__PURE__ */ e($, { className: "h-5 w-1/2" }),
59
68
  /* @__PURE__ */ e($, { className: "h-40 w-full" })
60
69
  ] }),
61
- l && c && l.leaf && /* @__PURE__ */ e(Fe, { drill: l, setParams: m, summary: c }),
62
- l && c && !l.leaf && /* @__PURE__ */ e(
63
- qe,
70
+ s && c && s.leaf && /* @__PURE__ */ e(Be, { drill: s, setParams: m, summary: c }),
71
+ s && c && !s.leaf && /* @__PURE__ */ e(
72
+ De,
64
73
  {
65
- drill: l,
74
+ drill: s,
66
75
  params: a,
67
76
  setParams: m,
68
77
  summary: c,
@@ -73,125 +82,125 @@ function Xe({
73
82
  }
74
83
  ) });
75
84
  }
76
- function Te() {
85
+ function Ee() {
77
86
  const a = A();
78
87
  return P({
79
88
  queryKey: ["delivery-analytics", "dimensions"],
80
89
  queryFn: () => a.request(
81
- B("/delivery-analytics/dimensions")
90
+ F("/delivery-analytics/dimensions")
82
91
  ).then((m) => m.data),
83
92
  staleTime: Number.POSITIVE_INFINITY
84
93
  });
85
94
  }
86
- function Re([a, m], c, o) {
87
- var r;
88
- const l = ((r = c == null ? void 0 : c.find((u) => u.key === a)) == null ? void 0 : r.label) ?? w(a.replace(/^ch[._]/, "")), s = m.map((u) => o.get(`${a}=${u}`) ?? o.get(u) ?? w(u));
89
- return `${l}: ${s.length > 2 ? `${s.slice(0, 2).join(", ")} +${s.length - 2}` : s.join(", ")}`;
95
+ function je([a, m], c, o) {
96
+ var d;
97
+ const s = ((d = c == null ? void 0 : c.find((u) => u.key === a)) == null ? void 0 : d.label) ?? v(a.replace(/^ch[._]/, "")), n = m.map((u) => o.get(`${a}=${u}`) ?? o.get(u) ?? v(u));
98
+ return `${s}: ${n.length > 2 ? `${n.slice(0, 2).join(", ")} +${n.length - 2}` : n.join(", ")}`;
90
99
  }
91
- function qe({
100
+ function De({
92
101
  drill: a,
93
102
  params: m,
94
103
  setParams: c,
95
104
  summary: o,
96
- labels: l
105
+ labels: s
97
106
  }) {
98
- var Q, H, Y;
99
- const s = A(), r = fe(), t = (Q = Te().data) == null ? void 0 : Q[a.source], k = { ...o.window, asof: o.asof, acted_hours: o.acted_hours }, y = $e(m, a, k), p = a.sort, E = y.toString(), x = ce({
100
- queryKey: ["delivery-analytics", "rows", E, p],
107
+ var Y, H, X;
108
+ const n = A(), d = fe(), t = (Y = Ee().data) == null ? void 0 : Y[a.source], y = { ...o.window, asof: o.asof, acted_hours: o.acted_hours }, f = $e(m, a, y), b = a.sort, R = f.toString(), p = ce({
109
+ queryKey: ["delivery-analytics", "rows", R, b],
101
110
  initialPageParam: "0",
102
- queryFn: ({ pageParam: i }) => {
103
- const d = new URLSearchParams(y);
104
- return d.set("cursor", String(i)), d.set("limit", "50"), p === "ttr" && d.set("sort", "ttr"), p === "time-asc" && d.set("dir", "asc"), s.request(B(`/delivery-analytics/rows?${d.toString()}`)).then((f) => f.data);
111
+ queryFn: ({ pageParam: l }) => {
112
+ const i = new URLSearchParams(f);
113
+ return i.set("cursor", String(l)), i.set("limit", "50"), b === "ttr" && i.set("sort", "ttr"), b === "time-asc" && i.set("dir", "asc"), n.request(F(`/delivery-analytics/rows?${i.toString()}`)).then((g) => g.data);
105
114
  },
106
- getNextPageParam: (i) => i.next_cursor ?? void 0,
115
+ getNextPageParam: (l) => l.next_cursor ?? void 0,
107
116
  staleTime: 6e4
108
- }), U = P({
109
- queryKey: ["delivery-analytics", "split", E, a.splitBy],
117
+ }), I = P({
118
+ queryKey: ["delivery-analytics", "split", R, a.splitBy],
110
119
  enabled: !!a.splitBy,
111
120
  queryFn: () => {
112
- const i = new URLSearchParams(y);
113
- return i.set("by", String(a.splitBy)), s.request(B(`/delivery-analytics/split?${i.toString()}`)).then((d) => d.data);
121
+ const l = new URLSearchParams(f);
122
+ return l.set("by", String(a.splitBy)), n.request(F(`/delivery-analytics/split?${l.toString()}`)).then((i) => i.data);
114
123
  },
115
124
  staleTime: 6e4
116
- }), [j, h] = G(!1), [L, z] = G(!1), R = (Y = (H = x.data) == null ? void 0 : H.pages[0]) == null ? void 0 : Y.total, O = xe(() => {
117
- var i;
118
- return ((i = x.data) == null ? void 0 : i.pages.flatMap((d) => d.rows)) ?? [];
119
- }, [x.data]), M = Le[a.source], se = a.prev ? `previous period, ${J(o.window.prev_from, o.window.prev_to)}` : a.source === "x" ? "standing mutes" : J(o.window.from, o.window.to), le = (i) => c((d) => {
120
- const f = d.getAll("dw").filter((C, T) => T !== i);
121
- d.delete("dw");
122
- for (const C of f) d.append("dw", C);
123
- d.delete("dby");
124
- }), oe = (i, d) => c((f) => {
125
- f.append("dw", Se(i)), f.delete("dby");
126
- const C = f.get("dl");
127
- f.set("dl", C ? `${C} · ${d}` : d);
128
- }), ie = (i) => c(
129
- (d) => {
130
- i === "time" ? d.delete("ds") : d.set("ds", i);
125
+ }), [h, L] = V(!1), [z, Q] = V(!1), q = (X = (H = p.data) == null ? void 0 : H.pages[0]) == null ? void 0 : X.total, B = xe(() => {
126
+ var l;
127
+ return ((l = p.data) == null ? void 0 : l.pages.flatMap((i) => i.rows)) ?? [];
128
+ }, [p.data]), O = Le[a.source], oe = a.prev ? `previous period, ${J(o.window.prev_from, o.window.prev_to)}` : a.source === "x" ? "standing mutes" : J(o.window.from, o.window.to), se = (l) => c((i) => {
129
+ const g = i.getAll("dw").filter((C, T) => T !== l);
130
+ i.delete("dw");
131
+ for (const C of g) i.append("dw", C);
132
+ i.delete("dby");
133
+ }), le = (l, i) => c((g) => {
134
+ g.append("dw", Se(l)), g.delete("dby");
135
+ const C = g.get("dl");
136
+ g.set("dl", C ? `${C} · ${i}` : i);
137
+ }), ie = (l) => c(
138
+ (i) => {
139
+ l === "time" ? i.delete("ds") : i.set("ds", l);
131
140
  },
132
141
  { replace: !0 }
133
142
  ), de = async () => {
134
- h(!0), z(!1);
143
+ L(!0), Q(!1);
135
144
  try {
136
- const i = new URLSearchParams(y);
137
- i.set("format", "csv"), p === "ttr" && i.set("sort", "ttr"), p === "time-asc" && i.set("dir", "asc");
138
- const d = await fetch(`${r.apiBase}/delivery-analytics/rows?${i}`, {
139
- headers: r.authHeaders,
140
- credentials: r.credentials
145
+ const l = new URLSearchParams(f);
146
+ l.set("format", "csv"), b === "ttr" && l.set("sort", "ttr"), b === "time-asc" && l.set("dir", "asc");
147
+ const i = await fetch(`${d.apiBase}/delivery-analytics/rows?${l}`, {
148
+ headers: d.authHeaders,
149
+ credentials: d.credentials
141
150
  });
142
- if (!d.ok) throw new Error(String(d.status));
143
- const f = await d.blob(), C = URL.createObjectURL(f), T = document.createElement("a");
144
- T.href = C, T.download = `delivery-${M}.csv`, document.body.appendChild(T), T.click(), T.remove(), setTimeout(() => URL.revokeObjectURL(C), 3e4);
151
+ if (!i.ok) throw new Error(String(i.status));
152
+ const g = await i.blob(), C = URL.createObjectURL(g), T = document.createElement("a");
153
+ T.href = C, T.download = `delivery-${O}.csv`, document.body.appendChild(T), T.click(), T.remove(), setTimeout(() => URL.revokeObjectURL(C), 3e4);
145
154
  } catch {
146
- z(!0);
155
+ Q(!0);
147
156
  } finally {
148
- h(!1);
157
+ L(!1);
149
158
  }
150
159
  };
151
- return /* @__PURE__ */ n(S, { children: [
152
- /* @__PURE__ */ n("div", { className: "shrink-0 border-b border-slate-200 px-5 pb-3 pt-4 pr-12 dark:border-border", children: [
153
- /* @__PURE__ */ e(D, { className: "truncate text-[16px] font-semibold tracking-[-0.01em] text-slate-900 dark:text-foreground", children: a.label ?? `${w(M)}` }),
154
- /* @__PURE__ */ n(ee, { className: "mt-0.5 text-[12px] text-slate-500 dark:text-muted-foreground", children: [
160
+ return /* @__PURE__ */ r(S, { children: [
161
+ /* @__PURE__ */ r("div", { className: "shrink-0 border-b border-slate-200 px-5 pb-3 pt-4 pr-12 dark:border-border", children: [
162
+ /* @__PURE__ */ e(j, { className: "truncate text-[16px] font-semibold tracking-[-0.01em] text-slate-900 dark:text-foreground", children: a.label ?? `${v(O)}` }),
163
+ /* @__PURE__ */ r(ee, { className: "mt-0.5 text-[12px] text-slate-500 dark:text-muted-foreground", children: [
155
164
  /* @__PURE__ */ e(
156
165
  "span",
157
166
  {
158
- "data-da-drill-total": R ?? "",
167
+ "data-da-drill-total": q ?? "",
159
168
  className: "font-medium tabular-nums text-slate-800 dark:text-foreground",
160
- children: R == null ? "…" : I(R)
169
+ children: q == null ? "…" : U(q)
161
170
  }
162
171
  ),
163
172
  " ",
164
- R === 1 ? M.replace(/s$/, "") : M,
173
+ q === 1 ? O.replace(/s$/, "") : O,
165
174
  " · ",
166
- se
175
+ oe
167
176
  ] }),
168
- a.where.length > 0 && /* @__PURE__ */ e("ul", { className: "mt-2 flex flex-wrap gap-1.5", "aria-label": "Conditions", children: a.where.map((i, d) => (
177
+ a.where.length > 0 && /* @__PURE__ */ e("ul", { className: "mt-2 flex flex-wrap gap-1.5", "aria-label": "Conditions", children: a.where.map((l, i) => (
169
178
  // biome-ignore lint/suspicious/noArrayIndexKey: the same condition may repeat; position is its identity
170
- /* @__PURE__ */ e("li", { children: /* @__PURE__ */ n("span", { className: "inline-flex max-w-[320px] items-center gap-1 rounded-full border border-slate-200 bg-slate-50 py-0.5 pl-2 pr-1 text-[11.5px] text-slate-700 dark:border-border dark:bg-muted dark:text-foreground", children: [
171
- /* @__PURE__ */ e("span", { className: "truncate", children: Re(i, t, l) }),
179
+ /* @__PURE__ */ e("li", { children: /* @__PURE__ */ r("span", { className: "inline-flex max-w-[320px] items-center gap-1 rounded-full border border-slate-200 bg-slate-50 py-0.5 pl-2 pr-1 text-[11.5px] text-slate-700 dark:border-border dark:bg-muted dark:text-foreground", children: [
180
+ /* @__PURE__ */ e("span", { className: "truncate", children: je(l, t, s) }),
172
181
  /* @__PURE__ */ e(
173
182
  "button",
174
183
  {
175
184
  type: "button",
176
185
  "aria-label": "Remove this condition",
177
186
  "data-tip": "Remove this condition",
178
- onClick: () => le(d),
187
+ onClick: () => se(i),
179
188
  className: "rounded-full p-0.5 text-slate-400 hover:bg-slate-200 hover:text-slate-700 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan/50 dark:hover:bg-border dark:hover:text-foreground",
180
189
  children: /* @__PURE__ */ e(me, { className: "h-3 w-3" })
181
190
  }
182
191
  )
183
- ] }) }, `${i[0]}:${d}`)
192
+ ] }) }, `${l[0]}:${i}`)
184
193
  )) }),
185
- /* @__PURE__ */ n("div", { className: "mt-3 flex flex-wrap items-center gap-2", children: [
194
+ /* @__PURE__ */ r("div", { className: "mt-3 flex flex-wrap items-center gap-2", children: [
186
195
  t && /* @__PURE__ */ e(
187
- ye,
196
+ ke,
188
197
  {
189
198
  label: "Break down by",
190
199
  allLabel: "Nothing",
191
200
  value: a.splitBy,
192
- options: t.filter((i) => !a.where.some(([d]) => d === i.key)).map((i) => ({ value: i.key, label: i.label })),
193
- onChange: (i) => c((d) => {
194
- i ? d.set("dby", i) : d.delete("dby");
201
+ options: t.filter((l) => !a.where.some(([i]) => i === l.key)).map((l) => ({ value: l.key, label: l.label })),
202
+ onChange: (l) => c((i) => {
203
+ l ? i.set("dby", l) : i.delete("dby");
195
204
  })
196
205
  }
197
206
  ),
@@ -207,85 +216,85 @@ function qe({
207
216
  ["time", "Newest"],
208
217
  ["time-asc", "Oldest"],
209
218
  ...a.source === "n" ? [["ttr", "Slowest read"]] : []
210
- ].map(([i, d]) => /* @__PURE__ */ e(
219
+ ].map(([l, i]) => /* @__PURE__ */ e(
211
220
  "button",
212
221
  {
213
222
  type: "button",
214
- "aria-pressed": p === i,
215
- onClick: () => ie(i),
216
- className: b(
223
+ "aria-pressed": b === l,
224
+ onClick: () => ie(l),
225
+ className: x(
217
226
  "rounded px-2 py-0.5 font-medium focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan/50",
218
- p === i ? "bg-slate-900 text-white dark:bg-nvr-cyan dark:text-[#172940]" : "text-slate-600 hover:bg-slate-100 dark:text-muted-foreground dark:hover:bg-muted"
227
+ b === l ? "bg-[#0f172a] text-white dark:bg-nvr-cyan dark:text-[#172940]" : "text-slate-600 hover:bg-slate-100 dark:text-muted-foreground dark:hover:bg-muted"
219
228
  ),
220
- children: d
229
+ children: i
221
230
  },
222
- i
231
+ l
223
232
  ))
224
233
  }
225
234
  ),
226
- /* @__PURE__ */ n(
235
+ /* @__PURE__ */ r(
227
236
  "button",
228
237
  {
229
238
  type: "button",
230
239
  onClick: () => void de(),
231
- disabled: j || !R,
232
- "data-tip": L ? "The file could not be made — try again" : "Download these rows as CSV",
240
+ disabled: h || !q,
241
+ "data-tip": z ? "The file could not be made — try again" : "Download these rows as CSV",
233
242
  className: "inline-flex h-7 items-center gap-1.5 rounded-md border border-slate-200 px-2.5 text-[12px] font-medium text-slate-700 hover:bg-slate-50 disabled:opacity-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan/50 dark:border-border dark:text-foreground dark:hover:bg-muted",
234
243
  children: [
235
244
  /* @__PURE__ */ e(he, { className: "h-3.5 w-3.5", "aria-hidden": !0 }),
236
- j ? "Preparing…" : L ? "Try CSV again" : "CSV"
245
+ h ? "Preparing…" : z ? "Try CSV again" : "CSV"
237
246
  ]
238
247
  }
239
248
  )
240
249
  ] })
241
250
  ] }),
242
- /* @__PURE__ */ n("div", { className: "min-h-0 flex-1 overflow-y-auto bg-white dark:bg-background", children: [
251
+ /* @__PURE__ */ r("div", { className: "min-h-0 flex-1 overflow-y-auto bg-white dark:bg-background", children: [
243
252
  a.splitBy && /* @__PURE__ */ e(
244
- De,
253
+ Fe,
245
254
  {
246
- split: U,
247
- onPick: (i, d) => {
248
- const f = String(a.splitBy);
249
- oe([f, [i]], d);
255
+ split: I,
256
+ onPick: (l, i) => {
257
+ const g = String(a.splitBy);
258
+ le([g, [l]], i);
250
259
  }
251
260
  }
252
261
  ),
253
- x.isLoading ? /* @__PURE__ */ e("div", { className: "space-y-2 p-5", "aria-busy": "true", children: Array.from({ length: 6 }, (i, d) => (
262
+ p.isLoading ? /* @__PURE__ */ e("div", { className: "space-y-2 p-5", "aria-busy": "true", children: Array.from({ length: 6 }, (l, i) => (
254
263
  // biome-ignore lint/suspicious/noArrayIndexKey: skeleton rows
255
- /* @__PURE__ */ e($, { className: "h-9 w-full" }, d)
256
- )) }) : x.isError ? /* @__PURE__ */ e("div", { className: "p-5", children: /* @__PURE__ */ e(
257
- V,
264
+ /* @__PURE__ */ e($, { className: "h-9 w-full" }, i)
265
+ )) }) : p.isError ? /* @__PURE__ */ e("div", { className: "p-5", children: /* @__PURE__ */ e(
266
+ K,
258
267
  {
259
- error: x.error,
268
+ error: p.error,
260
269
  what: "these rows",
261
- onRetry: () => void x.refetch()
270
+ onRetry: () => void p.refetch()
262
271
  }
263
- ) }) : O.length === 0 ? /* @__PURE__ */ e("p", { className: "px-5 py-10 text-center text-[12.5px] text-slate-500 dark:text-muted-foreground", children: "Nothing here now. The rows may have changed since the figure was read — reload the page to recount." }) : /* @__PURE__ */ n("div", { className: "px-5 py-4", children: [
272
+ ) }) : B.length === 0 ? /* @__PURE__ */ e("p", { className: "px-5 py-10 text-center text-[12.5px] text-slate-500 dark:text-muted-foreground", children: "Nothing here now. The rows may have changed since the figure was read — reload the page to recount." }) : /* @__PURE__ */ r("div", { className: "px-5 py-4", children: [
264
273
  /* @__PURE__ */ e(
265
- je,
274
+ Ie,
266
275
  {
267
276
  source: a.source,
268
- rows: O,
269
- onOpen: (i) => c((d) => {
270
- d.set("leaf", `${a.source}:${i}`);
277
+ rows: B,
278
+ onOpen: (l) => c((i) => {
279
+ i.set("leaf", `${a.source}:${l}`);
271
280
  })
272
281
  }
273
282
  ),
274
- /* @__PURE__ */ n("div", { className: "mt-3 flex items-center justify-between text-[11.5px] text-slate-500 dark:text-muted-foreground", children: [
275
- /* @__PURE__ */ n("span", { className: "tabular-nums", children: [
283
+ /* @__PURE__ */ r("div", { className: "mt-3 flex items-center justify-between text-[11.5px] text-slate-500 dark:text-muted-foreground", children: [
284
+ /* @__PURE__ */ r("span", { className: "tabular-nums", children: [
276
285
  "Showing ",
277
- I(O.length),
286
+ U(B.length),
278
287
  " of ",
279
- I(R ?? O.length)
288
+ U(q ?? B.length)
280
289
  ] }),
281
- x.hasNextPage && /* @__PURE__ */ e(
290
+ p.hasNextPage && /* @__PURE__ */ e(
282
291
  "button",
283
292
  {
284
293
  type: "button",
285
- onClick: () => void x.fetchNextPage(),
286
- disabled: x.isFetchingNextPage,
294
+ onClick: () => void p.fetchNextPage(),
295
+ disabled: p.isFetchingNextPage,
287
296
  className: "rounded-md border border-slate-200 px-3 py-1 font-medium text-slate-700 hover:bg-slate-50 disabled:opacity-50 dark:border-border dark:text-foreground dark:hover:bg-muted",
288
- children: x.isFetchingNextPage ? "Loading…" : "Load 50 more"
297
+ children: p.isFetchingNextPage ? "Loading…" : "Load 50 more"
289
298
  }
290
299
  )
291
300
  ] })
@@ -293,12 +302,12 @@ function qe({
293
302
  ] })
294
303
  ] });
295
304
  }
296
- function De({
305
+ function Fe({
297
306
  split: a,
298
307
  onPick: m
299
308
  }) {
300
309
  if (a.isLoading)
301
- return /* @__PURE__ */ n(
310
+ return /* @__PURE__ */ r(
302
311
  "div",
303
312
  {
304
313
  className: "space-y-1.5 border-b border-slate-100 px-5 py-4 dark:border-border",
@@ -312,151 +321,151 @@ function De({
312
321
  );
313
322
  if (a.isError || !a.data)
314
323
  return /* @__PURE__ */ e("div", { className: "border-b border-slate-100 px-5 py-4 dark:border-border", children: /* @__PURE__ */ e(
315
- V,
324
+ K,
316
325
  {
317
326
  error: a.error,
318
327
  what: "this breakdown",
319
328
  onRetry: () => void a.refetch()
320
329
  }
321
330
  ) });
322
- const c = a.data, o = Math.max(1, ...c.rows.map((l) => l.cell.n));
323
- return /* @__PURE__ */ n(
331
+ const c = a.data, o = Math.max(1, ...c.rows.map((s) => s.cell.n));
332
+ return /* @__PURE__ */ r(
324
333
  "section",
325
334
  {
326
335
  "aria-label": `By ${c.label}`,
327
336
  className: "border-b border-slate-100 bg-slate-50/60 px-5 py-3 dark:border-border dark:bg-muted/20",
328
337
  children: [
329
- /* @__PURE__ */ n("h4", { className: "mb-1.5 flex items-center gap-1.5 text-[12px] font-semibold text-slate-700 dark:text-foreground", children: [
338
+ /* @__PURE__ */ r("h4", { className: "mb-1.5 flex items-center gap-1.5 text-[12px] font-semibold text-slate-700 dark:text-foreground", children: [
330
339
  /* @__PURE__ */ e(pe, { className: "h-3.5 w-3.5 text-slate-400", "aria-hidden": !0 }),
331
340
  "By ",
332
341
  c.label.toLowerCase(),
333
342
  /* @__PURE__ */ e("span", { className: "font-normal text-slate-500 dark:text-muted-foreground", children: "— pick one to narrow the list" })
334
343
  ] }),
335
- /* @__PURE__ */ e("ul", { className: "divide-y divide-slate-100 dark:divide-border/60", children: c.rows.map((l) => /* @__PURE__ */ e("li", { children: /* @__PURE__ */ n(
344
+ /* @__PURE__ */ e("ul", { className: "divide-y divide-slate-100 dark:divide-border/60", children: c.rows.map((s) => /* @__PURE__ */ e("li", { children: /* @__PURE__ */ r(
336
345
  "button",
337
346
  {
338
347
  type: "button",
339
- "data-da-split-row": l.cell.n,
340
- onClick: () => m(l.key, l.label),
348
+ "data-da-split-row": s.cell.n,
349
+ onClick: () => m(s.key, s.label),
341
350
  className: "grid w-full grid-cols-[minmax(0,1fr)_120px_64px] items-center gap-3 rounded px-1 py-1.5 text-left text-[12.5px] hover:bg-white focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan/50 dark:hover:bg-muted",
342
351
  children: [
343
- /* @__PURE__ */ e("span", { className: "truncate text-slate-800 dark:text-foreground", children: l.label }),
344
- /* @__PURE__ */ e(ve, { value: l.cell.n, max: o }),
345
- /* @__PURE__ */ e("span", { className: "text-right tabular-nums text-slate-700 dark:text-foreground", children: I(l.cell.n) })
352
+ /* @__PURE__ */ e("span", { className: "truncate text-slate-800 dark:text-foreground", children: s.label }),
353
+ /* @__PURE__ */ e(ye, { value: s.cell.n, max: o }),
354
+ /* @__PURE__ */ e("span", { className: "text-right tabular-nums text-slate-700 dark:text-foreground", children: U(s.cell.n) })
346
355
  ]
347
356
  }
348
- ) }, l.key)) }),
357
+ ) }, s.key)) }),
349
358
  c.more && /* @__PURE__ */ e("p", { className: "mt-1 text-[11px] text-slate-500 dark:text-muted-foreground", children: "The 50 largest are shown." })
350
359
  ]
351
360
  }
352
361
  );
353
362
  }
354
- const g = "whitespace-nowrap px-3 py-2 text-left text-[10.5px] font-medium uppercase tracking-wide text-slate-500 dark:text-muted-foreground", N = "px-3 py-2 align-top";
355
- function je({
363
+ const N = "whitespace-nowrap px-3 py-2 text-left text-[10.5px] font-medium uppercase tracking-wide text-slate-500 dark:text-muted-foreground", w = "px-3 py-2 align-top";
364
+ function Ie({
356
365
  source: a,
357
366
  rows: m,
358
367
  onOpen: c
359
368
  }) {
360
- const o = W(), l = (s) => a === "x" ? {} : {
369
+ const o = W(), s = (n) => a === "x" ? {} : {
361
370
  tabIndex: 0,
362
371
  role: "link",
363
372
  "aria-label": "Open this row",
364
- onClick: () => c(s),
365
- onKeyDown: (r) => {
366
- (r.key === "Enter" || r.key === " ") && (r.preventDefault(), c(s));
373
+ onClick: () => c(n),
374
+ onKeyDown: (d) => {
375
+ (d.key === "Enter" || d.key === " ") && (d.preventDefault(), c(n));
367
376
  },
368
377
  className: "group cursor-pointer border-b border-slate-100 last:border-0 hover:bg-slate-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-nvr-cyan/50 dark:border-border/60 dark:hover:bg-muted/60"
369
378
  };
370
- return /* @__PURE__ */ e("div", { className: "overflow-x-auto rounded-lg border border-slate-200 dark:border-border", children: /* @__PURE__ */ n("table", { className: "w-full text-[12.5px]", children: [
371
- /* @__PURE__ */ e("thead", { className: "border-b border-slate-200 bg-slate-50 dark:border-border dark:bg-muted/40", children: a === "n" ? /* @__PURE__ */ n("tr", { children: [
372
- /* @__PURE__ */ e("th", { className: g, children: "Sent" }),
373
- /* @__PURE__ */ e("th", { className: b(g, "hidden sm:table-cell"), children: "To" }),
374
- /* @__PURE__ */ e("th", { className: g, children: "Subject" }),
375
- /* @__PURE__ */ e("th", { className: b(g, "hidden md:table-cell"), children: "Channels" }),
376
- /* @__PURE__ */ e("th", { className: b(g, "text-right"), children: "Read" }),
379
+ return /* @__PURE__ */ e("div", { className: "overflow-x-auto rounded-lg border border-slate-200 dark:border-border", children: /* @__PURE__ */ r("table", { className: "w-full text-[12.5px]", children: [
380
+ /* @__PURE__ */ e("thead", { className: "border-b border-slate-200 bg-slate-50 dark:border-border dark:bg-muted/40", children: a === "n" ? /* @__PURE__ */ r("tr", { children: [
381
+ /* @__PURE__ */ e("th", { className: N, children: "Sent" }),
382
+ /* @__PURE__ */ e("th", { className: x(N, "hidden sm:table-cell"), children: "To" }),
383
+ /* @__PURE__ */ e("th", { className: N, children: "Subject" }),
384
+ /* @__PURE__ */ e("th", { className: x(N, "hidden md:table-cell"), children: "Channels" }),
385
+ /* @__PURE__ */ e("th", { className: x(N, "text-right"), children: "Read" }),
377
386
  /* @__PURE__ */ e("th", { className: "w-6" })
378
- ] }) : a === "m" ? /* @__PURE__ */ n("tr", { children: [
379
- /* @__PURE__ */ e("th", { className: g, children: "When" }),
380
- /* @__PURE__ */ e("th", { className: b(g, "hidden sm:table-cell"), children: "To" }),
381
- /* @__PURE__ */ e("th", { className: g, children: "Subject" }),
382
- /* @__PURE__ */ e("th", { className: g, children: "Outcome" }),
387
+ ] }) : a === "m" ? /* @__PURE__ */ r("tr", { children: [
388
+ /* @__PURE__ */ e("th", { className: N, children: "When" }),
389
+ /* @__PURE__ */ e("th", { className: x(N, "hidden sm:table-cell"), children: "To" }),
390
+ /* @__PURE__ */ e("th", { className: N, children: "Subject" }),
391
+ /* @__PURE__ */ e("th", { className: N, children: "Outcome" }),
383
392
  /* @__PURE__ */ e("th", { className: "w-6" })
384
- ] }) : /* @__PURE__ */ n("tr", { children: [
385
- /* @__PURE__ */ e("th", { className: g, children: "Muted" }),
386
- /* @__PURE__ */ e("th", { className: g, children: "Person" }),
387
- /* @__PURE__ */ e("th", { className: g, children: "Record" })
393
+ ] }) : /* @__PURE__ */ r("tr", { children: [
394
+ /* @__PURE__ */ e("th", { className: N, children: "Muted" }),
395
+ /* @__PURE__ */ e("th", { className: N, children: "Person" }),
396
+ /* @__PURE__ */ e("th", { className: N, children: "Record" })
388
397
  ] }) }),
389
- /* @__PURE__ */ n("tbody", { className: "text-slate-700 dark:text-foreground", children: [
390
- a === "n" && m.map((s) => /* @__PURE__ */ n("tr", { "data-da-row": s.id, ...l(s.id), children: [
398
+ /* @__PURE__ */ r("tbody", { className: "text-slate-700 dark:text-foreground", children: [
399
+ a === "n" && m.map((n) => /* @__PURE__ */ r("tr", { "data-da-row": n.id, ...s(n.id), children: [
391
400
  /* @__PURE__ */ e(
392
401
  "td",
393
402
  {
394
- className: b(
395
- N,
403
+ className: x(
404
+ w,
396
405
  "whitespace-nowrap tabular-nums text-slate-500 dark:text-muted-foreground"
397
406
  ),
398
- children: v(s.timestamp)
407
+ children: k(n.timestamp)
399
408
  }
400
409
  ),
401
- /* @__PURE__ */ e("td", { className: b(N, "hidden max-w-[150px] truncate sm:table-cell"), children: s.recipient_name ?? "–" }),
402
- /* @__PURE__ */ n("td", { className: b(N, "min-w-[160px]"), children: [
403
- /* @__PURE__ */ e("span", { className: "line-clamp-2 [overflow-wrap:anywhere]", children: s.subject ?? "(no subject)" }),
404
- /* @__PURE__ */ n("span", { className: "text-[11px] text-slate-500 dark:text-muted-foreground", children: [
405
- /* @__PURE__ */ n("span", { className: "sm:hidden", children: [
410
+ /* @__PURE__ */ e("td", { className: x(w, "hidden max-w-[150px] truncate sm:table-cell"), children: n.recipient_name ?? "–" }),
411
+ /* @__PURE__ */ r("td", { className: x(w, "min-w-[160px]"), children: [
412
+ /* @__PURE__ */ e("span", { className: "line-clamp-2 [overflow-wrap:anywhere]", children: n.subject ?? "(no subject)" }),
413
+ /* @__PURE__ */ r("span", { className: "text-[11px] text-slate-500 dark:text-muted-foreground", children: [
414
+ /* @__PURE__ */ r("span", { className: "sm:hidden", children: [
406
415
  "To ",
407
- s.recipient_name ?? "nobody",
416
+ n.recipient_name ?? "nobody",
408
417
  " · "
409
418
  ] }),
410
- s.sender_name ? `from ${s.sender_name} · ` : "",
411
- s.reason_label
419
+ n.sender_name ? `from ${n.sender_name} · ` : "",
420
+ n.reason_label
412
421
  ] })
413
422
  ] }),
414
- /* @__PURE__ */ e("td", { className: b(N, "hidden md:table-cell"), children: /* @__PURE__ */ e("span", { className: "flex flex-wrap gap-1", children: s.channels.length === 0 ? /* @__PURE__ */ e("span", { className: "text-[11px] text-slate-400", children: "not recorded" }) : s.channels.map((r) => /* @__PURE__ */ e(q, { outcome: r.outcome, children: /* @__PURE__ */ n("span", { "data-tip": r.label, children: [
415
- r.channel === "inapp" ? "in-app" : r.channel === "sms" ? "SMS" : r.channel,
423
+ /* @__PURE__ */ e("td", { className: x(w, "hidden md:table-cell"), children: /* @__PURE__ */ e("span", { className: "flex flex-wrap gap-1", children: n.channels.length === 0 ? /* @__PURE__ */ e("span", { className: "text-[11px] text-slate-400", children: "not recorded" }) : n.channels.map((d) => /* @__PURE__ */ e(E, { outcome: d.outcome, children: /* @__PURE__ */ r("span", { "data-tip": d.label, children: [
424
+ d.channel === "inapp" ? "in-app" : d.channel === "sms" ? "SMS" : d.channel,
416
425
  " ",
417
- r.status.replace(/_/g, " ")
418
- ] }) }, r.channel)) }) }),
419
- /* @__PURE__ */ e("td", { className: b(N, "whitespace-nowrap text-right tabular-nums"), children: s.status === "inbox" ? /* @__PURE__ */ e("span", { className: "text-amber-700 dark:text-[#d4936a]", children: "Unread" }) : s.ttr_min != null ? te(s.ttr_min) : /* @__PURE__ */ e("span", { className: "text-slate-500 dark:text-muted-foreground", children: "Read" }) }),
426
+ d.status.replace(/_/g, " ")
427
+ ] }) }, d.channel)) }) }),
428
+ /* @__PURE__ */ e("td", { className: x(w, "whitespace-nowrap text-right tabular-nums"), children: n.status === "inbox" ? /* @__PURE__ */ e("span", { className: "text-amber-700 dark:text-[#d4936a]", children: "Unread" }) : n.ttr_min != null ? te(n.ttr_min) : /* @__PURE__ */ e("span", { className: "text-slate-500 dark:text-muted-foreground", children: "Read" }) }),
420
429
  /* @__PURE__ */ e("td", { className: "w-6 pr-2 pt-2.5 align-top", children: /* @__PURE__ */ e(
421
- X,
430
+ G,
422
431
  {
423
432
  className: "h-3.5 w-3.5 text-slate-300 group-hover:text-slate-500 dark:text-muted-foreground/50",
424
433
  "aria-hidden": !0
425
434
  }
426
435
  ) })
427
- ] }, s.id)),
428
- a === "m" && m.map((s) => /* @__PURE__ */ n("tr", { "data-da-row": s.id, ...l(s.id), children: [
436
+ ] }, n.id)),
437
+ a === "m" && m.map((n) => /* @__PURE__ */ r("tr", { "data-da-row": n.id, ...s(n.id), children: [
429
438
  /* @__PURE__ */ e(
430
439
  "td",
431
440
  {
432
- className: b(
433
- N,
441
+ className: x(
442
+ w,
434
443
  "whitespace-nowrap tabular-nums text-slate-500 dark:text-muted-foreground"
435
444
  ),
436
- children: v(s.created_at)
445
+ children: k(n.created_at)
437
446
  }
438
447
  ),
439
- /* @__PURE__ */ e("td", { className: b(N, "hidden max-w-[180px] truncate sm:table-cell"), children: s.to ?? "–" }),
440
- /* @__PURE__ */ n("td", { className: b(N, "min-w-[160px]"), children: [
441
- /* @__PURE__ */ e("span", { className: "line-clamp-2 [overflow-wrap:anywhere]", children: s.subject ?? "(no subject)" }),
442
- /* @__PURE__ */ n("span", { className: "block text-[11px] text-slate-500 dark:text-muted-foreground", children: [
443
- /* @__PURE__ */ n("span", { className: "sm:hidden", children: [
448
+ /* @__PURE__ */ e("td", { className: x(w, "hidden max-w-[180px] truncate sm:table-cell"), children: n.to ?? "–" }),
449
+ /* @__PURE__ */ r("td", { className: x(w, "min-w-[160px]"), children: [
450
+ /* @__PURE__ */ e("span", { className: "line-clamp-2 [overflow-wrap:anywhere]", children: n.subject ?? "(no subject)" }),
451
+ /* @__PURE__ */ r("span", { className: "block text-[11px] text-slate-500 dark:text-muted-foreground", children: [
452
+ /* @__PURE__ */ r("span", { className: "sm:hidden", children: [
444
453
  "To ",
445
- s.to ?? "nobody"
454
+ n.to ?? "nobody"
446
455
  ] }),
447
- s.template && /* @__PURE__ */ e("span", { className: "hidden sm:inline", children: s.template })
456
+ n.template && /* @__PURE__ */ e("span", { className: "hidden sm:inline", children: n.template })
448
457
  ] })
449
458
  ] }),
450
- /* @__PURE__ */ e("td", { className: N, children: /* @__PURE__ */ e(q, { outcome: s.outcome, children: s.reason_label }) }),
459
+ /* @__PURE__ */ e("td", { className: w, children: /* @__PURE__ */ e(E, { outcome: n.outcome, children: n.reason_label }) }),
451
460
  /* @__PURE__ */ e("td", { className: "w-6 pr-2 pt-2.5 align-top", children: /* @__PURE__ */ e(
452
- X,
461
+ G,
453
462
  {
454
463
  className: "h-3.5 w-3.5 text-slate-300 group-hover:text-slate-500 dark:text-muted-foreground/50",
455
464
  "aria-hidden": !0
456
465
  }
457
466
  ) })
458
- ] }, s.id)),
459
- a === "x" && m.map((s) => /* @__PURE__ */ n(
467
+ ] }, n.id)),
468
+ a === "x" && m.map((n) => /* @__PURE__ */ r(
460
469
  "tr",
461
470
  {
462
471
  className: "border-b border-slate-100 last:border-0 dark:border-border/60",
@@ -464,32 +473,32 @@ function je({
464
473
  /* @__PURE__ */ e(
465
474
  "td",
466
475
  {
467
- className: b(
468
- N,
476
+ className: x(
477
+ w,
469
478
  "whitespace-nowrap tabular-nums text-slate-500 dark:text-muted-foreground"
470
479
  ),
471
- children: v(s.created_at)
480
+ children: k(n.created_at)
472
481
  }
473
482
  ),
474
- /* @__PURE__ */ e("td", { className: N, children: /* @__PURE__ */ e(
483
+ /* @__PURE__ */ e("td", { className: w, children: /* @__PURE__ */ e(
475
484
  _,
476
485
  {
477
- href: o.person(s.user),
478
- onClick: o.person(s.user) ? o.go(String(o.person(s.user))) : void 0,
479
- children: s.user_name ?? "Unknown person"
486
+ href: o.person(n.user),
487
+ onClick: o.person(n.user) ? o.go(String(o.person(n.user))) : void 0,
488
+ children: n.user_name ?? "Unknown person"
480
489
  }
481
490
  ) }),
482
- /* @__PURE__ */ e("td", { className: N, children: (() => {
483
- const r = o.record(s.collection, s.item);
484
- return /* @__PURE__ */ n(_, { href: r, onClick: r ? o.go(r) : void 0, children: [
485
- w(s.collection ?? ""),
491
+ /* @__PURE__ */ e("td", { className: w, children: (() => {
492
+ const d = o.record(n.collection, n.item);
493
+ return /* @__PURE__ */ r(_, { href: d, onClick: d ? o.go(d) : void 0, children: [
494
+ v(n.collection ?? ""),
486
495
  " #",
487
- s.item
496
+ n.item
488
497
  ] });
489
498
  })() })
490
499
  ]
491
500
  },
492
- s.id
501
+ n.id
493
502
  ))
494
503
  ] })
495
504
  ] }) });
@@ -500,8 +509,8 @@ function ae({
500
509
  onBack: c,
501
510
  backLabel: o
502
511
  }) {
503
- return /* @__PURE__ */ n("div", { className: "shrink-0 border-b border-slate-200 px-5 pb-3.5 pt-4 pr-12 dark:border-border", children: [
504
- c && /* @__PURE__ */ n(
512
+ return /* @__PURE__ */ r("div", { className: "shrink-0 border-b border-slate-200 px-5 pb-3.5 pt-4 pr-12 dark:border-border", children: [
513
+ c && /* @__PURE__ */ r(
505
514
  "button",
506
515
  {
507
516
  type: "button",
@@ -514,68 +523,72 @@ function ae({
514
523
  ]
515
524
  }
516
525
  ),
517
- /* @__PURE__ */ e(D, { className: "line-clamp-2 text-[16px] font-semibold tracking-[-0.01em] text-slate-900 dark:text-foreground", children: a }),
526
+ /* @__PURE__ */ e(j, { className: "line-clamp-2 text-[16px] font-semibold tracking-[-0.01em] text-slate-900 dark:text-foreground", children: a }),
518
527
  /* @__PURE__ */ e(ee, { className: "mt-0.5 text-[12px] text-slate-500 dark:text-muted-foreground", children: m })
519
528
  ] });
520
529
  }
521
530
  function re({ items: a }) {
522
- return /* @__PURE__ */ e("dl", { className: "grid grid-cols-[minmax(110px,max-content)_1fr] gap-x-6 gap-y-1.5 text-[12.5px]", children: a.map(({ k: m, v: c }) => /* @__PURE__ */ n("div", { className: "contents", children: [
531
+ return /* @__PURE__ */ e("dl", { className: "grid grid-cols-[minmax(110px,max-content)_1fr] gap-x-6 gap-y-1.5 text-[12.5px]", children: a.map(({ k: m, v: c }) => /* @__PURE__ */ r("div", { className: "contents", children: [
523
532
  /* @__PURE__ */ e("dt", { className: "text-slate-500 dark:text-muted-foreground", children: m }),
524
533
  /* @__PURE__ */ e("dd", { className: "min-w-0 break-words text-slate-900 dark:text-foreground", children: c })
525
534
  ] }, m)) });
526
535
  }
527
- function F({ title: a, children: m }) {
528
- return /* @__PURE__ */ n("section", { children: [
536
+ function D({ title: a, children: m }) {
537
+ return /* @__PURE__ */ r("section", { children: [
529
538
  /* @__PURE__ */ e("h4", { className: "mb-1.5 text-[12px] font-semibold text-slate-800 dark:text-foreground", children: a }),
530
539
  m
531
540
  ] });
532
541
  }
533
- function Fe({
542
+ function Be({
534
543
  drill: a,
535
544
  setParams: m,
536
545
  summary: c
537
546
  }) {
538
- const o = a.leaf, l = a.where.length > 0 || a.label ? () => m((r) => r.delete("leaf")) : null, s = a.label ? `Back to ${a.label}` : "Back";
547
+ const o = a.leaf, s = a.where.length > 0 || a.label ? () => m((d) => d.delete("leaf")) : null, n = a.label ? `Back to ${a.label}` : "Back";
539
548
  return o.source === "n" ? /* @__PURE__ */ e(
540
- Be,
549
+ Oe,
541
550
  {
542
551
  id: o.id,
543
- onBack: l,
544
- backLabel: s,
552
+ onBack: s,
553
+ backLabel: n,
545
554
  summary: c,
546
555
  setParams: m
547
556
  }
548
- ) : /* @__PURE__ */ e(Ee, { id: o.id, onBack: l, backLabel: s });
557
+ ) : /* @__PURE__ */ e(Ue, { id: o.id, onBack: s, backLabel: n });
549
558
  }
550
559
  function ne() {
551
- return /* @__PURE__ */ n("div", { className: "space-y-3 p-5", "aria-busy": "true", children: [
552
- /* @__PURE__ */ e(D, { className: "sr-only", children: "Loading" }),
560
+ return /* @__PURE__ */ r("div", { className: "space-y-3 p-5", "aria-busy": "true", children: [
561
+ /* @__PURE__ */ e(j, { className: "sr-only", children: "Loading" }),
553
562
  /* @__PURE__ */ e($, { className: "h-5 w-2/3" }),
554
563
  /* @__PURE__ */ e($, { className: "h-24 w-full" }),
555
564
  /* @__PURE__ */ e($, { className: "h-40 w-full" })
556
565
  ] });
557
566
  }
558
- function Be({
567
+ function Oe({
559
568
  id: a,
560
569
  onBack: m,
561
570
  backLabel: c,
562
571
  summary: o,
563
- setParams: l
572
+ setParams: s
564
573
  }) {
565
- var U, j;
566
- const s = A(), r = W(), u = P({
567
- queryKey: ["delivery-analytics", "leaf", "n", a, o.acted_hours],
568
- queryFn: () => s.request(
569
- B(`/delivery-analytics/notifications/${a}`, { acted_hours: o.acted_hours })
574
+ var p, I;
575
+ const n = A(), d = W(), u = P({
576
+ queryKey: ["delivery-analytics", "leaf", "n", a, o.acted_hours, o.asof],
577
+ queryFn: () => n.request(
578
+ // The figures' asof: the leaf's acted verdict is the one they counted.
579
+ F(`/delivery-analytics/notifications/${a}`, {
580
+ acted_hours: o.acted_hours,
581
+ asof: o.asof
582
+ })
570
583
  ).then((h) => h.data),
571
584
  staleTime: 6e4
572
585
  });
573
586
  if (u.isLoading) return /* @__PURE__ */ e(ne, {});
574
587
  if (u.isError || !u.data)
575
- return /* @__PURE__ */ n("div", { className: "p-5", children: [
576
- /* @__PURE__ */ e(D, { className: "sr-only", children: "Notification" }),
588
+ return /* @__PURE__ */ r("div", { className: "p-5", children: [
589
+ /* @__PURE__ */ e(j, { className: "sr-only", children: "Notification" }),
577
590
  /* @__PURE__ */ e(
578
- V,
591
+ K,
579
592
  {
580
593
  error: u.error,
581
594
  what: "this notification",
@@ -583,31 +596,31 @@ function Be({
583
596
  }
584
597
  )
585
598
  ] });
586
- const t = u.data, k = r.record(t.collection, t.item), y = r.person((U = t.recipient) == null ? void 0 : U.id), p = r.person((j = t.sender) == null ? void 0 : j.id), E = t.read_at && t.timestamp ? (new Date(t.read_at).getTime() - new Date(t.timestamp).getTime()) / 6e4 : null, x = new Date(t.acted.window_ends).getTime() > Date.now();
587
- return /* @__PURE__ */ n(S, { children: [
599
+ const t = u.data, y = d.record(t.collection, t.item), f = d.person((p = t.recipient) == null ? void 0 : p.id), b = d.person((I = t.sender) == null ? void 0 : I.id), R = t.read_at && t.timestamp ? (new Date(t.read_at).getTime() - new Date(t.timestamp).getTime()) / 6e4 : null;
600
+ return /* @__PURE__ */ r(S, { children: [
588
601
  /* @__PURE__ */ e(
589
602
  ae,
590
603
  {
591
604
  title: t.subject ?? "(no subject)",
592
- sub: /* @__PURE__ */ n(S, { children: [
605
+ sub: /* @__PURE__ */ r(S, { children: [
593
606
  "Notification #",
594
607
  t.id,
595
608
  " · sent ",
596
- v(t.timestamp)
609
+ k(t.timestamp)
597
610
  ] }),
598
611
  onBack: m,
599
612
  backLabel: c
600
613
  }
601
614
  ),
602
- /* @__PURE__ */ n("div", { className: "min-h-0 flex-1 space-y-5 overflow-y-auto bg-white p-5 dark:bg-background", children: [
615
+ /* @__PURE__ */ r("div", { className: "min-h-0 flex-1 space-y-5 overflow-y-auto bg-white p-5 dark:bg-background", children: [
603
616
  /* @__PURE__ */ e(
604
617
  re,
605
618
  {
606
619
  items: [
607
620
  {
608
621
  k: "To",
609
- v: t.recipient ? /* @__PURE__ */ n(S, { children: [
610
- /* @__PURE__ */ e(_, { href: y, onClick: y ? r.go(y) : void 0, children: t.recipient.name }),
622
+ v: t.recipient ? /* @__PURE__ */ r(S, { children: [
623
+ /* @__PURE__ */ e(_, { href: f, onClick: f ? d.go(f) : void 0, children: t.recipient.name }),
611
624
  /* @__PURE__ */ e("span", { className: "text-slate-500 dark:text-muted-foreground", children: [
612
625
  t.recipient.role,
613
626
  t.recipient.status && t.recipient.status !== "active" ? t.recipient.status : null
@@ -616,37 +629,37 @@ function Be({
616
629
  },
617
630
  {
618
631
  k: "From",
619
- v: t.sender ? /* @__PURE__ */ e(_, { href: p, onClick: p ? r.go(p) : void 0, children: t.sender.name }) : "The system"
632
+ v: t.sender ? /* @__PURE__ */ e(_, { href: b, onClick: b ? d.go(b) : void 0, children: t.sender.name }) : "The system"
620
633
  },
621
- { k: "Category", v: w(t.category ?? "none") },
622
- { k: "Lane", v: w(t.lane ?? "fyi") },
634
+ { k: "Category", v: v(t.category ?? "none") },
635
+ { k: "Lane", v: v(t.lane ?? "fyi") },
623
636
  {
624
637
  k: "Record",
625
- v: k ? /* @__PURE__ */ n(_, { href: k, onClick: r.go(k), children: [
626
- w(t.collection ?? ""),
638
+ v: y ? /* @__PURE__ */ r(_, { href: y, onClick: d.go(y), children: [
639
+ v(t.collection ?? ""),
627
640
  " #",
628
641
  t.item,
629
- /* @__PURE__ */ e(K, { className: "h-3 w-3", "aria-hidden": !0 })
630
- ] }) : t.collection ? `${w(t.collection)}${t.item ? ` #${t.item}` : ""}` : "None"
642
+ /* @__PURE__ */ e(M, { className: "h-3 w-3", "aria-hidden": !0 })
643
+ ] }) : t.collection ? `${v(t.collection)}${t.item ? ` #${t.item}` : ""}` : "None"
631
644
  },
632
645
  {
633
646
  k: "Read",
634
- v: t.status === "inbox" ? t.snoozed_until ? `Snoozed until ${v(t.snoozed_until)}` : "Not yet" : t.read_at ? `${v(t.read_at)} · ${te(E)} after it was sent` : `Yes (${t.status}) — no read time recorded`
647
+ v: t.status === "inbox" ? t.snoozed_until ? `Snoozed until ${k(t.snoozed_until)}` : "Not yet" : t.read_at ? `${k(t.read_at)} · ${te(R)} after it was sent` : `Yes (${t.status}) — no read time recorded`
635
648
  }
636
649
  ]
637
650
  }
638
651
  ),
639
- /* @__PURE__ */ e(F, { title: "Why they got it", children: t.reason ? /* @__PURE__ */ n("div", { className: "rounded-lg border border-slate-200 px-3.5 py-3 text-[12.5px] dark:border-border", children: [
640
- /* @__PURE__ */ n("p", { className: "font-medium text-slate-900 dark:text-foreground", children: [
652
+ /* @__PURE__ */ e(D, { title: "Why they got it", children: t.reason ? /* @__PURE__ */ r("div", { className: "rounded-lg border border-slate-200 px-3.5 py-3 text-[12.5px] dark:border-border", children: [
653
+ /* @__PURE__ */ r("p", { className: "font-medium text-slate-900 dark:text-foreground", children: [
641
654
  t.reason.kind_label,
642
- t.reason.critical && /* @__PURE__ */ e("span", { className: "ml-2", children: /* @__PURE__ */ e(q, { outcome: "failed", children: "Critical" }) })
655
+ t.reason.critical && /* @__PURE__ */ e("span", { className: "ml-2", children: /* @__PURE__ */ e(E, { outcome: "failed", children: "Critical" }) })
643
656
  ] }),
644
657
  /* @__PURE__ */ e("p", { className: "mt-0.5 text-slate-600 dark:text-muted-foreground", children: t.reason.text }),
645
658
  t.reason.rules.length > 0 && /* @__PURE__ */ e("ul", { className: "mt-2 space-y-0.5 text-[12px] text-slate-600 dark:text-muted-foreground", children: t.reason.rules.map((h, L) => (
646
659
  // biome-ignore lint/suspicious/noArrayIndexKey: rules have no id
647
- /* @__PURE__ */ n("li", { children: [
648
- /* @__PURE__ */ n("span", { className: "text-slate-400", children: [
649
- h.channel === "all" ? "All channels" : w(h.channel),
660
+ /* @__PURE__ */ r("li", { children: [
661
+ /* @__PURE__ */ r("span", { className: "text-slate-400", children: [
662
+ h.channel === "all" ? "All channels" : v(h.channel),
650
663
  " ·",
651
664
  " "
652
665
  ] }),
@@ -654,31 +667,31 @@ function Be({
654
667
  ] }, L)
655
668
  )) })
656
669
  ] }) : /* @__PURE__ */ e("p", { className: "text-[12.5px] text-slate-500 dark:text-muted-foreground", children: "Not recorded — this notification was sent before the reason was stored." }) }),
657
- /* @__PURE__ */ n(F, { title: "Where it went", children: [
658
- /* @__PURE__ */ e("div", { className: "overflow-x-auto rounded-lg border border-slate-200 dark:border-border", children: /* @__PURE__ */ e("table", { className: "w-full text-[12.5px]", children: /* @__PURE__ */ e("tbody", { children: t.channels.map((h) => /* @__PURE__ */ n(
670
+ /* @__PURE__ */ r(D, { title: "Where it went", children: [
671
+ /* @__PURE__ */ e("div", { className: "overflow-x-auto rounded-lg border border-slate-200 dark:border-border", children: /* @__PURE__ */ e("table", { className: "w-full text-[12.5px]", children: /* @__PURE__ */ e("tbody", { children: t.channels.map((h) => /* @__PURE__ */ r(
659
672
  "tr",
660
673
  {
661
674
  className: "border-b border-slate-100 last:border-0 dark:border-border/60",
662
675
  children: [
663
- /* @__PURE__ */ e("td", { className: "w-[110px] px-3 py-2 align-top font-medium text-slate-800 dark:text-foreground", children: h.channel === "inapp" ? "In-app" : h.channel === "sms" ? "SMS" : w(h.channel) }),
664
- /* @__PURE__ */ n("td", { className: "px-3 py-2 align-top", children: [
665
- /* @__PURE__ */ e(q, { outcome: h.outcome, children: h.label }),
676
+ /* @__PURE__ */ e("td", { className: "w-[110px] px-3 py-2 align-top font-medium text-slate-800 dark:text-foreground", children: h.channel === "inapp" ? "In-app" : h.channel === "sms" ? "SMS" : v(h.channel) }),
677
+ /* @__PURE__ */ r("td", { className: "px-3 py-2 align-top", children: [
678
+ /* @__PURE__ */ e(E, { outcome: h.outcome, children: h.label }),
666
679
  h.reason && h.reason.replace(/\.$/, "") !== h.label.replace(/\.$/, "") && !h.reason.startsWith(h.label) && /* @__PURE__ */ e("p", { className: "mt-1 text-[12px] text-slate-600 dark:text-muted-foreground", children: h.reason })
667
680
  ] }),
668
- /* @__PURE__ */ e("td", { className: "whitespace-nowrap px-3 py-2 text-right align-top text-[11.5px] tabular-nums text-slate-500 dark:text-muted-foreground", children: h.at ? v(h.at) : "" })
681
+ /* @__PURE__ */ e("td", { className: "whitespace-nowrap px-3 py-2 text-right align-top text-[11.5px] tabular-nums text-slate-500 dark:text-muted-foreground", children: h.at ? k(h.at) : "" })
669
682
  ]
670
683
  },
671
684
  h.channel
672
685
  )) }) }) }),
673
- t.mail && /* @__PURE__ */ n("div", { className: "mt-2 rounded-lg border border-slate-200 px-3.5 py-3 text-[12.5px] dark:border-border", children: [
674
- /* @__PURE__ */ n("p", { className: "flex flex-wrap items-center gap-2", children: [
686
+ t.mail && /* @__PURE__ */ r("div", { className: "mt-2 rounded-lg border border-slate-200 px-3.5 py-3 text-[12.5px] dark:border-border", children: [
687
+ /* @__PURE__ */ r("p", { className: "flex flex-wrap items-center gap-2", children: [
675
688
  /* @__PURE__ */ e(ue, { className: "h-3.5 w-3.5 text-slate-400", "aria-hidden": !0 }),
676
- /* @__PURE__ */ n("span", { className: "font-medium text-slate-900 dark:text-foreground", children: [
689
+ /* @__PURE__ */ r("span", { className: "font-medium text-slate-900 dark:text-foreground", children: [
677
690
  "Email log #",
678
691
  t.mail.id
679
692
  ] }),
680
693
  /* @__PURE__ */ e(
681
- q,
694
+ E,
682
695
  {
683
696
  outcome: t.mail.status === "sent" ? "delivered" : t.mail.status ?? "other",
684
697
  children: t.mail.reason_label
@@ -689,7 +702,7 @@ function Be({
689
702
  "button",
690
703
  {
691
704
  type: "button",
692
- onClick: () => l((h) => {
705
+ onClick: () => s((h) => {
693
706
  var L;
694
707
  return h.set("leaf", `m:${(L = t.mail) == null ? void 0 : L.id}`);
695
708
  }),
@@ -697,14 +710,14 @@ function Be({
697
710
  children: "Open this email"
698
711
  }
699
712
  ),
700
- /* @__PURE__ */ n(
713
+ /* @__PURE__ */ r(
701
714
  _,
702
715
  {
703
- href: r.mailLog(t.mail.id),
704
- onClick: r.mailLog(t.mail.id) ? r.go(String(r.mailLog(t.mail.id))) : void 0,
716
+ href: d.mailLog(t.mail.id),
717
+ onClick: d.mailLog(t.mail.id) ? d.go(String(d.mailLog(t.mail.id))) : void 0,
705
718
  children: [
706
719
  "Mail log ",
707
- /* @__PURE__ */ e(K, { className: "h-3 w-3", "aria-hidden": !0 })
720
+ /* @__PURE__ */ e(M, { className: "h-3 w-3", "aria-hidden": !0 })
708
721
  ]
709
722
  }
710
723
  )
@@ -720,57 +733,67 @@ function Be({
720
733
  )
721
734
  ] })
722
735
  ] }),
723
- /* @__PURE__ */ e(F, { title: `Acted within ${t.acted.hours} hours`, children: /* @__PURE__ */ e("p", { className: "text-[12.5px] text-slate-700 dark:text-foreground", children: t.acted.eligible ? t.acted.actions.length > 0 ? t.acted.actions.map(
724
- (h) => `${h.kind === "transition" ? "Moved the record" : h.kind === "comment" ? "Commented" : "Completed a task"} ${v(h.at)}`
725
- ).join(" · ") : x ? `Nothing yet — the window stays open until ${v(t.acted.window_ends)}.` : "No transition, comment or task on the record in that time." : "Not about a record they could act on, so it does not count either way." }) }),
726
- /* @__PURE__ */ e(F, { title: "Message", children: t.message_hidden ? /* @__PURE__ */ e("p", { className: "text-[12.5px] text-slate-500 dark:text-muted-foreground", children: "Not shown: this notification can quote a private conversation." }) : t.message ? /* @__PURE__ */ e("p", { className: "whitespace-pre-wrap rounded-lg bg-slate-50 px-3.5 py-3 text-[12.5px] text-slate-800 dark:bg-muted/40 dark:text-foreground", children: t.message }) : /* @__PURE__ */ e("p", { className: "text-[12.5px] text-slate-500 dark:text-muted-foreground", children: "No message text." }) })
736
+ /* @__PURE__ */ e(D, { title: `Acted within ${t.acted.hours} hours`, children: /* @__PURE__ */ r("p", { className: "text-[12.5px] text-slate-700 dark:text-foreground", children: [
737
+ /* @__PURE__ */ e("span", { "data-da-acted": t.acted.verdict, className: "font-medium", children: Te[t.acted.verdict] ?? t.acted.verdict }),
738
+ t.acted.verdict === "window_open" && ` The window stays open until ${k(t.acted.window_ends)}.`,
739
+ t.acted.actions.length > 0 && /* @__PURE__ */ e("span", { className: "block text-slate-600 dark:text-muted-foreground", children: t.acted.actions.map(
740
+ (h) => `${h.kind === "transition" ? "Moved the record" : h.kind === "comment" ? "Commented" : "Completed a task"} ${k(h.at)}`
741
+ ).join(" · ") })
742
+ ] }) }),
743
+ /* @__PURE__ */ e(D, { title: "Message", children: t.message_hidden ? /* @__PURE__ */ e("p", { className: "text-[12.5px] text-slate-500 dark:text-muted-foreground", children: "Not shown: this notification can quote a private conversation." }) : t.message ? /* @__PURE__ */ e("p", { className: "whitespace-pre-wrap rounded-lg bg-slate-50 px-3.5 py-3 text-[12.5px] text-slate-800 dark:bg-muted/40 dark:text-foreground", children: t.message }) : /* @__PURE__ */ e("p", { className: "text-[12.5px] text-slate-500 dark:text-muted-foreground", children: "No message text." }) })
727
744
  ] })
728
745
  ] });
729
746
  }
730
- function Ee({
747
+ function Ue({
731
748
  id: a,
732
749
  onBack: m,
733
750
  backLabel: c
734
751
  }) {
735
- const o = A(), l = W(), s = P({
736
- queryKey: ["delivery-analytics", "leaf", "m", a],
737
- queryFn: () => o.request(B(`/delivery-analytics/mail/${a}`)).then((k) => k.data),
738
- staleTime: 6e4
752
+ const o = A(), s = W(), [n, d] = V(!1), u = P({
753
+ queryKey: ["delivery-analytics", "leaf", "m", a, n],
754
+ queryFn: () => o.request(
755
+ F(`/delivery-analytics/mail/${a}`, n ? { reveal: 1 } : void 0)
756
+ ).then((b) => b.data),
757
+ staleTime: Number.POSITIVE_INFINITY,
758
+ gcTime: 0,
759
+ refetchOnWindowFocus: !1,
760
+ refetchOnReconnect: !1,
761
+ retry: !1
739
762
  });
740
- if (s.isLoading) return /* @__PURE__ */ e(ne, {});
741
- if (s.isError || !s.data)
742
- return /* @__PURE__ */ n("div", { className: "p-5", children: [
743
- /* @__PURE__ */ e(D, { className: "sr-only", children: "Email" }),
744
- /* @__PURE__ */ e(V, { error: s.error, what: "this email", onRetry: () => void s.refetch() })
763
+ if (u.isLoading) return /* @__PURE__ */ e(ne, {});
764
+ if (u.isError || !u.data)
765
+ return /* @__PURE__ */ r("div", { className: "p-5", children: [
766
+ /* @__PURE__ */ e(j, { className: "sr-only", children: "Email" }),
767
+ /* @__PURE__ */ e(K, { error: u.error, what: "this email", onRetry: () => void u.refetch() })
745
768
  ] });
746
- const r = s.data, u = l.record(r.collection, r.item), t = l.mailLog(r.id);
747
- return /* @__PURE__ */ n(S, { children: [
769
+ const t = u.data, y = s.record(t.collection, t.item), f = s.mailLog(t.id);
770
+ return /* @__PURE__ */ r(S, { children: [
748
771
  /* @__PURE__ */ e(
749
772
  ae,
750
773
  {
751
- title: r.subject ?? "(no subject)",
752
- sub: /* @__PURE__ */ n(S, { children: [
774
+ title: t.subject ?? "(no subject)",
775
+ sub: /* @__PURE__ */ r(S, { children: [
753
776
  "Email log #",
754
- r.id,
777
+ t.id,
755
778
  " · ",
756
- v(r.created_at)
779
+ k(t.created_at)
757
780
  ] }),
758
781
  onBack: m,
759
782
  backLabel: c
760
783
  }
761
784
  ),
762
- /* @__PURE__ */ n("div", { className: "min-h-0 flex-1 space-y-5 overflow-y-auto bg-white p-5 dark:bg-background", children: [
763
- /* @__PURE__ */ n("div", { className: "rounded-lg border border-slate-200 px-3.5 py-3 text-[12.5px] dark:border-border", children: [
764
- /* @__PURE__ */ n("p", { className: "flex flex-wrap items-center gap-2", children: [
765
- /* @__PURE__ */ e(q, { outcome: r.outcome, children: r.outcome_label }),
766
- r.reason_label !== r.outcome_label && /* @__PURE__ */ e("span", { className: "font-medium text-slate-900 dark:text-foreground", children: r.reason_label })
785
+ /* @__PURE__ */ r("div", { className: "min-h-0 flex-1 space-y-5 overflow-y-auto bg-white p-5 dark:bg-background", children: [
786
+ /* @__PURE__ */ r("div", { className: "rounded-lg border border-slate-200 px-3.5 py-3 text-[12.5px] dark:border-border", children: [
787
+ /* @__PURE__ */ r("p", { className: "flex flex-wrap items-center gap-2", children: [
788
+ /* @__PURE__ */ e(E, { outcome: t.outcome, children: t.outcome_label }),
789
+ t.reason_label !== t.outcome_label && /* @__PURE__ */ e("span", { className: "font-medium text-slate-900 dark:text-foreground", children: t.reason_label })
767
790
  ] }),
768
- r.hint && /* @__PURE__ */ e("p", { className: "mt-1 text-slate-600 dark:text-muted-foreground", children: r.hint }),
769
- r.error && /* @__PURE__ */ e(
791
+ t.hint && /* @__PURE__ */ e("p", { className: "mt-1 text-slate-600 dark:text-muted-foreground", children: t.hint }),
792
+ t.error && /* @__PURE__ */ e(
770
793
  Z,
771
794
  {
772
795
  className: "mt-1.5",
773
- description: { title: r.reason_label, technical: r.error },
796
+ description: { title: t.reason_label, technical: t.error },
774
797
  action: "Send an email"
775
798
  }
776
799
  )
@@ -781,53 +804,73 @@ function Ee({
781
804
  items: [
782
805
  {
783
806
  k: "To",
784
- v: /* @__PURE__ */ n(S, { children: [
785
- r.to ?? "–",
786
- r.recipients.length > 0 && /* @__PURE__ */ e("span", { className: "block text-[12px]", children: r.recipients.map((k, y) => {
787
- const p = l.person(k.id);
788
- return /* @__PURE__ */ n("span", { children: [
789
- y > 0 && ", ",
790
- /* @__PURE__ */ e(_, { href: p, onClick: p ? l.go(p) : void 0, children: k.name })
791
- ] }, k.id);
807
+ v: /* @__PURE__ */ r(S, { children: [
808
+ t.to ?? "–",
809
+ t.recipients.length > 0 && /* @__PURE__ */ e("span", { className: "block text-[12px]", children: t.recipients.map((b, R) => {
810
+ const p = s.person(b.id);
811
+ return /* @__PURE__ */ r("span", { children: [
812
+ R > 0 && ", ",
813
+ /* @__PURE__ */ e(_, { href: p, onClick: p ? s.go(p) : void 0, children: b.name })
814
+ ] }, b.id);
792
815
  }) })
793
816
  ] })
794
817
  },
795
- { k: "Template", v: r.template ?? "None" },
818
+ { k: "Template", v: t.template ?? "None" },
796
819
  {
797
820
  k: "Record",
798
- v: u ? /* @__PURE__ */ n(_, { href: u, onClick: l.go(u), children: [
799
- w(r.collection ?? ""),
821
+ v: y ? /* @__PURE__ */ r(_, { href: y, onClick: s.go(y), children: [
822
+ v(t.collection ?? ""),
800
823
  " #",
801
- r.item,
802
- /* @__PURE__ */ e(K, { className: "h-3 w-3", "aria-hidden": !0 })
803
- ] }) : r.collection ? `${w(r.collection)}${r.item ? ` #${r.item}` : ""}` : "None"
824
+ t.item,
825
+ /* @__PURE__ */ e(M, { className: "h-3 w-3", "aria-hidden": !0 })
826
+ ] }) : t.collection ? `${v(t.collection)}${t.item ? ` #${t.item}` : ""}` : "None"
804
827
  },
805
- ...r.resend_of ? [{ k: "Resend of", v: `Email log #${r.resend_of}` }] : [],
828
+ ...t.resend_of ? [{ k: "Resend of", v: `Email log #${t.resend_of}` }] : [],
806
829
  {
807
830
  k: "Mail log",
808
- v: /* @__PURE__ */ n(_, { href: t, onClick: t ? l.go(t) : void 0, children: [
831
+ v: /* @__PURE__ */ r(_, { href: f, onClick: f ? s.go(f) : void 0, children: [
809
832
  "Open this row in the Mail log ",
810
- /* @__PURE__ */ e(K, { className: "h-3 w-3", "aria-hidden": !0 })
833
+ /* @__PURE__ */ e(M, { className: "h-3 w-3", "aria-hidden": !0 })
811
834
  ] })
812
835
  }
813
836
  ]
814
837
  }
815
838
  ),
816
- /* @__PURE__ */ e(F, { title: "The email as sent", children: r.body ? /* @__PURE__ */ e(
839
+ /* @__PURE__ */ e(D, { title: "The email as sent", children: t.body_withheld ? /* @__PURE__ */ r(
840
+ "div",
841
+ {
842
+ "data-da-withheld": "",
843
+ className: "rounded-lg border border-slate-200 px-3.5 py-3 text-[12.5px] dark:border-border",
844
+ children: [
845
+ /* @__PURE__ */ e("p", { className: "text-slate-700 dark:text-foreground", children: "This email quotes a private chat, so its text is not shown here." }),
846
+ /* @__PURE__ */ e(
847
+ "button",
848
+ {
849
+ type: "button",
850
+ onClick: () => d(!0),
851
+ className: "mt-2 inline-flex h-7 items-center rounded-md border border-slate-200 px-2.5 text-[12px] font-medium text-slate-700 hover:bg-slate-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan/50 dark:border-border dark:text-foreground dark:hover:bg-muted",
852
+ children: "Show (logged compliance view)"
853
+ }
854
+ )
855
+ ]
856
+ }
857
+ ) : t.body ? /* @__PURE__ */ e(
817
858
  "iframe",
818
859
  {
819
860
  title: "Rendered email",
820
861
  sandbox: "",
821
- srcDoc: r.body,
862
+ srcDoc: qe(t.body),
822
863
  className: "h-[520px] w-full rounded-md border border-slate-200 bg-white dark:border-border"
823
864
  }
824
- ) : /* @__PURE__ */ n("p", { className: "text-[12.5px] text-slate-500 dark:text-muted-foreground", children: [
865
+ ) : /* @__PURE__ */ r("p", { className: "text-[12.5px] text-slate-500 dark:text-muted-foreground", children: [
825
866
  "No stored body for this row",
826
- r.status === "dropped" || r.status === "deferred" ? " — it was never sent." : "."
867
+ t.status === "dropped" || t.status === "deferred" ? " — it was never sent." : "."
827
868
  ] }) })
828
869
  ] })
829
870
  ] });
830
871
  }
831
872
  export {
832
- Xe as DrillSheet
873
+ Ze as DrillSheet,
874
+ Re as EMAIL_CSP,
875
+ qe as sandboxedEmail
833
876
  };