@nivaro/react 0.3.11 → 0.3.12
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/full.css +1 -1
- package/dist/hooks/useSessionRecorder.js +109 -102
- package/dist/shared/components/ProfileView.js +115 -109
- package/dist/shared/components/chat/ChatPanel.js +492 -472
- package/dist/shared/components/item-edit/UserChip.js +301 -233
- package/dist/shared/components/profile/PersonAdminTools.js +168 -144
- package/dist/shared/components/profile/PersonProfile.js +42 -41
- package/dist/shared/components/profile/session-actions.js +52 -0
- package/dist/shared/lib/replay-checkout.js +20 -0
- package/package.json +1 -1
|
@@ -1,49 +1,33 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useMutation as
|
|
3
|
-
import { RefreshCw as
|
|
4
|
-
import { useState as m } from "react";
|
|
1
|
+
import { jsxs as a, jsx as e, Fragment as I } from "react/jsx-runtime";
|
|
2
|
+
import { useMutation as y, useQuery as T } from "@tanstack/react-query";
|
|
3
|
+
import { RefreshCw as F, LogOut as R, GitMerge as U, UserMinus as H } from "lucide-react";
|
|
4
|
+
import { useState as m, useEffect as K } from "react";
|
|
5
5
|
import { toast as x } from "sonner";
|
|
6
|
-
import { useNivaroClient as
|
|
7
|
-
import { post as
|
|
8
|
-
import { cn as
|
|
9
|
-
import { SectionCard as
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
seconds: Number(h) || 15,
|
|
17
|
-
message: p
|
|
18
|
-
})
|
|
19
|
-
).then((a) => a.data),
|
|
20
|
-
// The reload rides the person's room on every server; only the tab count can fall short.
|
|
21
|
-
// A server without `nodes` counts only the tabs on the server that took this request.
|
|
22
|
-
onSuccess: ({ sockets: a, nodes: s, partial: c, remembered: b, remember_hours: r }) => {
|
|
23
|
-
const f = b ? ` Tabs that connect in the next ${r ?? 24} h reload too.` : "";
|
|
24
|
-
x.success(
|
|
25
|
-
(a > 0 ? `Reload pushed to ${a} open tab${a === 1 ? "" : "s"}${c ? " (another server did not answer — there may be more)" : ""}.` : c ? "Reload sent — another server did not answer, so their open tabs could not be counted." : s != null ? "Reload sent — they have no tab open right now." : "Reload sent to every tab they have open (tabs on other servers are not counted).") + f
|
|
26
|
-
);
|
|
27
|
-
},
|
|
28
|
-
onError: (a) => x.error(y(a, "Failed to push the reload"))
|
|
29
|
-
});
|
|
30
|
-
return /* @__PURE__ */ o(
|
|
31
|
-
C,
|
|
6
|
+
import { useNivaroClient as C } from "../../context.js";
|
|
7
|
+
import { post as N, get as j } from "../../lib/commands.js";
|
|
8
|
+
import { cn as O } from "../../lib/utils.js";
|
|
9
|
+
import { SectionCard as f, EmptyLine as M } from "./primitives.js";
|
|
10
|
+
import { useReloadTheirTabs as Q, useSignOutEverywhere as z } from "./session-actions.js";
|
|
11
|
+
import { useInvalidatePerson as $, errorText as _ } from "./types.js";
|
|
12
|
+
function oe({ profile: s }) {
|
|
13
|
+
const [d, l] = m("15"), [t, u] = m(""), o = Q(s.id);
|
|
14
|
+
return /* @__PURE__ */ a(
|
|
15
|
+
f,
|
|
32
16
|
{
|
|
33
|
-
icon: /* @__PURE__ */ e(
|
|
17
|
+
icon: /* @__PURE__ */ e(F, { className: "h-4 w-4" }),
|
|
34
18
|
title: "Force a reload",
|
|
35
19
|
hint: "Every tab they have open shows a countdown, then reloads onto the current build",
|
|
36
20
|
tone: "danger",
|
|
37
21
|
testId: "force-reload",
|
|
38
22
|
children: [
|
|
39
|
-
/* @__PURE__ */
|
|
40
|
-
/* @__PURE__ */
|
|
23
|
+
/* @__PURE__ */ a("div", { className: "flex flex-wrap items-center gap-2", "data-user-force-reload": !0, children: [
|
|
24
|
+
/* @__PURE__ */ a("label", { className: "flex items-center gap-1.5 text-[12px] text-slate-600 dark:text-slate-300", children: [
|
|
41
25
|
"Countdown",
|
|
42
26
|
/* @__PURE__ */ e(
|
|
43
27
|
"input",
|
|
44
28
|
{
|
|
45
|
-
value:
|
|
46
|
-
onChange: (
|
|
29
|
+
value: d,
|
|
30
|
+
onChange: (c) => l(c.target.value),
|
|
47
31
|
inputMode: "numeric",
|
|
48
32
|
className: "h-7 w-14 rounded-md border border-slate-200 bg-white px-2 text-right text-[12px] dark:border-border dark:bg-background"
|
|
49
33
|
}
|
|
@@ -53,22 +37,22 @@ function te({ profile: d }) {
|
|
|
53
37
|
/* @__PURE__ */ e(
|
|
54
38
|
"input",
|
|
55
39
|
{
|
|
56
|
-
value:
|
|
57
|
-
onChange: (
|
|
40
|
+
value: t,
|
|
41
|
+
onChange: (c) => u(c.target.value),
|
|
58
42
|
placeholder: "Optional message in their banner",
|
|
59
43
|
className: "h-7 min-w-[200px] flex-1 rounded-md border border-slate-200 bg-white px-2.5 text-[12px] dark:border-border dark:bg-background"
|
|
60
44
|
}
|
|
61
45
|
),
|
|
62
|
-
/* @__PURE__ */
|
|
46
|
+
/* @__PURE__ */ a(
|
|
63
47
|
"button",
|
|
64
48
|
{
|
|
65
49
|
type: "button",
|
|
66
|
-
disabled:
|
|
67
|
-
onClick: () =>
|
|
50
|
+
disabled: o.isPending,
|
|
51
|
+
onClick: () => o.mutate({ seconds: Number(d) || 15, message: t }),
|
|
68
52
|
className: "inline-flex h-7 items-center gap-1.5 rounded-md border border-amber-300 px-2.5 text-[11.5px] font-medium text-amber-800 transition-colors hover:bg-amber-50 disabled:opacity-50 dark:border-amber-500/40 dark:text-amber-300 dark:hover:bg-amber-500/10",
|
|
69
53
|
children: [
|
|
70
|
-
/* @__PURE__ */ e(
|
|
71
|
-
|
|
54
|
+
/* @__PURE__ */ e(F, { className: O("h-3 w-3", o.isPending && "animate-spin") }),
|
|
55
|
+
o.isPending ? "Sending…" : "Reload their tabs"
|
|
72
56
|
]
|
|
73
57
|
}
|
|
74
58
|
)
|
|
@@ -78,19 +62,58 @@ function te({ profile: d }) {
|
|
|
78
62
|
}
|
|
79
63
|
);
|
|
80
64
|
}
|
|
81
|
-
function
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
65
|
+
function ie({ profile: s }) {
|
|
66
|
+
const d = [s.first_name, s.last_name].filter(Boolean).join(" ") || s.email || "They", [l, t] = m(!1);
|
|
67
|
+
K(() => {
|
|
68
|
+
if (!l) return;
|
|
69
|
+
const o = setTimeout(() => t(!1), 4e3);
|
|
70
|
+
return () => clearTimeout(o);
|
|
71
|
+
}, [l]);
|
|
72
|
+
const u = z(s.id, d, { onDone: () => t(!1) });
|
|
73
|
+
return /* @__PURE__ */ a(
|
|
74
|
+
f,
|
|
75
|
+
{
|
|
76
|
+
icon: /* @__PURE__ */ e(R, { className: "h-4 w-4" }),
|
|
77
|
+
title: "Sign out everywhere",
|
|
78
|
+
hint: "Ends every session they have, on every app — each open tab goes back to sign-in",
|
|
79
|
+
tone: "danger",
|
|
80
|
+
testId: "sign-out-everywhere",
|
|
81
|
+
children: [
|
|
82
|
+
/* @__PURE__ */ e("div", { className: "flex flex-wrap items-center gap-2", "data-user-sign-out": !0, children: /* @__PURE__ */ a(
|
|
83
|
+
"button",
|
|
84
|
+
{
|
|
85
|
+
type: "button",
|
|
86
|
+
disabled: u.isPending,
|
|
87
|
+
onClick: () => l ? u.mutate() : t(!0),
|
|
88
|
+
onBlur: () => t(!1),
|
|
89
|
+
className: O(
|
|
90
|
+
"inline-flex h-7 items-center gap-1.5 rounded-md border px-2.5 text-[11.5px] font-medium transition-colors disabled:opacity-50",
|
|
91
|
+
l ? "border-red-600 bg-red-600 text-white hover:bg-red-700" : "border-amber-300 text-amber-800 hover:bg-amber-50 dark:border-amber-500/40 dark:text-amber-300 dark:hover:bg-amber-500/10"
|
|
92
|
+
),
|
|
93
|
+
children: [
|
|
94
|
+
/* @__PURE__ */ e(R, { className: "h-3 w-3" }),
|
|
95
|
+
u.isPending ? "Signing out…" : l ? "Confirm sign out" : "Sign them out"
|
|
96
|
+
]
|
|
97
|
+
}
|
|
98
|
+
) }),
|
|
99
|
+
/* @__PURE__ */ e("p", { className: "mt-2 text-[11.5px] text-slate-500 dark:text-slate-400", children: "They can sign in again straight away — suspend the account to keep them out. API keys and static tokens keep working." })
|
|
100
|
+
]
|
|
101
|
+
}
|
|
102
|
+
);
|
|
103
|
+
}
|
|
104
|
+
function A({
|
|
105
|
+
excludeId: s,
|
|
106
|
+
value: d,
|
|
107
|
+
label: l,
|
|
85
108
|
onPick: t
|
|
86
109
|
}) {
|
|
87
|
-
const
|
|
88
|
-
queryKey: ["nvr-offboard-user-search",
|
|
89
|
-
queryFn: () =>
|
|
90
|
-
enabled:
|
|
110
|
+
const u = C(), [o, c] = m(""), { data: h = [] } = T({
|
|
111
|
+
queryKey: ["nvr-offboard-user-search", o],
|
|
112
|
+
queryFn: () => u.request(j("/users", { search: o, limit: 8 })).then((i) => i.data),
|
|
113
|
+
enabled: o.length > 1
|
|
91
114
|
});
|
|
92
|
-
return
|
|
93
|
-
|
|
115
|
+
return d ? /* @__PURE__ */ a("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: [
|
|
116
|
+
d.name,
|
|
94
117
|
/* @__PURE__ */ e(
|
|
95
118
|
"button",
|
|
96
119
|
{
|
|
@@ -101,32 +124,32 @@ function D({
|
|
|
101
124
|
children: "✕"
|
|
102
125
|
}
|
|
103
126
|
)
|
|
104
|
-
] }) : /* @__PURE__ */
|
|
127
|
+
] }) : /* @__PURE__ */ a("div", { className: "relative", children: [
|
|
105
128
|
/* @__PURE__ */ e(
|
|
106
129
|
"input",
|
|
107
130
|
{
|
|
108
|
-
value:
|
|
109
|
-
onChange: (
|
|
110
|
-
placeholder:
|
|
131
|
+
value: o,
|
|
132
|
+
onChange: (i) => c(i.target.value),
|
|
133
|
+
placeholder: l,
|
|
111
134
|
className: "h-8 w-[260px] rounded-md border border-slate-200 bg-white px-2.5 text-[12.5px] dark:border-border dark:bg-background"
|
|
112
135
|
}
|
|
113
136
|
),
|
|
114
|
-
|
|
115
|
-
const
|
|
116
|
-
return /* @__PURE__ */
|
|
137
|
+
o.length > 1 && h.length > 0 && /* @__PURE__ */ e("div", { className: "absolute z-10 mt-1 w-[260px] rounded-md border border-slate-200 bg-white shadow-lg dark:border-border dark:bg-card", children: h.filter((i) => i.id.toUpperCase() !== s.toUpperCase()).map((i) => {
|
|
138
|
+
const p = `${i.first_name ?? ""} ${i.last_name ?? ""}`.trim() || i.email;
|
|
139
|
+
return /* @__PURE__ */ a(
|
|
117
140
|
"button",
|
|
118
141
|
{
|
|
119
142
|
type: "button",
|
|
120
143
|
onClick: () => {
|
|
121
|
-
t({ id:
|
|
144
|
+
t({ id: i.id, name: p }), c("");
|
|
122
145
|
},
|
|
123
146
|
className: "block w-full px-2.5 py-1.5 text-left text-[12.5px] text-slate-700 hover:bg-muted dark:text-foreground",
|
|
124
147
|
children: [
|
|
125
|
-
|
|
126
|
-
/* @__PURE__ */ e("span", { className: "ml-1.5 text-[11px] text-slate-400", children:
|
|
148
|
+
p,
|
|
149
|
+
/* @__PURE__ */ e("span", { className: "ml-1.5 text-[11px] text-slate-400", children: i.email })
|
|
127
150
|
]
|
|
128
151
|
},
|
|
129
|
-
|
|
152
|
+
i.id
|
|
130
153
|
);
|
|
131
154
|
}) })
|
|
132
155
|
] });
|
|
@@ -140,7 +163,7 @@ const q = {
|
|
|
140
163
|
direct_reports: "Direct reports",
|
|
141
164
|
notification_subscriptions: "Notification subscriptions",
|
|
142
165
|
field_watches: "Field watches"
|
|
143
|
-
},
|
|
166
|
+
}, J = {
|
|
144
167
|
queue_claims: "queue_claims",
|
|
145
168
|
instance_ownerships: "instance_ownerships",
|
|
146
169
|
open_tasks: "open_tasks",
|
|
@@ -150,70 +173,70 @@ const q = {
|
|
|
150
173
|
notification_subscriptions: "notification_subscriptions",
|
|
151
174
|
field_watches: "notification_subscriptions"
|
|
152
175
|
};
|
|
153
|
-
function
|
|
154
|
-
const
|
|
155
|
-
queryKey: ["nvr-offboarding",
|
|
156
|
-
queryFn: () =>
|
|
157
|
-
}),
|
|
158
|
-
mutationFn: () =>
|
|
159
|
-
|
|
160
|
-
).then((
|
|
161
|
-
onSuccess: (
|
|
162
|
-
|
|
176
|
+
function de({ profile: s }) {
|
|
177
|
+
const d = C(), l = $(s.id), [t, u] = m(null), [o, c] = m({}), [h, i] = m(!0), [p, g] = m(null), { data: n, refetch: k } = T({
|
|
178
|
+
queryKey: ["nvr-offboarding", s.id],
|
|
179
|
+
queryFn: () => d.request(j(`/offboarding/${s.id}`)).then((r) => r.data)
|
|
180
|
+
}), v = y({
|
|
181
|
+
mutationFn: () => d.request(
|
|
182
|
+
N(`/offboarding/${s.id}/run`, { successor: t == null ? void 0 : t.id, include: o, suspend: h })
|
|
183
|
+
).then((r) => r.data),
|
|
184
|
+
onSuccess: (r) => {
|
|
185
|
+
g(r), x.success("Offboarding complete"), k(), l();
|
|
163
186
|
},
|
|
164
|
-
onError: (
|
|
165
|
-
}),
|
|
187
|
+
onError: (r) => x.error(_(r, "Offboarding failed"))
|
|
188
|
+
}), D = Object.values((n == null ? void 0 : n.holdings) ?? {}).reduce((r, b) => r + b, 0), [S, L] = m("");
|
|
166
189
|
return /* @__PURE__ */ e(
|
|
167
|
-
|
|
190
|
+
f,
|
|
168
191
|
{
|
|
169
|
-
icon: /* @__PURE__ */ e(
|
|
192
|
+
icon: /* @__PURE__ */ e(H, { className: "h-4 w-4" }),
|
|
170
193
|
title: "Offboarding",
|
|
171
194
|
hint: "Hand everything they hold to a successor in one pass",
|
|
172
195
|
tone: "danger",
|
|
173
196
|
testId: "offboarding",
|
|
174
|
-
children:
|
|
175
|
-
/* @__PURE__ */ e("div", { className: "grid gap-x-6 gap-y-1 sm:grid-cols-2", children: Object.entries(
|
|
176
|
-
const
|
|
197
|
+
children: n ? /* @__PURE__ */ a("div", { className: "space-y-3", children: [
|
|
198
|
+
/* @__PURE__ */ e("div", { className: "grid gap-x-6 gap-y-1 sm:grid-cols-2", children: Object.entries(n.holdings).map(([r, b]) => {
|
|
199
|
+
const w = J[r], P = O(
|
|
177
200
|
"flex items-center gap-2 text-[12.5px]",
|
|
178
|
-
|
|
179
|
-
),
|
|
180
|
-
/* @__PURE__ */ e("span", { className: "flex-1", children: q[
|
|
181
|
-
/* @__PURE__ */ e("span", { className: "font-semibold tabular-nums", children:
|
|
201
|
+
b === 0 ? "text-slate-300 dark:text-slate-600" : "text-slate-700 dark:text-slate-200"
|
|
202
|
+
), E = /* @__PURE__ */ a(I, { children: [
|
|
203
|
+
/* @__PURE__ */ e("span", { className: "flex-1", children: q[r] ?? r }),
|
|
204
|
+
/* @__PURE__ */ e("span", { className: "font-semibold tabular-nums", children: b })
|
|
182
205
|
] });
|
|
183
|
-
return
|
|
206
|
+
return w ? /* @__PURE__ */ a("label", { className: P, children: [
|
|
184
207
|
/* @__PURE__ */ e(
|
|
185
208
|
"input",
|
|
186
209
|
{
|
|
187
210
|
type: "checkbox",
|
|
188
|
-
checked:
|
|
189
|
-
disabled:
|
|
190
|
-
onChange: (
|
|
211
|
+
checked: o[w] !== !1,
|
|
212
|
+
disabled: b === 0,
|
|
213
|
+
onChange: (B) => c((G) => ({ ...G, [w]: B.target.checked })),
|
|
191
214
|
className: "h-3.5 w-3.5"
|
|
192
215
|
}
|
|
193
216
|
),
|
|
194
|
-
|
|
195
|
-
] },
|
|
217
|
+
E
|
|
218
|
+
] }, r) : /* @__PURE__ */ a("div", { className: P, children: [
|
|
196
219
|
/* @__PURE__ */ e("span", { className: "w-3.5" }),
|
|
197
|
-
|
|
198
|
-
] },
|
|
220
|
+
E
|
|
221
|
+
] }, r);
|
|
199
222
|
}) }),
|
|
200
|
-
|
|
223
|
+
D === 0 ? /* @__PURE__ */ e(M, { children: "Nothing to hand over — this account holds no work." }) : /* @__PURE__ */ a("div", { className: "flex flex-wrap items-center gap-2.5", children: [
|
|
201
224
|
/* @__PURE__ */ e(
|
|
202
|
-
|
|
225
|
+
A,
|
|
203
226
|
{
|
|
204
|
-
excludeId:
|
|
227
|
+
excludeId: s.id,
|
|
205
228
|
value: t,
|
|
206
229
|
label: "Successor (who takes it over)…",
|
|
207
|
-
onPick:
|
|
230
|
+
onPick: u
|
|
208
231
|
}
|
|
209
232
|
),
|
|
210
|
-
/* @__PURE__ */
|
|
233
|
+
/* @__PURE__ */ a("label", { className: "flex items-center gap-1.5 text-[12px] text-slate-600 dark:text-slate-300", children: [
|
|
211
234
|
/* @__PURE__ */ e(
|
|
212
235
|
"input",
|
|
213
236
|
{
|
|
214
237
|
type: "checkbox",
|
|
215
|
-
checked:
|
|
216
|
-
onChange: (
|
|
238
|
+
checked: h,
|
|
239
|
+
onChange: (r) => i(r.target.checked),
|
|
217
240
|
className: "h-3.5 w-3.5"
|
|
218
241
|
}
|
|
219
242
|
),
|
|
@@ -223,8 +246,8 @@ function re({ profile: d }) {
|
|
|
223
246
|
t && /* @__PURE__ */ e(
|
|
224
247
|
"input",
|
|
225
248
|
{
|
|
226
|
-
value:
|
|
227
|
-
onChange: (
|
|
249
|
+
value: S,
|
|
250
|
+
onChange: (r) => L(r.target.value),
|
|
228
251
|
placeholder: "Type OFFBOARD",
|
|
229
252
|
"aria-label": "Type OFFBOARD to confirm",
|
|
230
253
|
className: "h-8 w-[150px] rounded-md border border-amber-300 bg-white px-2.5 text-[12.5px] dark:border-amber-500/40 dark:bg-background"
|
|
@@ -234,54 +257,54 @@ function re({ profile: d }) {
|
|
|
234
257
|
"button",
|
|
235
258
|
{
|
|
236
259
|
type: "button",
|
|
237
|
-
disabled: !t ||
|
|
238
|
-
onClick: () =>
|
|
260
|
+
disabled: !t || S !== "OFFBOARD" || v.isPending,
|
|
261
|
+
onClick: () => v.mutate(),
|
|
239
262
|
className: "h-8 rounded-md bg-amber-500 px-4 text-[12.5px] font-semibold text-white hover:bg-amber-600 disabled:opacity-50",
|
|
240
|
-
children:
|
|
263
|
+
children: v.isPending ? "Reassigning…" : "Run offboarding"
|
|
241
264
|
}
|
|
242
265
|
)
|
|
243
266
|
] }),
|
|
244
|
-
|
|
267
|
+
p && /* @__PURE__ */ a("p", { className: "rounded-md bg-emerald-50 px-3 py-2 text-[12px] text-emerald-700 dark:bg-emerald-500/10 dark:text-emerald-400", children: [
|
|
245
268
|
"Done:",
|
|
246
269
|
" ",
|
|
247
|
-
Object.entries(
|
|
270
|
+
Object.entries(p).map(([r, b]) => `${(q[r] ?? r).toLowerCase()} ${b}`).join(" · ")
|
|
248
271
|
] })
|
|
249
|
-
] }) : /* @__PURE__ */ e(
|
|
272
|
+
] }) : /* @__PURE__ */ e(M, { children: "Loading what they hold…" })
|
|
250
273
|
}
|
|
251
274
|
);
|
|
252
275
|
}
|
|
253
|
-
function
|
|
254
|
-
const
|
|
255
|
-
mutationFn: () =>
|
|
256
|
-
|
|
257
|
-
).then((
|
|
258
|
-
onSuccess: (
|
|
259
|
-
onError: (
|
|
260
|
-
}),
|
|
261
|
-
mutationFn: () =>
|
|
276
|
+
function le({ profile: s }) {
|
|
277
|
+
const d = C(), l = $(s.id), [t, u] = m(null), [o, c] = m(null), [h, i] = m(""), p = y({
|
|
278
|
+
mutationFn: () => d.request(
|
|
279
|
+
N(`/offboarding/${s.id}/merge`, { into: t == null ? void 0 : t.id, dry_run: !0 })
|
|
280
|
+
).then((n) => n.data),
|
|
281
|
+
onSuccess: (n) => c(n.references),
|
|
282
|
+
onError: (n) => x.error(_(n, "Preview failed"))
|
|
283
|
+
}), g = y({
|
|
284
|
+
mutationFn: () => d.request(N(`/offboarding/${s.id}/merge`, { into: t == null ? void 0 : t.id })),
|
|
262
285
|
onSuccess: () => {
|
|
263
|
-
x.success("Accounts merged — the duplicate is suspended"),
|
|
286
|
+
x.success("Accounts merged — the duplicate is suspended"), c(null), i(""), l();
|
|
264
287
|
},
|
|
265
|
-
onError: (
|
|
288
|
+
onError: (n) => x.error(_(n, "Merge failed"))
|
|
266
289
|
});
|
|
267
290
|
return /* @__PURE__ */ e(
|
|
268
|
-
|
|
291
|
+
f,
|
|
269
292
|
{
|
|
270
293
|
icon: /* @__PURE__ */ e(U, { className: "h-4 w-4" }),
|
|
271
294
|
title: "Merge into another account",
|
|
272
295
|
hint: "For duplicate or legacy twins: every reference moves to the survivor, then this account is suspended",
|
|
273
296
|
tone: "danger",
|
|
274
297
|
testId: "merge",
|
|
275
|
-
children: /* @__PURE__ */
|
|
276
|
-
/* @__PURE__ */
|
|
298
|
+
children: /* @__PURE__ */ a("div", { className: "space-y-3", children: [
|
|
299
|
+
/* @__PURE__ */ a("div", { className: "flex flex-wrap items-center gap-2.5", children: [
|
|
277
300
|
/* @__PURE__ */ e(
|
|
278
|
-
|
|
301
|
+
A,
|
|
279
302
|
{
|
|
280
|
-
excludeId:
|
|
303
|
+
excludeId: s.id,
|
|
281
304
|
value: t,
|
|
282
305
|
label: "Survivor account (keeps everything)…",
|
|
283
|
-
onPick: (
|
|
284
|
-
|
|
306
|
+
onPick: (n) => {
|
|
307
|
+
u(n), c(null);
|
|
285
308
|
}
|
|
286
309
|
}
|
|
287
310
|
),
|
|
@@ -289,31 +312,31 @@ function ne({ profile: d }) {
|
|
|
289
312
|
"button",
|
|
290
313
|
{
|
|
291
314
|
type: "button",
|
|
292
|
-
disabled: !t ||
|
|
293
|
-
onClick: () =>
|
|
315
|
+
disabled: !t || p.isPending,
|
|
316
|
+
onClick: () => p.mutate(),
|
|
294
317
|
className: "h-8 rounded-md border border-slate-200 px-3 text-[12.5px] font-medium text-slate-600 hover:bg-slate-50 disabled:opacity-50 dark:border-border dark:text-slate-300 dark:hover:bg-muted",
|
|
295
|
-
children:
|
|
318
|
+
children: p.isPending ? "Scanning…" : "Preview references"
|
|
296
319
|
}
|
|
297
320
|
)
|
|
298
321
|
] }),
|
|
299
|
-
|
|
300
|
-
/* @__PURE__ */ e("div", { className: "max-h-[220px] overflow-y-auto rounded-md border border-slate-100 dark:border-border/60", children: Object.keys(
|
|
322
|
+
o && /* @__PURE__ */ a(I, { children: [
|
|
323
|
+
/* @__PURE__ */ e("div", { className: "max-h-[220px] overflow-y-auto rounded-md border border-slate-100 dark:border-border/60", children: Object.keys(o).length === 0 ? /* @__PURE__ */ e("p", { className: "px-3 py-2 text-[12px] text-slate-400", children: "Nothing references this account." }) : Object.entries(o).map(([n, k]) => /* @__PURE__ */ a(
|
|
301
324
|
"div",
|
|
302
325
|
{
|
|
303
326
|
className: "flex items-center justify-between border-b border-slate-50 px-3 py-1 text-[12px] last:border-0 dark:border-border/40",
|
|
304
327
|
children: [
|
|
305
|
-
/* @__PURE__ */ e("span", { className: "font-mono text-slate-600 dark:text-slate-300", children:
|
|
306
|
-
/* @__PURE__ */ e("span", { className: "font-semibold tabular-nums text-slate-700 dark:text-slate-200", children:
|
|
328
|
+
/* @__PURE__ */ e("span", { className: "font-mono text-slate-600 dark:text-slate-300", children: n }),
|
|
329
|
+
/* @__PURE__ */ e("span", { className: "font-semibold tabular-nums text-slate-700 dark:text-slate-200", children: k })
|
|
307
330
|
]
|
|
308
331
|
},
|
|
309
|
-
|
|
332
|
+
n
|
|
310
333
|
)) }),
|
|
311
|
-
/* @__PURE__ */
|
|
334
|
+
/* @__PURE__ */ a("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
312
335
|
/* @__PURE__ */ e(
|
|
313
336
|
"input",
|
|
314
337
|
{
|
|
315
|
-
value:
|
|
316
|
-
onChange: (
|
|
338
|
+
value: h,
|
|
339
|
+
onChange: (n) => i(n.target.value),
|
|
317
340
|
placeholder: "Type MERGE to confirm",
|
|
318
341
|
"aria-label": "Type MERGE to confirm",
|
|
319
342
|
className: "h-8 w-[180px] rounded-md border border-amber-300 bg-white px-2.5 text-[12.5px] dark:border-amber-500/40 dark:bg-background"
|
|
@@ -323,10 +346,10 @@ function ne({ profile: d }) {
|
|
|
323
346
|
"button",
|
|
324
347
|
{
|
|
325
348
|
type: "button",
|
|
326
|
-
disabled:
|
|
327
|
-
onClick: () =>
|
|
349
|
+
disabled: h !== "MERGE" || g.isPending,
|
|
350
|
+
onClick: () => g.mutate(),
|
|
328
351
|
className: "h-8 rounded-md bg-amber-500 px-4 text-[12.5px] font-semibold text-white hover:bg-amber-600 disabled:opacity-50",
|
|
329
|
-
children:
|
|
352
|
+
children: g.isPending ? "Merging…" : `Merge into ${(t == null ? void 0 : t.name) ?? ""}`
|
|
330
353
|
}
|
|
331
354
|
)
|
|
332
355
|
] })
|
|
@@ -336,8 +359,9 @@ function ne({ profile: d }) {
|
|
|
336
359
|
);
|
|
337
360
|
}
|
|
338
361
|
export {
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
362
|
+
oe as ForceReloadCard,
|
|
363
|
+
le as MergeCard,
|
|
364
|
+
de as OffboardingCard,
|
|
365
|
+
ie as SignOutEverywhereCard,
|
|
366
|
+
A as UserPicker
|
|
343
367
|
};
|