@nivaro/react 0.3.56 → 0.3.58

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 (55) hide show
  1. package/dist/full.css +1 -1
  2. package/dist/hooks/useSessionRecorder.js +1 -1
  3. package/dist/index.d.ts +9 -2
  4. package/dist/shared/components/CollectionBrowserView.js +2827 -2750
  5. package/dist/shared/components/DataTable.js +247 -236
  6. package/dist/shared/components/ItemEditForm.js +1693 -1668
  7. package/dist/shared/components/ProfileView.js +716 -715
  8. package/dist/shared/components/RecordReadView.js +367 -364
  9. package/dist/shared/components/ReportView.js +64 -39
  10. package/dist/shared/components/alerts/AlertManagerView.js +284 -271
  11. package/dist/shared/components/cbv/row-focus.js +19 -0
  12. package/dist/shared/components/help-videos/HelpVideoPlayer.js +152 -147
  13. package/dist/shared/components/integrations/console/SignalCard.js +59 -59
  14. package/dist/shared/components/integrations/console/tone.js +52 -30
  15. package/dist/shared/components/item-edit/CatalogPickerField.js +525 -505
  16. package/dist/shared/components/item-edit/FieldRow.js +175 -173
  17. package/dist/shared/components/item-edit/InlineTableField.js +407 -402
  18. package/dist/shared/components/item-edit/M2MCombobox.js +313 -291
  19. package/dist/shared/components/item-edit/MidairCollisionDialog.js +1 -1
  20. package/dist/shared/components/item-edit/PlanGrid.js +826 -803
  21. package/dist/shared/components/item-edit/QuickCreateButton.js +115 -79
  22. package/dist/shared/components/item-edit/RecordLiveSync.js +77 -75
  23. package/dist/shared/components/item-edit/RelationCombobox.js +412 -328
  24. package/dist/shared/components/item-edit/RelationGroupedCombobox.js +147 -125
  25. package/dist/shared/components/item-edit/SummaryPanel.js +406 -392
  26. package/dist/shared/components/item-edit/option-disambiguate.js +44 -32
  27. package/dist/shared/components/item-edit/related-missing.js +45 -0
  28. package/dist/shared/components/item-edit/save-outcome.js +5 -5
  29. package/dist/shared/components/notifications/NotificationRulesEditor.js +130 -123
  30. package/dist/shared/components/panels/AccessDeniedPanel.js +52 -48
  31. package/dist/shared/components/panels/ItemLockBanner.js +2 -3
  32. package/dist/shared/components/panels/PipelinePanel.js +1027 -978
  33. package/dist/shared/components/panels/RevisionsPanel.js +4 -1
  34. package/dist/shared/components/panels/TaskPanel.js +265 -249
  35. package/dist/shared/components/panels/landing-state.js +27 -0
  36. package/dist/shared/components/pipeline/PipelineEditorView.js +86 -78
  37. package/dist/shared/components/profile/AiMemoryCard.js +12 -10
  38. package/dist/shared/components/queue/OwnerAvatars.js +80 -41
  39. package/dist/shared/components/queue/QueueItemSheet.js +111 -111
  40. package/dist/shared/components/queue/QueueQuickFilters.js +48 -48
  41. package/dist/shared/components/queue/QueueWorklist.js +975 -964
  42. package/dist/shared/components/queue/group-sums.js +27 -0
  43. package/dist/shared/components/queue/live-state-aspect.js +7 -3
  44. package/dist/shared/components/queue/path-label.js +14 -0
  45. package/dist/shared/components/widgets/ReviewListWidget.js +186 -168
  46. package/dist/shared/lib/back-closes.js +25 -0
  47. package/dist/shared/lib/cbv-page-warm.js +36 -0
  48. package/dist/shared/lib/form-usage-beacon.js +7 -7
  49. package/dist/shared/lib/list-page-memory.js +41 -0
  50. package/dist/shared/lib/live.js +44 -44
  51. package/dist/shared/lib/own-writes.js +76 -28
  52. package/dist/shared/lib/record-ref.js +78 -53
  53. package/dist/shared/lib/request-gate.js +110 -109
  54. package/dist/shared/lib/validation-rules.js +34 -19
  55. package/package.json +1 -1
@@ -1,96 +1,96 @@
1
- import { jsxs as a, jsx as e, Fragment as X } from "react/jsx-runtime";
2
- import { readUser as he, readUserCard as be, updateUser as oe, readMyScopes as xe, saveMyScopeDefaults as ge, readItems as te } from "@nivaro/sdk";
1
+ import { jsxs as t, jsx as e, Fragment as X } from "react/jsx-runtime";
2
+ import { readUser as be, readUserCard as xe, updateUser as de, readMyScopes as ge, saveMyScopeDefaults as fe, readItems as te } from "@nivaro/sdk";
3
3
  import { useQueryClient as M, useQuery as v, useMutation as w } from "@tanstack/react-query";
4
- import { Loader2 as ie, Camera as fe, Building2 as ye, Mail as ve, Phone as ke, Clock as Ne, Undo2 as we, Check as Se, UserRound as _e, Filter as Ce, LogOut as qe, ShieldCheck as Pe } from "lucide-react";
5
- import { useRef as ue, useEffect as Te, useState as C, useMemo as Ae } from "react";
6
- import { useNivaroClient as A, useItemEditAuth as pe } from "../context.js";
7
- import { get as T, patch as G, post as ee, put as Fe, del as Oe } from "../lib/commands.js";
8
- import { playNotificationSound as de } from "../lib/notification-sound.js";
9
- import { BRAND_ACCENT as ae, parseThemeAccents as De, DEFAULT_THEME_ACCENTS as ce } from "../lib/theme-accents.js";
4
+ import { Loader2 as ce, Camera as ye, Building2 as ve, Mail as ke, Phone as Ne, Clock as we, Undo2 as Se, Check as _e, UserRound as Ce, Filter as qe, LogOut as Pe, ShieldCheck as Ae } from "lucide-react";
5
+ import { useRef as he, useEffect as Te, useState as C, useMemo as Fe } from "react";
6
+ import { useNivaroClient as F, useItemEditAuth as ne } from "../context.js";
7
+ import { get as T, patch as G, post as ee, put as Oe, del as De } from "../lib/commands.js";
8
+ import { playNotificationSound as me } from "../lib/notification-sound.js";
9
+ import { BRAND_ACCENT as ae, parseThemeAccents as Me, DEFAULT_THEME_ACCENTS as ue } from "../lib/theme-accents.js";
10
10
  import { announceLocalPrefs as re } from "../lib/user-sync.js";
11
- import { cn as Q, setDisplayTimezone as Me } from "../lib/utils.js";
12
- import { CustomStatusEditor as Ke, activeCustomStatus as Le } from "./CustomStatusEditor.js";
13
- import { mergeNotifyRulesClient as Re, NOTIFY_RULE_CATS as Ie, NotificationRulesEditor as je } from "./notifications/NotificationRulesEditor.js";
14
- import { TestMyRules as Ee } from "./notifications/TestMyRules.js";
15
- import { AgentsPanel as Qe } from "./profile/AgentsPanel.js";
16
- import { AiMemoryCard as Ue, AiHistoryCard as $e } from "./profile/AiMemoryCard.js";
17
- import { BrowserPushCard as ze } from "./profile/BrowserPushCard.js";
18
- import { DelegationCard as Be } from "./profile/DelegationCard.js";
19
- import { MailSuppressedPill as He } from "./profile/MailSuppressedPill.js";
20
- import { PersonDidPanel as Ye } from "./profile/PersonDidPanel.js";
21
- import { TeamLoadCard as We } from "./profile/PersonExtras.js";
22
- import { TeamsConnect as Ge } from "./profile/TeamsConnect.js";
23
- import { NotificationSourcesCard as Je } from "./NotificationSourcesCard.js";
24
- import { MyDefaultsCard as Ve } from "./profile/MyDefaultsCard.js";
25
- import { UserScopesCard as Ze } from "./profile/PersonAccess.js";
26
- import { PersonProfile as Xe } from "./profile/PersonProfile.js";
27
- import { Toggle as et, SectionCard as ne, Field as H, ConfirmButton as me } from "./profile/primitives.js";
28
- import { SignedInDevices as tt } from "./profile/SignedInDevices.js";
29
- import { SimpleSelectXs as U } from "./ui/SimpleSelect.js";
30
- const at = (s) => [s.first_name, s.last_name].filter(Boolean).join(" ") || (s.email ?? "Unknown"), rt = (s) => {
31
- var u, t;
32
- return (`${((u = s.first_name) == null ? void 0 : u[0]) ?? ""}${((t = s.last_name) == null ? void 0 : t[0]) ?? ""}` || (s.email ?? "?").slice(0, 2)).toUpperCase();
33
- }, nt = Ie;
34
- function st() {
35
- const s = A(), u = M(), { data: t = [] } = v({
11
+ import { cn as j, setDisplayTimezone as Ke } from "../lib/utils.js";
12
+ import { CustomStatusEditor as Le, activeCustomStatus as Re } from "./CustomStatusEditor.js";
13
+ import { mergeNotifyRulesClient as Ie, NOTIFY_RULE_CATS as je, NotificationRulesEditor as Ee } from "./notifications/NotificationRulesEditor.js";
14
+ import { TestMyRules as Qe } from "./notifications/TestMyRules.js";
15
+ import { AgentsPanel as Ue } from "./profile/AgentsPanel.js";
16
+ import { AiMemoryCard as $e, AiHistoryCard as ze } from "./profile/AiMemoryCard.js";
17
+ import { BrowserPushCard as Be } from "./profile/BrowserPushCard.js";
18
+ import { DelegationCard as He } from "./profile/DelegationCard.js";
19
+ import { MailSuppressedPill as Ye } from "./profile/MailSuppressedPill.js";
20
+ import { PersonDidPanel as We } from "./profile/PersonDidPanel.js";
21
+ import { TeamLoadCard as Ge } from "./profile/PersonExtras.js";
22
+ import { TeamsConnect as Je } from "./profile/TeamsConnect.js";
23
+ import { NotificationSourcesCard as Ve } from "./NotificationSourcesCard.js";
24
+ import { MyDefaultsCard as Ze } from "./profile/MyDefaultsCard.js";
25
+ import { UserScopesCard as Xe } from "./profile/PersonAccess.js";
26
+ import { PersonProfile as et } from "./profile/PersonProfile.js";
27
+ import { Toggle as tt, SectionCard as se, Field as H, ConfirmButton as pe } from "./profile/primitives.js";
28
+ import { SignedInDevices as at } from "./profile/SignedInDevices.js";
29
+ import { SimpleSelectXs as E } from "./ui/SimpleSelect.js";
30
+ const rt = (o) => [o.first_name, o.last_name].filter(Boolean).join(" ") || (o.email ?? "Unknown"), nt = (o) => {
31
+ var p, n;
32
+ return (`${((p = o.first_name) == null ? void 0 : p[0]) ?? ""}${((n = o.last_name) == null ? void 0 : n[0]) ?? ""}` || (o.email ?? "?").slice(0, 2)).toUpperCase();
33
+ }, st = je;
34
+ function lt() {
35
+ const o = F(), p = M(), { data: n = [] } = v({
36
36
  queryKey: ["nvr-profile-fields"],
37
- queryFn: () => s.request(T("/profile-fields/mine")).then((r) => r.data ?? []).catch(() => [])
38
- }), [i, o] = C(null), l = w({
39
- mutationFn: (r) => s.request(Fe("/profile-fields/mine", { values: r })),
37
+ queryFn: () => o.request(T("/profile-fields/mine")).then((a) => a.data ?? []).catch(() => [])
38
+ }), [r, s] = C(null), i = w({
39
+ mutationFn: (a) => o.request(Oe("/profile-fields/mine", { values: a })),
40
40
  onSuccess: () => {
41
- o(null), u.invalidateQueries({ queryKey: ["nvr-profile-fields"] });
41
+ s(null), p.invalidateQueries({ queryKey: ["nvr-profile-fields"] });
42
42
  }
43
43
  });
44
- if (t.length === 0) return null;
45
- const c = i ?? Object.fromEntries(t.map((r) => [r.key, r.value ?? ""])), m = (r) => Array.isArray(r) ? r.map(String) : Array.isArray(r == null ? void 0 : r.choices) ? r.choices.map(
44
+ if (n.length === 0) return null;
45
+ const c = r ?? Object.fromEntries(n.map((a) => [a.key, a.value ?? ""])), u = (a) => Array.isArray(a) ? a.map(String) : Array.isArray(a == null ? void 0 : a.choices) ? a.choices.map(
46
46
  (h) => typeof h == "object" && h != null ? String(h.value ?? "") : String(h)
47
47
  ) : [];
48
- return /* @__PURE__ */ a("div", { className: "rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card", children: [
49
- /* @__PURE__ */ a("header", { className: "border-b border-slate-100 px-4 py-2.5 dark:border-border/60", children: [
48
+ return /* @__PURE__ */ t("div", { className: "rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card", children: [
49
+ /* @__PURE__ */ t("header", { className: "border-b border-slate-100 px-4 py-2.5 dark:border-border/60", children: [
50
50
  /* @__PURE__ */ e("h3", { className: "text-[13px] font-semibold text-slate-800 dark:text-slate-100", children: "Profile fields" }),
51
51
  /* @__PURE__ */ e("p", { className: "mt-0.5 text-[11px] text-slate-400", children: "Extra details your organization tracks about people." })
52
52
  ] }),
53
- /* @__PURE__ */ e("div", { className: "grid grid-cols-1 gap-3 p-4 sm:grid-cols-2", children: t.map((r) => /* @__PURE__ */ a("div", { children: [
54
- /* @__PURE__ */ a("p", { className: "mb-1 text-[11px] font-medium text-slate-500", children: [
55
- r.label,
56
- r.required && /* @__PURE__ */ e("span", { className: "ml-0.5 text-red-500", children: "*" })
53
+ /* @__PURE__ */ e("div", { className: "grid grid-cols-1 gap-3 p-4 sm:grid-cols-2", children: n.map((a) => /* @__PURE__ */ t("div", { children: [
54
+ /* @__PURE__ */ t("p", { className: "mb-1 text-[11px] font-medium text-slate-500", children: [
55
+ a.label,
56
+ a.required && /* @__PURE__ */ e("span", { className: "ml-0.5 text-red-500", children: "*" })
57
57
  ] }),
58
- r.type === "boolean" ? /* @__PURE__ */ e(
59
- U,
58
+ a.type === "boolean" ? /* @__PURE__ */ e(
59
+ E,
60
60
  {
61
- value: c[r.key] || "false",
61
+ value: c[a.key] || "false",
62
62
  options: [
63
63
  { value: "true", label: "Yes" },
64
64
  { value: "false", label: "No" }
65
65
  ],
66
- onChange: (h) => o({ ...c, [r.key]: h })
66
+ onChange: (h) => s({ ...c, [a.key]: h })
67
67
  }
68
- ) : r.type === "select" ? /* @__PURE__ */ e(
69
- U,
68
+ ) : a.type === "select" ? /* @__PURE__ */ e(
69
+ E,
70
70
  {
71
- value: c[r.key] || "",
71
+ value: c[a.key] || "",
72
72
  options: [
73
73
  { value: "", label: "—" },
74
- ...m(r.options).map((h) => ({ value: h, label: h }))
74
+ ...u(a.options).map((h) => ({ value: h, label: h }))
75
75
  ],
76
- onChange: (h) => o({ ...c, [r.key]: h })
76
+ onChange: (h) => s({ ...c, [a.key]: h })
77
77
  }
78
78
  ) : /* @__PURE__ */ e(
79
79
  "input",
80
80
  {
81
- type: r.type === "number" ? "number" : r.type === "date" ? "date" : "text",
82
- value: c[r.key] ?? "",
83
- onChange: (h) => o({ ...c, [r.key]: h.target.value }),
81
+ type: a.type === "number" ? "number" : a.type === "date" ? "date" : "text",
82
+ value: c[a.key] ?? "",
83
+ onChange: (h) => s({ ...c, [a.key]: h.target.value }),
84
84
  className: "h-8 w-full rounded-md border border-slate-200 bg-background px-2 text-[12.5px] dark:border-border"
85
85
  }
86
86
  )
87
- ] }, r.key)) }),
88
- i && /* @__PURE__ */ a("div", { className: "flex justify-end gap-2 border-t border-slate-100 px-4 py-2.5 dark:border-border/60", children: [
87
+ ] }, a.key)) }),
88
+ r && /* @__PURE__ */ t("div", { className: "flex justify-end gap-2 border-t border-slate-100 px-4 py-2.5 dark:border-border/60", children: [
89
89
  /* @__PURE__ */ e(
90
90
  "button",
91
91
  {
92
92
  type: "button",
93
- onClick: () => o(null),
93
+ onClick: () => s(null),
94
94
  className: "h-7 rounded-md px-2.5 text-[12px] text-slate-500",
95
95
  children: "Cancel"
96
96
  }
@@ -99,143 +99,143 @@ function st() {
99
99
  "button",
100
100
  {
101
101
  type: "button",
102
- disabled: l.isPending,
103
- onClick: () => l.mutate(c),
102
+ disabled: i.isPending,
103
+ onClick: () => i.mutate(c),
104
104
  className: "h-7 rounded-md bg-nvr-cyan px-3 text-[12px] font-semibold text-white disabled:opacity-50",
105
- children: l.isPending ? "Saving…" : "Save"
105
+ children: i.isPending ? "Saving…" : "Save"
106
106
  }
107
107
  )
108
108
  ] })
109
109
  ] });
110
110
  }
111
- function lt() {
112
- var Y, W, se;
113
- const s = A(), u = M(), { data: t } = v({
111
+ function ot() {
112
+ var W, le, oe;
113
+ const o = F(), p = ne(), n = M(), { data: r } = v({
114
114
  queryKey: ["nvr-profile-prefs"],
115
- queryFn: () => s.request(T("/users/me")).then((n) => {
116
- var b;
117
- return ((b = n.data) == null ? void 0 : b.preferences) ?? {};
115
+ queryFn: () => o.request(T("/users/me")).then((l) => {
116
+ var x;
117
+ return ((x = l.data) == null ? void 0 : x.preferences) ?? {};
118
118
  })
119
- }), { data: i } = v({
119
+ }), { data: s } = v({
120
120
  queryKey: ["nvr-profile-teams"],
121
- queryFn: () => s.request(T("/users/me")).then((n) => {
122
- var b, N;
121
+ queryFn: () => o.request(T("/users/me")).then((l) => {
122
+ var x, N;
123
123
  return {
124
- available: ((b = n.data) == null ? void 0 : b.teams_available) === !0,
125
- link: ((N = n.data) == null ? void 0 : N.teams_link) ?? null
124
+ available: ((x = l.data) == null ? void 0 : x.teams_available) === !0,
125
+ link: ((N = l.data) == null ? void 0 : N.teams_link) ?? null
126
126
  };
127
127
  })
128
- }), o = (i == null ? void 0 : i.available) === !0, l = ((Y = i == null ? void 0 : i.link) == null ? void 0 : Y.status) === "active", c = ue(null), m = t != null;
128
+ }), i = (s == null ? void 0 : s.available) === !0, c = ((W = s == null ? void 0 : s.link) == null ? void 0 : W.status) === "active", u = he(null), a = r != null;
129
129
  Te(() => {
130
- var n;
131
- !m || typeof window > "u" || window.location.hash === "#notification-rules" && ((n = c.current) == null || n.scrollIntoView({ block: "start", behavior: "smooth" }));
132
- }, [m]);
133
- const r = (t == null ? void 0 : t.notification_prefs) ?? {}, { data: h } = v({
130
+ var l;
131
+ !a || typeof window > "u" || window.location.hash === "#notification-rules" && ((l = u.current) == null || l.scrollIntoView({ block: "start", behavior: "smooth" }));
132
+ }, [a]);
133
+ const h = (r == null ? void 0 : r.notification_prefs) ?? {}, { data: m } = v({
134
134
  queryKey: ["nvr-my-rule-defaults"],
135
- queryFn: () => s.request(T("/notifications/my-rule-defaults")).then((n) => n.data).catch(() => null),
135
+ queryFn: () => o.request(T("/notifications/my-rule-defaults")).then((l) => l.data).catch(() => null),
136
136
  staleTime: 6e4
137
- }), p = (t == null ? void 0 : t.email_digest) === "daily" ? "daily" : "instant", S = Re(r, h != null && h.role ? h.rules : null), k = (n) => {
138
- var b, N, B, le;
139
- return ((N = (b = r.matrix) == null ? void 0 : b[n]) == null ? void 0 : N.email) ?? (p === "daily" ? "daily" : ((le = (B = S.matrix) == null ? void 0 : B[n]) == null ? void 0 : le.email) ?? p);
140
- }, F = w({
141
- mutationFn: (n) => s.request(G("/users/me/preferences", { notification_prefs: n })),
137
+ }), S = (r == null ? void 0 : r.email_digest) === "daily" ? "daily" : "instant", k = Ie(h, m != null && m.role ? m.rules : null), O = (l) => {
138
+ var x, N, B, ie;
139
+ return ((N = (x = h.matrix) == null ? void 0 : x[l]) == null ? void 0 : N.email) ?? (S === "daily" ? "daily" : ((ie = (B = k.matrix) == null ? void 0 : B[l]) == null ? void 0 : ie.email) ?? S);
140
+ }, y = w({
141
+ mutationFn: (l) => o.request(G("/users/me/preferences", { notification_prefs: l })),
142
142
  onSuccess: () => {
143
- u.invalidateQueries({ queryKey: ["nvr-profile-prefs"] }), re(["notification_prefs"]);
143
+ n.invalidateQueries({ queryKey: ["nvr-profile-prefs"] }), re(["notification_prefs"]);
144
144
  }
145
- }), f = w({
146
- mutationFn: (n) => s.request(G("/users/me/preferences", n)),
147
- onSuccess: (n, b) => {
148
- u.invalidateQueries({ queryKey: ["nvr-profile-prefs"] }), re(Object.keys(b));
145
+ }), q = w({
146
+ mutationFn: (l) => o.request(G("/users/me/preferences", l)),
147
+ onSuccess: (l, x) => {
148
+ n.invalidateQueries({ queryKey: ["nvr-profile-prefs"] }), re(Object.keys(x));
149
149
  }
150
- }), [_, O] = C(null), q = w({
151
- mutationFn: (n) => s.request(ee("/notifications/rules-preview", { notification_prefs: n })),
152
- onSuccess: (n) => O({
153
- total: n.data.total_notifications,
154
- current: n.data.current,
155
- proposed: n.data.proposed
150
+ }), [_, P] = C(null), g = w({
151
+ mutationFn: (l) => o.request(ee("/notifications/rules-preview", { notification_prefs: l })),
152
+ onSuccess: (l) => P({
153
+ total: l.data.total_notifications,
154
+ current: l.data.current,
155
+ proposed: l.data.proposed
156
156
  })
157
- }), g = (n) => {
158
- const b = {
159
- ...n,
157
+ }), Q = (l) => {
158
+ const x = {
159
+ ...l,
160
160
  // Kept as-is: "mute 1h" said to the bot lives here, and a save must not wipe it.
161
- ...r.teams_muted_until ? { teams_muted_until: r.teams_muted_until } : {}
161
+ ...h.teams_muted_until ? { teams_muted_until: h.teams_muted_until } : {}
162
162
  };
163
- q.mutate(b), F.mutate(b);
164
- }, $ = (n) => g({ ...r, ...n }), K = (t == null ? void 0 : t.notification_sounds) ?? {}, x = (n, b) => {
165
- const N = { ...K };
166
- b === "default" ? delete N[n] : N[n] = b, b !== "default" && de(b, { preview: !0 }), f.mutate({ notification_sounds: Object.keys(N).length ? N : null });
167
- }, { data: R } = v({
163
+ g.mutate(x), y.mutate(x);
164
+ }, K = (l) => Q({ ...h, ...l }), b = (r == null ? void 0 : r.notification_sounds) ?? {}, R = (l, x) => {
165
+ const N = { ...b };
166
+ x === "default" ? delete N[l] : N[l] = x, x !== "default" && me(x, { preview: !0 }), q.mutate({ notification_sounds: Object.keys(N).length ? N : null });
167
+ }, { data: U } = v({
168
168
  queryKey: ["nvr-noise-suggestions"],
169
- queryFn: () => s.request(T("/notifications/noise-suggestions")).then((n) => n.data ?? []),
169
+ queryFn: () => o.request(T("/notifications/noise-suggestions")).then((l) => l.data ?? []),
170
170
  staleTime: 6e5
171
- }), [I, j] = C({}), [d, y] = C(() => {
171
+ }), [I, d] = C({}), [f, A] = C(() => {
172
172
  try {
173
- const n = JSON.parse(localStorage.getItem("nvr-noise-dismissed") ?? "null");
174
- return n && Date.now() - n.at < 30 * 864e5 ? n.cats : [];
173
+ const l = JSON.parse(localStorage.getItem("nvr-noise-dismissed") ?? "null");
174
+ return l && Date.now() - l.at < 30 * 864e5 ? l.cats : [];
175
175
  } catch {
176
176
  return [];
177
177
  }
178
- }), P = (n) => {
179
- const b = [...d, n];
180
- y(b);
178
+ }), J = (l) => {
179
+ const x = [...f, l];
180
+ A(x);
181
181
  try {
182
- localStorage.setItem("nvr-noise-dismissed", JSON.stringify({ at: Date.now(), cats: b }));
182
+ localStorage.setItem("nvr-noise-dismissed", JSON.stringify({ at: Date.now(), cats: x }));
183
183
  } catch {
184
184
  }
185
- }, J = Number.isInteger(Number(t == null ? void 0 : t.digest_hour)) ? Number(t == null ? void 0 : t.digest_hour) : 7, D = (n) => `${n % 12 === 0 ? 12 : n % 12}:45 ${n < 12 ? "AM" : "PM"}`, [z, L] = C(null), E = w({
186
- mutationFn: () => s.request(ee("/users/me/digest-test", {})),
187
- onSuccess: (n) => L(n.data.note),
188
- onError: () => L("Test send failed — try again.")
189
- }), V = nt.some((n) => k(n.key) === "daily"), Z = ({ text: n }) => /* @__PURE__ */ e(
185
+ }, D = Number.isInteger(Number(r == null ? void 0 : r.digest_hour)) ? Number(r == null ? void 0 : r.digest_hour) : 7, Y = (l) => `${l % 12 === 0 ? 12 : l % 12}:45 ${l < 12 ? "AM" : "PM"}`, [L, $] = C(null), z = w({
186
+ mutationFn: () => o.request(ee("/users/me/digest-test", {})),
187
+ onSuccess: (l) => $(l.data.note),
188
+ onError: () => $("Test send failed — try again.")
189
+ }), V = st.some((l) => O(l.key) === "daily"), Z = ({ text: l }) => /* @__PURE__ */ e(
190
190
  "span",
191
191
  {
192
192
  className: "ml-1 inline-flex h-3.5 w-3.5 cursor-help items-center justify-center rounded-full border border-slate-300 text-[9px] font-semibold normal-case tracking-normal text-slate-400 dark:border-border",
193
193
  role: "img",
194
- title: n,
195
- "data-tip": n,
196
- "aria-label": n,
194
+ title: l,
195
+ "data-tip": l,
196
+ "aria-label": l,
197
197
  children: "?"
198
198
  }
199
199
  );
200
- return /* @__PURE__ */ a(
200
+ return /* @__PURE__ */ t(
201
201
  "div",
202
202
  {
203
203
  id: "notification-rules",
204
- ref: c,
204
+ ref: u,
205
205
  "data-profile-card": "notifications",
206
206
  className: "rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card",
207
207
  children: [
208
- /* @__PURE__ */ a("header", { className: "border-b border-slate-100 px-4 py-2.5 dark:border-border/60", children: [
208
+ /* @__PURE__ */ t("header", { className: "border-b border-slate-100 px-4 py-2.5 dark:border-border/60", children: [
209
209
  /* @__PURE__ */ e("h3", { className: "text-[13px] font-semibold text-slate-800 dark:text-slate-100", children: "Notification rules" }),
210
210
  /* @__PURE__ */ e("p", { className: "mt-0.5 text-[11px] text-slate-400", children: "Per category: whether it lands in your in-app inbox, whether your browser pushes it, and how it reaches your email — each one as it happens, folded into the daily action summary, or not at all. Quiet hours pause pushes and hold emails until morning unless a category is let through them; critical alerts (SLA escalations, maintenance, monitor failures) always get through." })
211
211
  ] }),
212
- /* @__PURE__ */ a("div", { className: "space-y-3 p-4", children: [
213
- (R ?? []).filter((n) => !d.includes(n.category)).map((n) => /* @__PURE__ */ a(
212
+ /* @__PURE__ */ t("div", { className: "space-y-3 p-4", children: [
213
+ (U ?? []).filter((l) => !f.includes(l.category)).map((l) => /* @__PURE__ */ t(
214
214
  "div",
215
215
  {
216
- "data-noise-suggestion": n.category,
216
+ "data-noise-suggestion": l.category,
217
217
  className: "flex flex-wrap items-center gap-2 rounded-md border border-amber-200 bg-amber-50 px-3 py-2 text-[12px] text-amber-900 dark:border-amber-900/50 dark:bg-amber-950/30 dark:text-amber-200",
218
218
  children: [
219
- /* @__PURE__ */ a("span", { className: "min-w-0 flex-1", children: [
220
- n.message,
219
+ /* @__PURE__ */ t("span", { className: "min-w-0 flex-1", children: [
220
+ l.message,
221
221
  " Mute them?"
222
222
  ] }),
223
- n.category in I ? /* @__PURE__ */ e(
223
+ l.category in I ? /* @__PURE__ */ e(
224
224
  "button",
225
225
  {
226
226
  type: "button",
227
227
  className: "underline",
228
228
  onClick: () => {
229
- $({
229
+ K({
230
230
  matrix: {
231
- ...r.matrix ?? {},
232
- [n.category]: I[n.category]
231
+ ...h.matrix ?? {},
232
+ [l.category]: I[l.category]
233
233
  }
234
- }), j(({ [n.category]: b, ...N }) => N);
234
+ }), d(({ [l.category]: x, ...N }) => N);
235
235
  },
236
236
  children: "Muted — undo"
237
237
  }
238
- ) : /* @__PURE__ */ a(X, { children: [
238
+ ) : /* @__PURE__ */ t(X, { children: [
239
239
  /* @__PURE__ */ e(
240
240
  "button",
241
241
  {
@@ -243,30 +243,30 @@ function lt() {
243
243
  className: "rounded border border-amber-300 px-2 py-0.5 font-medium dark:border-amber-800",
244
244
  onClick: () => {
245
245
  var N;
246
- const b = ((N = r.matrix) == null ? void 0 : N[n.category]) ?? { inapp: !0, push: !0 };
247
- j((B) => ({ ...B, [n.category]: b })), $({
246
+ const x = ((N = h.matrix) == null ? void 0 : N[l.category]) ?? { inapp: !0, push: !0 };
247
+ d((B) => ({ ...B, [l.category]: x })), K({
248
248
  matrix: {
249
- ...r.matrix ?? {},
250
- [n.category]: { ...b, inapp: !1, push: !1 }
249
+ ...h.matrix ?? {},
250
+ [l.category]: { ...x, inapp: !1, push: !1 }
251
251
  }
252
252
  });
253
253
  },
254
254
  children: "Mute"
255
255
  }
256
256
  ),
257
- /* @__PURE__ */ e("button", { type: "button", className: "underline", onClick: () => P(n.category), children: "Not now" })
257
+ /* @__PURE__ */ e("button", { type: "button", className: "underline", onClick: () => J(l.category), children: "Not now" })
258
258
  ] })
259
259
  ]
260
260
  },
261
- n.category
261
+ l.category
262
262
  )),
263
- _ && _.total > 0 && /* @__PURE__ */ a(
263
+ _ && _.total > 0 && /* @__PURE__ */ t(
264
264
  "div",
265
265
  {
266
266
  "data-rules-preview": !0,
267
267
  className: "flex flex-wrap items-center gap-2 rounded-md border border-slate-200 bg-slate-50 px-3 py-2 text-[12px] text-slate-600 dark:border-border dark:bg-background/40 dark:text-muted-foreground",
268
268
  children: [
269
- /* @__PURE__ */ a("span", { className: "min-w-0 flex-1", children: [
269
+ /* @__PURE__ */ t("span", { className: "min-w-0 flex-1", children: [
270
270
  "Last week with this change: ",
271
271
  _.proposed.inapp,
272
272
  " in-app instead of",
@@ -284,36 +284,36 @@ function lt() {
284
284
  _.current.push,
285
285
  "."
286
286
  ] }),
287
- /* @__PURE__ */ e("button", { type: "button", className: "underline", onClick: () => O(null), children: "Dismiss" })
287
+ /* @__PURE__ */ e("button", { type: "button", className: "underline", onClick: () => P(null), children: "Dismiss" })
288
288
  ]
289
289
  }
290
290
  ),
291
- /* @__PURE__ */ a("div", { className: "flex flex-wrap items-center gap-2 text-[12.5px] text-slate-600 dark:text-muted-foreground", children: [
291
+ /* @__PURE__ */ t("div", { className: "flex flex-wrap items-center gap-2 text-[12.5px] text-slate-600 dark:text-muted-foreground", children: [
292
292
  "Sound:",
293
293
  /* @__PURE__ */ e(
294
- U,
294
+ E,
295
295
  {
296
- value: String((t == null ? void 0 : t.notification_sound) ?? "off"),
296
+ value: String((r == null ? void 0 : r.notification_sound) ?? "off"),
297
297
  options: [
298
298
  { value: "off", label: "Off" },
299
299
  { value: "subtle", label: "Subtle blip" },
300
300
  { value: "chime", label: "Chime" }
301
301
  ],
302
- onChange: (n) => {
303
- de(n, { preview: !0 }), f.mutate({ notification_sound: n });
302
+ onChange: (l) => {
303
+ me(l, { preview: !0 }), q.mutate({ notification_sound: l });
304
304
  }
305
305
  }
306
306
  ),
307
307
  /* @__PURE__ */ e("span", { className: "text-[11px] text-slate-400", children: "plays when a notification or a direct message arrives" }),
308
- /* @__PURE__ */ e("span", { className: "ml-auto", children: /* @__PURE__ */ e(Ee, {}) })
308
+ /* @__PURE__ */ e("span", { className: "ml-auto", children: /* @__PURE__ */ e(Qe, {}) })
309
309
  ] }),
310
- /* @__PURE__ */ a("div", { className: "flex flex-wrap items-center gap-2 text-[12.5px] text-slate-600 dark:text-muted-foreground", children: [
310
+ /* @__PURE__ */ t("div", { className: "flex flex-wrap items-center gap-2 text-[12.5px] text-slate-600 dark:text-muted-foreground", children: [
311
311
  /* @__PURE__ */ e(
312
- et,
312
+ tt,
313
313
  {
314
- on: (t == null ? void 0 : t.huddle_hold_notifications) !== !1,
315
- onChange: () => f.mutate({
316
- huddle_hold_notifications: (t == null ? void 0 : t.huddle_hold_notifications) === !1
314
+ on: (r == null ? void 0 : r.huddle_hold_notifications) !== !1,
315
+ onChange: () => q.mutate({
316
+ huddle_hold_notifications: (r == null ? void 0 : r.huddle_hold_notifications) === !1
317
317
  }),
318
318
  label: "Hold notifications during huddles"
319
319
  }
@@ -322,75 +322,76 @@ function lt() {
322
322
  /* @__PURE__ */ e("span", { className: "text-[11px] text-slate-400", children: "toasts and sounds wait while you talk; you get one summary when you leave" })
323
323
  ] }),
324
324
  /* @__PURE__ */ e(
325
- je,
325
+ Ee,
326
326
  {
327
327
  subject: "person",
328
- value: r,
329
- inherited: h != null && h.role ? h.rules : null,
330
- inheritedName: ((W = h == null ? void 0 : h.role) == null ? void 0 : W.name) ?? null,
331
- legacyEmail: p,
332
- saving: F.isPending,
333
- onCommit: (n) => g(n),
334
- onLegacyEmail: (n) => f.mutate({ email_digest: n }),
335
- teams: o ? {
328
+ isAdmin: p.isAdmin,
329
+ value: h,
330
+ inherited: m != null && m.role ? m.rules : null,
331
+ inheritedName: ((le = m == null ? void 0 : m.role) == null ? void 0 : le.name) ?? null,
332
+ legacyEmail: S,
333
+ saving: y.isPending,
334
+ onCommit: (l) => Q(l),
335
+ onLegacyEmail: (l) => q.mutate({ email_digest: l }),
336
+ teams: i ? {
336
337
  available: !0,
337
- linked: l,
338
- header: /* @__PURE__ */ e("div", { className: "mt-0.5", children: /* @__PURE__ */ e(Ge, { linked: l, linkedAt: (se = i == null ? void 0 : i.link) == null ? void 0 : se.linked_at }) })
338
+ linked: c,
339
+ header: /* @__PURE__ */ e("div", { className: "mt-0.5", children: /* @__PURE__ */ e(Je, { linked: c, linkedAt: (oe = s == null ? void 0 : s.link) == null ? void 0 : oe.linked_at }) })
339
340
  } : null,
340
341
  extraColumn: {
341
- header: /* @__PURE__ */ a(X, { children: [
342
+ header: /* @__PURE__ */ t(X, { children: [
342
343
  "Sound",
343
344
  /* @__PURE__ */ e(Z, { text: "A different sound for this category, or none. Default follows the Sound setting above." })
344
345
  ] }),
345
- cell: (n, b) => /* @__PURE__ */ e("div", { className: "inline-block", children: /* @__PURE__ */ e(
346
- U,
346
+ cell: (l, x) => /* @__PURE__ */ e("div", { className: "inline-block", children: /* @__PURE__ */ e(
347
+ E,
347
348
  {
348
- ariaLabel: `Sound for ${b}`,
349
- value: K[n] ?? "default",
349
+ ariaLabel: `Sound for ${x}`,
350
+ value: b[l] ?? "default",
350
351
  options: [
351
352
  { value: "default", label: "Default" },
352
353
  { value: "off", label: "None" },
353
354
  { value: "subtle", label: "Subtle blip" },
354
355
  { value: "chime", label: "Chime" }
355
356
  ],
356
- onChange: (N) => x(n, N)
357
+ onChange: (N) => R(l, N)
357
358
  }
358
359
  ) })
359
360
  }
360
361
  }
361
362
  ),
362
- /* @__PURE__ */ a("div", { className: "space-y-2 rounded-md border border-slate-100 bg-slate-50/60 px-3 py-2 dark:border-border/60 dark:bg-background/40", children: [
363
- /* @__PURE__ */ a("p", { className: "text-[12px] font-medium text-slate-700 dark:text-foreground", children: [
363
+ /* @__PURE__ */ t("div", { className: "space-y-2 rounded-md border border-slate-100 bg-slate-50/60 px-3 py-2 dark:border-border/60 dark:bg-background/40", children: [
364
+ /* @__PURE__ */ t("p", { className: "text-[12px] font-medium text-slate-700 dark:text-foreground", children: [
364
365
  "Daily action summary",
365
- /* @__PURE__ */ a("span", { className: "ml-1.5 text-[11px] font-normal text-slate-400", children: [
366
+ /* @__PURE__ */ t("span", { className: "ml-1.5 text-[11px] font-normal text-slate-400", children: [
366
367
  "one morning email — every category set to Daily summary, plus items assigned to you and invoices awaiting your review",
367
368
  !V && " · nothing is set to Daily summary yet"
368
369
  ] })
369
370
  ] }),
370
- /* @__PURE__ */ a("div", { className: "flex flex-wrap items-center gap-x-4 gap-y-2 text-[12px] text-slate-600 dark:text-muted-foreground", children: [
371
- /* @__PURE__ */ a("span", { className: "flex items-center gap-1.5", children: [
371
+ /* @__PURE__ */ t("div", { className: "flex flex-wrap items-center gap-x-4 gap-y-2 text-[12px] text-slate-600 dark:text-muted-foreground", children: [
372
+ /* @__PURE__ */ t("span", { className: "flex items-center gap-1.5", children: [
372
373
  "Deliver at",
373
374
  /* @__PURE__ */ e(
374
- U,
375
+ E,
375
376
  {
376
377
  ariaLabel: "Digest delivery hour",
377
- value: String(J),
378
- onChange: (n) => f.mutate({ digest_hour: Number(n) }),
379
- options: Array.from({ length: 24 }, (n, b) => ({
380
- value: String(b),
381
- label: D(b)
378
+ value: String(D),
379
+ onChange: (l) => q.mutate({ digest_hour: Number(l) }),
380
+ options: Array.from({ length: 24 }, (l, x) => ({
381
+ value: String(x),
382
+ label: Y(x)
382
383
  }))
383
384
  }
384
385
  ),
385
386
  /* @__PURE__ */ e("span", { className: "text-[11px] text-slate-400", children: "Eastern time" })
386
387
  ] }),
387
- /* @__PURE__ */ a("label", { className: "flex cursor-pointer items-center gap-1.5", children: [
388
+ /* @__PURE__ */ t("label", { className: "flex cursor-pointer items-center gap-1.5", children: [
388
389
  /* @__PURE__ */ e(
389
390
  "input",
390
391
  {
391
392
  type: "checkbox",
392
- checked: (t == null ? void 0 : t.digest_layout) === "compact",
393
- onChange: (n) => f.mutate({ digest_layout: n.target.checked ? "compact" : "detailed" }),
393
+ checked: (r == null ? void 0 : r.digest_layout) === "compact",
394
+ onChange: (l) => q.mutate({ digest_layout: l.target.checked ? "compact" : "detailed" }),
394
395
  className: "rounded"
395
396
  }
396
397
  ),
@@ -400,40 +401,40 @@ function lt() {
400
401
  "button",
401
402
  {
402
403
  type: "button",
403
- disabled: E.isPending,
404
- onClick: () => E.mutate(),
404
+ disabled: z.isPending,
405
+ onClick: () => z.mutate(),
405
406
  className: "text-[12px] text-slate-500 underline decoration-dotted underline-offset-2 hover:text-slate-700 disabled:opacity-50 dark:text-slate-400 dark:hover:text-slate-200",
406
- children: E.isPending ? "Building…" : "Send me a test summary now"
407
+ children: z.isPending ? "Building…" : "Send me a test summary now"
407
408
  }
408
409
  ),
409
- z && /* @__PURE__ */ e("span", { className: "text-[11.5px] text-slate-400", children: z })
410
+ L && /* @__PURE__ */ e("span", { className: "text-[11.5px] text-slate-400", children: L })
410
411
  ] })
411
412
  ] }),
412
- /* @__PURE__ */ a("div", { className: "flex flex-wrap items-center gap-4 border-t border-slate-100 pt-3 text-[12.5px] text-slate-600 dark:border-border/60 dark:text-muted-foreground", children: [
413
+ /* @__PURE__ */ t("div", { className: "flex flex-wrap items-center gap-4 border-t border-slate-100 pt-3 text-[12.5px] text-slate-600 dark:border-border/60 dark:text-muted-foreground", children: [
413
414
  /* @__PURE__ */ e("span", { className: "text-[11.5px] text-slate-400", children: "Auto-watch records I…" }),
414
415
  [
415
416
  ["created", "create"],
416
417
  ["commented", "comment on"],
417
418
  ["transitioned", "move through a workflow"]
418
- ].map(([n, b]) => {
419
+ ].map(([l, x]) => {
419
420
  var N;
420
- return /* @__PURE__ */ a("label", { className: "flex cursor-pointer items-center gap-1.5", children: [
421
+ return /* @__PURE__ */ t("label", { className: "flex cursor-pointer items-center gap-1.5", children: [
421
422
  /* @__PURE__ */ e(
422
423
  "input",
423
424
  {
424
425
  type: "checkbox",
425
- checked: ((N = t == null ? void 0 : t.auto_watch) == null ? void 0 : N[n]) === !0,
426
- onChange: (B) => f.mutate({
426
+ checked: ((N = r == null ? void 0 : r.auto_watch) == null ? void 0 : N[l]) === !0,
427
+ onChange: (B) => q.mutate({
427
428
  auto_watch: {
428
- ...(t == null ? void 0 : t.auto_watch) ?? {},
429
- [n]: B.target.checked
429
+ ...(r == null ? void 0 : r.auto_watch) ?? {},
430
+ [l]: B.target.checked
430
431
  }
431
432
  }),
432
433
  className: "rounded"
433
434
  }
434
435
  ),
435
- b
436
- ] }, n);
436
+ x
437
+ ] }, l);
437
438
  })
438
439
  ] })
439
440
  ] })
@@ -441,18 +442,18 @@ function lt() {
441
442
  }
442
443
  );
443
444
  }
444
- function ot() {
445
- const s = A(), u = M(), { data: t } = v({
445
+ function it() {
446
+ const o = F(), p = M(), { data: n } = v({
446
447
  queryKey: ["nvr-profile-prefs"],
447
- queryFn: () => s.request(T("/users/me")).then((c) => {
448
- var m;
449
- return ((m = c.data) == null ? void 0 : m.preferences) ?? {};
448
+ queryFn: () => o.request(T("/users/me")).then((c) => {
449
+ var u;
450
+ return ((u = c.data) == null ? void 0 : u.preferences) ?? {};
450
451
  })
451
- }), i = (t == null ? void 0 : t.link_app) === "portal" || (t == null ? void 0 : t.link_app) === "admin" ? t.link_app : "auto", o = w({
452
- mutationFn: (c) => s.request(G("/users/me/preferences", { link_app: c })),
453
- onSuccess: () => void u.invalidateQueries({ queryKey: ["nvr-profile-prefs"] })
452
+ }), r = (n == null ? void 0 : n.link_app) === "portal" || (n == null ? void 0 : n.link_app) === "admin" ? n.link_app : "auto", s = w({
453
+ mutationFn: (c) => o.request(G("/users/me/preferences", { link_app: c })),
454
+ onSuccess: () => void p.invalidateQueries({ queryKey: ["nvr-profile-prefs"] })
454
455
  });
455
- return /* @__PURE__ */ a(
456
+ return /* @__PURE__ */ t(
456
457
  "div",
457
458
  {
458
459
  className: "rounded-xl border border-slate-200 bg-white p-5 dark:border-border dark:bg-card",
@@ -469,8 +470,8 @@ function ot() {
469
470
  {
470
471
  type: "button",
471
472
  title: c.hint,
472
- onClick: () => o.mutate(c.v),
473
- className: i === c.v ? "rounded bg-nvr-cyan px-3 py-1 text-[12.5px] font-medium text-white" : "rounded px-3 py-1 text-[12.5px] font-medium text-slate-600 hover:bg-slate-100 dark:text-muted-foreground dark:hover:bg-muted",
473
+ onClick: () => s.mutate(c.v),
474
+ className: r === c.v ? "rounded bg-nvr-cyan px-3 py-1 text-[12.5px] font-medium text-white" : "rounded px-3 py-1 text-[12.5px] font-medium text-slate-600 hover:bg-slate-100 dark:text-muted-foreground dark:hover:bg-muted",
474
475
  children: c.label
475
476
  },
476
477
  c.v
@@ -479,17 +480,17 @@ function ot() {
479
480
  }
480
481
  );
481
482
  }
482
- function it() {
483
- const s = A(), u = M(), [t, i] = C(""), o = (() => {
483
+ function dt() {
484
+ const o = F(), p = M(), [n, r] = C(""), s = (() => {
484
485
  try {
485
486
  return Intl.DateTimeFormat().resolvedOptions().timeZone;
486
487
  } catch {
487
488
  return "UTC";
488
489
  }
489
- })(), l = (() => {
490
- var p;
490
+ })(), i = (() => {
491
+ var m;
491
492
  try {
492
- return ((p = Intl.supportedValuesOf) == null ? void 0 : p.call(
493
+ return ((m = Intl.supportedValuesOf) == null ? void 0 : m.call(
493
494
  Intl,
494
495
  "timeZone"
495
496
  )) ?? [];
@@ -498,181 +499,181 @@ function it() {
498
499
  }
499
500
  })(), { data: c } = v({
500
501
  queryKey: ["nvr-profile-prefs"],
501
- queryFn: () => s.request(T("/users/me")).then((p) => {
502
+ queryFn: () => o.request(T("/users/me")).then((m) => {
502
503
  var S;
503
- return ((S = p.data) == null ? void 0 : S.preferences) ?? {};
504
+ return ((S = m.data) == null ? void 0 : S.preferences) ?? {};
504
505
  })
505
- }), m = typeof (c == null ? void 0 : c.timezone) == "string" ? c.timezone : null, r = w({
506
- mutationFn: (p) => s.request(G("/users/me/preferences", { timezone: p })),
507
- onSuccess: (p, S) => {
508
- Me(S), i(""), u.invalidateQueries({ queryKey: ["nvr-profile-prefs"] });
506
+ }), u = typeof (c == null ? void 0 : c.timezone) == "string" ? c.timezone : null, a = w({
507
+ mutationFn: (m) => o.request(G("/users/me/preferences", { timezone: m })),
508
+ onSuccess: (m, S) => {
509
+ Ke(S), r(""), p.invalidateQueries({ queryKey: ["nvr-profile-prefs"] });
509
510
  }
510
- }), h = t.length > 1 ? l.filter((p) => p.toLowerCase().includes(t.toLowerCase())).slice(0, 8) : [];
511
- return /* @__PURE__ */ a(
511
+ }), h = n.length > 1 ? i.filter((m) => m.toLowerCase().includes(n.toLowerCase())).slice(0, 8) : [];
512
+ return /* @__PURE__ */ t(
512
513
  "div",
513
514
  {
514
515
  "data-profile-card": "timezone",
515
516
  className: "rounded-xl border border-slate-200 bg-white p-5 dark:border-border dark:bg-card",
516
517
  children: [
517
518
  /* @__PURE__ */ e("p", { className: "text-[13.5px] font-semibold text-slate-800 dark:text-slate-100", children: "Timezone" }),
518
- /* @__PURE__ */ a("p", { className: "mt-0.5 text-[12px] text-slate-500 dark:text-muted-foreground", children: [
519
+ /* @__PURE__ */ t("p", { className: "mt-0.5 text-[12px] text-slate-500 dark:text-muted-foreground", children: [
519
520
  "Dates and times render in this zone. Your browser reports",
520
521
  " ",
521
- /* @__PURE__ */ e("span", { className: "font-medium", children: o }),
522
+ /* @__PURE__ */ e("span", { className: "font-medium", children: s }),
522
523
  "."
523
524
  ] }),
524
- /* @__PURE__ */ a("div", { className: "mt-3 flex flex-wrap items-center gap-2", children: [
525
- /* @__PURE__ */ e("span", { className: "inline-flex items-center gap-1.5 rounded-full bg-nvr-cyan/10 px-2.5 py-1 text-[12px] font-medium text-nvr-navy dark:text-nvr-cyan", children: m ?? `${o} (browser default)` }),
526
- m && /* @__PURE__ */ e(
525
+ /* @__PURE__ */ t("div", { className: "mt-3 flex flex-wrap items-center gap-2", children: [
526
+ /* @__PURE__ */ e("span", { className: "inline-flex items-center gap-1.5 rounded-full bg-nvr-cyan/10 px-2.5 py-1 text-[12px] font-medium text-nvr-navy dark:text-nvr-cyan", children: u ?? `${s} (browser default)` }),
527
+ u && /* @__PURE__ */ e(
527
528
  "button",
528
529
  {
529
530
  type: "button",
530
- onClick: () => r.mutate(null),
531
+ onClick: () => a.mutate(null),
531
532
  className: "text-[12px] text-slate-400 hover:text-slate-600 dark:hover:text-slate-300",
532
533
  children: "Use browser default"
533
534
  }
534
535
  )
535
536
  ] }),
536
- /* @__PURE__ */ a("div", { className: "relative mt-2", children: [
537
+ /* @__PURE__ */ t("div", { className: "relative mt-2", children: [
537
538
  /* @__PURE__ */ e(
538
539
  "input",
539
540
  {
540
- value: t,
541
- onChange: (p) => i(p.target.value),
541
+ value: n,
542
+ onChange: (m) => r(m.target.value),
542
543
  placeholder: "Change zone… (e.g. America/Denver)",
543
544
  className: "h-8 w-[280px] rounded-md border border-slate-200 bg-background px-2.5 text-[12.5px] dark:border-border"
544
545
  }
545
546
  ),
546
- h.length > 0 && /* @__PURE__ */ e("div", { className: "absolute z-10 mt-1 w-[280px] rounded-md border border-slate-200 bg-white shadow-lg dark:border-border dark:bg-card", children: h.map((p) => /* @__PURE__ */ e(
547
+ h.length > 0 && /* @__PURE__ */ e("div", { className: "absolute z-10 mt-1 w-[280px] rounded-md border border-slate-200 bg-white shadow-lg dark:border-border dark:bg-card", children: h.map((m) => /* @__PURE__ */ e(
547
548
  "button",
548
549
  {
549
550
  type: "button",
550
- onClick: () => r.mutate(p),
551
+ onClick: () => a.mutate(m),
551
552
  className: "block w-full px-2.5 py-1.5 text-left text-[12.5px] text-slate-700 hover:bg-muted dark:text-foreground",
552
- children: p
553
+ children: m
553
554
  },
554
- p
555
+ m
555
556
  )) })
556
557
  ] })
557
558
  ]
558
559
  }
559
560
  );
560
561
  }
561
- function dt() {
562
- const s = A(), u = M(), { data: t } = v({
562
+ function ct() {
563
+ const o = F(), p = M(), { data: n } = v({
563
564
  queryKey: ["nvr-profile-scopes"],
564
- queryFn: () => s.request(xe()).then((o) => o.data)
565
- }), i = w({
566
- mutationFn: ({ dimension: o, values: l }) => s.request(ge(o, l)),
567
- onSuccess: () => void u.invalidateQueries({ queryKey: ["nvr-profile-scopes"] })
565
+ queryFn: () => o.request(ge()).then((s) => s.data)
566
+ }), r = w({
567
+ mutationFn: ({ dimension: s, values: i }) => o.request(fe(s, i)),
568
+ onSuccess: () => void p.invalidateQueries({ queryKey: ["nvr-profile-scopes"] })
568
569
  });
569
- return !t || t.dimensions.length === 0 ? null : /* @__PURE__ */ e(
570
- ne,
570
+ return !n || n.dimensions.length === 0 ? null : /* @__PURE__ */ e(
571
+ se,
571
572
  {
572
573
  testId: "scopes",
573
- icon: /* @__PURE__ */ e(Ce, { className: "h-4 w-4" }),
574
+ icon: /* @__PURE__ */ e(qe, { className: "h-4 w-4" }),
574
575
  title: "Default filters",
575
576
  hint: "Pre-selected in browsers and reports — clear anytime",
576
- children: /* @__PURE__ */ e("div", { className: "space-y-3", children: t.dimensions.map((o) => /* @__PURE__ */ e(
577
- ct,
577
+ children: /* @__PURE__ */ e("div", { className: "space-y-3", children: n.dimensions.map((s) => /* @__PURE__ */ e(
578
+ mt,
578
579
  {
579
- dimension: o,
580
- selected: t.defaults[o.name] ?? [],
581
- restricted: t.restricted[o.name],
582
- onSave: (l) => i.mutate({ dimension: o.name, values: l })
580
+ dimension: s,
581
+ selected: n.defaults[s.name] ?? [],
582
+ restricted: n.restricted[s.name],
583
+ onSave: (i) => r.mutate({ dimension: s.name, values: i })
583
584
  },
584
- o.name
585
+ s.name
585
586
  )) })
586
587
  }
587
588
  );
588
589
  }
589
- function ct({
590
- dimension: s,
591
- selected: u,
592
- restricted: t,
593
- onSave: i
590
+ function mt({
591
+ dimension: o,
592
+ selected: p,
593
+ restricted: n,
594
+ onSave: r
594
595
  }) {
595
- const o = A(), l = s.display_field ?? "name", [c, m] = C(""), [r, h] = C(!1), { data: p = [] } = v({
596
- queryKey: ["nvr-scope-options", s.name],
597
- queryFn: async () => ((await o.request(
598
- te(s.target_collection, {
599
- fields: ["id", l],
600
- sort: s.options_sort ? [s.options_sort] : void 0,
596
+ const s = F(), i = o.display_field ?? "name", [c, u] = C(""), [a, h] = C(!1), { data: m = [] } = v({
597
+ queryKey: ["nvr-scope-options", o.name],
598
+ queryFn: async () => ((await s.request(
599
+ te(o.target_collection, {
600
+ fields: ["id", i],
601
+ sort: o.options_sort ? [o.options_sort] : void 0,
601
602
  limit: 200
602
603
  })
603
- )).data ?? []).map((y) => ({
604
- id: y.id,
605
- label: String(y[l] ?? y.id)
604
+ )).data ?? []).map((f) => ({
605
+ id: f.id,
606
+ label: String(f[i] ?? f.id)
606
607
  }))
607
- }), S = t != null && t.length ? new Set(t.map(String)) : null, k = S ? p.filter((d) => S.has(String(d.id))) : p, F = new Set(u.map(String)), f = k.length > 24 || p.length >= 200 && !S, { data: _ = [], isFetching: O } = v({
608
- queryKey: ["nvr-scope-search", s.name, c],
608
+ }), S = n != null && n.length ? new Set(n.map(String)) : null, k = S ? m.filter((d) => S.has(String(d.id))) : m, O = new Set(p.map(String)), y = k.length > 24 || m.length >= 200 && !S, { data: q = [], isFetching: _ } = v({
609
+ queryKey: ["nvr-scope-search", o.name, c],
609
610
  queryFn: async () => {
610
- const y = ((await o.request(
611
- te(s.target_collection, {
612
- fields: ["id", l],
613
- filter: { [l]: { _contains: c } },
614
- sort: s.options_sort ? [s.options_sort] : void 0,
611
+ const f = ((await s.request(
612
+ te(o.target_collection, {
613
+ fields: ["id", i],
614
+ filter: { [i]: { _contains: c } },
615
+ sort: o.options_sort ? [o.options_sort] : void 0,
615
616
  limit: 30
616
617
  })
617
- )).data ?? []).map((P) => ({
618
- id: P.id,
619
- label: String(P[l] ?? P.id)
618
+ )).data ?? []).map((A) => ({
619
+ id: A.id,
620
+ label: String(A[i] ?? A.id)
620
621
  }));
621
- return S ? y.filter((P) => S.has(String(P.id))) : y;
622
+ return S ? f.filter((A) => S.has(String(A.id))) : f;
622
623
  },
623
- enabled: f && c.trim().length > 0,
624
+ enabled: y && c.trim().length > 0,
624
625
  placeholderData: (d) => d
625
- }), q = new Map(p.map((d) => [String(d.id), d.label]));
626
- for (const d of _) q.set(String(d.id), d.label);
627
- const g = u.filter((d) => !q.has(String(d))), { data: $ = [] } = v({
628
- queryKey: ["nvr-scope-selected-labels", s.name, g.map(String).sort().join(",")],
629
- queryFn: async () => ((await o.request(
630
- te(s.target_collection, {
631
- fields: ["id", l],
626
+ }), P = new Map(m.map((d) => [String(d.id), d.label]));
627
+ for (const d of q) P.set(String(d.id), d.label);
628
+ const g = p.filter((d) => !P.has(String(d))), { data: Q = [] } = v({
629
+ queryKey: ["nvr-scope-selected-labels", o.name, g.map(String).sort().join(",")],
630
+ queryFn: async () => ((await s.request(
631
+ te(o.target_collection, {
632
+ fields: ["id", i],
632
633
  filter: { id: { _in: g } },
633
634
  limit: 100
634
635
  })
635
- )).data ?? []).map((y) => ({
636
- id: y.id,
637
- label: String(y[l] ?? y.id)
636
+ )).data ?? []).map((f) => ({
637
+ id: f.id,
638
+ label: String(f[i] ?? f.id)
638
639
  })),
639
640
  enabled: g.length > 0
640
641
  });
641
- for (const d of $) q.set(String(d.id), d.label);
642
+ for (const d of Q) P.set(String(d.id), d.label);
642
643
  const K = (d) => {
643
- const y = F.has(String(d));
644
- i(y ? u.filter((P) => String(P) !== String(d)) : [...u, d]);
645
- }, x = c.trim().toLowerCase(), R = x ? k.filter((d) => d.label.toLowerCase().includes(x)) : k, I = x.length === 0 ? k.slice(0, 30) : O && _.length === 0 ? R.slice(0, 30) : _, j = f && (r || x.length > 0);
646
- return /* @__PURE__ */ a("div", { children: [
647
- /* @__PURE__ */ a("p", { className: "mb-1 text-[11px] font-medium uppercase tracking-wide text-slate-400", children: [
648
- s.label,
649
- t != null && t.length ? /* @__PURE__ */ e("span", { className: "ml-1.5 normal-case tracking-normal text-amber-500", children: "(limited by your access)" }) : null,
650
- u.length > 0 && /* @__PURE__ */ a(
644
+ const f = O.has(String(d));
645
+ r(f ? p.filter((A) => String(A) !== String(d)) : [...p, d]);
646
+ }, b = c.trim().toLowerCase(), R = b ? k.filter((d) => d.label.toLowerCase().includes(b)) : k, U = b.length === 0 ? k.slice(0, 30) : _ && q.length === 0 ? R.slice(0, 30) : q, I = y && (a || b.length > 0);
647
+ return /* @__PURE__ */ t("div", { children: [
648
+ /* @__PURE__ */ t("p", { className: "mb-1 text-[11px] font-medium uppercase tracking-wide text-slate-400", children: [
649
+ o.label,
650
+ n != null && n.length ? /* @__PURE__ */ e("span", { className: "ml-1.5 normal-case tracking-normal text-amber-500", children: "(limited by your access)" }) : null,
651
+ p.length > 0 && /* @__PURE__ */ t(
651
652
  "button",
652
653
  {
653
654
  type: "button",
654
- onClick: () => i([]),
655
+ onClick: () => r([]),
655
656
  className: "ml-2 normal-case tracking-normal text-slate-400 underline-offset-2 hover:text-slate-600 hover:underline",
656
657
  children: [
657
658
  "clear ",
658
- u.length
659
+ p.length
659
660
  ]
660
661
  }
661
662
  )
662
663
  ] }),
663
- f ? /* @__PURE__ */ a("div", { className: "max-w-xl", children: [
664
- u.length > 0 && /* @__PURE__ */ e("div", { className: "mb-1.5 flex flex-wrap gap-1", children: u.map((d) => /* @__PURE__ */ a(
664
+ y ? /* @__PURE__ */ t("div", { className: "max-w-xl", children: [
665
+ p.length > 0 && /* @__PURE__ */ e("div", { className: "mb-1.5 flex flex-wrap gap-1", children: p.map((d) => /* @__PURE__ */ t(
665
666
  "span",
666
667
  {
667
668
  className: "inline-flex items-center gap-1 rounded-full border border-nvr-cyan bg-nvr-cyan/10 py-0.5 pl-2.5 pr-1 text-[11.5px] font-medium text-nvr-navy dark:text-nvr-cyan",
668
669
  children: [
669
- q.get(String(d)) ?? String(d),
670
+ P.get(String(d)) ?? String(d),
670
671
  /* @__PURE__ */ e(
671
672
  "button",
672
673
  {
673
674
  type: "button",
674
675
  onClick: () => K(d),
675
- "aria-label": `Remove ${q.get(String(d)) ?? d}`,
676
+ "aria-label": `Remove ${P.get(String(d)) ?? d}`,
676
677
  className: "rounded-full px-1 text-slate-400 hover:text-slate-600 dark:hover:text-slate-200",
677
678
  children: "×"
678
679
  }
@@ -685,55 +686,55 @@ function ct({
685
686
  "input",
686
687
  {
687
688
  value: c,
688
- onChange: (d) => m(d.target.value),
689
+ onChange: (d) => u(d.target.value),
689
690
  onFocus: () => h(!0),
690
691
  onBlur: () => h(!1),
691
- placeholder: `Search ${s.label.toLowerCase()} to add…`,
692
+ placeholder: `Search ${o.label.toLowerCase()} to add…`,
692
693
  className: "h-8 w-full rounded-md border border-slate-200 bg-white px-2.5 text-[12px] outline-none focus:border-nvr-cyan dark:border-border dark:bg-card"
693
694
  }
694
695
  ),
695
- j && /* @__PURE__ */ a(
696
+ I && /* @__PURE__ */ t(
696
697
  "div",
697
698
  {
698
699
  onMouseDown: (d) => d.preventDefault(),
699
700
  className: "mt-1 max-h-44 overflow-y-auto rounded-md border border-slate-200 dark:border-border",
700
701
  children: [
701
- I.map((d) => {
702
- const y = F.has(String(d.id));
703
- return /* @__PURE__ */ a(
702
+ U.map((d) => {
703
+ const f = O.has(String(d.id));
704
+ return /* @__PURE__ */ t(
704
705
  "button",
705
706
  {
706
707
  type: "button",
707
708
  onClick: () => K(d.id),
708
- className: Q(
709
+ className: j(
709
710
  "flex w-full items-center justify-between px-2.5 py-1.5 text-left text-[12px] hover:bg-slate-50 dark:hover:bg-muted",
710
- y ? "font-medium text-nvr-navy dark:text-nvr-cyan" : "text-slate-600 dark:text-slate-300"
711
+ f ? "font-medium text-nvr-navy dark:text-nvr-cyan" : "text-slate-600 dark:text-slate-300"
711
712
  ),
712
713
  children: [
713
714
  /* @__PURE__ */ e("span", { className: "truncate", children: d.label }),
714
- /* @__PURE__ */ e("span", { className: "pl-2 text-[11px] text-slate-400", children: y ? "Remove" : "Add" })
715
+ /* @__PURE__ */ e("span", { className: "pl-2 text-[11px] text-slate-400", children: f ? "Remove" : "Add" })
715
716
  ]
716
717
  },
717
718
  String(d.id)
718
719
  );
719
720
  }),
720
- I.length === 0 && /* @__PURE__ */ e("p", { className: "px-2.5 py-2 text-[11.5px] text-slate-400", children: O ? "Searching…" : x ? "No matches." : "No options." }),
721
- x.length === 0 && k.length > 30 && /* @__PURE__ */ e("p", { className: "border-t border-slate-100 px-2.5 py-1.5 text-[11px] text-slate-400 dark:border-border", children: "Showing first 30 — type to narrow." })
721
+ U.length === 0 && /* @__PURE__ */ e("p", { className: "px-2.5 py-2 text-[11.5px] text-slate-400", children: _ ? "Searching…" : b ? "No matches." : "No options." }),
722
+ b.length === 0 && k.length > 30 && /* @__PURE__ */ e("p", { className: "border-t border-slate-100 px-2.5 py-1.5 text-[11px] text-slate-400 dark:border-border", children: "Showing first 30 — type to narrow." })
722
723
  ]
723
724
  }
724
725
  ),
725
- !j && u.length === 0 && /* @__PURE__ */ e("p", { className: "mt-1 text-[11px] text-slate-400", children: "No defaults set — click to browse or type to search." })
726
- ] }) : /* @__PURE__ */ a("div", { className: "flex flex-wrap gap-1", children: [
726
+ !I && p.length === 0 && /* @__PURE__ */ e("p", { className: "mt-1 text-[11px] text-slate-400", children: "No defaults set — click to browse or type to search." })
727
+ ] }) : /* @__PURE__ */ t("div", { className: "flex flex-wrap gap-1", children: [
727
728
  k.map((d) => {
728
- const y = F.has(String(d.id));
729
+ const f = O.has(String(d.id));
729
730
  return /* @__PURE__ */ e(
730
731
  "button",
731
732
  {
732
733
  type: "button",
733
734
  onClick: () => K(d.id),
734
- className: Q(
735
+ className: j(
735
736
  "rounded-full border px-2.5 py-0.5 text-[11.5px] transition-colors",
736
- y ? "border-nvr-cyan bg-nvr-cyan/10 font-medium text-nvr-navy dark:text-nvr-cyan" : "border-slate-200 text-slate-500 hover:border-slate-300 dark:border-border"
737
+ f ? "border-nvr-cyan bg-nvr-cyan/10 font-medium text-nvr-navy dark:text-nvr-cyan" : "border-slate-200 text-slate-500 hover:border-slate-300 dark:border-border"
737
738
  ),
738
739
  children: d.label
739
740
  },
@@ -744,67 +745,67 @@ function ct({
744
745
  ] })
745
746
  ] });
746
747
  }
747
- function mt() {
748
- const { data: s } = v({
748
+ function ut() {
749
+ const { data: o } = v({
749
750
  queryKey: ["nvr-settings-2fa"],
750
- queryFn: () => t.request({ _method: "GET", _path: "/settings/" }).then((g) => (g == null ? void 0 : g.data) ?? null).catch(() => null),
751
+ queryFn: () => n.request({ _method: "GET", _path: "/settings/" }).then((g) => (g == null ? void 0 : g.data) ?? null).catch(() => null),
751
752
  staleTime: 6e5
752
- }), u = (s == null ? void 0 : s.two_factor_enabled) !== !1, t = A(), i = M(), [o, l] = C(null), [c, m] = C(""), [r, h] = C(null), { data: p } = v({
753
+ }), p = (o == null ? void 0 : o.two_factor_enabled) !== !1, n = F(), r = M(), [s, i] = C(null), [c, u] = C(""), [a, h] = C(null), { data: m } = v({
753
754
  queryKey: ["nvr-profile-totp"],
754
- queryFn: () => t.request({ _method: "GET", _path: "/two-factor/status" }).then((g) => g.data)
755
- }), S = () => void i.invalidateQueries({ queryKey: ["nvr-profile-totp"] }), k = w({
756
- mutationFn: () => t.request({ _method: "POST", _path: "/two-factor/setup" }).then((g) => g.data),
757
- onSuccess: (g) => l(g)
758
- }), F = w({
759
- mutationFn: (g) => t.request({
755
+ queryFn: () => n.request({ _method: "GET", _path: "/two-factor/status" }).then((g) => g.data)
756
+ }), S = () => void r.invalidateQueries({ queryKey: ["nvr-profile-totp"] }), k = w({
757
+ mutationFn: () => n.request({ _method: "POST", _path: "/two-factor/setup" }).then((g) => g.data),
758
+ onSuccess: (g) => i(g)
759
+ }), O = w({
760
+ mutationFn: (g) => n.request({
760
761
  _method: "POST",
761
762
  _path: "/two-factor/verify",
762
763
  _body: { token: g }
763
764
  }),
764
765
  onSuccess: () => {
765
- l(null), m(""), S();
766
+ i(null), u(""), S();
766
767
  }
767
- }), f = w({
768
- mutationFn: (g) => t.request({
768
+ }), y = w({
769
+ mutationFn: (g) => n.request({
769
770
  _method: "POST",
770
771
  _path: "/two-factor/disable",
771
772
  _body: { token: g }
772
773
  }),
773
774
  onSuccess: () => {
774
- m(""), S();
775
+ u(""), S();
775
776
  }
776
- }), _ = w({
777
- mutationFn: () => t.request({ _method: "POST", _path: "/users/me/token" }).then((g) => g.data),
777
+ }), q = w({
778
+ mutationFn: () => n.request({ _method: "POST", _path: "/users/me/token" }).then((g) => g.data),
778
779
  onSuccess: (g) => h(g.token)
779
- }), O = w({
780
- mutationFn: () => t.request({ _method: "DELETE", _path: "/users/me/token" }),
780
+ }), _ = w({
781
+ mutationFn: () => n.request({ _method: "DELETE", _path: "/users/me/token" }),
781
782
  onSuccess: () => h(null)
782
- }), q = w({
783
- mutationFn: () => t.request({ _method: "POST", _path: "/auth/logout-all" }),
783
+ }), P = w({
784
+ mutationFn: () => n.request({ _method: "POST", _path: "/auth/logout-all" }),
784
785
  onSuccess: () => window.location.assign("/login")
785
786
  });
786
787
  return /* @__PURE__ */ e(
787
- ne,
788
+ se,
788
789
  {
789
- icon: /* @__PURE__ */ e(Pe, { className: "h-4 w-4" }),
790
+ icon: /* @__PURE__ */ e(Ae, { className: "h-4 w-4" }),
790
791
  title: "Security",
791
- hint: u ? "Two-factor sign-in and API access" : "API access",
792
- children: /* @__PURE__ */ a("div", { className: "space-y-4", children: [
793
- u && /* @__PURE__ */ a("div", { children: [
794
- /* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
792
+ hint: p ? "Two-factor sign-in and API access" : "API access",
793
+ children: /* @__PURE__ */ t("div", { className: "space-y-4", children: [
794
+ p && /* @__PURE__ */ t("div", { children: [
795
+ /* @__PURE__ */ t("div", { className: "flex items-center gap-2", children: [
795
796
  /* @__PURE__ */ e("p", { className: "text-[12.5px] font-medium text-slate-700 dark:text-slate-200", children: "Two-factor authentication" }),
796
797
  /* @__PURE__ */ e(
797
798
  "span",
798
799
  {
799
- className: Q(
800
+ className: j(
800
801
  "rounded-full px-1.5 py-px text-[10px] font-semibold",
801
- p != null && p.enabled ? "bg-emerald-50 text-emerald-600 dark:bg-emerald-500/10 dark:text-emerald-400" : "bg-slate-100 text-slate-500 dark:bg-muted dark:text-slate-400"
802
+ m != null && m.enabled ? "bg-emerald-50 text-emerald-600 dark:bg-emerald-500/10 dark:text-emerald-400" : "bg-slate-100 text-slate-500 dark:bg-muted dark:text-slate-400"
802
803
  ),
803
- children: p != null && p.enabled ? "Enabled" : "Off"
804
+ children: m != null && m.enabled ? "Enabled" : "Off"
804
805
  }
805
806
  )
806
807
  ] }),
807
- !(p != null && p.enabled) && !o && /* @__PURE__ */ e(
808
+ !(m != null && m.enabled) && !s && /* @__PURE__ */ e(
808
809
  "button",
809
810
  {
810
811
  type: "button",
@@ -813,23 +814,23 @@ function mt() {
813
814
  children: k.isPending ? "Preparing…" : "Set up 2FA"
814
815
  }
815
816
  ),
816
- o && /* @__PURE__ */ a("div", { className: "mt-3 flex flex-wrap items-start gap-4", children: [
817
+ s && /* @__PURE__ */ t("div", { className: "mt-3 flex flex-wrap items-start gap-4", children: [
817
818
  /* @__PURE__ */ e(
818
819
  "img",
819
820
  {
820
- src: o.qr,
821
+ src: s.qr,
821
822
  alt: "Scan with your authenticator app",
822
823
  className: "h-32 w-32 rounded-md border border-slate-200 dark:border-border"
823
824
  }
824
825
  ),
825
- /* @__PURE__ */ a("div", { className: "min-w-[200px] flex-1 space-y-2", children: [
826
+ /* @__PURE__ */ t("div", { className: "min-w-[200px] flex-1 space-y-2", children: [
826
827
  /* @__PURE__ */ e("p", { className: "text-[12px] text-slate-500", children: "Scan with your authenticator app, then enter the 6-digit code to confirm." }),
827
- /* @__PURE__ */ a("div", { className: "flex gap-1.5", children: [
828
+ /* @__PURE__ */ t("div", { className: "flex gap-1.5", children: [
828
829
  /* @__PURE__ */ e(
829
830
  "input",
830
831
  {
831
832
  value: c,
832
- onChange: (g) => m(g.target.value),
833
+ onChange: (g) => u(g.target.value),
833
834
  placeholder: "123456",
834
835
  inputMode: "numeric",
835
836
  className: "h-8 w-[110px] rounded-md border border-slate-200 px-2.5 text-center text-[13px] tabular-nums tracking-widest dark:border-border dark:bg-background"
@@ -839,8 +840,8 @@ function mt() {
839
840
  "button",
840
841
  {
841
842
  type: "button",
842
- disabled: c.trim().length < 6 || F.isPending,
843
- onClick: () => F.mutate(c.trim()),
843
+ disabled: c.trim().length < 6 || O.isPending,
844
+ onClick: () => O.mutate(c.trim()),
844
845
  className: "h-8 rounded-md bg-nvr-cyan px-3 text-[12px] font-semibold text-white disabled:opacity-50",
845
846
  children: "Confirm"
846
847
  }
@@ -848,12 +849,12 @@ function mt() {
848
849
  ] })
849
850
  ] })
850
851
  ] }),
851
- (p == null ? void 0 : p.enabled) && /* @__PURE__ */ a("div", { className: "mt-2 flex gap-1.5", children: [
852
+ (m == null ? void 0 : m.enabled) && /* @__PURE__ */ t("div", { className: "mt-2 flex gap-1.5", children: [
852
853
  /* @__PURE__ */ e(
853
854
  "input",
854
855
  {
855
856
  value: c,
856
- onChange: (g) => m(g.target.value),
857
+ onChange: (g) => u(g.target.value),
857
858
  placeholder: "Code to disable",
858
859
  inputMode: "numeric",
859
860
  className: "h-8 w-[130px] rounded-md border border-slate-200 px-2.5 text-[12px] dark:border-border dark:bg-background"
@@ -863,37 +864,37 @@ function mt() {
863
864
  "button",
864
865
  {
865
866
  type: "button",
866
- disabled: c.trim().length < 6 || f.isPending,
867
- onClick: () => f.mutate(c.trim()),
867
+ disabled: c.trim().length < 6 || y.isPending,
868
+ onClick: () => y.mutate(c.trim()),
868
869
  className: "h-8 rounded-md border border-red-200 px-3 text-[12px] font-medium text-red-500 transition-colors hover:bg-red-50 disabled:opacity-50 dark:border-red-500/30 dark:hover:bg-red-500/10",
869
- children: f.isPending ? "Disabling…" : "Disable"
870
+ children: y.isPending ? "Disabling…" : "Disable"
870
871
  }
871
872
  )
872
873
  ] })
873
874
  ] }),
874
- /* @__PURE__ */ a(
875
+ /* @__PURE__ */ t(
875
876
  "div",
876
877
  {
877
- className: u ? "border-t border-slate-100 pt-3 dark:border-border/60" : void 0,
878
+ className: p ? "border-t border-slate-100 pt-3 dark:border-border/60" : void 0,
878
879
  children: [
879
880
  /* @__PURE__ */ e("p", { className: "text-[12.5px] font-medium text-slate-700 dark:text-slate-200", children: "API token" }),
880
881
  /* @__PURE__ */ e("p", { className: "mt-0.5 text-[11.5px] text-slate-400", children: "Personal Bearer token for scripts and integrations. Shown once — creating a new one replaces the old." }),
881
- r && /* @__PURE__ */ e("code", { className: "mt-2 block select-all break-all rounded-md bg-slate-50 px-2.5 py-2 font-mono text-[11.5px] text-nvr-navy dark:bg-muted dark:text-nvr-cyan", children: r }),
882
- /* @__PURE__ */ a("div", { className: "mt-2 flex gap-1.5", children: [
882
+ a && /* @__PURE__ */ e("code", { className: "mt-2 block select-all break-all rounded-md bg-slate-50 px-2.5 py-2 font-mono text-[11.5px] text-nvr-navy dark:bg-muted dark:text-nvr-cyan", children: a }),
883
+ /* @__PURE__ */ t("div", { className: "mt-2 flex gap-1.5", children: [
883
884
  /* @__PURE__ */ e(
884
885
  "button",
885
886
  {
886
887
  type: "button",
887
- onClick: () => _.mutate(),
888
+ onClick: () => q.mutate(),
888
889
  className: "h-8 rounded-md border border-slate-200 px-3 text-[12px] font-medium text-slate-600 hover:border-nvr-cyan hover:text-nvr-navy dark:border-border dark:text-slate-300 dark:hover:text-nvr-cyan",
889
- children: _.isPending ? "Generating…" : "Generate token"
890
+ children: q.isPending ? "Generating…" : "Generate token"
890
891
  }
891
892
  ),
892
893
  /* @__PURE__ */ e(
893
- me,
894
+ pe,
894
895
  {
895
896
  title: "Revoke API token",
896
- onConfirm: () => O.mutate(),
897
+ onConfirm: () => _.mutate(),
897
898
  confirmLabel: "Revoke token?",
898
899
  className: "h-8 rounded-md px-3 text-[12px] font-medium text-slate-400 transition-colors hover:text-red-500",
899
900
  armedClassName: "font-semibold text-red-500",
@@ -904,20 +905,20 @@ function mt() {
904
905
  ]
905
906
  }
906
907
  ),
907
- /* @__PURE__ */ a("div", { className: "border-t border-slate-100 pt-3 dark:border-border/60", children: [
908
+ /* @__PURE__ */ t("div", { className: "border-t border-slate-100 pt-3 dark:border-border/60", children: [
908
909
  /* @__PURE__ */ e("p", { className: "text-[12.5px] font-medium text-slate-700 dark:text-slate-200", children: "Sessions" }),
909
910
  /* @__PURE__ */ e("p", { className: "mt-0.5 text-[11.5px] text-slate-400", children: "Signs you out on every device and browser, including this one." }),
910
- /* @__PURE__ */ a(
911
- me,
911
+ /* @__PURE__ */ t(
912
+ pe,
912
913
  {
913
914
  title: "Sign out everywhere",
914
- onConfirm: () => q.mutate(),
915
+ onConfirm: () => P.mutate(),
915
916
  confirmLabel: "Sign out everywhere?",
916
917
  className: "mt-2 inline-flex h-8 items-center gap-1.5 rounded-md border border-slate-200 px-3 text-[12px] font-medium text-slate-600 transition-colors hover:border-red-300 hover:text-red-500 dark:border-border dark:text-slate-300 dark:hover:border-red-500/40 dark:hover:text-red-400",
917
918
  armedClassName: "border-red-300 font-semibold text-red-500 dark:border-red-500/40 dark:text-red-400",
918
919
  children: [
919
- /* @__PURE__ */ e(qe, { className: "h-3.5 w-3.5" }),
920
- q.isPending ? "Signing out…" : "Sign out everywhere"
920
+ /* @__PURE__ */ e(Pe, { className: "h-3.5 w-3.5" }),
921
+ P.isPending ? "Signing out…" : "Sign out everywhere"
921
922
  ]
922
923
  }
923
924
  )
@@ -926,85 +927,85 @@ function mt() {
926
927
  }
927
928
  );
928
929
  }
929
- function Jt({
930
- userId: s,
931
- className: u,
932
- initialTab: t,
933
- extra: i,
934
- pushServiceWorker: o = "/sw.js"
930
+ function Vt({
931
+ userId: o,
932
+ className: p,
933
+ initialTab: n,
934
+ extra: r,
935
+ pushServiceWorker: s = "/sw.js"
935
936
  }) {
936
- const l = pe();
937
- return !s || (l == null ? void 0 : l.userId) != null && String(l.userId) === String(s) ? /* @__PURE__ */ e(ut, { className: u, extra: i, pushServiceWorker: o }) : /* @__PURE__ */ e(Xe, { userId: s, className: u, initialTab: t });
937
+ const i = ne();
938
+ return !o || (i == null ? void 0 : i.userId) != null && String(i.userId) === String(o) ? /* @__PURE__ */ e(pt, { className: p, extra: r, pushServiceWorker: s }) : /* @__PURE__ */ e(et, { userId: o, className: p, initialTab: n });
938
939
  }
939
- function ut({
940
- className: s,
941
- extra: u,
942
- pushServiceWorker: t
940
+ function pt({
941
+ className: o,
942
+ extra: p,
943
+ pushServiceWorker: n
943
944
  }) {
944
- var j;
945
- const i = A(), o = M(), l = pe(), c = !0, m = "me", { data: r } = v({
946
- queryKey: ["nvr-profile-user", m],
947
- queryFn: () => i.request(he(m)).then((d) => d.data),
945
+ var I;
946
+ const r = F(), s = M(), i = ne(), c = !0, u = "me", { data: a } = v({
947
+ queryKey: ["nvr-profile-user", u],
948
+ queryFn: () => r.request(be(u)).then((d) => d.data),
948
949
  enabled: c
949
- }), h = (r == null ? void 0 : r.id) ?? null, { data: p } = v({
950
+ }), h = (a == null ? void 0 : a.id) ?? null, { data: m } = v({
950
951
  queryKey: ["nvr-profile-card", h],
951
- queryFn: () => i.request(be(h)).then((d) => d.data),
952
+ queryFn: () => r.request(xe(h)).then((d) => d.data),
952
953
  enabled: !!h
953
- }), [S, k] = C(null), F = Ae(
954
+ }), [S, k] = C(null), O = Fe(
954
955
  () => ({
955
- first_name: (r == null ? void 0 : r.first_name) ?? "",
956
- last_name: (r == null ? void 0 : r.last_name) ?? "",
957
- title: (r == null ? void 0 : r.title) ?? "",
958
- department: (r == null ? void 0 : r.department) ?? "",
959
- phone: (r == null ? void 0 : r.phone) ?? ""
956
+ first_name: (a == null ? void 0 : a.first_name) ?? "",
957
+ last_name: (a == null ? void 0 : a.last_name) ?? "",
958
+ title: (a == null ? void 0 : a.title) ?? "",
959
+ department: (a == null ? void 0 : a.department) ?? "",
960
+ phone: (a == null ? void 0 : a.phone) ?? ""
960
961
  }),
961
- [r]
962
- ), f = S ?? F, _ = JSON.stringify(f) !== JSON.stringify(F), O = w({
963
- mutationFn: () => i.request(oe(r.id, f)),
962
+ [a]
963
+ ), y = S ?? O, q = JSON.stringify(y) !== JSON.stringify(O), _ = w({
964
+ mutationFn: () => r.request(de(a.id, y)),
964
965
  onSuccess: () => {
965
- k(null), o.invalidateQueries({ queryKey: ["nvr-profile-user"] }), o.invalidateQueries({ queryKey: ["nvr-profile-card"] });
966
+ k(null), s.invalidateQueries({ queryKey: ["nvr-profile-user"] }), s.invalidateQueries({ queryKey: ["nvr-profile-card"] });
966
967
  }
967
- }), [q, g] = C(pt), $ = ue(null), K = w({
968
+ }), [P, g] = C(ht), Q = he(null), K = w({
968
969
  mutationFn: async (d) => {
969
- const y = await new Promise((P, J) => {
970
- const D = new Image(), z = URL.createObjectURL(d);
970
+ const f = await new Promise((A, J) => {
971
+ const D = new Image(), Y = URL.createObjectURL(d);
971
972
  D.onload = () => {
972
- URL.revokeObjectURL(z);
973
- const L = 96, E = document.createElement("canvas");
974
- E.width = L, E.height = L;
975
- const V = E.getContext("2d");
976
- if (!V) return J(new Error("canvas unavailable"));
977
- const Z = Math.max(L / D.width, L / D.height), Y = D.width * Z, W = D.height * Z;
978
- V.drawImage(D, (L - Y) / 2, (L - W) / 2, Y, W), P(E.toDataURL("image/jpeg", 0.85));
973
+ URL.revokeObjectURL(Y);
974
+ const L = 96, $ = document.createElement("canvas");
975
+ $.width = L, $.height = L;
976
+ const z = $.getContext("2d");
977
+ if (!z) return J(new Error("canvas unavailable"));
978
+ const V = Math.max(L / D.width, L / D.height), Z = D.width * V, W = D.height * V;
979
+ z.drawImage(D, (L - Z) / 2, (L - W) / 2, Z, W), A($.toDataURL("image/jpeg", 0.85));
979
980
  }, D.onerror = () => {
980
- URL.revokeObjectURL(z), J(new Error("not an image"));
981
- }, D.src = z;
981
+ URL.revokeObjectURL(Y), J(new Error("not an image"));
982
+ }, D.src = Y;
982
983
  });
983
- await i.request(oe(r.id, { avatar: y }));
984
+ await r.request(de(a.id, { avatar: f }));
984
985
  },
985
986
  onSuccess: () => {
986
- o.invalidateQueries({ queryKey: ["nvr-profile-user"] }), o.invalidateQueries({ queryKey: ["nvr-profile-card"] }), o.invalidateQueries({ queryKey: ["user-card"] }), o.invalidateQueries({ queryKey: ["user-avatar"] });
987
+ s.invalidateQueries({ queryKey: ["nvr-profile-user"] }), s.invalidateQueries({ queryKey: ["nvr-profile-card"] }), s.invalidateQueries({ queryKey: ["user-card"] }), s.invalidateQueries({ queryKey: ["user-avatar"] });
987
988
  }
988
- }), x = p ?? (r ? { ...r, role_name: null } : null);
989
- if (!x)
990
- return /* @__PURE__ */ a("div", { className: Q("flex animate-pulse flex-col gap-4", s), "aria-busy": "true", children: [
991
- /* @__PURE__ */ a("div", { className: "flex items-center gap-5 rounded-lg border border-slate-200 bg-white p-5 dark:border-border dark:bg-card", children: [
989
+ }), b = m ?? (a ? { ...a, role_name: null } : null);
990
+ if (!b)
991
+ return /* @__PURE__ */ t("div", { className: j("flex animate-pulse flex-col gap-4", o), "aria-busy": "true", children: [
992
+ /* @__PURE__ */ t("div", { className: "flex items-center gap-5 rounded-lg border border-slate-200 bg-white p-5 dark:border-border dark:bg-card", children: [
992
993
  /* @__PURE__ */ e("div", { className: "h-[76px] w-[76px] rounded-full bg-slate-100 dark:bg-muted" }),
993
- /* @__PURE__ */ a("div", { className: "flex-1 space-y-2.5", children: [
994
+ /* @__PURE__ */ t("div", { className: "flex-1 space-y-2.5", children: [
994
995
  /* @__PURE__ */ e("div", { className: "h-5 w-48 rounded bg-slate-100 dark:bg-muted" }),
995
996
  /* @__PURE__ */ e("div", { className: "h-3.5 w-72 max-w-full rounded bg-slate-100 dark:bg-muted" }),
996
997
  /* @__PURE__ */ e("div", { className: "h-3.5 w-56 max-w-full rounded bg-slate-100 dark:bg-muted" })
997
998
  ] })
998
999
  ] }),
999
- /* @__PURE__ */ a("div", { className: "grid gap-4 lg:grid-cols-2", children: [
1000
+ /* @__PURE__ */ t("div", { className: "grid gap-4 lg:grid-cols-2", children: [
1000
1001
  /* @__PURE__ */ e("div", { className: "h-64 rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card" }),
1001
1002
  /* @__PURE__ */ e("div", { className: "h-64 rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card" })
1002
1003
  ] })
1003
1004
  ] });
1004
- const R = (r == null ? void 0 : r.avatar) ?? null, I = x.status === "active";
1005
- return /* @__PURE__ */ a("div", { className: Q("flex flex-col gap-4", s), "data-nvr-profile": !0, children: [
1006
- /* @__PURE__ */ e("div", { className: "rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card", children: /* @__PURE__ */ a("div", { className: "flex flex-wrap items-center gap-x-5 gap-y-4 p-5", children: [
1007
- /* @__PURE__ */ a("div", { className: "relative", children: [
1005
+ const R = (a == null ? void 0 : a.avatar) ?? null, U = b.status === "active";
1006
+ return /* @__PURE__ */ t("div", { className: j("flex flex-col gap-4", o), "data-nvr-profile": !0, children: [
1007
+ /* @__PURE__ */ e("div", { className: "rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card", children: /* @__PURE__ */ t("div", { className: "flex flex-wrap items-center gap-x-5 gap-y-4 p-5", children: [
1008
+ /* @__PURE__ */ t("div", { className: "relative", children: [
1008
1009
  R ? /* @__PURE__ */ e(
1009
1010
  "img",
1010
1011
  {
@@ -1012,18 +1013,18 @@ function ut({
1012
1013
  alt: "",
1013
1014
  className: "h-[76px] w-[76px] rounded-full border border-slate-200 object-cover dark:border-border"
1014
1015
  }
1015
- ) : /* @__PURE__ */ e("span", { className: "flex h-[76px] w-[76px] items-center justify-center rounded-full bg-[#c7f0fb] text-[24px] font-semibold text-[#04516b] dark:bg-nvr-cyan/15 dark:text-nvr-cyan", children: rt(x) }),
1016
+ ) : /* @__PURE__ */ e("span", { className: "flex h-[76px] w-[76px] items-center justify-center rounded-full bg-[#c7f0fb] text-[24px] font-semibold text-[#04516b] dark:bg-nvr-cyan/15 dark:text-nvr-cyan", children: nt(b) }),
1016
1017
  /* @__PURE__ */ e(
1017
1018
  "span",
1018
1019
  {
1019
- className: Q(
1020
+ className: j(
1020
1021
  "absolute bottom-0.5 right-0.5 h-3 w-3 rounded-full border-2 border-white dark:border-card",
1021
- I ? "bg-emerald-500" : "bg-slate-300 dark:bg-slate-600"
1022
+ U ? "bg-emerald-500" : "bg-slate-300 dark:bg-slate-600"
1022
1023
  ),
1023
- title: I ? "Active" : x.status
1024
+ title: U ? "Active" : b.status
1024
1025
  }
1025
1026
  ),
1026
- /* @__PURE__ */ a(X, { children: [
1027
+ /* @__PURE__ */ t(X, { children: [
1027
1028
  /* @__PURE__ */ e(
1028
1029
  "button",
1029
1030
  {
@@ -1032,81 +1033,81 @@ function ut({
1032
1033
  "aria-label": "Change photo",
1033
1034
  onClick: () => {
1034
1035
  var d;
1035
- return (d = $.current) == null ? void 0 : d.click();
1036
+ return (d = Q.current) == null ? void 0 : d.click();
1036
1037
  },
1037
1038
  className: "absolute -right-1 -top-1 flex h-7 w-7 items-center justify-center rounded-full border border-slate-200 bg-white text-slate-500 shadow-sm transition-colors hover:border-nvr-cyan hover:text-nvr-navy dark:border-border dark:bg-background dark:text-slate-300 dark:hover:text-nvr-cyan",
1038
- children: K.isPending ? /* @__PURE__ */ e(ie, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ e(fe, { className: "h-3.5 w-3.5" })
1039
+ children: K.isPending ? /* @__PURE__ */ e(ce, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ e(ye, { className: "h-3.5 w-3.5" })
1039
1040
  }
1040
1041
  ),
1041
1042
  /* @__PURE__ */ e(
1042
1043
  "input",
1043
1044
  {
1044
- ref: $,
1045
+ ref: Q,
1045
1046
  type: "file",
1046
1047
  accept: "image/*",
1047
1048
  className: "hidden",
1048
1049
  onChange: (d) => {
1049
- var P;
1050
- const y = (P = d.target.files) == null ? void 0 : P[0];
1051
- y && K.mutate(y), d.target.value = "";
1050
+ var A;
1051
+ const f = (A = d.target.files) == null ? void 0 : A[0];
1052
+ f && K.mutate(f), d.target.value = "";
1052
1053
  }
1053
1054
  }
1054
1055
  )
1055
1056
  ] })
1056
1057
  ] }),
1057
- /* @__PURE__ */ a("div", { className: "min-w-0 flex-1", children: [
1058
- /* @__PURE__ */ a("div", { className: "flex flex-wrap items-center gap-2", children: [
1059
- /* @__PURE__ */ e("h1", { className: "text-[21px] font-semibold tracking-[-0.015em] text-slate-900 dark:text-white", children: at(x) }),
1060
- x.role_name && /* @__PURE__ */ e("span", { className: "rounded-full bg-nvr-cyan/10 px-2 py-px text-[10.5px] font-semibold text-nvr-navy dark:text-nvr-cyan", children: x.role_name }),
1061
- x.is_out_of_office && /* @__PURE__ */ e("span", { className: "rounded-full bg-amber-50 px-2 py-px text-[10.5px] font-semibold text-amber-600 dark:bg-amber-500/10 dark:text-amber-400", children: "Out of office" }),
1062
- /* @__PURE__ */ e(He, { email: x.email, canClear: l.isAdmin })
1058
+ /* @__PURE__ */ t("div", { className: "min-w-0 flex-1", children: [
1059
+ /* @__PURE__ */ t("div", { className: "flex flex-wrap items-center gap-2", children: [
1060
+ /* @__PURE__ */ e("h1", { className: "text-[21px] font-semibold tracking-[-0.015em] text-slate-900 dark:text-white", children: rt(b) }),
1061
+ b.role_name && /* @__PURE__ */ e("span", { className: "rounded-full bg-nvr-cyan/10 px-2 py-px text-[10.5px] font-semibold text-nvr-navy dark:text-nvr-cyan", children: b.role_name }),
1062
+ b.is_out_of_office && /* @__PURE__ */ e("span", { className: "rounded-full bg-amber-50 px-2 py-px text-[10.5px] font-semibold text-amber-600 dark:bg-amber-500/10 dark:text-amber-400", children: "Out of office" }),
1063
+ /* @__PURE__ */ e(Ye, { email: b.email, canClear: i.isAdmin })
1063
1064
  ] }),
1064
- r && // The same status the chat panel's Online tab sets — one editor,
1065
+ a && // The same status the chat panel's Online tab sets — one editor,
1065
1066
  // one preference, so the profile always agrees with the top bar.
1066
1067
  /* @__PURE__ */ e(
1067
- Ke,
1068
+ Le,
1068
1069
  {
1069
- status: Le(
1070
- (j = r.preferences) == null ? void 0 : j.custom_status
1070
+ status: Re(
1071
+ (I = a.preferences) == null ? void 0 : I.custom_status
1071
1072
  ),
1072
1073
  showExpiry: !0,
1073
1074
  className: "mt-1.5"
1074
1075
  }
1075
1076
  ),
1076
- (x.title || x.department) && /* @__PURE__ */ e("p", { className: "mt-0.5 truncate text-[13px] text-slate-500 dark:text-slate-400", children: [x.title, x.department].filter(Boolean).join(" · ") }),
1077
- /* @__PURE__ */ a("div", { className: "mt-2 flex flex-wrap items-center gap-x-4 gap-y-1 text-[12.5px] text-slate-500 dark:text-slate-400", children: [
1078
- x.company && /* @__PURE__ */ a("span", { className: "inline-flex items-center gap-1.5", children: [
1079
- /* @__PURE__ */ e(ye, { className: "h-3.5 w-3.5" }),
1077
+ (b.title || b.department) && /* @__PURE__ */ e("p", { className: "mt-0.5 truncate text-[13px] text-slate-500 dark:text-slate-400", children: [b.title, b.department].filter(Boolean).join(" · ") }),
1078
+ /* @__PURE__ */ t("div", { className: "mt-2 flex flex-wrap items-center gap-x-4 gap-y-1 text-[12.5px] text-slate-500 dark:text-slate-400", children: [
1079
+ b.company && /* @__PURE__ */ t("span", { className: "inline-flex items-center gap-1.5", children: [
1080
+ /* @__PURE__ */ e(ve, { className: "h-3.5 w-3.5" }),
1080
1081
  " ",
1081
- x.company
1082
+ b.company
1082
1083
  ] }),
1083
- /* @__PURE__ */ a(
1084
+ /* @__PURE__ */ t(
1084
1085
  "a",
1085
1086
  {
1086
- href: `mailto:${x.email}`,
1087
+ href: `mailto:${b.email}`,
1087
1088
  className: "inline-flex items-center gap-1.5 transition-colors hover:text-nvr-navy dark:hover:text-nvr-cyan",
1088
1089
  children: [
1089
- /* @__PURE__ */ e(ve, { className: "h-3.5 w-3.5" }),
1090
+ /* @__PURE__ */ e(ke, { className: "h-3.5 w-3.5" }),
1090
1091
  " ",
1091
- x.email
1092
+ b.email
1092
1093
  ]
1093
1094
  }
1094
1095
  ),
1095
- x.phone && /* @__PURE__ */ a(
1096
+ b.phone && /* @__PURE__ */ t(
1096
1097
  "a",
1097
1098
  {
1098
- href: `tel:${x.phone}`,
1099
+ href: `tel:${b.phone}`,
1099
1100
  className: "inline-flex items-center gap-1.5 transition-colors hover:text-nvr-navy dark:hover:text-nvr-cyan",
1100
1101
  children: [
1101
- /* @__PURE__ */ e(ke, { className: "h-3.5 w-3.5" }),
1102
+ /* @__PURE__ */ e(Ne, { className: "h-3.5 w-3.5" }),
1102
1103
  " ",
1103
- x.phone
1104
+ b.phone
1104
1105
  ]
1105
1106
  }
1106
1107
  ),
1107
- x.last_access && /* @__PURE__ */ a("span", { className: "inline-flex items-center gap-1.5", title: "Last active", children: [
1108
- /* @__PURE__ */ e(Ne, { className: "h-3.5 w-3.5" }),
1109
- new Date(x.last_access).toLocaleDateString(void 0, {
1108
+ b.last_access && /* @__PURE__ */ t("span", { className: "inline-flex items-center gap-1.5", title: "Last active", children: [
1109
+ /* @__PURE__ */ e(we, { className: "h-3.5 w-3.5" }),
1110
+ new Date(b.last_access).toLocaleDateString(void 0, {
1110
1111
  month: "short",
1111
1112
  day: "numeric"
1112
1113
  })
@@ -1114,29 +1115,29 @@ function ut({
1114
1115
  ] })
1115
1116
  ] })
1116
1117
  ] }) }),
1117
- /* @__PURE__ */ e(ht, { tab: q, onChange: g }),
1118
- q === "agents" ? /* @__PURE__ */ e(Qe, {}) : q === "did" && r ? (
1118
+ /* @__PURE__ */ e(bt, { tab: P, onChange: g }),
1119
+ P === "agents" ? /* @__PURE__ */ e(Ue, {}) : P === "did" && a ? (
1119
1120
  // #13 — your own audit trail, by day and collection.
1120
- /* @__PURE__ */ e(Ye, { userId: String(r.id), name: null })
1121
- ) : r ? (
1121
+ /* @__PURE__ */ e(We, { userId: String(a.id), name: null })
1122
+ ) : a ? (
1122
1123
  // One list in reading order — you, then notifications, then access
1123
1124
  // and security — flowing into two balanced columns. Two fixed stacks
1124
1125
  // left thirteen cards on one side and four on the other, and the page
1125
1126
  // ran as long as the heavy side. Cards never split across columns.
1126
- /* @__PURE__ */ a(
1127
+ /* @__PURE__ */ t(
1127
1128
  "div",
1128
1129
  {
1129
1130
  className: "gap-4 lg:columns-2 [&>*]:mb-4 [&>*]:break-inside-avoid",
1130
1131
  "data-profile-columns": !0,
1131
1132
  children: [
1132
1133
  /* @__PURE__ */ e(
1133
- ne,
1134
+ se,
1134
1135
  {
1135
- icon: /* @__PURE__ */ e(_e, { className: "h-4 w-4" }),
1136
+ icon: /* @__PURE__ */ e(Ce, { className: "h-4 w-4" }),
1136
1137
  title: "About you",
1137
1138
  hint: "Shown on your contact card across the app",
1138
- actions: _ && /* @__PURE__ */ a("span", { className: "flex items-center gap-1.5", children: [
1139
- /* @__PURE__ */ a(
1139
+ actions: q && /* @__PURE__ */ t("span", { className: "flex items-center gap-1.5", children: [
1140
+ /* @__PURE__ */ t(
1140
1141
  "button",
1141
1142
  {
1142
1143
  type: "button",
@@ -1144,49 +1145,49 @@ function ut({
1144
1145
  onClick: () => k(null),
1145
1146
  className: "inline-flex h-7 items-center gap-1 rounded-md px-2 text-[11.5px] font-medium text-slate-400 transition-colors hover:text-slate-600 dark:hover:text-slate-200",
1146
1147
  children: [
1147
- /* @__PURE__ */ e(we, { className: "h-3 w-3" }),
1148
+ /* @__PURE__ */ e(Se, { className: "h-3 w-3" }),
1148
1149
  " Reset"
1149
1150
  ]
1150
1151
  }
1151
1152
  ),
1152
- /* @__PURE__ */ a(
1153
+ /* @__PURE__ */ t(
1153
1154
  "button",
1154
1155
  {
1155
1156
  type: "button",
1156
- disabled: O.isPending,
1157
- onClick: () => O.mutate(),
1157
+ disabled: _.isPending,
1158
+ onClick: () => _.mutate(),
1158
1159
  className: "inline-flex h-7 items-center gap-1 rounded-md bg-nvr-cyan px-2.5 text-[11.5px] font-semibold text-white transition-opacity disabled:opacity-50",
1159
1160
  children: [
1160
- O.isPending ? /* @__PURE__ */ e(ie, { className: "h-3 w-3 animate-spin" }) : /* @__PURE__ */ e(Se, { className: "h-3 w-3" }),
1161
+ _.isPending ? /* @__PURE__ */ e(ce, { className: "h-3 w-3 animate-spin" }) : /* @__PURE__ */ e(_e, { className: "h-3 w-3" }),
1161
1162
  " ",
1162
1163
  "Save"
1163
1164
  ]
1164
1165
  }
1165
1166
  )
1166
1167
  ] }),
1167
- children: /* @__PURE__ */ a("div", { className: "grid gap-3 sm:grid-cols-2", children: [
1168
+ children: /* @__PURE__ */ t("div", { className: "grid gap-3 sm:grid-cols-2", children: [
1168
1169
  /* @__PURE__ */ e(
1169
1170
  H,
1170
1171
  {
1171
1172
  label: "First name",
1172
- value: f.first_name,
1173
- onChange: (d) => k({ ...f, first_name: d })
1173
+ value: y.first_name,
1174
+ onChange: (d) => k({ ...y, first_name: d })
1174
1175
  }
1175
1176
  ),
1176
1177
  /* @__PURE__ */ e(
1177
1178
  H,
1178
1179
  {
1179
1180
  label: "Last name",
1180
- value: f.last_name,
1181
- onChange: (d) => k({ ...f, last_name: d })
1181
+ value: y.last_name,
1182
+ onChange: (d) => k({ ...y, last_name: d })
1182
1183
  }
1183
1184
  ),
1184
1185
  /* @__PURE__ */ e(
1185
1186
  H,
1186
1187
  {
1187
1188
  label: "Title",
1188
- value: f.title,
1189
- onChange: (d) => k({ ...f, title: d }),
1189
+ value: y.title,
1190
+ onChange: (d) => k({ ...y, title: d }),
1190
1191
  placeholder: "e.g. Construction Manager"
1191
1192
  }
1192
1193
  ),
@@ -1194,76 +1195,76 @@ function ut({
1194
1195
  H,
1195
1196
  {
1196
1197
  label: "Department",
1197
- value: f.department,
1198
- onChange: (d) => k({ ...f, department: d })
1198
+ value: y.department,
1199
+ onChange: (d) => k({ ...y, department: d })
1199
1200
  }
1200
1201
  ),
1201
1202
  /* @__PURE__ */ e(
1202
1203
  H,
1203
1204
  {
1204
1205
  label: "Phone",
1205
- value: f.phone,
1206
- onChange: (d) => k({ ...f, phone: d }),
1206
+ value: y.phone,
1207
+ onChange: (d) => k({ ...y, phone: d }),
1207
1208
  placeholder: "+1 …",
1208
1209
  type: "tel"
1209
1210
  }
1210
1211
  ),
1211
- /* @__PURE__ */ e(H, { label: "Email", value: r.email ?? "", disabled: !0, hint: "managed by admin" })
1212
+ /* @__PURE__ */ e(H, { label: "Email", value: a.email ?? "", disabled: !0, hint: "managed by admin" })
1212
1213
  ] })
1213
1214
  }
1214
1215
  ),
1215
1216
  /* @__PURE__ */ e(
1216
- Be,
1217
+ He,
1217
1218
  {
1218
- user: r,
1219
+ user: a,
1219
1220
  onSaved: () => {
1220
- o.invalidateQueries({ queryKey: ["nvr-profile-user"] }), o.invalidateQueries({ queryKey: ["nvr-profile-card"] });
1221
+ s.invalidateQueries({ queryKey: ["nvr-profile-user"] }), s.invalidateQueries({ queryKey: ["nvr-profile-card"] });
1221
1222
  }
1222
1223
  }
1223
1224
  ),
1224
- /* @__PURE__ */ e(st, {}),
1225
+ /* @__PURE__ */ e(lt, {}),
1226
+ /* @__PURE__ */ e(dt, {}),
1227
+ /* @__PURE__ */ e(kt, {}),
1228
+ /* @__PURE__ */ e(Ze, {}),
1225
1229
  /* @__PURE__ */ e(it, {}),
1226
- /* @__PURE__ */ e(vt, {}),
1227
- /* @__PURE__ */ e(Ve, {}),
1228
- /* @__PURE__ */ e(ot, {}),
1229
- /* @__PURE__ */ e(Ue, {}),
1230
1230
  /* @__PURE__ */ e($e, {}),
1231
- l.isAdmin && (r != null && r.id) ? /* @__PURE__ */ e(Ze, { userId: String(r.id) }) : /* @__PURE__ */ e(dt, {}),
1232
- /* @__PURE__ */ e(xt, {}),
1233
- /* @__PURE__ */ e(We, { userId: "me" }),
1231
+ /* @__PURE__ */ e(ze, {}),
1232
+ i.isAdmin && (a != null && a.id) ? /* @__PURE__ */ e(Xe, { userId: String(a.id) }) : /* @__PURE__ */ e(ct, {}),
1234
1233
  /* @__PURE__ */ e(gt, {}),
1235
- /* @__PURE__ */ e(lt, {}),
1236
- /* @__PURE__ */ e(Je, {}),
1237
- t !== !1 && /* @__PURE__ */ e(ze, { serviceWorkerPath: t }),
1234
+ /* @__PURE__ */ e(Ge, { userId: "me" }),
1238
1235
  /* @__PURE__ */ e(ft, {}),
1239
- /* @__PURE__ */ e(tt, {}),
1240
- /* @__PURE__ */ e(mt, {}),
1236
+ /* @__PURE__ */ e(ot, {}),
1237
+ /* @__PURE__ */ e(Ve, {}),
1238
+ n !== !1 && /* @__PURE__ */ e(Be, { serviceWorkerPath: n }),
1241
1239
  /* @__PURE__ */ e(yt, {}),
1242
- /* @__PURE__ */ e(bt, {}),
1243
- u
1240
+ /* @__PURE__ */ e(at, {}),
1241
+ /* @__PURE__ */ e(ut, {}),
1242
+ /* @__PURE__ */ e(vt, {}),
1243
+ /* @__PURE__ */ e(xt, {}),
1244
+ p
1244
1245
  ]
1245
1246
  }
1246
1247
  )
1247
1248
  ) : null
1248
1249
  ] });
1249
1250
  }
1250
- function pt() {
1251
+ function ht() {
1251
1252
  try {
1252
- const s = new URLSearchParams(window.location.search).get("tab");
1253
- return s === "agents" || s === "did" ? s : "profile";
1253
+ const o = new URLSearchParams(window.location.search).get("tab");
1254
+ return o === "agents" || o === "did" ? o : "profile";
1254
1255
  } catch {
1255
1256
  return "profile";
1256
1257
  }
1257
1258
  }
1258
- function ht({
1259
- tab: s,
1260
- onChange: u
1259
+ function bt({
1260
+ tab: o,
1261
+ onChange: p
1261
1262
  }) {
1262
- const t = (o) => {
1263
- u(o);
1263
+ const n = (s) => {
1264
+ p(s);
1264
1265
  try {
1265
- const l = new URL(window.location.href);
1266
- o !== "profile" ? l.searchParams.set("tab", o) : l.searchParams.delete("tab"), window.history.replaceState(window.history.state, "", l);
1266
+ const i = new URL(window.location.href);
1267
+ s !== "profile" ? i.searchParams.set("tab", s) : i.searchParams.delete("tab"), window.history.replaceState(window.history.state, "", i);
1267
1268
  } catch {
1268
1269
  }
1269
1270
  };
@@ -1277,70 +1278,70 @@ function ht({
1277
1278
  ["profile", "Profile"],
1278
1279
  ["agents", "What my agents did"],
1279
1280
  ["did", "What I did"]
1280
- ].map(([o, l]) => /* @__PURE__ */ e(
1281
+ ].map(([s, i]) => /* @__PURE__ */ e(
1281
1282
  "button",
1282
1283
  {
1283
1284
  type: "button",
1284
1285
  role: "tab",
1285
- "aria-selected": s === o,
1286
- onClick: () => t(o),
1287
- className: Q(
1286
+ "aria-selected": o === s,
1287
+ onClick: () => n(s),
1288
+ className: j(
1288
1289
  "-mb-px border-b-2 px-3 py-2 text-[13px] font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan/40",
1289
- s === o ? "border-nvr-cyan text-slate-900 dark:text-white" : "border-transparent text-slate-500 hover:text-slate-800 dark:text-slate-400 dark:hover:text-slate-200"
1290
+ o === s ? "border-nvr-cyan text-slate-900 dark:text-white" : "border-transparent text-slate-500 hover:text-slate-800 dark:text-slate-400 dark:hover:text-slate-200"
1290
1291
  ),
1291
- children: l
1292
+ children: i
1292
1293
  },
1293
- o
1294
+ s
1294
1295
  ))
1295
1296
  }
1296
1297
  );
1297
1298
  }
1298
- function bt() {
1299
- const s = A(), [u, t] = C(!1), { data: i = [], isLoading: o } = v({
1299
+ function xt() {
1300
+ const o = F(), [p, n] = C(!1), { data: r = [], isLoading: s } = v({
1300
1301
  queryKey: ["my-matrix-seats"],
1301
- queryFn: () => s.request(T("/pipelines/my-seats")).then((c) => c.data ?? []).catch(() => []),
1302
- enabled: u,
1302
+ queryFn: () => o.request(T("/pipelines/my-seats")).then((c) => c.data ?? []).catch(() => []),
1303
+ enabled: p,
1303
1304
  staleTime: 6e4
1304
- }), l = /* @__PURE__ */ new Map();
1305
- for (const c of i) {
1306
- const m = l.get(c.template_name) ?? [];
1307
- m.push(c), l.set(c.template_name, m);
1305
+ }), i = /* @__PURE__ */ new Map();
1306
+ for (const c of r) {
1307
+ const u = i.get(c.template_name) ?? [];
1308
+ u.push(c), i.set(c.template_name, u);
1308
1309
  }
1309
- return /* @__PURE__ */ a("div", { className: "rounded-lg border border-slate-200 bg-white p-4 dark:border-border dark:bg-card", children: [
1310
- /* @__PURE__ */ a(
1310
+ return /* @__PURE__ */ t("div", { className: "rounded-lg border border-slate-200 bg-white p-4 dark:border-border dark:bg-card", children: [
1311
+ /* @__PURE__ */ t(
1311
1312
  "button",
1312
1313
  {
1313
1314
  type: "button",
1314
- onClick: () => t((c) => !c),
1315
+ onClick: () => n((c) => !c),
1315
1316
  className: "flex w-full items-center justify-between text-left",
1316
1317
  children: [
1317
- /* @__PURE__ */ a("div", { children: [
1318
+ /* @__PURE__ */ t("div", { children: [
1318
1319
  /* @__PURE__ */ e("h3", { className: "text-[14px] font-semibold", children: "My approval seats" }),
1319
1320
  /* @__PURE__ */ e("p", { className: "text-[12px] text-slate-500 dark:text-muted-foreground", children: "Every owner-matrix cell you sit in — why records land in your queue." })
1320
1321
  ] }),
1321
- /* @__PURE__ */ e("span", { className: "text-slate-400", children: u ? "▾" : "▸" })
1322
+ /* @__PURE__ */ e("span", { className: "text-slate-400", children: p ? "▾" : "▸" })
1322
1323
  ]
1323
1324
  }
1324
1325
  ),
1325
- u && (o ? /* @__PURE__ */ e("p", { className: "mt-3 text-[12.5px] text-slate-400", children: "Loading…" }) : i.length === 0 ? /* @__PURE__ */ e("p", { className: "mt-3 text-[12.5px] text-slate-400", children: "You're not in any owner groups — approvals never route to you automatically." }) : /* @__PURE__ */ e("div", { className: "mt-3 space-y-3", children: [...l.entries()].map(([c, m]) => /* @__PURE__ */ a("div", { children: [
1326
+ p && (s ? /* @__PURE__ */ e("p", { className: "mt-3 text-[12.5px] text-slate-400", children: "Loading…" }) : r.length === 0 ? /* @__PURE__ */ e("p", { className: "mt-3 text-[12.5px] text-slate-400", children: "You're not in any owner groups — approvals never route to you automatically." }) : /* @__PURE__ */ e("div", { className: "mt-3 space-y-3", children: [...i.entries()].map(([c, u]) => /* @__PURE__ */ t("div", { children: [
1326
1327
  /* @__PURE__ */ e("p", { className: "text-[11px] font-semibold uppercase tracking-wide text-slate-400", children: c }),
1327
- /* @__PURE__ */ a("ul", { className: "mt-1 space-y-1.5", children: [
1328
- m.slice(0, 40).map((r) => /* @__PURE__ */ a("li", { className: "text-[12.5px]", children: [
1329
- /* @__PURE__ */ e("span", { className: "font-medium", children: r.state_label || r.state_key }),
1330
- r.group_name && /* @__PURE__ */ a("span", { className: "text-slate-500 dark:text-muted-foreground", children: [
1328
+ /* @__PURE__ */ t("ul", { className: "mt-1 space-y-1.5", children: [
1329
+ u.slice(0, 40).map((a) => /* @__PURE__ */ t("li", { className: "text-[12.5px]", children: [
1330
+ /* @__PURE__ */ e("span", { className: "font-medium", children: a.state_label || a.state_key }),
1331
+ a.group_name && /* @__PURE__ */ t("span", { className: "text-slate-500 dark:text-muted-foreground", children: [
1331
1332
  " ",
1332
1333
  "— ",
1333
- r.group_name
1334
+ a.group_name
1334
1335
  ] }),
1335
- (r.is_default === !0 || r.is_default === 1) && /* @__PURE__ */ e("span", { className: "ml-1.5 rounded bg-slate-100 px-1 py-px text-[9.5px] text-slate-500 dark:bg-muted", children: "default" }),
1336
- Array.isArray(r.filters) && r.filters.length > 0 && // "Region: KEY Zone: Zone 1" — what the matrix cell matches on.
1336
+ (a.is_default === !0 || a.is_default === 1) && /* @__PURE__ */ e("span", { className: "ml-1.5 rounded bg-slate-100 px-1 py-px text-[9.5px] text-slate-500 dark:bg-muted", children: "default" }),
1337
+ Array.isArray(a.filters) && a.filters.length > 0 && // "Region: KEY Zone: Zone 1" — what the matrix cell matches on.
1337
1338
  /* @__PURE__ */ e(
1338
1339
  "span",
1339
1340
  {
1340
1341
  "data-seat-filters": !0,
1341
1342
  className: "mt-0.5 flex flex-wrap gap-x-2.5 gap-y-0.5 text-[11.5px]",
1342
- children: r.filters.map((h) => /* @__PURE__ */ a("span", { className: "whitespace-nowrap", children: [
1343
- /* @__PURE__ */ a("span", { className: "text-slate-500 dark:text-slate-400", children: [
1343
+ children: a.filters.map((h) => /* @__PURE__ */ t("span", { className: "whitespace-nowrap", children: [
1344
+ /* @__PURE__ */ t("span", { className: "text-slate-500 dark:text-slate-400", children: [
1344
1345
  h.label ?? h.field,
1345
1346
  ":"
1346
1347
  ] }),
@@ -1349,65 +1350,65 @@ function bt() {
1349
1350
  ] }, h.field))
1350
1351
  }
1351
1352
  )
1352
- ] }, r.group_id)),
1353
- m.length > 40 && /* @__PURE__ */ a("li", { className: "text-[11.5px] text-slate-400", children: [
1353
+ ] }, a.group_id)),
1354
+ u.length > 40 && /* @__PURE__ */ t("li", { className: "text-[11.5px] text-slate-400", children: [
1354
1355
  "…and ",
1355
- m.length - 40,
1356
+ u.length - 40,
1356
1357
  " more"
1357
1358
  ] })
1358
1359
  ] })
1359
1360
  ] }, c)) }))
1360
1361
  ] });
1361
1362
  }
1362
- function xt() {
1363
- const s = A(), u = M(), { data: t = [] } = v({
1363
+ function gt() {
1364
+ const o = F(), p = M(), { data: n = [] } = v({
1364
1365
  queryKey: ["my-reminders"],
1365
- queryFn: () => s.request(T("/reminders")).then((p) => p.data).catch(() => []),
1366
+ queryFn: () => o.request(T("/reminders")).then((m) => m.data).catch(() => []),
1366
1367
  staleTime: 3e4
1367
- }), [i, o] = C(""), [l, c] = C(""), m = () => void u.invalidateQueries({ queryKey: ["my-reminders"] }), r = w({
1368
- mutationFn: () => s.request(ee("/reminders", { note: i, remind_at: new Date(l).toISOString() })),
1368
+ }), [r, s] = C(""), [i, c] = C(""), u = () => void p.invalidateQueries({ queryKey: ["my-reminders"] }), a = w({
1369
+ mutationFn: () => o.request(ee("/reminders", { note: r, remind_at: new Date(i).toISOString() })),
1369
1370
  onSuccess: () => {
1370
- o(""), c(""), m();
1371
+ s(""), c(""), u();
1371
1372
  }
1372
1373
  }), h = w({
1373
- mutationFn: (p) => s.request(Oe(`/reminders/${p}`)),
1374
- onSuccess: m
1374
+ mutationFn: (m) => o.request(De(`/reminders/${m}`)),
1375
+ onSuccess: u
1375
1376
  });
1376
- return /* @__PURE__ */ a("div", { className: "rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card", children: [
1377
- /* @__PURE__ */ a("header", { className: "border-b border-slate-100 px-4 py-2.5 dark:border-border/60", children: [
1377
+ return /* @__PURE__ */ t("div", { className: "rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card", children: [
1378
+ /* @__PURE__ */ t("header", { className: "border-b border-slate-100 px-4 py-2.5 dark:border-border/60", children: [
1378
1379
  /* @__PURE__ */ e("h3", { className: "text-[13px] font-semibold text-slate-800 dark:text-slate-100", children: "Reminders" }),
1379
1380
  /* @__PURE__ */ e("p", { className: "mt-0.5 text-[11px] text-slate-400", children: `Personal nudges delivered as notifications at the time you pick. The chat bot's "remind me…" requests land here too.` })
1380
1381
  ] }),
1381
- /* @__PURE__ */ a("div", { className: "space-y-2 px-4 py-3", children: [
1382
- t.length === 0 && /* @__PURE__ */ e("p", { className: "text-[12px] text-slate-400", children: "No upcoming reminders." }),
1383
- t.map((p) => /* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
1384
- /* @__PURE__ */ a("div", { className: "min-w-0 flex-1", children: [
1385
- /* @__PURE__ */ e("p", { className: "truncate text-[12.5px] text-slate-700 dark:text-slate-200", children: p.note }),
1386
- /* @__PURE__ */ e("p", { className: "text-[11px] text-slate-400", children: new Date(p.remind_at).toLocaleString() })
1382
+ /* @__PURE__ */ t("div", { className: "space-y-2 px-4 py-3", children: [
1383
+ n.length === 0 && /* @__PURE__ */ e("p", { className: "text-[12px] text-slate-400", children: "No upcoming reminders." }),
1384
+ n.map((m) => /* @__PURE__ */ t("div", { className: "flex items-center gap-2", children: [
1385
+ /* @__PURE__ */ t("div", { className: "min-w-0 flex-1", children: [
1386
+ /* @__PURE__ */ e("p", { className: "truncate text-[12.5px] text-slate-700 dark:text-slate-200", children: m.note }),
1387
+ /* @__PURE__ */ e("p", { className: "text-[11px] text-slate-400", children: new Date(m.remind_at).toLocaleString() })
1387
1388
  ] }),
1388
1389
  /* @__PURE__ */ e(
1389
1390
  "button",
1390
1391
  {
1391
1392
  type: "button",
1392
- onClick: () => h.mutate(p.id),
1393
+ onClick: () => h.mutate(m.id),
1393
1394
  className: "shrink-0 rounded px-1.5 py-0.5 text-[11px] text-slate-400 hover:bg-red-50 hover:text-red-600 dark:hover:bg-red-500/10",
1394
1395
  children: "Cancel"
1395
1396
  }
1396
1397
  )
1397
- ] }, p.id)),
1398
- /* @__PURE__ */ a(
1398
+ ] }, m.id)),
1399
+ /* @__PURE__ */ t(
1399
1400
  "form",
1400
1401
  {
1401
1402
  className: "flex flex-wrap items-center gap-2 pt-1",
1402
- onSubmit: (p) => {
1403
- p.preventDefault(), i.trim() && l && r.mutate();
1403
+ onSubmit: (m) => {
1404
+ m.preventDefault(), r.trim() && i && a.mutate();
1404
1405
  },
1405
1406
  children: [
1406
1407
  /* @__PURE__ */ e(
1407
1408
  "input",
1408
1409
  {
1409
- value: i,
1410
- onChange: (p) => o(p.target.value),
1410
+ value: r,
1411
+ onChange: (m) => s(m.target.value),
1411
1412
  placeholder: "Remind me to…",
1412
1413
  className: "h-7 min-w-[160px] flex-1 rounded border border-slate-200 px-2 text-[12px] outline-none focus:border-nvr-cyan dark:border-border dark:bg-background"
1413
1414
  }
@@ -1416,8 +1417,8 @@ function xt() {
1416
1417
  "input",
1417
1418
  {
1418
1419
  type: "datetime-local",
1419
- value: l,
1420
- onChange: (p) => c(p.target.value),
1420
+ value: i,
1421
+ onChange: (m) => c(m.target.value),
1421
1422
  className: "h-7 rounded border border-slate-200 px-2 text-[12px] outline-none focus:border-nvr-cyan dark:border-border dark:bg-background"
1422
1423
  }
1423
1424
  ),
@@ -1425,9 +1426,9 @@ function xt() {
1425
1426
  "button",
1426
1427
  {
1427
1428
  type: "submit",
1428
- disabled: !i.trim() || !l || r.isPending,
1429
+ disabled: !r.trim() || !i || a.isPending,
1429
1430
  className: "h-7 rounded bg-nvr-cyan px-2.5 text-[11.5px] font-medium text-white hover:bg-nvr-cyan-dark disabled:opacity-50",
1430
- children: r.isPending ? "Adding…" : "Add"
1431
+ children: a.isPending ? "Adding…" : "Add"
1431
1432
  }
1432
1433
  )
1433
1434
  ]
@@ -1436,55 +1437,55 @@ function xt() {
1436
1437
  ] })
1437
1438
  ] });
1438
1439
  }
1439
- function gt() {
1440
- const s = A(), { data: u } = v({
1440
+ function ft() {
1441
+ const o = F(), { data: p } = v({
1441
1442
  queryKey: ["my-stats"],
1442
- queryFn: () => s.request(T("/users/me/stats")).then((i) => i.data).catch(() => null),
1443
+ queryFn: () => o.request(T("/users/me/stats")).then((r) => r.data).catch(() => null),
1443
1444
  staleTime: 5 * 6e4
1444
1445
  });
1445
- if (!u) return null;
1446
- const t = Math.max(1, ...u.weeks.map((i) => i.transitions + i.tasks_done + i.created));
1447
- return /* @__PURE__ */ a("div", { className: "rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card", children: [
1448
- /* @__PURE__ */ a("header", { className: "flex items-center justify-between border-b border-slate-100 px-4 py-2.5 dark:border-border/60", children: [
1449
- /* @__PURE__ */ a("div", { children: [
1446
+ if (!p) return null;
1447
+ const n = Math.max(1, ...p.weeks.map((r) => r.transitions + r.tasks_done + r.created));
1448
+ return /* @__PURE__ */ t("div", { className: "rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card", children: [
1449
+ /* @__PURE__ */ t("header", { className: "flex items-center justify-between border-b border-slate-100 px-4 py-2.5 dark:border-border/60", children: [
1450
+ /* @__PURE__ */ t("div", { children: [
1450
1451
  /* @__PURE__ */ e("h3", { className: "text-[13px] font-semibold text-slate-800 dark:text-slate-100", children: "My activity" }),
1451
1452
  /* @__PURE__ */ e("p", { className: "mt-0.5 text-[11px] text-slate-400", children: "Last 8 weeks — just yours." })
1452
1453
  ] }),
1453
- u.streak_days > 1 && /* @__PURE__ */ a("span", { className: "rounded-full bg-nvr-cyan/10 px-2 py-0.5 text-[11px] font-medium text-nvr-navy dark:text-nvr-cyan", children: [
1454
- u.streak_days,
1454
+ p.streak_days > 1 && /* @__PURE__ */ t("span", { className: "rounded-full bg-nvr-cyan/10 px-2 py-0.5 text-[11px] font-medium text-nvr-navy dark:text-nvr-cyan", children: [
1455
+ p.streak_days,
1455
1456
  "-day streak"
1456
1457
  ] })
1457
1458
  ] }),
1458
- /* @__PURE__ */ a("div", { className: "px-4 py-3", children: [
1459
- /* @__PURE__ */ e("div", { className: "flex items-end gap-1.5", style: { height: 56 }, children: u.weeks.map((i, o) => {
1460
- const l = i.transitions + i.tasks_done + i.created;
1459
+ /* @__PURE__ */ t("div", { className: "px-4 py-3", children: [
1460
+ /* @__PURE__ */ e("div", { className: "flex items-end gap-1.5", style: { height: 56 }, children: p.weeks.map((r, s) => {
1461
+ const i = r.transitions + r.tasks_done + r.created;
1461
1462
  return /* @__PURE__ */ e(
1462
1463
  "div",
1463
1464
  {
1464
1465
  className: "flex-1 rounded-t bg-nvr-cyan/60 transition-all dark:bg-nvr-cyan/40",
1465
- style: { height: `${Math.max(4, l / t * 100)}%` },
1466
- "data-tip": `${l} action${l === 1 ? "" : "s"}: ${i.transitions} transitions, ${i.tasks_done} tasks done, ${i.created} created`
1466
+ style: { height: `${Math.max(4, i / n * 100)}%` },
1467
+ "data-tip": `${i} action${i === 1 ? "" : "s"}: ${r.transitions} transitions, ${r.tasks_done} tasks done, ${r.created} created`
1467
1468
  },
1468
- o
1469
+ s
1469
1470
  );
1470
1471
  }) }),
1471
- /* @__PURE__ */ a("div", { className: "mt-2 flex items-center justify-between text-[11px] text-slate-400", children: [
1472
+ /* @__PURE__ */ t("div", { className: "mt-2 flex items-center justify-between text-[11px] text-slate-400", children: [
1472
1473
  /* @__PURE__ */ e("span", { children: "8 weeks ago" }),
1473
1474
  /* @__PURE__ */ e("span", { children: "this week" })
1474
1475
  ] }),
1475
- /* @__PURE__ */ a("div", { className: "mt-2 flex flex-wrap gap-x-4 gap-y-1 text-[11.5px] text-slate-500 dark:text-muted-foreground", children: [
1476
- /* @__PURE__ */ a("span", { children: [
1477
- /* @__PURE__ */ e("b", { className: "tabular-nums text-slate-700 dark:text-slate-200", children: u.totals.transitions }),
1476
+ /* @__PURE__ */ t("div", { className: "mt-2 flex flex-wrap gap-x-4 gap-y-1 text-[11.5px] text-slate-500 dark:text-muted-foreground", children: [
1477
+ /* @__PURE__ */ t("span", { children: [
1478
+ /* @__PURE__ */ e("b", { className: "tabular-nums text-slate-700 dark:text-slate-200", children: p.totals.transitions }),
1478
1479
  " ",
1479
1480
  "transitions"
1480
1481
  ] }),
1481
- /* @__PURE__ */ a("span", { children: [
1482
- /* @__PURE__ */ e("b", { className: "tabular-nums text-slate-700 dark:text-slate-200", children: u.totals.tasks_done }),
1482
+ /* @__PURE__ */ t("span", { children: [
1483
+ /* @__PURE__ */ e("b", { className: "tabular-nums text-slate-700 dark:text-slate-200", children: p.totals.tasks_done }),
1483
1484
  " ",
1484
1485
  "tasks done"
1485
1486
  ] }),
1486
- /* @__PURE__ */ a("span", { children: [
1487
- /* @__PURE__ */ e("b", { className: "tabular-nums text-slate-700 dark:text-slate-200", children: u.totals.created }),
1487
+ /* @__PURE__ */ t("span", { children: [
1488
+ /* @__PURE__ */ e("b", { className: "tabular-nums text-slate-700 dark:text-slate-200", children: p.totals.created }),
1488
1489
  " ",
1489
1490
  "records created"
1490
1491
  ] })
@@ -1492,185 +1493,185 @@ function gt() {
1492
1493
  ] })
1493
1494
  ] });
1494
1495
  }
1495
- function ft() {
1496
- const s = A(), u = M(), { data: t } = v({
1496
+ function yt() {
1497
+ const o = F(), p = M(), { data: n } = v({
1497
1498
  queryKey: ["my-security"],
1498
- queryFn: () => s.request(T("/security/my/sessions")).then((l) => l.data).catch(() => ({ sessions: [], logins: [] })),
1499
+ queryFn: () => o.request(T("/security/my/sessions")).then((i) => i.data).catch(() => ({ sessions: [], logins: [] })),
1499
1500
  staleTime: 3e4
1500
- }), i = w({
1501
- mutationFn: () => s.request(ee("/security/my/sessions/sign-out-others", {})).then((l) => l.data),
1502
- onSuccess: (l) => {
1503
- u.invalidateQueries({ queryKey: ["my-security"] }), o(`Signed out ${(l == null ? void 0 : l.revoked) ?? 0} other session(s)`);
1501
+ }), r = w({
1502
+ mutationFn: () => o.request(ee("/security/my/sessions/sign-out-others", {})).then((i) => i.data),
1503
+ onSuccess: (i) => {
1504
+ p.invalidateQueries({ queryKey: ["my-security"] }), s(`Signed out ${(i == null ? void 0 : i.revoked) ?? 0} other session(s)`);
1504
1505
  },
1505
- onError: (l) => {
1506
- var m, r;
1507
- const c = ((r = (m = l == null ? void 0 : l.response) == null ? void 0 : m.data) == null ? void 0 : r.error) ?? "Could not sign out your other sessions — try again.";
1506
+ onError: (i) => {
1507
+ var u, a;
1508
+ const c = ((a = (u = i == null ? void 0 : i.response) == null ? void 0 : u.data) == null ? void 0 : a.error) ?? "Could not sign out your other sessions — try again.";
1508
1509
  import("sonner").then(({ toast: h }) => h.error(c)).catch(() => {
1509
1510
  });
1510
1511
  }
1511
- }), o = (l) => {
1512
+ }), s = (i) => {
1512
1513
  try {
1513
- import("sonner").then(({ toast: c }) => c.success(l));
1514
+ import("sonner").then(({ toast: c }) => c.success(i));
1514
1515
  } catch {
1515
1516
  }
1516
1517
  };
1517
- return /* @__PURE__ */ a("div", { className: "rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card", children: [
1518
- /* @__PURE__ */ a("header", { className: "flex items-center justify-between border-b border-slate-100 px-4 py-2.5 dark:border-border/60", children: [
1519
- /* @__PURE__ */ a("div", { children: [
1518
+ return /* @__PURE__ */ t("div", { className: "rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card", children: [
1519
+ /* @__PURE__ */ t("header", { className: "flex items-center justify-between border-b border-slate-100 px-4 py-2.5 dark:border-border/60", children: [
1520
+ /* @__PURE__ */ t("div", { children: [
1520
1521
  /* @__PURE__ */ e("h3", { className: "text-[13px] font-semibold text-slate-800 dark:text-slate-100", children: "Security" }),
1521
1522
  /* @__PURE__ */ e("p", { className: "mt-0.5 text-[11px] text-slate-400", children: "Your active sessions and recent sign-ins." })
1522
1523
  ] }),
1523
- ((t == null ? void 0 : t.sessions.length) ?? 0) > 1 && /* @__PURE__ */ e(
1524
+ ((n == null ? void 0 : n.sessions.length) ?? 0) > 1 && /* @__PURE__ */ e(
1524
1525
  "button",
1525
1526
  {
1526
1527
  type: "button",
1527
- disabled: i.isPending,
1528
- onClick: () => i.mutate(),
1528
+ disabled: r.isPending,
1529
+ onClick: () => r.mutate(),
1529
1530
  className: "rounded-md border border-red-200 px-2 py-1 text-[11.5px] text-red-600 hover:bg-red-50 disabled:opacity-50 dark:border-red-500/30",
1530
1531
  children: "Sign out everywhere else"
1531
1532
  }
1532
1533
  )
1533
1534
  ] }),
1534
- /* @__PURE__ */ a("div", { className: "space-y-2 p-4", children: [
1535
- /* @__PURE__ */ a("p", { className: "text-[11px] font-semibold uppercase tracking-wide text-slate-400", children: [
1535
+ /* @__PURE__ */ t("div", { className: "space-y-2 p-4", children: [
1536
+ /* @__PURE__ */ t("p", { className: "text-[11px] font-semibold uppercase tracking-wide text-slate-400", children: [
1536
1537
  "Active sessions (",
1537
- (t == null ? void 0 : t.sessions.length) ?? 0,
1538
+ (n == null ? void 0 : n.sessions.length) ?? 0,
1538
1539
  ")"
1539
1540
  ] }),
1540
- ((t == null ? void 0 : t.sessions) ?? []).map((l) => /* @__PURE__ */ a(
1541
+ ((n == null ? void 0 : n.sessions) ?? []).map((i) => /* @__PURE__ */ t(
1541
1542
  "p",
1542
1543
  {
1543
1544
  className: "flex items-center gap-2 text-[12px] text-slate-600 dark:text-slate-300",
1544
1545
  children: [
1545
- /* @__PURE__ */ a("span", { className: "font-mono text-slate-400", children: [
1546
- l.sid_prefix,
1546
+ /* @__PURE__ */ t("span", { className: "font-mono text-slate-400", children: [
1547
+ i.sid_prefix,
1547
1548
  "…"
1548
1549
  ] }),
1549
- l.current && /* @__PURE__ */ e("span", { className: "rounded bg-nvr-cyan/[0.08] px-1.5 py-px text-[10px] font-medium text-[#007a99] dark:text-nvr-cyan", children: "this session" }),
1550
- /* @__PURE__ */ a("span", { className: "ml-auto text-[11px] text-slate-400", children: [
1550
+ i.current && /* @__PURE__ */ e("span", { className: "rounded bg-nvr-cyan/[0.08] px-1.5 py-px text-[10px] font-medium text-[#007a99] dark:text-nvr-cyan", children: "this session" }),
1551
+ /* @__PURE__ */ t("span", { className: "ml-auto text-[11px] text-slate-400", children: [
1551
1552
  "expires in ",
1552
- Math.round(l.ttl_seconds / 3600),
1553
+ Math.round(i.ttl_seconds / 3600),
1553
1554
  "h"
1554
1555
  ] })
1555
1556
  ]
1556
1557
  },
1557
- l.sid_prefix
1558
+ i.sid_prefix
1558
1559
  )),
1559
- ((t == null ? void 0 : t.logins) ?? []).length > 0 && /* @__PURE__ */ a(X, { children: [
1560
+ ((n == null ? void 0 : n.logins) ?? []).length > 0 && /* @__PURE__ */ t(X, { children: [
1560
1561
  /* @__PURE__ */ e("p", { className: "pt-1 text-[11px] font-semibold uppercase tracking-wide text-slate-400", children: "Recent sign-ins" }),
1561
- ((t == null ? void 0 : t.logins) ?? []).slice(0, 8).map((l, c) => (
1562
+ ((n == null ? void 0 : n.logins) ?? []).slice(0, 8).map((i, c) => (
1562
1563
  // biome-ignore lint/suspicious/noArrayIndexKey: log rows
1563
- /* @__PURE__ */ a("p", { className: "flex items-center gap-2 text-[11.5px] text-slate-500", children: [
1564
- /* @__PURE__ */ e("span", { className: "font-mono", children: l.ip ?? "—" }),
1565
- l.new_ip && /* @__PURE__ */ e("span", { className: "rounded bg-amber-100 px-1 text-[9.5px] font-semibold text-amber-700 dark:bg-amber-400/15 dark:text-amber-400", children: "new IP" }),
1566
- /* @__PURE__ */ e("span", { className: "ml-auto text-slate-400", children: new Date(l.created_at).toLocaleString() })
1564
+ /* @__PURE__ */ t("p", { className: "flex items-center gap-2 text-[11.5px] text-slate-500", children: [
1565
+ /* @__PURE__ */ e("span", { className: "font-mono", children: i.ip ?? "—" }),
1566
+ i.new_ip && /* @__PURE__ */ e("span", { className: "rounded bg-amber-100 px-1 text-[9.5px] font-semibold text-amber-700 dark:bg-amber-400/15 dark:text-amber-400", children: "new IP" }),
1567
+ /* @__PURE__ */ e("span", { className: "ml-auto text-slate-400", children: new Date(i.created_at).toLocaleString() })
1567
1568
  ] }, c)
1568
1569
  ))
1569
1570
  ] })
1570
1571
  ] })
1571
1572
  ] });
1572
1573
  }
1573
- function yt() {
1574
- const s = A(), [u, t] = C(!1), { data: i } = v({
1574
+ function vt() {
1575
+ const o = F(), [p, n] = C(!1), { data: r } = v({
1575
1576
  queryKey: ["my-permissions"],
1576
- queryFn: () => s.request(T("/security/my/permissions")).then((o) => o.data),
1577
- enabled: u,
1577
+ queryFn: () => o.request(T("/security/my/permissions")).then((s) => s.data),
1578
+ enabled: p,
1578
1579
  staleTime: 5 * 6e4
1579
1580
  });
1580
- return /* @__PURE__ */ a("div", { className: "rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card", children: [
1581
- /* @__PURE__ */ a(
1581
+ return /* @__PURE__ */ t("div", { className: "rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card", children: [
1582
+ /* @__PURE__ */ t(
1582
1583
  "button",
1583
1584
  {
1584
1585
  type: "button",
1585
- onClick: () => t((o) => !o),
1586
+ onClick: () => n((s) => !s),
1586
1587
  className: "flex w-full items-center justify-between px-4 py-2.5 text-left",
1587
1588
  children: [
1588
- /* @__PURE__ */ a("div", { children: [
1589
+ /* @__PURE__ */ t("div", { children: [
1589
1590
  /* @__PURE__ */ e("h3", { className: "text-[13px] font-semibold text-slate-800 dark:text-slate-100", children: "What can I access?" }),
1590
1591
  /* @__PURE__ */ e("p", { className: "mt-0.5 text-[11px] text-slate-400", children: "Your role, collections, and data limits in plain language." })
1591
1592
  ] }),
1592
- /* @__PURE__ */ e("span", { className: "text-[11px] text-slate-400", children: u ? "Hide" : "Show" })
1593
+ /* @__PURE__ */ e("span", { className: "text-[11px] text-slate-400", children: p ? "Hide" : "Show" })
1593
1594
  ]
1594
1595
  }
1595
1596
  ),
1596
- u && i && /* @__PURE__ */ a("div", { className: "space-y-2 border-t border-slate-100 px-4 py-3 text-[12.5px] text-slate-600 dark:border-border/60 dark:text-slate-300", children: [
1597
- /* @__PURE__ */ a("p", { children: [
1597
+ p && r && /* @__PURE__ */ t("div", { className: "space-y-2 border-t border-slate-100 px-4 py-3 text-[12.5px] text-slate-600 dark:border-border/60 dark:text-slate-300", children: [
1598
+ /* @__PURE__ */ t("p", { children: [
1598
1599
  "Your role is ",
1599
- /* @__PURE__ */ e("b", { children: i.role ?? "unassigned" }),
1600
- i.is_admin && " — an administrator role with access to everything",
1600
+ /* @__PURE__ */ e("b", { children: r.role ?? "unassigned" }),
1601
+ r.is_admin && " — an administrator role with access to everything",
1601
1602
  "."
1602
1603
  ] }),
1603
- i.scopes.length > 0 && /* @__PURE__ */ a("p", { children: [
1604
+ r.scopes.length > 0 && /* @__PURE__ */ t("p", { children: [
1604
1605
  "Your data is limited to:",
1605
1606
  " ",
1606
- i.scopes.map((o) => `${o.dimension}: ${o.values.join(", ")}`).join(" · ")
1607
+ r.scopes.map((s) => `${s.dimension}: ${s.values.join(", ")}`).join(" · ")
1607
1608
  ] }),
1608
- !i.is_admin && /* @__PURE__ */ a("div", { children: [
1609
- /* @__PURE__ */ a("p", { className: "mb-1 text-[11px] font-semibold uppercase tracking-wide text-slate-400", children: [
1609
+ !r.is_admin && /* @__PURE__ */ t("div", { children: [
1610
+ /* @__PURE__ */ t("p", { className: "mb-1 text-[11px] font-semibold uppercase tracking-wide text-slate-400", children: [
1610
1611
  "Collections (",
1611
- i.collections.length,
1612
+ r.collections.length,
1612
1613
  ")"
1613
1614
  ] }),
1614
- /* @__PURE__ */ e("div", { className: "max-h-48 overflow-y-auto", children: i.collections.map((o) => /* @__PURE__ */ a(
1615
+ /* @__PURE__ */ e("div", { className: "max-h-48 overflow-y-auto", children: r.collections.map((s) => /* @__PURE__ */ t(
1615
1616
  "p",
1616
1617
  {
1617
1618
  className: "flex items-center gap-2 border-b border-slate-50 py-0.5 text-[12px] last:border-b-0 dark:border-border/40",
1618
1619
  children: [
1619
- /* @__PURE__ */ e("span", { className: "font-mono", children: o.collection }),
1620
- /* @__PURE__ */ e("span", { className: "ml-auto text-[10.5px] text-slate-400", children: [...new Set(o.actions)].join(" · ") })
1620
+ /* @__PURE__ */ e("span", { className: "font-mono", children: s.collection }),
1621
+ /* @__PURE__ */ e("span", { className: "ml-auto text-[10.5px] text-slate-400", children: [...new Set(s.actions)].join(" · ") })
1621
1622
  ]
1622
1623
  },
1623
- o.collection
1624
+ s.collection
1624
1625
  )) })
1625
1626
  ] })
1626
1627
  ] })
1627
1628
  ] });
1628
1629
  }
1629
- function vt() {
1630
- const s = A(), u = M(), { data: t } = v({
1630
+ function kt() {
1631
+ const o = F(), p = M(), { data: n } = v({
1631
1632
  queryKey: ["nvr-profile-prefs"],
1632
- queryFn: () => s.request(T("/users/me")).then((m) => {
1633
- var r;
1634
- return ((r = m.data) == null ? void 0 : r.preferences) ?? {};
1633
+ queryFn: () => o.request(T("/users/me")).then((u) => {
1634
+ var a;
1635
+ return ((a = u.data) == null ? void 0 : a.preferences) ?? {};
1635
1636
  })
1636
- }), i = w({
1637
- mutationFn: (m) => s.request(G("/users/me/preferences", m)),
1638
- onSuccess: (m, r) => {
1639
- u.invalidateQueries({ queryKey: ["nvr-profile-prefs"] }), re(Object.keys(r)), import("sonner").then(
1637
+ }), r = w({
1638
+ mutationFn: (u) => o.request(G("/users/me/preferences", u)),
1639
+ onSuccess: (u, a) => {
1640
+ p.invalidateQueries({ queryKey: ["nvr-profile-prefs"] }), re(Object.keys(a)), import("sonner").then(
1640
1641
  ({ toast: h }) => h.success("Saved — applied on all your open tabs and devices")
1641
1642
  );
1642
1643
  }
1643
- }), o = (t == null ? void 0 : t.number_format) ?? {}, { data: l = [ae, ...ce] } = v({
1644
+ }), s = (n == null ? void 0 : n.number_format) ?? {}, { data: i = [ae, ...ue] } = v({
1644
1645
  queryKey: ["nvr-theme-accents"],
1645
- queryFn: () => s.request(
1646
+ queryFn: () => o.request(
1646
1647
  T("/settings")
1647
- ).then((m) => {
1648
- var r, h;
1648
+ ).then((u) => {
1649
+ var a, h;
1649
1650
  return [
1650
- { ...ae, color: ((r = m.data) == null ? void 0 : r.project_color) ?? null },
1651
- ...De((h = m.data) == null ? void 0 : h.theme_accents)
1651
+ { ...ae, color: ((a = u.data) == null ? void 0 : a.project_color) ?? null },
1652
+ ...Me((h = u.data) == null ? void 0 : h.theme_accents)
1652
1653
  ];
1653
- }).catch(() => [ae, ...ce]),
1654
+ }).catch(() => [ae, ...ue]),
1654
1655
  staleTime: 5 * 6e4
1655
- }), c = typeof (t == null ? void 0 : t.theme_accent) == "string" ? t.theme_accent : "brand";
1656
- return /* @__PURE__ */ a(
1656
+ }), c = typeof (n == null ? void 0 : n.theme_accent) == "string" ? n.theme_accent : "brand";
1657
+ return /* @__PURE__ */ t(
1657
1658
  "div",
1658
1659
  {
1659
1660
  "data-profile-card": "display",
1660
1661
  className: "rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card",
1661
1662
  children: [
1662
- /* @__PURE__ */ a("header", { className: "border-b border-slate-100 px-4 py-2.5 dark:border-border/60", children: [
1663
+ /* @__PURE__ */ t("header", { className: "border-b border-slate-100 px-4 py-2.5 dark:border-border/60", children: [
1663
1664
  /* @__PURE__ */ e("h3", { className: "text-[13px] font-semibold text-slate-800 dark:text-slate-100", children: "Display" }),
1664
1665
  /* @__PURE__ */ e("p", { className: "mt-0.5 text-[11px] text-slate-400", children: "How times, numbers and text render for you." })
1665
1666
  ] }),
1666
- /* @__PURE__ */ a("div", { className: "flex flex-wrap items-center gap-x-5 gap-y-2.5 p-4 text-[12.5px] text-slate-600 dark:text-muted-foreground", children: [
1667
- /* @__PURE__ */ a("label", { className: "flex items-center gap-1.5", children: [
1667
+ /* @__PURE__ */ t("div", { className: "flex flex-wrap items-center gap-x-5 gap-y-2.5 p-4 text-[12.5px] text-slate-600 dark:text-muted-foreground", children: [
1668
+ /* @__PURE__ */ t("label", { className: "flex items-center gap-1.5", children: [
1668
1669
  "Timestamps",
1669
1670
  /* @__PURE__ */ e(
1670
- U,
1671
+ E,
1671
1672
  {
1672
- value: String((t == null ? void 0 : t.time_display) ?? "relative"),
1673
- onChange: (m) => i.mutate({ time_display: m }),
1673
+ value: String((n == null ? void 0 : n.time_display) ?? "relative"),
1674
+ onChange: (u) => r.mutate({ time_display: u }),
1674
1675
  options: [
1675
1676
  { value: "relative", label: "Relative (3h ago)" },
1676
1677
  { value: "exact", label: "Exact (Aug 24, 3:12 PM)" }
@@ -1678,39 +1679,39 @@ function vt() {
1678
1679
  }
1679
1680
  )
1680
1681
  ] }),
1681
- /* @__PURE__ */ a("label", { htmlFor: "pref-compact-numbers", className: "flex cursor-pointer items-center gap-1.5", children: [
1682
+ /* @__PURE__ */ t("label", { htmlFor: "pref-compact-numbers", className: "flex cursor-pointer items-center gap-1.5", children: [
1682
1683
  /* @__PURE__ */ e(
1683
1684
  "input",
1684
1685
  {
1685
1686
  id: "pref-compact-numbers",
1686
1687
  type: "checkbox",
1687
1688
  "aria-label": "Compact numbers (1.2M)",
1688
- checked: o.compact === !0,
1689
- onChange: (m) => i.mutate({ number_format: { ...o, compact: m.target.checked } }),
1689
+ checked: s.compact === !0,
1690
+ onChange: (u) => r.mutate({ number_format: { ...s, compact: u.target.checked } }),
1690
1691
  className: "rounded"
1691
1692
  }
1692
1693
  ),
1693
1694
  "Compact numbers (1.2M)"
1694
1695
  ] }),
1695
- /* @__PURE__ */ a("label", { className: "flex items-center gap-1.5", children: [
1696
+ /* @__PURE__ */ t("label", { className: "flex items-center gap-1.5", children: [
1696
1697
  "Number locale",
1697
1698
  /* @__PURE__ */ e(
1698
1699
  "input",
1699
1700
  {
1700
- defaultValue: o.locale ?? "",
1701
- onBlur: (m) => i.mutate({ number_format: { ...o, locale: m.target.value.trim() || void 0 } }),
1701
+ defaultValue: s.locale ?? "",
1702
+ onBlur: (u) => r.mutate({ number_format: { ...s, locale: u.target.value.trim() || void 0 } }),
1702
1703
  placeholder: "en-US",
1703
1704
  className: "h-7 w-20 rounded-md border border-slate-200 bg-background px-1.5 text-[12px] dark:border-border"
1704
1705
  }
1705
1706
  )
1706
1707
  ] }),
1707
- /* @__PURE__ */ a("label", { className: "flex items-center gap-1.5", children: [
1708
+ /* @__PURE__ */ t("label", { className: "flex items-center gap-1.5", children: [
1708
1709
  "Week starts",
1709
1710
  /* @__PURE__ */ e(
1710
- U,
1711
+ E,
1711
1712
  {
1712
- value: String((t == null ? void 0 : t.week_start) ?? "sun"),
1713
- onChange: (m) => i.mutate({ week_start: m }),
1713
+ value: String((n == null ? void 0 : n.week_start) ?? "sun"),
1714
+ onChange: (u) => r.mutate({ week_start: u }),
1714
1715
  options: [
1715
1716
  { value: "sun", label: "Sunday" },
1716
1717
  { value: "mon", label: "Monday" }
@@ -1718,36 +1719,36 @@ function vt() {
1718
1719
  }
1719
1720
  )
1720
1721
  ] }),
1721
- /* @__PURE__ */ a("div", { className: "flex items-center gap-1.5", "data-theme-accent-picker": !0, children: [
1722
+ /* @__PURE__ */ t("div", { className: "flex items-center gap-1.5", "data-theme-accent-picker": !0, children: [
1722
1723
  "Accent",
1723
- /* @__PURE__ */ e("span", { className: "flex items-center gap-1", children: l.map((m) => {
1724
- const r = m.key === "brand" && c === "brand" || m.key === c;
1724
+ /* @__PURE__ */ e("span", { className: "flex items-center gap-1", children: i.map((u) => {
1725
+ const a = u.key === "brand" && c === "brand" || u.key === c;
1725
1726
  return /* @__PURE__ */ e(
1726
1727
  "button",
1727
1728
  {
1728
1729
  type: "button",
1729
- title: m.label,
1730
- "aria-label": `Accent ${m.label}`,
1731
- "aria-pressed": r,
1732
- "data-theme-accent": m.key,
1733
- onClick: () => i.mutate({ theme_accent: m.key === "brand" ? null : m.key }),
1734
- className: Q(
1730
+ title: u.label,
1731
+ "aria-label": `Accent ${u.label}`,
1732
+ "aria-pressed": a,
1733
+ "data-theme-accent": u.key,
1734
+ onClick: () => r.mutate({ theme_accent: u.key === "brand" ? null : u.key }),
1735
+ className: j(
1735
1736
  "h-5 w-5 rounded-full border-2 transition-transform",
1736
- r ? "scale-110 border-slate-800 dark:border-slate-100" : "border-transparent hover:scale-105"
1737
+ a ? "scale-110 border-slate-800 dark:border-slate-100" : "border-transparent hover:scale-105"
1737
1738
  ),
1738
- style: { background: m.color ?? "var(--nvr-cyan)" }
1739
+ style: { background: u.color ?? "var(--nvr-cyan)" }
1739
1740
  },
1740
- m.key
1741
+ u.key
1741
1742
  );
1742
1743
  }) })
1743
1744
  ] }),
1744
- /* @__PURE__ */ a("label", { className: "flex items-center gap-1.5", children: [
1745
+ /* @__PURE__ */ t("label", { className: "flex items-center gap-1.5", children: [
1745
1746
  "Text size",
1746
1747
  /* @__PURE__ */ e(
1747
- U,
1748
+ E,
1748
1749
  {
1749
- value: String((t == null ? void 0 : t.font_size) ?? "default"),
1750
- onChange: (m) => i.mutate({ font_size: m }),
1750
+ value: String((n == null ? void 0 : n.font_size) ?? "default"),
1751
+ onChange: (u) => r.mutate({ font_size: u }),
1751
1752
  options: [
1752
1753
  { value: "small", label: "Small" },
1753
1754
  { value: "default", label: "Default" },
@@ -1762,11 +1763,11 @@ function vt() {
1762
1763
  );
1763
1764
  }
1764
1765
  export {
1765
- Be as DelegationCard,
1766
- vt as DisplayPrefsCard,
1767
- ot as LinkAppCard,
1768
- lt as NotificationRulesCard,
1769
- st as ProfileFieldsCard,
1770
- Jt as ProfileView,
1771
- it as TimezoneCard
1766
+ He as DelegationCard,
1767
+ kt as DisplayPrefsCard,
1768
+ it as LinkAppCard,
1769
+ ot as NotificationRulesCard,
1770
+ lt as ProfileFieldsCard,
1771
+ Vt as ProfileView,
1772
+ dt as TimezoneCard
1772
1773
  };