@nivaro/react 0.3.41 → 0.3.42
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.
- package/dist/components/LayoutForm.js +100 -98
- package/dist/full.css +1 -1
- package/dist/hooks/useSessionRecorder.js +1 -1
- package/dist/index.d.ts +644 -15
- package/dist/index.js +814 -775
- package/dist/shared/components/ActivityEntry.js +154 -0
- package/dist/shared/components/AudienceConfirmPanel.js +98 -0
- package/dist/shared/components/BackgroundRunOffer.js +43 -31
- package/dist/shared/components/BroadcastView.js +225 -204
- package/dist/shared/components/CollectionBrowserView.js +3924 -3584
- package/dist/shared/components/ConfigHistory.js +153 -0
- package/dist/shared/components/ConfigReadBack.js +65 -0
- package/dist/shared/components/DataTable.js +379 -346
- package/dist/shared/components/ForceReloadBanner.js +47 -40
- package/dist/shared/components/IdleReloadWatcher.js +69 -0
- package/dist/shared/components/ItemEditForm.js +4041 -3853
- package/dist/shared/components/MyWorkView.js +278 -213
- package/dist/shared/components/NotificationBell.js +130 -121
- package/dist/shared/components/ProfileView.js +776 -1003
- package/dist/shared/components/RecentRecordsRail.js +34 -16
- package/dist/shared/components/RecordReadView.js +500 -477
- package/dist/shared/components/Skeletons.js +199 -0
- package/dist/shared/components/SlowNotice.js +63 -0
- package/dist/shared/components/Term.js +23 -0
- package/dist/shared/components/WidgetSlot.js +350 -353
- package/dist/shared/components/access/PermissionSummary.js +106 -0
- package/dist/shared/components/bulk/BulkActionButtons.js +76 -73
- package/dist/shared/components/chat/ChatPanel.js +902 -886
- package/dist/shared/components/chat/MemberPaging.js +70 -0
- package/dist/shared/components/chat/RoomParts.js +147 -117
- package/dist/shared/components/chat/ScreenClip.js +73 -69
- package/dist/shared/components/chat/chat-core.js +449 -396
- package/dist/shared/components/chat/huddle/huddle-store.js +48 -43
- package/dist/shared/components/help-videos/api.js +2 -5
- package/dist/shared/components/help-videos/viewer/HelpVideoMatchChip.js +79 -0
- package/dist/shared/components/help-videos/viewer/matchChip.js +50 -0
- package/dist/shared/components/imports/CollectionImportPanel.js +139 -133
- package/dist/shared/components/imports/RunDetailSheet.js +222 -227
- package/dist/shared/components/integrations/console/ErrorExplanation.js +121 -0
- package/dist/shared/components/integrations/console/PartnerDetail.js +175 -174
- package/dist/shared/components/integrations/console/SubmissionRow.js +36 -34
- package/dist/shared/components/integrations/console/drill/SubmissionDrill.js +50 -48
- package/dist/shared/components/item-edit/FieldComments.js +212 -0
- package/dist/shared/components/item-edit/FieldRow.js +340 -336
- package/dist/shared/components/item-edit/RecordHeaderActions.js +23 -22
- package/dist/shared/components/item-edit/RelationCombobox.js +231 -222
- package/dist/shared/components/item-edit/RuleHiddenNotes.js +55 -0
- package/dist/shared/components/item-edit/field-comments-context.js +6 -0
- package/dist/shared/components/item-edit/field-sources.js +33 -0
- package/dist/shared/components/item-edit/rule-hidden.js +30 -0
- package/dist/shared/components/layout-editor/HistoryPanel.js +113 -96
- package/dist/shared/components/layout-editor/editors/cascade-filters.js +170 -145
- package/dist/shared/components/layout-editor/inspector/Breadcrumb.js +22 -18
- package/dist/shared/components/layout-editor/inspector/GroupInspector.js +177 -159
- package/dist/shared/components/layout-editor/inspector/PickerTab.js +35 -34
- package/dist/shared/components/layout-editor/inspector/RulesTab.js +124 -111
- package/dist/shared/components/layout-editor/inspector/kit.js +292 -277
- package/dist/shared/components/layout-editor/parity-keys.json.js +1 -1
- package/dist/shared/components/list/CopyListLinkButton.js +41 -0
- package/dist/shared/components/list/InlineEdit.js +363 -0
- package/dist/shared/components/notifications/NotificationCenterView.js +213 -181
- package/dist/shared/components/notifications/NotificationDetailBits.js +205 -82
- package/dist/shared/components/notifications/NotificationRulesEditor.js +515 -0
- package/dist/shared/components/notifications/TestMyRules.js +137 -0
- package/dist/shared/components/notifications/changes-lines.js +24 -0
- package/dist/shared/components/notifications/why-lines.js +64 -0
- package/dist/shared/components/panels/CommentPanel.js +316 -281
- package/dist/shared/components/panels/LegalHoldBanner.js +38 -0
- package/dist/shared/components/panels/PipelinePanel.js +201 -196
- package/dist/shared/components/panels/RevisionsPanel.js +496 -479
- package/dist/shared/components/pipeline/PipelineEditorView.js +1587 -1560
- package/dist/shared/components/pipeline/PipelineStateOwners.js +116 -103
- package/dist/shared/components/profile/PersonDidPanel.js +188 -0
- package/dist/shared/components/profile/PersonProfile.js +57 -52
- package/dist/shared/components/queue/QueueWorklist.js +1526 -1365
- package/dist/shared/hooks/useSlowReason.js +39 -0
- package/dist/shared/lib/activity-sentence.js +670 -0
- package/dist/shared/lib/config-sentences.js +418 -0
- package/dist/shared/lib/core-glossary.js +229 -0
- package/dist/shared/lib/error-hints.js +159 -0
- package/dist/shared/lib/error-message.js +105 -0
- package/dist/shared/lib/error-toast.js +22 -0
- package/dist/shared/lib/field-comments.js +25 -0
- package/dist/shared/lib/filter-sentence.js +261 -0
- package/dist/shared/lib/glossary.js +55 -48
- package/dist/shared/lib/idle-reload.js +138 -0
- package/dist/shared/lib/layout-resolve.js +42 -29
- package/dist/shared/lib/list-inline-edit.js +190 -0
- package/dist/shared/lib/list-link.js +147 -0
- package/dist/shared/lib/prefetch.js +259 -106
- package/dist/shared/lib/record-ref.js +72 -0
- package/dist/shared/lib/reload-holds.js +25 -0
- package/dist/shared/lib/safe-error.js +52 -24
- package/dist/shared/lib/skeleton-shapes.js +72 -0
- package/dist/shared/lib/slow-reason.js +63 -0
- package/package.json +1 -1
|
@@ -1,148 +1,90 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { readUser as
|
|
3
|
-
import { useQueryClient as K, useQuery as
|
|
4
|
-
import { Loader2 as
|
|
5
|
-
import {
|
|
6
|
-
import { useNivaroClient as
|
|
7
|
-
import { get as
|
|
8
|
-
import { playNotificationSound as
|
|
9
|
-
import { BRAND_ACCENT as
|
|
10
|
-
import { announceLocalPrefs as
|
|
11
|
-
import { cn as
|
|
12
|
-
import { CustomStatusEditor as
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
35
|
-
{
|
|
36
|
-
key: "workflow",
|
|
37
|
-
label: "Workflow & approvals",
|
|
38
|
-
help: "A record you own or follow moves state, needs your approval, is sent back, or an approval chain reaches your step. Also support requests you work on the desk (new, assigned, replied)."
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
key: "sla",
|
|
42
|
-
label: "SLA & escalations",
|
|
43
|
-
help: "A record you own is nearing or past its SLA, and escalation-ladder notices as they climb. SLA escalations always email immediately."
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
key: "watch",
|
|
47
|
-
label: "Watches",
|
|
48
|
-
help: "Something you explicitly watch fired: field watches, per-record subscriptions, and watched stock parts (Stock Planning)."
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
key: "alerts",
|
|
52
|
-
label: "Alerts",
|
|
53
|
-
help: "Threshold alerts you subscribe to: metric alert rules, per-record alert definitions, report alerts, and the alert digest."
|
|
54
|
-
},
|
|
55
|
-
{
|
|
56
|
-
key: "anomaly",
|
|
57
|
-
label: "Anomaly detections",
|
|
58
|
-
help: "Anomaly rules you created flag an outlier, spike, or duplicate pattern."
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
key: "reports",
|
|
62
|
-
label: "Reports",
|
|
63
|
-
help: "Scheduled report emails, Report Studio subscription digests, and saved-view change digests."
|
|
64
|
-
},
|
|
65
|
-
{
|
|
66
|
-
key: "integrations",
|
|
67
|
-
label: "Integrations",
|
|
68
|
-
help: "A partner system was not told something about your record, a send is still unanswered, or an integration alert you turned on in the Integrations console fired."
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
key: "huddle",
|
|
72
|
-
label: "Huddles & calls",
|
|
73
|
-
help: "Someone calls you in a huddle or adds you to one, and reminders for huddles you were invited to. Push is what rings a closed tab."
|
|
74
|
-
},
|
|
75
|
-
{
|
|
76
|
-
key: "chaos",
|
|
77
|
-
label: "Chaos drills",
|
|
78
|
-
help: "Chaos Monkey drills starting and ending, and pushes about drills you started or take part in (with a Stop button). Only administrators and chaos operators get these."
|
|
79
|
-
},
|
|
80
|
-
{
|
|
81
|
-
key: "system",
|
|
82
|
-
label: "System & digests",
|
|
83
|
-
help: "Maintenance windows, failing monitors, import results, updates on support requests you raised, and the daily action summary itself. Maintenance and monitor failures always email immediately."
|
|
84
|
-
},
|
|
85
|
-
{
|
|
86
|
-
key: "other",
|
|
87
|
-
label: "Everything else",
|
|
88
|
-
help: "Any notification that does not fit a category above — direct messages from other users, access requests, task assignments."
|
|
89
|
-
}
|
|
90
|
-
];
|
|
91
|
-
function it() {
|
|
92
|
-
const i = L(), m = K(), { data: r = [] } = w({
|
|
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";
|
|
3
|
+
import { useQueryClient as K, 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";
|
|
10
|
+
import { announceLocalPrefs as re } from "../lib/user-sync.js";
|
|
11
|
+
import { cn as Q, setDisplayTimezone as Ke } from "../lib/utils.js";
|
|
12
|
+
import { CustomStatusEditor as Le, activeCustomStatus as Me } from "./CustomStatusEditor.js";
|
|
13
|
+
import { mergeNotifyRulesClient as Re, NOTIFY_RULE_CATS as je, NotificationRulesEditor as Ee } from "./notifications/NotificationRulesEditor.js";
|
|
14
|
+
import { TestMyRules as Ie } 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 { SimpleSelectXs as U } from "./ui/SimpleSelect.js";
|
|
29
|
+
const tt = (s) => [s.first_name, s.last_name].filter(Boolean).join(" ") || (s.email ?? "Unknown"), at = (s) => {
|
|
30
|
+
var u, t;
|
|
31
|
+
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();
|
|
32
|
+
}, rt = je;
|
|
33
|
+
function nt() {
|
|
34
|
+
const s = A(), u = K(), { data: t = [] } = v({
|
|
93
35
|
queryKey: ["nvr-profile-fields"],
|
|
94
|
-
queryFn: () =>
|
|
95
|
-
}), [
|
|
96
|
-
mutationFn: (
|
|
36
|
+
queryFn: () => s.request(T("/profile-fields/mine")).then((r) => r.data ?? []).catch(() => [])
|
|
37
|
+
}), [i, o] = C(null), l = w({
|
|
38
|
+
mutationFn: (r) => s.request(Fe("/profile-fields/mine", { values: r })),
|
|
97
39
|
onSuccess: () => {
|
|
98
|
-
o(null),
|
|
40
|
+
o(null), u.invalidateQueries({ queryKey: ["nvr-profile-fields"] });
|
|
99
41
|
}
|
|
100
42
|
});
|
|
101
|
-
if (
|
|
102
|
-
const
|
|
103
|
-
(
|
|
43
|
+
if (t.length === 0) return null;
|
|
44
|
+
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(
|
|
45
|
+
(h) => typeof h == "object" && h != null ? String(h.value ?? "") : String(h)
|
|
104
46
|
) : [];
|
|
105
|
-
return /* @__PURE__ */
|
|
106
|
-
/* @__PURE__ */
|
|
47
|
+
return /* @__PURE__ */ a("div", { className: "rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card", children: [
|
|
48
|
+
/* @__PURE__ */ a("header", { className: "border-b border-slate-100 px-4 py-2.5 dark:border-border/60", children: [
|
|
107
49
|
/* @__PURE__ */ e("h3", { className: "text-[13px] font-semibold text-slate-800 dark:text-slate-100", children: "Profile fields" }),
|
|
108
50
|
/* @__PURE__ */ e("p", { className: "mt-0.5 text-[11px] text-slate-400", children: "Extra details your organization tracks about people." })
|
|
109
51
|
] }),
|
|
110
|
-
/* @__PURE__ */ e("div", { className: "grid grid-cols-1 gap-3 p-4 sm:grid-cols-2", children:
|
|
111
|
-
/* @__PURE__ */
|
|
112
|
-
|
|
113
|
-
|
|
52
|
+
/* @__PURE__ */ e("div", { className: "grid grid-cols-1 gap-3 p-4 sm:grid-cols-2", children: t.map((r) => /* @__PURE__ */ a("div", { children: [
|
|
53
|
+
/* @__PURE__ */ a("p", { className: "mb-1 text-[11px] font-medium text-slate-500", children: [
|
|
54
|
+
r.label,
|
|
55
|
+
r.required && /* @__PURE__ */ e("span", { className: "ml-0.5 text-red-500", children: "*" })
|
|
114
56
|
] }),
|
|
115
|
-
|
|
116
|
-
|
|
57
|
+
r.type === "boolean" ? /* @__PURE__ */ e(
|
|
58
|
+
U,
|
|
117
59
|
{
|
|
118
|
-
value:
|
|
60
|
+
value: c[r.key] || "false",
|
|
119
61
|
options: [
|
|
120
62
|
{ value: "true", label: "Yes" },
|
|
121
63
|
{ value: "false", label: "No" }
|
|
122
64
|
],
|
|
123
|
-
onChange: (
|
|
65
|
+
onChange: (h) => o({ ...c, [r.key]: h })
|
|
124
66
|
}
|
|
125
|
-
) :
|
|
126
|
-
|
|
67
|
+
) : r.type === "select" ? /* @__PURE__ */ e(
|
|
68
|
+
U,
|
|
127
69
|
{
|
|
128
|
-
value:
|
|
70
|
+
value: c[r.key] || "",
|
|
129
71
|
options: [
|
|
130
72
|
{ value: "", label: "—" },
|
|
131
|
-
...
|
|
73
|
+
...m(r.options).map((h) => ({ value: h, label: h }))
|
|
132
74
|
],
|
|
133
|
-
onChange: (
|
|
75
|
+
onChange: (h) => o({ ...c, [r.key]: h })
|
|
134
76
|
}
|
|
135
77
|
) : /* @__PURE__ */ e(
|
|
136
78
|
"input",
|
|
137
79
|
{
|
|
138
|
-
type:
|
|
139
|
-
value:
|
|
140
|
-
onChange: (
|
|
80
|
+
type: r.type === "number" ? "number" : r.type === "date" ? "date" : "text",
|
|
81
|
+
value: c[r.key] ?? "",
|
|
82
|
+
onChange: (h) => o({ ...c, [r.key]: h.target.value }),
|
|
141
83
|
className: "h-8 w-full rounded-md border border-slate-200 bg-background px-2 text-[12.5px] dark:border-border"
|
|
142
84
|
}
|
|
143
85
|
)
|
|
144
|
-
] },
|
|
145
|
-
|
|
86
|
+
] }, r.key)) }),
|
|
87
|
+
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: [
|
|
146
88
|
/* @__PURE__ */ e(
|
|
147
89
|
"button",
|
|
148
90
|
{
|
|
@@ -157,7 +99,7 @@ function it() {
|
|
|
157
99
|
{
|
|
158
100
|
type: "button",
|
|
159
101
|
disabled: l.isPending,
|
|
160
|
-
onClick: () => l.mutate(
|
|
102
|
+
onClick: () => l.mutate(c),
|
|
161
103
|
className: "h-7 rounded-md bg-nvr-cyan px-3 text-[12px] font-semibold text-white disabled:opacity-50",
|
|
162
104
|
children: l.isPending ? "Saving…" : "Save"
|
|
163
105
|
}
|
|
@@ -165,279 +107,211 @@ function it() {
|
|
|
165
107
|
] })
|
|
166
108
|
] });
|
|
167
109
|
}
|
|
168
|
-
function
|
|
169
|
-
var
|
|
170
|
-
const
|
|
110
|
+
function st() {
|
|
111
|
+
var Y, W, se;
|
|
112
|
+
const s = A(), u = K(), { data: t } = v({
|
|
171
113
|
queryKey: ["nvr-profile-prefs"],
|
|
172
|
-
queryFn: () =>
|
|
173
|
-
var
|
|
174
|
-
return ((
|
|
114
|
+
queryFn: () => s.request(T("/users/me")).then((n) => {
|
|
115
|
+
var b;
|
|
116
|
+
return ((b = n.data) == null ? void 0 : b.preferences) ?? {};
|
|
175
117
|
})
|
|
176
|
-
}), { data:
|
|
118
|
+
}), { data: i } = v({
|
|
177
119
|
queryKey: ["nvr-profile-teams"],
|
|
178
|
-
queryFn: () =>
|
|
179
|
-
var
|
|
120
|
+
queryFn: () => s.request(T("/users/me")).then((n) => {
|
|
121
|
+
var b, N;
|
|
180
122
|
return {
|
|
181
|
-
available: ((
|
|
182
|
-
link: ((
|
|
123
|
+
available: ((b = n.data) == null ? void 0 : b.teams_available) === !0,
|
|
124
|
+
link: ((N = n.data) == null ? void 0 : N.teams_link) ?? null
|
|
183
125
|
};
|
|
184
126
|
})
|
|
185
|
-
}), o = (
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
127
|
+
}), 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
|
+
Te(() => {
|
|
129
|
+
var n;
|
|
130
|
+
!m || typeof window > "u" || window.location.hash === "#notification-rules" && ((n = c.current) == null || n.scrollIntoView({ block: "start", behavior: "smooth" }));
|
|
131
|
+
}, [m]);
|
|
132
|
+
const r = (t == null ? void 0 : t.notification_prefs) ?? {}, { data: h } = v({
|
|
133
|
+
queryKey: ["nvr-my-rule-defaults"],
|
|
134
|
+
queryFn: () => s.request(T("/notifications/my-rule-defaults")).then((n) => n.data).catch(() => null),
|
|
135
|
+
staleTime: 6e4
|
|
136
|
+
}), p = (t == null ? void 0 : t.email_digest) === "daily" ? "daily" : "instant", S = Re(r, h != null && h.role ? h.rules : null), k = (n) => {
|
|
137
|
+
var b, N, B, le;
|
|
138
|
+
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);
|
|
139
|
+
}, F = w({
|
|
140
|
+
mutationFn: (n) => s.request(G("/users/me/preferences", { notification_prefs: n })),
|
|
190
141
|
onSuccess: () => {
|
|
191
|
-
|
|
142
|
+
u.invalidateQueries({ queryKey: ["nvr-profile-prefs"] }), re(["notification_prefs"]);
|
|
192
143
|
}
|
|
193
|
-
}),
|
|
194
|
-
mutationFn: (
|
|
195
|
-
onSuccess: (
|
|
196
|
-
|
|
144
|
+
}), f = w({
|
|
145
|
+
mutationFn: (n) => s.request(G("/users/me/preferences", n)),
|
|
146
|
+
onSuccess: (n, b) => {
|
|
147
|
+
u.invalidateQueries({ queryKey: ["nvr-profile-prefs"] }), re(Object.keys(b));
|
|
197
148
|
}
|
|
198
|
-
}), [
|
|
199
|
-
mutationFn: (
|
|
200
|
-
onSuccess: (
|
|
201
|
-
total:
|
|
202
|
-
current:
|
|
203
|
-
proposed:
|
|
149
|
+
}), [_, O] = C(null), q = w({
|
|
150
|
+
mutationFn: (n) => s.request(ee("/notifications/rules-preview", { notification_prefs: n })),
|
|
151
|
+
onSuccess: (n) => O({
|
|
152
|
+
total: n.data.total_notifications,
|
|
153
|
+
current: n.data.current,
|
|
154
|
+
proposed: n.data.proposed
|
|
204
155
|
})
|
|
205
|
-
}),
|
|
206
|
-
const
|
|
207
|
-
|
|
208
|
-
quiet_end: a.quiet_end ?? (v || void 0),
|
|
209
|
-
matrix: a.matrix ?? s.matrix ?? {},
|
|
210
|
-
escalation: a.escalation ?? s.escalation ?? {},
|
|
156
|
+
}), g = (n) => {
|
|
157
|
+
const b = {
|
|
158
|
+
...n,
|
|
211
159
|
// Kept as-is: "mute 1h" said to the bot lives here, and a save must not wipe it.
|
|
212
|
-
...
|
|
160
|
+
...r.teams_muted_until ? { teams_muted_until: r.teams_muted_until } : {}
|
|
213
161
|
};
|
|
214
|
-
|
|
215
|
-
},
|
|
216
|
-
const
|
|
217
|
-
|
|
218
|
-
}, { data:
|
|
162
|
+
q.mutate(b), F.mutate(b);
|
|
163
|
+
}, $ = (n) => g({ ...r, ...n }), L = (t == null ? void 0 : t.notification_sounds) ?? {}, x = (n, b) => {
|
|
164
|
+
const N = { ...L };
|
|
165
|
+
b === "default" ? delete N[n] : N[n] = b, b !== "default" && de(b, { preview: !0 }), f.mutate({ notification_sounds: Object.keys(N).length ? N : null });
|
|
166
|
+
}, { data: R } = v({
|
|
219
167
|
queryKey: ["nvr-noise-suggestions"],
|
|
220
|
-
queryFn: () =>
|
|
168
|
+
queryFn: () => s.request(T("/notifications/noise-suggestions")).then((n) => n.data ?? []),
|
|
221
169
|
staleTime: 6e5
|
|
222
|
-
}), [j,
|
|
170
|
+
}), [j, E] = C({}), [d, y] = C(() => {
|
|
223
171
|
try {
|
|
224
|
-
const
|
|
225
|
-
return
|
|
172
|
+
const n = JSON.parse(localStorage.getItem("nvr-noise-dismissed") ?? "null");
|
|
173
|
+
return n && Date.now() - n.at < 30 * 864e5 ? n.cats : [];
|
|
226
174
|
} catch {
|
|
227
175
|
return [];
|
|
228
176
|
}
|
|
229
|
-
}),
|
|
230
|
-
const
|
|
231
|
-
|
|
177
|
+
}), P = (n) => {
|
|
178
|
+
const b = [...d, n];
|
|
179
|
+
y(b);
|
|
232
180
|
try {
|
|
233
|
-
localStorage.setItem("nvr-noise-dismissed", JSON.stringify({ at: Date.now(), cats:
|
|
181
|
+
localStorage.setItem("nvr-noise-dismissed", JSON.stringify({ at: Date.now(), cats: b }));
|
|
234
182
|
} catch {
|
|
235
183
|
}
|
|
236
|
-
},
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
Object.keys(g).length ? H[a] = g : delete H[a], P({ escalation: H });
|
|
242
|
-
}, W = [
|
|
243
|
-
{ value: "", label: "never" },
|
|
244
|
-
{ value: "15", label: "15 min" },
|
|
245
|
-
{ value: "60", label: "1 hour" },
|
|
246
|
-
{ value: "240", label: "4 hours" },
|
|
247
|
-
{ value: "480", label: "8 hours" },
|
|
248
|
-
{ value: "1440", label: "1 day" }
|
|
249
|
-
], Q = (a, p) => {
|
|
250
|
-
var g;
|
|
251
|
-
const x = ((g = s.matrix) == null ? void 0 : g[a]) ?? { inapp: !0, push: !0 };
|
|
252
|
-
P({
|
|
253
|
-
matrix: { ...s.matrix ?? {}, [a]: { ...x, [p]: x[p] === !1 } }
|
|
254
|
-
});
|
|
255
|
-
}, B = (a) => {
|
|
256
|
-
var x;
|
|
257
|
-
const p = ((x = s.matrix) == null ? void 0 : x[a]) ?? { inapp: !0, push: !0 };
|
|
258
|
-
P({ matrix: { ...s.matrix ?? {}, [a]: { ...p, teams: p.teams !== !0 } } });
|
|
259
|
-
}, V = (a, p) => {
|
|
260
|
-
var g;
|
|
261
|
-
const x = ((g = s.matrix) == null ? void 0 : g[a]) ?? { inapp: !0, push: !0 };
|
|
262
|
-
P({ matrix: { ...s.matrix ?? {}, [a]: { ...x, email: p } } });
|
|
263
|
-
}, Z = (a) => {
|
|
264
|
-
var g;
|
|
265
|
-
const p = ((g = s.matrix) == null ? void 0 : g[a]) ?? { inapp: !0, push: !0 }, x = { ...p };
|
|
266
|
-
p.quiet_override ? delete x.quiet_override : x.quiet_override = !0, P({ matrix: { ...s.matrix ?? {}, [a]: x } });
|
|
267
|
-
}, X = !!(T && v), ee = (a) => {
|
|
268
|
-
var x;
|
|
269
|
-
const p = {};
|
|
270
|
-
for (const g of te)
|
|
271
|
-
p[g.key] = { ...((x = s.matrix) == null ? void 0 : x[g.key]) ?? { inapp: !0, push: !0 }, email: a };
|
|
272
|
-
P({ matrix: p }), a !== "off" && A.mutate({ email_digest: a });
|
|
273
|
-
}, ke = Number.isInteger(Number(r == null ? void 0 : r.digest_hour)) ? Number(r == null ? void 0 : r.digest_hour) : 7, Ne = (a) => `${a % 12 === 0 ? 12 : a % 12}:45 ${a < 12 ? "AM" : "PM"}`, [de, ce] = q(null), re = _({
|
|
274
|
-
mutationFn: () => i.request(ae("/users/me/digest-test", {})),
|
|
275
|
-
onSuccess: (a) => ce(a.data.note),
|
|
276
|
-
onError: () => ce("Test send failed — try again.")
|
|
277
|
-
}), we = te.some((a) => n(a.key) === "daily"), ue = [
|
|
278
|
-
{ value: "instant", label: "Individual email" },
|
|
279
|
-
{ value: "daily", label: "Daily summary" },
|
|
280
|
-
{ value: "off", label: "No email" }
|
|
281
|
-
], I = ({ text: a }) => /* @__PURE__ */ e(
|
|
184
|
+
}, 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, M] = C(null), I = w({
|
|
185
|
+
mutationFn: () => s.request(ee("/users/me/digest-test", {})),
|
|
186
|
+
onSuccess: (n) => M(n.data.note),
|
|
187
|
+
onError: () => M("Test send failed — try again.")
|
|
188
|
+
}), V = rt.some((n) => k(n.key) === "daily"), Z = ({ text: n }) => /* @__PURE__ */ e(
|
|
282
189
|
"span",
|
|
283
190
|
{
|
|
284
191
|
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",
|
|
285
192
|
role: "img",
|
|
286
|
-
title:
|
|
287
|
-
"data-tip":
|
|
288
|
-
"aria-label":
|
|
193
|
+
title: n,
|
|
194
|
+
"data-tip": n,
|
|
195
|
+
"aria-label": n,
|
|
289
196
|
children: "?"
|
|
290
197
|
}
|
|
291
198
|
);
|
|
292
|
-
return /* @__PURE__ */
|
|
199
|
+
return /* @__PURE__ */ a(
|
|
293
200
|
"div",
|
|
294
201
|
{
|
|
202
|
+
id: "notification-rules",
|
|
203
|
+
ref: c,
|
|
295
204
|
"data-profile-card": "notifications",
|
|
296
205
|
className: "rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card",
|
|
297
206
|
children: [
|
|
298
|
-
/* @__PURE__ */
|
|
207
|
+
/* @__PURE__ */ a("header", { className: "border-b border-slate-100 px-4 py-2.5 dark:border-border/60", children: [
|
|
299
208
|
/* @__PURE__ */ e("h3", { className: "text-[13px] font-semibold text-slate-800 dark:text-slate-100", children: "Notification rules" }),
|
|
300
209
|
/* @__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." })
|
|
301
210
|
] }),
|
|
302
|
-
/* @__PURE__ */
|
|
303
|
-
(
|
|
211
|
+
/* @__PURE__ */ a("div", { className: "space-y-3 p-4", children: [
|
|
212
|
+
(R ?? []).filter((n) => !d.includes(n.category)).map((n) => /* @__PURE__ */ a(
|
|
304
213
|
"div",
|
|
305
214
|
{
|
|
306
|
-
"data-noise-suggestion":
|
|
215
|
+
"data-noise-suggestion": n.category,
|
|
307
216
|
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",
|
|
308
217
|
children: [
|
|
309
|
-
/* @__PURE__ */
|
|
310
|
-
|
|
218
|
+
/* @__PURE__ */ a("span", { className: "min-w-0 flex-1", children: [
|
|
219
|
+
n.message,
|
|
311
220
|
" Mute them?"
|
|
312
221
|
] }),
|
|
313
|
-
|
|
222
|
+
n.category in j ? /* @__PURE__ */ e(
|
|
314
223
|
"button",
|
|
315
224
|
{
|
|
316
225
|
type: "button",
|
|
317
226
|
className: "underline",
|
|
318
227
|
onClick: () => {
|
|
319
|
-
|
|
228
|
+
$({
|
|
320
229
|
matrix: {
|
|
321
|
-
...
|
|
322
|
-
[
|
|
230
|
+
...r.matrix ?? {},
|
|
231
|
+
[n.category]: j[n.category]
|
|
323
232
|
}
|
|
324
|
-
}),
|
|
233
|
+
}), E(({ [n.category]: b, ...N }) => N);
|
|
325
234
|
},
|
|
326
235
|
children: "Muted — undo"
|
|
327
236
|
}
|
|
328
|
-
) : /* @__PURE__ */
|
|
237
|
+
) : /* @__PURE__ */ a(X, { children: [
|
|
329
238
|
/* @__PURE__ */ e(
|
|
330
239
|
"button",
|
|
331
240
|
{
|
|
332
241
|
type: "button",
|
|
333
242
|
className: "rounded border border-amber-300 px-2 py-0.5 font-medium dark:border-amber-800",
|
|
334
243
|
onClick: () => {
|
|
335
|
-
var
|
|
336
|
-
const
|
|
337
|
-
|
|
244
|
+
var N;
|
|
245
|
+
const b = ((N = r.matrix) == null ? void 0 : N[n.category]) ?? { inapp: !0, push: !0 };
|
|
246
|
+
E((B) => ({ ...B, [n.category]: b })), $({
|
|
338
247
|
matrix: {
|
|
339
|
-
...
|
|
340
|
-
[
|
|
248
|
+
...r.matrix ?? {},
|
|
249
|
+
[n.category]: { ...b, inapp: !1, push: !1 }
|
|
341
250
|
}
|
|
342
251
|
});
|
|
343
252
|
},
|
|
344
253
|
children: "Mute"
|
|
345
254
|
}
|
|
346
255
|
),
|
|
347
|
-
/* @__PURE__ */ e("button", { type: "button", className: "underline", onClick: () =>
|
|
256
|
+
/* @__PURE__ */ e("button", { type: "button", className: "underline", onClick: () => P(n.category), children: "Not now" })
|
|
348
257
|
] })
|
|
349
258
|
]
|
|
350
259
|
},
|
|
351
|
-
|
|
260
|
+
n.category
|
|
352
261
|
)),
|
|
353
|
-
|
|
262
|
+
_ && _.total > 0 && /* @__PURE__ */ a(
|
|
354
263
|
"div",
|
|
355
264
|
{
|
|
356
265
|
"data-rules-preview": !0,
|
|
357
266
|
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",
|
|
358
267
|
children: [
|
|
359
|
-
/* @__PURE__ */
|
|
268
|
+
/* @__PURE__ */ a("span", { className: "min-w-0 flex-1", children: [
|
|
360
269
|
"Last week with this change: ",
|
|
361
|
-
|
|
270
|
+
_.proposed.inapp,
|
|
362
271
|
" in-app instead of",
|
|
363
272
|
" ",
|
|
364
|
-
|
|
273
|
+
_.current.inapp,
|
|
365
274
|
", ",
|
|
366
|
-
|
|
275
|
+
_.proposed.email_sent,
|
|
367
276
|
" emails instead of",
|
|
368
277
|
" ",
|
|
369
|
-
|
|
278
|
+
_.current.email_sent,
|
|
370
279
|
", ",
|
|
371
|
-
|
|
280
|
+
_.proposed.push,
|
|
372
281
|
" pushes instead of",
|
|
373
282
|
" ",
|
|
374
|
-
|
|
283
|
+
_.current.push,
|
|
375
284
|
"."
|
|
376
285
|
] }),
|
|
377
|
-
/* @__PURE__ */ e("button", { type: "button", className: "underline", onClick: () =>
|
|
286
|
+
/* @__PURE__ */ e("button", { type: "button", className: "underline", onClick: () => O(null), children: "Dismiss" })
|
|
378
287
|
]
|
|
379
288
|
}
|
|
380
289
|
),
|
|
381
|
-
/* @__PURE__ */
|
|
382
|
-
"Quiet hours (ET):",
|
|
383
|
-
/* @__PURE__ */ e(
|
|
384
|
-
"input",
|
|
385
|
-
{
|
|
386
|
-
type: "time",
|
|
387
|
-
value: T,
|
|
388
|
-
onChange: (a) => h(a.target.value),
|
|
389
|
-
onBlur: () => P({ quiet_start: T || void 0 }),
|
|
390
|
-
className: "h-7 rounded-md border border-slate-200 bg-background px-1.5 text-[12px] dark:border-border"
|
|
391
|
-
}
|
|
392
|
-
),
|
|
393
|
-
/* @__PURE__ */ e("span", { children: "to" }),
|
|
394
|
-
/* @__PURE__ */ e(
|
|
395
|
-
"input",
|
|
396
|
-
{
|
|
397
|
-
type: "time",
|
|
398
|
-
value: v,
|
|
399
|
-
onChange: (a) => N(a.target.value),
|
|
400
|
-
onBlur: () => P({ quiet_end: v || void 0 }),
|
|
401
|
-
className: "h-7 rounded-md border border-slate-200 bg-background px-1.5 text-[12px] dark:border-border"
|
|
402
|
-
}
|
|
403
|
-
),
|
|
404
|
-
(T || v) && /* @__PURE__ */ e(
|
|
405
|
-
"button",
|
|
406
|
-
{
|
|
407
|
-
type: "button",
|
|
408
|
-
onClick: () => {
|
|
409
|
-
h(""), N(""), O.mutate({ matrix: s.matrix ?? {} });
|
|
410
|
-
},
|
|
411
|
-
className: "text-[11.5px] text-slate-400 underline decoration-dotted underline-offset-2",
|
|
412
|
-
children: "Clear"
|
|
413
|
-
}
|
|
414
|
-
)
|
|
415
|
-
] }),
|
|
416
|
-
/* @__PURE__ */ t("div", { className: "flex flex-wrap items-center gap-2 text-[12.5px] text-slate-600 dark:text-muted-foreground", children: [
|
|
290
|
+
/* @__PURE__ */ a("div", { className: "flex flex-wrap items-center gap-2 text-[12.5px] text-slate-600 dark:text-muted-foreground", children: [
|
|
417
291
|
"Sound:",
|
|
418
292
|
/* @__PURE__ */ e(
|
|
419
|
-
|
|
293
|
+
U,
|
|
420
294
|
{
|
|
421
|
-
value: String((
|
|
295
|
+
value: String((t == null ? void 0 : t.notification_sound) ?? "off"),
|
|
422
296
|
options: [
|
|
423
297
|
{ value: "off", label: "Off" },
|
|
424
298
|
{ value: "subtle", label: "Subtle blip" },
|
|
425
299
|
{ value: "chime", label: "Chime" }
|
|
426
300
|
],
|
|
427
|
-
onChange: (
|
|
428
|
-
|
|
301
|
+
onChange: (n) => {
|
|
302
|
+
de(n, { preview: !0 }), f.mutate({ notification_sound: n });
|
|
429
303
|
}
|
|
430
304
|
}
|
|
431
305
|
),
|
|
432
306
|
/* @__PURE__ */ e("span", { className: "text-[11px] text-slate-400", children: "plays when a notification or a direct message arrives" })
|
|
433
307
|
] }),
|
|
434
|
-
/* @__PURE__ */
|
|
308
|
+
/* @__PURE__ */ a("div", { className: "flex flex-wrap items-center gap-2 text-[12.5px] text-slate-600 dark:text-muted-foreground", children: [
|
|
435
309
|
/* @__PURE__ */ e(
|
|
436
|
-
|
|
310
|
+
et,
|
|
437
311
|
{
|
|
438
|
-
on: (
|
|
439
|
-
onChange: () =>
|
|
440
|
-
huddle_hold_notifications: (
|
|
312
|
+
on: (t == null ? void 0 : t.huddle_hold_notifications) !== !1,
|
|
313
|
+
onChange: () => f.mutate({
|
|
314
|
+
huddle_hold_notifications: (t == null ? void 0 : t.huddle_hold_notifications) === !1
|
|
441
315
|
}),
|
|
442
316
|
label: "Hold notifications during huddles"
|
|
443
317
|
}
|
|
@@ -445,188 +319,82 @@ function dt() {
|
|
|
445
319
|
"Hold notifications during huddles",
|
|
446
320
|
/* @__PURE__ */ e("span", { className: "text-[11px] text-slate-400", children: "toasts and sounds wait while you talk; you get one summary when you leave" })
|
|
447
321
|
] }),
|
|
448
|
-
/* @__PURE__ */
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
/* @__PURE__ */
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
/* @__PURE__ */ t("th", { className: "py-1 text-center font-semibold", children: [
|
|
469
|
-
"Sound",
|
|
470
|
-
/* @__PURE__ */ e(I, { text: "A different sound for this category, or none. Default follows the Sound setting above." })
|
|
471
|
-
] }),
|
|
472
|
-
/* @__PURE__ */ t("th", { className: "py-1 text-center font-semibold", children: [
|
|
473
|
-
"Quiet hours",
|
|
474
|
-
/* @__PURE__ */ e(I, { text: "Ticked = this category still pushes and emails during your quiet hours (the in-app row always lands either way). Leave it off to have quiet hours hold this category until morning. Critical alerts always get through." })
|
|
475
|
-
] })
|
|
476
|
-
] }) }),
|
|
477
|
-
/* @__PURE__ */ e("tbody", { children: te.map((a) => {
|
|
478
|
-
var x;
|
|
479
|
-
const p = ((x = s.matrix) == null ? void 0 : x[a.key]) ?? {};
|
|
480
|
-
return /* @__PURE__ */ t("tr", { className: "border-t border-slate-100 dark:border-border", children: [
|
|
481
|
-
/* @__PURE__ */ t("td", { className: "py-1.5 text-slate-700 dark:text-foreground", children: [
|
|
482
|
-
a.label,
|
|
483
|
-
/* @__PURE__ */ e(I, { text: a.help })
|
|
484
|
-
] }),
|
|
485
|
-
["inapp", "push"].map((g) => /* @__PURE__ */ e("td", { className: "py-1.5 text-center", children: /* @__PURE__ */ e(
|
|
486
|
-
"input",
|
|
487
|
-
{
|
|
488
|
-
type: "checkbox",
|
|
489
|
-
checked: p[g] !== !1,
|
|
490
|
-
onChange: () => Q(a.key, g),
|
|
491
|
-
disabled: O.isPending,
|
|
492
|
-
"aria-label": `${g === "inapp" ? "In-app" : "Push"} for ${a.label}`,
|
|
493
|
-
"data-notify-channel": `${a.key}:${g}`,
|
|
494
|
-
className: "h-3.5 w-3.5"
|
|
495
|
-
}
|
|
496
|
-
) }, g)),
|
|
497
|
-
/* @__PURE__ */ e("td", { className: "py-1 text-center", children: /* @__PURE__ */ e("div", { className: "inline-block", children: /* @__PURE__ */ e(
|
|
498
|
-
E,
|
|
499
|
-
{
|
|
500
|
-
ariaLabel: `Email for ${a.label}`,
|
|
501
|
-
value: n(a.key),
|
|
502
|
-
options: ue,
|
|
503
|
-
onChange: (g) => V(a.key, g)
|
|
504
|
-
}
|
|
505
|
-
) }) }),
|
|
506
|
-
o && /* @__PURE__ */ e("td", { className: "py-1.5 text-center", children: /* @__PURE__ */ e(
|
|
507
|
-
"input",
|
|
508
|
-
{
|
|
509
|
-
type: "checkbox",
|
|
510
|
-
checked: p.teams === !0,
|
|
511
|
-
onChange: () => B(a.key),
|
|
512
|
-
disabled: O.isPending || !l,
|
|
513
|
-
"aria-label": `Teams for ${a.label}`,
|
|
514
|
-
title: l ? void 0 : "Connect Teams first",
|
|
515
|
-
"data-notify-channel": `${a.key}:teams`,
|
|
516
|
-
className: "h-3.5 w-3.5"
|
|
517
|
-
}
|
|
518
|
-
) }),
|
|
519
|
-
/* @__PURE__ */ e("td", { className: "py-1 text-center", children: /* @__PURE__ */ e("div", { className: "inline-block", children: /* @__PURE__ */ e(
|
|
520
|
-
E,
|
|
521
|
-
{
|
|
522
|
-
ariaLabel: `Sound for ${a.label}`,
|
|
523
|
-
value: y[a.key] ?? "default",
|
|
524
|
-
options: [
|
|
525
|
-
{ value: "default", label: "Default" },
|
|
526
|
-
{ value: "off", label: "None" },
|
|
527
|
-
{ value: "subtle", label: "Subtle blip" },
|
|
528
|
-
{ value: "chime", label: "Chime" }
|
|
529
|
-
],
|
|
530
|
-
onChange: (g) => $(a.key, g)
|
|
531
|
-
}
|
|
532
|
-
) }) }),
|
|
533
|
-
/* @__PURE__ */ e("td", { className: "py-1.5 text-center", children: /* @__PURE__ */ e(
|
|
534
|
-
"input",
|
|
535
|
-
{
|
|
536
|
-
type: "checkbox",
|
|
537
|
-
checked: p.quiet_override === !0,
|
|
538
|
-
onChange: () => Z(a.key),
|
|
539
|
-
disabled: O.isPending,
|
|
540
|
-
"aria-label": `Let ${a.label} through quiet hours`,
|
|
541
|
-
title: X ? void 0 : "Set quiet hours above for this to matter — it is remembered either way",
|
|
542
|
-
"data-quiet-override": a.key,
|
|
543
|
-
className: "h-3.5 w-3.5"
|
|
544
|
-
}
|
|
545
|
-
) })
|
|
546
|
-
] }, a.key);
|
|
547
|
-
}) })
|
|
548
|
-
] }),
|
|
549
|
-
/* @__PURE__ */ t("div", { className: "flex flex-wrap items-center gap-2 text-[11.5px] text-slate-500 dark:text-muted-foreground", children: [
|
|
550
|
-
/* @__PURE__ */ e("span", { children: "All email:" }),
|
|
551
|
-
ue.map((a) => /* @__PURE__ */ e(
|
|
552
|
-
"button",
|
|
553
|
-
{
|
|
554
|
-
type: "button",
|
|
555
|
-
disabled: O.isPending,
|
|
556
|
-
onClick: () => ee(a.value),
|
|
557
|
-
className: "rounded border border-slate-200 px-2 py-0.5 hover:border-slate-400 hover:text-slate-800 dark:border-border dark:hover:text-foreground",
|
|
558
|
-
children: a.label
|
|
559
|
-
},
|
|
560
|
-
a.value
|
|
561
|
-
))
|
|
562
|
-
] }),
|
|
563
|
-
/* @__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: [
|
|
564
|
-
/* @__PURE__ */ t("p", { className: "text-[12px] font-medium text-slate-700 dark:text-foreground", children: [
|
|
565
|
-
"If it stays unread",
|
|
566
|
-
/* @__PURE__ */ e("span", { className: "ml-1.5 text-[11px] font-normal text-slate-400", children: "one notification climbs channels on your schedule — push, then email — and stops the moment you read it. A channel that already delivered it is not repeated." })
|
|
567
|
-
] }),
|
|
568
|
-
/* @__PURE__ */ t("table", { className: "w-full text-[12px]", children: [
|
|
569
|
-
/* @__PURE__ */ e("thead", { children: /* @__PURE__ */ t("tr", { className: "text-left text-[10.5px] uppercase tracking-wide text-slate-400", children: [
|
|
570
|
-
/* @__PURE__ */ e("th", { className: "py-1 font-semibold", children: "Category" }),
|
|
571
|
-
/* @__PURE__ */ t("th", { className: "py-1 font-semibold", children: [
|
|
572
|
-
"Push after",
|
|
573
|
-
/* @__PURE__ */ e(I, { text: "Still unread after this long → a browser / device push (needs a registered device; quiet hours do not apply to escalations you asked for)." })
|
|
322
|
+
/* @__PURE__ */ e(
|
|
323
|
+
Ee,
|
|
324
|
+
{
|
|
325
|
+
subject: "person",
|
|
326
|
+
value: r,
|
|
327
|
+
inherited: h != null && h.role ? h.rules : null,
|
|
328
|
+
inheritedName: ((W = h == null ? void 0 : h.role) == null ? void 0 : W.name) ?? null,
|
|
329
|
+
legacyEmail: p,
|
|
330
|
+
saving: F.isPending,
|
|
331
|
+
onCommit: (n) => g(n),
|
|
332
|
+
onLegacyEmail: (n) => f.mutate({ email_digest: n }),
|
|
333
|
+
teams: o ? {
|
|
334
|
+
available: !0,
|
|
335
|
+
linked: l,
|
|
336
|
+
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 }) })
|
|
337
|
+
} : null,
|
|
338
|
+
extraColumn: {
|
|
339
|
+
header: /* @__PURE__ */ a(X, { children: [
|
|
340
|
+
"Sound",
|
|
341
|
+
/* @__PURE__ */ e(Z, { text: "A different sound for this category, or none. Default follows the Sound setting above." })
|
|
574
342
|
] }),
|
|
575
|
-
/* @__PURE__ */
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
] })
|
|
579
|
-
] }) }),
|
|
580
|
-
/* @__PURE__ */ e("tbody", { children: te.map((a) => {
|
|
581
|
-
var x;
|
|
582
|
-
const p = ((x = s.escalation) == null ? void 0 : x[a.key]) ?? {};
|
|
583
|
-
return /* @__PURE__ */ t("tr", { className: "border-t border-slate-100 dark:border-border", children: [
|
|
584
|
-
/* @__PURE__ */ e("td", { className: "py-1 text-slate-700 dark:text-foreground", children: a.label }),
|
|
585
|
-
["push_after_min", "email_after_min"].map((g) => /* @__PURE__ */ e("td", { className: "py-1", children: /* @__PURE__ */ e(
|
|
586
|
-
E,
|
|
343
|
+
cell: (n, b) => /* @__PURE__ */ a("div", { className: "inline-block", children: [
|
|
344
|
+
/* @__PURE__ */ e(
|
|
345
|
+
U,
|
|
587
346
|
{
|
|
588
|
-
ariaLabel:
|
|
589
|
-
value:
|
|
590
|
-
options:
|
|
591
|
-
|
|
347
|
+
ariaLabel: `Sound for ${b}`,
|
|
348
|
+
value: L[n] ?? "default",
|
|
349
|
+
options: [
|
|
350
|
+
{ value: "default", label: "Default" },
|
|
351
|
+
{ value: "off", label: "None" },
|
|
352
|
+
{ value: "subtle", label: "Subtle blip" },
|
|
353
|
+
{ value: "chime", label: "Chime" }
|
|
354
|
+
],
|
|
355
|
+
onChange: (N) => x(n, N)
|
|
592
356
|
}
|
|
593
|
-
)
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
357
|
+
),
|
|
358
|
+
/* @__PURE__ */ a("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
359
|
+
/* @__PURE__ */ e(Ie, {}),
|
|
360
|
+
/* @__PURE__ */ e("span", { className: "text-[11px] text-slate-400", children: "see what would happen to a notification for you right now, and which rule decides it" })
|
|
361
|
+
] })
|
|
362
|
+
] })
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
),
|
|
366
|
+
/* @__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: [
|
|
367
|
+
/* @__PURE__ */ a("p", { className: "text-[12px] font-medium text-slate-700 dark:text-foreground", children: [
|
|
600
368
|
"Daily action summary",
|
|
601
|
-
/* @__PURE__ */
|
|
369
|
+
/* @__PURE__ */ a("span", { className: "ml-1.5 text-[11px] font-normal text-slate-400", children: [
|
|
602
370
|
"one morning email — every category set to Daily summary, plus items assigned to you and invoices awaiting your review",
|
|
603
|
-
!
|
|
371
|
+
!V && " · nothing is set to Daily summary yet"
|
|
604
372
|
] })
|
|
605
373
|
] }),
|
|
606
|
-
/* @__PURE__ */
|
|
607
|
-
/* @__PURE__ */
|
|
374
|
+
/* @__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: [
|
|
375
|
+
/* @__PURE__ */ a("span", { className: "flex items-center gap-1.5", children: [
|
|
608
376
|
"Deliver at",
|
|
609
377
|
/* @__PURE__ */ e(
|
|
610
|
-
|
|
378
|
+
U,
|
|
611
379
|
{
|
|
612
380
|
ariaLabel: "Digest delivery hour",
|
|
613
|
-
value: String(
|
|
614
|
-
onChange: (
|
|
615
|
-
options: Array.from({ length: 24 }, (
|
|
616
|
-
value: String(
|
|
617
|
-
label:
|
|
381
|
+
value: String(J),
|
|
382
|
+
onChange: (n) => f.mutate({ digest_hour: Number(n) }),
|
|
383
|
+
options: Array.from({ length: 24 }, (n, b) => ({
|
|
384
|
+
value: String(b),
|
|
385
|
+
label: D(b)
|
|
618
386
|
}))
|
|
619
387
|
}
|
|
620
388
|
),
|
|
621
389
|
/* @__PURE__ */ e("span", { className: "text-[11px] text-slate-400", children: "Eastern time" })
|
|
622
390
|
] }),
|
|
623
|
-
/* @__PURE__ */
|
|
391
|
+
/* @__PURE__ */ a("label", { className: "flex cursor-pointer items-center gap-1.5", children: [
|
|
624
392
|
/* @__PURE__ */ e(
|
|
625
393
|
"input",
|
|
626
394
|
{
|
|
627
395
|
type: "checkbox",
|
|
628
|
-
checked: (
|
|
629
|
-
onChange: (
|
|
396
|
+
checked: (t == null ? void 0 : t.digest_layout) === "compact",
|
|
397
|
+
onChange: (n) => f.mutate({ digest_layout: n.target.checked ? "compact" : "detailed" }),
|
|
630
398
|
className: "rounded"
|
|
631
399
|
}
|
|
632
400
|
),
|
|
@@ -636,40 +404,40 @@ function dt() {
|
|
|
636
404
|
"button",
|
|
637
405
|
{
|
|
638
406
|
type: "button",
|
|
639
|
-
disabled:
|
|
640
|
-
onClick: () =>
|
|
407
|
+
disabled: I.isPending,
|
|
408
|
+
onClick: () => I.mutate(),
|
|
641
409
|
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",
|
|
642
|
-
children:
|
|
410
|
+
children: I.isPending ? "Building…" : "Send me a test summary now"
|
|
643
411
|
}
|
|
644
412
|
),
|
|
645
|
-
|
|
413
|
+
z && /* @__PURE__ */ e("span", { className: "text-[11.5px] text-slate-400", children: z })
|
|
646
414
|
] })
|
|
647
415
|
] }),
|
|
648
|
-
/* @__PURE__ */
|
|
416
|
+
/* @__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: [
|
|
649
417
|
/* @__PURE__ */ e("span", { className: "text-[11.5px] text-slate-400", children: "Auto-watch records I…" }),
|
|
650
418
|
[
|
|
651
419
|
["created", "create"],
|
|
652
420
|
["commented", "comment on"],
|
|
653
421
|
["transitioned", "move through a workflow"]
|
|
654
|
-
].map(([
|
|
655
|
-
var
|
|
656
|
-
return /* @__PURE__ */
|
|
422
|
+
].map(([n, b]) => {
|
|
423
|
+
var N;
|
|
424
|
+
return /* @__PURE__ */ a("label", { className: "flex cursor-pointer items-center gap-1.5", children: [
|
|
657
425
|
/* @__PURE__ */ e(
|
|
658
426
|
"input",
|
|
659
427
|
{
|
|
660
428
|
type: "checkbox",
|
|
661
|
-
checked: ((
|
|
662
|
-
onChange: (
|
|
429
|
+
checked: ((N = t == null ? void 0 : t.auto_watch) == null ? void 0 : N[n]) === !0,
|
|
430
|
+
onChange: (B) => f.mutate({
|
|
663
431
|
auto_watch: {
|
|
664
|
-
...(
|
|
665
|
-
[
|
|
432
|
+
...(t == null ? void 0 : t.auto_watch) ?? {},
|
|
433
|
+
[n]: B.target.checked
|
|
666
434
|
}
|
|
667
435
|
}),
|
|
668
436
|
className: "rounded"
|
|
669
437
|
}
|
|
670
438
|
),
|
|
671
|
-
|
|
672
|
-
] },
|
|
439
|
+
b
|
|
440
|
+
] }, n);
|
|
673
441
|
})
|
|
674
442
|
] })
|
|
675
443
|
] })
|
|
@@ -677,18 +445,18 @@ function dt() {
|
|
|
677
445
|
}
|
|
678
446
|
);
|
|
679
447
|
}
|
|
680
|
-
function
|
|
681
|
-
const
|
|
448
|
+
function lt() {
|
|
449
|
+
const s = A(), u = K(), { data: t } = v({
|
|
682
450
|
queryKey: ["nvr-profile-prefs"],
|
|
683
|
-
queryFn: () =>
|
|
684
|
-
var
|
|
685
|
-
return ((
|
|
451
|
+
queryFn: () => s.request(T("/users/me")).then((c) => {
|
|
452
|
+
var m;
|
|
453
|
+
return ((m = c.data) == null ? void 0 : m.preferences) ?? {};
|
|
686
454
|
})
|
|
687
|
-
}),
|
|
688
|
-
mutationFn: (
|
|
689
|
-
onSuccess: () => void
|
|
455
|
+
}), i = (t == null ? void 0 : t.link_app) === "portal" || (t == null ? void 0 : t.link_app) === "admin" ? t.link_app : "auto", o = w({
|
|
456
|
+
mutationFn: (c) => s.request(G("/users/me/preferences", { link_app: c })),
|
|
457
|
+
onSuccess: () => void u.invalidateQueries({ queryKey: ["nvr-profile-prefs"] })
|
|
690
458
|
});
|
|
691
|
-
return /* @__PURE__ */
|
|
459
|
+
return /* @__PURE__ */ a(
|
|
692
460
|
"div",
|
|
693
461
|
{
|
|
694
462
|
className: "rounded-xl border border-slate-200 bg-white p-5 dark:border-border dark:bg-card",
|
|
@@ -700,356 +468,356 @@ function ct() {
|
|
|
700
468
|
{ v: "auto", label: "Automatic", hint: "Admins open the admin, everyone else the portal" },
|
|
701
469
|
{ v: "portal", label: "Portal", hint: "Always the front-end app" },
|
|
702
470
|
{ v: "admin", label: "Admin", hint: "Always the admin console" }
|
|
703
|
-
].map((
|
|
471
|
+
].map((c) => /* @__PURE__ */ e(
|
|
704
472
|
"button",
|
|
705
473
|
{
|
|
706
474
|
type: "button",
|
|
707
|
-
title:
|
|
708
|
-
onClick: () => o.mutate(
|
|
709
|
-
className:
|
|
710
|
-
children:
|
|
475
|
+
title: c.hint,
|
|
476
|
+
onClick: () => o.mutate(c.v),
|
|
477
|
+
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",
|
|
478
|
+
children: c.label
|
|
711
479
|
},
|
|
712
|
-
|
|
480
|
+
c.v
|
|
713
481
|
)) })
|
|
714
482
|
]
|
|
715
483
|
}
|
|
716
484
|
);
|
|
717
485
|
}
|
|
718
|
-
function
|
|
719
|
-
const
|
|
486
|
+
function ot() {
|
|
487
|
+
const s = A(), u = K(), [t, i] = C(""), o = (() => {
|
|
720
488
|
try {
|
|
721
489
|
return Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
722
490
|
} catch {
|
|
723
491
|
return "UTC";
|
|
724
492
|
}
|
|
725
493
|
})(), l = (() => {
|
|
726
|
-
var
|
|
494
|
+
var p;
|
|
727
495
|
try {
|
|
728
|
-
return ((
|
|
496
|
+
return ((p = Intl.supportedValuesOf) == null ? void 0 : p.call(
|
|
729
497
|
Intl,
|
|
730
498
|
"timeZone"
|
|
731
499
|
)) ?? [];
|
|
732
500
|
} catch {
|
|
733
501
|
return [];
|
|
734
502
|
}
|
|
735
|
-
})(), { data:
|
|
503
|
+
})(), { data: c } = v({
|
|
736
504
|
queryKey: ["nvr-profile-prefs"],
|
|
737
|
-
queryFn: () =>
|
|
738
|
-
var
|
|
739
|
-
return ((
|
|
505
|
+
queryFn: () => s.request(T("/users/me")).then((p) => {
|
|
506
|
+
var S;
|
|
507
|
+
return ((S = p.data) == null ? void 0 : S.preferences) ?? {};
|
|
740
508
|
})
|
|
741
|
-
}),
|
|
742
|
-
mutationFn: (
|
|
743
|
-
onSuccess: (
|
|
744
|
-
|
|
509
|
+
}), m = typeof (c == null ? void 0 : c.timezone) == "string" ? c.timezone : null, r = w({
|
|
510
|
+
mutationFn: (p) => s.request(G("/users/me/preferences", { timezone: p })),
|
|
511
|
+
onSuccess: (p, S) => {
|
|
512
|
+
Ke(S), i(""), u.invalidateQueries({ queryKey: ["nvr-profile-prefs"] });
|
|
745
513
|
}
|
|
746
|
-
}),
|
|
747
|
-
return /* @__PURE__ */
|
|
514
|
+
}), h = t.length > 1 ? l.filter((p) => p.toLowerCase().includes(t.toLowerCase())).slice(0, 8) : [];
|
|
515
|
+
return /* @__PURE__ */ a(
|
|
748
516
|
"div",
|
|
749
517
|
{
|
|
750
518
|
"data-profile-card": "timezone",
|
|
751
519
|
className: "rounded-xl border border-slate-200 bg-white p-5 dark:border-border dark:bg-card",
|
|
752
520
|
children: [
|
|
753
521
|
/* @__PURE__ */ e("p", { className: "text-[13.5px] font-semibold text-slate-800 dark:text-slate-100", children: "Timezone" }),
|
|
754
|
-
/* @__PURE__ */
|
|
522
|
+
/* @__PURE__ */ a("p", { className: "mt-0.5 text-[12px] text-slate-500 dark:text-muted-foreground", children: [
|
|
755
523
|
"Dates and times render in this zone. Your browser reports",
|
|
756
524
|
" ",
|
|
757
525
|
/* @__PURE__ */ e("span", { className: "font-medium", children: o }),
|
|
758
526
|
"."
|
|
759
527
|
] }),
|
|
760
|
-
/* @__PURE__ */
|
|
761
|
-
/* @__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:
|
|
762
|
-
|
|
528
|
+
/* @__PURE__ */ a("div", { className: "mt-3 flex flex-wrap items-center gap-2", children: [
|
|
529
|
+
/* @__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)` }),
|
|
530
|
+
m && /* @__PURE__ */ e(
|
|
763
531
|
"button",
|
|
764
532
|
{
|
|
765
533
|
type: "button",
|
|
766
|
-
onClick: () =>
|
|
534
|
+
onClick: () => r.mutate(null),
|
|
767
535
|
className: "text-[12px] text-slate-400 hover:text-slate-600 dark:hover:text-slate-300",
|
|
768
536
|
children: "Use browser default"
|
|
769
537
|
}
|
|
770
538
|
)
|
|
771
539
|
] }),
|
|
772
|
-
/* @__PURE__ */
|
|
540
|
+
/* @__PURE__ */ a("div", { className: "relative mt-2", children: [
|
|
773
541
|
/* @__PURE__ */ e(
|
|
774
542
|
"input",
|
|
775
543
|
{
|
|
776
|
-
value:
|
|
777
|
-
onChange: (
|
|
544
|
+
value: t,
|
|
545
|
+
onChange: (p) => i(p.target.value),
|
|
778
546
|
placeholder: "Change zone… (e.g. America/Denver)",
|
|
779
547
|
className: "h-8 w-[280px] rounded-md border border-slate-200 bg-background px-2.5 text-[12.5px] dark:border-border"
|
|
780
548
|
}
|
|
781
549
|
),
|
|
782
|
-
|
|
550
|
+
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(
|
|
783
551
|
"button",
|
|
784
552
|
{
|
|
785
553
|
type: "button",
|
|
786
|
-
onClick: () =>
|
|
554
|
+
onClick: () => r.mutate(p),
|
|
787
555
|
className: "block w-full px-2.5 py-1.5 text-left text-[12.5px] text-slate-700 hover:bg-muted dark:text-foreground",
|
|
788
|
-
children:
|
|
556
|
+
children: p
|
|
789
557
|
},
|
|
790
|
-
|
|
558
|
+
p
|
|
791
559
|
)) })
|
|
792
560
|
] })
|
|
793
561
|
]
|
|
794
562
|
}
|
|
795
563
|
);
|
|
796
564
|
}
|
|
797
|
-
function
|
|
798
|
-
const
|
|
565
|
+
function it() {
|
|
566
|
+
const s = A(), u = K(), { data: t } = v({
|
|
799
567
|
queryKey: ["nvr-profile-scopes"],
|
|
800
|
-
queryFn: () =>
|
|
801
|
-
}),
|
|
802
|
-
mutationFn: ({ dimension: o, values: l }) =>
|
|
803
|
-
onSuccess: () => void
|
|
568
|
+
queryFn: () => s.request(xe()).then((o) => o.data)
|
|
569
|
+
}), i = w({
|
|
570
|
+
mutationFn: ({ dimension: o, values: l }) => s.request(ge(o, l)),
|
|
571
|
+
onSuccess: () => void u.invalidateQueries({ queryKey: ["nvr-profile-scopes"] })
|
|
804
572
|
});
|
|
805
|
-
return !
|
|
806
|
-
|
|
573
|
+
return !t || t.dimensions.length === 0 ? null : /* @__PURE__ */ e(
|
|
574
|
+
ne,
|
|
807
575
|
{
|
|
808
576
|
testId: "scopes",
|
|
809
|
-
icon: /* @__PURE__ */ e(
|
|
577
|
+
icon: /* @__PURE__ */ e(Ce, { className: "h-4 w-4" }),
|
|
810
578
|
title: "Default filters",
|
|
811
579
|
hint: "Pre-selected in browsers and reports — clear anytime",
|
|
812
|
-
children: /* @__PURE__ */ e("div", { className: "space-y-3", children:
|
|
813
|
-
|
|
580
|
+
children: /* @__PURE__ */ e("div", { className: "space-y-3", children: t.dimensions.map((o) => /* @__PURE__ */ e(
|
|
581
|
+
dt,
|
|
814
582
|
{
|
|
815
583
|
dimension: o,
|
|
816
|
-
selected:
|
|
817
|
-
restricted:
|
|
818
|
-
onSave: (l) =>
|
|
584
|
+
selected: t.defaults[o.name] ?? [],
|
|
585
|
+
restricted: t.restricted[o.name],
|
|
586
|
+
onSave: (l) => i.mutate({ dimension: o.name, values: l })
|
|
819
587
|
},
|
|
820
588
|
o.name
|
|
821
589
|
)) })
|
|
822
590
|
}
|
|
823
591
|
);
|
|
824
592
|
}
|
|
825
|
-
function
|
|
826
|
-
dimension:
|
|
827
|
-
selected:
|
|
828
|
-
restricted:
|
|
829
|
-
onSave:
|
|
593
|
+
function dt({
|
|
594
|
+
dimension: s,
|
|
595
|
+
selected: u,
|
|
596
|
+
restricted: t,
|
|
597
|
+
onSave: i
|
|
830
598
|
}) {
|
|
831
|
-
const o =
|
|
832
|
-
queryKey: ["nvr-scope-options",
|
|
599
|
+
const o = A(), l = s.display_field ?? "name", [c, m] = C(""), [r, h] = C(!1), { data: p = [] } = v({
|
|
600
|
+
queryKey: ["nvr-scope-options", s.name],
|
|
833
601
|
queryFn: async () => ((await o.request(
|
|
834
|
-
|
|
602
|
+
te(s.target_collection, {
|
|
835
603
|
fields: ["id", l],
|
|
836
|
-
sort:
|
|
604
|
+
sort: s.options_sort ? [s.options_sort] : void 0,
|
|
837
605
|
limit: 200
|
|
838
606
|
})
|
|
839
|
-
)).data ?? []).map((
|
|
840
|
-
id:
|
|
841
|
-
label: String(
|
|
607
|
+
)).data ?? []).map((y) => ({
|
|
608
|
+
id: y.id,
|
|
609
|
+
label: String(y[l] ?? y.id)
|
|
842
610
|
}))
|
|
843
|
-
}),
|
|
844
|
-
queryKey: ["nvr-scope-search",
|
|
611
|
+
}), 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({
|
|
612
|
+
queryKey: ["nvr-scope-search", s.name, c],
|
|
845
613
|
queryFn: async () => {
|
|
846
|
-
const
|
|
847
|
-
|
|
614
|
+
const y = ((await o.request(
|
|
615
|
+
te(s.target_collection, {
|
|
848
616
|
fields: ["id", l],
|
|
849
|
-
filter: { [l]: { _contains:
|
|
850
|
-
sort:
|
|
617
|
+
filter: { [l]: { _contains: c } },
|
|
618
|
+
sort: s.options_sort ? [s.options_sort] : void 0,
|
|
851
619
|
limit: 30
|
|
852
620
|
})
|
|
853
|
-
)).data ?? []).map((
|
|
854
|
-
id:
|
|
855
|
-
label: String(
|
|
621
|
+
)).data ?? []).map((P) => ({
|
|
622
|
+
id: P.id,
|
|
623
|
+
label: String(P[l] ?? P.id)
|
|
856
624
|
}));
|
|
857
|
-
return
|
|
625
|
+
return S ? y.filter((P) => S.has(String(P.id))) : y;
|
|
858
626
|
},
|
|
859
|
-
enabled:
|
|
860
|
-
placeholderData: (
|
|
861
|
-
}),
|
|
862
|
-
for (const
|
|
863
|
-
const
|
|
864
|
-
queryKey: ["nvr-scope-selected-labels",
|
|
627
|
+
enabled: f && c.trim().length > 0,
|
|
628
|
+
placeholderData: (d) => d
|
|
629
|
+
}), q = new Map(p.map((d) => [String(d.id), d.label]));
|
|
630
|
+
for (const d of _) q.set(String(d.id), d.label);
|
|
631
|
+
const g = u.filter((d) => !q.has(String(d))), { data: $ = [] } = v({
|
|
632
|
+
queryKey: ["nvr-scope-selected-labels", s.name, g.map(String).sort().join(",")],
|
|
865
633
|
queryFn: async () => ((await o.request(
|
|
866
|
-
|
|
634
|
+
te(s.target_collection, {
|
|
867
635
|
fields: ["id", l],
|
|
868
|
-
filter: { id: { _in:
|
|
636
|
+
filter: { id: { _in: g } },
|
|
869
637
|
limit: 100
|
|
870
638
|
})
|
|
871
|
-
)).data ?? []).map((
|
|
872
|
-
id:
|
|
873
|
-
label: String(
|
|
639
|
+
)).data ?? []).map((y) => ({
|
|
640
|
+
id: y.id,
|
|
641
|
+
label: String(y[l] ?? y.id)
|
|
874
642
|
})),
|
|
875
|
-
enabled:
|
|
643
|
+
enabled: g.length > 0
|
|
876
644
|
});
|
|
877
|
-
for (const
|
|
878
|
-
const
|
|
879
|
-
const
|
|
880
|
-
|
|
881
|
-
},
|
|
882
|
-
return /* @__PURE__ */
|
|
883
|
-
/* @__PURE__ */
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
645
|
+
for (const d of $) q.set(String(d.id), d.label);
|
|
646
|
+
const L = (d) => {
|
|
647
|
+
const y = F.has(String(d));
|
|
648
|
+
i(y ? u.filter((P) => String(P) !== String(d)) : [...u, d]);
|
|
649
|
+
}, x = c.trim().toLowerCase(), R = x ? k.filter((d) => d.label.toLowerCase().includes(x)) : k, j = x.length === 0 ? k.slice(0, 30) : O && _.length === 0 ? R.slice(0, 30) : _, E = f && (r || x.length > 0);
|
|
650
|
+
return /* @__PURE__ */ a("div", { children: [
|
|
651
|
+
/* @__PURE__ */ a("p", { className: "mb-1 text-[11px] font-medium uppercase tracking-wide text-slate-400", children: [
|
|
652
|
+
s.label,
|
|
653
|
+
t != null && t.length ? /* @__PURE__ */ e("span", { className: "ml-1.5 normal-case tracking-normal text-amber-500", children: "(limited by your access)" }) : null,
|
|
654
|
+
u.length > 0 && /* @__PURE__ */ a(
|
|
887
655
|
"button",
|
|
888
656
|
{
|
|
889
657
|
type: "button",
|
|
890
|
-
onClick: () =>
|
|
658
|
+
onClick: () => i([]),
|
|
891
659
|
className: "ml-2 normal-case tracking-normal text-slate-400 underline-offset-2 hover:text-slate-600 hover:underline",
|
|
892
660
|
children: [
|
|
893
661
|
"clear ",
|
|
894
|
-
|
|
662
|
+
u.length
|
|
895
663
|
]
|
|
896
664
|
}
|
|
897
665
|
)
|
|
898
666
|
] }),
|
|
899
|
-
|
|
900
|
-
|
|
667
|
+
f ? /* @__PURE__ */ a("div", { className: "max-w-xl", children: [
|
|
668
|
+
u.length > 0 && /* @__PURE__ */ e("div", { className: "mb-1.5 flex flex-wrap gap-1", children: u.map((d) => /* @__PURE__ */ a(
|
|
901
669
|
"span",
|
|
902
670
|
{
|
|
903
671
|
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",
|
|
904
672
|
children: [
|
|
905
|
-
|
|
673
|
+
q.get(String(d)) ?? String(d),
|
|
906
674
|
/* @__PURE__ */ e(
|
|
907
675
|
"button",
|
|
908
676
|
{
|
|
909
677
|
type: "button",
|
|
910
|
-
onClick: () =>
|
|
911
|
-
"aria-label": `Remove ${
|
|
678
|
+
onClick: () => L(d),
|
|
679
|
+
"aria-label": `Remove ${q.get(String(d)) ?? d}`,
|
|
912
680
|
className: "rounded-full px-1 text-slate-400 hover:text-slate-600 dark:hover:text-slate-200",
|
|
913
681
|
children: "×"
|
|
914
682
|
}
|
|
915
683
|
)
|
|
916
684
|
]
|
|
917
685
|
},
|
|
918
|
-
String(
|
|
686
|
+
String(d)
|
|
919
687
|
)) }),
|
|
920
688
|
/* @__PURE__ */ e(
|
|
921
689
|
"input",
|
|
922
690
|
{
|
|
923
|
-
value:
|
|
924
|
-
onChange: (
|
|
925
|
-
onFocus: () =>
|
|
926
|
-
onBlur: () =>
|
|
927
|
-
placeholder: `Search ${
|
|
691
|
+
value: c,
|
|
692
|
+
onChange: (d) => m(d.target.value),
|
|
693
|
+
onFocus: () => h(!0),
|
|
694
|
+
onBlur: () => h(!1),
|
|
695
|
+
placeholder: `Search ${s.label.toLowerCase()} to add…`,
|
|
928
696
|
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"
|
|
929
697
|
}
|
|
930
698
|
),
|
|
931
|
-
|
|
699
|
+
E && /* @__PURE__ */ a(
|
|
932
700
|
"div",
|
|
933
701
|
{
|
|
934
|
-
onMouseDown: (
|
|
702
|
+
onMouseDown: (d) => d.preventDefault(),
|
|
935
703
|
className: "mt-1 max-h-44 overflow-y-auto rounded-md border border-slate-200 dark:border-border",
|
|
936
704
|
children: [
|
|
937
|
-
|
|
938
|
-
const
|
|
939
|
-
return /* @__PURE__ */
|
|
705
|
+
j.map((d) => {
|
|
706
|
+
const y = F.has(String(d.id));
|
|
707
|
+
return /* @__PURE__ */ a(
|
|
940
708
|
"button",
|
|
941
709
|
{
|
|
942
710
|
type: "button",
|
|
943
|
-
onClick: () =>
|
|
944
|
-
className:
|
|
711
|
+
onClick: () => L(d.id),
|
|
712
|
+
className: Q(
|
|
945
713
|
"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",
|
|
946
|
-
|
|
714
|
+
y ? "font-medium text-nvr-navy dark:text-nvr-cyan" : "text-slate-600 dark:text-slate-300"
|
|
947
715
|
),
|
|
948
716
|
children: [
|
|
949
|
-
/* @__PURE__ */ e("span", { className: "truncate", children:
|
|
950
|
-
/* @__PURE__ */ e("span", { className: "pl-2 text-[11px] text-slate-400", children:
|
|
717
|
+
/* @__PURE__ */ e("span", { className: "truncate", children: d.label }),
|
|
718
|
+
/* @__PURE__ */ e("span", { className: "pl-2 text-[11px] text-slate-400", children: y ? "Remove" : "Add" })
|
|
951
719
|
]
|
|
952
720
|
},
|
|
953
|
-
String(
|
|
721
|
+
String(d.id)
|
|
954
722
|
);
|
|
955
723
|
}),
|
|
956
|
-
|
|
957
|
-
|
|
724
|
+
j.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." }),
|
|
725
|
+
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." })
|
|
958
726
|
]
|
|
959
727
|
}
|
|
960
728
|
),
|
|
961
|
-
!
|
|
962
|
-
] }) : /* @__PURE__ */
|
|
963
|
-
|
|
964
|
-
const
|
|
729
|
+
!E && 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." })
|
|
730
|
+
] }) : /* @__PURE__ */ a("div", { className: "flex flex-wrap gap-1", children: [
|
|
731
|
+
k.map((d) => {
|
|
732
|
+
const y = F.has(String(d.id));
|
|
965
733
|
return /* @__PURE__ */ e(
|
|
966
734
|
"button",
|
|
967
735
|
{
|
|
968
736
|
type: "button",
|
|
969
|
-
onClick: () =>
|
|
970
|
-
className:
|
|
737
|
+
onClick: () => L(d.id),
|
|
738
|
+
className: Q(
|
|
971
739
|
"rounded-full border px-2.5 py-0.5 text-[11.5px] transition-colors",
|
|
972
|
-
|
|
740
|
+
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"
|
|
973
741
|
),
|
|
974
|
-
children:
|
|
742
|
+
children: d.label
|
|
975
743
|
},
|
|
976
|
-
String(
|
|
744
|
+
String(d.id)
|
|
977
745
|
);
|
|
978
746
|
}),
|
|
979
|
-
|
|
747
|
+
k.length === 0 && /* @__PURE__ */ e("span", { className: "text-[11.5px] text-slate-400", children: "No options." })
|
|
980
748
|
] })
|
|
981
749
|
] });
|
|
982
750
|
}
|
|
983
|
-
function
|
|
984
|
-
const { data:
|
|
751
|
+
function ct() {
|
|
752
|
+
const { data: s } = v({
|
|
985
753
|
queryKey: ["nvr-settings-2fa"],
|
|
986
|
-
queryFn: () =>
|
|
754
|
+
queryFn: () => t.request({ _method: "GET", _path: "/settings/" }).then((g) => (g == null ? void 0 : g.data) ?? null).catch(() => null),
|
|
987
755
|
staleTime: 6e5
|
|
988
|
-
}),
|
|
756
|
+
}), u = (s == null ? void 0 : s.two_factor_enabled) !== !1, t = A(), i = K(), [o, l] = C(null), [c, m] = C(""), [r, h] = C(null), { data: p } = v({
|
|
989
757
|
queryKey: ["nvr-profile-totp"],
|
|
990
|
-
queryFn: () =>
|
|
991
|
-
}),
|
|
992
|
-
mutationFn: () =>
|
|
993
|
-
onSuccess: (
|
|
994
|
-
}),
|
|
995
|
-
mutationFn: (
|
|
758
|
+
queryFn: () => t.request({ _method: "GET", _path: "/two-factor/status" }).then((g) => g.data)
|
|
759
|
+
}), S = () => void i.invalidateQueries({ queryKey: ["nvr-profile-totp"] }), k = w({
|
|
760
|
+
mutationFn: () => t.request({ _method: "POST", _path: "/two-factor/setup" }).then((g) => g.data),
|
|
761
|
+
onSuccess: (g) => l(g)
|
|
762
|
+
}), F = w({
|
|
763
|
+
mutationFn: (g) => t.request({
|
|
996
764
|
_method: "POST",
|
|
997
765
|
_path: "/two-factor/verify",
|
|
998
|
-
_body: { token:
|
|
766
|
+
_body: { token: g }
|
|
999
767
|
}),
|
|
1000
768
|
onSuccess: () => {
|
|
1001
|
-
l(null),
|
|
769
|
+
l(null), m(""), S();
|
|
1002
770
|
}
|
|
1003
|
-
}),
|
|
1004
|
-
mutationFn: (
|
|
771
|
+
}), f = w({
|
|
772
|
+
mutationFn: (g) => t.request({
|
|
1005
773
|
_method: "POST",
|
|
1006
774
|
_path: "/two-factor/disable",
|
|
1007
|
-
_body: { token:
|
|
775
|
+
_body: { token: g }
|
|
1008
776
|
}),
|
|
1009
777
|
onSuccess: () => {
|
|
1010
|
-
|
|
778
|
+
m(""), S();
|
|
1011
779
|
}
|
|
1012
|
-
}),
|
|
1013
|
-
mutationFn: () =>
|
|
1014
|
-
onSuccess: (
|
|
1015
|
-
}),
|
|
1016
|
-
mutationFn: () =>
|
|
1017
|
-
onSuccess: () =>
|
|
1018
|
-
}),
|
|
1019
|
-
mutationFn: () =>
|
|
780
|
+
}), _ = w({
|
|
781
|
+
mutationFn: () => t.request({ _method: "POST", _path: "/users/me/token" }).then((g) => g.data),
|
|
782
|
+
onSuccess: (g) => h(g.token)
|
|
783
|
+
}), O = w({
|
|
784
|
+
mutationFn: () => t.request({ _method: "DELETE", _path: "/users/me/token" }),
|
|
785
|
+
onSuccess: () => h(null)
|
|
786
|
+
}), q = w({
|
|
787
|
+
mutationFn: () => t.request({ _method: "POST", _path: "/auth/logout-all" }),
|
|
1020
788
|
onSuccess: () => window.location.assign("/login")
|
|
1021
789
|
});
|
|
1022
790
|
return /* @__PURE__ */ e(
|
|
1023
|
-
|
|
791
|
+
ne,
|
|
1024
792
|
{
|
|
1025
|
-
icon: /* @__PURE__ */ e(
|
|
793
|
+
icon: /* @__PURE__ */ e(Pe, { className: "h-4 w-4" }),
|
|
1026
794
|
title: "Security",
|
|
1027
|
-
hint:
|
|
1028
|
-
children: /* @__PURE__ */
|
|
1029
|
-
|
|
1030
|
-
/* @__PURE__ */
|
|
795
|
+
hint: u ? "Two-factor sign-in and API access" : "API access",
|
|
796
|
+
children: /* @__PURE__ */ a("div", { className: "space-y-4", children: [
|
|
797
|
+
u && /* @__PURE__ */ a("div", { children: [
|
|
798
|
+
/* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
|
|
1031
799
|
/* @__PURE__ */ e("p", { className: "text-[12.5px] font-medium text-slate-700 dark:text-slate-200", children: "Two-factor authentication" }),
|
|
1032
800
|
/* @__PURE__ */ e(
|
|
1033
801
|
"span",
|
|
1034
802
|
{
|
|
1035
|
-
className:
|
|
803
|
+
className: Q(
|
|
1036
804
|
"rounded-full px-1.5 py-px text-[10px] font-semibold",
|
|
1037
|
-
|
|
805
|
+
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"
|
|
1038
806
|
),
|
|
1039
|
-
children:
|
|
807
|
+
children: p != null && p.enabled ? "Enabled" : "Off"
|
|
1040
808
|
}
|
|
1041
809
|
)
|
|
1042
810
|
] }),
|
|
1043
|
-
!(
|
|
811
|
+
!(p != null && p.enabled) && !o && /* @__PURE__ */ e(
|
|
1044
812
|
"button",
|
|
1045
813
|
{
|
|
1046
814
|
type: "button",
|
|
1047
|
-
onClick: () =>
|
|
815
|
+
onClick: () => k.mutate(),
|
|
1048
816
|
className: "mt-2 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",
|
|
1049
|
-
children:
|
|
817
|
+
children: k.isPending ? "Preparing…" : "Set up 2FA"
|
|
1050
818
|
}
|
|
1051
819
|
),
|
|
1052
|
-
o && /* @__PURE__ */
|
|
820
|
+
o && /* @__PURE__ */ a("div", { className: "mt-3 flex flex-wrap items-start gap-4", children: [
|
|
1053
821
|
/* @__PURE__ */ e(
|
|
1054
822
|
"img",
|
|
1055
823
|
{
|
|
@@ -1058,14 +826,14 @@ function ht() {
|
|
|
1058
826
|
className: "h-32 w-32 rounded-md border border-slate-200 dark:border-border"
|
|
1059
827
|
}
|
|
1060
828
|
),
|
|
1061
|
-
/* @__PURE__ */
|
|
829
|
+
/* @__PURE__ */ a("div", { className: "min-w-[200px] flex-1 space-y-2", children: [
|
|
1062
830
|
/* @__PURE__ */ e("p", { className: "text-[12px] text-slate-500", children: "Scan with your authenticator app, then enter the 6-digit code to confirm." }),
|
|
1063
|
-
/* @__PURE__ */
|
|
831
|
+
/* @__PURE__ */ a("div", { className: "flex gap-1.5", children: [
|
|
1064
832
|
/* @__PURE__ */ e(
|
|
1065
833
|
"input",
|
|
1066
834
|
{
|
|
1067
|
-
value:
|
|
1068
|
-
onChange: (
|
|
835
|
+
value: c,
|
|
836
|
+
onChange: (g) => m(g.target.value),
|
|
1069
837
|
placeholder: "123456",
|
|
1070
838
|
inputMode: "numeric",
|
|
1071
839
|
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"
|
|
@@ -1075,8 +843,8 @@ function ht() {
|
|
|
1075
843
|
"button",
|
|
1076
844
|
{
|
|
1077
845
|
type: "button",
|
|
1078
|
-
disabled:
|
|
1079
|
-
onClick: () =>
|
|
846
|
+
disabled: c.trim().length < 6 || F.isPending,
|
|
847
|
+
onClick: () => F.mutate(c.trim()),
|
|
1080
848
|
className: "h-8 rounded-md bg-nvr-cyan px-3 text-[12px] font-semibold text-white disabled:opacity-50",
|
|
1081
849
|
children: "Confirm"
|
|
1082
850
|
}
|
|
@@ -1084,12 +852,12 @@ function ht() {
|
|
|
1084
852
|
] })
|
|
1085
853
|
] })
|
|
1086
854
|
] }),
|
|
1087
|
-
(
|
|
855
|
+
(p == null ? void 0 : p.enabled) && /* @__PURE__ */ a("div", { className: "mt-2 flex gap-1.5", children: [
|
|
1088
856
|
/* @__PURE__ */ e(
|
|
1089
857
|
"input",
|
|
1090
858
|
{
|
|
1091
|
-
value:
|
|
1092
|
-
onChange: (
|
|
859
|
+
value: c,
|
|
860
|
+
onChange: (g) => m(g.target.value),
|
|
1093
861
|
placeholder: "Code to disable",
|
|
1094
862
|
inputMode: "numeric",
|
|
1095
863
|
className: "h-8 w-[130px] rounded-md border border-slate-200 px-2.5 text-[12px] dark:border-border dark:bg-background"
|
|
@@ -1099,37 +867,37 @@ function ht() {
|
|
|
1099
867
|
"button",
|
|
1100
868
|
{
|
|
1101
869
|
type: "button",
|
|
1102
|
-
disabled:
|
|
1103
|
-
onClick: () =>
|
|
870
|
+
disabled: c.trim().length < 6 || f.isPending,
|
|
871
|
+
onClick: () => f.mutate(c.trim()),
|
|
1104
872
|
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",
|
|
1105
|
-
children:
|
|
873
|
+
children: f.isPending ? "Disabling…" : "Disable"
|
|
1106
874
|
}
|
|
1107
875
|
)
|
|
1108
876
|
] })
|
|
1109
877
|
] }),
|
|
1110
|
-
/* @__PURE__ */
|
|
878
|
+
/* @__PURE__ */ a(
|
|
1111
879
|
"div",
|
|
1112
880
|
{
|
|
1113
|
-
className:
|
|
881
|
+
className: u ? "border-t border-slate-100 pt-3 dark:border-border/60" : void 0,
|
|
1114
882
|
children: [
|
|
1115
883
|
/* @__PURE__ */ e("p", { className: "text-[12.5px] font-medium text-slate-700 dark:text-slate-200", children: "API token" }),
|
|
1116
884
|
/* @__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." }),
|
|
1117
|
-
|
|
1118
|
-
/* @__PURE__ */
|
|
885
|
+
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 }),
|
|
886
|
+
/* @__PURE__ */ a("div", { className: "mt-2 flex gap-1.5", children: [
|
|
1119
887
|
/* @__PURE__ */ e(
|
|
1120
888
|
"button",
|
|
1121
889
|
{
|
|
1122
890
|
type: "button",
|
|
1123
|
-
onClick: () =>
|
|
891
|
+
onClick: () => _.mutate(),
|
|
1124
892
|
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",
|
|
1125
|
-
children:
|
|
893
|
+
children: _.isPending ? "Generating…" : "Generate token"
|
|
1126
894
|
}
|
|
1127
895
|
),
|
|
1128
896
|
/* @__PURE__ */ e(
|
|
1129
|
-
|
|
897
|
+
me,
|
|
1130
898
|
{
|
|
1131
899
|
title: "Revoke API token",
|
|
1132
|
-
onConfirm: () =>
|
|
900
|
+
onConfirm: () => O.mutate(),
|
|
1133
901
|
confirmLabel: "Revoke token?",
|
|
1134
902
|
className: "h-8 rounded-md px-3 text-[12px] font-medium text-slate-400 transition-colors hover:text-red-500",
|
|
1135
903
|
armedClassName: "font-semibold text-red-500",
|
|
@@ -1140,20 +908,20 @@ function ht() {
|
|
|
1140
908
|
]
|
|
1141
909
|
}
|
|
1142
910
|
),
|
|
1143
|
-
/* @__PURE__ */
|
|
911
|
+
/* @__PURE__ */ a("div", { className: "border-t border-slate-100 pt-3 dark:border-border/60", children: [
|
|
1144
912
|
/* @__PURE__ */ e("p", { className: "text-[12.5px] font-medium text-slate-700 dark:text-slate-200", children: "Sessions" }),
|
|
1145
913
|
/* @__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." }),
|
|
1146
|
-
/* @__PURE__ */
|
|
1147
|
-
|
|
914
|
+
/* @__PURE__ */ a(
|
|
915
|
+
me,
|
|
1148
916
|
{
|
|
1149
917
|
title: "Sign out everywhere",
|
|
1150
|
-
onConfirm: () =>
|
|
918
|
+
onConfirm: () => q.mutate(),
|
|
1151
919
|
confirmLabel: "Sign out everywhere?",
|
|
1152
920
|
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",
|
|
1153
921
|
armedClassName: "border-red-300 font-semibold text-red-500 dark:border-red-500/40 dark:text-red-400",
|
|
1154
922
|
children: [
|
|
1155
|
-
/* @__PURE__ */ e(
|
|
1156
|
-
|
|
923
|
+
/* @__PURE__ */ e(qe, { className: "h-3.5 w-3.5" }),
|
|
924
|
+
q.isPending ? "Signing out…" : "Sign out everywhere"
|
|
1157
925
|
]
|
|
1158
926
|
}
|
|
1159
927
|
)
|
|
@@ -1162,104 +930,104 @@ function ht() {
|
|
|
1162
930
|
}
|
|
1163
931
|
);
|
|
1164
932
|
}
|
|
1165
|
-
function
|
|
1166
|
-
userId:
|
|
1167
|
-
className:
|
|
1168
|
-
initialTab:
|
|
1169
|
-
extra:
|
|
933
|
+
function Wt({
|
|
934
|
+
userId: s,
|
|
935
|
+
className: u,
|
|
936
|
+
initialTab: t,
|
|
937
|
+
extra: i,
|
|
1170
938
|
pushServiceWorker: o = "/sw.js"
|
|
1171
939
|
}) {
|
|
1172
|
-
const l =
|
|
1173
|
-
return !
|
|
940
|
+
const l = pe();
|
|
941
|
+
return !s || (l == null ? void 0 : l.userId) != null && String(l.userId) === String(s) ? /* @__PURE__ */ e(mt, { className: u, extra: i, pushServiceWorker: o }) : /* @__PURE__ */ e(Xe, { userId: s, className: u, initialTab: t });
|
|
1174
942
|
}
|
|
1175
|
-
function
|
|
1176
|
-
className:
|
|
1177
|
-
extra:
|
|
1178
|
-
pushServiceWorker:
|
|
943
|
+
function mt({
|
|
944
|
+
className: s,
|
|
945
|
+
extra: u,
|
|
946
|
+
pushServiceWorker: t
|
|
1179
947
|
}) {
|
|
1180
|
-
var
|
|
1181
|
-
const
|
|
1182
|
-
queryKey: ["nvr-profile-user",
|
|
1183
|
-
queryFn: () =>
|
|
1184
|
-
enabled:
|
|
1185
|
-
}),
|
|
1186
|
-
queryKey: ["nvr-profile-card",
|
|
1187
|
-
queryFn: () =>
|
|
1188
|
-
enabled: !!
|
|
1189
|
-
}), [
|
|
948
|
+
var E;
|
|
949
|
+
const i = A(), o = K(), l = pe(), c = !0, m = "me", { data: r } = v({
|
|
950
|
+
queryKey: ["nvr-profile-user", m],
|
|
951
|
+
queryFn: () => i.request(he(m)).then((d) => d.data),
|
|
952
|
+
enabled: c
|
|
953
|
+
}), h = (r == null ? void 0 : r.id) ?? null, { data: p } = v({
|
|
954
|
+
queryKey: ["nvr-profile-card", h],
|
|
955
|
+
queryFn: () => i.request(be(h)).then((d) => d.data),
|
|
956
|
+
enabled: !!h
|
|
957
|
+
}), [S, k] = C(null), F = Ae(
|
|
1190
958
|
() => ({
|
|
1191
|
-
first_name: (
|
|
1192
|
-
last_name: (
|
|
1193
|
-
title: (
|
|
1194
|
-
department: (
|
|
1195
|
-
phone: (
|
|
959
|
+
first_name: (r == null ? void 0 : r.first_name) ?? "",
|
|
960
|
+
last_name: (r == null ? void 0 : r.last_name) ?? "",
|
|
961
|
+
title: (r == null ? void 0 : r.title) ?? "",
|
|
962
|
+
department: (r == null ? void 0 : r.department) ?? "",
|
|
963
|
+
phone: (r == null ? void 0 : r.phone) ?? ""
|
|
1196
964
|
}),
|
|
1197
|
-
[
|
|
1198
|
-
),
|
|
1199
|
-
mutationFn: () =>
|
|
965
|
+
[r]
|
|
966
|
+
), f = S ?? F, _ = JSON.stringify(f) !== JSON.stringify(F), O = w({
|
|
967
|
+
mutationFn: () => i.request(oe(r.id, f)),
|
|
1200
968
|
onSuccess: () => {
|
|
1201
|
-
|
|
969
|
+
k(null), o.invalidateQueries({ queryKey: ["nvr-profile-user"] }), o.invalidateQueries({ queryKey: ["nvr-profile-card"] });
|
|
1202
970
|
}
|
|
1203
|
-
}), [
|
|
1204
|
-
mutationFn: async (
|
|
1205
|
-
const
|
|
1206
|
-
const
|
|
1207
|
-
|
|
1208
|
-
URL.revokeObjectURL(
|
|
1209
|
-
const
|
|
1210
|
-
|
|
1211
|
-
const V =
|
|
971
|
+
}), [q, g] = C(ut), $ = ue(null), L = w({
|
|
972
|
+
mutationFn: async (d) => {
|
|
973
|
+
const y = await new Promise((P, J) => {
|
|
974
|
+
const D = new Image(), z = URL.createObjectURL(d);
|
|
975
|
+
D.onload = () => {
|
|
976
|
+
URL.revokeObjectURL(z);
|
|
977
|
+
const M = 96, I = document.createElement("canvas");
|
|
978
|
+
I.width = M, I.height = M;
|
|
979
|
+
const V = I.getContext("2d");
|
|
1212
980
|
if (!V) return J(new Error("canvas unavailable"));
|
|
1213
|
-
const Z = Math.max(
|
|
1214
|
-
V.drawImage(
|
|
1215
|
-
},
|
|
1216
|
-
URL.revokeObjectURL(
|
|
1217
|
-
},
|
|
981
|
+
const Z = Math.max(M / D.width, M / D.height), Y = D.width * Z, W = D.height * Z;
|
|
982
|
+
V.drawImage(D, (M - Y) / 2, (M - W) / 2, Y, W), P(I.toDataURL("image/jpeg", 0.85));
|
|
983
|
+
}, D.onerror = () => {
|
|
984
|
+
URL.revokeObjectURL(z), J(new Error("not an image"));
|
|
985
|
+
}, D.src = z;
|
|
1218
986
|
});
|
|
1219
|
-
await
|
|
987
|
+
await i.request(oe(r.id, { avatar: y }));
|
|
1220
988
|
},
|
|
1221
989
|
onSuccess: () => {
|
|
1222
990
|
o.invalidateQueries({ queryKey: ["nvr-profile-user"] }), o.invalidateQueries({ queryKey: ["nvr-profile-card"] }), o.invalidateQueries({ queryKey: ["user-card"] }), o.invalidateQueries({ queryKey: ["user-avatar"] });
|
|
1223
991
|
}
|
|
1224
|
-
}),
|
|
1225
|
-
if (!
|
|
1226
|
-
return /* @__PURE__ */
|
|
1227
|
-
/* @__PURE__ */
|
|
992
|
+
}), x = p ?? (r ? { ...r, role_name: null } : null);
|
|
993
|
+
if (!x)
|
|
994
|
+
return /* @__PURE__ */ a("div", { className: Q("flex animate-pulse flex-col gap-4", s), "aria-busy": "true", children: [
|
|
995
|
+
/* @__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: [
|
|
1228
996
|
/* @__PURE__ */ e("div", { className: "h-[76px] w-[76px] rounded-full bg-slate-100 dark:bg-muted" }),
|
|
1229
|
-
/* @__PURE__ */
|
|
997
|
+
/* @__PURE__ */ a("div", { className: "flex-1 space-y-2.5", children: [
|
|
1230
998
|
/* @__PURE__ */ e("div", { className: "h-5 w-48 rounded bg-slate-100 dark:bg-muted" }),
|
|
1231
999
|
/* @__PURE__ */ e("div", { className: "h-3.5 w-72 max-w-full rounded bg-slate-100 dark:bg-muted" }),
|
|
1232
1000
|
/* @__PURE__ */ e("div", { className: "h-3.5 w-56 max-w-full rounded bg-slate-100 dark:bg-muted" })
|
|
1233
1001
|
] })
|
|
1234
1002
|
] }),
|
|
1235
|
-
/* @__PURE__ */
|
|
1003
|
+
/* @__PURE__ */ a("div", { className: "grid gap-4 lg:grid-cols-2", children: [
|
|
1236
1004
|
/* @__PURE__ */ e("div", { className: "h-64 rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card" }),
|
|
1237
1005
|
/* @__PURE__ */ e("div", { className: "h-64 rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card" })
|
|
1238
1006
|
] })
|
|
1239
1007
|
] });
|
|
1240
|
-
const
|
|
1241
|
-
return /* @__PURE__ */
|
|
1242
|
-
/* @__PURE__ */ e("div", { className: "rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card", children: /* @__PURE__ */
|
|
1243
|
-
/* @__PURE__ */
|
|
1244
|
-
|
|
1008
|
+
const R = (r == null ? void 0 : r.avatar) ?? null, j = x.status === "active";
|
|
1009
|
+
return /* @__PURE__ */ a("div", { className: Q("flex flex-col gap-4", s), "data-nvr-profile": !0, children: [
|
|
1010
|
+
/* @__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: [
|
|
1011
|
+
/* @__PURE__ */ a("div", { className: "relative", children: [
|
|
1012
|
+
R ? /* @__PURE__ */ e(
|
|
1245
1013
|
"img",
|
|
1246
1014
|
{
|
|
1247
|
-
src:
|
|
1015
|
+
src: R.startsWith("data:") ? R : `/api/files/${R}`,
|
|
1248
1016
|
alt: "",
|
|
1249
1017
|
className: "h-[76px] w-[76px] rounded-full border border-slate-200 object-cover dark:border-border"
|
|
1250
1018
|
}
|
|
1251
|
-
) : /* @__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:
|
|
1019
|
+
) : /* @__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: at(x) }),
|
|
1252
1020
|
/* @__PURE__ */ e(
|
|
1253
1021
|
"span",
|
|
1254
1022
|
{
|
|
1255
|
-
className:
|
|
1023
|
+
className: Q(
|
|
1256
1024
|
"absolute bottom-0.5 right-0.5 h-3 w-3 rounded-full border-2 border-white dark:border-card",
|
|
1257
|
-
|
|
1025
|
+
j ? "bg-emerald-500" : "bg-slate-300 dark:bg-slate-600"
|
|
1258
1026
|
),
|
|
1259
|
-
title:
|
|
1027
|
+
title: j ? "Active" : x.status
|
|
1260
1028
|
}
|
|
1261
1029
|
),
|
|
1262
|
-
/* @__PURE__ */
|
|
1030
|
+
/* @__PURE__ */ a(X, { children: [
|
|
1263
1031
|
/* @__PURE__ */ e(
|
|
1264
1032
|
"button",
|
|
1265
1033
|
{
|
|
@@ -1267,82 +1035,82 @@ function bt({
|
|
|
1267
1035
|
title: "Change photo",
|
|
1268
1036
|
"aria-label": "Change photo",
|
|
1269
1037
|
onClick: () => {
|
|
1270
|
-
var
|
|
1271
|
-
return (
|
|
1038
|
+
var d;
|
|
1039
|
+
return (d = $.current) == null ? void 0 : d.click();
|
|
1272
1040
|
},
|
|
1273
1041
|
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",
|
|
1274
|
-
children:
|
|
1042
|
+
children: L.isPending ? /* @__PURE__ */ e(ie, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ e(fe, { className: "h-3.5 w-3.5" })
|
|
1275
1043
|
}
|
|
1276
1044
|
),
|
|
1277
1045
|
/* @__PURE__ */ e(
|
|
1278
1046
|
"input",
|
|
1279
1047
|
{
|
|
1280
|
-
ref:
|
|
1048
|
+
ref: $,
|
|
1281
1049
|
type: "file",
|
|
1282
1050
|
accept: "image/*",
|
|
1283
1051
|
className: "hidden",
|
|
1284
|
-
onChange: (
|
|
1285
|
-
var
|
|
1286
|
-
const
|
|
1287
|
-
|
|
1052
|
+
onChange: (d) => {
|
|
1053
|
+
var P;
|
|
1054
|
+
const y = (P = d.target.files) == null ? void 0 : P[0];
|
|
1055
|
+
y && L.mutate(y), d.target.value = "";
|
|
1288
1056
|
}
|
|
1289
1057
|
}
|
|
1290
1058
|
)
|
|
1291
1059
|
] })
|
|
1292
1060
|
] }),
|
|
1293
|
-
/* @__PURE__ */
|
|
1294
|
-
/* @__PURE__ */
|
|
1295
|
-
/* @__PURE__ */ e("h1", { className: "text-[21px] font-semibold tracking-[-0.015em] text-slate-900 dark:text-white", children:
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
/* @__PURE__ */ e(
|
|
1061
|
+
/* @__PURE__ */ a("div", { className: "min-w-0 flex-1", children: [
|
|
1062
|
+
/* @__PURE__ */ a("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
1063
|
+
/* @__PURE__ */ e("h1", { className: "text-[21px] font-semibold tracking-[-0.015em] text-slate-900 dark:text-white", children: tt(x) }),
|
|
1064
|
+
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 }),
|
|
1065
|
+
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" }),
|
|
1066
|
+
/* @__PURE__ */ e(He, { email: x.email, canClear: l.isAdmin })
|
|
1299
1067
|
] }),
|
|
1300
|
-
|
|
1068
|
+
r && // The same status the chat panel's Online tab sets — one editor,
|
|
1301
1069
|
// one preference, so the profile always agrees with the top bar.
|
|
1302
1070
|
/* @__PURE__ */ e(
|
|
1303
|
-
|
|
1071
|
+
Le,
|
|
1304
1072
|
{
|
|
1305
|
-
status:
|
|
1306
|
-
(
|
|
1073
|
+
status: Me(
|
|
1074
|
+
(E = r.preferences) == null ? void 0 : E.custom_status
|
|
1307
1075
|
),
|
|
1308
1076
|
showExpiry: !0,
|
|
1309
1077
|
className: "mt-1.5"
|
|
1310
1078
|
}
|
|
1311
1079
|
),
|
|
1312
|
-
(
|
|
1313
|
-
/* @__PURE__ */
|
|
1314
|
-
|
|
1315
|
-
/* @__PURE__ */ e(
|
|
1080
|
+
(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(" · ") }),
|
|
1081
|
+
/* @__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: [
|
|
1082
|
+
x.company && /* @__PURE__ */ a("span", { className: "inline-flex items-center gap-1.5", children: [
|
|
1083
|
+
/* @__PURE__ */ e(ye, { className: "h-3.5 w-3.5" }),
|
|
1316
1084
|
" ",
|
|
1317
|
-
|
|
1085
|
+
x.company
|
|
1318
1086
|
] }),
|
|
1319
|
-
/* @__PURE__ */
|
|
1087
|
+
/* @__PURE__ */ a(
|
|
1320
1088
|
"a",
|
|
1321
1089
|
{
|
|
1322
|
-
href: `mailto:${
|
|
1090
|
+
href: `mailto:${x.email}`,
|
|
1323
1091
|
className: "inline-flex items-center gap-1.5 transition-colors hover:text-nvr-navy dark:hover:text-nvr-cyan",
|
|
1324
1092
|
children: [
|
|
1325
|
-
/* @__PURE__ */ e(
|
|
1093
|
+
/* @__PURE__ */ e(ve, { className: "h-3.5 w-3.5" }),
|
|
1326
1094
|
" ",
|
|
1327
|
-
|
|
1095
|
+
x.email
|
|
1328
1096
|
]
|
|
1329
1097
|
}
|
|
1330
1098
|
),
|
|
1331
|
-
|
|
1099
|
+
x.phone && /* @__PURE__ */ a(
|
|
1332
1100
|
"a",
|
|
1333
1101
|
{
|
|
1334
|
-
href: `tel:${
|
|
1102
|
+
href: `tel:${x.phone}`,
|
|
1335
1103
|
className: "inline-flex items-center gap-1.5 transition-colors hover:text-nvr-navy dark:hover:text-nvr-cyan",
|
|
1336
1104
|
children: [
|
|
1337
|
-
/* @__PURE__ */ e(
|
|
1105
|
+
/* @__PURE__ */ e(ke, { className: "h-3.5 w-3.5" }),
|
|
1338
1106
|
" ",
|
|
1339
|
-
|
|
1107
|
+
x.phone
|
|
1340
1108
|
]
|
|
1341
1109
|
}
|
|
1342
1110
|
),
|
|
1343
|
-
|
|
1344
|
-
/* @__PURE__ */ e(
|
|
1345
|
-
new Date(
|
|
1111
|
+
x.last_access && /* @__PURE__ */ a("span", { className: "inline-flex items-center gap-1.5", title: "Last active", children: [
|
|
1112
|
+
/* @__PURE__ */ e(Ne, { className: "h-3.5 w-3.5" }),
|
|
1113
|
+
new Date(x.last_access).toLocaleDateString(void 0, {
|
|
1346
1114
|
month: "short",
|
|
1347
1115
|
day: "numeric"
|
|
1348
1116
|
})
|
|
@@ -1350,151 +1118,155 @@ function bt({
|
|
|
1350
1118
|
] })
|
|
1351
1119
|
] })
|
|
1352
1120
|
] }) }),
|
|
1353
|
-
/* @__PURE__ */ e(
|
|
1354
|
-
|
|
1121
|
+
/* @__PURE__ */ e(pt, { tab: q, onChange: g }),
|
|
1122
|
+
q === "agents" ? /* @__PURE__ */ e(Qe, {}) : q === "did" && r ? (
|
|
1123
|
+
// #13 — your own audit trail, by day and collection.
|
|
1124
|
+
/* @__PURE__ */ e(Ye, { userId: String(r.id), name: null })
|
|
1125
|
+
) : r ? (
|
|
1355
1126
|
// One list in reading order — you, then notifications, then access
|
|
1356
1127
|
// and security — flowing into two balanced columns. Two fixed stacks
|
|
1357
1128
|
// left thirteen cards on one side and four on the other, and the page
|
|
1358
1129
|
// ran as long as the heavy side. Cards never split across columns.
|
|
1359
|
-
/* @__PURE__ */
|
|
1130
|
+
/* @__PURE__ */ a(
|
|
1360
1131
|
"div",
|
|
1361
1132
|
{
|
|
1362
1133
|
className: "gap-4 lg:columns-2 [&>*]:mb-4 [&>*]:break-inside-avoid",
|
|
1363
1134
|
"data-profile-columns": !0,
|
|
1364
1135
|
children: [
|
|
1365
1136
|
/* @__PURE__ */ e(
|
|
1366
|
-
|
|
1137
|
+
ne,
|
|
1367
1138
|
{
|
|
1368
|
-
icon: /* @__PURE__ */ e(
|
|
1139
|
+
icon: /* @__PURE__ */ e(_e, { className: "h-4 w-4" }),
|
|
1369
1140
|
title: "About you",
|
|
1370
1141
|
hint: "Shown on your contact card across the app",
|
|
1371
|
-
actions:
|
|
1372
|
-
/* @__PURE__ */
|
|
1142
|
+
actions: _ && /* @__PURE__ */ a("span", { className: "flex items-center gap-1.5", children: [
|
|
1143
|
+
/* @__PURE__ */ a(
|
|
1373
1144
|
"button",
|
|
1374
1145
|
{
|
|
1375
1146
|
type: "button",
|
|
1376
1147
|
title: "Discard changes",
|
|
1377
|
-
onClick: () =>
|
|
1148
|
+
onClick: () => k(null),
|
|
1378
1149
|
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",
|
|
1379
1150
|
children: [
|
|
1380
|
-
/* @__PURE__ */ e(
|
|
1151
|
+
/* @__PURE__ */ e(we, { className: "h-3 w-3" }),
|
|
1381
1152
|
" Reset"
|
|
1382
1153
|
]
|
|
1383
1154
|
}
|
|
1384
1155
|
),
|
|
1385
|
-
/* @__PURE__ */
|
|
1156
|
+
/* @__PURE__ */ a(
|
|
1386
1157
|
"button",
|
|
1387
1158
|
{
|
|
1388
1159
|
type: "button",
|
|
1389
|
-
disabled:
|
|
1390
|
-
onClick: () =>
|
|
1160
|
+
disabled: O.isPending,
|
|
1161
|
+
onClick: () => O.mutate(),
|
|
1391
1162
|
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",
|
|
1392
1163
|
children: [
|
|
1393
|
-
|
|
1164
|
+
O.isPending ? /* @__PURE__ */ e(ie, { className: "h-3 w-3 animate-spin" }) : /* @__PURE__ */ e(Se, { className: "h-3 w-3" }),
|
|
1394
1165
|
" ",
|
|
1395
1166
|
"Save"
|
|
1396
1167
|
]
|
|
1397
1168
|
}
|
|
1398
1169
|
)
|
|
1399
1170
|
] }),
|
|
1400
|
-
children: /* @__PURE__ */
|
|
1171
|
+
children: /* @__PURE__ */ a("div", { className: "grid gap-3 sm:grid-cols-2", children: [
|
|
1401
1172
|
/* @__PURE__ */ e(
|
|
1402
|
-
|
|
1173
|
+
H,
|
|
1403
1174
|
{
|
|
1404
1175
|
label: "First name",
|
|
1405
|
-
value:
|
|
1406
|
-
onChange: (
|
|
1176
|
+
value: f.first_name,
|
|
1177
|
+
onChange: (d) => k({ ...f, first_name: d })
|
|
1407
1178
|
}
|
|
1408
1179
|
),
|
|
1409
1180
|
/* @__PURE__ */ e(
|
|
1410
|
-
|
|
1181
|
+
H,
|
|
1411
1182
|
{
|
|
1412
1183
|
label: "Last name",
|
|
1413
|
-
value:
|
|
1414
|
-
onChange: (
|
|
1184
|
+
value: f.last_name,
|
|
1185
|
+
onChange: (d) => k({ ...f, last_name: d })
|
|
1415
1186
|
}
|
|
1416
1187
|
),
|
|
1417
1188
|
/* @__PURE__ */ e(
|
|
1418
|
-
|
|
1189
|
+
H,
|
|
1419
1190
|
{
|
|
1420
1191
|
label: "Title",
|
|
1421
|
-
value:
|
|
1422
|
-
onChange: (
|
|
1192
|
+
value: f.title,
|
|
1193
|
+
onChange: (d) => k({ ...f, title: d }),
|
|
1423
1194
|
placeholder: "e.g. Construction Manager"
|
|
1424
1195
|
}
|
|
1425
1196
|
),
|
|
1426
1197
|
/* @__PURE__ */ e(
|
|
1427
|
-
|
|
1198
|
+
H,
|
|
1428
1199
|
{
|
|
1429
1200
|
label: "Department",
|
|
1430
|
-
value:
|
|
1431
|
-
onChange: (
|
|
1201
|
+
value: f.department,
|
|
1202
|
+
onChange: (d) => k({ ...f, department: d })
|
|
1432
1203
|
}
|
|
1433
1204
|
),
|
|
1434
1205
|
/* @__PURE__ */ e(
|
|
1435
|
-
|
|
1206
|
+
H,
|
|
1436
1207
|
{
|
|
1437
1208
|
label: "Phone",
|
|
1438
|
-
value:
|
|
1439
|
-
onChange: (
|
|
1209
|
+
value: f.phone,
|
|
1210
|
+
onChange: (d) => k({ ...f, phone: d }),
|
|
1440
1211
|
placeholder: "+1 …",
|
|
1441
1212
|
type: "tel"
|
|
1442
1213
|
}
|
|
1443
1214
|
),
|
|
1444
|
-
/* @__PURE__ */ e(
|
|
1215
|
+
/* @__PURE__ */ e(H, { label: "Email", value: r.email ?? "", disabled: !0, hint: "managed by admin" })
|
|
1445
1216
|
] })
|
|
1446
1217
|
}
|
|
1447
1218
|
),
|
|
1448
1219
|
/* @__PURE__ */ e(
|
|
1449
|
-
|
|
1220
|
+
Be,
|
|
1450
1221
|
{
|
|
1451
|
-
user:
|
|
1222
|
+
user: r,
|
|
1452
1223
|
onSaved: () => {
|
|
1453
1224
|
o.invalidateQueries({ queryKey: ["nvr-profile-user"] }), o.invalidateQueries({ queryKey: ["nvr-profile-card"] });
|
|
1454
1225
|
}
|
|
1455
1226
|
}
|
|
1456
1227
|
),
|
|
1457
|
-
/* @__PURE__ */ e(
|
|
1458
|
-
/* @__PURE__ */ e(
|
|
1459
|
-
/* @__PURE__ */ e(
|
|
1460
|
-
/* @__PURE__ */ e(
|
|
1228
|
+
/* @__PURE__ */ e(nt, {}),
|
|
1229
|
+
/* @__PURE__ */ e(ot, {}),
|
|
1230
|
+
/* @__PURE__ */ e(yt, {}),
|
|
1231
|
+
/* @__PURE__ */ e(Ve, {}),
|
|
1232
|
+
/* @__PURE__ */ e(lt, {}),
|
|
1233
|
+
/* @__PURE__ */ e(Ue, {}),
|
|
1234
|
+
/* @__PURE__ */ e($e, {}),
|
|
1235
|
+
l.isAdmin && (r != null && r.id) ? /* @__PURE__ */ e(Ze, { userId: String(r.id) }) : /* @__PURE__ */ e(it, {}),
|
|
1236
|
+
/* @__PURE__ */ e(bt, {}),
|
|
1237
|
+
/* @__PURE__ */ e(We, { userId: "me" }),
|
|
1238
|
+
/* @__PURE__ */ e(xt, {}),
|
|
1239
|
+
/* @__PURE__ */ e(st, {}),
|
|
1240
|
+
/* @__PURE__ */ e(Je, {}),
|
|
1241
|
+
t !== !1 && /* @__PURE__ */ e(ze, { serviceWorkerPath: t }),
|
|
1242
|
+
/* @__PURE__ */ e(gt, {}),
|
|
1461
1243
|
/* @__PURE__ */ e(ct, {}),
|
|
1462
|
-
/* @__PURE__ */ e(We, {}),
|
|
1463
|
-
/* @__PURE__ */ e(Ge, {}),
|
|
1464
|
-
l.isAdmin && (n != null && n.id) ? /* @__PURE__ */ e(rt, { userId: String(n.id) }) : /* @__PURE__ */ e(mt, {}),
|
|
1465
1244
|
/* @__PURE__ */ e(ft, {}),
|
|
1466
|
-
/* @__PURE__ */ e(Xe, { userId: "me" }),
|
|
1467
|
-
/* @__PURE__ */ e(vt, {}),
|
|
1468
|
-
/* @__PURE__ */ e(dt, {}),
|
|
1469
|
-
/* @__PURE__ */ e(tt, {}),
|
|
1470
|
-
r !== !1 && /* @__PURE__ */ e(Je, { serviceWorkerPath: r }),
|
|
1471
|
-
/* @__PURE__ */ e(kt, {}),
|
|
1472
1245
|
/* @__PURE__ */ e(ht, {}),
|
|
1473
|
-
|
|
1474
|
-
/* @__PURE__ */ e(yt, {}),
|
|
1475
|
-
m
|
|
1246
|
+
u
|
|
1476
1247
|
]
|
|
1477
1248
|
}
|
|
1478
1249
|
)
|
|
1479
1250
|
) : null
|
|
1480
1251
|
] });
|
|
1481
1252
|
}
|
|
1482
|
-
function
|
|
1253
|
+
function ut() {
|
|
1483
1254
|
try {
|
|
1484
|
-
|
|
1255
|
+
const s = new URLSearchParams(window.location.search).get("tab");
|
|
1256
|
+
return s === "agents" || s === "did" ? s : "profile";
|
|
1485
1257
|
} catch {
|
|
1486
1258
|
return "profile";
|
|
1487
1259
|
}
|
|
1488
1260
|
}
|
|
1489
|
-
function
|
|
1490
|
-
tab:
|
|
1491
|
-
onChange:
|
|
1261
|
+
function pt({
|
|
1262
|
+
tab: s,
|
|
1263
|
+
onChange: u
|
|
1492
1264
|
}) {
|
|
1493
|
-
const
|
|
1494
|
-
|
|
1265
|
+
const t = (o) => {
|
|
1266
|
+
u(o);
|
|
1495
1267
|
try {
|
|
1496
1268
|
const l = new URL(window.location.href);
|
|
1497
|
-
o
|
|
1269
|
+
o !== "profile" ? l.searchParams.set("tab", o) : l.searchParams.delete("tab"), window.history.replaceState(window.history.state, "", l);
|
|
1498
1270
|
} catch {
|
|
1499
1271
|
}
|
|
1500
1272
|
};
|
|
@@ -1506,17 +1278,18 @@ function gt({
|
|
|
1506
1278
|
className: "flex gap-1 border-b border-slate-200 dark:border-border",
|
|
1507
1279
|
children: [
|
|
1508
1280
|
["profile", "Profile"],
|
|
1509
|
-
["agents", "What my agents did"]
|
|
1281
|
+
["agents", "What my agents did"],
|
|
1282
|
+
["did", "What I did"]
|
|
1510
1283
|
].map(([o, l]) => /* @__PURE__ */ e(
|
|
1511
1284
|
"button",
|
|
1512
1285
|
{
|
|
1513
1286
|
type: "button",
|
|
1514
1287
|
role: "tab",
|
|
1515
|
-
"aria-selected":
|
|
1516
|
-
onClick: () =>
|
|
1517
|
-
className:
|
|
1288
|
+
"aria-selected": s === o,
|
|
1289
|
+
onClick: () => t(o),
|
|
1290
|
+
className: Q(
|
|
1518
1291
|
"-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",
|
|
1519
|
-
|
|
1292
|
+
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"
|
|
1520
1293
|
),
|
|
1521
1294
|
children: l
|
|
1522
1295
|
},
|
|
@@ -1525,119 +1298,119 @@ function gt({
|
|
|
1525
1298
|
}
|
|
1526
1299
|
);
|
|
1527
1300
|
}
|
|
1528
|
-
function
|
|
1529
|
-
const
|
|
1301
|
+
function ht() {
|
|
1302
|
+
const s = A(), [u, t] = C(!1), { data: i = [], isLoading: o } = v({
|
|
1530
1303
|
queryKey: ["my-matrix-seats"],
|
|
1531
|
-
queryFn: () =>
|
|
1532
|
-
enabled:
|
|
1304
|
+
queryFn: () => s.request(T("/pipelines/my-seats")).then((c) => c.data ?? []).catch(() => []),
|
|
1305
|
+
enabled: u,
|
|
1533
1306
|
staleTime: 6e4
|
|
1534
1307
|
}), l = /* @__PURE__ */ new Map();
|
|
1535
|
-
for (const
|
|
1536
|
-
const
|
|
1537
|
-
|
|
1308
|
+
for (const c of i) {
|
|
1309
|
+
const m = l.get(c.template_name) ?? [];
|
|
1310
|
+
m.push(c), l.set(c.template_name, m);
|
|
1538
1311
|
}
|
|
1539
|
-
return /* @__PURE__ */
|
|
1540
|
-
/* @__PURE__ */
|
|
1312
|
+
return /* @__PURE__ */ a("div", { className: "rounded-lg border border-slate-200 bg-white p-4 dark:border-border dark:bg-card", children: [
|
|
1313
|
+
/* @__PURE__ */ a(
|
|
1541
1314
|
"button",
|
|
1542
1315
|
{
|
|
1543
1316
|
type: "button",
|
|
1544
|
-
onClick: () =>
|
|
1317
|
+
onClick: () => t((c) => !c),
|
|
1545
1318
|
className: "flex w-full items-center justify-between text-left",
|
|
1546
1319
|
children: [
|
|
1547
|
-
/* @__PURE__ */
|
|
1320
|
+
/* @__PURE__ */ a("div", { children: [
|
|
1548
1321
|
/* @__PURE__ */ e("h3", { className: "text-[14px] font-semibold", children: "My approval seats" }),
|
|
1549
1322
|
/* @__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." })
|
|
1550
1323
|
] }),
|
|
1551
|
-
/* @__PURE__ */ e("span", { className: "text-slate-400", children:
|
|
1324
|
+
/* @__PURE__ */ e("span", { className: "text-slate-400", children: u ? "▾" : "▸" })
|
|
1552
1325
|
]
|
|
1553
1326
|
}
|
|
1554
1327
|
),
|
|
1555
|
-
|
|
1556
|
-
/* @__PURE__ */ e("p", { className: "text-[11px] font-semibold uppercase tracking-wide text-slate-400", children:
|
|
1557
|
-
/* @__PURE__ */
|
|
1558
|
-
|
|
1559
|
-
/* @__PURE__ */ e("span", { className: "font-medium", children:
|
|
1560
|
-
|
|
1328
|
+
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: [
|
|
1329
|
+
/* @__PURE__ */ e("p", { className: "text-[11px] font-semibold uppercase tracking-wide text-slate-400", children: c }),
|
|
1330
|
+
/* @__PURE__ */ a("ul", { className: "mt-1 space-y-1.5", children: [
|
|
1331
|
+
m.slice(0, 40).map((r) => /* @__PURE__ */ a("li", { className: "text-[12.5px]", children: [
|
|
1332
|
+
/* @__PURE__ */ e("span", { className: "font-medium", children: r.state_label || r.state_key }),
|
|
1333
|
+
r.group_name && /* @__PURE__ */ a("span", { className: "text-slate-500 dark:text-muted-foreground", children: [
|
|
1561
1334
|
" ",
|
|
1562
1335
|
"— ",
|
|
1563
|
-
|
|
1336
|
+
r.group_name
|
|
1564
1337
|
] }),
|
|
1565
|
-
(
|
|
1566
|
-
Array.isArray(
|
|
1338
|
+
(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" }),
|
|
1339
|
+
Array.isArray(r.filters) && r.filters.length > 0 && // "Region: KEY Zone: Zone 1" — what the matrix cell matches on.
|
|
1567
1340
|
/* @__PURE__ */ e(
|
|
1568
1341
|
"span",
|
|
1569
1342
|
{
|
|
1570
1343
|
"data-seat-filters": !0,
|
|
1571
1344
|
className: "mt-0.5 flex flex-wrap gap-x-2.5 gap-y-0.5 text-[11.5px]",
|
|
1572
|
-
children:
|
|
1573
|
-
/* @__PURE__ */
|
|
1574
|
-
|
|
1345
|
+
children: r.filters.map((h) => /* @__PURE__ */ a("span", { className: "whitespace-nowrap", children: [
|
|
1346
|
+
/* @__PURE__ */ a("span", { className: "text-slate-500 dark:text-slate-400", children: [
|
|
1347
|
+
h.label ?? h.field,
|
|
1575
1348
|
":"
|
|
1576
1349
|
] }),
|
|
1577
1350
|
" ",
|
|
1578
|
-
/* @__PURE__ */ e("span", { className: "text-slate-600 dark:text-slate-300", children: String(
|
|
1579
|
-
] },
|
|
1351
|
+
/* @__PURE__ */ e("span", { className: "text-slate-600 dark:text-slate-300", children: String(h.value ?? "—") })
|
|
1352
|
+
] }, h.field))
|
|
1580
1353
|
}
|
|
1581
1354
|
)
|
|
1582
|
-
] },
|
|
1583
|
-
|
|
1355
|
+
] }, r.group_id)),
|
|
1356
|
+
m.length > 40 && /* @__PURE__ */ a("li", { className: "text-[11.5px] text-slate-400", children: [
|
|
1584
1357
|
"…and ",
|
|
1585
|
-
|
|
1358
|
+
m.length - 40,
|
|
1586
1359
|
" more"
|
|
1587
1360
|
] })
|
|
1588
1361
|
] })
|
|
1589
|
-
] },
|
|
1362
|
+
] }, c)) }))
|
|
1590
1363
|
] });
|
|
1591
1364
|
}
|
|
1592
|
-
function
|
|
1593
|
-
const
|
|
1365
|
+
function bt() {
|
|
1366
|
+
const s = A(), u = K(), { data: t = [] } = v({
|
|
1594
1367
|
queryKey: ["my-reminders"],
|
|
1595
|
-
queryFn: () =>
|
|
1368
|
+
queryFn: () => s.request(T("/reminders")).then((p) => p.data).catch(() => []),
|
|
1596
1369
|
staleTime: 3e4
|
|
1597
|
-
}), [
|
|
1598
|
-
mutationFn: () =>
|
|
1370
|
+
}), [i, o] = C(""), [l, c] = C(""), m = () => void u.invalidateQueries({ queryKey: ["my-reminders"] }), r = w({
|
|
1371
|
+
mutationFn: () => s.request(ee("/reminders", { note: i, remind_at: new Date(l).toISOString() })),
|
|
1599
1372
|
onSuccess: () => {
|
|
1600
|
-
o(""),
|
|
1373
|
+
o(""), c(""), m();
|
|
1601
1374
|
}
|
|
1602
|
-
}),
|
|
1603
|
-
mutationFn: (
|
|
1604
|
-
onSuccess:
|
|
1375
|
+
}), h = w({
|
|
1376
|
+
mutationFn: (p) => s.request(Oe(`/reminders/${p}`)),
|
|
1377
|
+
onSuccess: m
|
|
1605
1378
|
});
|
|
1606
|
-
return /* @__PURE__ */
|
|
1607
|
-
/* @__PURE__ */
|
|
1379
|
+
return /* @__PURE__ */ a("div", { className: "rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card", children: [
|
|
1380
|
+
/* @__PURE__ */ a("header", { className: "border-b border-slate-100 px-4 py-2.5 dark:border-border/60", children: [
|
|
1608
1381
|
/* @__PURE__ */ e("h3", { className: "text-[13px] font-semibold text-slate-800 dark:text-slate-100", children: "Reminders" }),
|
|
1609
1382
|
/* @__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.` })
|
|
1610
1383
|
] }),
|
|
1611
|
-
/* @__PURE__ */
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
/* @__PURE__ */
|
|
1615
|
-
/* @__PURE__ */ e("p", { className: "truncate text-[12.5px] text-slate-700 dark:text-slate-200", children:
|
|
1616
|
-
/* @__PURE__ */ e("p", { className: "text-[11px] text-slate-400", children: new Date(
|
|
1384
|
+
/* @__PURE__ */ a("div", { className: "space-y-2 px-4 py-3", children: [
|
|
1385
|
+
t.length === 0 && /* @__PURE__ */ e("p", { className: "text-[12px] text-slate-400", children: "No upcoming reminders." }),
|
|
1386
|
+
t.map((p) => /* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
|
|
1387
|
+
/* @__PURE__ */ a("div", { className: "min-w-0 flex-1", children: [
|
|
1388
|
+
/* @__PURE__ */ e("p", { className: "truncate text-[12.5px] text-slate-700 dark:text-slate-200", children: p.note }),
|
|
1389
|
+
/* @__PURE__ */ e("p", { className: "text-[11px] text-slate-400", children: new Date(p.remind_at).toLocaleString() })
|
|
1617
1390
|
] }),
|
|
1618
1391
|
/* @__PURE__ */ e(
|
|
1619
1392
|
"button",
|
|
1620
1393
|
{
|
|
1621
1394
|
type: "button",
|
|
1622
|
-
onClick: () =>
|
|
1395
|
+
onClick: () => h.mutate(p.id),
|
|
1623
1396
|
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",
|
|
1624
1397
|
children: "Cancel"
|
|
1625
1398
|
}
|
|
1626
1399
|
)
|
|
1627
|
-
] },
|
|
1628
|
-
/* @__PURE__ */
|
|
1400
|
+
] }, p.id)),
|
|
1401
|
+
/* @__PURE__ */ a(
|
|
1629
1402
|
"form",
|
|
1630
1403
|
{
|
|
1631
1404
|
className: "flex flex-wrap items-center gap-2 pt-1",
|
|
1632
|
-
onSubmit: (
|
|
1633
|
-
|
|
1405
|
+
onSubmit: (p) => {
|
|
1406
|
+
p.preventDefault(), i.trim() && l && r.mutate();
|
|
1634
1407
|
},
|
|
1635
1408
|
children: [
|
|
1636
1409
|
/* @__PURE__ */ e(
|
|
1637
1410
|
"input",
|
|
1638
1411
|
{
|
|
1639
|
-
value:
|
|
1640
|
-
onChange: (
|
|
1412
|
+
value: i,
|
|
1413
|
+
onChange: (p) => o(p.target.value),
|
|
1641
1414
|
placeholder: "Remind me to…",
|
|
1642
1415
|
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"
|
|
1643
1416
|
}
|
|
@@ -1647,7 +1420,7 @@ function ft() {
|
|
|
1647
1420
|
{
|
|
1648
1421
|
type: "datetime-local",
|
|
1649
1422
|
value: l,
|
|
1650
|
-
onChange: (
|
|
1423
|
+
onChange: (p) => c(p.target.value),
|
|
1651
1424
|
className: "h-7 rounded border border-slate-200 px-2 text-[12px] outline-none focus:border-nvr-cyan dark:border-border dark:bg-background"
|
|
1652
1425
|
}
|
|
1653
1426
|
),
|
|
@@ -1655,9 +1428,9 @@ function ft() {
|
|
|
1655
1428
|
"button",
|
|
1656
1429
|
{
|
|
1657
1430
|
type: "submit",
|
|
1658
|
-
disabled: !
|
|
1431
|
+
disabled: !i.trim() || !l || r.isPending,
|
|
1659
1432
|
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",
|
|
1660
|
-
children:
|
|
1433
|
+
children: r.isPending ? "Adding…" : "Add"
|
|
1661
1434
|
}
|
|
1662
1435
|
)
|
|
1663
1436
|
]
|
|
@@ -1666,55 +1439,55 @@ function ft() {
|
|
|
1666
1439
|
] })
|
|
1667
1440
|
] });
|
|
1668
1441
|
}
|
|
1669
|
-
function
|
|
1670
|
-
const
|
|
1442
|
+
function xt() {
|
|
1443
|
+
const s = A(), { data: u } = v({
|
|
1671
1444
|
queryKey: ["my-stats"],
|
|
1672
|
-
queryFn: () =>
|
|
1445
|
+
queryFn: () => s.request(T("/users/me/stats")).then((i) => i.data).catch(() => null),
|
|
1673
1446
|
staleTime: 5 * 6e4
|
|
1674
1447
|
});
|
|
1675
|
-
if (!
|
|
1676
|
-
const
|
|
1677
|
-
return /* @__PURE__ */
|
|
1678
|
-
/* @__PURE__ */
|
|
1679
|
-
/* @__PURE__ */
|
|
1448
|
+
if (!u) return null;
|
|
1449
|
+
const t = Math.max(1, ...u.weeks.map((i) => i.transitions + i.tasks_done + i.created));
|
|
1450
|
+
return /* @__PURE__ */ a("div", { className: "rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card", children: [
|
|
1451
|
+
/* @__PURE__ */ a("header", { className: "flex items-center justify-between border-b border-slate-100 px-4 py-2.5 dark:border-border/60", children: [
|
|
1452
|
+
/* @__PURE__ */ a("div", { children: [
|
|
1680
1453
|
/* @__PURE__ */ e("h3", { className: "text-[13px] font-semibold text-slate-800 dark:text-slate-100", children: "My activity" }),
|
|
1681
1454
|
/* @__PURE__ */ e("p", { className: "mt-0.5 text-[11px] text-slate-400", children: "Last 8 weeks — just yours." })
|
|
1682
1455
|
] }),
|
|
1683
|
-
|
|
1684
|
-
|
|
1456
|
+
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: [
|
|
1457
|
+
u.streak_days,
|
|
1685
1458
|
"-day streak"
|
|
1686
1459
|
] })
|
|
1687
1460
|
] }),
|
|
1688
|
-
/* @__PURE__ */
|
|
1689
|
-
/* @__PURE__ */ e("div", { className: "flex items-end gap-1.5", style: { height: 56 }, children:
|
|
1690
|
-
const l =
|
|
1461
|
+
/* @__PURE__ */ a("div", { className: "px-4 py-3", children: [
|
|
1462
|
+
/* @__PURE__ */ e("div", { className: "flex items-end gap-1.5", style: { height: 56 }, children: u.weeks.map((i, o) => {
|
|
1463
|
+
const l = i.transitions + i.tasks_done + i.created;
|
|
1691
1464
|
return /* @__PURE__ */ e(
|
|
1692
1465
|
"div",
|
|
1693
1466
|
{
|
|
1694
1467
|
className: "flex-1 rounded-t bg-nvr-cyan/60 transition-all dark:bg-nvr-cyan/40",
|
|
1695
|
-
style: { height: `${Math.max(4, l /
|
|
1696
|
-
"data-tip": `${l} action${l === 1 ? "" : "s"}: ${
|
|
1468
|
+
style: { height: `${Math.max(4, l / t * 100)}%` },
|
|
1469
|
+
"data-tip": `${l} action${l === 1 ? "" : "s"}: ${i.transitions} transitions, ${i.tasks_done} tasks done, ${i.created} created`
|
|
1697
1470
|
},
|
|
1698
1471
|
o
|
|
1699
1472
|
);
|
|
1700
1473
|
}) }),
|
|
1701
|
-
/* @__PURE__ */
|
|
1474
|
+
/* @__PURE__ */ a("div", { className: "mt-2 flex items-center justify-between text-[11px] text-slate-400", children: [
|
|
1702
1475
|
/* @__PURE__ */ e("span", { children: "8 weeks ago" }),
|
|
1703
1476
|
/* @__PURE__ */ e("span", { children: "this week" })
|
|
1704
1477
|
] }),
|
|
1705
|
-
/* @__PURE__ */
|
|
1706
|
-
/* @__PURE__ */
|
|
1707
|
-
/* @__PURE__ */ e("b", { className: "tabular-nums text-slate-700 dark:text-slate-200", children:
|
|
1478
|
+
/* @__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: [
|
|
1479
|
+
/* @__PURE__ */ a("span", { children: [
|
|
1480
|
+
/* @__PURE__ */ e("b", { className: "tabular-nums text-slate-700 dark:text-slate-200", children: u.totals.transitions }),
|
|
1708
1481
|
" ",
|
|
1709
1482
|
"transitions"
|
|
1710
1483
|
] }),
|
|
1711
|
-
/* @__PURE__ */
|
|
1712
|
-
/* @__PURE__ */ e("b", { className: "tabular-nums text-slate-700 dark:text-slate-200", children:
|
|
1484
|
+
/* @__PURE__ */ a("span", { children: [
|
|
1485
|
+
/* @__PURE__ */ e("b", { className: "tabular-nums text-slate-700 dark:text-slate-200", children: u.totals.tasks_done }),
|
|
1713
1486
|
" ",
|
|
1714
1487
|
"tasks done"
|
|
1715
1488
|
] }),
|
|
1716
|
-
/* @__PURE__ */
|
|
1717
|
-
/* @__PURE__ */ e("b", { className: "tabular-nums text-slate-700 dark:text-slate-200", children:
|
|
1489
|
+
/* @__PURE__ */ a("span", { children: [
|
|
1490
|
+
/* @__PURE__ */ e("b", { className: "tabular-nums text-slate-700 dark:text-slate-200", children: u.totals.created }),
|
|
1718
1491
|
" ",
|
|
1719
1492
|
"records created"
|
|
1720
1493
|
] })
|
|
@@ -1722,62 +1495,62 @@ function vt() {
|
|
|
1722
1495
|
] })
|
|
1723
1496
|
] });
|
|
1724
1497
|
}
|
|
1725
|
-
function
|
|
1726
|
-
const
|
|
1498
|
+
function gt() {
|
|
1499
|
+
const s = A(), u = K(), { data: t } = v({
|
|
1727
1500
|
queryKey: ["my-security"],
|
|
1728
|
-
queryFn: () =>
|
|
1501
|
+
queryFn: () => s.request(T("/security/my/sessions")).then((l) => l.data).catch(() => ({ sessions: [], logins: [] })),
|
|
1729
1502
|
staleTime: 3e4
|
|
1730
|
-
}),
|
|
1731
|
-
mutationFn: () =>
|
|
1503
|
+
}), i = w({
|
|
1504
|
+
mutationFn: () => s.request(ee("/security/my/sessions/sign-out-others", {})).then((l) => l.data),
|
|
1732
1505
|
onSuccess: (l) => {
|
|
1733
|
-
|
|
1506
|
+
u.invalidateQueries({ queryKey: ["my-security"] }), o(`Signed out ${(l == null ? void 0 : l.revoked) ?? 0} other session(s)`);
|
|
1734
1507
|
},
|
|
1735
1508
|
onError: (l) => {
|
|
1736
|
-
var
|
|
1737
|
-
const
|
|
1738
|
-
import("sonner").then(({ toast:
|
|
1509
|
+
var m, r;
|
|
1510
|
+
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.";
|
|
1511
|
+
import("sonner").then(({ toast: h }) => h.error(c)).catch(() => {
|
|
1739
1512
|
});
|
|
1740
1513
|
}
|
|
1741
1514
|
}), o = (l) => {
|
|
1742
1515
|
try {
|
|
1743
|
-
import("sonner").then(({ toast:
|
|
1516
|
+
import("sonner").then(({ toast: c }) => c.success(l));
|
|
1744
1517
|
} catch {
|
|
1745
1518
|
}
|
|
1746
1519
|
};
|
|
1747
|
-
return /* @__PURE__ */
|
|
1748
|
-
/* @__PURE__ */
|
|
1749
|
-
/* @__PURE__ */
|
|
1520
|
+
return /* @__PURE__ */ a("div", { className: "rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card", children: [
|
|
1521
|
+
/* @__PURE__ */ a("header", { className: "flex items-center justify-between border-b border-slate-100 px-4 py-2.5 dark:border-border/60", children: [
|
|
1522
|
+
/* @__PURE__ */ a("div", { children: [
|
|
1750
1523
|
/* @__PURE__ */ e("h3", { className: "text-[13px] font-semibold text-slate-800 dark:text-slate-100", children: "Security" }),
|
|
1751
1524
|
/* @__PURE__ */ e("p", { className: "mt-0.5 text-[11px] text-slate-400", children: "Your active sessions and recent sign-ins." })
|
|
1752
1525
|
] }),
|
|
1753
|
-
((
|
|
1526
|
+
((t == null ? void 0 : t.sessions.length) ?? 0) > 1 && /* @__PURE__ */ e(
|
|
1754
1527
|
"button",
|
|
1755
1528
|
{
|
|
1756
1529
|
type: "button",
|
|
1757
|
-
disabled:
|
|
1758
|
-
onClick: () =>
|
|
1530
|
+
disabled: i.isPending,
|
|
1531
|
+
onClick: () => i.mutate(),
|
|
1759
1532
|
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",
|
|
1760
1533
|
children: "Sign out everywhere else"
|
|
1761
1534
|
}
|
|
1762
1535
|
)
|
|
1763
1536
|
] }),
|
|
1764
|
-
/* @__PURE__ */
|
|
1765
|
-
/* @__PURE__ */
|
|
1537
|
+
/* @__PURE__ */ a("div", { className: "space-y-2 p-4", children: [
|
|
1538
|
+
/* @__PURE__ */ a("p", { className: "text-[11px] font-semibold uppercase tracking-wide text-slate-400", children: [
|
|
1766
1539
|
"Active sessions (",
|
|
1767
|
-
(
|
|
1540
|
+
(t == null ? void 0 : t.sessions.length) ?? 0,
|
|
1768
1541
|
")"
|
|
1769
1542
|
] }),
|
|
1770
|
-
((
|
|
1543
|
+
((t == null ? void 0 : t.sessions) ?? []).map((l) => /* @__PURE__ */ a(
|
|
1771
1544
|
"p",
|
|
1772
1545
|
{
|
|
1773
1546
|
className: "flex items-center gap-2 text-[12px] text-slate-600 dark:text-slate-300",
|
|
1774
1547
|
children: [
|
|
1775
|
-
/* @__PURE__ */
|
|
1548
|
+
/* @__PURE__ */ a("span", { className: "font-mono text-slate-400", children: [
|
|
1776
1549
|
l.sid_prefix,
|
|
1777
1550
|
"…"
|
|
1778
1551
|
] }),
|
|
1779
1552
|
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" }),
|
|
1780
|
-
/* @__PURE__ */
|
|
1553
|
+
/* @__PURE__ */ a("span", { className: "ml-auto text-[11px] text-slate-400", children: [
|
|
1781
1554
|
"expires in ",
|
|
1782
1555
|
Math.round(l.ttl_seconds / 3600),
|
|
1783
1556
|
"h"
|
|
@@ -1786,62 +1559,62 @@ function kt() {
|
|
|
1786
1559
|
},
|
|
1787
1560
|
l.sid_prefix
|
|
1788
1561
|
)),
|
|
1789
|
-
((
|
|
1562
|
+
((t == null ? void 0 : t.logins) ?? []).length > 0 && /* @__PURE__ */ a(X, { children: [
|
|
1790
1563
|
/* @__PURE__ */ e("p", { className: "pt-1 text-[11px] font-semibold uppercase tracking-wide text-slate-400", children: "Recent sign-ins" }),
|
|
1791
|
-
((
|
|
1564
|
+
((t == null ? void 0 : t.logins) ?? []).slice(0, 8).map((l, c) => (
|
|
1792
1565
|
// biome-ignore lint/suspicious/noArrayIndexKey: log rows
|
|
1793
|
-
/* @__PURE__ */
|
|
1566
|
+
/* @__PURE__ */ a("p", { className: "flex items-center gap-2 text-[11.5px] text-slate-500", children: [
|
|
1794
1567
|
/* @__PURE__ */ e("span", { className: "font-mono", children: l.ip ?? "—" }),
|
|
1795
1568
|
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" }),
|
|
1796
1569
|
/* @__PURE__ */ e("span", { className: "ml-auto text-slate-400", children: new Date(l.created_at).toLocaleString() })
|
|
1797
|
-
] },
|
|
1570
|
+
] }, c)
|
|
1798
1571
|
))
|
|
1799
1572
|
] })
|
|
1800
1573
|
] })
|
|
1801
1574
|
] });
|
|
1802
1575
|
}
|
|
1803
|
-
function
|
|
1804
|
-
const
|
|
1576
|
+
function ft() {
|
|
1577
|
+
const s = A(), [u, t] = C(!1), { data: i } = v({
|
|
1805
1578
|
queryKey: ["my-permissions"],
|
|
1806
|
-
queryFn: () =>
|
|
1807
|
-
enabled:
|
|
1579
|
+
queryFn: () => s.request(T("/security/my/permissions")).then((o) => o.data),
|
|
1580
|
+
enabled: u,
|
|
1808
1581
|
staleTime: 5 * 6e4
|
|
1809
1582
|
});
|
|
1810
|
-
return /* @__PURE__ */
|
|
1811
|
-
/* @__PURE__ */
|
|
1583
|
+
return /* @__PURE__ */ a("div", { className: "rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card", children: [
|
|
1584
|
+
/* @__PURE__ */ a(
|
|
1812
1585
|
"button",
|
|
1813
1586
|
{
|
|
1814
1587
|
type: "button",
|
|
1815
|
-
onClick: () =>
|
|
1588
|
+
onClick: () => t((o) => !o),
|
|
1816
1589
|
className: "flex w-full items-center justify-between px-4 py-2.5 text-left",
|
|
1817
1590
|
children: [
|
|
1818
|
-
/* @__PURE__ */
|
|
1591
|
+
/* @__PURE__ */ a("div", { children: [
|
|
1819
1592
|
/* @__PURE__ */ e("h3", { className: "text-[13px] font-semibold text-slate-800 dark:text-slate-100", children: "What can I access?" }),
|
|
1820
1593
|
/* @__PURE__ */ e("p", { className: "mt-0.5 text-[11px] text-slate-400", children: "Your role, collections, and data limits in plain language." })
|
|
1821
1594
|
] }),
|
|
1822
|
-
/* @__PURE__ */ e("span", { className: "text-[11px] text-slate-400", children:
|
|
1595
|
+
/* @__PURE__ */ e("span", { className: "text-[11px] text-slate-400", children: u ? "Hide" : "Show" })
|
|
1823
1596
|
]
|
|
1824
1597
|
}
|
|
1825
1598
|
),
|
|
1826
|
-
|
|
1827
|
-
/* @__PURE__ */
|
|
1599
|
+
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: [
|
|
1600
|
+
/* @__PURE__ */ a("p", { children: [
|
|
1828
1601
|
"Your role is ",
|
|
1829
|
-
/* @__PURE__ */ e("b", { children:
|
|
1830
|
-
|
|
1602
|
+
/* @__PURE__ */ e("b", { children: i.role ?? "unassigned" }),
|
|
1603
|
+
i.is_admin && " — an administrator role with access to everything",
|
|
1831
1604
|
"."
|
|
1832
1605
|
] }),
|
|
1833
|
-
|
|
1606
|
+
i.scopes.length > 0 && /* @__PURE__ */ a("p", { children: [
|
|
1834
1607
|
"Your data is limited to:",
|
|
1835
1608
|
" ",
|
|
1836
|
-
|
|
1609
|
+
i.scopes.map((o) => `${o.dimension}: ${o.values.join(", ")}`).join(" · ")
|
|
1837
1610
|
] }),
|
|
1838
|
-
!
|
|
1839
|
-
/* @__PURE__ */
|
|
1611
|
+
!i.is_admin && /* @__PURE__ */ a("div", { children: [
|
|
1612
|
+
/* @__PURE__ */ a("p", { className: "mb-1 text-[11px] font-semibold uppercase tracking-wide text-slate-400", children: [
|
|
1840
1613
|
"Collections (",
|
|
1841
|
-
|
|
1614
|
+
i.collections.length,
|
|
1842
1615
|
")"
|
|
1843
1616
|
] }),
|
|
1844
|
-
/* @__PURE__ */ e("div", { className: "max-h-48 overflow-y-auto", children:
|
|
1617
|
+
/* @__PURE__ */ e("div", { className: "max-h-48 overflow-y-auto", children: i.collections.map((o) => /* @__PURE__ */ a(
|
|
1845
1618
|
"p",
|
|
1846
1619
|
{
|
|
1847
1620
|
className: "flex items-center gap-2 border-b border-slate-50 py-0.5 text-[12px] last:border-b-0 dark:border-border/40",
|
|
@@ -1856,51 +1629,51 @@ function Nt() {
|
|
|
1856
1629
|
] })
|
|
1857
1630
|
] });
|
|
1858
1631
|
}
|
|
1859
|
-
function
|
|
1860
|
-
const
|
|
1632
|
+
function yt() {
|
|
1633
|
+
const s = A(), u = K(), { data: t } = v({
|
|
1861
1634
|
queryKey: ["nvr-profile-prefs"],
|
|
1862
|
-
queryFn: () =>
|
|
1863
|
-
var
|
|
1864
|
-
return ((
|
|
1635
|
+
queryFn: () => s.request(T("/users/me")).then((m) => {
|
|
1636
|
+
var r;
|
|
1637
|
+
return ((r = m.data) == null ? void 0 : r.preferences) ?? {};
|
|
1865
1638
|
})
|
|
1866
|
-
}),
|
|
1867
|
-
mutationFn: (
|
|
1868
|
-
onSuccess: (
|
|
1869
|
-
|
|
1870
|
-
({ toast:
|
|
1639
|
+
}), i = w({
|
|
1640
|
+
mutationFn: (m) => s.request(G("/users/me/preferences", m)),
|
|
1641
|
+
onSuccess: (m, r) => {
|
|
1642
|
+
u.invalidateQueries({ queryKey: ["nvr-profile-prefs"] }), re(Object.keys(r)), import("sonner").then(
|
|
1643
|
+
({ toast: h }) => h.success("Saved — applied on all your open tabs and devices")
|
|
1871
1644
|
);
|
|
1872
1645
|
}
|
|
1873
|
-
}), o = (
|
|
1646
|
+
}), o = (t == null ? void 0 : t.number_format) ?? {}, { data: l = [ae, ...ce] } = v({
|
|
1874
1647
|
queryKey: ["nvr-theme-accents"],
|
|
1875
|
-
queryFn: () =>
|
|
1876
|
-
|
|
1877
|
-
).then((
|
|
1878
|
-
var
|
|
1648
|
+
queryFn: () => s.request(
|
|
1649
|
+
T("/settings")
|
|
1650
|
+
).then((m) => {
|
|
1651
|
+
var r, h;
|
|
1879
1652
|
return [
|
|
1880
|
-
{ ...
|
|
1881
|
-
...
|
|
1653
|
+
{ ...ae, color: ((r = m.data) == null ? void 0 : r.project_color) ?? null },
|
|
1654
|
+
...De((h = m.data) == null ? void 0 : h.theme_accents)
|
|
1882
1655
|
];
|
|
1883
|
-
}).catch(() => [
|
|
1656
|
+
}).catch(() => [ae, ...ce]),
|
|
1884
1657
|
staleTime: 5 * 6e4
|
|
1885
|
-
}),
|
|
1886
|
-
return /* @__PURE__ */
|
|
1658
|
+
}), c = typeof (t == null ? void 0 : t.theme_accent) == "string" ? t.theme_accent : "brand";
|
|
1659
|
+
return /* @__PURE__ */ a(
|
|
1887
1660
|
"div",
|
|
1888
1661
|
{
|
|
1889
1662
|
"data-profile-card": "display",
|
|
1890
1663
|
className: "rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card",
|
|
1891
1664
|
children: [
|
|
1892
|
-
/* @__PURE__ */
|
|
1665
|
+
/* @__PURE__ */ a("header", { className: "border-b border-slate-100 px-4 py-2.5 dark:border-border/60", children: [
|
|
1893
1666
|
/* @__PURE__ */ e("h3", { className: "text-[13px] font-semibold text-slate-800 dark:text-slate-100", children: "Display" }),
|
|
1894
1667
|
/* @__PURE__ */ e("p", { className: "mt-0.5 text-[11px] text-slate-400", children: "How times, numbers and text render for you." })
|
|
1895
1668
|
] }),
|
|
1896
|
-
/* @__PURE__ */
|
|
1897
|
-
/* @__PURE__ */
|
|
1669
|
+
/* @__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: [
|
|
1670
|
+
/* @__PURE__ */ a("label", { className: "flex items-center gap-1.5", children: [
|
|
1898
1671
|
"Timestamps",
|
|
1899
1672
|
/* @__PURE__ */ e(
|
|
1900
|
-
|
|
1673
|
+
U,
|
|
1901
1674
|
{
|
|
1902
|
-
value: String((
|
|
1903
|
-
onChange: (
|
|
1675
|
+
value: String((t == null ? void 0 : t.time_display) ?? "relative"),
|
|
1676
|
+
onChange: (m) => i.mutate({ time_display: m }),
|
|
1904
1677
|
options: [
|
|
1905
1678
|
{ value: "relative", label: "Relative (3h ago)" },
|
|
1906
1679
|
{ value: "exact", label: "Exact (Aug 24, 3:12 PM)" }
|
|
@@ -1908,37 +1681,37 @@ function wt() {
|
|
|
1908
1681
|
}
|
|
1909
1682
|
)
|
|
1910
1683
|
] }),
|
|
1911
|
-
/* @__PURE__ */
|
|
1684
|
+
/* @__PURE__ */ a("label", { className: "flex cursor-pointer items-center gap-1.5", children: [
|
|
1912
1685
|
/* @__PURE__ */ e(
|
|
1913
1686
|
"input",
|
|
1914
1687
|
{
|
|
1915
1688
|
type: "checkbox",
|
|
1916
1689
|
checked: o.compact === !0,
|
|
1917
|
-
onChange: (
|
|
1690
|
+
onChange: (m) => i.mutate({ number_format: { ...o, compact: m.target.checked } }),
|
|
1918
1691
|
className: "rounded"
|
|
1919
1692
|
}
|
|
1920
1693
|
),
|
|
1921
1694
|
"Compact numbers (1.2M)"
|
|
1922
1695
|
] }),
|
|
1923
|
-
/* @__PURE__ */
|
|
1696
|
+
/* @__PURE__ */ a("label", { className: "flex items-center gap-1.5", children: [
|
|
1924
1697
|
"Number locale",
|
|
1925
1698
|
/* @__PURE__ */ e(
|
|
1926
1699
|
"input",
|
|
1927
1700
|
{
|
|
1928
1701
|
defaultValue: o.locale ?? "",
|
|
1929
|
-
onBlur: (
|
|
1702
|
+
onBlur: (m) => i.mutate({ number_format: { ...o, locale: m.target.value.trim() || void 0 } }),
|
|
1930
1703
|
placeholder: "en-US",
|
|
1931
1704
|
className: "h-7 w-20 rounded-md border border-slate-200 bg-background px-1.5 text-[12px] dark:border-border"
|
|
1932
1705
|
}
|
|
1933
1706
|
)
|
|
1934
1707
|
] }),
|
|
1935
|
-
/* @__PURE__ */
|
|
1708
|
+
/* @__PURE__ */ a("label", { className: "flex items-center gap-1.5", children: [
|
|
1936
1709
|
"Week starts",
|
|
1937
1710
|
/* @__PURE__ */ e(
|
|
1938
|
-
|
|
1711
|
+
U,
|
|
1939
1712
|
{
|
|
1940
|
-
value: String((
|
|
1941
|
-
onChange: (
|
|
1713
|
+
value: String((t == null ? void 0 : t.week_start) ?? "sun"),
|
|
1714
|
+
onChange: (m) => i.mutate({ week_start: m }),
|
|
1942
1715
|
options: [
|
|
1943
1716
|
{ value: "sun", label: "Sunday" },
|
|
1944
1717
|
{ value: "mon", label: "Monday" }
|
|
@@ -1946,36 +1719,36 @@ function wt() {
|
|
|
1946
1719
|
}
|
|
1947
1720
|
)
|
|
1948
1721
|
] }),
|
|
1949
|
-
/* @__PURE__ */
|
|
1722
|
+
/* @__PURE__ */ a("div", { className: "flex items-center gap-1.5", "data-theme-accent-picker": !0, children: [
|
|
1950
1723
|
"Accent",
|
|
1951
|
-
/* @__PURE__ */ e("span", { className: "flex items-center gap-1", children: l.map((
|
|
1952
|
-
const
|
|
1724
|
+
/* @__PURE__ */ e("span", { className: "flex items-center gap-1", children: l.map((m) => {
|
|
1725
|
+
const r = m.key === "brand" && c === "brand" || m.key === c;
|
|
1953
1726
|
return /* @__PURE__ */ e(
|
|
1954
1727
|
"button",
|
|
1955
1728
|
{
|
|
1956
1729
|
type: "button",
|
|
1957
|
-
title:
|
|
1958
|
-
"aria-label": `Accent ${
|
|
1959
|
-
"aria-pressed":
|
|
1960
|
-
"data-theme-accent":
|
|
1961
|
-
onClick: () =>
|
|
1962
|
-
className:
|
|
1730
|
+
title: m.label,
|
|
1731
|
+
"aria-label": `Accent ${m.label}`,
|
|
1732
|
+
"aria-pressed": r,
|
|
1733
|
+
"data-theme-accent": m.key,
|
|
1734
|
+
onClick: () => i.mutate({ theme_accent: m.key === "brand" ? null : m.key }),
|
|
1735
|
+
className: Q(
|
|
1963
1736
|
"h-5 w-5 rounded-full border-2 transition-transform",
|
|
1964
|
-
|
|
1737
|
+
r ? "scale-110 border-slate-800 dark:border-slate-100" : "border-transparent hover:scale-105"
|
|
1965
1738
|
),
|
|
1966
|
-
style: { background:
|
|
1739
|
+
style: { background: m.color ?? "var(--nvr-cyan)" }
|
|
1967
1740
|
},
|
|
1968
|
-
|
|
1741
|
+
m.key
|
|
1969
1742
|
);
|
|
1970
1743
|
}) })
|
|
1971
1744
|
] }),
|
|
1972
|
-
/* @__PURE__ */
|
|
1745
|
+
/* @__PURE__ */ a("label", { className: "flex items-center gap-1.5", children: [
|
|
1973
1746
|
"Text size",
|
|
1974
1747
|
/* @__PURE__ */ e(
|
|
1975
|
-
|
|
1748
|
+
U,
|
|
1976
1749
|
{
|
|
1977
|
-
value: String((
|
|
1978
|
-
onChange: (
|
|
1750
|
+
value: String((t == null ? void 0 : t.font_size) ?? "default"),
|
|
1751
|
+
onChange: (m) => i.mutate({ font_size: m }),
|
|
1979
1752
|
options: [
|
|
1980
1753
|
{ value: "small", label: "Small" },
|
|
1981
1754
|
{ value: "default", label: "Default" },
|
|
@@ -1990,11 +1763,11 @@ function wt() {
|
|
|
1990
1763
|
);
|
|
1991
1764
|
}
|
|
1992
1765
|
export {
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
1766
|
+
Be as DelegationCard,
|
|
1767
|
+
yt as DisplayPrefsCard,
|
|
1768
|
+
lt as LinkAppCard,
|
|
1769
|
+
st as NotificationRulesCard,
|
|
1770
|
+
nt as ProfileFieldsCard,
|
|
1771
|
+
Wt as ProfileView,
|
|
1772
|
+
ot as TimezoneCard
|
|
2000
1773
|
};
|