@nivaro/react 0.3.63 → 0.3.65

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. package/dist/full.css +1 -1
  2. package/dist/hooks/useSessionRecorder.js +1 -1
  3. package/dist/index.d.ts +54 -5
  4. package/dist/shared/components/CollectionBrowserView.js +3029 -2947
  5. package/dist/shared/components/ConformanceView.js +235 -221
  6. package/dist/shared/components/DataTable.js +478 -459
  7. package/dist/shared/components/ItemEditForm.js +4469 -4266
  8. package/dist/shared/components/PageRenderer.js +146 -138
  9. package/dist/shared/components/RecordDrilldownSheet.js +73 -65
  10. package/dist/shared/components/bulk/BulkActionButtons.js +72 -72
  11. package/dist/shared/components/bulk/BulkFieldUpdate.js +114 -103
  12. package/dist/shared/components/bulk/BulkFieldUpdateButton.js +73 -0
  13. package/dist/shared/components/bulk/bulk-field-options.js +29 -23
  14. package/dist/shared/components/integrations/IntegrationObligationsView.js +191 -173
  15. package/dist/shared/components/integrations/IntegrationStatusLines.js +101 -85
  16. package/dist/shared/components/integrations/RecordIntegrationPreview.js +11 -9
  17. package/dist/shared/components/integrations/SendCurrentData.js +126 -0
  18. package/dist/shared/components/item-edit/CatalogPickerField.js +1530 -1437
  19. package/dist/shared/components/item-edit/FieldRenderer.js +49 -45
  20. package/dist/shared/components/item-edit/FieldRow.js +413 -403
  21. package/dist/shared/components/item-edit/InlineTableField.js +2903 -2816
  22. package/dist/shared/components/item-edit/M2MCombobox.js +172 -168
  23. package/dist/shared/components/item-edit/MidairCollisionDialog.js +341 -114
  24. package/dist/shared/components/item-edit/NestedRelationEditor.js +171 -163
  25. package/dist/shared/components/item-edit/PlanGrid.js +783 -724
  26. package/dist/shared/components/item-edit/QuickCreateButton.js +291 -224
  27. package/dist/shared/components/item-edit/RecordInsights.js +113 -111
  28. package/dist/shared/components/item-edit/RecordLiveSync.js +4 -1
  29. package/dist/shared/components/item-edit/RelationCombobox.js +332 -314
  30. package/dist/shared/components/item-edit/cascade-clear-notice.js +52 -0
  31. package/dist/shared/components/item-edit/collision-format.js +37 -0
  32. package/dist/shared/components/item-edit/field-a11y.js +25 -0
  33. package/dist/shared/components/item-edit/line-merge.js +58 -0
  34. package/dist/shared/components/item-edit/line-midair.js +94 -87
  35. package/dist/shared/components/item-edit/move-guard.js +17 -0
  36. package/dist/shared/components/item-edit/picker-search.js +22 -15
  37. package/dist/shared/components/item-edit/rail-width.js +8 -0
  38. package/dist/shared/components/monitoring/InactiveUserLinksView.js +322 -291
  39. package/dist/shared/components/panels/AccessDeniedPanel.js +96 -55
  40. package/dist/shared/components/panels/CommentPanel.js +142 -136
  41. package/dist/shared/components/panels/ItemLockBanner.js +246 -240
  42. package/dist/shared/components/panels/PipelinePanel.js +1366 -1194
  43. package/dist/shared/components/panels/RevisionsPanel.js +106 -102
  44. package/dist/shared/components/panels/SlaBreachBanner.js +16 -20
  45. package/dist/shared/components/panels/SlaClock.js +90 -68
  46. package/dist/shared/components/queue/QueueItemSheet.js +94 -87
  47. package/dist/shared/components/queue/QueueWorklist.js +1502 -1354
  48. package/dist/shared/components/queue/worklist-csv.js +75 -0
  49. package/dist/shared/components/queue/worklist-helpers.js +20 -0
  50. package/dist/shared/components/widgets/ReviewListWidget.js +226 -207
  51. package/dist/shared/lib/bulk-copy.js +17 -0
  52. package/dist/shared/lib/cbv-export.js +122 -0
  53. package/dist/shared/lib/delete-offer.js +13 -0
  54. package/dist/shared/lib/error-hints.js +1 -0
  55. package/dist/shared/lib/leave-guard.js +41 -26
  56. package/dist/shared/lib/list-link.js +72 -56
  57. package/dist/shared/lib/live-queries.js +32 -30
  58. package/dist/shared/lib/moved-notice.js +25 -0
  59. package/dist/shared/lib/notification-target.js +56 -54
  60. package/dist/shared/lib/obligation-banner.js +11 -8
  61. package/dist/shared/lib/obligation-reason-text.js +6 -6
  62. package/dist/shared/lib/sort-cycle.js +6 -0
  63. package/dist/shared/lib/summary-mode.js +59 -41
  64. package/package.json +1 -1
@@ -1,318 +1,348 @@
1
- import { jsxs as a, jsx as e, Fragment as H } from "react/jsx-runtime";
2
- import { useQueryClient as ne, useQuery as B } from "@tanstack/react-query";
3
- import { RotateCw as se, Search as le, UserX as oe, ChevronDown as V, ChevronRight as X } from "lucide-react";
4
- import { useState as f, useMemo as A, useCallback as de } from "react";
5
- import { useNivaroClient as z, useNavigation as G, useItemNavigation as J } from "../../context.js";
6
- import { get as I, post as Y } from "../../lib/commands.js";
7
- import { userErrorMessage as K } from "../../lib/safe-error.js";
8
- import { cn as E, formatRelative as ie } from "../../lib/utils.js";
9
- import { UserAvatar as ce } from "../UserAvatar.js";
10
- const T = {
1
+ import { jsxs as r, jsx as e, Fragment as J } from "react/jsx-runtime";
2
+ import { useQueryClient as ie, useQuery as K } from "@tanstack/react-query";
3
+ import { RotateCw as ce, Search as ue, UserX as me, ChevronDown as Y, ChevronRight as Z } from "lucide-react";
4
+ import { useState as x, useEffect as xe, useMemo as F, useCallback as he } from "react";
5
+ import { useNivaroClient as B, useNavigation as ee, useItemNavigation as te } from "../../context.js";
6
+ import { get as M, post as ae } from "../../lib/commands.js";
7
+ import { userErrorMessage as Q } from "../../lib/safe-error.js";
8
+ import { cn as A, formatRelative as pe } from "../../lib/utils.js";
9
+ import { UserAvatar as fe } from "../UserAvatar.js";
10
+ const re = {
11
11
  suspended: "Suspended",
12
12
  redacted: "Redacted",
13
- anonymised: "Anonymised",
13
+ // One word for one state app-wide (army 11): the legacy anonymisation IS a redaction.
14
+ anonymised: "Redacted",
14
15
  placeholder: "Placeholder"
15
- }, Z = {
16
+ }, ne = {
16
17
  suspended: "The account is suspended — the person cannot sign in or act.",
17
- redacted: "Personal details were removed by a retention policy.",
18
- anonymised: "Details were overwritten by the nightly anonymisation of departed people.",
18
+ redacted: "Personal details were removed by a retention policy (or the legacy retention job).",
19
+ anonymised: "Redacted by the legacy retention job — the name and email were replaced.",
19
20
  placeholder: "Stands in for a legacy account that no longer exists."
20
- }, ue = {
21
+ }, be = {
21
22
  suspended: "bg-[#fef3c7] text-[#92400e] dark:bg-[#3a2a12] dark:text-[#f5c97a]",
22
23
  redacted: "bg-[#ffe4e6] text-[#9f1239] dark:bg-[#3d1a20] dark:text-[#f4a3ad]",
23
24
  anonymised: "bg-[#ffe4e6] text-[#9f1239] dark:bg-[#3d1a20] dark:text-[#f4a3ad]",
24
25
  placeholder: "bg-[#e2e8f0] text-[#334155] dark:bg-[#2c3038] dark:text-[#cbd5e1]"
25
- }, g = (l) => l.toLocaleString();
26
- function Ce({ className: l }) {
27
- var Q;
28
- const n = z(), o = ne(), [b, C] = f(!0), [v, d] = f(!1), [u, y] = f(!1), [i, x] = f(!0), [p, $] = f(null), [h, S] = f(""), [_, O] = f(null), [q, j] = f(0), c = B({
29
- queryKey: ["inactive-user-links", q],
30
- queryFn: () => n.request(I(`/inactive-user-links${q ? "?fresh=1" : ""}`)).then((t) => t.data),
26
+ }, b = (l) => l.toLocaleString(), X = (l) => l === "anonymised" ? "redacted" : l, ge = ["suspended", "redacted", "placeholder"];
27
+ function Ee({
28
+ className: l,
29
+ focusUserId: s,
30
+ onClearFocus: o
31
+ }) {
32
+ var I;
33
+ const N = B(), y = ie(), [h, d] = x(!0), [u, k] = x(!1), [i, m] = x(!1), [g, w] = x(!0), [c, C] = x(null), [q, j] = x(""), [_, E] = x(s ?? null), [$, L] = x(s ?? null);
34
+ xe(() => {
35
+ L(s ?? null), s && E(s);
36
+ }, [s]);
37
+ const [n, p] = x(0), a = K({
38
+ queryKey: ["inactive-user-links", n],
39
+ queryFn: () => N.request(M(`/inactive-user-links${n ? "?fresh=1" : ""}`)).then((t) => t.data),
31
40
  staleTime: 6e4
32
- }), N = A(
41
+ }), f = F(
33
42
  () => {
34
43
  var t;
35
- return new Map((((t = c.data) == null ? void 0 : t.sources) ?? []).map((R) => [R.key, R]));
44
+ return new Map((((t = a.data) == null ? void 0 : t.sources) ?? []).map((S) => [S.key, S]));
36
45
  },
37
- [c.data]
38
- ), r = de(
39
- (t) => !(!t || t.role === "audit" && !v || t.role === "own" && !u || t.role === "seat" && !i || b && t.scope !== "open" && t.role !== "seat"),
40
- [b, v, u, i]
41
- ), m = A(() => {
42
- var R;
43
- const t = h.trim().toLowerCase();
44
- return (((R = c.data) == null ? void 0 : R.users) ?? []).map((w) => {
45
- const P = w.links.filter((L) => r(N.get(L.source))).sort(
46
- (L, U) => {
47
- var D, W;
48
- return +(((D = N.get(L.source)) == null ? void 0 : D.role) === "seat") - +(((W = N.get(U.source)) == null ? void 0 : W.role) === "seat") || U.count - L.count;
46
+ [a.data]
47
+ ), D = he(
48
+ (t) => !(!t || t.role === "audit" && !u || t.role === "own" && !i || t.role === "seat" && !g || h && t.scope !== "open" && t.role !== "seat"),
49
+ [h, u, i, g]
50
+ ), T = F(() => {
51
+ var S;
52
+ const t = q.trim().toLowerCase();
53
+ return (((S = a.data) == null ? void 0 : S.users) ?? []).map((v) => {
54
+ const P = v.links.filter((R) => D(f.get(R.source))).sort(
55
+ (R, z) => {
56
+ var G, V;
57
+ return +(((G = f.get(R.source)) == null ? void 0 : G.role) === "seat") - +(((V = f.get(z.source)) == null ? void 0 : V.role) === "seat") || z.count - R.count;
49
58
  }
50
59
  );
51
- return { ...w, links: P, total: P.reduce((L, U) => L + U.count, 0) };
52
- }).filter((w) => w.total > 0).filter(
53
- (w) => !t || `${w.user.name} ${w.user.email ?? ""}`.toLowerCase().includes(t)
54
- ).sort((w, P) => P.total - w.total);
55
- }, [c.data, N, h, r]), s = A(() => {
60
+ return { ...v, links: P, total: P.reduce((R, z) => R + z.count, 0) };
61
+ }).filter((v) => v.total > 0).filter((v) => !$ || v.user.id.toUpperCase() === $.toUpperCase()).filter(
62
+ (v) => !t || `${v.user.name} ${v.user.email ?? ""}`.toLowerCase().includes(t)
63
+ ).sort((v, P) => P.total - v.total);
64
+ }, [a.data, f, q, D, $]), W = F(() => {
56
65
  const t = { suspended: 0, redacted: 0, anonymised: 0, placeholder: 0 };
57
- for (const R of m) t[R.user.reason]++;
66
+ for (const S of T) t[X(S.user.reason)]++;
58
67
  return t;
59
- }, [m]), k = p ? m.filter((t) => t.user.reason === p) : m, M = A(() => {
60
- var w;
61
- let t = 0, R = 0;
62
- for (const P of k)
63
- for (const L of P.links)
64
- ((w = N.get(L.source)) == null ? void 0 : w.role) === "seat" ? R += L.count : t += L.count;
65
- return { records: t, seats: R };
66
- }, [k, N]), ae = () => {
67
- j((t) => t + 1), O(null);
68
- }, re = () => {
69
- o.invalidateQueries({ queryKey: ["inactive-user-links"] }), o.invalidateQueries({ queryKey: ["inactive-user-records"] });
68
+ }, [T]), O = c ? T.filter((t) => X(t.user.reason) === c) : T, H = F(() => {
69
+ var v;
70
+ let t = 0, S = 0;
71
+ for (const P of O)
72
+ for (const R of P.links)
73
+ ((v = f.get(R.source)) == null ? void 0 : v.role) === "seat" ? S += R.count : t += R.count;
74
+ return { records: t, seats: S };
75
+ }, [O, f]), oe = () => {
76
+ p((t) => t + 1), E(null);
77
+ }, de = () => {
78
+ y.invalidateQueries({ queryKey: ["inactive-user-links"] }), y.invalidateQueries({ queryKey: ["inactive-user-records"] });
70
79
  };
71
- return /* @__PURE__ */ a("div", { className: E("flex min-h-0 flex-1 flex-col gap-4 p-6", l), "data-inactive-links": !0, children: [
72
- /* @__PURE__ */ a("div", { className: "flex flex-wrap items-center gap-x-5 gap-y-3", children: [
73
- /* @__PURE__ */ a("dl", { className: "flex items-baseline gap-5 text-[12px] text-slate-500 dark:text-muted-foreground", children: [
74
- /* @__PURE__ */ a("div", { className: "flex items-baseline gap-1.5", children: [
80
+ return /* @__PURE__ */ r("div", { className: A("flex min-h-0 flex-1 flex-col gap-4 p-6", l), "data-inactive-links": !0, children: [
81
+ /* @__PURE__ */ r("div", { className: "flex flex-wrap items-center gap-x-5 gap-y-3", children: [
82
+ /* @__PURE__ */ r("dl", { className: "flex items-baseline gap-5 text-[12px] text-slate-500 dark:text-muted-foreground", children: [
83
+ /* @__PURE__ */ r("div", { className: "flex items-baseline gap-1.5", children: [
75
84
  /* @__PURE__ */ e(
76
85
  "dd",
77
86
  {
78
87
  className: "text-[20px] font-semibold tabular-nums text-slate-900 dark:text-foreground",
79
88
  "data-inactive-people": !0,
80
- children: c.isLoading ? "—" : g(k.length)
89
+ children: a.isLoading ? "—" : b(O.length)
81
90
  }
82
91
  ),
83
- /* @__PURE__ */ e("dt", { children: k.length === 1 ? "person" : "people" })
92
+ /* @__PURE__ */ e("dt", { children: O.length === 1 ? "person" : "people" })
84
93
  ] }),
85
- /* @__PURE__ */ a("div", { className: "flex items-baseline gap-1.5", children: [
86
- /* @__PURE__ */ e("dd", { className: "text-[20px] font-semibold tabular-nums text-slate-900 dark:text-foreground", children: c.isLoading ? "—" : g(M.records) }),
87
- /* @__PURE__ */ e("dt", { children: b ? "links on open records" : "record links" })
94
+ /* @__PURE__ */ r("div", { className: "flex items-baseline gap-1.5", children: [
95
+ /* @__PURE__ */ e("dd", { className: "text-[20px] font-semibold tabular-nums text-slate-900 dark:text-foreground", children: a.isLoading ? "—" : b(H.records) }),
96
+ /* @__PURE__ */ e("dt", { children: h ? "links on open records" : "record links" })
88
97
  ] }),
89
- /* @__PURE__ */ a("div", { className: "flex items-baseline gap-1.5", children: [
90
- /* @__PURE__ */ e("dd", { className: "text-[20px] font-semibold tabular-nums text-slate-900 dark:text-foreground", children: c.isLoading ? "—" : g(M.seats) }),
98
+ /* @__PURE__ */ r("div", { className: "flex items-baseline gap-1.5", children: [
99
+ /* @__PURE__ */ e("dd", { className: "text-[20px] font-semibold tabular-nums text-slate-900 dark:text-foreground", children: a.isLoading ? "—" : b(H.seats) }),
91
100
  /* @__PURE__ */ e("dt", { children: "owner seats and team places" })
92
101
  ] })
93
102
  ] }),
94
- /* @__PURE__ */ a(
103
+ /* @__PURE__ */ r(
95
104
  "button",
96
105
  {
97
106
  type: "button",
98
- onClick: ae,
99
- disabled: c.isFetching,
107
+ onClick: oe,
108
+ disabled: a.isFetching,
100
109
  className: "ml-auto inline-flex h-8 items-center gap-1.5 rounded-md border border-slate-200 px-2.5 text-[12px] font-medium text-slate-600 hover:border-slate-300 hover:text-slate-900 disabled:opacity-60 dark:border-border dark:text-muted-foreground dark:hover:text-foreground",
101
110
  "data-inactive-rescan": !0,
102
111
  children: [
103
- /* @__PURE__ */ e(se, { className: E("h-3.5 w-3.5", c.isFetching && "animate-spin") }),
112
+ /* @__PURE__ */ e(ce, { className: A("h-3.5 w-3.5", a.isFetching && "animate-spin") }),
104
113
  "Scan again"
105
114
  ]
106
115
  }
107
116
  )
108
117
  ] }),
109
- /* @__PURE__ */ a("div", { className: "flex flex-wrap items-center gap-2", children: [
110
- /* @__PURE__ */ a("label", { className: "relative", children: [
111
- /* @__PURE__ */ e(le, { className: "pointer-events-none absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-slate-400" }),
118
+ $ && /* @__PURE__ */ r(
119
+ "p",
120
+ {
121
+ className: "flex flex-wrap items-center gap-2 text-[12px] text-slate-600 dark:text-muted-foreground",
122
+ "data-inactive-focus": !0,
123
+ children: [
124
+ "Showing one person.",
125
+ /* @__PURE__ */ e(
126
+ "button",
127
+ {
128
+ type: "button",
129
+ onClick: () => {
130
+ L(null), o == null || o();
131
+ },
132
+ className: "font-medium text-slate-800 underline underline-offset-2 dark:text-foreground",
133
+ children: "Show everyone"
134
+ }
135
+ )
136
+ ]
137
+ }
138
+ ),
139
+ /* @__PURE__ */ r("div", { className: "flex flex-wrap items-center gap-2", children: [
140
+ /* @__PURE__ */ r("label", { className: "relative", children: [
141
+ /* @__PURE__ */ e(ue, { className: "pointer-events-none absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-slate-400" }),
112
142
  /* @__PURE__ */ e(
113
143
  "input",
114
144
  {
115
- value: h,
116
- onChange: (t) => S(t.target.value),
145
+ value: q,
146
+ onChange: (t) => j(t.target.value),
117
147
  placeholder: "Find a person",
118
148
  className: "h-8 w-56 rounded-md border border-slate-200 bg-background pl-7 pr-2 text-[12.5px] text-slate-800 placeholder:text-slate-500 focus:border-slate-400 focus:outline-none dark:border-border dark:text-foreground dark:placeholder:text-muted-foreground",
119
149
  "data-inactive-search": !0
120
150
  }
121
151
  )
122
152
  ] }),
123
- /* @__PURE__ */ e("span", { className: "flex flex-wrap items-center gap-1", children: Object.keys(T).map(
124
- (t) => s[t] || p === t ? /* @__PURE__ */ a(
153
+ /* @__PURE__ */ e("span", { className: "flex flex-wrap items-center gap-1", children: ge.map(
154
+ (t) => W[t] || c === t ? /* @__PURE__ */ r(
125
155
  "button",
126
156
  {
127
157
  type: "button",
128
- "aria-pressed": p === t,
129
- onClick: () => $(p === t ? null : t),
130
- "data-tip": Z[t],
158
+ "aria-pressed": c === t,
159
+ onClick: () => C(c === t ? null : t),
160
+ "data-tip": ne[t],
131
161
  "data-inactive-reason": t,
132
- className: E(
162
+ className: A(
133
163
  "h-7 rounded-md border px-2 text-[11.5px] font-medium transition-colors",
134
- p === t ? "border-slate-400 bg-slate-100 text-slate-900 dark:border-border dark:bg-muted dark:text-foreground" : "border-slate-200 text-slate-600 hover:border-slate-300 dark:border-border dark:text-muted-foreground"
164
+ c === t ? "border-slate-400 bg-slate-100 text-slate-900 dark:border-border dark:bg-muted dark:text-foreground" : "border-slate-200 text-slate-600 hover:border-slate-300 dark:border-border dark:text-muted-foreground"
135
165
  ),
136
166
  children: [
137
- T[t],
167
+ re[t],
138
168
  " ",
139
- /* @__PURE__ */ e("span", { className: "tabular-nums text-slate-500 dark:text-muted-foreground", children: g(s[t]) })
169
+ /* @__PURE__ */ e("span", { className: "tabular-nums text-slate-500 dark:text-muted-foreground", children: b(W[t]) })
140
170
  ]
141
171
  },
142
172
  t
143
173
  ) : null
144
174
  ) }),
145
- /* @__PURE__ */ a("span", { className: "ml-auto flex flex-wrap items-center gap-x-4 gap-y-1", children: [
175
+ /* @__PURE__ */ r("span", { className: "ml-auto flex flex-wrap items-center gap-x-4 gap-y-1", children: [
146
176
  /* @__PURE__ */ e(
147
- F,
177
+ U,
148
178
  {
149
179
  label: "Only records in an open workflow",
150
- checked: b,
151
- onChange: C,
180
+ checked: h,
181
+ onChange: d,
152
182
  hook: "open"
153
183
  }
154
184
  ),
155
185
  /* @__PURE__ */ e(
156
- F,
186
+ U,
157
187
  {
158
188
  label: "Owner seats and team places",
159
- checked: i,
160
- onChange: x,
189
+ checked: g,
190
+ onChange: w,
161
191
  hook: "seats"
162
192
  }
163
193
  ),
164
194
  /* @__PURE__ */ e(
165
- F,
195
+ U,
166
196
  {
167
197
  label: "Created by / updated by",
168
- checked: v,
169
- onChange: d,
198
+ checked: u,
199
+ onChange: k,
170
200
  hook: "audit"
171
201
  }
172
202
  ),
173
203
  /* @__PURE__ */ e(
174
- F,
204
+ U,
175
205
  {
176
206
  label: "The person's own saved sets",
177
- checked: u,
178
- onChange: y,
207
+ checked: i,
208
+ onChange: m,
179
209
  hook: "own"
180
210
  }
181
211
  )
182
212
  ] })
183
213
  ] }),
184
- (Q = c.data) != null && Q.failed.length ? /* @__PURE__ */ a("p", { className: "text-[11.5px] text-amber-700 dark:text-amber-300", children: [
185
- c.data.failed.length,
214
+ (I = a.data) != null && I.failed.length ? /* @__PURE__ */ r("p", { className: "text-[11.5px] text-amber-700 dark:text-amber-300", children: [
215
+ a.data.failed.length,
186
216
  " link ",
187
- c.data.failed.length === 1 ? "type" : "types",
217
+ a.data.failed.length === 1 ? "type" : "types",
188
218
  " could not be read and are left out: ",
189
- c.data.failed.join(", ")
219
+ a.data.failed.join(", ")
190
220
  ] }) : null,
191
- /* @__PURE__ */ e("div", { className: "flex min-h-0 flex-1 flex-col overflow-hidden rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card", children: c.isLoading ? /* @__PURE__ */ e("div", { className: "space-y-2 p-4", children: [0, 1, 2, 3, 4].map((t) => /* @__PURE__ */ e(
221
+ /* @__PURE__ */ e("div", { className: "flex min-h-0 flex-1 flex-col overflow-hidden rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card", children: a.isLoading ? /* @__PURE__ */ e("div", { className: "space-y-2 p-4", children: [0, 1, 2, 3, 4].map((t) => /* @__PURE__ */ e(
192
222
  "div",
193
223
  {
194
224
  className: "h-9 animate-pulse rounded",
195
225
  style: { background: "hsl(var(--nvr-skeleton))" }
196
226
  },
197
227
  t
198
- )) }) : c.isError ? /* @__PURE__ */ a("p", { className: "p-6 text-[12.5px] text-rose-700 dark:text-rose-300", children: [
228
+ )) }) : a.isError ? /* @__PURE__ */ r("p", { className: "p-6 text-[12.5px] text-rose-700 dark:text-rose-300", children: [
199
229
  "The scan failed. ",
200
- K(c.error, "")
201
- ] }) : k.length === 0 ? /* @__PURE__ */ a("div", { className: "flex flex-1 flex-col items-center justify-center gap-2 p-10 text-center", children: [
202
- /* @__PURE__ */ e(oe, { className: "h-6 w-6 text-slate-400" }),
203
- /* @__PURE__ */ e("p", { className: "text-[13px] font-medium text-slate-800 dark:text-foreground", children: b ? "Nobody inactive is named on open work" : "Nothing matches" }),
204
- /* @__PURE__ */ e("p", { className: "max-w-[52ch] text-[12px] text-slate-500 dark:text-muted-foreground", children: b ? "Every contact, owner and task on a record in an open workflow belongs to someone who can still act. Clear the first switch to look at closed records too." : "Change the switches above to widen what counts as a link." })
205
- ] }) : /* @__PURE__ */ e("ul", { className: "min-h-0 flex-1 divide-y divide-slate-100 overflow-y-auto dark:divide-border", children: k.map((t) => /* @__PURE__ */ e(
206
- me,
230
+ Q(a.error, "")
231
+ ] }) : O.length === 0 ? /* @__PURE__ */ r("div", { className: "flex flex-1 flex-col items-center justify-center gap-2 p-10 text-center", children: [
232
+ /* @__PURE__ */ e(me, { className: "h-6 w-6 text-slate-400" }),
233
+ /* @__PURE__ */ e("p", { className: "text-[13px] font-medium text-slate-800 dark:text-foreground", children: h ? "Nobody inactive is named on open work" : "Nothing matches" }),
234
+ /* @__PURE__ */ e("p", { className: "max-w-[52ch] text-[12px] text-slate-500 dark:text-muted-foreground", children: h ? "Every contact, owner and task on a record in an open workflow belongs to someone who can still act. Clear the first switch to look at closed records too." : "Change the switches above to widen what counts as a link." })
235
+ ] }) : /* @__PURE__ */ e("ul", { className: "min-h-0 flex-1 divide-y divide-slate-100 overflow-y-auto dark:divide-border", children: O.map((t) => /* @__PURE__ */ e(
236
+ ke,
207
237
  {
208
238
  person: t,
209
- sources: N,
239
+ sources: f,
210
240
  open: _ === t.user.id,
211
- onToggle: () => O(_ === t.user.id ? null : t.user.id),
212
- onChanged: re
241
+ onToggle: () => E(_ === t.user.id ? null : t.user.id),
242
+ onChanged: de
213
243
  },
214
244
  t.user.id
215
245
  )) }) })
216
246
  ] });
217
247
  }
218
- function F({
248
+ function U({
219
249
  label: l,
220
- checked: n,
250
+ checked: s,
221
251
  onChange: o,
222
- hook: b
252
+ hook: N
223
253
  }) {
224
- return /* @__PURE__ */ a("label", { className: "flex cursor-pointer items-center gap-1.5 text-[11.5px] text-slate-600 dark:text-muted-foreground", children: [
254
+ return /* @__PURE__ */ r("label", { className: "flex cursor-pointer items-center gap-1.5 text-[11.5px] text-slate-600 dark:text-muted-foreground", children: [
225
255
  /* @__PURE__ */ e(
226
256
  "input",
227
257
  {
228
258
  type: "checkbox",
229
- checked: n,
230
- onChange: (C) => o(C.target.checked),
259
+ checked: s,
260
+ onChange: (y) => o(y.target.checked),
231
261
  className: "h-3.5 w-3.5 accent-slate-700",
232
- "data-inactive-switch": b
262
+ "data-inactive-switch": N
233
263
  }
234
264
  ),
235
265
  l
236
266
  ] });
237
267
  }
238
- function ee(l) {
268
+ function se(l) {
239
269
  return l.kind === "builtin" ? l.label : `${l.collection_label} · ${l.label}`;
240
270
  }
241
- function me({
271
+ function ke({
242
272
  person: l,
243
- sources: n,
273
+ sources: s,
244
274
  open: o,
245
- onToggle: b,
246
- onChanged: C
275
+ onToggle: N,
276
+ onChanged: y
247
277
  }) {
248
- const v = G(), d = l.user, u = v.userUrl ? v.userUrl(d.id) : `/users/${d.id}`, y = d.name.split(/\s+/).map((i) => i[0]).join("").slice(0, 2).toUpperCase();
249
- return /* @__PURE__ */ a("li", { "data-inactive-person": d.id, children: [
250
- /* @__PURE__ */ a(
278
+ const h = ee(), d = l.user, u = h.userUrl ? h.userUrl(d.id) : `/users/${d.id}`, k = d.name.split(/\s+/).map((i) => i[0]).join("").slice(0, 2).toUpperCase();
279
+ return /* @__PURE__ */ r("li", { "data-inactive-person": d.id, children: [
280
+ /* @__PURE__ */ r(
251
281
  "button",
252
282
  {
253
283
  type: "button",
254
- onClick: b,
284
+ onClick: N,
255
285
  "aria-expanded": o,
256
286
  className: "flex w-full items-center gap-3 px-4 py-2.5 text-left hover:bg-muted",
257
287
  children: [
258
- o ? /* @__PURE__ */ e(V, { className: "h-3.5 w-3.5 shrink-0 text-slate-400" }) : /* @__PURE__ */ e(X, { className: "h-3.5 w-3.5 shrink-0 text-slate-400" }),
288
+ o ? /* @__PURE__ */ e(Y, { className: "h-3.5 w-3.5 shrink-0 text-slate-400" }) : /* @__PURE__ */ e(Z, { className: "h-3.5 w-3.5 shrink-0 text-slate-400" }),
259
289
  /* @__PURE__ */ e(
260
- ce,
290
+ fe,
261
291
  {
262
292
  userId: d.id,
263
293
  className: "h-6 w-6 shrink-0 rounded-full object-cover",
264
- fallback: /* @__PURE__ */ e("span", { className: "flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-slate-200 text-[9px] font-semibold text-slate-600 dark:bg-muted dark:text-muted-foreground", children: y })
294
+ fallback: /* @__PURE__ */ e("span", { className: "flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-slate-200 text-[9px] font-semibold text-slate-600 dark:bg-muted dark:text-muted-foreground", children: k })
265
295
  }
266
296
  ),
267
- /* @__PURE__ */ a("span", { className: "min-w-0 flex-[0_1_260px]", children: [
297
+ /* @__PURE__ */ r("span", { className: "min-w-0 flex-[0_1_260px]", children: [
268
298
  /* @__PURE__ */ e("span", { className: "block truncate text-[12.5px] font-medium text-slate-900 dark:text-foreground", children: d.name }),
269
299
  /* @__PURE__ */ e("span", { className: "block truncate text-[11px] text-slate-500 dark:text-muted-foreground", children: d.email ?? "—" })
270
300
  ] }),
271
301
  /* @__PURE__ */ e(
272
302
  "span",
273
303
  {
274
- className: E(
304
+ className: A(
275
305
  "shrink-0 rounded px-1.5 py-0.5 text-[10.5px] font-medium",
276
- ue[d.reason]
306
+ be[d.reason]
277
307
  ),
278
- "data-tip": Z[d.reason],
279
- children: T[d.reason]
308
+ "data-tip": ne[d.reason],
309
+ children: re[d.reason]
280
310
  }
281
311
  ),
282
- /* @__PURE__ */ a("span", { className: "hidden min-w-0 flex-1 truncate text-[11.5px] text-slate-500 md:block dark:text-muted-foreground", children: [
312
+ /* @__PURE__ */ r("span", { className: "hidden min-w-0 flex-1 truncate text-[11.5px] text-slate-500 md:block dark:text-muted-foreground", children: [
283
313
  l.links.slice(0, 3).map((i) => {
284
- const x = n.get(i.source);
285
- return x ? `${ee(x)} ${g(i.count)}` : "";
314
+ const m = s.get(i.source);
315
+ return m ? `${se(m)} ${b(i.count)}` : "";
286
316
  }).filter(Boolean).join(" · "),
287
317
  l.links.length > 3 ? ` · +${l.links.length - 3} more` : ""
288
318
  ] }),
289
- /* @__PURE__ */ e("span", { className: "ml-auto shrink-0 text-[11px] text-slate-500 dark:text-muted-foreground", children: d.last_access ? `last active ${ie(d.last_access)}` : "never signed in" }),
290
- /* @__PURE__ */ e("span", { className: "w-14 shrink-0 text-right text-[12.5px] font-semibold tabular-nums text-slate-900 dark:text-foreground", children: g(l.total) })
319
+ /* @__PURE__ */ e("span", { className: "ml-auto shrink-0 text-[11px] text-slate-500 dark:text-muted-foreground", children: d.last_access ? `last active ${pe(d.last_access)}` : "never signed in" }),
320
+ /* @__PURE__ */ e("span", { className: "w-14 shrink-0 text-right text-[12.5px] font-semibold tabular-nums text-slate-900 dark:text-foreground", children: b(l.total) })
291
321
  ]
292
322
  }
293
323
  ),
294
- o && /* @__PURE__ */ a("div", { className: "border-t border-slate-100 bg-slate-50/60 px-4 py-3 pl-11 dark:border-border dark:bg-white/[0.02]", children: [
324
+ o && /* @__PURE__ */ r("div", { className: "border-t border-slate-100 bg-slate-50/60 px-4 py-3 pl-11 dark:border-border dark:bg-white/[0.02]", children: [
295
325
  /* @__PURE__ */ e("ul", { className: "space-y-1", children: l.links.map((i) => {
296
- const x = n.get(i.source);
297
- return x ? /* @__PURE__ */ e(
298
- xe,
326
+ const m = s.get(i.source);
327
+ return m ? /* @__PURE__ */ e(
328
+ ve,
299
329
  {
300
330
  userId: d.id,
301
- source: x,
331
+ source: m,
302
332
  count: i.count,
303
- onChanged: C
333
+ onChanged: y
304
334
  },
305
335
  i.source
306
336
  ) : null;
307
337
  }) }),
308
- u && /* @__PURE__ */ a("p", { className: "mt-3 text-[11.5px] text-slate-500 dark:text-muted-foreground", children: [
338
+ u && /* @__PURE__ */ r("p", { className: "mt-3 text-[11.5px] text-slate-500 dark:text-muted-foreground", children: [
309
339
  "Everything this person holds can also move in one pass from",
310
340
  " ",
311
341
  /* @__PURE__ */ e(
312
342
  "button",
313
343
  {
314
344
  type: "button",
315
- onClick: () => v.navigate(u),
345
+ onClick: () => h.navigate(u),
316
346
  className: "font-medium text-slate-700 underline decoration-dotted underline-offset-2 hover:text-slate-900 dark:text-foreground",
317
347
  children: "their account page"
318
348
  }
@@ -323,110 +353,110 @@ function me({
323
353
  ] })
324
354
  ] });
325
355
  }
326
- function xe({
356
+ function ve({
327
357
  userId: l,
328
- source: n,
358
+ source: s,
329
359
  count: o,
330
- onChanged: b
360
+ onChanged: N
331
361
  }) {
332
- var p, $;
333
- const C = z(), { open: v } = J(), [d, u] = f(!1), y = !0, i = n.kind === "builtin", x = B({
334
- queryKey: ["inactive-user-records", l, n.key],
335
- queryFn: () => C.request(
336
- I(
337
- `/inactive-user-links/${l}/records?source=${encodeURIComponent(n.key)}&limit=100`
362
+ var g, w;
363
+ const y = B(), { open: h } = te(), [d, u] = x(!1), k = !0, i = s.kind === "builtin", m = K({
364
+ queryKey: ["inactive-user-records", l, s.key],
365
+ queryFn: () => y.request(
366
+ M(
367
+ `/inactive-user-links/${l}/records?source=${encodeURIComponent(s.key)}&limit=100`
338
368
  )
339
- ).then((h) => h.data),
340
- enabled: d && y
369
+ ).then((c) => c.data),
370
+ enabled: d && k
341
371
  });
342
- return /* @__PURE__ */ a("li", { "data-inactive-source": n.key, children: [
343
- /* @__PURE__ */ a("div", { className: "flex items-center gap-2 text-[12px]", children: [
344
- /* @__PURE__ */ a(
372
+ return /* @__PURE__ */ r("li", { "data-inactive-source": s.key, children: [
373
+ /* @__PURE__ */ r("div", { className: "flex items-center gap-2 text-[12px]", children: [
374
+ /* @__PURE__ */ r(
345
375
  "button",
346
376
  {
347
377
  type: "button",
348
- disabled: !y,
349
- onClick: () => u((h) => !h),
378
+ disabled: !k,
379
+ onClick: () => u((c) => !c),
350
380
  "aria-expanded": d,
351
381
  className: "flex min-w-0 items-center gap-1.5 text-left text-slate-700 enabled:hover:text-slate-900 dark:text-foreground",
352
382
  children: [
353
- d ? /* @__PURE__ */ e(V, { className: "h-3 w-3 shrink-0 text-slate-400" }) : /* @__PURE__ */ e(X, { className: "h-3 w-3 shrink-0 text-slate-400" }),
354
- /* @__PURE__ */ e("span", { className: "truncate", children: ee(n) })
383
+ d ? /* @__PURE__ */ e(Y, { className: "h-3 w-3 shrink-0 text-slate-400" }) : /* @__PURE__ */ e(Z, { className: "h-3 w-3 shrink-0 text-slate-400" }),
384
+ /* @__PURE__ */ e("span", { className: "truncate", children: se(s) })
355
385
  ]
356
386
  }
357
387
  ),
358
- /* @__PURE__ */ e("span", { className: "tabular-nums text-slate-500 dark:text-muted-foreground", children: g(o) }),
359
- n.scope === "open" && /* @__PURE__ */ e("span", { className: "rounded bg-[#e0f2fe] px-1.5 py-0.5 text-[10px] font-medium text-[#075985] dark:bg-[#15303f] dark:text-[#8fcdf0]", children: "open workflow" }),
360
- n.reassignable && !i && /* @__PURE__ */ e("span", { className: "ml-auto", children: /* @__PURE__ */ e(te, { userId: l, source: n, count: o, onDone: b }) })
388
+ /* @__PURE__ */ e("span", { className: "tabular-nums text-slate-500 dark:text-muted-foreground", children: b(o) }),
389
+ s.scope === "open" && /* @__PURE__ */ e("span", { className: "rounded bg-[#e0f2fe] px-1.5 py-0.5 text-[10px] font-medium text-[#075985] dark:bg-[#15303f] dark:text-[#8fcdf0]", children: "open workflow" }),
390
+ s.reassignable && !i && /* @__PURE__ */ e("span", { className: "ml-auto", children: /* @__PURE__ */ e(le, { userId: l, source: s, count: o, onDone: N }) })
361
391
  ] }),
362
- d && y && /* @__PURE__ */ e("div", { className: "ml-[18px] mt-1 mb-2", children: x.isLoading ? /* @__PURE__ */ e("p", { className: "text-[11.5px] text-slate-500 dark:text-muted-foreground", children: "Loading…" }) : i ? /* @__PURE__ */ e(
363
- he,
392
+ d && k && /* @__PURE__ */ e("div", { className: "ml-[18px] mt-1 mb-2", children: m.isLoading ? /* @__PURE__ */ e("p", { className: "text-[11.5px] text-slate-500 dark:text-muted-foreground", children: "Loading…" }) : i ? /* @__PURE__ */ e(
393
+ Ne,
364
394
  {
365
395
  userId: l,
366
- source: n,
367
- entries: ((p = x.data) == null ? void 0 : p.entries) ?? [],
368
- onChanged: b
396
+ source: s,
397
+ entries: ((g = m.data) == null ? void 0 : g.entries) ?? [],
398
+ onChanged: N
369
399
  }
370
- ) : ($ = x.data) != null && $.records.length ? /* @__PURE__ */ a("ul", { className: "flex flex-wrap gap-1", "data-inactive-records": !0, children: [
371
- x.data.records.map((h) => {
372
- var S;
400
+ ) : (w = m.data) != null && w.records.length ? /* @__PURE__ */ r("ul", { className: "flex flex-wrap gap-1", "data-inactive-records": !0, children: [
401
+ m.data.records.map((c) => {
402
+ var C;
373
403
  return /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(
374
404
  "button",
375
405
  {
376
406
  type: "button",
377
- onClick: () => v({ collection: h.collection, itemId: h.id }),
407
+ onClick: () => h({ collection: c.collection, itemId: c.id }),
378
408
  className: "rounded border border-slate-200 bg-white px-1.5 py-0.5 text-[11px] text-slate-700 hover:border-slate-400 dark:border-border dark:bg-card dark:text-foreground",
379
- children: ((S = h.label) == null ? void 0 : S.trim()) || `#${h.id}`
409
+ children: ((C = c.label) == null ? void 0 : C.trim()) || `#${c.id}`
380
410
  }
381
- ) }, `${h.collection}:${h.id}`);
411
+ ) }, `${c.collection}:${c.id}`);
382
412
  }),
383
- o > x.data.records.length && /* @__PURE__ */ a("li", { className: "px-1 py-0.5 text-[11px] text-slate-500 dark:text-muted-foreground", children: [
413
+ o > m.data.records.length && /* @__PURE__ */ r("li", { className: "px-1 py-0.5 text-[11px] text-slate-500 dark:text-muted-foreground", children: [
384
414
  "+",
385
- g(o - x.data.records.length),
415
+ b(o - m.data.records.length),
386
416
  " more"
387
417
  ] })
388
418
  ] }) : /* @__PURE__ */ e("p", { className: "text-[11.5px] text-slate-500 dark:text-muted-foreground", children: "Nothing to list." }) })
389
419
  ] });
390
420
  }
391
- function te({
421
+ function le({
392
422
  userId: l,
393
- source: n,
423
+ source: s,
394
424
  count: o,
395
- ids: b,
396
- label: C = "Hand to…",
397
- onDone: v
425
+ ids: N,
426
+ label: y = "Hand to…",
427
+ onDone: h
398
428
  }) {
399
- var m;
400
- const d = z(), [u, y] = f(!1), [i, x] = f(""), [p, $] = f(null), [h, S] = f(!1), [_, O] = f(null), [q, j] = f(null), c = B({
429
+ var p;
430
+ const d = B(), [u, k] = x(!1), [i, m] = x(""), [g, w] = x(null), [c, C] = x(!1), [q, j] = x(null), [_, E] = x(null), $ = K({
401
431
  queryKey: ["inactive-reassign-users", i],
402
- queryFn: () => d.request(I(`/users?search=${encodeURIComponent(i)}&limit=8`)).then((s) => s.data),
403
- enabled: u && !p && i.trim().length >= 2,
432
+ queryFn: () => d.request(M(`/users?search=${encodeURIComponent(i)}&limit=8`)).then((a) => a.data),
433
+ enabled: u && !g && i.trim().length >= 2,
404
434
  staleTime: 3e4
405
- }), N = (s) => [s.first_name, s.last_name].filter(Boolean).join(" ") || s.email, r = async () => {
406
- if (p) {
407
- S(!0), j(null);
435
+ }), L = (a) => [a.first_name, a.last_name].filter(Boolean).join(" ") || a.email, n = async () => {
436
+ if (g) {
437
+ C(!0), E(null);
408
438
  try {
409
- const k = (await d.request(Y(`/inactive-user-links/${l}/reassign`, { source: n.key, to: p.id, ids: b }))).data;
410
- O(
411
- `${g(k.moved)} moved to ${N(p)}` + (k.removed ? ` · ${g(k.removed)} already theirs` : "") + (k.failed.length ? ` · ${g(k.failed.length)} refused (${k.failed[0].error})` : "")
412
- ), y(!1), v();
413
- } catch (s) {
414
- const k = s.response;
415
- j((k == null ? void 0 : k.error) ?? K(s, ""));
439
+ const f = (await d.request(ae(`/inactive-user-links/${l}/reassign`, { source: s.key, to: g.id, ids: N }))).data;
440
+ j(
441
+ `${b(f.moved)} moved to ${L(g)}` + (f.removed ? ` · ${b(f.removed)} already theirs` : "") + (f.failed.length ? ` · ${b(f.failed.length)} refused (${f.failed[0].error})` : "")
442
+ ), k(!1), h();
443
+ } catch (a) {
444
+ const f = a.response;
445
+ E((f == null ? void 0 : f.error) ?? Q(a, ""));
416
446
  } finally {
417
- S(!1);
447
+ C(!1);
418
448
  }
419
449
  }
420
450
  };
421
- return _ ? /* @__PURE__ */ e("span", { className: "text-[11px] text-emerald-700 dark:text-emerald-400", "data-inactive-reassigned": !0, children: _ }) : /* @__PURE__ */ a("span", { className: "relative inline-block", children: [
451
+ return q ? /* @__PURE__ */ e("span", { className: "text-[11px] text-emerald-700 dark:text-emerald-400", "data-inactive-reassigned": !0, children: q }) : /* @__PURE__ */ r("span", { className: "relative inline-block", children: [
422
452
  /* @__PURE__ */ e(
423
453
  "button",
424
454
  {
425
455
  type: "button",
426
- onClick: () => y((s) => !s),
427
- "data-inactive-reassign": n.key,
456
+ onClick: () => k((a) => !a),
457
+ "data-inactive-reassign": s.key,
428
458
  className: "rounded-md border border-slate-200 bg-white px-2 py-0.5 text-[11px] text-slate-600 hover:border-slate-300 hover:text-slate-900 dark:border-border dark:bg-card dark:text-muted-foreground dark:hover:text-foreground",
429
- children: C
459
+ children: y
430
460
  }
431
461
  ),
432
462
  u && /* @__PURE__ */ e(
@@ -434,30 +464,30 @@ function te({
434
464
  {
435
465
  className: "absolute right-0 top-7 z-30 w-72 rounded-md border border-slate-200 bg-white p-2 text-left shadow-md dark:border-border dark:bg-card",
436
466
  "data-inactive-reassign-panel": !0,
437
- children: p ? /* @__PURE__ */ a("div", { className: "space-y-2", children: [
438
- /* @__PURE__ */ a("p", { className: "text-[12px] text-slate-700 dark:text-foreground", children: [
467
+ children: g ? /* @__PURE__ */ r("div", { className: "space-y-2", children: [
468
+ /* @__PURE__ */ r("p", { className: "text-[12px] text-slate-700 dark:text-foreground", children: [
439
469
  "Put ",
440
- /* @__PURE__ */ e("strong", { className: "font-semibold", children: N(p) }),
470
+ /* @__PURE__ */ e("strong", { className: "font-semibold", children: L(g) }),
441
471
  " on",
442
472
  " ",
443
- g(Math.min(o, 500)),
473
+ b(Math.min(o, 500)),
444
474
  " ",
445
- n.kind === "builtin" ? o === 1 ? "place" : "places" : o === 1 ? "record" : "records",
475
+ s.kind === "builtin" ? o === 1 ? "place" : "places" : o === 1 ? "record" : "records",
446
476
  " ",
447
477
  "as ",
448
- n.label.toLowerCase(),
478
+ s.label.toLowerCase(),
449
479
  o > 500 ? " (500 at a time)" : "",
450
480
  "?",
451
481
  " ",
452
- n.kind === "builtin" ? "Places they already hold are not doubled." : "Each change is saved to the record's history."
482
+ s.kind === "builtin" ? "Places they already hold are not doubled." : "Each change is saved to the record's history."
453
483
  ] }),
454
- q && /* @__PURE__ */ e("p", { className: "text-[11.5px] text-rose-700 dark:text-rose-300", children: q }),
455
- /* @__PURE__ */ a("div", { className: "flex justify-end gap-1.5", children: [
484
+ _ && /* @__PURE__ */ e("p", { className: "text-[11.5px] text-rose-700 dark:text-rose-300", children: _ }),
485
+ /* @__PURE__ */ r("div", { className: "flex justify-end gap-1.5", children: [
456
486
  /* @__PURE__ */ e(
457
487
  "button",
458
488
  {
459
489
  type: "button",
460
- onClick: () => $(null),
490
+ onClick: () => w(null),
461
491
  className: "h-7 rounded-md px-2 text-[11.5px] text-slate-600 hover:text-slate-900 dark:text-muted-foreground",
462
492
  children: "Back"
463
493
  }
@@ -466,125 +496,125 @@ function te({
466
496
  "button",
467
497
  {
468
498
  type: "button",
469
- onClick: r,
470
- disabled: h,
499
+ onClick: n,
500
+ disabled: c,
471
501
  "data-inactive-reassign-confirm": !0,
472
502
  className: "h-7 rounded-md bg-nvr-cyan px-2.5 text-[11.5px] font-medium text-white disabled:opacity-60",
473
- children: h ? "Moving…" : "Move them"
503
+ children: c ? "Moving…" : "Move them"
474
504
  }
475
505
  )
476
506
  ] })
477
- ] }) : /* @__PURE__ */ a(H, { children: [
507
+ ] }) : /* @__PURE__ */ r(J, { children: [
478
508
  /* @__PURE__ */ e(
479
509
  "input",
480
510
  {
481
511
  autoFocus: !0,
482
512
  value: i,
483
- onChange: (s) => x(s.target.value),
513
+ onChange: (a) => m(a.target.value),
484
514
  placeholder: "Search people",
485
515
  className: "h-8 w-full rounded-md border border-slate-200 bg-background px-2 text-[12.5px] text-slate-800 placeholder:text-slate-500 focus:border-slate-400 focus:outline-none dark:border-border dark:text-foreground"
486
516
  }
487
517
  ),
488
- /* @__PURE__ */ a("ul", { className: "mt-1 max-h-56 overflow-y-auto", children: [
489
- (c.data ?? []).filter((s) => s.id.toLowerCase() !== l.toLowerCase()).map((s) => /* @__PURE__ */ e("li", { children: /* @__PURE__ */ a(
518
+ /* @__PURE__ */ r("ul", { className: "mt-1 max-h-56 overflow-y-auto", children: [
519
+ ($.data ?? []).filter((a) => a.id.toLowerCase() !== l.toLowerCase()).map((a) => /* @__PURE__ */ e("li", { children: /* @__PURE__ */ r(
490
520
  "button",
491
521
  {
492
522
  type: "button",
493
- onClick: () => $(s),
494
- "data-inactive-candidate": s.id,
523
+ onClick: () => w(a),
524
+ "data-inactive-candidate": a.id,
495
525
  className: "flex w-full flex-col rounded px-2 py-1 text-left hover:bg-muted",
496
526
  children: [
497
- /* @__PURE__ */ e("span", { className: "text-[12px] text-slate-800 dark:text-foreground", children: N(s) }),
498
- /* @__PURE__ */ e("span", { className: "text-[10.5px] text-slate-500 dark:text-muted-foreground", children: s.email })
527
+ /* @__PURE__ */ e("span", { className: "text-[12px] text-slate-800 dark:text-foreground", children: L(a) }),
528
+ /* @__PURE__ */ e("span", { className: "text-[10.5px] text-slate-500 dark:text-muted-foreground", children: a.email })
499
529
  ]
500
530
  }
501
- ) }, s.id)),
502
- i.trim().length >= 2 && !c.isLoading && !((m = c.data) != null && m.length) && /* @__PURE__ */ e("li", { className: "px-2 py-1 text-[11.5px] text-slate-500 dark:text-muted-foreground", children: "No active person matches." })
531
+ ) }, a.id)),
532
+ i.trim().length >= 2 && !$.isLoading && !((p = $.data) != null && p.length) && /* @__PURE__ */ e("li", { className: "px-2 py-1 text-[11.5px] text-slate-500 dark:text-muted-foreground", children: "No active person matches." })
503
533
  ] })
504
534
  ] })
505
535
  }
506
536
  )
507
537
  ] });
508
538
  }
509
- function he({
539
+ function Ne({
510
540
  userId: l,
511
- source: n,
541
+ source: s,
512
542
  entries: o,
513
- onChanged: b
543
+ onChanged: N
514
544
  }) {
515
- const C = z(), v = G(), { open: d } = J(), [u, y] = f(/* @__PURE__ */ new Set()), [i, x] = f(!1), [p, $] = f(!1), [h, S] = f(null), _ = n.key !== "builtin:tasks", O = [...u], q = o.length > 0 && u.size === o.length, j = (r) => y((m) => {
516
- const s = new Set(m);
517
- return s.has(r) ? s.delete(r) : s.add(r), s;
518
- }), c = async () => {
519
- var r;
520
- $(!0);
545
+ const y = B(), h = ee(), { open: d } = te(), [u, k] = x(/* @__PURE__ */ new Set()), [i, m] = x(!1), [g, w] = x(!1), [c, C] = x(null), q = s.key !== "builtin:tasks", j = [...u], _ = o.length > 0 && u.size === o.length, E = (n) => k((p) => {
546
+ const a = new Set(p);
547
+ return a.has(n) ? a.delete(n) : a.add(n), a;
548
+ }), $ = async () => {
549
+ var n;
550
+ w(!0);
521
551
  try {
522
- const m = await C.request(
523
- Y(`/inactive-user-links/${l}/remove`, { source: n.key, ids: O })
552
+ const p = await y.request(
553
+ ae(`/inactive-user-links/${l}/remove`, { source: s.key, ids: j })
524
554
  );
525
- S(
526
- `${g(m.data.removed)} removed${m.data.failed.length ? ` · ${g(m.data.failed.length)} refused` : ""}`
527
- ), y(/* @__PURE__ */ new Set()), x(!1), b();
528
- } catch (m) {
529
- S(((r = m.response) == null ? void 0 : r.error) ?? K(m, ""));
555
+ C(
556
+ `${b(p.data.removed)} removed${p.data.failed.length ? ` · ${b(p.data.failed.length)} refused` : ""}`
557
+ ), k(/* @__PURE__ */ new Set()), m(!1), N();
558
+ } catch (p) {
559
+ C(((n = p.response) == null ? void 0 : n.error) ?? Q(p, ""));
530
560
  } finally {
531
- $(!1);
561
+ w(!1);
532
562
  }
533
563
  };
534
564
  if (!o.length)
535
565
  return /* @__PURE__ */ e("p", { className: "text-[11.5px] text-slate-500 dark:text-muted-foreground", children: "Nothing to list." });
536
- const N = o.filter((r) => r.sole).length;
537
- return /* @__PURE__ */ a("div", { "data-inactive-entries": n.key, children: [
538
- /* @__PURE__ */ a("div", { className: "mb-1 flex min-h-7 flex-wrap items-center gap-2 text-[11.5px] text-slate-600 dark:text-muted-foreground", children: [
539
- /* @__PURE__ */ a("label", { className: "flex cursor-pointer items-center gap-1.5", children: [
566
+ const L = o.filter((n) => n.sole).length;
567
+ return /* @__PURE__ */ r("div", { "data-inactive-entries": s.key, children: [
568
+ /* @__PURE__ */ r("div", { className: "mb-1 flex min-h-7 flex-wrap items-center gap-2 text-[11.5px] text-slate-600 dark:text-muted-foreground", children: [
569
+ /* @__PURE__ */ r("label", { className: "flex cursor-pointer items-center gap-1.5", children: [
540
570
  /* @__PURE__ */ e(
541
571
  "input",
542
572
  {
543
573
  type: "checkbox",
544
- checked: q,
545
- onChange: () => y(q ? /* @__PURE__ */ new Set() : new Set(o.map((r) => r.id))),
574
+ checked: _,
575
+ onChange: () => k(_ ? /* @__PURE__ */ new Set() : new Set(o.map((n) => n.id))),
546
576
  className: "h-3.5 w-3.5 accent-slate-700",
547
577
  "data-inactive-entries-all": !0
548
578
  }
549
579
  ),
550
- u.size ? `${g(u.size)} picked` : "Pick all"
580
+ u.size ? `${b(u.size)} picked` : "Pick all"
551
581
  ] }),
552
- N > 0 && /* @__PURE__ */ a("span", { className: "rounded bg-[#ffe4e6] px-1.5 py-0.5 text-[10.5px] font-medium text-[#9f1239] dark:bg-[#3d1a20] dark:text-[#f4a3ad]", children: [
553
- g(N),
582
+ L > 0 && /* @__PURE__ */ r("span", { className: "rounded bg-[#ffe4e6] px-1.5 py-0.5 text-[10.5px] font-medium text-[#9f1239] dark:bg-[#3d1a20] dark:text-[#f4a3ad]", children: [
583
+ b(L),
554
584
  " with nobody else who can act"
555
585
  ] }),
556
- h && /* @__PURE__ */ e("span", { className: "text-emerald-700 dark:text-emerald-400", children: h }),
557
- u.size > 0 && /* @__PURE__ */ a("span", { className: "ml-auto flex items-center gap-1.5", children: [
586
+ c && /* @__PURE__ */ e("span", { className: "text-emerald-700 dark:text-emerald-400", children: c }),
587
+ u.size > 0 && /* @__PURE__ */ r("span", { className: "ml-auto flex items-center gap-1.5", children: [
558
588
  /* @__PURE__ */ e(
559
- te,
589
+ le,
560
590
  {
561
591
  userId: l,
562
- source: n,
592
+ source: s,
563
593
  count: u.size,
564
- ids: O,
565
- label: `Hand ${g(u.size)} to…`,
594
+ ids: j,
595
+ label: `Hand ${b(u.size)} to…`,
566
596
  onDone: () => {
567
- y(/* @__PURE__ */ new Set()), b();
597
+ k(/* @__PURE__ */ new Set()), N();
568
598
  }
569
599
  }
570
600
  ),
571
- _ && (i ? /* @__PURE__ */ a(H, { children: [
601
+ q && (i ? /* @__PURE__ */ r(J, { children: [
572
602
  /* @__PURE__ */ e(
573
603
  "button",
574
604
  {
575
605
  type: "button",
576
- onClick: c,
577
- disabled: p,
606
+ onClick: $,
607
+ disabled: g,
578
608
  "data-inactive-remove-confirm": !0,
579
609
  className: "h-[22px] rounded-md bg-[#be123c] px-2 text-[11px] font-medium text-white disabled:opacity-60",
580
- children: p ? "Removing…" : `Remove ${g(u.size)}, no successor`
610
+ children: g ? "Removing…" : `Remove ${b(u.size)}, no successor`
581
611
  }
582
612
  ),
583
613
  /* @__PURE__ */ e(
584
614
  "button",
585
615
  {
586
616
  type: "button",
587
- onClick: () => x(!1),
617
+ onClick: () => m(!1),
588
618
  className: "text-[11px] text-slate-600 hover:text-slate-900 dark:text-muted-foreground",
589
619
  children: "Keep"
590
620
  }
@@ -593,7 +623,7 @@ function he({
593
623
  "button",
594
624
  {
595
625
  type: "button",
596
- onClick: () => x(!0),
626
+ onClick: () => m(!0),
597
627
  "data-inactive-remove": !0,
598
628
  className: "rounded-md border border-slate-200 bg-white px-2 py-0.5 text-[11px] text-slate-600 hover:border-[#be123c] hover:text-[#be123c] dark:border-border dark:bg-card dark:text-muted-foreground",
599
629
  children: "Remove…"
@@ -601,64 +631,65 @@ function he({
601
631
  ))
602
632
  ] })
603
633
  ] }),
604
- /* @__PURE__ */ e("ul", { className: "divide-y divide-slate-100 rounded-md border border-slate-200 bg-white dark:divide-border dark:border-border dark:bg-card", children: o.map((r) => {
605
- const m = r.console_path ? v.consoleUrl ? v.consoleUrl(r.console_path) : r.console_path : null;
606
- return /* @__PURE__ */ a(
634
+ /* @__PURE__ */ e("ul", { className: "divide-y divide-slate-100 rounded-md border border-slate-200 bg-white dark:divide-border dark:border-border dark:bg-card", children: o.map((n) => {
635
+ const p = n.console_path ? h.consoleUrl ? h.consoleUrl(n.console_path) : n.console_path : null;
636
+ return /* @__PURE__ */ r(
607
637
  "li",
608
638
  {
609
639
  className: "flex items-start gap-2 px-2.5 py-1.5",
610
- "data-inactive-entry": r.id,
640
+ "data-inactive-entry": n.id,
611
641
  children: [
612
642
  /* @__PURE__ */ e(
613
643
  "input",
614
644
  {
615
645
  type: "checkbox",
616
- checked: u.has(r.id),
617
- onChange: () => j(r.id),
618
- "aria-label": `Pick ${r.title}`,
646
+ checked: u.has(n.id),
647
+ onChange: () => E(n.id),
648
+ "aria-label": `Pick ${n.title}`,
619
649
  className: "mt-0.5 h-3.5 w-3.5 shrink-0 accent-slate-700"
620
650
  }
621
651
  ),
622
- /* @__PURE__ */ a("div", { className: "min-w-0 flex-1", children: [
623
- /* @__PURE__ */ a("div", { className: "flex flex-wrap items-baseline gap-x-2", children: [
624
- r.record ? /* @__PURE__ */ e(
652
+ /* @__PURE__ */ r("div", { className: "min-w-0 flex-1", children: [
653
+ /* @__PURE__ */ r("div", { className: "flex flex-wrap items-baseline gap-x-2", children: [
654
+ n.record ? /* @__PURE__ */ e(
625
655
  "button",
626
656
  {
627
657
  type: "button",
628
- onClick: () => r.record && d({ collection: r.record.collection, itemId: r.record.id }),
658
+ onClick: () => n.record && d({ collection: n.record.collection, itemId: n.record.id }),
629
659
  className: "text-left text-[12px] font-medium text-slate-900 underline decoration-dotted underline-offset-2 dark:text-foreground",
630
- children: r.title
660
+ children: n.title
631
661
  }
632
- ) : m ? /* @__PURE__ */ e(
662
+ ) : p ? /* @__PURE__ */ e(
633
663
  "button",
634
664
  {
635
665
  type: "button",
636
- onClick: () => /^https?:/.test(m) ? window.open(m, "_blank") : v.navigate(m),
666
+ onClick: () => /^https?:/.test(p) ? window.open(p, "_blank") : h.navigate(p),
637
667
  className: "text-left text-[12px] font-medium text-slate-900 underline decoration-dotted underline-offset-2 dark:text-foreground",
638
- children: r.title
668
+ children: n.title
639
669
  }
640
- ) : /* @__PURE__ */ e("span", { className: "text-[12px] font-medium text-slate-900 dark:text-foreground", children: r.title }),
641
- /* @__PURE__ */ e("span", { className: "text-[11px] text-slate-500 dark:text-muted-foreground", children: r.facts.join(" · ") })
670
+ ) : /* @__PURE__ */ e("span", { className: "text-[12px] font-medium text-slate-900 dark:text-foreground", children: n.title }),
671
+ /* @__PURE__ */ e("span", { className: "text-[11px] text-slate-500 dark:text-muted-foreground", children: n.facts.join(" · ") })
642
672
  ] }),
643
- r.subtitle && /* @__PURE__ */ e("p", { className: "text-[11.5px] text-slate-600 dark:text-muted-foreground", children: r.subtitle }),
644
- (n.key === "builtin:owner_seats" || n.key === "builtin:teams") && /* @__PURE__ */ e(
673
+ n.subtitle && /* @__PURE__ */ e("p", { className: "text-[11.5px] text-slate-600 dark:text-muted-foreground", children: n.subtitle }),
674
+ (s.key === "builtin:owner_seats" || s.key === "builtin:teams") && /* @__PURE__ */ e(
645
675
  "p",
646
676
  {
647
- className: E(
677
+ className: A(
648
678
  "text-[11px]",
649
- r.sole ? "font-medium text-[#9f1239] dark:text-[#f4a3ad]" : "text-slate-500 dark:text-muted-foreground"
679
+ n.sole ? "font-medium text-[#9f1239] dark:text-[#f4a3ad]" : "text-slate-500 dark:text-muted-foreground"
650
680
  ),
651
- children: r.sole ? "Nobody else who can act holds this — records here resolve no owner." : `Also held by ${r.others.slice(0, 4).join(", ")}${r.others.length > 4 ? ` +${r.others.length - 4}` : ""}${r.others.length ? "" : "a linked team"}`
681
+ children: n.sole ? "Nobody else who can act holds this — records here resolve no owner." : `Also held by ${n.others.slice(0, 4).join(", ")}${n.others.length > 4 ? ` +${n.others.length - 4}` : ""}${n.others.length ? "" : "a linked team"}`
652
682
  }
653
683
  )
654
684
  ] })
655
685
  ]
656
686
  },
657
- r.id
687
+ n.id
658
688
  );
659
689
  }) })
660
690
  ] });
661
691
  }
662
692
  export {
663
- Ce as InactiveUserLinksView
693
+ Ee as InactiveUserLinksView,
694
+ X as reasonGroup
664
695
  };