@nivaro/react 0.3.99 → 0.3.101

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 (60) hide show
  1. package/dist/full.css +1 -1
  2. package/dist/hooks/useFormSchema.js +82 -85
  3. package/dist/hooks/useSessionRecorder.js +206 -175
  4. package/dist/index.d.ts +84 -16
  5. package/dist/index.js +627 -622
  6. package/dist/lib/commands.js +15 -11
  7. package/dist/shared/components/ActivityEntry.js +5 -5
  8. package/dist/shared/components/CollectionBrowserView.js +516 -503
  9. package/dist/shared/components/ItemEditForm.js +3471 -3465
  10. package/dist/shared/components/JobsTray.js +76 -61
  11. package/dist/shared/components/MyWorkView.js +133 -126
  12. package/dist/shared/components/NotificationBell.js +322 -289
  13. package/dist/shared/components/RecordCompare.js +38 -40
  14. package/dist/shared/components/RecordReadView.js +119 -119
  15. package/dist/shared/components/TipLayer.js +56 -41
  16. package/dist/shared/components/cbv/FoundElsewhere.js +61 -0
  17. package/dist/shared/components/integrations/console/SignalCard.js +40 -40
  18. package/dist/shared/components/integrations/console/drill/SubmissionDrill.js +95 -73
  19. package/dist/shared/components/integrations/console/drill/status.js +23 -18
  20. package/dist/shared/components/item-edit/InlineGridField.js +45 -45
  21. package/dist/shared/components/item-edit/InlineTableField.js +750 -749
  22. package/dist/shared/components/item-edit/QuickPickerDialog.js +44 -44
  23. package/dist/shared/components/item-edit/RawEditSheet.js +122 -114
  24. package/dist/shared/components/item-edit/RecordInsights.js +86 -86
  25. package/dist/shared/components/item-edit/RelationCombobox.js +454 -378
  26. package/dist/shared/components/item-edit/SummaryPanel.js +56 -48
  27. package/dist/shared/components/item-edit/header-path-preview.js +46 -34
  28. package/dist/shared/components/item-edit/related-missing.js +75 -19
  29. package/dist/shared/components/notifications/DeliveryChips.js +1 -2
  30. package/dist/shared/components/notifications/NotificationCenterView.js +249 -226
  31. package/dist/shared/components/panels/AccessDeniedPanel.js +31 -28
  32. package/dist/shared/components/panels/BackgroundMove.js +242 -0
  33. package/dist/shared/components/panels/MoveAdvisory.js +204 -0
  34. package/dist/shared/components/panels/PipelinePanel.js +1459 -1220
  35. package/dist/shared/components/panels/RecordIntegrityBanner.js +113 -112
  36. package/dist/shared/components/profile/ActivityFeedCard.js +322 -0
  37. package/dist/shared/components/profile/DayTimeline.js +145 -140
  38. package/dist/shared/components/profile/PersonAccess.js +679 -383
  39. package/dist/shared/components/profile/PersonActivity.js +404 -427
  40. package/dist/shared/components/profile/PersonDidPanel.js +248 -134
  41. package/dist/shared/components/profile/PersonProfile.js +33 -32
  42. package/dist/shared/components/profile/journey-view.js +166 -0
  43. package/dist/shared/lib/activity-sentence.js +319 -236
  44. package/dist/shared/lib/commands.js +18 -14
  45. package/dist/shared/lib/error-hints.js +1 -1
  46. package/dist/shared/lib/job-failure-text.js +12 -0
  47. package/dist/shared/lib/jobs-tray.js +60 -41
  48. package/dist/shared/lib/move-failure.js +19 -0
  49. package/dist/shared/lib/obligation-banner.js +22 -21
  50. package/dist/shared/lib/partner-failure.js +83 -0
  51. package/dist/shared/lib/prefetch.js +73 -73
  52. package/dist/shared/lib/replay-checkout.js +18 -13
  53. package/dist/shared/lib/replay-context.js +90 -77
  54. package/dist/shared/lib/replay-idle.js +21 -0
  55. package/dist/shared/lib/replay-socket.js +21 -17
  56. package/dist/shared/lib/rum.js +56 -51
  57. package/dist/shared/lib/safe-error.js +17 -13
  58. package/dist/shared/lib/stale-chunk.js +69 -26
  59. package/dist/shared/lib/system-collections.js +20 -0
  60. package/package.json +1 -1
@@ -1,322 +1,348 @@
1
- import { jsxs as o, jsx as a } from "react/jsx-runtime";
2
- import { readUnreadNotificationCount as ye, markNotificationRead as Ne, markNotificationsRead as Ce, markAllNotificationsRead as $e } from "@nivaro/sdk";
3
- import { useQueryClient as _e, useQuery as ne, useMutation as E } from "@tanstack/react-query";
4
- import { Bell as Se, CheckCheck as qe, ExternalLink as re, Check as z, History as Ee, ShieldCheck as Ae, ChevronDown as Le } from "lucide-react";
5
- import { useState as $, useRef as oe, useEffect as O, useMemo as le, Fragment as ie } from "react";
6
- import { createPortal as Re } from "react-dom";
7
- import { useNivaroClient as Fe } from "../context.js";
8
- import { get as Me, post as Ie } from "../lib/commands.js";
9
- import { useLiveRefetchInterval as De } from "../lib/live-queries.js";
10
- import { resolveNotificationTargetFor as A, runNotificationTarget as L } from "../lib/notification-target.js";
11
- import { useTabAttention as Te } from "../lib/tab-attention.js";
12
- import { formatRelative as se } from "../lib/utils.js";
13
- import { AsItWasSheet as Ke } from "./notifications/AsItWasSheet.js";
14
- import { bundleLocally as Be, laneTone as je, bundleAsNotification as ze, bundleHeadline as Oe, categoryChipLabel as Pe } from "./notifications/bundles.js";
15
- import { DeliveryChips as Qe } from "./notifications/DeliveryChips.js";
16
- import { NotificationActions as He } from "./notifications/NotificationActions.js";
17
- import { NotificationDetailBits as Ge } from "./notifications/NotificationDetailBits.js";
18
- function Ue(n) {
19
- var u, h;
1
+ import { jsxs as r, jsx as t, Fragment as Ne } from "react/jsx-runtime";
2
+ import { readUnreadNotificationCount as Ce, markNotificationRead as $e, markNotificationsRead as _e, markAllNotificationsRead as Me } from "@nivaro/sdk";
3
+ import { useQueryClient as Se, useQuery as re, useMutation as F } from "@tanstack/react-query";
4
+ import { Bell as qe, CheckCheck as Re, ExternalLink as oe, Check as A, History as Ee, ShieldCheck as Fe, ChevronDown as Ae } from "lucide-react";
5
+ import { useState as M, useRef as le, useEffect as P, useMemo as ie, Fragment as se } from "react";
6
+ import { createPortal as Le } from "react-dom";
7
+ import { useNivaroClient as Ie } from "../context.js";
8
+ import { get as De, post as Te } from "../lib/commands.js";
9
+ import { useLiveRefetchInterval as Ke } from "../lib/live-queries.js";
10
+ import { resolveNotificationTargetFor as S, runNotificationTarget as L } from "../lib/notification-target.js";
11
+ import { useTabAttention as Oe } from "../lib/tab-attention.js";
12
+ import { formatRelative as de, cn as Be } from "../lib/utils.js";
13
+ import { AsItWasSheet as je } from "./notifications/AsItWasSheet.js";
14
+ import { bundleLocally as ze, laneTone as Pe, bundleAsNotification as Qe, bundleHeadline as He, categoryChipLabel as Ge } from "./notifications/bundles.js";
15
+ import { DeliveryChips as Ue } from "./notifications/DeliveryChips.js";
16
+ import { NotificationActions as Ye } from "./notifications/NotificationActions.js";
17
+ import { NotificationDetailBits as Ve } from "./notifications/NotificationDetailBits.js";
18
+ function We(n) {
19
+ var p, k;
20
20
  if (!n) return null;
21
21
  if (n.target_label && n.kind !== "record") return n.target_label;
22
22
  if (String(n.collection ?? "") === "__chat__") return "Chat";
23
23
  if (!n.collection) return null;
24
- const d = ((u = n.record_collection_label) == null ? void 0 : u.trim()) || (() => {
25
- const f = String(n.collection).replace(/_/g, " ").trim();
26
- return f ? f.charAt(0).toUpperCase() + f.slice(1) : null;
27
- })(), c = (h = n.record_label) == null ? void 0 : h.trim();
28
- return d && c ? `${d} ${c}` : c || d || null;
24
+ const d = ((p = n.record_collection_label) == null ? void 0 : p.trim()) || (() => {
25
+ const h = String(n.collection).replace(/_/g, " ").trim();
26
+ return h ? h.charAt(0).toUpperCase() + h.slice(1) : null;
27
+ })(), u = (k = n.record_label) == null ? void 0 : k.trim();
28
+ return d && u ? `${d} ${u}` : u || d || null;
29
29
  }
30
- function Ye(n) {
31
- var d, c;
32
- return de(n) ? n.revision_id != null || (((c = (d = n.detail) == null ? void 0 : d.changes) == null ? void 0 : c.length) ?? 0) > 0 || n.category === "watch" || n.category === "workflow" : !1;
30
+ function Je(n) {
31
+ var d, u;
32
+ return ce(n) ? n.revision_id != null || (((u = (d = n.detail) == null ? void 0 : d.changes) == null ? void 0 : u.length) ?? 0) > 0 || n.category === "watch" || n.category === "workflow" : !1;
33
33
  }
34
- function de(n) {
35
- var h, f, _;
36
- if ((((h = n.target) == null ? void 0 : h.kind) ?? n.kind ?? (n.collection && n.item ? "record" : null)) !== "record") return !1;
37
- const c = ((f = n.target) == null ? void 0 : f.collection) ?? n.collection, u = ((_ = n.target) == null ? void 0 : _.id) ?? n.item;
38
- return !!c && u != null && u !== "" && !/^(nivaro|directus)_|^__/i.test(c);
34
+ function ce(n) {
35
+ var k, h, q;
36
+ if ((((k = n.target) == null ? void 0 : k.kind) ?? n.kind ?? (n.collection && n.item ? "record" : null)) !== "record") return !1;
37
+ const u = ((h = n.target) == null ? void 0 : h.collection) ?? n.collection, p = ((q = n.target) == null ? void 0 : q.id) ?? n.item;
38
+ return !!u && p != null && p !== "" && !/^(nivaro|directus)_|^__/i.test(u);
39
39
  }
40
- function mt({
40
+ function xt({
41
41
  routes: n,
42
42
  onNavigate: d,
43
- app: c,
44
- subscribe: u,
45
- buttonClassName: h,
46
- panelClassName: f,
47
- beforeList: _,
48
- extraBadge: P = 0,
49
- mailLogUrl: ce,
50
- renderTrigger: Q,
51
- allPath: H,
52
- subscriptionsPath: ue,
43
+ app: u,
44
+ subscribe: p,
45
+ buttonClassName: k,
46
+ panelClassName: h,
47
+ beforeList: q,
48
+ extraBadge: Q = 0,
49
+ mailLogUrl: ue,
50
+ renderTrigger: H,
51
+ allPath: G,
52
+ subscriptionsPath: pe,
53
53
  rulesPath: me,
54
- onActionError: pe,
55
- panelPlacement: y = "below",
54
+ onActionError: fe,
55
+ panelPlacement: $ = "below",
56
56
  tabBadge: xe = !0
57
57
  }) {
58
- const k = Fe(), [b, m] = $(!1), [g, G] = $("attention"), R = oe(null), U = oe(null), [F, fe] = $(null), Y = _e(), N = () => {
59
- Y.invalidateQueries({ queryKey: ["notification-count"] }), Y.invalidateQueries({ queryKey: ["notifications"] });
60
- }, he = De(6e4, { enabled: !!u, safetyMs: 12e4 }), { data: p } = ne({
58
+ const y = Ie(), [g, m] = M(!1), [w, U] = M("attention"), I = le(null), Y = le(null), [D, he] = M(null), V = Se(), _ = () => {
59
+ V.invalidateQueries({ queryKey: ["notification-count"] }), V.invalidateQueries({ queryKey: ["notifications"] });
60
+ }, be = Ke(6e4, { enabled: !!p, safetyMs: 12e4 }), { data: f } = re({
61
61
  queryKey: ["notification-count"],
62
- queryFn: () => k.request(ye()),
63
- refetchInterval: he
64
- }), M = (p == null ? void 0 : p.unread) ?? 0, I = (p == null ? void 0 : p.attention) ?? M, S = (p == null ? void 0 : p.lanes) ?? { critical: 0, fyi: 0 }, w = M + P;
65
- Te(I + P, { enabled: xe });
66
- const { data: x } = ne({
67
- queryKey: ["notifications", "bell", c ?? null, g],
68
- queryFn: () => k.request(
69
- Me("/notifications", {
62
+ queryFn: () => y.request(Ce()),
63
+ refetchInterval: be
64
+ }), T = (f == null ? void 0 : f.unread) ?? 0, K = (f == null ? void 0 : f.attention) ?? T, R = (f == null ? void 0 : f.lanes) ?? { critical: 0, fyi: 0 }, N = T + Q;
65
+ Oe(K + Q, { enabled: xe });
66
+ const { data: x } = re({
67
+ queryKey: ["notifications", "bell", u ?? null, w],
68
+ queryFn: () => y.request(
69
+ De("/notifications", {
70
70
  limit: 60,
71
- app: c,
71
+ app: u,
72
72
  bundle: "record",
73
- ...g === "attention" ? { lane: "attention", status: "inbox" } : {},
74
- ...g === "fyi" ? { lane: "fyi", status: "inbox" } : {}
73
+ ...w === "attention" ? { lane: "attention", status: "inbox" } : {},
74
+ ...w === "fyi" ? { lane: "fyi", status: "inbox" } : {}
75
75
  })
76
76
  ).then((e) => {
77
- const t = e.pinned ?? [], l = new Set(t.map((r) => r.id)), s = (e.data ?? []).filter((r) => !l.has(r.id));
78
- return e.bundles ? { rows: s, bundles: e.bundles, pinned: t } : { ...Be(s), pinned: t };
77
+ const a = e.pinned ?? [], o = new Set(a.map((s) => s.id)), i = (e.data ?? []).filter((s) => !o.has(s.id));
78
+ return e.bundles ? { rows: i, bundles: e.bundles, pinned: a } : { ...ze(i), pinned: a };
79
79
  }),
80
- enabled: b
81
- }), V = (x == null ? void 0 : x.rows) ?? [], D = (x == null ? void 0 : x.pinned) ?? [], W = (x == null ? void 0 : x.bundles) ?? [], [be, J] = $(() => /* @__PURE__ */ new Set()), [v, T] = $(null);
82
- O(() => u == null ? void 0 : u(N), [u]), O(() => {
83
- if (!b) return;
84
- const e = (t) => {
85
- var s, r;
86
- const l = t.target;
87
- (s = R.current) != null && s.contains(l) || (r = U.current) != null && r.contains(l) || m(!1);
80
+ enabled: g
81
+ }), W = (x == null ? void 0 : x.rows) ?? [], O = (x == null ? void 0 : x.pinned) ?? [], J = (x == null ? void 0 : x.bundles) ?? [], [ke, X] = M(() => /* @__PURE__ */ new Set()), [C, B] = M(null);
82
+ P(() => p == null ? void 0 : p(_), [p]), P(() => {
83
+ if (!g) return;
84
+ const e = (a) => {
85
+ var i, s;
86
+ const o = a.target;
87
+ (i = I.current) != null && i.contains(o) || (s = Y.current) != null && s.contains(o) || m(!1);
88
88
  };
89
89
  return window.addEventListener("mousedown", e), () => window.removeEventListener("mousedown", e);
90
- }, [b]), O(() => {
91
- if (!b || y !== "right") return;
90
+ }, [g]), P(() => {
91
+ if (!g || $ !== "right") return;
92
92
  const e = () => {
93
- var l;
94
- const t = (l = R.current) == null ? void 0 : l.getBoundingClientRect();
95
- t && fe({
96
- left: Math.round(t.right + 12),
97
- bottom: Math.max(8, Math.round(window.innerHeight - t.bottom))
93
+ var o;
94
+ const a = (o = I.current) == null ? void 0 : o.getBoundingClientRect();
95
+ a && he({
96
+ left: Math.round(a.right + 12),
97
+ bottom: Math.max(8, Math.round(window.innerHeight - a.bottom))
98
98
  });
99
99
  };
100
100
  return e(), window.addEventListener("resize", e), window.addEventListener("scroll", e, !0), () => {
101
101
  window.removeEventListener("resize", e), window.removeEventListener("scroll", e, !0);
102
102
  };
103
- }, [b, y]);
104
- const X = E({
105
- mutationFn: (e) => k.request(Ie(`/notifications/${e}/acknowledge`)),
106
- onSuccess: N
107
- }), K = E({
108
- mutationFn: (e) => k.request(Ne(e)),
109
- onSuccess: N
110
- }), B = E({
111
- mutationFn: (e) => k.request(Ce(e)),
112
- onSuccess: N
113
- }), ge = E({
114
- mutationFn: () => k.request($e()),
115
- onSuccess: N
116
- }), Z = le(() => V.slice(0, 40), [V]), ee = le(() => {
103
+ }, [g, $]);
104
+ const Z = F({
105
+ mutationFn: (e) => y.request(Te(`/notifications/${e}/acknowledge`)),
106
+ onSuccess: _
107
+ }), E = F({
108
+ mutationFn: (e) => y.request($e(e)),
109
+ onSuccess: _
110
+ }), j = F({
111
+ mutationFn: (e) => y.request(_e(e)),
112
+ onSuccess: _
113
+ }), ge = F({
114
+ mutationFn: () => y.request(Me()),
115
+ onSuccess: _
116
+ }), ee = ie(() => W.slice(0, 40), [W]), te = ie(() => {
117
117
  const e = /* @__PURE__ */ new Map();
118
- for (const t of Z) {
119
- const l = t.collection && t.item ? `${t.collection}:${t.item}` : `single:${t.id}`, s = e.get(l) ?? {
120
- key: l,
121
- collection: t.collection ?? null,
122
- item: t.item ?? null,
118
+ for (const a of ee) {
119
+ const o = a.collection && a.item ? `${a.collection}:${a.item}` : `single:${a.id}`, i = e.get(o) ?? {
120
+ key: o,
121
+ collection: a.collection ?? null,
122
+ item: a.item ?? null,
123
123
  rows: []
124
124
  };
125
- s.rows.push(t), e.set(l, s);
125
+ i.rows.push(a), e.set(o, i);
126
126
  }
127
127
  return [...e.values()];
128
- }, [Z]), ke = (e) => {
129
- const t = A(e, n);
130
- t && (m(!1), L(t, d));
131
- }, te = (e) => {
128
+ }, [ee]), we = (e) => {
129
+ const a = S(e, n);
130
+ a && (m(!1), L(a, d));
131
+ }, ae = (e) => {
132
132
  m(!1), d(e);
133
- }, j = (e, t, l = !1) => {
134
- var s;
135
- return /* @__PURE__ */ o(ie, { children: [
136
- /* @__PURE__ */ o(
133
+ }, z = (e, a, o = !1) => {
134
+ var v;
135
+ const i = S(e, n) != null, s = `py-2 pr-3 ${o ? "pl-7" : "pl-3"}`, b = /* @__PURE__ */ r(Ne, { children: [
136
+ /* @__PURE__ */ t(
137
+ "span",
138
+ {
139
+ className: `mt-1.5 h-2 w-2 shrink-0 rounded-full ${e.read ? "bg-transparent" : e.lane === "critical" ? "bg-red-500" : "bg-nvr-cyan"}`
140
+ }
141
+ ),
142
+ /* @__PURE__ */ r("span", { className: "min-w-0 flex-1", children: [
143
+ /* @__PURE__ */ r(
144
+ "span",
145
+ {
146
+ className: `block truncate text-[12.5px] ${e.read ? "font-normal text-slate-600 dark:text-slate-400" : "font-medium text-slate-900 dark:text-slate-100"}`,
147
+ children: [
148
+ e.lane === "critical" && !e.read && /* @__PURE__ */ t("span", { className: "mr-1 rounded bg-red-500/10 px-1 text-[9.5px] font-bold uppercase tracking-wide text-red-600 dark:text-red-400", children: "Critical" }),
149
+ e.title
150
+ ]
151
+ }
152
+ ),
153
+ e.message && /* @__PURE__ */ t("span", { className: "mt-0.5 line-clamp-2 text-[11px] leading-snug text-slate-500", children: e.message.replace(/<[^>]+>/g, "") }),
154
+ /* @__PURE__ */ r("span", { className: "mt-0.5 flex flex-wrap items-center gap-x-2 gap-y-0.5 text-[10.5px] text-slate-400", children: [
155
+ de(e.created_at),
156
+ /* @__PURE__ */ t(
157
+ Ue,
158
+ {
159
+ delivery: e.delivery,
160
+ mailLogUrl: ue,
161
+ onNavigate: ae
162
+ }
163
+ ),
164
+ ce(e) && // biome-ignore lint/a11y/useSemanticElements: nested inside the row's <button> — a real <button> is invalid there
165
+ /* @__PURE__ */ r(
166
+ "span",
167
+ {
168
+ role: "button",
169
+ tabIndex: -1,
170
+ "data-notification-as-it-was": e.id,
171
+ "data-tip": "The record as it was when you were told",
172
+ onClick: (c) => {
173
+ c.stopPropagation(), m(!1), B(e);
174
+ },
175
+ onKeyDown: (c) => {
176
+ (c.key === "Enter" || c.key === " ") && (c.preventDefault(), c.stopPropagation(), m(!1), B(e));
177
+ },
178
+ className: "inline-flex items-center gap-0.5 rounded px-1 text-[10.5px] text-slate-400 transition-colors hover:bg-slate-100 hover:text-slate-700 dark:hover:bg-muted dark:hover:text-slate-200",
179
+ children: [
180
+ /* @__PURE__ */ t(Ee, { className: "h-3 w-3" }),
181
+ "as it was"
182
+ ]
183
+ }
184
+ )
185
+ ] })
186
+ ] })
187
+ ] }), l = "mt-0.5 rounded p-1 text-slate-400 hover:bg-slate-100 hover:text-slate-700 dark:hover:bg-muted dark:hover:text-slate-200";
188
+ return /* @__PURE__ */ r(se, { children: [
189
+ i ? /* @__PURE__ */ r(
137
190
  "button",
138
191
  {
139
192
  type: "button",
140
193
  onClick: () => {
141
- e.read || K.mutate(e.id), ke(e);
194
+ e.read || E.mutate(e.id), we(e);
142
195
  },
143
- className: `flex w-full items-start gap-2.5 py-2 pr-3 text-left transition-colors ${l ? "pl-7" : "pl-3"} ${t ? "hover:bg-slate-50 dark:hover:bg-muted" : "cursor-default"}`,
196
+ className: `flex w-full items-start gap-2.5 text-left transition-colors hover:bg-slate-50 dark:hover:bg-muted ${s}`,
144
197
  "data-notification-row": e.id,
145
198
  children: [
146
- /* @__PURE__ */ a(
147
- "span",
148
- {
149
- className: `mt-1.5 h-2 w-2 shrink-0 rounded-full ${e.read ? "bg-transparent" : e.lane === "critical" ? "bg-red-500" : "bg-nvr-cyan"}`
150
- }
151
- ),
152
- /* @__PURE__ */ o("span", { className: "min-w-0 flex-1", children: [
153
- /* @__PURE__ */ o(
154
- "span",
155
- {
156
- className: `block truncate text-[12.5px] ${e.read ? "font-normal text-slate-600 dark:text-slate-400" : "font-medium text-slate-900 dark:text-slate-100"}`,
157
- children: [
158
- e.lane === "critical" && !e.read && /* @__PURE__ */ a("span", { className: "mr-1 rounded bg-red-500/10 px-1 text-[9.5px] font-bold uppercase tracking-wide text-red-600 dark:text-red-400", children: "Critical" }),
159
- e.title
160
- ]
161
- }
162
- ),
163
- e.message && /* @__PURE__ */ a("span", { className: "mt-0.5 line-clamp-2 text-[11px] leading-snug text-slate-500", children: e.message.replace(/<[^>]+>/g, "") }),
164
- /* @__PURE__ */ o("span", { className: "mt-0.5 flex flex-wrap items-center gap-x-2 gap-y-0.5 text-[10.5px] text-slate-400", children: [
165
- se(e.created_at),
166
- /* @__PURE__ */ a(
167
- Qe,
168
- {
169
- delivery: e.delivery,
170
- mailLogUrl: ce,
171
- onNavigate: te
172
- }
173
- ),
174
- de(e) && // biome-ignore lint/a11y/useSemanticElements: nested inside the row's <button> — a real <button> is invalid there
175
- /* @__PURE__ */ o(
176
- "span",
177
- {
178
- role: "button",
179
- tabIndex: -1,
180
- "data-notification-as-it-was": e.id,
181
- "data-tip": "The record as it was when you were told",
182
- onClick: (r) => {
183
- r.stopPropagation(), m(!1), T(e);
184
- },
185
- onKeyDown: (r) => {
186
- (r.key === "Enter" || r.key === " ") && (r.preventDefault(), r.stopPropagation(), m(!1), T(e));
187
- },
188
- className: "inline-flex items-center gap-0.5 rounded px-1 text-[10.5px] text-slate-400 transition-colors hover:bg-slate-100 hover:text-slate-700 dark:hover:bg-muted dark:hover:text-slate-200",
189
- children: [
190
- /* @__PURE__ */ a(Ee, { className: "h-3 w-3" }),
191
- "as it was"
192
- ]
193
- }
194
- )
195
- ] })
196
- ] }),
197
- !t && !e.read && // biome-ignore lint/a11y/useSemanticElements: nested inside the row's <button> — a real <button> is invalid there
198
- /* @__PURE__ */ a(
199
+ b,
200
+ !a && !e.read && // biome-ignore lint/a11y/useSemanticElements: nested inside the row's <button> — a real <button> is invalid there
201
+ /* @__PURE__ */ t(
199
202
  "span",
200
203
  {
201
204
  role: "button",
202
205
  tabIndex: -1,
203
- title: "Mark read",
204
- onClick: (r) => {
205
- r.stopPropagation(), K.mutate(e.id);
206
+ "aria-label": "Mark read",
207
+ "data-tip": "Mark read",
208
+ onClick: (c) => {
209
+ c.stopPropagation(), E.mutate(e.id);
206
210
  },
207
- onKeyDown: (r) => {
208
- (r.key === "Enter" || r.key === " ") && (r.preventDefault(), r.stopPropagation(), K.mutate(e.id));
211
+ onKeyDown: (c) => {
212
+ (c.key === "Enter" || c.key === " ") && (c.preventDefault(), c.stopPropagation(), E.mutate(e.id));
209
213
  },
210
- className: "mt-0.5 rounded p-1 text-slate-400 hover:bg-slate-100 hover:text-slate-700 dark:hover:bg-muted dark:hover:text-slate-200",
211
- children: /* @__PURE__ */ a(z, { className: "h-3 w-3" })
214
+ className: l,
215
+ children: /* @__PURE__ */ t(A, { className: "h-3 w-3" })
216
+ }
217
+ )
218
+ ]
219
+ }
220
+ ) : /* @__PURE__ */ r(
221
+ "div",
222
+ {
223
+ className: `flex w-full items-start gap-2.5 text-left ${s}`,
224
+ "data-notification-row": e.id,
225
+ "data-notification-plain": !0,
226
+ children: [
227
+ b,
228
+ /* @__PURE__ */ t(
229
+ "button",
230
+ {
231
+ type: "button",
232
+ "aria-label": "Mark read",
233
+ "data-tip": "Mark read",
234
+ tabIndex: e.read ? -1 : void 0,
235
+ onClick: () => E.mutate(e.id),
236
+ className: Be(l, "shrink-0", e.read && "invisible"),
237
+ children: /* @__PURE__ */ t(A, { className: "h-3 w-3" })
212
238
  }
213
239
  )
214
240
  ]
215
241
  }
216
242
  ),
217
- ((s = e.ack) == null ? void 0 : s.required) && !e.ack.at && /* @__PURE__ */ a("div", { className: `pb-2 pr-3 ${l ? "pl-[46px]" : "pl-[30px]"}`, children: /* @__PURE__ */ o(
243
+ ((v = e.ack) == null ? void 0 : v.required) && !e.ack.at && /* @__PURE__ */ t("div", { className: `pb-2 pr-3 ${o ? "pl-[46px]" : "pl-[30px]"}`, children: /* @__PURE__ */ r(
218
244
  "button",
219
245
  {
220
246
  type: "button",
221
- disabled: X.isPending,
222
- onClick: () => X.mutate(e.id),
247
+ disabled: Z.isPending,
248
+ onClick: () => Z.mutate(e.id),
223
249
  "data-notification-acknowledge": e.id,
224
250
  className: "inline-flex items-center gap-1 rounded-md bg-nvr-cyan px-2 py-1 text-[11px] font-medium text-white hover:opacity-90 disabled:opacity-50",
225
251
  children: [
226
- /* @__PURE__ */ a(Ae, { className: "h-3 w-3" }),
252
+ /* @__PURE__ */ t(Fe, { className: "h-3 w-3" }),
227
253
  "Acknowledge"
228
254
  ]
229
255
  }
230
256
  ) }),
231
- e.actions && e.actions.length > 0 && !e.read && /* @__PURE__ */ a(
232
- He,
257
+ e.actions && e.actions.length > 0 && !e.read && /* @__PURE__ */ t(
258
+ Ye,
233
259
  {
234
260
  actions: e.actions,
235
261
  notificationId: e.id,
236
- onError: pe,
237
- className: `pb-2 pr-3 ${l ? "pl-[46px]" : "pl-[30px]"}`
262
+ onError: fe,
263
+ className: `pb-2 pr-3 ${o ? "pl-[46px]" : "pl-[30px]"}`
238
264
  }
239
265
  ),
240
- /* @__PURE__ */ a(
241
- Ge,
266
+ /* @__PURE__ */ t(
267
+ Ve,
242
268
  {
243
269
  detail: e.detail,
244
270
  why: e.why,
245
271
  delivery: e.delivery,
246
272
  notificationId: e.id,
247
- recordChanges: Ye(e),
248
- subscriptionsPath: ue,
273
+ recordChanges: Je(e),
274
+ subscriptionsPath: pe,
249
275
  rulesPath: me,
250
- onNavigate: te,
251
- className: `pb-3 pr-3 ${l ? "pl-[46px]" : "pl-[30px]"}`
276
+ onNavigate: ae,
277
+ className: `pb-3 pr-3 ${o ? "pl-[46px]" : "pl-[30px]"}`
252
278
  }
253
279
  )
254
280
  ] }, e.id);
255
- }, we = (e) => {
256
- const t = `${e.collection}:${e.item}`, l = be.has(t), s = je(e.lane), r = e.deleted ? null : A(ze(e), n), C = e.rows.filter((i) => !i.read).map((i) => i.id);
257
- return /* @__PURE__ */ o(
281
+ }, ve = (e) => {
282
+ const a = `${e.collection}:${e.item}`, o = ke.has(a), i = Pe(e.lane), s = e.deleted ? null : S(Qe(e), n), b = e.rows.filter((l) => !l.read).map((l) => l.id);
283
+ return /* @__PURE__ */ r(
258
284
  "div",
259
285
  {
260
286
  className: "border-b border-slate-50 last:border-b-0 dark:border-border/50",
261
287
  "data-notification-bundle-deleted": e.deleted ? "true" : void 0,
262
- "data-notification-bundle": t,
288
+ "data-notification-bundle": a,
263
289
  "data-notification-bundle-count": e.count,
264
290
  "data-notification-bundle-lane": e.lane,
265
291
  children: [
266
- /* @__PURE__ */ o("div", { className: "flex items-start gap-2 px-3 py-2", children: [
267
- /* @__PURE__ */ a(
292
+ /* @__PURE__ */ r("div", { className: "flex items-start gap-2 px-3 py-2", children: [
293
+ /* @__PURE__ */ t(
268
294
  "button",
269
295
  {
270
296
  type: "button",
271
- "aria-expanded": l,
272
- "aria-label": l ? "Collapse" : "Expand",
273
- "data-notification-bundle-expand": t,
274
- onClick: () => J((i) => {
275
- const q = new Set(i);
276
- return q.has(t) ? q.delete(t) : q.add(t), q;
297
+ "aria-expanded": o,
298
+ "aria-label": o ? "Collapse" : "Expand",
299
+ "data-notification-bundle-expand": a,
300
+ onClick: () => X((l) => {
301
+ const v = new Set(l);
302
+ return v.has(a) ? v.delete(a) : v.add(a), v;
277
303
  }),
278
304
  className: "mt-0.5 rounded p-0.5 text-slate-400 hover:bg-slate-100 hover:text-slate-700 dark:hover:bg-muted dark:hover:text-slate-200",
279
- children: /* @__PURE__ */ a(
280
- Le,
305
+ children: /* @__PURE__ */ t(
306
+ Ae,
281
307
  {
282
- className: `h-3.5 w-3.5 transition-transform ${l ? "" : "-rotate-90"}`
308
+ className: `h-3.5 w-3.5 transition-transform ${o ? "" : "-rotate-90"}`
283
309
  }
284
310
  )
285
311
  }
286
312
  ),
287
- /* @__PURE__ */ o(
313
+ /* @__PURE__ */ r(
288
314
  "button",
289
315
  {
290
316
  type: "button",
291
317
  onClick: () => {
292
- r ? (m(!1), L(r, d)) : J((i) => new Set(i).add(t));
318
+ s ? (m(!1), L(s, d)) : X((l) => new Set(l).add(a));
293
319
  },
294
320
  className: "min-w-0 flex-1 text-left",
295
321
  children: [
296
- /* @__PURE__ */ o("span", { className: "flex items-center gap-1.5", children: [
297
- /* @__PURE__ */ a(
322
+ /* @__PURE__ */ r("span", { className: "flex items-center gap-1.5", children: [
323
+ /* @__PURE__ */ t(
298
324
  "span",
299
325
  {
300
- className: `h-2 w-2 shrink-0 rounded-full ${e.unread > 0 ? s.dot : "bg-transparent"}`
326
+ className: `h-2 w-2 shrink-0 rounded-full ${e.unread > 0 ? i.dot : "bg-transparent"}`
301
327
  }
302
328
  ),
303
- /* @__PURE__ */ a(
329
+ /* @__PURE__ */ t(
304
330
  "span",
305
331
  {
306
- className: `truncate text-[12.5px] ${e.unread > 0 ? `font-medium ${s.text}` : "font-normal text-slate-600 dark:text-slate-400"}`,
307
- children: Oe(e)
332
+ className: `truncate text-[12.5px] ${e.unread > 0 ? `font-medium ${i.text}` : "font-normal text-slate-600 dark:text-slate-400"}`,
333
+ children: He(e)
308
334
  }
309
335
  )
310
336
  ] }),
311
- /* @__PURE__ */ o("span", { className: "mt-1 flex flex-wrap items-center gap-1 pl-3.5 text-[10.5px] text-slate-400", children: [
312
- e.lane === "critical" && e.unread > 0 && /* @__PURE__ */ a(
337
+ /* @__PURE__ */ r("span", { className: "mt-1 flex flex-wrap items-center gap-1 pl-3.5 text-[10.5px] text-slate-400", children: [
338
+ e.lane === "critical" && e.unread > 0 && /* @__PURE__ */ t(
313
339
  "span",
314
340
  {
315
- className: `rounded px-1 text-[9.5px] font-bold uppercase tracking-wide ${s.chip}`,
341
+ className: `rounded px-1 text-[9.5px] font-bold uppercase tracking-wide ${i.chip}`,
316
342
  children: "Critical"
317
343
  }
318
344
  ),
319
- e.collection_label && /* @__PURE__ */ a(
345
+ e.collection_label && /* @__PURE__ */ t(
320
346
  "span",
321
347
  {
322
348
  className: "rounded border border-slate-200 px-1 py-px text-[9.5px] font-medium text-slate-500 dark:border-border dark:text-slate-400",
@@ -324,25 +350,26 @@ function mt({
324
350
  children: e.collection_label
325
351
  }
326
352
  ),
327
- e.deleted && /* @__PURE__ */ a(
353
+ e.deleted && /* @__PURE__ */ t(
328
354
  "span",
329
355
  {
330
356
  className: "rounded bg-rose-50 px-1 py-px text-[9.5px] font-semibold text-rose-700 dark:bg-rose-900/30 dark:text-rose-300",
331
- title: "This record has since been deleted",
357
+ "data-notification-bundle-gone": !0,
358
+ "data-tip": "This record has since been deleted",
332
359
  children: "deleted"
333
360
  }
334
361
  ),
335
- e.categories.map((i) => /* @__PURE__ */ a(
362
+ e.categories.map((l) => /* @__PURE__ */ t(
336
363
  "span",
337
364
  {
338
365
  className: "rounded bg-slate-100 px-1 py-px text-[9.5px] font-medium text-slate-600 dark:bg-muted dark:text-slate-300",
339
- "data-notification-bundle-category": i,
340
- children: Pe(i)
366
+ "data-notification-bundle-category": l,
367
+ children: Ge(l)
341
368
  },
342
- i
369
+ l
343
370
  )),
344
- /* @__PURE__ */ a("span", { children: e.newest ? se(e.newest) : "" }),
345
- e.unread > 0 && e.unread < e.count && /* @__PURE__ */ o("span", { children: [
371
+ /* @__PURE__ */ t("span", { children: e.newest ? de(e.newest) : "" }),
372
+ e.unread > 0 && e.unread < e.count && /* @__PURE__ */ r("span", { children: [
346
373
  "· ",
347
374
  e.unread,
348
375
  " unread"
@@ -351,94 +378,97 @@ function mt({
351
378
  ]
352
379
  }
353
380
  ),
354
- /* @__PURE__ */ o("span", { className: "flex shrink-0 items-center gap-0.5", children: [
355
- r && /* @__PURE__ */ a(
381
+ /* @__PURE__ */ r("span", { className: "flex shrink-0 items-center gap-0.5", children: [
382
+ s && /* @__PURE__ */ t(
356
383
  "button",
357
384
  {
358
385
  type: "button",
359
- title: "Open record",
386
+ "aria-label": "Open record",
387
+ "data-tip": "Open record",
388
+ "data-notification-open-record": !0,
360
389
  onClick: () => {
361
- m(!1), L(r, d);
390
+ m(!1), L(s, d);
362
391
  },
363
392
  className: "rounded p-1 text-slate-400 hover:bg-slate-100 hover:text-slate-700 dark:hover:bg-muted dark:hover:text-slate-200",
364
- children: /* @__PURE__ */ a(re, { className: "h-3 w-3" })
393
+ children: /* @__PURE__ */ t(oe, { className: "h-3 w-3" })
365
394
  }
366
395
  ),
367
- C.length > 0 && /* @__PURE__ */ a(
396
+ b.length > 0 && /* @__PURE__ */ t(
368
397
  "button",
369
398
  {
370
399
  type: "button",
371
- title: "Mark all read",
372
- "data-notification-bundle-read": t,
373
- onClick: () => B.mutate(C),
400
+ "aria-label": "Mark read",
401
+ "data-tip": "Mark read",
402
+ "data-notification-bundle-read": a,
403
+ onClick: () => j.mutate(b),
374
404
  className: "rounded p-1 text-slate-400 hover:bg-slate-100 hover:text-slate-700 dark:hover:bg-muted dark:hover:text-slate-200",
375
- children: /* @__PURE__ */ a(z, { className: "h-3 w-3" })
405
+ children: /* @__PURE__ */ t(A, { className: "h-3 w-3" })
376
406
  }
377
407
  )
378
408
  ] })
379
409
  ] }),
380
- l && /* @__PURE__ */ a(
410
+ o && /* @__PURE__ */ t(
381
411
  "div",
382
412
  {
383
413
  className: "border-t border-slate-50 bg-slate-50/50 dark:border-border/50 dark:bg-muted/30",
384
- "data-notification-bundle-rows": t,
385
- children: e.rows.map((i) => j(i, !0, !0))
414
+ "data-notification-bundle-rows": a,
415
+ children: e.rows.map((l) => z(l, !0, !0))
386
416
  }
387
417
  )
388
418
  ]
389
419
  },
390
- `bundle:${t}`
420
+ `bundle:${a}`
391
421
  );
392
- }, ve = [
393
- { key: "attention", label: "Needs you", count: I },
394
- { key: "fyi", label: "FYI", count: S.fyi },
422
+ }, ye = [
423
+ { key: "attention", label: "Needs you", count: K },
424
+ { key: "fyi", label: "FYI", count: R.fyi },
395
425
  { key: "all", label: "All", count: null }
396
- ], ae = () => m((e) => (!e && g === "attention" && I === 0 && S.fyi > 0 && G("fyi"), !e));
397
- return /* @__PURE__ */ o("div", { ref: R, className: "relative", "data-nvr-notification-bell": !0, children: [
398
- Q ? Q({ open: b, badge: w, toggle: ae }) : /* @__PURE__ */ o(
426
+ ], ne = () => m((e) => (!e && w === "attention" && K === 0 && R.fyi > 0 && U("fyi"), !e));
427
+ return /* @__PURE__ */ r("div", { ref: I, className: "relative", "data-nvr-notification-bell": !0, children: [
428
+ H ? H({ open: g, badge: N, toggle: ne }) : /* @__PURE__ */ r(
399
429
  "button",
400
430
  {
401
431
  type: "button",
402
- onClick: ae,
403
- className: h ?? "relative rounded-md p-1.5 text-slate-500 transition-colors hover:bg-slate-100 dark:text-slate-400 dark:hover:bg-muted",
404
- "aria-label": w ? `Notifications (${w} unread)` : "Notifications",
432
+ onClick: ne,
433
+ className: k ?? "relative rounded-md p-1.5 text-slate-500 transition-colors hover:bg-slate-100 dark:text-slate-400 dark:hover:bg-muted",
434
+ "aria-label": N ? `Notifications (${N} unread)` : "Notifications",
405
435
  children: [
406
- /* @__PURE__ */ a(Se, { className: "h-4 w-4", strokeWidth: 1.8 }),
407
- w > 0 && /* @__PURE__ */ a(
436
+ /* @__PURE__ */ t(qe, { className: "h-4 w-4", strokeWidth: 1.8 }),
437
+ N > 0 && /* @__PURE__ */ t(
408
438
  "span",
409
439
  {
410
440
  "data-nvr-recording-hide": !0,
411
- className: `absolute -right-0.5 -top-0.5 flex h-4 min-w-4 items-center justify-center rounded-full px-1 text-[9.5px] font-bold ${S.critical > 0 ? "bg-red-500 text-white" : "bg-nvr-cyan text-nvr-navy"}`,
412
- children: w > 99 ? "99+" : w
441
+ className: `absolute -right-0.5 -top-0.5 flex h-4 min-w-4 items-center justify-center rounded-full px-1 text-[9.5px] font-bold ${R.critical > 0 ? "bg-red-500 text-white" : "bg-nvr-cyan text-nvr-navy"}`,
442
+ children: N > 99 ? "99+" : N
413
443
  }
414
444
  )
415
445
  ]
416
446
  }
417
447
  ),
418
- b && (y === "right" ? Re : (e) => e)(
419
- /* @__PURE__ */ o(
448
+ g && ($ === "right" ? Le : (e) => e)(
449
+ /* @__PURE__ */ r(
420
450
  "div",
421
451
  {
422
- ref: U,
423
- className: `${y === "right" ? "fixed z-[110]" : "absolute right-0 top-10 z-40"} w-[360px] overflow-hidden rounded-xl border border-slate-200 bg-white shadow-xl dark:border-border dark:bg-card ${f ?? ""}`,
424
- style: y === "right" && F ? { left: F.left, bottom: F.bottom } : void 0,
452
+ ref: Y,
453
+ className: `${$ === "right" ? "fixed z-[110]" : "absolute right-0 top-10 z-40"} w-[360px] overflow-hidden rounded-xl border border-slate-200 bg-white shadow-xl dark:border-border dark:bg-card ${h ?? ""}`,
454
+ style: $ === "right" && D ? { left: D.left, bottom: D.bottom } : void 0,
425
455
  "data-nvr-notification-panel": !0,
426
456
  children: [
427
- _,
428
- /* @__PURE__ */ o("div", { className: "flex items-center justify-between border-b border-slate-100 px-3 py-2 dark:border-border/60", children: [
429
- /* @__PURE__ */ a("div", { className: "flex items-center gap-1 rounded-md bg-slate-100 p-0.5 dark:bg-muted", children: ve.map((e) => /* @__PURE__ */ o(
457
+ q,
458
+ /* @__PURE__ */ r("div", { className: "flex items-center justify-between border-b border-slate-100 px-3 py-2 dark:border-border/60", children: [
459
+ /* @__PURE__ */ t("div", { className: "flex items-center gap-1 rounded-md bg-slate-100 p-0.5 dark:bg-muted", children: ye.map((e) => /* @__PURE__ */ r(
430
460
  "button",
431
461
  {
432
462
  type: "button",
433
- onClick: () => G(e.key),
463
+ onClick: () => U(e.key),
434
464
  "data-nvr-lane-tab": e.key,
435
- className: g === e.key ? "rounded bg-white px-2 py-0.5 text-[11px] font-medium text-slate-900 shadow-sm dark:bg-card dark:text-slate-100" : "rounded px-2 py-0.5 text-[11px] font-medium text-slate-500 hover:text-slate-700 dark:text-slate-400",
465
+ className: w === e.key ? "rounded bg-white px-2 py-0.5 text-[11px] font-medium text-slate-900 shadow-sm dark:bg-card dark:text-slate-100" : "rounded px-2 py-0.5 text-[11px] font-medium text-slate-500 hover:text-slate-700 dark:text-slate-400",
436
466
  children: [
437
467
  e.label,
438
- e.count != null && e.count > 0 && /* @__PURE__ */ a(
468
+ e.count != null && e.count > 0 && /* @__PURE__ */ t(
439
469
  "span",
440
470
  {
441
- className: `ml-1 rounded-full px-1 text-[9.5px] font-bold ${e.key === "attention" && S.critical > 0 ? "bg-red-500/15 text-red-600 dark:text-red-400" : "bg-slate-200 text-slate-600 dark:bg-slate-700 dark:text-slate-300"}`,
471
+ className: `ml-1 rounded-full px-1 text-[9.5px] font-bold ${e.key === "attention" && R.critical > 0 ? "bg-red-500/15 text-red-600 dark:text-red-400" : "bg-slate-200 text-slate-600 dark:bg-slate-700 dark:text-slate-300"}`,
442
472
  children: e.count
443
473
  }
444
474
  )
@@ -446,64 +476,67 @@ function mt({
446
476
  },
447
477
  e.key
448
478
  )) }),
449
- M > 0 && /* @__PURE__ */ o(
479
+ T > 0 && /* @__PURE__ */ r(
450
480
  "button",
451
481
  {
452
482
  type: "button",
453
483
  onClick: () => ge.mutate(),
454
484
  className: "inline-flex items-center gap-1 text-[11px] font-medium text-slate-400 transition-colors hover:text-nvr-cyan",
455
485
  children: [
456
- /* @__PURE__ */ a(qe, { className: "h-3.5 w-3.5", strokeWidth: 2 }),
486
+ /* @__PURE__ */ t(Re, { className: "h-3.5 w-3.5", strokeWidth: 2 }),
457
487
  "Mark all read"
458
488
  ]
459
489
  }
460
490
  )
461
491
  ] }),
462
- /* @__PURE__ */ o("div", { className: "max-h-96 overflow-y-auto", children: [
463
- D.length > 0 && /* @__PURE__ */ o("div", { "data-notification-pinned": !0, children: [
464
- /* @__PURE__ */ a("div", { className: "bg-amber-50 px-3 py-1 text-[10px] font-semibold uppercase tracking-wide text-amber-700 dark:bg-amber-400/10 dark:text-amber-300", children: "Needs your acknowledgement" }),
465
- D.map((e) => /* @__PURE__ */ a(ie, { children: j(e, !!A(e, n)) }, e.id))
492
+ /* @__PURE__ */ r("div", { className: "max-h-96 overflow-y-auto", children: [
493
+ O.length > 0 && /* @__PURE__ */ r("div", { "data-notification-pinned": !0, children: [
494
+ /* @__PURE__ */ t("div", { className: "bg-amber-50 px-3 py-1 text-[10px] font-semibold uppercase tracking-wide text-amber-700 dark:bg-amber-400/10 dark:text-amber-300", children: "Needs your acknowledgement" }),
495
+ O.map((e) => /* @__PURE__ */ t(se, { children: z(e, !!S(e, n)) }, e.id))
466
496
  ] }),
467
- ee.length === 0 && W.length === 0 && D.length === 0 ? /* @__PURE__ */ a("p", { className: "px-3 py-6 text-center text-[12px] text-slate-400", children: g === "attention" ? "Nothing needs you right now." : g === "fyi" ? "No FYI notifications." : "No notifications" }) : [
468
- ...W.map(we),
469
- ...ee.map((e) => {
470
- const t = e.rows.filter((i) => !i.read).map((i) => i.id), l = A(e.rows[0], n), s = !!l, r = e.rows.find((i) => i.record_label) ?? e.rows[0], C = Ue(r);
471
- return /* @__PURE__ */ o(
497
+ te.length === 0 && J.length === 0 && O.length === 0 ? /* @__PURE__ */ t("p", { className: "px-3 py-6 text-center text-[12px] text-slate-400", children: w === "attention" ? "Nothing needs you right now." : w === "fyi" ? "No FYI notifications." : "No notifications" }) : [
498
+ ...J.map(ve),
499
+ ...te.map((e) => {
500
+ const a = e.rows.filter((l) => !l.read).map((l) => l.id), o = S(e.rows[0], n), i = !!o, s = e.rows.find((l) => l.record_label) ?? e.rows[0], b = We(s);
501
+ return /* @__PURE__ */ r(
472
502
  "div",
473
503
  {
474
504
  className: "border-b border-slate-50 last:border-b-0 dark:border-border/50",
475
505
  children: [
476
- s && C && /* @__PURE__ */ o("div", { className: "flex items-center gap-1.5 px-3 pt-2", children: [
477
- /* @__PURE__ */ o("span", { className: "truncate text-[10.5px] font-semibold uppercase tracking-wide text-slate-400", children: [
478
- C,
506
+ i && b && /* @__PURE__ */ r("div", { className: "flex items-center gap-1.5 px-3 pt-2", children: [
507
+ /* @__PURE__ */ r("span", { className: "truncate text-[10.5px] font-semibold uppercase tracking-wide text-slate-400", children: [
508
+ b,
479
509
  e.rows.length > 1 ? ` · ${e.rows.length}` : ""
480
510
  ] }),
481
- /* @__PURE__ */ o("span", { className: "ml-auto flex items-center gap-0.5", children: [
482
- /* @__PURE__ */ a(
511
+ /* @__PURE__ */ r("span", { className: "ml-auto flex items-center gap-0.5", children: [
512
+ /* @__PURE__ */ t(
483
513
  "button",
484
514
  {
485
515
  type: "button",
486
- title: "Open record",
516
+ "aria-label": "Open record",
517
+ "data-tip": "Open record",
518
+ "data-notification-open-record": !0,
487
519
  onClick: () => {
488
- t.length && B.mutate(t), m(!1), L(l, d);
520
+ a.length && j.mutate(a), m(!1), L(o, d);
489
521
  },
490
522
  className: "rounded p-1 text-slate-400 hover:bg-slate-100 hover:text-slate-700 dark:hover:bg-muted dark:hover:text-slate-200",
491
- children: /* @__PURE__ */ a(re, { className: "h-3 w-3" })
523
+ children: /* @__PURE__ */ t(oe, { className: "h-3 w-3" })
492
524
  }
493
525
  ),
494
- t.length > 0 && /* @__PURE__ */ a(
526
+ a.length > 0 && /* @__PURE__ */ t(
495
527
  "button",
496
528
  {
497
529
  type: "button",
498
- title: "Mark read",
499
- onClick: () => B.mutate(t),
530
+ "aria-label": "Mark read",
531
+ "data-tip": "Mark read",
532
+ onClick: () => j.mutate(a),
500
533
  className: "rounded p-1 text-slate-400 hover:bg-slate-100 hover:text-slate-700 dark:hover:bg-muted dark:hover:text-slate-200",
501
- children: /* @__PURE__ */ a(z, { className: "h-3 w-3" })
534
+ children: /* @__PURE__ */ t(A, { className: "h-3 w-3" })
502
535
  }
503
536
  )
504
537
  ] })
505
538
  ] }),
506
- e.rows.map((i) => j(i, s))
539
+ e.rows.map((l) => z(l, i))
507
540
  ]
508
541
  },
509
542
  e.key
@@ -511,12 +544,12 @@ function mt({
511
544
  })
512
545
  ]
513
546
  ] }),
514
- H && /* @__PURE__ */ a(
547
+ G && /* @__PURE__ */ t(
515
548
  "button",
516
549
  {
517
550
  type: "button",
518
551
  onClick: () => {
519
- m(!1), d(H);
552
+ m(!1), d(G);
520
553
  },
521
554
  className: "block w-full border-t border-slate-100 px-3 py-1.5 text-center text-[11px] font-medium text-slate-500 hover:text-nvr-cyan dark:border-border/60",
522
555
  children: "See all notifications"
@@ -527,19 +560,19 @@ function mt({
527
560
  ),
528
561
  document.body
529
562
  ),
530
- /* @__PURE__ */ a(
531
- Ke,
563
+ /* @__PURE__ */ t(
564
+ je,
532
565
  {
533
- notificationId: (v == null ? void 0 : v.id) ?? null,
534
- title: (v == null ? void 0 : v.title) ?? null,
535
- onClose: () => T(null)
566
+ notificationId: (C == null ? void 0 : C.id) ?? null,
567
+ title: (C == null ? void 0 : C.title) ?? null,
568
+ onClose: () => B(null)
536
569
  }
537
570
  )
538
571
  ] });
539
572
  }
540
573
  export {
541
- mt as NotificationBell,
542
- Ue as bellGroupLabel,
543
- de as hasSnapshotView,
544
- Ye as offersChanges
574
+ xt as NotificationBell,
575
+ We as bellGroupLabel,
576
+ ce as hasSnapshotView,
577
+ Je as offersChanges
545
578
  };