@nivaro/react 0.3.117 → 0.3.118

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 (137) hide show
  1. package/dist/full.css +1 -1
  2. package/dist/hooks/useSessionRecorder.js +1 -1
  3. package/dist/index.d.ts +136 -14
  4. package/dist/index.js +488 -485
  5. package/dist/shared/components/ActivityEntry.js +130 -125
  6. package/dist/shared/components/AgentPresenceChip.js +36 -26
  7. package/dist/shared/components/CellCopyLayer.js +50 -45
  8. package/dist/shared/components/CollectionBrowserView.js +3757 -3695
  9. package/dist/shared/components/FilePreviewLightbox.js +96 -58
  10. package/dist/shared/components/InStep.js +18 -17
  11. package/dist/shared/components/ItemEditForm.js +4220 -4175
  12. package/dist/shared/components/JobsTray.js +8 -8
  13. package/dist/shared/components/LiveNewMatchesPill.js +21 -14
  14. package/dist/shared/components/LiveOffNote.js +3 -2
  15. package/dist/shared/components/LiveRowMark.js +53 -23
  16. package/dist/shared/components/LiveTraceView.js +162 -123
  17. package/dist/shared/components/MyWorkView.js +320 -299
  18. package/dist/shared/components/NotificationBell.js +14 -14
  19. package/dist/shared/components/OverflowRail.js +1 -1
  20. package/dist/shared/components/PageRenderer.js +120 -116
  21. package/dist/shared/components/ProfileView.js +203 -202
  22. package/dist/shared/components/RealtimeStatusBanner.js +31 -29
  23. package/dist/shared/components/RecordDrilldownSheet.js +7 -7
  24. package/dist/shared/components/RecordHoverCard.js +102 -84
  25. package/dist/shared/components/RecordReadView.js +146 -146
  26. package/dist/shared/components/ScreenRefreshButton.js +34 -32
  27. package/dist/shared/components/TipLayer.js +65 -58
  28. package/dist/shared/components/WidgetImageMenu.js +83 -43
  29. package/dist/shared/components/activity/RecordActivityStream.js +175 -173
  30. package/dist/shared/components/bulk/BulkSelectionNotices.js +142 -119
  31. package/dist/shared/components/change-proposals/ChangeProposalsPanel.js +158 -143
  32. package/dist/shared/components/change-proposals/ProposeChangeButton.js +17 -11
  33. package/dist/shared/components/change-proposals/ProposeChangeDialog.js +201 -173
  34. package/dist/shared/components/chat/ChatAnalyticsView.js +27 -27
  35. package/dist/shared/components/chat/HuddleAnalyticsTab.js +17 -17
  36. package/dist/shared/components/collections-directory/CollectionsToolbar.js +39 -41
  37. package/dist/shared/components/collections-directory/page-model.js +72 -67
  38. package/dist/shared/components/integrations/RecordIntegrationPreview.js +48 -56
  39. package/dist/shared/components/integrations/SendStatus.js +65 -59
  40. package/dist/shared/components/integrations/console/ReadyToSendView.js +275 -209
  41. package/dist/shared/components/integrations/console/SignalCard.js +237 -230
  42. package/dist/shared/components/item-edit/CatalogPickerField.js +227 -205
  43. package/dist/shared/components/item-edit/ChangedAfterApprovalBadge.js +131 -92
  44. package/dist/shared/components/item-edit/CloneDialog.js +191 -161
  45. package/dist/shared/components/item-edit/DerivedCauseNote.js +44 -30
  46. package/dist/shared/components/item-edit/DraftRecoveryBanner.js +153 -134
  47. package/dist/shared/components/item-edit/FieldComments.js +54 -53
  48. package/dist/shared/components/item-edit/FieldPointer.js +82 -67
  49. package/dist/shared/components/item-edit/FieldRow.js +106 -100
  50. package/dist/shared/components/item-edit/FieldSourceBadge.js +58 -56
  51. package/dist/shared/components/item-edit/FilePickerField.js +452 -387
  52. package/dist/shared/components/item-edit/HeaderSummaryChip.js +78 -56
  53. package/dist/shared/components/item-edit/HeaderTools.js +94 -85
  54. package/dist/shared/components/item-edit/InlineTableField.js +1242 -1218
  55. package/dist/shared/components/item-edit/ListNeighborNav.js +47 -50
  56. package/dist/shared/components/item-edit/LiveTraceSheet.js +15 -10
  57. package/dist/shared/components/item-edit/MembershipSetField.js +285 -254
  58. package/dist/shared/components/item-edit/OutboxReviewTray.js +155 -144
  59. package/dist/shared/components/item-edit/QueueReturnChip.js +15 -36
  60. package/dist/shared/components/item-edit/RecalcValue.js +57 -32
  61. package/dist/shared/components/item-edit/RecordHelpChip.js +21 -22
  62. package/dist/shared/components/item-edit/RecordLiveSync.js +283 -231
  63. package/dist/shared/components/item-edit/RelationCombobox.js +439 -393
  64. package/dist/shared/components/item-edit/RemoteChangeUi.js +292 -224
  65. package/dist/shared/components/item-edit/RemoteUploads.js +26 -20
  66. package/dist/shared/components/item-edit/RemovedLineNote.js +77 -67
  67. package/dist/shared/components/item-edit/RichTextEditorImpl.js +184 -179
  68. package/dist/shared/components/item-edit/ScheduledChangeChip.js +168 -134
  69. package/dist/shared/components/item-edit/SectionPresence.js +18 -10
  70. package/dist/shared/components/item-edit/SplitLinesButton.js +163 -139
  71. package/dist/shared/components/item-edit/UserChip.js +1 -1
  72. package/dist/shared/components/item-edit/file-live.js +69 -54
  73. package/dist/shared/components/item-edit/layout-switch.js +98 -89
  74. package/dist/shared/components/item-edit/partner-needs.js +12 -12
  75. package/dist/shared/components/item-edit/removed-line.js +31 -25
  76. package/dist/shared/components/layout-editor/pickers/field-picker.js +112 -104
  77. package/dist/shared/components/list/ListViewers.js +46 -35
  78. package/dist/shared/components/notifications/NotificationCenterView.js +479 -437
  79. package/dist/shared/components/panels/AccessDeniedPanel.js +176 -101
  80. package/dist/shared/components/panels/AlertBanners.js +82 -72
  81. package/dist/shared/components/panels/BranchLanes.js +22 -22
  82. package/dist/shared/components/panels/CommentImages.js +123 -102
  83. package/dist/shared/components/panels/CommentPanel.js +186 -185
  84. package/dist/shared/components/panels/ExternalRequestsChip.js +111 -119
  85. package/dist/shared/components/panels/OwnerOpenedLine.js +31 -24
  86. package/dist/shared/components/panels/PipelinePanel.js +2037 -1885
  87. package/dist/shared/components/panels/ResubmissionDiff.js +163 -142
  88. package/dist/shared/components/pipeline/OwnerMatrixSheet.js +400 -288
  89. package/dist/shared/components/pipeline/PipelineEditorView.js +7 -2
  90. package/dist/shared/components/profile/AgentNameField.js +107 -81
  91. package/dist/shared/components/profile/AgentsPanel.js +184 -184
  92. package/dist/shared/components/profile/PersonAccess.js +599 -495
  93. package/dist/shared/components/profile/SignInTroubleshooter.js +160 -127
  94. package/dist/shared/components/profile/SignedInDevices.js +17 -17
  95. package/dist/shared/components/profile/primitives.js +1 -1
  96. package/dist/shared/components/queue/OwnerAvatars.js +91 -54
  97. package/dist/shared/components/queue/QueueTeamStrip.js +56 -46
  98. package/dist/shared/components/queue/QueueWorklist.js +1002 -983
  99. package/dist/shared/components/support/AssignRules.js +1733 -0
  100. package/dist/shared/components/support/PersonPick.js +88 -0
  101. package/dist/shared/components/support/RequestList.js +790 -0
  102. package/dist/shared/components/support/ScreenShare.js +158 -152
  103. package/dist/shared/components/support/SupportRequestDialog.js +50 -48
  104. package/dist/shared/components/support/SupportView.js +140 -246
  105. package/dist/shared/components/support/TicketDetailSheet.js +82 -75
  106. package/dist/shared/components/support/TicketSlowScreens.js +9 -9
  107. package/dist/shared/components/support/assign-rules-text.js +171 -0
  108. package/dist/shared/components/support/support-list.js +125 -0
  109. package/dist/shared/components/ui/SimpleSelect.js +28 -20
  110. package/dist/shared/components/ui/checkbox.js +6 -6
  111. package/dist/shared/components/ui/select.js +43 -39
  112. package/dist/shared/components/ui/sheet.js +9 -9
  113. package/dist/shared/components/ui/switch.js +12 -11
  114. package/dist/shared/components/watch-list/WatchDock.js +532 -459
  115. package/dist/shared/components/watch-list/WatchExtras.js +332 -286
  116. package/dist/shared/components/watch-list/WatchRows.js +164 -140
  117. package/dist/shared/lib/activity-sentence.js +103 -91
  118. package/dist/shared/lib/agent-presence.js +27 -21
  119. package/dist/shared/lib/approval-progress.js +2 -2
  120. package/dist/shared/lib/copy-rules.js +31 -24
  121. package/dist/shared/lib/derived-causes.js +113 -78
  122. package/dist/shared/lib/grid-cursors.js +26 -26
  123. package/dist/shared/lib/label-flash.js +27 -0
  124. package/dist/shared/lib/list-return.js +137 -125
  125. package/dist/shared/lib/live-deltas.js +40 -34
  126. package/dist/shared/lib/live-groups.js +56 -52
  127. package/dist/shared/lib/live-preference.js +64 -59
  128. package/dist/shared/lib/live-screen.js +223 -192
  129. package/dist/shared/lib/partner-failure.js +11 -11
  130. package/dist/shared/lib/rollup-recalc.js +68 -64
  131. package/dist/shared/lib/screen-refresh.js +74 -68
  132. package/dist/shared/lib/screen-share.js +108 -104
  133. package/dist/shared/lib/send-status.js +77 -61
  134. package/dist/shared/lib/text-diff-window.js +29 -0
  135. package/dist/shared/lib/watch-list.js +210 -209
  136. package/dist/shared/lib/widget-image-render.js +72 -49
  137. package/package.json +1 -1
@@ -1,252 +1,252 @@
1
- import { jsxs as n, jsx as t, Fragment as qe } from "react/jsx-runtime";
2
- import { useQueryClient as Nt, useQuery as H, keepPreviousData as Ct, useMutation as A } from "@tanstack/react-query";
3
- import { ChevronUp as St, Archive as Me, CheckCheck as _t, Search as At, Check as oe, AlarmClock as ce, ExternalLink as Te, Bell as Le, ShieldCheck as ue, ChevronLeft as Dt, ChevronRight as zt, History as $t, Trash2 as Ft, ChevronDown as qt } from "lucide-react";
4
- import { useState as c, useEffect as me, useRef as Mt, useCallback as Tt, Fragment as pe } from "react";
5
- import { useNivaroClient as Lt } from "../../context.js";
6
- import { get as Q, post as w, patch as Pt, del as Rt } from "../../lib/commands.js";
7
- import { useTopInserts as Pe, slideIn as Ot } from "../../lib/live-screen.js";
8
- import { resolveNotificationTargetFor as V, runNotificationTarget as be } from "../../lib/notification-target.js";
9
- import { openInTabsMessage as It, openInTabs as Kt } from "../../lib/open-in-tabs.js";
10
- import { useRecordPeek as jt, isNewTabClick as Bt, notificationPeekTarget as Re } from "../../lib/record-peek.js";
11
- import { cn as b, formatRelative as Oe } from "../../lib/utils.js";
12
- import { AgentBadge as Ut } from "../AgentBadge.js";
13
- import { hasSnapshotView as Ht, offersChanges as Qt } from "../NotificationBell.js";
14
- import { RelativeTime as Ie } from "../RelativeTime.js";
15
- import { SimpleSelect as he } from "../ui/SimpleSelect.js";
16
- import { AsItWasSheet as Gt } from "./AsItWasSheet.js";
17
- import { bundleLocally as Yt, laneTone as Vt, bundleAsNotification as Wt, bundleHeadline as Zt, categoryChipLabel as Jt } from "./bundles.js";
18
- import { DeliveryChips as Xt } from "./DeliveryChips.js";
19
- import { NotificationActions as Et } from "./NotificationActions.js";
20
- import { NotificationChangesList as ea, ResolvedLine as ta, NotificationDetailBits as aa } from "./NotificationDetailBits.js";
21
- const xe = 25, na = [
1
+ import { jsxs as a, jsx as t, Fragment as ue } from "react/jsx-runtime";
2
+ import { useQueryClient as Ct, useQuery as G, keepPreviousData as St, useMutation as D } from "@tanstack/react-query";
3
+ import { ChevronUp as _t, Archive as Te, CheckCheck as At, Search as Dt, Check as me, AlarmClock as pe, ExternalLink as Le, Bell as Re, ShieldCheck as he, ChevronLeft as $t, ChevronRight as zt, History as Ft, Trash2 as qt, ChevronDown as Mt } from "lucide-react";
4
+ import { useState as u, useEffect as be, useRef as Tt, useCallback as Lt, Fragment as xe } from "react";
5
+ import { useNivaroClient as Rt } from "../../context.js";
6
+ import { get as H, post as S, patch as Pt, del as Ot } from "../../lib/commands.js";
7
+ import { useTopInserts as Pe, slideIn as It } from "../../lib/live-screen.js";
8
+ import { resolveNotificationTargetFor as V, runNotificationTarget as fe } from "../../lib/notification-target.js";
9
+ import { openInTabsMessage as Bt, openInTabs as Kt } from "../../lib/open-in-tabs.js";
10
+ import { useRecordPeek as jt, isNewTabClick as Ut, notificationPeekTarget as Oe } from "../../lib/record-peek.js";
11
+ import { cn as x, formatRelative as Ie } from "../../lib/utils.js";
12
+ import { AgentBadge as Gt } from "../AgentBadge.js";
13
+ import { bellGroupLabel as Ht, hasSnapshotView as Qt, offersChanges as Yt } from "../NotificationBell.js";
14
+ import { RelativeTime as Be } from "../RelativeTime.js";
15
+ import { SimpleSelect as ge } from "../ui/SimpleSelect.js";
16
+ import { AsItWasSheet as Vt } from "./AsItWasSheet.js";
17
+ import { bundleLocally as Wt, laneTone as Zt, bundleAsNotification as Jt, bundleHeadline as Ke, categoryChipLabel as Xt } from "./bundles.js";
18
+ import { DeliveryChips as Et } from "./DeliveryChips.js";
19
+ import { NotificationActions as ea } from "./NotificationActions.js";
20
+ import { NotificationChangesList as ta, ResolvedLine as aa, NotificationDetailBits as na } from "./NotificationDetailBits.js";
21
+ const ke = 25, la = [
22
22
  { key: "all", label: "All" },
23
23
  { key: "inbox", label: "Unread" },
24
24
  { key: "read", label: "Read" },
25
25
  { key: "snoozed", label: "Snoozed" },
26
26
  { key: "archived", label: "Archived" },
27
27
  { key: "sent", label: "Sent" }
28
- ], la = [
28
+ ], ra = [
29
29
  { key: "all", label: "Every lane" },
30
30
  { key: "critical", label: "Critical" },
31
31
  { key: "needs_you", label: "Needs you" },
32
32
  { key: "fyi", label: "FYI" }
33
33
  ];
34
- function Ke() {
35
- const m = /* @__PURE__ */ new Date(), h = new Date(m.getTime() + 3600 * 1e3), N = new Date(m);
36
- N.setDate(N.getDate() + 1), N.setHours(8, 0, 0, 0);
37
- const D = new Date(m);
38
- return D.setDate(D.getDate() + ((8 - D.getDay()) % 7 || 7)), D.setHours(8, 0, 0, 0), [
39
- { label: "For 1 hour", until: h },
40
- { label: "Until tomorrow 8am", until: N },
41
- { label: "Until next week", until: D }
34
+ function je() {
35
+ const o = /* @__PURE__ */ new Date(), p = new Date(o.getTime() + 3600 * 1e3), f = new Date(o);
36
+ f.setDate(f.getDate() + 1), f.setHours(8, 0, 0, 0);
37
+ const g = new Date(o);
38
+ return g.setDate(g.getDate() + ((8 - g.getDay()) % 7 || 7)), g.setHours(8, 0, 0, 0), [
39
+ { label: "For 1 hour", until: p },
40
+ { label: "Until tomorrow 8am", until: f },
41
+ { label: "Until next week", until: g }
42
42
  ];
43
43
  }
44
- const je = (m) => `b:${m.collection}:${m.item}`, Be = (m) => `n:${m.id}`;
45
- function Sa({
46
- routes: m,
47
- onNavigate: h,
48
- app: N,
49
- mailLogUrl: D,
50
- subscriptionsPath: He,
44
+ const Ue = (o) => `b:${o.collection}:${o.item}`, Ge = (o) => `n:${o.id}`;
45
+ function Aa({
46
+ routes: o,
47
+ onNavigate: p,
48
+ app: f,
49
+ mailLogUrl: g,
50
+ subscriptionsPath: W,
51
51
  rulesPath: Qe,
52
- changesId: fe,
52
+ changesId: ve,
53
53
  onNotice: r,
54
- onError: d,
55
- className: Ge
54
+ onError: i,
55
+ className: Ye
56
56
  }) {
57
- const p = Lt(), W = jt(), Z = Nt(), [J, Ye] = c(() => {
58
- if (fe !== void 0) return fe;
57
+ const h = Rt(), Z = jt(), J = Ct(), [X, Ve] = u(() => {
58
+ if (ve !== void 0) return ve;
59
59
  if (typeof window > "u") return null;
60
- const e = new URLSearchParams(window.location.search).get("changes"), a = Number(e);
61
- return e && Number.isInteger(a) && a > 0 ? a : null;
62
- }), [i, Ve] = c("all"), [C, We] = c("all"), [G, Ze] = c(!0), { data: ge = [], isLoading: Je } = H({
63
- queryKey: ["notifications", "sent", G],
64
- queryFn: () => p.request(
65
- Q("/notifications/sent", { lane: G ? "critical" : "all" })
60
+ const e = new URLSearchParams(window.location.search).get("changes"), n = Number(e);
61
+ return e && Number.isInteger(n) && n > 0 ? n : null;
62
+ }), [d, We] = u("all"), [N, Ze] = u("all"), [Q, Je] = u(!0), { data: ye = [], isLoading: Xe } = G({
63
+ queryKey: ["notifications", "sent", Q],
64
+ queryFn: () => h.request(
65
+ H("/notifications/sent", { lane: Q ? "critical" : "all" })
66
66
  ).then((e) => e.data ?? []),
67
- enabled: i === "sent",
68
- refetchInterval: i === "sent" ? 3e4 : !1
69
- }), [S, F] = c(1), [Xe, X] = c(null), [ke, ve] = c(null), [E, Ee] = c(""), [I, et] = c(""), [q, tt] = c(""), [K, at] = c(!0), [nt, lt] = c(() => /* @__PURE__ */ new Set()), [v, ye] = c(null), [M, Y] = c(() => /* @__PURE__ */ new Set()), [ee, j] = c(!1), [rt, te] = c(!1), [we, dt] = c(!1), [Ne, it] = c("30");
70
- me(() => {
71
- Y(/* @__PURE__ */ new Set()), j(!1), te(!1);
72
- }, [i, C, S, I, q]), me(() => {
67
+ enabled: d === "sent",
68
+ refetchInterval: d === "sent" ? 3e4 : !1
69
+ }), [_, q] = u(1), [Ee, E] = u(null), [we, Ne] = u(null), [ee, et] = u(""), [M, tt] = u(""), [$, at] = u(""), [B, nt] = u(!0), [lt, rt] = u(() => /* @__PURE__ */ new Set()), [C, Ce] = u(null), [T, Y] = u(() => /* @__PURE__ */ new Set()), [te, K] = u(!1), [it, ae] = u(!1), [ne, dt] = u(!1), [Se, st] = u("30");
70
+ be(() => {
71
+ Y(/* @__PURE__ */ new Set()), K(!1), ae(!1);
72
+ }, [d, N, _, M, $]), be(() => {
73
73
  const e = setTimeout(() => {
74
- et(E.trim()), F(1);
74
+ tt(ee.trim()), q(1);
75
75
  }, 350);
76
76
  return () => clearTimeout(e);
77
- }, [E]);
78
- const { data: y } = H({
77
+ }, [ee]);
78
+ const { data: b } = G({
79
79
  queryKey: ["notification-count"],
80
- queryFn: () => p.request(Q("/notifications/unread-count"))
81
- }), { data: u, isLoading: st, isPlaceholderData: ot } = H({
80
+ queryFn: () => h.request(H("/notifications/unread-count"))
81
+ }), { data: m, isLoading: ot, isPlaceholderData: ct } = G({
82
82
  queryKey: [
83
83
  "notifications",
84
84
  "center",
85
- i,
86
- C,
87
- S,
88
- I,
89
- q,
90
- N ?? null,
91
- K
85
+ d,
86
+ N,
87
+ _,
88
+ M,
89
+ $,
90
+ f ?? null,
91
+ B
92
92
  ],
93
- queryFn: () => p.request(
94
- Q("/notifications", {
95
- page: S,
96
- limit: xe,
97
- status: i === "snoozed" || i === "sent" ? "all" : i,
98
- snoozed: i === "snoozed" ? "true" : void 0,
99
- lane: C === "all" ? void 0 : C,
100
- search: I || void 0,
101
- collection: q || void 0,
102
- app: N,
103
- bundle: K ? "record" : void 0
93
+ queryFn: () => h.request(
94
+ H("/notifications", {
95
+ page: _,
96
+ limit: ke,
97
+ status: d === "snoozed" || d === "sent" ? "all" : d,
98
+ snoozed: d === "snoozed" ? "true" : void 0,
99
+ lane: N === "all" ? void 0 : N,
100
+ search: M || void 0,
101
+ collection: $ || void 0,
102
+ app: f,
103
+ bundle: B ? "record" : void 0
104
104
  })
105
105
  ).then((e) => {
106
- if (!K || e.bundles) return e;
107
- const a = Yt(e.data ?? []);
108
- return { ...e, data: a.rows, bundles: a.bundles };
106
+ if (!B || e.bundles) return e;
107
+ const n = Wt(e.data ?? []);
108
+ return { ...e, data: n.rows, bundles: n.bundles };
109
109
  }),
110
- placeholderData: Ct,
111
- enabled: i !== "sent"
112
- }), { data: ct = [] } = H({
110
+ placeholderData: St,
111
+ enabled: d !== "sent"
112
+ }), { data: ut = [] } = G({
113
113
  queryKey: ["notifications", "center", "collections"],
114
- queryFn: () => p.request(
115
- Q("/collections")
114
+ queryFn: () => h.request(
115
+ H("/collections")
116
116
  ).then((e) => {
117
- const a = Array.isArray(e) ? e : e.data ?? [];
118
- return [...new Set(a.map((l) => l.collection))].sort();
117
+ const n = Array.isArray(e) ? e : e.data ?? [];
118
+ return [...new Set(n.map((l) => l.collection))].sort();
119
119
  }),
120
120
  staleTime: 3e5
121
- }), z = i === "archived" || S > 1 ? [] : (u == null ? void 0 : u.pinned) ?? [], ut = new Set(z.map((e) => e.id)), T = ((u == null ? void 0 : u.data) ?? []).filter((e) => !ut.has(e.id)), B = (u == null ? void 0 : u.bundles) ?? [], $ = (u == null ? void 0 : u.total) ?? 0, ae = Math.max(1, Math.ceil($ / xe)), Ce = i !== "sent" && S === 1 && !!u && !ot, Se = [i, C, I, q, N ?? "", K].join("|"), L = Pe(u ? B : void 0, je, {
122
- enabled: Ce,
123
- resetKey: Se
124
- }), P = Pe(u ? T : void 0, Be, {
125
- enabled: Ce,
126
- resetKey: Se
127
- }), mt = u ? L.rows : B, _e = u ? P.rows : T, ne = L.held + P.held, Ae = Mt(null), De = L.rootRef, ze = P.rootRef, pt = Tt(
121
+ }), z = d === "archived" || _ > 1 ? [] : (m == null ? void 0 : m.pinned) ?? [], mt = new Set(z.map((e) => e.id)), L = ((m == null ? void 0 : m.data) ?? []).filter((e) => !mt.has(e.id)), j = (m == null ? void 0 : m.bundles) ?? [], F = (m == null ? void 0 : m.total) ?? 0, le = Math.max(1, Math.ceil(F / ke)), _e = d !== "sent" && _ === 1 && !!m && !ct, Ae = [d, N, M, $, f ?? "", B].join("|"), R = Pe(m ? j : void 0, Ue, {
122
+ enabled: _e,
123
+ resetKey: Ae
124
+ }), P = Pe(m ? L : void 0, Ge, {
125
+ enabled: _e,
126
+ resetKey: Ae
127
+ }), pt = m ? R.rows : j, De = m ? P.rows : L, re = R.held + P.held, $e = Tt(null), ze = R.rootRef, Fe = P.rootRef, ht = Lt(
128
128
  (e) => {
129
- Ae.current = e, De(e), ze(e);
129
+ $e.current = e, ze(e), Fe(e);
130
130
  },
131
- [De, ze]
131
+ [ze, Fe]
132
132
  );
133
- me(() => {
134
- Ot(Ae.current, [...L.arrived, ...P.arrived]);
135
- }, [L.arrived, P.arrived]);
133
+ be(() => {
134
+ It($e.current, [...R.arrived, ...P.arrived]);
135
+ }, [R.arrived, P.arrived]);
136
136
  const bt = () => {
137
- L.reveal(), P.reveal();
138
- }, k = () => {
139
- Z.invalidateQueries({ queryKey: ["notifications"] }), Z.invalidateQueries({ queryKey: ["notification-count"] });
140
- }, ht = A({
141
- mutationFn: (e) => p.request(w("/notifications/mark-read", { ids: e })),
142
- onSuccess: k,
143
- onError: () => d == null ? void 0 : d("Failed to mark the bundle read")
144
- }), le = A({
145
- mutationFn: () => p.request(w("/notifications/mark-all-read")),
137
+ R.reveal(), P.reveal();
138
+ }, w = () => {
139
+ J.invalidateQueries({ queryKey: ["notifications"] }), J.invalidateQueries({ queryKey: ["notification-count"] });
140
+ }, xt = D({
141
+ mutationFn: (e) => h.request(S("/notifications/mark-read", { ids: e })),
142
+ onSuccess: w,
143
+ onError: () => i == null ? void 0 : i("Failed to mark the bundle read")
144
+ }), ie = D({
145
+ mutationFn: () => h.request(S("/notifications/mark-all-read")),
146
146
  onSuccess: () => {
147
- k(), r == null || r("All notifications marked as read");
147
+ w(), r == null || r("All notifications marked as read");
148
148
  },
149
- onError: () => d == null ? void 0 : d("Failed to mark all read")
150
- }), U = A({
149
+ onError: () => i == null ? void 0 : i("Failed to mark all read")
150
+ }), U = D({
151
151
  mutationFn: ({
152
152
  id: e,
153
- until: a,
153
+ until: n,
154
154
  untilChange: l
155
- }) => p.request(
156
- w(
155
+ }) => h.request(
156
+ S(
157
157
  `/notifications/${e}/snooze`,
158
- l ? { until_change: !0 } : { until: a ? a.toISOString() : null }
158
+ l ? { until_change: !0 } : { until: n ? n.toISOString() : null }
159
159
  )
160
160
  ),
161
- onSuccess: (e, a) => {
162
- k(), ve(null), r == null || r(
163
- a.untilChange ? "Snoozed — it comes back when someone changes the record" : a.until ? "Snoozed — it will return unread" : "Snooze cleared"
161
+ onSuccess: (e, n) => {
162
+ w(), Ne(null), r == null || r(
163
+ n.untilChange ? "Snoozed — it comes back when someone changes the record" : n.until ? "Snoozed — it will return unread" : "Snooze cleared"
164
164
  );
165
165
  },
166
- onError: () => d == null ? void 0 : d("Failed to snooze")
167
- }), $e = A({
168
- mutationFn: (e) => p.request(w(`/notifications/${e}/acknowledge`)),
166
+ onError: () => i == null ? void 0 : i("Failed to snooze")
167
+ }), qe = D({
168
+ mutationFn: (e) => h.request(S(`/notifications/${e}/acknowledge`)),
169
169
  onSuccess: () => {
170
- k(), r == null || r("Acknowledged");
170
+ w(), r == null || r("Acknowledged");
171
171
  },
172
- onError: () => d == null ? void 0 : d("Failed to acknowledge")
173
- }), xt = () => ({
174
- status: i === "snoozed" || i === "sent" ? "all" : i,
175
- snoozed: i === "snoozed" ? "true" : void 0,
176
- lane: C === "all" ? void 0 : C,
177
- search: I || void 0,
178
- collection: q || void 0
179
- }), R = A({
180
- mutationFn: (e) => p.request(
181
- w("/notifications/bulk-action", {
172
+ onError: () => i == null ? void 0 : i("Failed to acknowledge")
173
+ }), ft = () => ({
174
+ status: d === "snoozed" || d === "sent" ? "all" : d,
175
+ snoozed: d === "snoozed" ? "true" : void 0,
176
+ lane: N === "all" ? void 0 : N,
177
+ search: M || void 0,
178
+ collection: $ || void 0
179
+ }), O = D({
180
+ mutationFn: (e) => h.request(
181
+ S("/notifications/bulk-action", {
182
182
  action: e.action,
183
183
  until: e.until ? e.until.toISOString() : void 0,
184
- ...ee ? { filter: xt() } : { ids: [...M] }
184
+ ...te ? { filter: ft() } : { ids: [...T] }
185
185
  })
186
186
  ),
187
- onSuccess: (e, a) => {
187
+ onSuccess: (e, n) => {
188
188
  var s;
189
- k(), Y(/* @__PURE__ */ new Set()), j(!1), te(!1);
189
+ w(), Y(/* @__PURE__ */ new Set()), K(!1), ae(!1);
190
190
  const l = ((s = e.data) == null ? void 0 : s.updated) ?? 0;
191
191
  r == null || r(
192
- `${l} notification${l === 1 ? "" : "s"} ${a.action === "read" ? "marked read" : a.action === "archive" ? "archived" : "snoozed"}`
192
+ `${l} notification${l === 1 ? "" : "s"} ${n.action === "read" ? "marked read" : n.action === "archive" ? "archived" : "snoozed"}`
193
193
  );
194
194
  },
195
- onError: () => d == null ? void 0 : d("That bulk action failed")
196
- }), re = A({
197
- mutationFn: (e) => p.request(w("/notifications/archive-read", { days: e })),
195
+ onError: () => i == null ? void 0 : i("That bulk action failed")
196
+ }), de = D({
197
+ mutationFn: (e) => h.request(S("/notifications/archive-read", { days: e })),
198
198
  onSuccess: (e) => {
199
- var a;
200
- k(), r == null || r(`${((a = e.data) == null ? void 0 : a.updated) ?? 0} archived — find them under Archived`);
199
+ var n;
200
+ w(), r == null || r(`${((n = e.data) == null ? void 0 : n.updated) ?? 0} archived — find them under Archived`);
201
201
  },
202
- onError: () => d == null ? void 0 : d("Clean-up failed")
203
- }), { data: de } = H({
202
+ onError: () => i == null ? void 0 : i("Clean-up failed")
203
+ }), { data: se } = G({
204
204
  queryKey: ["nvr-profile-prefs"],
205
- queryFn: () => p.request(Q("/users/me")).then((e) => {
206
- var a;
207
- return ((a = e.data) == null ? void 0 : a.preferences) ?? {};
205
+ queryFn: () => h.request(H("/users/me")).then((e) => {
206
+ var n;
207
+ return ((n = e.data) == null ? void 0 : n.preferences) ?? {};
208
208
  }),
209
- enabled: we
210
- }), ft = A({
211
- mutationFn: (e) => p.request(Pt("/users/me/preferences", { notification_cleanup_days: e })),
209
+ enabled: ne
210
+ }), gt = D({
211
+ mutationFn: (e) => h.request(Pt("/users/me/preferences", { notification_cleanup_days: e })),
212
212
  onSuccess: () => {
213
- Z.invalidateQueries({ queryKey: ["nvr-profile-prefs"] }), r == null || r("Automatic clean-up saved");
213
+ J.invalidateQueries({ queryKey: ["nvr-profile-prefs"] }), r == null || r("Automatic clean-up saved");
214
214
  },
215
- onError: () => d == null ? void 0 : d("Could not save the clean-up setting")
216
- }), ie = A({
217
- mutationFn: (e) => p.request(Rt(`/notifications/${e}`)),
215
+ onError: () => i == null ? void 0 : i("Could not save the clean-up setting")
216
+ }), oe = D({
217
+ mutationFn: (e) => h.request(Ot(`/notifications/${e}`)),
218
218
  onSuccess: () => {
219
- k(), X(null), r == null || r("Notification deleted");
219
+ w(), E(null), r == null || r("Notification deleted");
220
220
  },
221
- onError: () => d == null ? void 0 : d("Failed to delete notification")
222
- }), gt = async (e) => {
223
- await p.request(w(`/notifications/${e}/read`)).catch(() => {
224
- }), k();
225
- }, kt = async (e, a) => {
226
- const l = W && !Bt(a) ? Re(e) : null;
227
- if (l && W) {
228
- const s = T.map((x) => Re(x)).filter((x) => !!x);
229
- W.open(l, { list: s }), e.read || p.request(w(`/notifications/${e.id}/read`)).catch(() => {
230
- }).then(() => k());
221
+ onError: () => i == null ? void 0 : i("Failed to delete notification")
222
+ }), kt = async (e) => {
223
+ await h.request(S(`/notifications/${e}/read`)).catch(() => {
224
+ }), w();
225
+ }, vt = async (e, n) => {
226
+ const l = Z && !Ut(n) ? Oe(e) : null;
227
+ if (l && Z) {
228
+ const s = L.map((k) => Oe(k)).filter((k) => !!k);
229
+ Z.open(l, { list: s }), e.read || h.request(S(`/notifications/${e.id}/read`)).catch(() => {
230
+ }).then(() => w());
231
231
  return;
232
232
  }
233
- e.read || (await p.request(w(`/notifications/${e.id}/read`)).catch(() => {
234
- }), k()), be(V(e, m), h);
235
- }, vt = (e) => {
236
- j(!1), Y((a) => {
237
- const l = new Set(a);
233
+ e.read || (await h.request(S(`/notifications/${e.id}/read`)).catch(() => {
234
+ }), w()), fe(V(e, o), p);
235
+ }, yt = (e) => {
236
+ K(!1), Y((n) => {
237
+ const l = new Set(n);
238
238
  return l.has(e) ? l.delete(e) : l.add(e), l;
239
239
  });
240
- }, se = (e, a = !1) => {
241
- var O, _, o, f;
242
- const l = !e.read, s = V(e, m), x = /* @__PURE__ */ n(qe, { children: [
243
- /* @__PURE__ */ n("div", { className: "flex flex-wrap items-baseline gap-x-2 sm:flex-nowrap", children: [
240
+ }, ce = (e, n = !1) => {
241
+ var I, A, c, v;
242
+ const l = !e.read, s = V(e, o), k = /* @__PURE__ */ a(ue, { children: [
243
+ /* @__PURE__ */ a("div", { className: "flex flex-wrap items-baseline gap-x-2 sm:flex-nowrap", children: [
244
244
  e.lane === "critical" && /* @__PURE__ */ t("span", { className: "shrink-0 rounded bg-red-500/10 px-1 text-[9.5px] font-bold uppercase tracking-wide text-red-600 dark:text-red-400", children: "Critical" }),
245
245
  e.lane === "needs_you" && l && /* @__PURE__ */ t("span", { className: "shrink-0 rounded bg-nvr-cyan/10 px-1 text-[9.5px] font-bold uppercase tracking-wide text-nvr-navy dark:text-nvr-cyan", children: "Needs you" }),
246
246
  /* @__PURE__ */ t(
247
247
  "span",
248
248
  {
249
- className: b(
249
+ className: x(
250
250
  // Wraps on a phone so the sender and what changed stay readable; one line on wider screens.
251
251
  "min-w-0 break-words text-[13px] sm:truncate",
252
252
  l ? "font-medium text-slate-900 dark:text-slate-100" : "font-normal text-slate-600 dark:text-slate-400"
@@ -254,22 +254,22 @@ function Sa({
254
254
  children: e.subject ?? e.title ?? "—"
255
255
  }
256
256
  ),
257
- /* @__PURE__ */ n("span", { className: "flex shrink-0 items-center gap-1.5 text-[10.5px] text-slate-400", children: [
258
- /* @__PURE__ */ t(Ut, { label: (O = e.detail) == null ? void 0 : O.via_agent }),
259
- /* @__PURE__ */ t(Ie, { value: e.created_at ?? /* @__PURE__ */ new Date() })
257
+ /* @__PURE__ */ a("span", { className: "flex shrink-0 items-center gap-1.5 text-[10.5px] text-slate-400", children: [
258
+ /* @__PURE__ */ t(Gt, { label: (I = e.detail) == null ? void 0 : I.via_agent }),
259
+ /* @__PURE__ */ t(Be, { value: e.created_at ?? /* @__PURE__ */ new Date() })
260
260
  ] })
261
261
  ] }),
262
- e.message && /* @__PURE__ */ t("p", { className: "mt-0.5 line-clamp-3 whitespace-pre-line text-[12px] text-slate-500", children: e.message.replace(/<[^>]+>/g, "") }),
263
- /* @__PURE__ */ t(ta, { resolved: (_ = e.detail) == null ? void 0 : _.resolved, className: "text-[11.5px]" })
262
+ e.message && /* @__PURE__ */ t(ia, { text: e.message.replace(/<[^>]+>/g, "") }),
263
+ /* @__PURE__ */ t(aa, { resolved: (A = e.detail) == null ? void 0 : A.resolved, className: "text-[11.5px]" })
264
264
  ] });
265
- return /* @__PURE__ */ n(
265
+ return /* @__PURE__ */ a(
266
266
  "div",
267
267
  {
268
- className: b(
268
+ className: x(
269
269
  "group relative flex items-start gap-3 py-3",
270
270
  // Only a row that opens something lights up under the pointer.
271
271
  s && "transition-colors hover:bg-slate-50 dark:hover:bg-slate-800/40",
272
- a ? "bg-slate-50/50 pl-8 pr-4 dark:bg-muted/30" : "px-4"
272
+ n ? "bg-slate-50/50 pl-8 pr-4 dark:bg-muted/30" : "px-4"
273
273
  ),
274
274
  "data-notification-row": e.id,
275
275
  "data-nvr-lane-row": e.lane ?? "",
@@ -278,8 +278,8 @@ function Sa({
278
278
  "input",
279
279
  {
280
280
  type: "checkbox",
281
- checked: M.has(e.id),
282
- onChange: () => vt(e.id),
281
+ checked: T.has(e.id),
282
+ onChange: () => yt(e.id),
283
283
  "aria-label": "Select notification",
284
284
  "data-notification-select": e.id,
285
285
  className: "mt-1.5 h-3.5 w-3.5 shrink-0"
@@ -288,29 +288,29 @@ function Sa({
288
288
  /* @__PURE__ */ t(
289
289
  "span",
290
290
  {
291
- className: b(
291
+ className: x(
292
292
  "mt-2 h-2 w-2 shrink-0 rounded-full",
293
293
  l ? e.lane === "critical" ? "bg-red-500" : "bg-nvr-cyan" : "bg-transparent"
294
294
  )
295
295
  }
296
296
  ),
297
- /* @__PURE__ */ n("div", { className: "min-w-0 flex-1", children: [
297
+ /* @__PURE__ */ a("div", { className: "min-w-0 flex-1", children: [
298
298
  s ? /* @__PURE__ */ t(
299
299
  "button",
300
300
  {
301
301
  type: "button",
302
- onClick: (g) => void kt(e, g),
302
+ onClick: (y) => void vt(e, y),
303
303
  className: "block w-full text-left",
304
- children: x
304
+ children: k
305
305
  }
306
306
  ) : (
307
307
  // Nowhere to open: plain text, read or not. As a button its click
308
308
  // only marked the row read, so the row dimmed (or left the Unread
309
309
  // list) and opened nothing. Mark read is its own control below.
310
- /* @__PURE__ */ t("div", { "data-notification-plain": !0, children: x })
310
+ /* @__PURE__ */ t("div", { "data-notification-plain": !0, children: k })
311
311
  ),
312
- /* @__PURE__ */ n("div", { className: "mt-1 flex flex-wrap items-center gap-2", children: [
313
- e.sender_name && /* @__PURE__ */ n("span", { className: "text-[11px] text-slate-400", children: [
312
+ /* @__PURE__ */ a("div", { className: "mt-1 flex flex-wrap items-center gap-2", children: [
313
+ e.sender_name && /* @__PURE__ */ a("span", { className: "text-[11px] text-slate-400", children: [
314
314
  "From ",
315
315
  e.sender_name
316
316
  ] }),
@@ -318,90 +318,94 @@ function Sa({
318
318
  "button",
319
319
  {
320
320
  type: "button",
321
- onClick: () => be(s, h),
321
+ onClick: () => fe(s, p),
322
322
  ...e.collection && !e.item && s.type !== "chat" && s.type !== "external" ? {
323
- "aria-label": `See what changed in ${Ue(e.collection)}`,
324
- "data-tip": `See what changed in ${Ue(e.collection)}`
323
+ "aria-label": `See what changed in ${He(e.collection)}`,
324
+ "data-tip": `See what changed in ${He(e.collection)}`
325
325
  } : {},
326
326
  className: "inline-flex items-center gap-1 rounded-full bg-nvr-cyan/10 px-2 py-0.5 text-[10px] font-medium text-nvr-navy hover:bg-nvr-cyan/20 dark:bg-nvr-cyan/15 dark:text-nvr-cyan",
327
- children: s.type === "chat" ? "Open chat" : s.type === "external" ? "Open in app ↗" : e.target_label && e.kind !== "record" ? `${e.target_label}${e.item ? ` #${e.item}` : ""}` : e.collection === "__chat__" ? "Chat" : e.collection && !e.item ? "See changes" : e.collection ? `${e.collection} #${e.item}` : "Open"
327
+ children: s.type === "chat" ? "Open chat" : s.type === "external" ? "Open in app ↗" : e.target_label && e.kind !== "record" ? `${e.target_label}${e.item ? ` #${e.item}` : ""}` : e.collection === "__chat__" ? "Chat" : e.collection && !e.item ? "See changes" : e.collection ? (
328
+ // The record's friendly id ("Workflow TP26-80418"), as the title
329
+ // names it — never the table name and row id.
330
+ (e.record_label ? Ht(e) : null) ?? `${e.collection} #${e.item}`
331
+ ) : "Open"
328
332
  }
329
333
  ),
330
- l && !s && /* @__PURE__ */ n(
334
+ l && !s && /* @__PURE__ */ a(
331
335
  "button",
332
336
  {
333
337
  type: "button",
334
338
  "data-notification-mark-read": e.id,
335
- onClick: () => void gt(e.id),
339
+ onClick: () => void kt(e.id),
336
340
  className: "inline-flex items-center gap-1 rounded-full border border-slate-200 px-2 py-0.5 text-[10px] font-medium text-slate-500 hover:bg-slate-50 hover:text-slate-700 dark:border-border dark:text-slate-400 dark:hover:bg-muted dark:hover:text-slate-200",
337
341
  children: [
338
- /* @__PURE__ */ t(oe, { className: "h-3 w-3" }),
342
+ /* @__PURE__ */ t(me, { className: "h-3 w-3" }),
339
343
  "Mark read"
340
344
  ]
341
345
  }
342
346
  ),
343
- /* @__PURE__ */ t(Xt, { delivery: e.delivery, mailLogUrl: D, onNavigate: h }),
344
- Ht(e) && /* @__PURE__ */ n(
347
+ /* @__PURE__ */ t(Et, { delivery: e.delivery, mailLogUrl: g, onNavigate: p }),
348
+ Qt(e) && /* @__PURE__ */ a(
345
349
  "button",
346
350
  {
347
351
  type: "button",
348
352
  "data-notification-as-it-was": e.id,
349
353
  "data-tip": "The record as it was when you were told",
350
- onClick: () => ye(e),
354
+ onClick: () => Ce(e),
351
355
  className: "inline-flex items-center gap-1 rounded-full border border-slate-200 px-2 py-0.5 text-[10px] font-medium text-slate-500 hover:bg-slate-50 hover:text-slate-700 dark:border-border dark:text-slate-400 dark:hover:bg-muted dark:hover:text-slate-200",
352
356
  children: [
353
- /* @__PURE__ */ t($t, { className: "h-3 w-3" }),
354
- "as it was"
357
+ /* @__PURE__ */ t(Ft, { className: "h-3 w-3" }),
358
+ "Record when sent"
355
359
  ]
356
360
  }
357
361
  )
358
362
  ] }),
359
363
  /* @__PURE__ */ t(
360
- aa,
364
+ na,
361
365
  {
362
366
  detail: e.detail,
363
367
  why: e.why,
364
368
  delivery: e.delivery,
365
369
  notificationId: e.id,
366
- recordChanges: Qt(e),
367
- subscriptionsPath: He,
370
+ recordChanges: Yt(e),
371
+ subscriptionsPath: W,
368
372
  rulesPath: Qe,
369
- onNavigate: h,
373
+ onNavigate: p,
370
374
  className: "mt-1"
371
375
  }
372
376
  ),
373
- ((o = e.ack) == null ? void 0 : o.required) && /* @__PURE__ */ t("div", { className: "mt-1.5", "data-notification-ack": e.ack.at ? "acked" : "pending", children: e.ack.at ? /* @__PURE__ */ n("span", { className: "inline-flex items-center gap-1 rounded-full bg-emerald-50 px-2 py-0.5 text-[10.5px] font-medium text-emerald-700 dark:bg-emerald-500/10 dark:text-emerald-400", children: [
374
- /* @__PURE__ */ t(ue, { className: "h-3 w-3" }),
377
+ ((c = e.ack) == null ? void 0 : c.required) && /* @__PURE__ */ t("div", { className: "mt-1.5", "data-notification-ack": e.ack.at ? "acked" : "pending", children: e.ack.at ? /* @__PURE__ */ a("span", { className: "inline-flex items-center gap-1 rounded-full bg-emerald-50 px-2 py-0.5 text-[10.5px] font-medium text-emerald-700 dark:bg-emerald-500/10 dark:text-emerald-400", children: [
378
+ /* @__PURE__ */ t(he, { className: "h-3 w-3" }),
375
379
  "Acknowledged ",
376
- Oe(e.ack.at)
377
- ] }) : /* @__PURE__ */ n(
380
+ Ie(e.ack.at)
381
+ ] }) : /* @__PURE__ */ a(
378
382
  "button",
379
383
  {
380
384
  type: "button",
381
- disabled: $e.isPending,
382
- onClick: () => $e.mutate(e.id),
385
+ disabled: qe.isPending,
386
+ onClick: () => qe.mutate(e.id),
383
387
  "data-notification-acknowledge": e.id,
384
388
  className: "inline-flex items-center gap-1 rounded-md bg-nvr-cyan px-2.5 py-1 text-[11.5px] font-medium text-white hover:opacity-90 disabled:opacity-50",
385
389
  children: [
386
- /* @__PURE__ */ t(ue, { className: "h-3.5 w-3.5" }),
390
+ /* @__PURE__ */ t(he, { className: "h-3.5 w-3.5" }),
387
391
  "Acknowledge"
388
392
  ]
389
393
  }
390
394
  ) }),
391
- e.actions && e.actions.length > 0 && !((f = e.detail) != null && f.resolved) && /* @__PURE__ */ t(
392
- Et,
395
+ e.actions && e.actions.length > 0 && !((v = e.detail) != null && v.resolved) && /* @__PURE__ */ t(
396
+ ea,
393
397
  {
394
- actions: l ? e.actions : e.actions.filter((g) => !!g.input),
398
+ actions: l ? e.actions : e.actions.filter((y) => !!y.input),
395
399
  notificationId: e.id,
396
400
  size: "sm",
397
- onError: d,
401
+ onError: i,
398
402
  onDone: () => r == null ? void 0 : r("Done"),
399
403
  className: "mt-1.5"
400
404
  }
401
405
  )
402
406
  ] }),
403
- /* @__PURE__ */ n("div", { className: "relative shrink-0", children: [
404
- e.snoozed_until && new Date(e.snoozed_until) > /* @__PURE__ */ new Date() ? /* @__PURE__ */ n(
407
+ /* @__PURE__ */ a("div", { className: "relative shrink-0", children: [
408
+ e.snoozed_until && new Date(e.snoozed_until) > /* @__PURE__ */ new Date() ? /* @__PURE__ */ a(
405
409
  "button",
406
410
  {
407
411
  type: "button",
@@ -409,7 +413,7 @@ function Sa({
409
413
  className: "inline-flex items-center gap-1 rounded-full bg-amber-50 px-2 py-0.5 text-[10.5px] font-medium text-amber-700 hover:bg-amber-100 dark:bg-amber-400/10 dark:text-amber-300",
410
414
  "data-tip": "Click to wake now",
411
415
  children: [
412
- /* @__PURE__ */ t(ce, { className: "h-3 w-3" }),
416
+ /* @__PURE__ */ t(pe, { className: "h-3 w-3" }),
413
417
  e.snooze_until_change ? "Until it changes" : `Until ${new Date(e.snoozed_until).toLocaleString([], {
414
418
  month: "short",
415
419
  day: "numeric",
@@ -422,23 +426,23 @@ function Sa({
422
426
  "button",
423
427
  {
424
428
  type: "button",
425
- onClick: () => ve(ke === e.id ? null : e.id),
426
- className: "rounded p-1.5 text-slate-300 opacity-0 transition-all hover:bg-amber-50 hover:text-amber-500 group-hover:opacity-100 dark:hover:bg-amber-400/10",
429
+ onClick: () => Ne(we === e.id ? null : e.id),
430
+ className: "rounded p-1.5 text-slate-300 opacity-0 transition-all hover:bg-amber-50 hover:text-amber-500 focus-visible:opacity-100 group-hover:opacity-100 group-focus-within:opacity-100 dark:hover:bg-amber-400/10 [@media(hover:none)]:opacity-100",
427
431
  "aria-label": "Snooze notification",
428
- children: /* @__PURE__ */ t(ce, { className: "h-3.5 w-3.5" })
432
+ children: /* @__PURE__ */ t(pe, { className: "h-3.5 w-3.5" })
429
433
  }
430
434
  ),
431
- ke === e.id && /* @__PURE__ */ n("div", { className: "absolute right-0 top-8 z-20 w-[180px] rounded-md border border-slate-200 bg-white py-1 shadow-lg dark:border-border dark:bg-card", children: [
432
- Ke().map((g) => /* @__PURE__ */ t(
435
+ we === e.id && /* @__PURE__ */ a("div", { className: "absolute right-0 top-8 z-20 w-[180px] rounded-md border border-slate-200 bg-white py-1 shadow-lg dark:border-border dark:bg-card", children: [
436
+ je().map((y) => /* @__PURE__ */ t(
433
437
  "button",
434
438
  {
435
439
  type: "button",
436
440
  disabled: U.isPending,
437
- onClick: () => U.mutate({ id: e.id, until: g.until }),
441
+ onClick: () => U.mutate({ id: e.id, until: y.until }),
438
442
  className: "block w-full px-3 py-1.5 text-left text-[12px] text-slate-700 hover:bg-muted dark:text-foreground",
439
- children: g.label
443
+ children: y.label
440
444
  },
441
- g.label
445
+ y.label
442
446
  )),
443
447
  e.collection && e.item != null && /* @__PURE__ */ t(
444
448
  "button",
@@ -453,12 +457,12 @@ function Sa({
453
457
  )
454
458
  ] })
455
459
  ] }),
456
- /* @__PURE__ */ t("div", { className: "shrink-0", children: Xe === e.id ? /* @__PURE__ */ n("div", { className: "flex items-center gap-1.5", children: [
460
+ /* @__PURE__ */ t("div", { className: "shrink-0", children: Ee === e.id ? /* @__PURE__ */ a("div", { className: "flex items-center gap-1.5", children: [
457
461
  /* @__PURE__ */ t(
458
462
  "button",
459
463
  {
460
464
  type: "button",
461
- onClick: () => X(null),
465
+ onClick: () => E(null),
462
466
  className: "h-6 rounded-md border border-slate-200 px-2 text-[11px] dark:border-border",
463
467
  children: "Cancel"
464
468
  }
@@ -467,53 +471,53 @@ function Sa({
467
471
  "button",
468
472
  {
469
473
  type: "button",
470
- disabled: ie.isPending,
471
- onClick: () => ie.mutate(e.id),
474
+ disabled: oe.isPending,
475
+ onClick: () => oe.mutate(e.id),
472
476
  className: "h-6 rounded-md bg-red-500 px-2 text-[11px] text-white hover:bg-red-600",
473
- children: ie.isPending ? "Deleting…" : "Delete"
477
+ children: oe.isPending ? "Deleting…" : "Delete"
474
478
  }
475
479
  )
476
480
  ] }) : /* @__PURE__ */ t(
477
481
  "button",
478
482
  {
479
483
  type: "button",
480
- onClick: () => X(e.id),
481
- className: "rounded p-1.5 text-slate-300 opacity-0 transition-all hover:bg-red-50 hover:text-red-400 group-hover:opacity-100",
484
+ onClick: () => E(e.id),
485
+ className: "rounded p-1.5 text-slate-300 opacity-0 transition-all hover:bg-red-50 hover:text-red-400 focus-visible:opacity-100 group-hover:opacity-100 group-focus-within:opacity-100 [@media(hover:none)]:opacity-100",
482
486
  "aria-label": "Delete notification",
483
- children: /* @__PURE__ */ t(Ft, { className: "h-3.5 w-3.5" })
487
+ children: /* @__PURE__ */ t(qt, { className: "h-3.5 w-3.5" })
484
488
  }
485
489
  ) })
486
490
  ]
487
491
  }
488
492
  );
489
- }, yt = (e) => {
490
- const a = `${e.collection}:${e.item}`, l = nt.has(a), s = Vt(e.lane), x = e.deleted ? null : V(Wt(e), m), O = e.rows.filter((o) => !o.read).map((o) => o.id), _ = () => lt((o) => {
491
- const f = new Set(o);
492
- return f.has(a) ? f.delete(a) : f.add(a), f;
493
+ }, wt = (e) => {
494
+ const n = `${e.collection}:${e.item}`, l = lt.has(n), s = Zt(e.lane), k = e.deleted ? null : V(Jt(e), o), I = e.rows.filter((c) => !c.read).map((c) => c.id), A = () => rt((c) => {
495
+ const v = new Set(c);
496
+ return v.has(n) ? v.delete(n) : v.add(n), v;
493
497
  });
494
- return /* @__PURE__ */ n(
498
+ return /* @__PURE__ */ a(
495
499
  "div",
496
500
  {
497
- "data-live-key": je(e),
498
- "data-notification-bundle": a,
501
+ "data-live-key": Ue(e),
502
+ "data-notification-bundle": n,
499
503
  "data-notification-bundle-count": e.count,
500
504
  "data-notification-bundle-lane": e.lane,
501
505
  "data-notification-bundle-deleted": e.deleted ? "true" : void 0,
502
506
  children: [
503
- /* @__PURE__ */ n("div", { className: "group flex items-start gap-3 px-4 py-3 transition-colors hover:bg-slate-50 dark:hover:bg-slate-800/40", children: [
507
+ /* @__PURE__ */ a("div", { className: "group flex items-start gap-3 px-4 py-3 transition-colors hover:bg-slate-50 dark:hover:bg-slate-800/40", children: [
504
508
  /* @__PURE__ */ t(
505
509
  "button",
506
510
  {
507
511
  type: "button",
508
512
  "aria-expanded": l,
509
513
  "aria-label": l ? "Collapse" : "Expand",
510
- "data-notification-bundle-expand": a,
511
- onClick: _,
514
+ "data-notification-bundle-expand": n,
515
+ onClick: A,
512
516
  className: "mt-1 rounded p-0.5 text-slate-400 hover:bg-slate-100 hover:text-slate-700 dark:hover:bg-muted dark:hover:text-slate-200",
513
517
  children: /* @__PURE__ */ t(
514
- qt,
518
+ Mt,
515
519
  {
516
- className: b("h-3.5 w-3.5 transition-transform", !l && "-rotate-90")
520
+ className: x("h-3.5 w-3.5 transition-transform", !l && "-rotate-90")
517
521
  }
518
522
  )
519
523
  }
@@ -521,18 +525,19 @@ function Sa({
521
525
  /* @__PURE__ */ t(
522
526
  "span",
523
527
  {
524
- className: b(
528
+ className: x(
525
529
  "mt-2 h-2 w-2 shrink-0 rounded-full",
526
- e.unread > 0 ? s.dot : "bg-transparent"
530
+ // The same dot an unread row inside the group shows.
531
+ e.unread > 0 ? e.lane === "critical" ? "bg-red-500" : "bg-nvr-cyan" : "bg-transparent"
527
532
  )
528
533
  }
529
534
  ),
530
- /* @__PURE__ */ n("div", { className: "min-w-0 flex-1", children: [
531
- /* @__PURE__ */ t("button", { type: "button", onClick: _, className: "block w-full text-left", children: /* @__PURE__ */ n("div", { className: "flex items-baseline gap-2", children: [
535
+ /* @__PURE__ */ a("div", { className: "min-w-0 flex-1", children: [
536
+ /* @__PURE__ */ t("button", { type: "button", onClick: A, className: "block w-full text-left", children: /* @__PURE__ */ a("div", { className: "flex items-baseline gap-2", children: [
532
537
  e.lane === "critical" && e.unread > 0 && /* @__PURE__ */ t(
533
538
  "span",
534
539
  {
535
- className: b(
540
+ className: x(
536
541
  "shrink-0 rounded px-1 text-[9.5px] font-bold uppercase tracking-wide",
537
542
  s.chip
538
543
  ),
@@ -542,16 +547,20 @@ function Sa({
542
547
  /* @__PURE__ */ t(
543
548
  "span",
544
549
  {
545
- className: b(
546
- "truncate text-[13px]",
547
- e.unread > 0 ? b("font-medium", s.text) : "font-normal text-slate-600 dark:text-slate-400"
550
+ className: x(
551
+ // A phone wraps the headline (two lines) instead of cutting it to a word.
552
+ "min-w-0 line-clamp-2 break-words text-[13px] sm:line-clamp-none sm:truncate",
553
+ e.unread > 0 ? x("font-medium", s.text) : "font-normal text-slate-600 dark:text-slate-400"
548
554
  ),
549
- children: Zt(e)
555
+ children: e.label ? /* @__PURE__ */ a(ue, { children: [
556
+ Ke(e).slice(0, -e.label.length),
557
+ /* @__PURE__ */ t("span", { className: "whitespace-nowrap", children: e.label })
558
+ ] }) : Ke(e)
550
559
  }
551
560
  ),
552
- /* @__PURE__ */ t("span", { className: "shrink-0 text-[10.5px] text-slate-400", children: e.newest ? Oe(e.newest) : "" })
561
+ /* @__PURE__ */ t("span", { className: "shrink-0 text-[10.5px] text-slate-400", children: e.newest ? Ie(e.newest) : "" })
553
562
  ] }) }),
554
- /* @__PURE__ */ n("div", { className: "mt-1 flex flex-wrap items-center gap-1.5", children: [
563
+ /* @__PURE__ */ a("div", { className: "mt-1 flex flex-wrap items-center gap-1.5", children: [
555
564
  e.collection_label && /* @__PURE__ */ t(
556
565
  "span",
557
566
  {
@@ -568,44 +577,46 @@ function Sa({
568
577
  children: "deleted"
569
578
  }
570
579
  ),
571
- e.categories.map((o) => /* @__PURE__ */ t(
580
+ e.categories.map((c) => /* @__PURE__ */ t(
572
581
  "span",
573
582
  {
574
583
  className: "rounded bg-slate-100 px-1.5 py-px text-[10px] font-medium text-slate-600 dark:bg-muted dark:text-slate-300",
575
- "data-notification-bundle-category": o,
576
- children: Jt(o)
584
+ "data-notification-bundle-category": c,
585
+ children: Xt(c)
577
586
  },
578
- o
587
+ c
579
588
  )),
580
- x && /* @__PURE__ */ n(
589
+ k && /* @__PURE__ */ a(
581
590
  "button",
582
591
  {
583
592
  type: "button",
584
- onClick: () => be(x, h),
593
+ onClick: () => fe(k, p),
585
594
  className: "inline-flex items-center gap-1 rounded-full bg-nvr-cyan/10 px-2 py-0.5 text-[10px] font-medium text-nvr-navy hover:bg-nvr-cyan/20 dark:bg-nvr-cyan/15 dark:text-nvr-cyan",
586
595
  children: [
587
- /* @__PURE__ */ t(Te, { className: "h-3 w-3" }),
596
+ /* @__PURE__ */ t(Le, { className: "h-3 w-3" }),
588
597
  "Open ",
589
598
  e.label
590
599
  ]
591
600
  }
592
601
  ),
593
- e.unread > 0 && e.unread < e.count && /* @__PURE__ */ n("span", { className: "text-[10.5px] text-slate-400", children: [
602
+ e.unread > 0 && /* @__PURE__ */ a("span", { className: "text-[10.5px] text-slate-500 dark:text-slate-400", children: [
594
603
  e.unread,
595
604
  " unread"
596
605
  ] })
597
606
  ] })
598
607
  ] }),
599
- O.length > 0 && /* @__PURE__ */ n(
608
+ I.length > 0 && /* @__PURE__ */ a(
600
609
  "button",
601
610
  {
602
611
  type: "button",
603
- "data-notification-bundle-read": a,
604
- onClick: () => ht.mutate(O),
605
- className: "inline-flex items-center gap-1 rounded-md border border-slate-200 px-2 py-1 text-[11px] font-medium text-slate-600 hover:bg-slate-50 dark:border-border dark:text-slate-300 dark:hover:bg-muted",
612
+ "data-notification-bundle-read": n,
613
+ onClick: () => xt.mutate(I),
614
+ "aria-label": "Mark read",
615
+ "data-tip": "Mark read",
616
+ className: "inline-flex shrink-0 items-center gap-1 rounded-md border border-slate-200 p-1.5 text-[11px] font-medium text-slate-600 hover:bg-slate-50 sm:px-2 sm:py-1 dark:border-border dark:text-slate-300 dark:hover:bg-muted",
606
617
  children: [
607
- /* @__PURE__ */ t(oe, { className: "h-3 w-3" }),
608
- "Mark read"
618
+ /* @__PURE__ */ t(me, { className: "h-3.5 w-3.5 sm:h-3 sm:w-3" }),
619
+ /* @__PURE__ */ t("span", { className: "max-sm:hidden", children: "Mark read" })
609
620
  ]
610
621
  }
611
622
  )
@@ -614,88 +625,94 @@ function Sa({
614
625
  "div",
615
626
  {
616
627
  className: "divide-y divide-slate-100 border-t border-slate-100 dark:divide-border dark:border-border",
617
- "data-notification-bundle-rows": a,
618
- children: e.rows.map((o) => /* @__PURE__ */ t(pe, { children: se(o, !0) }, o.id))
628
+ "data-notification-bundle-rows": n,
629
+ children: e.rows.map((c) => /* @__PURE__ */ t(xe, { children: ce(c, !0) }, c.id))
619
630
  }
620
631
  )
621
632
  ]
622
633
  },
623
- `bundle:${a}`
634
+ `bundle:${n}`
624
635
  );
625
- }, Fe = z.length + T.length + B.reduce((e, a) => e + a.rows.length, 0), wt = (e) => {
626
- var a;
627
- return e === "all" ? null : ((a = y == null ? void 0 : y.lanes) == null ? void 0 : a[e]) ?? null;
636
+ }, Me = z.length + L.length + j.reduce((e, n) => e + n.rows.length, 0), Nt = (e) => {
637
+ var n;
638
+ return e === "all" ? null : ((n = b == null ? void 0 : b.lanes) == null ? void 0 : n[e]) ?? null;
628
639
  };
629
- return /* @__PURE__ */ n("div", { className: b("flex flex-1 min-h-0 flex-col", Ge), "data-nvr-notification-center": !0, children: [
630
- /* @__PURE__ */ n("header", { className: "shrink-0 border-b border-slate-200 bg-white px-4 py-5 dark:border-border dark:bg-background sm:px-8", children: [
631
- /* @__PURE__ */ n("div", { className: "flex flex-wrap items-center justify-between gap-x-3 gap-y-2", children: [
632
- /* @__PURE__ */ n("div", { children: [
633
- /* @__PURE__ */ n("div", { className: "flex flex-wrap items-center gap-x-3 gap-y-1", children: [
640
+ return /* @__PURE__ */ a("div", { className: x("flex flex-1 min-h-0 flex-col", Ye), "data-nvr-notification-center": !0, children: [
641
+ /* @__PURE__ */ a("header", { className: "shrink-0 border-b border-slate-200 bg-white px-4 py-5 dark:border-border dark:bg-background sm:px-8", children: [
642
+ /* @__PURE__ */ a("div", { className: "flex flex-wrap items-center justify-between gap-x-3 gap-y-2", children: [
643
+ /* @__PURE__ */ a("div", { children: [
644
+ /* @__PURE__ */ a("div", { className: "flex flex-wrap items-center gap-x-3 gap-y-1", children: [
634
645
  /* @__PURE__ */ t("h1", { className: "text-xl font-bold text-slate-900 dark:text-slate-100", children: "Notifications" }),
635
- ne > 0 && /* @__PURE__ */ n(
646
+ re > 0 && /* @__PURE__ */ a(
636
647
  "button",
637
648
  {
638
649
  type: "button",
639
- "data-notification-new-pill": ne,
650
+ "data-notification-new-pill": re,
640
651
  onClick: bt,
641
652
  className: "inline-flex h-7 items-center gap-1 rounded-full border border-nvr-cyan/40 bg-nvr-cyan/[0.08] px-3 text-[12px] font-medium text-nvr-navy transition-colors hover:bg-nvr-cyan/15 focus-visible:outline focus-visible:outline-2 focus-visible:outline-nvr-cyan dark:border-nvr-cyan/40 dark:bg-nvr-cyan/15 dark:text-nvr-cyan dark:hover:bg-nvr-cyan/25",
642
653
  children: [
643
- /* @__PURE__ */ t(St, { className: "h-3.5 w-3.5", "aria-hidden": !0 }),
644
- ne,
654
+ /* @__PURE__ */ t(_t, { className: "h-3.5 w-3.5", "aria-hidden": !0 }),
655
+ re,
645
656
  " new"
646
657
  ]
647
658
  }
648
659
  )
649
660
  ] }),
650
- /* @__PURE__ */ n("p", { className: "mt-0.5 text-[13px] text-slate-400", children: [
651
- $,
661
+ /* @__PURE__ */ a("p", { className: "mt-0.5 text-[13px] text-slate-500 dark:text-slate-400", children: [
662
+ F,
652
663
  " notification",
653
- $ === 1 ? "" : "s",
654
- (y == null ? void 0 : y.attention) != null && y.attention > 0 ? ` · ${y.attention} need${y.attention === 1 ? "s" : ""} you` : ""
664
+ F === 1 ? "" : "s",
665
+ N !== "all" || d !== "all" || M || $ ? " in this view" : "",
666
+ (b == null ? void 0 : b.attention) != null && b.attention > 0 ? ` · ${b.attention} need${b.attention === 1 ? "s" : ""} you` : ""
655
667
  ] })
656
668
  ] }),
657
- /* @__PURE__ */ n("div", { className: "flex shrink-0 items-center gap-2", children: [
658
- /* @__PURE__ */ n(
669
+ /* @__PURE__ */ a("div", { className: "flex shrink-0 items-center gap-2", children: [
670
+ /* @__PURE__ */ a(
659
671
  "button",
660
672
  {
661
673
  type: "button",
662
674
  onClick: () => dt((e) => !e),
663
675
  "data-notification-cleanup-toggle": !0,
664
- className: "inline-flex h-8 items-center gap-1.5 whitespace-nowrap rounded-md border border-slate-200 px-3 text-[12px] font-medium text-slate-700 hover:bg-slate-50 dark:border-border dark:text-foreground dark:hover:bg-muted",
676
+ "aria-label": "Clean up",
677
+ "aria-expanded": ne,
678
+ "data-tip": "Clean up",
679
+ className: "inline-flex h-8 items-center gap-1.5 whitespace-nowrap rounded-md border border-slate-200 px-2 text-[12px] font-medium text-slate-700 hover:bg-slate-50 sm:px-3 dark:border-border dark:text-foreground dark:hover:bg-muted",
665
680
  children: [
666
- /* @__PURE__ */ t(Me, { className: "h-3.5 w-3.5" }),
667
- "Clean up"
681
+ /* @__PURE__ */ t(Te, { className: "h-3.5 w-3.5", "aria-hidden": !0 }),
682
+ /* @__PURE__ */ t("span", { className: "hidden sm:inline", children: "Clean up" })
668
683
  ]
669
684
  }
670
685
  ),
671
- /* @__PURE__ */ n(
686
+ /* @__PURE__ */ a(
672
687
  "button",
673
688
  {
674
689
  type: "button",
675
- onClick: () => le.mutate(),
676
- disabled: le.isPending,
677
- className: "inline-flex h-8 items-center gap-1.5 whitespace-nowrap rounded-md border border-slate-200 px-3 text-[12px] font-medium text-slate-700 hover:bg-slate-50 disabled:opacity-50 dark:border-border dark:text-foreground dark:hover:bg-muted",
690
+ onClick: () => ie.mutate(),
691
+ disabled: ie.isPending || b != null && b.unread === 0,
692
+ "aria-label": "Mark all read",
693
+ "data-tip": (b == null ? void 0 : b.unread) === 0 ? "Nothing unread" : "Mark all read",
694
+ className: "inline-flex h-8 items-center gap-1.5 whitespace-nowrap rounded-md border border-slate-200 px-2 text-[12px] font-medium text-slate-700 hover:bg-slate-50 disabled:cursor-not-allowed disabled:opacity-50 sm:px-3 dark:border-border dark:text-foreground dark:hover:bg-muted",
678
695
  children: [
679
- /* @__PURE__ */ t(_t, { className: "h-3.5 w-3.5" }),
680
- le.isPending ? "Marking…" : "Mark all read"
696
+ /* @__PURE__ */ t(At, { className: "h-3.5 w-3.5", "aria-hidden": !0 }),
697
+ /* @__PURE__ */ t("span", { className: "hidden sm:inline", children: ie.isPending ? "Marking…" : "Mark all read" })
681
698
  ]
682
699
  }
683
700
  )
684
701
  ] })
685
702
  ] }),
686
- we && /* @__PURE__ */ n(
703
+ ne && /* @__PURE__ */ a(
687
704
  "div",
688
705
  {
689
706
  className: "mt-3 space-y-2 rounded-md border border-slate-200 bg-slate-50 px-3 py-2.5 text-[12px] text-slate-600 dark:border-border dark:bg-muted/40 dark:text-muted-foreground",
690
707
  "data-notification-cleanup": !0,
691
708
  children: [
692
- /* @__PURE__ */ n("div", { className: "flex flex-wrap items-center gap-2", children: [
709
+ /* @__PURE__ */ a("div", { className: "flex flex-wrap items-center gap-2", children: [
693
710
  "Archive everything read and older than",
694
711
  /* @__PURE__ */ t(
695
- he,
712
+ ge,
696
713
  {
697
- value: Ne,
698
- onChange: it,
714
+ value: Se,
715
+ onChange: st,
699
716
  ariaLabel: "Older than",
700
717
  className: "h-7 w-auto rounded-md border-slate-200 bg-background px-2 text-[12px] dark:border-border",
701
718
  options: [
@@ -710,21 +727,21 @@ function Sa({
710
727
  "button",
711
728
  {
712
729
  type: "button",
713
- disabled: re.isPending,
714
- onClick: () => re.mutate(Number(Ne)),
730
+ disabled: de.isPending,
731
+ onClick: () => de.mutate(Number(Se)),
715
732
  "data-notification-archive-read": !0,
716
- className: "h-7 rounded-md bg-slate-900 px-2.5 text-[11.5px] font-medium text-white hover:bg-slate-700 disabled:opacity-50 dark:bg-slate-100 dark:text-slate-900",
717
- children: re.isPending ? "Archiving…" : "Archive now"
733
+ className: "h-7 rounded-md bg-[#0f172a] px-2.5 text-[11.5px] font-medium text-[#ffffff] hover:bg-[#334155] disabled:opacity-50 dark:bg-[#e2e8f0] dark:text-[#0f172a] dark:hover:bg-[#ffffff]",
734
+ children: de.isPending ? "Archiving…" : "Archive now"
718
735
  }
719
736
  )
720
737
  ] }),
721
- /* @__PURE__ */ n("div", { className: "flex flex-wrap items-center gap-2", children: [
738
+ /* @__PURE__ */ a("div", { className: "flex flex-wrap items-center gap-2", children: [
722
739
  "Or do it automatically — archive read notifications after",
723
740
  /* @__PURE__ */ t(
724
- he,
741
+ ge,
725
742
  {
726
- value: String((de == null ? void 0 : de.notification_cleanup_days) ?? ""),
727
- onChange: (e) => ft.mutate(e ? Number(e) : null),
743
+ value: String((se == null ? void 0 : se.notification_cleanup_days) ?? ""),
744
+ onChange: (e) => gt.mutate(e ? Number(e) : null),
728
745
  ariaLabel: "Automatic clean-up",
729
746
  className: "h-7 w-auto rounded-md border-slate-200 bg-background px-2 text-[12px] dark:border-border",
730
747
  options: [
@@ -740,73 +757,80 @@ function Sa({
740
757
  ]
741
758
  }
742
759
  ),
743
- /* @__PURE__ */ n("div", { className: "mt-4 flex flex-wrap items-center gap-2", children: [
744
- /* @__PURE__ */ t("div", { className: "flex max-w-full flex-wrap items-center gap-1", children: la.map((e) => {
745
- const a = wt(e.key);
746
- return /* @__PURE__ */ n(
760
+ /* @__PURE__ */ a("div", { className: "mt-4 flex flex-wrap items-center gap-2", children: [
761
+ /* @__PURE__ */ t("div", { className: "-mx-1 flex max-w-full items-center gap-1 overflow-x-auto px-1 [scrollbar-width:none] sm:flex-wrap", children: ra.map((e) => {
762
+ const n = Nt(e.key);
763
+ return /* @__PURE__ */ a(
747
764
  "button",
748
765
  {
749
766
  type: "button",
750
767
  onClick: () => {
751
- We(e.key), F(1);
768
+ Ze(e.key), q(1);
752
769
  },
753
770
  "data-nvr-lane": e.key,
754
- className: b(
771
+ className: x(
755
772
  "shrink-0 whitespace-nowrap rounded-md px-3 py-1.5 text-[12.5px] font-medium transition-colors",
756
- C === e.key ? e.key === "critical" ? "bg-red-500/10 text-red-700 dark:text-red-400" : "bg-nvr-cyan/10 text-nvr-navy dark:bg-nvr-cyan/15 dark:text-nvr-cyan" : "text-slate-500 hover:bg-slate-50 hover:text-slate-700 dark:hover:bg-slate-800/50"
773
+ N === e.key ? e.key === "critical" ? "bg-red-500/10 text-red-700 dark:text-red-400" : "bg-nvr-cyan/10 text-nvr-navy dark:bg-nvr-cyan/15 dark:text-nvr-cyan" : "text-slate-500 hover:bg-slate-50 hover:text-slate-700 dark:hover:bg-slate-800/50"
757
774
  ),
758
775
  children: [
759
776
  e.label,
760
- a != null && a > 0 && /* @__PURE__ */ t("span", { className: "ml-1.5 rounded-full bg-slate-200 px-1.5 text-[10px] font-bold text-slate-600 dark:bg-slate-700 dark:text-slate-300", children: a })
777
+ n != null && n > 0 && /* @__PURE__ */ t(
778
+ "span",
779
+ {
780
+ className: "ml-1.5 rounded-full bg-slate-200 px-1.5 text-[10px] font-bold text-slate-600 dark:bg-slate-700 dark:text-slate-300",
781
+ "data-tip": `${n} unread`,
782
+ children: n
783
+ }
784
+ )
761
785
  ]
762
786
  },
763
787
  e.key
764
788
  );
765
789
  }) }),
766
790
  /* @__PURE__ */ t("span", { className: "mx-1 hidden h-5 w-px bg-slate-200 dark:bg-border sm:block" }),
767
- /* @__PURE__ */ t("div", { className: "flex max-w-full flex-wrap items-center gap-1", children: na.map((e) => /* @__PURE__ */ t(
791
+ /* @__PURE__ */ t("div", { className: "-mx-1 flex max-w-full items-center gap-1 overflow-x-auto px-1 [scrollbar-width:none] sm:flex-wrap", children: la.map((e) => /* @__PURE__ */ t(
768
792
  "button",
769
793
  {
770
794
  type: "button",
771
795
  onClick: () => {
772
- Ve(e.key), F(1);
796
+ We(e.key), q(1);
773
797
  },
774
- className: b(
798
+ className: x(
775
799
  "shrink-0 whitespace-nowrap rounded-md px-2.5 py-1.5 text-[12px] font-medium transition-colors",
776
- i === e.key ? "bg-slate-900 text-white dark:bg-slate-100 dark:text-slate-900" : "text-slate-500 hover:bg-slate-50 hover:text-slate-700 dark:hover:bg-slate-800/50"
800
+ d === e.key ? "bg-[#0f172a] text-[#ffffff] dark:bg-[#e2e8f0] dark:text-[#0f172a]" : "text-slate-500 hover:bg-slate-50 hover:text-slate-700 dark:hover:bg-slate-800/50"
777
801
  ),
778
802
  children: e.label
779
803
  },
780
804
  e.key
781
805
  )) }),
782
- /* @__PURE__ */ n("div", { className: "relative w-full sm:ml-auto sm:w-auto", children: [
783
- /* @__PURE__ */ t(At, { className: "pointer-events-none absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-slate-400" }),
806
+ /* @__PURE__ */ a("div", { className: "relative w-full sm:ml-auto sm:w-auto", children: [
807
+ /* @__PURE__ */ t(Dt, { className: "pointer-events-none absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-slate-400" }),
784
808
  /* @__PURE__ */ t(
785
809
  "input",
786
810
  {
787
- value: E,
788
- onChange: (e) => Ee(e.target.value),
811
+ value: ee,
812
+ onChange: (e) => et(e.target.value),
789
813
  placeholder: "Search notifications…",
790
814
  className: "h-8 w-full rounded-md border border-slate-200 bg-background pl-8 sm:w-[240px] pr-2.5 text-[12.5px] dark:border-border"
791
815
  }
792
816
  )
793
817
  ] }),
794
818
  /* @__PURE__ */ t(
795
- he,
819
+ ge,
796
820
  {
797
- value: q,
821
+ value: $,
798
822
  onChange: (e) => {
799
- tt(e), F(1);
823
+ at(e), q(1);
800
824
  },
801
825
  ariaLabel: "Collection",
802
826
  className: "h-8 w-auto rounded-md border-slate-200 bg-background px-2 text-[12.5px] dark:border-border",
803
827
  options: [
804
828
  { value: "", label: "All collections" },
805
- ...ct.map((e) => ({ value: e, label: e }))
829
+ ...ut.map((e) => ({ value: e, label: e }))
806
830
  ]
807
831
  }
808
832
  ),
809
- /* @__PURE__ */ n(
833
+ /* @__PURE__ */ a(
810
834
  "label",
811
835
  {
812
836
  className: "flex cursor-pointer items-center gap-1.5 text-[12px] text-slate-500 dark:text-slate-400",
@@ -816,8 +840,8 @@ function Sa({
816
840
  "input",
817
841
  {
818
842
  type: "checkbox",
819
- checked: K,
820
- onChange: (e) => at(e.target.checked),
843
+ checked: B,
844
+ onChange: (e) => nt(e.target.checked),
821
845
  className: "h-3.5 w-3.5",
822
846
  "data-notification-group-by-record": !0
823
847
  }
@@ -828,121 +852,121 @@ function Sa({
828
852
  )
829
853
  ] })
830
854
  ] }),
831
- J != null && /* @__PURE__ */ n(
855
+ X != null && /* @__PURE__ */ a(
832
856
  "div",
833
857
  {
834
858
  className: "shrink-0 border-b border-slate-200 bg-white px-8 py-3 dark:border-border dark:bg-background",
835
- "data-notification-changes-landing": J,
859
+ "data-notification-changes-landing": X,
836
860
  children: [
837
- /* @__PURE__ */ n("div", { className: "flex items-center justify-between gap-2", children: [
861
+ /* @__PURE__ */ a("div", { className: "flex items-center justify-between gap-2", children: [
838
862
  /* @__PURE__ */ t("p", { className: "text-[12.5px] font-semibold text-slate-800 dark:text-slate-100", children: "What changed" }),
839
863
  /* @__PURE__ */ t(
840
864
  "button",
841
865
  {
842
866
  type: "button",
843
- onClick: () => Ye(null),
867
+ onClick: () => Ve(null),
844
868
  className: "text-[11.5px] text-slate-400 underline decoration-dotted underline-offset-2 hover:text-slate-600 dark:hover:text-slate-200",
845
869
  children: "Dismiss"
846
870
  }
847
871
  )
848
872
  ] }),
849
- /* @__PURE__ */ t(ea, { notificationId: J, className: "max-w-3xl" })
873
+ /* @__PURE__ */ t(ta, { notificationId: X, className: "max-w-3xl" })
850
874
  ]
851
875
  }
852
876
  ),
853
- i !== "sent" && M.size > 0 && /* @__PURE__ */ n(
877
+ d !== "sent" && T.size > 0 && /* @__PURE__ */ a(
854
878
  "div",
855
879
  {
856
880
  className: "flex shrink-0 flex-wrap items-center gap-2 border-b border-nvr-cyan/30 bg-nvr-cyan/5 px-8 py-2 text-[12px] text-slate-700 dark:text-slate-200",
857
881
  "data-notification-bulkbar": !0,
858
882
  children: [
859
- /* @__PURE__ */ t("span", { className: "font-medium", children: ee ? `All ${$} matching` : `${M.size} selected` }),
860
- !ee && M.size >= Fe && $ > Fe && /* @__PURE__ */ n(
883
+ /* @__PURE__ */ t("span", { className: "font-medium", children: te ? `All ${F} matching` : `${T.size} selected` }),
884
+ !te && T.size >= Me && F > Me && /* @__PURE__ */ a(
861
885
  "button",
862
886
  {
863
887
  type: "button",
864
- onClick: () => j(!0),
888
+ onClick: () => K(!0),
865
889
  "data-notification-select-matching": !0,
866
890
  className: "text-nvr-navy underline decoration-dotted underline-offset-2 dark:text-nvr-cyan",
867
891
  children: [
868
892
  "Select all ",
869
- $,
893
+ F,
870
894
  " matching"
871
895
  ]
872
896
  }
873
897
  ),
874
898
  /* @__PURE__ */ t("span", { className: "mx-1 h-4 w-px bg-slate-300 dark:bg-border" }),
875
- /* @__PURE__ */ n(
899
+ /* @__PURE__ */ a(
876
900
  "button",
877
901
  {
878
902
  type: "button",
879
- disabled: R.isPending,
880
- onClick: () => R.mutate({ action: "read" }),
903
+ disabled: O.isPending,
904
+ onClick: () => O.mutate({ action: "read" }),
881
905
  "data-notification-bulk": "read",
882
906
  className: "inline-flex h-7 items-center gap-1 rounded-md border border-slate-200 bg-background px-2 text-[11.5px] font-medium hover:bg-slate-50 dark:border-border",
883
907
  children: [
884
- /* @__PURE__ */ t(oe, { className: "h-3 w-3" }),
908
+ /* @__PURE__ */ t(me, { className: "h-3 w-3" }),
885
909
  " Mark read"
886
910
  ]
887
911
  }
888
912
  ),
889
- /* @__PURE__ */ n("div", { className: "relative", children: [
890
- /* @__PURE__ */ n(
913
+ /* @__PURE__ */ a("div", { className: "relative", children: [
914
+ /* @__PURE__ */ a(
891
915
  "button",
892
916
  {
893
917
  type: "button",
894
- disabled: R.isPending,
895
- onClick: () => te((e) => !e),
918
+ disabled: O.isPending,
919
+ onClick: () => ae((e) => !e),
896
920
  "data-notification-bulk": "snooze",
897
921
  className: "inline-flex h-7 items-center gap-1 rounded-md border border-slate-200 bg-background px-2 text-[11.5px] font-medium hover:bg-slate-50 dark:border-border",
898
922
  children: [
899
- /* @__PURE__ */ t(ce, { className: "h-3 w-3" }),
923
+ /* @__PURE__ */ t(pe, { className: "h-3 w-3" }),
900
924
  " Snooze"
901
925
  ]
902
926
  }
903
927
  ),
904
- rt && /* @__PURE__ */ t("div", { className: "absolute left-0 top-8 z-20 w-[180px] rounded-md border border-slate-200 bg-white py-1 shadow-lg dark:border-border dark:bg-card", children: Ke().map((e) => /* @__PURE__ */ t(
928
+ it && /* @__PURE__ */ t("div", { className: "absolute left-0 top-8 z-20 w-[180px] rounded-md border border-slate-200 bg-white py-1 shadow-lg dark:border-border dark:bg-card", children: je().map((e) => /* @__PURE__ */ t(
905
929
  "button",
906
930
  {
907
931
  type: "button",
908
- onClick: () => R.mutate({ action: "snooze", until: e.until }),
932
+ onClick: () => O.mutate({ action: "snooze", until: e.until }),
909
933
  className: "block w-full px-3 py-1.5 text-left text-[12px] text-slate-700 hover:bg-muted dark:text-foreground",
910
934
  children: e.label
911
935
  },
912
936
  e.label
913
937
  )) })
914
938
  ] }),
915
- i !== "archived" && /* @__PURE__ */ n(
939
+ d !== "archived" && /* @__PURE__ */ a(
916
940
  "button",
917
941
  {
918
942
  type: "button",
919
- disabled: R.isPending,
920
- onClick: () => R.mutate({ action: "archive" }),
943
+ disabled: O.isPending,
944
+ onClick: () => O.mutate({ action: "archive" }),
921
945
  "data-notification-bulk": "archive",
922
946
  className: "inline-flex h-7 items-center gap-1 rounded-md border border-slate-200 bg-background px-2 text-[11.5px] font-medium hover:bg-slate-50 dark:border-border",
923
947
  children: [
924
- /* @__PURE__ */ t(Me, { className: "h-3 w-3" }),
948
+ /* @__PURE__ */ t(Te, { className: "h-3 w-3" }),
925
949
  " Archive"
926
950
  ]
927
951
  }
928
952
  ),
929
- /* @__PURE__ */ n(
953
+ /* @__PURE__ */ a(
930
954
  "button",
931
955
  {
932
956
  type: "button",
933
957
  onClick: () => {
934
958
  const e = [];
935
- for (const a of [...z, ...T, ...B.flatMap((l) => l.rows)]) {
936
- if (!M.has(a.id)) continue;
937
- const l = V(a, m);
959
+ for (const n of [...z, ...L, ...j.flatMap((l) => l.rows)]) {
960
+ if (!T.has(n.id)) continue;
961
+ const l = V(n, o);
938
962
  l && (l.type === "external" ? e.push(l.url) : l.type === "path" && typeof window < "u" && e.push(`${window.location.origin}${l.path}`));
939
963
  }
940
- e.length === 0 ? r == null || r("None of the selected notifications opens a page") : r == null || r(It(Kt(e)));
964
+ e.length === 0 ? r == null || r("None of the selected notifications opens a page") : r == null || r(Bt(Kt(e)));
941
965
  },
942
966
  "data-notification-bulk": "tabs",
943
967
  className: "inline-flex h-7 items-center gap-1 rounded-md border border-slate-200 bg-background px-2 text-[11.5px] font-medium hover:bg-slate-50 dark:border-border",
944
968
  children: [
945
- /* @__PURE__ */ t(Te, { className: "h-3 w-3" }),
969
+ /* @__PURE__ */ t(Le, { className: "h-3 w-3" }),
946
970
  " Open in tabs"
947
971
  ]
948
972
  }
@@ -952,7 +976,7 @@ function Sa({
952
976
  {
953
977
  type: "button",
954
978
  onClick: () => {
955
- Y(/* @__PURE__ */ new Set()), j(!1);
979
+ Y(/* @__PURE__ */ new Set()), K(!1);
956
980
  },
957
981
  className: "ml-auto text-[11.5px] text-slate-500 underline decoration-dotted underline-offset-2",
958
982
  children: "Clear selection"
@@ -961,17 +985,17 @@ function Sa({
961
985
  ]
962
986
  }
963
987
  ),
964
- /* @__PURE__ */ n("div", { className: "flex-1 overflow-y-auto bg-slate-50 dark:bg-background", children: [
965
- i === "sent" ? /* @__PURE__ */ n("div", { className: "mx-8 my-6 space-y-3", "data-nvr-sent": !0, children: [
966
- /* @__PURE__ */ n("div", { className: "flex flex-wrap items-center gap-3 text-[12px] text-slate-500", children: [
988
+ /* @__PURE__ */ a("div", { className: "flex-1 overflow-y-auto bg-slate-50 dark:bg-background", children: [
989
+ d === "sent" ? /* @__PURE__ */ a("div", { className: "mx-4 my-6 space-y-3 sm:mx-8", "data-nvr-sent": !0, children: [
990
+ /* @__PURE__ */ a("div", { className: "flex flex-wrap items-center gap-3 text-[12px] text-slate-500", children: [
967
991
  /* @__PURE__ */ t("span", { children: "What you sent, with who has read it. A send is one subject to its recipients; a critical send bypasses mutes and quiet hours, so its receipts matter most." }),
968
- /* @__PURE__ */ n("label", { className: "ml-auto flex cursor-pointer items-center gap-1.5", children: [
992
+ /* @__PURE__ */ a("label", { className: "ml-auto flex cursor-pointer items-center gap-1.5", children: [
969
993
  /* @__PURE__ */ t(
970
994
  "input",
971
995
  {
972
996
  type: "checkbox",
973
- checked: G,
974
- onChange: (e) => Ze(e.target.checked),
997
+ checked: Q,
998
+ onChange: (e) => Je(e.target.checked),
975
999
  className: "h-3.5 w-3.5",
976
1000
  "data-nvr-sent-critical": !0
977
1001
  }
@@ -979,19 +1003,19 @@ function Sa({
979
1003
  "Critical only"
980
1004
  ] })
981
1005
  ] }),
982
- Je ? /* @__PURE__ */ t("p", { className: "py-10 text-[13px] text-slate-400", children: "Loading…" }) : ge.length === 0 ? /* @__PURE__ */ n("div", { className: "flex flex-col items-center justify-center py-24 text-center", children: [
983
- /* @__PURE__ */ t(Le, { className: "h-10 w-10 text-slate-200 dark:text-slate-700" }),
1006
+ Xe ? /* @__PURE__ */ t("p", { className: "py-10 text-[13px] text-slate-400", children: "Loading…" }) : ye.length === 0 ? /* @__PURE__ */ a("div", { className: "flex flex-col items-center justify-center py-24 text-center", children: [
1007
+ /* @__PURE__ */ t(Re, { className: "h-10 w-10 text-slate-200 dark:text-slate-700" }),
984
1008
  /* @__PURE__ */ t("p", { className: "mt-3 text-[14px] font-medium text-slate-500", children: "Nothing sent yet" }),
985
- /* @__PURE__ */ t("p", { className: "mt-1 text-[12px] text-slate-400", children: G ? 'No critical sends. Untick "Critical only" to see everything you sent.' : "Messages you send to stakeholders or colleagues appear here." })
986
- ] }) : /* @__PURE__ */ t("div", { className: "divide-y divide-slate-100 overflow-hidden rounded-lg border border-slate-200 bg-white dark:divide-border dark:border-border dark:bg-card", children: ge.map((e) => /* @__PURE__ */ n("div", { className: "px-4 py-3", "data-nvr-sent-row": !0, children: [
987
- /* @__PURE__ */ n("div", { className: "flex items-baseline gap-2", children: [
1009
+ /* @__PURE__ */ t("p", { className: "mt-1 text-[12px] text-slate-400", children: Q ? 'No critical sends. Untick "Critical only" to see everything you sent.' : "Messages you send to stakeholders or colleagues appear here." })
1010
+ ] }) : /* @__PURE__ */ t("div", { className: "divide-y divide-slate-100 overflow-hidden rounded-lg border border-slate-200 bg-white dark:divide-border dark:border-border dark:bg-card", children: ye.map((e) => /* @__PURE__ */ a("div", { className: "px-4 py-3", "data-nvr-sent-row": !0, children: [
1011
+ /* @__PURE__ */ a("div", { className: "flex items-baseline gap-2", children: [
988
1012
  e.lane === "critical" && /* @__PURE__ */ t("span", { className: "shrink-0 rounded bg-red-500/10 px-1 text-[9.5px] font-bold uppercase tracking-wide text-red-600 dark:text-red-400", children: "Critical" }),
989
1013
  /* @__PURE__ */ t("span", { className: "truncate text-[13px] font-medium text-slate-900 dark:text-slate-100", children: e.subject.replace(/^critical:\s*/i, "") }),
990
- /* @__PURE__ */ t("span", { className: "shrink-0 text-[10.5px] text-slate-400", children: /* @__PURE__ */ t(Ie, { value: e.created_at ?? /* @__PURE__ */ new Date() }) }),
991
- /* @__PURE__ */ n(
1014
+ /* @__PURE__ */ t("span", { className: "shrink-0 text-[10.5px] text-slate-400", children: /* @__PURE__ */ t(Be, { value: e.created_at ?? /* @__PURE__ */ new Date() }) }),
1015
+ /* @__PURE__ */ a(
992
1016
  "span",
993
1017
  {
994
- className: b(
1018
+ className: x(
995
1019
  "ml-auto shrink-0 rounded-full px-2 py-0.5 text-[10.5px] font-semibold tabular-nums",
996
1020
  e.read_count === e.total ? "bg-emerald-50 text-emerald-700 dark:bg-emerald-500/10 dark:text-emerald-400" : "bg-amber-50 text-amber-700 dark:bg-amber-400/10 dark:text-amber-300"
997
1021
  ),
@@ -1004,7 +1028,7 @@ function Sa({
1004
1028
  ]
1005
1029
  }
1006
1030
  ),
1007
- e.ack_required && /* @__PURE__ */ n(
1031
+ e.ack_required && /* @__PURE__ */ a(
1008
1032
  "span",
1009
1033
  {
1010
1034
  className: "shrink-0 rounded-full bg-sky-50 px-2 py-0.5 text-[10.5px] font-semibold tabular-nums text-sky-700 dark:bg-sky-400/10 dark:text-sky-300",
@@ -1019,92 +1043,92 @@ function Sa({
1019
1043
  )
1020
1044
  ] }),
1021
1045
  e.message && /* @__PURE__ */ t("p", { className: "mt-0.5 line-clamp-2 whitespace-pre-line text-[12px] text-slate-500", children: e.message.replace(/<[^>]+>/g, "") }),
1022
- /* @__PURE__ */ t("div", { className: "mt-1.5 flex flex-wrap gap-1", children: e.recipients.map((a) => /* @__PURE__ */ n(
1046
+ /* @__PURE__ */ t("div", { className: "mt-1.5 flex flex-wrap gap-1", children: e.recipients.map((n) => /* @__PURE__ */ a(
1023
1047
  "span",
1024
1048
  {
1025
- className: b(
1049
+ className: x(
1026
1050
  "inline-flex items-center gap-1 rounded-full border px-1.5 py-px text-[10.5px]",
1027
- a.read ? "border-emerald-200 bg-emerald-50/70 text-emerald-700 dark:border-emerald-900/40 dark:bg-emerald-900/10 dark:text-emerald-300" : "border-slate-200 bg-slate-50 text-slate-500 dark:border-border dark:bg-muted dark:text-slate-400"
1051
+ n.read ? "border-emerald-200 bg-emerald-50/70 text-emerald-700 dark:border-emerald-900/40 dark:bg-emerald-900/10 dark:text-emerald-300" : "border-slate-200 bg-slate-50 text-slate-500 dark:border-border dark:bg-muted dark:text-slate-400"
1028
1052
  ),
1029
- "data-nvr-receipt": a.read ? "read" : "unread",
1030
- "data-nvr-ack": a.ack ?? void 0,
1031
- "data-tip": a.ack === "acked" ? `Acknowledged${a.ack_at ? ` ${new Date(a.ack_at).toLocaleString()}` : ""}` : a.ack === "pending" ? "Has not acknowledged yet" : a.read && a.read_at ? `Read ${new Date(a.read_at).toLocaleString()}` : a.read ? "Read" : "Not read yet",
1053
+ "data-nvr-receipt": n.read ? "read" : "unread",
1054
+ "data-nvr-ack": n.ack ?? void 0,
1055
+ "data-tip": n.ack === "acked" ? `Acknowledged${n.ack_at ? ` ${new Date(n.ack_at).toLocaleString()}` : ""}` : n.ack === "pending" ? "Has not acknowledged yet" : n.read && n.read_at ? `Read ${new Date(n.read_at).toLocaleString()}` : n.read ? "Read" : "Not read yet",
1032
1056
  children: [
1033
1057
  /* @__PURE__ */ t(
1034
1058
  "span",
1035
1059
  {
1036
- className: b(
1060
+ className: x(
1037
1061
  "h-1.5 w-1.5 rounded-full",
1038
- a.read ? "bg-emerald-500" : "bg-slate-300 dark:bg-slate-600"
1062
+ n.read ? "bg-emerald-500" : "bg-slate-300 dark:bg-slate-600"
1039
1063
  )
1040
1064
  }
1041
1065
  ),
1042
- a.name,
1043
- a.ack === "acked" && /* @__PURE__ */ t(ue, { className: "h-3 w-3" })
1066
+ n.name,
1067
+ n.ack === "acked" && /* @__PURE__ */ t(he, { className: "h-3 w-3" })
1044
1068
  ]
1045
1069
  },
1046
- a.id
1070
+ n.id
1047
1071
  )) })
1048
1072
  ] }, e.key)) })
1049
- ] }) : st ? /* @__PURE__ */ t("p", { className: "px-8 py-10 text-[13px] text-slate-400", children: "Loading…" }) : T.length === 0 && B.length === 0 && z.length === 0 ? /* @__PURE__ */ n("div", { className: "flex flex-col items-center justify-center py-24 text-center", children: [
1050
- /* @__PURE__ */ t(Le, { className: "h-10 w-10 text-slate-200 dark:text-slate-700" }),
1073
+ ] }) : ot ? /* @__PURE__ */ t("p", { className: "px-8 py-10 text-[13px] text-slate-400", children: "Loading…" }) : L.length === 0 && j.length === 0 && z.length === 0 ? /* @__PURE__ */ a("div", { className: "flex flex-col items-center justify-center py-24 text-center", children: [
1074
+ /* @__PURE__ */ t(Re, { className: "h-10 w-10 text-slate-200 dark:text-slate-700" }),
1051
1075
  /* @__PURE__ */ t("p", { className: "mt-3 text-[14px] font-medium text-slate-500", children: "You're all caught up" }),
1052
- /* @__PURE__ */ t("p", { className: "mt-1 text-[12px] text-slate-400", children: i === "inbox" ? "No unread notifications." : "No notifications here." })
1053
- ] }) : /* @__PURE__ */ t(qe, { children: /* @__PURE__ */ n(
1076
+ /* @__PURE__ */ t("p", { className: "mt-1 text-[12px] text-slate-400", children: d === "inbox" ? "No unread notifications." : "No notifications here." })
1077
+ ] }) : /* @__PURE__ */ t(ue, { children: /* @__PURE__ */ a(
1054
1078
  "div",
1055
1079
  {
1056
- ref: pt,
1057
- className: "mx-8 my-6 divide-y divide-slate-100 overflow-hidden rounded-lg border border-slate-200 bg-white dark:divide-border dark:border-border dark:bg-card",
1080
+ ref: ht,
1081
+ className: "mx-4 my-6 divide-y sm:mx-8 divide-slate-100 overflow-hidden rounded-lg border border-slate-200 bg-white dark:divide-border dark:border-border dark:bg-card",
1058
1082
  children: [
1059
- z.length > 0 && /* @__PURE__ */ n("div", { "data-notification-pinned": !0, children: [
1060
- /* @__PURE__ */ n("div", { className: "bg-amber-50 px-4 py-1 text-[10.5px] font-semibold uppercase tracking-wide text-amber-700 dark:bg-amber-400/10 dark:text-amber-300", children: [
1083
+ z.length > 0 && /* @__PURE__ */ a("div", { "data-notification-pinned": !0, children: [
1084
+ /* @__PURE__ */ a("div", { className: "bg-amber-50 px-4 py-1 text-[10.5px] font-semibold uppercase tracking-wide text-amber-700 dark:bg-amber-400/10 dark:text-amber-300", children: [
1061
1085
  "Needs your acknowledgement · ",
1062
1086
  z.length
1063
1087
  ] }),
1064
- z.map((e) => /* @__PURE__ */ t(pe, { children: se(e) }, `pin:${e.id}`))
1088
+ z.map((e) => /* @__PURE__ */ t(xe, { children: ce(e) }, `pin:${e.id}`))
1065
1089
  ] }),
1066
- mt.map(yt),
1067
- _e.map((e, a) => {
1068
- const l = (_) => {
1069
- if (!_) return "Older";
1070
- const o = new Date(_), f = /* @__PURE__ */ new Date(), g = new Date(f.getFullYear(), f.getMonth(), f.getDate());
1071
- return o >= g ? "Today" : o >= new Date(g.getTime() - 864e5) ? "Yesterday" : o >= new Date(g.getTime() - 5184e5) ? "This week" : "Older";
1072
- }, s = l(e.created_at), x = a > 0 ? l(_e[a - 1].created_at) : null;
1073
- return /* @__PURE__ */ n(pe, { children: [
1074
- s !== x ? /* @__PURE__ */ t("div", { className: "bg-slate-50/80 px-4 py-1 text-[10.5px] font-semibold uppercase tracking-wide text-slate-400 dark:bg-muted/40", children: s }) : null,
1075
- /* @__PURE__ */ t("div", { "data-live-key": Be(e), children: se(e) })
1090
+ pt.map(wt),
1091
+ De.map((e, n) => {
1092
+ const l = (A) => {
1093
+ if (!A) return "Older";
1094
+ const c = new Date(A), v = /* @__PURE__ */ new Date(), y = new Date(v.getFullYear(), v.getMonth(), v.getDate());
1095
+ return c >= y ? "Today" : c >= new Date(y.getTime() - 864e5) ? "Yesterday" : c >= new Date(y.getTime() - 5184e5) ? "This week" : "Older";
1096
+ }, s = l(e.created_at), k = n > 0 ? l(De[n - 1].created_at) : null;
1097
+ return /* @__PURE__ */ a(xe, { children: [
1098
+ s !== k ? /* @__PURE__ */ t("div", { className: "bg-slate-50/80 px-4 py-1 text-[10.5px] font-semibold uppercase tracking-wide text-slate-400 dark:bg-muted/40", children: s }) : null,
1099
+ /* @__PURE__ */ t("div", { "data-live-key": Ge(e), children: ce(e) })
1076
1100
  ] }, e.id);
1077
1101
  })
1078
1102
  ]
1079
1103
  }
1080
1104
  ) }),
1081
- i !== "sent" && $ > xe && /* @__PURE__ */ n("div", { className: "mx-8 mb-6 flex items-center justify-between", children: [
1082
- /* @__PURE__ */ n("p", { className: "text-[12px] text-slate-400", children: [
1105
+ d !== "sent" && F > ke && /* @__PURE__ */ a("div", { className: "mx-8 mb-6 flex items-center justify-between", children: [
1106
+ /* @__PURE__ */ a("p", { className: "text-[12px] text-slate-400", children: [
1083
1107
  "Page ",
1084
- S,
1108
+ _,
1085
1109
  " of ",
1086
- ae
1110
+ le
1087
1111
  ] }),
1088
- /* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
1089
- /* @__PURE__ */ n(
1112
+ /* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
1113
+ /* @__PURE__ */ a(
1090
1114
  "button",
1091
1115
  {
1092
1116
  type: "button",
1093
- disabled: S <= 1,
1094
- onClick: () => F((e) => Math.max(1, e - 1)),
1117
+ disabled: _ <= 1,
1118
+ onClick: () => q((e) => Math.max(1, e - 1)),
1095
1119
  className: "inline-flex h-7 items-center rounded-md border border-slate-200 px-2 text-[12px] disabled:opacity-40 dark:border-border",
1096
1120
  children: [
1097
- /* @__PURE__ */ t(Dt, { className: "mr-1 h-3.5 w-3.5" }),
1121
+ /* @__PURE__ */ t($t, { className: "mr-1 h-3.5 w-3.5" }),
1098
1122
  "Previous"
1099
1123
  ]
1100
1124
  }
1101
1125
  ),
1102
- /* @__PURE__ */ n(
1126
+ /* @__PURE__ */ a(
1103
1127
  "button",
1104
1128
  {
1105
1129
  type: "button",
1106
- disabled: S >= ae,
1107
- onClick: () => F((e) => Math.min(ae, e + 1)),
1130
+ disabled: _ >= le,
1131
+ onClick: () => q((e) => Math.min(le, e + 1)),
1108
1132
  className: "inline-flex h-7 items-center rounded-md border border-slate-200 px-2 text-[12px] disabled:opacity-40 dark:border-border",
1109
1133
  children: [
1110
1134
  "Next",
@@ -1116,19 +1140,37 @@ function Sa({
1116
1140
  ] })
1117
1141
  ] }),
1118
1142
  /* @__PURE__ */ t(
1119
- Gt,
1143
+ Vt,
1120
1144
  {
1121
- notificationId: (v == null ? void 0 : v.id) ?? null,
1122
- title: (v == null ? void 0 : v.subject) ?? (v == null ? void 0 : v.title) ?? null,
1123
- onClose: () => ye(null)
1145
+ notificationId: (C == null ? void 0 : C.id) ?? null,
1146
+ title: (C == null ? void 0 : C.subject) ?? (C == null ? void 0 : C.title) ?? null,
1147
+ onClose: () => Ce(null)
1124
1148
  }
1125
1149
  )
1126
1150
  ] });
1127
1151
  }
1128
- function Ue(m) {
1129
- const h = m.replace(/_/g, " ").trim();
1130
- return h ? h.charAt(0).toUpperCase() + h.slice(1) : m;
1152
+ function He(o) {
1153
+ const p = o.replace(/_/g, " ").trim();
1154
+ return p ? p.charAt(0).toUpperCase() + p.slice(1) : o;
1155
+ }
1156
+ function ia({ text: o }) {
1157
+ const p = o.split(`
1158
+ `).map((g) => g.trim()).filter(Boolean);
1159
+ if (p.length <= 1)
1160
+ return /* @__PURE__ */ t("p", { className: "mt-0.5 line-clamp-3 whitespace-pre-line text-[12px] text-slate-500", children: o });
1161
+ const f = p.slice(0, 4);
1162
+ return /* @__PURE__ */ a("div", { className: "mt-0.5 space-y-0.5 text-[12px] text-slate-500", children: [
1163
+ f.map((g, W) => (
1164
+ // biome-ignore lint/suspicious/noArrayIndexKey: static lines of one message
1165
+ /* @__PURE__ */ t("p", { className: "line-clamp-2", children: g }, W)
1166
+ )),
1167
+ p.length > f.length && /* @__PURE__ */ a("p", { className: "text-[11.5px] text-slate-400", children: [
1168
+ "+",
1169
+ p.length - f.length,
1170
+ " more"
1171
+ ] })
1172
+ ] });
1131
1173
  }
1132
1174
  export {
1133
- Sa as NotificationCenterView
1175
+ Aa as NotificationCenterView
1134
1176
  };