@burdenoff/microfe-auth 2026.1031.1 → 2026.1101.1
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/auth/AuthRoot.js +14 -11
- package/dist/auth/AuthRoot.js.map +1 -1
- package/dist/auth/AuthRoutes.js +1 -2
- package/dist/auth/AuthRoutes.js.map +1 -1
- package/dist/auth/components/AuthIcons.js +1 -2
- package/dist/auth/components/AuthIcons.js.map +1 -1
- package/dist/auth/components/AuthLayout.js +1 -2
- package/dist/auth/components/AuthLayout.js.map +1 -1
- package/dist/auth/components/CaptchaV2.js +9 -10
- package/dist/auth/components/CaptchaV2.js.map +1 -1
- package/dist/auth/components/ConfirmActionDialog.js +1 -2
- package/dist/auth/components/ConfirmActionDialog.js.map +1 -1
- package/dist/auth/components/profile/UserProfileMenu.js +7 -6
- package/dist/auth/components/profile/UserProfileMenu.js.map +1 -1
- package/dist/auth/components/workspace/WorkspaceSelector.js +1 -2
- package/dist/auth/components/workspace/WorkspaceSelector.js.map +1 -1
- package/dist/auth/constants/permissions.js +1 -2
- package/dist/auth/constants/permissions.js.map +1 -1
- package/dist/auth/constants/sessionKeys.js +1 -2
- package/dist/auth/constants/sessionKeys.js.map +1 -1
- package/dist/auth/hooks/contextDeepLink.js +1 -2
- package/dist/auth/hooks/contextDeepLink.js.map +1 -1
- package/dist/auth/hooks/index.js +12 -11
- package/dist/auth/hooks/useAccountOperations.js +1 -2
- package/dist/auth/hooks/useAccountOperations.js.map +1 -1
- package/dist/auth/hooks/useActiveContextBootstrapMirror.js +1 -2
- package/dist/auth/hooks/useActiveContextBootstrapMirror.js.map +1 -1
- package/dist/auth/hooks/useAuthOperations.js +37 -37
- package/dist/auth/hooks/useAuthOperations.js.map +1 -1
- package/dist/auth/hooks/useAuthPermissions.js +1 -2
- package/dist/auth/hooks/useAuthPermissions.js.map +1 -1
- package/dist/auth/hooks/useCaptchaV3.js +1 -2
- package/dist/auth/hooks/useCaptchaV3.js.map +1 -1
- package/dist/auth/hooks/useContextSwitcherData.js +81 -78
- package/dist/auth/hooks/useContextSwitcherData.js.map +1 -1
- package/dist/auth/hooks/useMfaOperations.js +4 -5
- package/dist/auth/hooks/useMfaOperations.js.map +1 -1
- package/dist/auth/hooks/useMyWorkspaces.js +4 -5
- package/dist/auth/hooks/useMyWorkspaces.js.map +1 -1
- package/dist/auth/hooks/useOAuthOperations.js +11 -12
- package/dist/auth/hooks/useOAuthOperations.js.map +1 -1
- package/dist/auth/hooks/usePasswordOperations.js +1 -2
- package/dist/auth/hooks/usePasswordOperations.js.map +1 -1
- package/dist/auth/hooks/useSessionOperations.js +3 -4
- package/dist/auth/hooks/useSessionOperations.js.map +1 -1
- package/dist/auth/hooks/useSignupCaptcha.js +1 -2
- package/dist/auth/hooks/useSignupCaptcha.js.map +1 -1
- package/dist/auth/hooks/useSsoOperations.js +80 -81
- package/dist/auth/hooks/useSsoOperations.js.map +1 -1
- package/dist/auth/hooks/useTokenRefresh.js +8 -12
- package/dist/auth/hooks/useTokenRefresh.js.map +1 -1
- package/dist/auth/hooks/useUserOperations.js +1 -2
- package/dist/auth/hooks/useUserOperations.js.map +1 -1
- package/dist/auth/hooks/useWorkspaceOperations.js +1 -2
- package/dist/auth/hooks/useWorkspaceOperations.js.map +1 -1
- package/dist/auth/hooks/useWorkspaceToken.js +1 -2
- package/dist/auth/hooks/useWorkspaceToken.js.map +1 -1
- package/dist/auth/index.js +19 -18
- package/dist/auth/pages/AuditLogPage.js +21 -22
- package/dist/auth/pages/AuditLogPage.js.map +1 -1
- package/dist/auth/pages/EmailVerifyPage.js +15 -17
- package/dist/auth/pages/EmailVerifyPage.js.map +1 -1
- package/dist/auth/pages/LoginPage.js +89 -105
- package/dist/auth/pages/LoginPage.js.map +1 -1
- package/dist/auth/pages/MagicLinkPage.js +30 -31
- package/dist/auth/pages/MagicLinkPage.js.map +1 -1
- package/dist/auth/pages/MfaSetupPage.js +18 -20
- package/dist/auth/pages/MfaSetupPage.js.map +1 -1
- package/dist/auth/pages/MfaVerifyPage.js +31 -35
- package/dist/auth/pages/MfaVerifyPage.js.map +1 -1
- package/dist/auth/pages/OAuthCallbackPage.js +4 -11
- package/dist/auth/pages/OAuthCallbackPage.js.map +1 -1
- package/dist/auth/pages/PasswordResetPage.js +20 -23
- package/dist/auth/pages/PasswordResetPage.js.map +1 -1
- package/dist/auth/pages/ReactivatePage.js +14 -18
- package/dist/auth/pages/ReactivatePage.js.map +1 -1
- package/dist/auth/pages/RegisterPage.js +180 -181
- package/dist/auth/pages/RegisterPage.js.map +1 -1
- package/dist/auth/pages/SSOClearPage.js +9 -10
- package/dist/auth/pages/SSOClearPage.js.map +1 -1
- package/dist/auth/pages/SSODepositPage.js +9 -13
- package/dist/auth/pages/SSODepositPage.js.map +1 -1
- package/dist/auth/pages/SSORelayCallbackPage.js +3 -7
- package/dist/auth/pages/SSORelayCallbackPage.js.map +1 -1
- package/dist/auth/pages/SSORelayPage.js +11 -10
- package/dist/auth/pages/SSORelayPage.js.map +1 -1
- package/dist/auth/pages/SecurityPage.js +19 -21
- package/dist/auth/pages/SecurityPage.js.map +1 -1
- package/dist/auth/pages/SessionBridgePage.js +9 -16
- package/dist/auth/pages/SessionBridgePage.js.map +1 -1
- package/dist/auth/pages/SessionsPage.js +17 -18
- package/dist/auth/pages/SessionsPage.js.map +1 -1
- package/dist/auth/pages/SsoCallbackPage.js +17 -22
- package/dist/auth/pages/SsoCallbackPage.js.map +1 -1
- package/dist/auth/pages/SsoConfigPage.js +69 -69
- package/dist/auth/pages/SsoConfigPage.js.map +1 -1
- package/dist/auth/pages/SsoLoginPage.js +9 -10
- package/dist/auth/pages/SsoLoginPage.js.map +1 -1
- package/dist/auth/pages/UserDetailsPage.js +16 -23
- package/dist/auth/pages/UserDetailsPage.js.map +1 -1
- package/dist/auth/pages/UserProfilePage.js +140 -141
- package/dist/auth/pages/UserProfilePage.js.map +1 -1
- package/dist/auth/pages/UsersPage.js +446 -453
- package/dist/auth/pages/UsersPage.js.map +1 -1
- package/dist/auth/providers/AuthProvider.js +1 -2
- package/dist/auth/providers/AuthProvider.js.map +1 -1
- package/dist/auth/providers/CaptchaProvider.js +1 -2
- package/dist/auth/providers/CaptchaProvider.js.map +1 -1
- package/dist/auth/store/authStore.js +5 -12
- package/dist/auth/store/authStore.js.map +1 -1
- package/dist/auth/utils/captchaConfig.js +5 -8
- package/dist/auth/utils/captchaConfig.js.map +1 -1
- package/dist/auth/utils/formatters.js +1 -2
- package/dist/auth/utils/formatters.js.map +1 -1
- package/dist/auth/utils/gatewayBaseUrls.js +1 -2
- package/dist/auth/utils/gatewayBaseUrls.js.map +1 -1
- package/dist/auth/utils/legalUrls.js +2 -3
- package/dist/auth/utils/legalUrls.js.map +1 -1
- package/dist/auth/utils/redirect.js +1 -2
- package/dist/auth/utils/redirect.js.map +1 -1
- package/dist/auth/utils/ssoOrigins.js +2 -3
- package/dist/auth/utils/ssoOrigins.js.map +1 -1
- package/dist/auth/utils/validation.js +34 -36
- package/dist/auth/utils/validation.js.map +1 -1
- package/dist/generated/global-operations.js +2 -3
- package/dist/generated/global-operations.js.map +1 -1
- package/dist/generated/wspace-operations.js +2 -3
- package/dist/generated/wspace-operations.js.map +1 -1
- package/dist/microfe-auth.css +1 -1
- package/dist/shared/hooks/useTr.js +1 -2
- package/dist/shared/hooks/useTr.js.map +1 -1
- package/dist/translations/en.js +1 -2
- package/dist/translations/en.js.map +1 -1
- package/dist/utils/nativeBridge.js +1 -2
- package/package.json +7 -3
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { useTr as e } from "../../shared/hooks/useTr.js";
|
|
2
|
+
import { useAuthPermissions as t } from "../hooks/useAuthPermissions.js";
|
|
3
|
+
import { useUserOperations as n } from "../hooks/useUserOperations.js";
|
|
4
|
+
import { validatePhoneNumber as r, validateUserFields as i } from "../utils/validation.js";
|
|
5
|
+
import { useAuthStore as a } from "../store/authStore.js";
|
|
6
6
|
import { ConfirmActionDialog as o } from "../components/ConfirmActionDialog.js";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { useCallback as
|
|
10
|
-
import { useNavigate as
|
|
11
|
-
import { Fragment as
|
|
12
|
-
import { Button as
|
|
13
|
-
import { EmphasisPanel as
|
|
14
|
-
|
|
15
|
-
var
|
|
7
|
+
import { AlertIcon as s, SpinnerIcon as c } from "../components/AuthIcons.js";
|
|
8
|
+
import { nativeImpact as ee, nativeNotify as l } from "../../utils/nativeBridge.js";
|
|
9
|
+
import { useCallback as te, useEffect as ne, useId as u, useState as d } from "react";
|
|
10
|
+
import { useNavigate as re } from "react-router";
|
|
11
|
+
import { Fragment as f, jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
12
|
+
import { Button as h } from "@burdenoff/fe-libs/button";
|
|
13
|
+
import { EmphasisPanel as ie, IllustratedEmptyState as g, NextSteps as ae, PagePurpose as oe } from "@burdenoff/fe-libs/ui";
|
|
14
|
+
// src/auth/pages/UsersPage.tsx
|
|
15
|
+
var _ = [
|
|
16
16
|
"TENANT_ADMIN",
|
|
17
17
|
"ORG_ADMIN",
|
|
18
18
|
"WORKSPACE_ADMIN",
|
|
19
19
|
"MEMBER",
|
|
20
20
|
"GUEST"
|
|
21
|
-
],
|
|
21
|
+
], v = [
|
|
22
22
|
"ACTIVE",
|
|
23
23
|
"INACTIVE",
|
|
24
24
|
"SUSPENDED",
|
|
25
25
|
"DELETED"
|
|
26
26
|
];
|
|
27
|
-
function
|
|
28
|
-
let
|
|
29
|
-
|
|
27
|
+
function y() {
|
|
28
|
+
let y = e(), se = re(), b = a((e) => e.isAuthenticated), ce = a((e) => e.user), { canViewUsers: le, canUpdateUsers: ue, canDeleteUsers: x, isLoading: de } = t(), { listUsers: S, updateUser: fe, deleteUser: pe, hardDeleteUser: me, isLoading: C } = n(), w = u(), he = u(), ge = u(), _e = u(), ve = u(), [T, E] = d(!1), D = async () => {
|
|
29
|
+
E(!0);
|
|
30
30
|
try {
|
|
31
31
|
let e = {};
|
|
32
|
-
|
|
33
|
-
let t = (await
|
|
32
|
+
G && (e.search = G), K && (e.role = K), q && (e.status = q);
|
|
33
|
+
let t = (await S(e, {
|
|
34
34
|
offset: 0,
|
|
35
35
|
limit: 1e4
|
|
36
36
|
})).users, n = [
|
|
@@ -66,11 +66,11 @@ function v() {
|
|
|
66
66
|
].join(","))], a = new Blob([i.join("\n")], { type: "text/csv;charset=utf-8;" }), o = URL.createObjectURL(a), s = document.createElement("a");
|
|
67
67
|
s.href = o, s.download = `users-${(/* @__PURE__ */ new Date()).toISOString().slice(0, 10)}.csv`, s.click(), URL.revokeObjectURL(o);
|
|
68
68
|
} catch (e) {
|
|
69
|
-
|
|
69
|
+
L(e instanceof Error ? e.message : "Failed to export users");
|
|
70
70
|
} finally {
|
|
71
|
-
|
|
71
|
+
E(!1);
|
|
72
72
|
}
|
|
73
|
-
}, [
|
|
73
|
+
}, [O, ye] = d([]), [k, be] = d(0), [xe, Se] = d(!1), [A, j] = d("list"), [M, N] = d(null), [P, F] = d({
|
|
74
74
|
username: "",
|
|
75
75
|
firstName: "",
|
|
76
76
|
lastName: "",
|
|
@@ -79,34 +79,34 @@ function v() {
|
|
|
79
79
|
role: "MEMBER",
|
|
80
80
|
status: "ACTIVE",
|
|
81
81
|
emailVerified: !1
|
|
82
|
-
}), [
|
|
83
|
-
if (
|
|
84
|
-
|
|
82
|
+
}), [I, L] = d(null), [R, z] = d(null), [Ce, B] = d(!1), [V, H] = d(null), [U, W] = d(null), [G, we] = d(""), [K, Te] = d(""), [q, Ee] = d(""), [J, Y] = d(0), X = te(async () => {
|
|
83
|
+
if (b) try {
|
|
84
|
+
B(!1);
|
|
85
85
|
let e = {};
|
|
86
|
-
|
|
87
|
-
let t =
|
|
88
|
-
offset:
|
|
86
|
+
G && (e.search = G), K && (e.role = K), q && (e.status = q);
|
|
87
|
+
let t = {
|
|
88
|
+
offset: J * 10,
|
|
89
89
|
limit: 10
|
|
90
|
-
});
|
|
91
|
-
|
|
90
|
+
}, n = await S(e, t);
|
|
91
|
+
ye(n.users), be(n.totalCount), Se(n.hasMore), L(null);
|
|
92
92
|
} catch (e) {
|
|
93
93
|
if (e instanceof Error && (e.name === "AbortError" || e.message.includes("aborted"))) return;
|
|
94
94
|
let t = e instanceof Error ? e.message : "Failed to fetch users";
|
|
95
|
-
t.toLowerCase().includes("not authorized") || t.toLowerCase().includes("forbidden") ? (
|
|
95
|
+
t.toLowerCase().includes("not authorized") || t.toLowerCase().includes("forbidden") ? (B(!0), L(null)) : L(t);
|
|
96
96
|
}
|
|
97
97
|
}, [
|
|
98
|
-
|
|
98
|
+
S,
|
|
99
|
+
G,
|
|
99
100
|
K,
|
|
100
101
|
q,
|
|
101
102
|
J,
|
|
102
|
-
|
|
103
|
-
y
|
|
103
|
+
b
|
|
104
104
|
]);
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
}, [
|
|
108
|
-
let
|
|
109
|
-
|
|
105
|
+
ne(() => {
|
|
106
|
+
X();
|
|
107
|
+
}, [X]);
|
|
108
|
+
let Z = () => {
|
|
109
|
+
F({
|
|
110
110
|
username: "",
|
|
111
111
|
firstName: "",
|
|
112
112
|
lastName: "",
|
|
@@ -115,50 +115,50 @@ function v() {
|
|
|
115
115
|
role: "MEMBER",
|
|
116
116
|
status: "ACTIVE",
|
|
117
117
|
emailVerified: !1
|
|
118
|
-
}),
|
|
119
|
-
},
|
|
120
|
-
if (e.preventDefault(), !
|
|
121
|
-
if (
|
|
122
|
-
let e =
|
|
123
|
-
|
|
124
|
-
return;
|
|
125
|
-
}
|
|
126
|
-
let t = te(F, { requireAll: !1 });
|
|
127
|
-
if (!t.valid) {
|
|
128
|
-
R(t.errors.map((e) => v(`auth.users.${e.field}_${e.code}`, e.message)).join(" · "));
|
|
118
|
+
}), N(null), L(null), z(null), H(null);
|
|
119
|
+
}, De = async (e) => {
|
|
120
|
+
if (e.preventDefault(), !M) return;
|
|
121
|
+
if (L(null), z(null), !r(P.phoneNumber).valid) {
|
|
122
|
+
let e = y("auth.users.phoneNumber_invalid", "Invalid phone number");
|
|
123
|
+
z(e), L(e);
|
|
129
124
|
return;
|
|
130
125
|
}
|
|
131
|
-
|
|
132
|
-
|
|
126
|
+
let t = i(P, { requireAll: !1 });
|
|
127
|
+
if (!t.valid) L(t.errors.map((e) => {
|
|
128
|
+
let t = `auth.users.${e.field}_${e.code}`;
|
|
129
|
+
return y(t, e.message);
|
|
130
|
+
}).join(" · "));
|
|
131
|
+
else try {
|
|
132
|
+
await fe(M.id, {
|
|
133
133
|
username: t.values.username || void 0,
|
|
134
134
|
firstName: t.values.firstName || void 0,
|
|
135
135
|
lastName: t.values.lastName || void 0,
|
|
136
|
-
name:
|
|
137
|
-
phoneNumber:
|
|
138
|
-
role:
|
|
139
|
-
status:
|
|
140
|
-
emailVerified:
|
|
141
|
-
}),
|
|
136
|
+
name: P.name || void 0,
|
|
137
|
+
phoneNumber: P.phoneNumber || void 0,
|
|
138
|
+
role: P.role,
|
|
139
|
+
status: P.status,
|
|
140
|
+
emailVerified: P.emailVerified
|
|
141
|
+
}), H(y("auth.users.updateSuccess", "User updated successfully!")), j("list"), Z(), X();
|
|
142
142
|
} catch (e) {
|
|
143
|
-
|
|
143
|
+
L(e instanceof Error ? e.message : "Failed to update user");
|
|
144
144
|
}
|
|
145
|
-
},
|
|
146
|
-
|
|
145
|
+
}, Oe = async (e) => {
|
|
146
|
+
ee("medium");
|
|
147
147
|
try {
|
|
148
|
-
let t = await
|
|
149
|
-
t.success ? (
|
|
148
|
+
let t = await pe(e.id);
|
|
149
|
+
t.success ? (l("success"), H(y("auth.users.userDeactivated", "User \"{email}\" has been deactivated.").replace("{email}", e.email)), W(null), X()) : (l("error"), L(t.message));
|
|
150
150
|
} catch (e) {
|
|
151
|
-
|
|
151
|
+
l("error"), L(e instanceof Error ? e.message : "Failed to delete user");
|
|
152
152
|
}
|
|
153
|
-
},
|
|
153
|
+
}, ke = async (e) => {
|
|
154
154
|
try {
|
|
155
|
-
let t = await
|
|
156
|
-
t.success ? (
|
|
155
|
+
let t = await me(e.id);
|
|
156
|
+
t.success ? (H(y("auth.users.userPermanentlyDeleted", "User \"{email}\" has been permanently deleted.").replace("{email}", e.email)), W(null), X()) : L(t.message);
|
|
157
157
|
} catch (e) {
|
|
158
|
-
|
|
158
|
+
L(e instanceof Error ? e.message : "Failed to hard delete user");
|
|
159
159
|
}
|
|
160
|
-
},
|
|
161
|
-
|
|
160
|
+
}, Ae = (e) => {
|
|
161
|
+
N(e), F({
|
|
162
162
|
username: e.username || "",
|
|
163
163
|
firstName: e.firstName || "",
|
|
164
164
|
lastName: e.lastName || "",
|
|
@@ -167,26 +167,20 @@ function v() {
|
|
|
167
167
|
role: e.role,
|
|
168
168
|
status: e.status,
|
|
169
169
|
emailVerified: e.emailVerified
|
|
170
|
-
}),
|
|
171
|
-
},
|
|
172
|
-
open:
|
|
170
|
+
}), j("edit"), L(null);
|
|
171
|
+
}, Q = /* @__PURE__ */ p(o, {
|
|
172
|
+
open: U !== null,
|
|
173
173
|
onOpenChange: (e) => {
|
|
174
|
-
e ||
|
|
174
|
+
e || W(null);
|
|
175
175
|
},
|
|
176
|
-
title:
|
|
177
|
-
description:
|
|
178
|
-
confirmText:
|
|
179
|
-
variant:
|
|
176
|
+
title: U?.type === "hard-delete" ? y("auth.users.hardDeleteTitle", "Permanently delete user?") : y("auth.users.deactivateTitle", "Deactivate user?"),
|
|
177
|
+
description: U?.type === "hard-delete" ? U ? y("auth.users.hardDeleteDesc", "This permanently deletes \"{email}\" and cannot be undone.").replace("{email}", U.user.email) : "" : U ? y("auth.users.deactivateDesc", "\"{email}\" will be prevented from signing in until reactivated.").replace("{email}", U.user.email) : "",
|
|
178
|
+
confirmText: U?.type === "hard-delete" ? y("auth.users.hardDeleteConfirm", "Delete permanently") : y("auth.users.deactivateConfirm", "Deactivate user"),
|
|
179
|
+
variant: U?.type === "hard-delete" ? "danger" : "warning",
|
|
180
180
|
onConfirm: async () => {
|
|
181
|
-
|
|
182
|
-
if (W.type === "hard-delete") {
|
|
183
|
-
await Oe(W.user);
|
|
184
|
-
return;
|
|
185
|
-
}
|
|
186
|
-
await De(W.user);
|
|
187
|
-
}
|
|
181
|
+
U && (U.type === "hard-delete" ? await ke(U.user) : await Oe(U.user));
|
|
188
182
|
}
|
|
189
|
-
}),
|
|
183
|
+
}), je = (e) => {
|
|
190
184
|
switch (e) {
|
|
191
185
|
case "SUPER_ADMIN": return "bg-accent-purple-subtle text-accent-purple";
|
|
192
186
|
case "TENANT_ADMIN": return "bg-status-info-bg-subtle text-status-info-text";
|
|
@@ -196,7 +190,7 @@ function v() {
|
|
|
196
190
|
case "GUEST": return "bg-bg-sunken text-text-primary";
|
|
197
191
|
default: return "bg-bg-sunken text-text-primary";
|
|
198
192
|
}
|
|
199
|
-
},
|
|
193
|
+
}, $ = (e) => {
|
|
200
194
|
switch (e) {
|
|
201
195
|
case "ACTIVE": return "bg-status-success-bg-subtle text-status-success-text";
|
|
202
196
|
case "INACTIVE": return "bg-status-warning-bg-subtle text-status-warning-text";
|
|
@@ -205,193 +199,193 @@ function v() {
|
|
|
205
199
|
default: return "bg-bg-sunken text-text-primary";
|
|
206
200
|
}
|
|
207
201
|
};
|
|
208
|
-
return
|
|
202
|
+
return b ? de ? /* @__PURE__ */ p("div", {
|
|
209
203
|
className: "max-w-6xl mx-auto p-6",
|
|
210
|
-
children: /* @__PURE__ */
|
|
204
|
+
children: /* @__PURE__ */ m("div", {
|
|
211
205
|
className: "text-center py-16",
|
|
212
|
-
children: [/* @__PURE__ */
|
|
206
|
+
children: [/* @__PURE__ */ p(c, { className: "size-8 mx-auto text-text-secondary animate-spin" }), /* @__PURE__ */ p("p", {
|
|
213
207
|
className: "mt-4 text-text-secondary",
|
|
214
|
-
children:
|
|
208
|
+
children: y("auth.users.loadingPermissions", "Loading permissions...")
|
|
215
209
|
})]
|
|
216
210
|
})
|
|
217
|
-
}) : !
|
|
211
|
+
}) : !le || Ce ? /* @__PURE__ */ p("div", {
|
|
218
212
|
className: "max-w-6xl mx-auto p-6",
|
|
219
|
-
children: /* @__PURE__ */
|
|
213
|
+
children: /* @__PURE__ */ p(g, {
|
|
220
214
|
illustration: "empty-generic",
|
|
221
|
-
title:
|
|
222
|
-
description: /* @__PURE__ */
|
|
223
|
-
|
|
215
|
+
title: y("auth.users.adminAccessRequired", "Admin Access Required"),
|
|
216
|
+
description: /* @__PURE__ */ m(f, { children: [
|
|
217
|
+
y("auth.users.adminAccessDesc", "You need administrator privileges to view and manage users."),
|
|
224
218
|
" ",
|
|
225
|
-
|
|
219
|
+
y("auth.users.requiredRoles", "Required roles: Super Admin, Tenant Admin, or Org Admin")
|
|
226
220
|
] })
|
|
227
221
|
})
|
|
228
|
-
}) :
|
|
222
|
+
}) : A === "list" ? /* @__PURE__ */ m("div", {
|
|
229
223
|
className: "max-w-6xl mx-auto p-6",
|
|
230
224
|
children: [
|
|
231
|
-
|
|
232
|
-
/* @__PURE__ */
|
|
225
|
+
Q,
|
|
226
|
+
/* @__PURE__ */ m("div", {
|
|
233
227
|
className: "flex items-center justify-between mb-8",
|
|
234
|
-
children: [/* @__PURE__ */
|
|
228
|
+
children: [/* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("h1", {
|
|
235
229
|
className: "text-3xl font-semibold text-text-primary",
|
|
236
|
-
children:
|
|
237
|
-
}), /* @__PURE__ */
|
|
230
|
+
children: y("auth.users.title", "Users")
|
|
231
|
+
}), /* @__PURE__ */ m("p", {
|
|
238
232
|
className: "text-text-secondary mt-2",
|
|
239
233
|
children: [
|
|
240
|
-
|
|
234
|
+
y("auth.users.subtitle", "Manage users in your organization"),
|
|
241
235
|
" (",
|
|
242
|
-
|
|
236
|
+
k,
|
|
243
237
|
" ",
|
|
244
|
-
|
|
238
|
+
y("auth.users.paginationUsers", "total"),
|
|
245
239
|
")"
|
|
246
240
|
]
|
|
247
|
-
})] }), /* @__PURE__ */
|
|
241
|
+
})] }), /* @__PURE__ */ p("button", {
|
|
248
242
|
type: "button",
|
|
249
|
-
onClick: () => void
|
|
250
|
-
disabled:
|
|
251
|
-
"aria-label":
|
|
243
|
+
onClick: () => void D(),
|
|
244
|
+
disabled: T,
|
|
245
|
+
"aria-label": y("auth.users.exportAriaLabel", "Export user list"),
|
|
252
246
|
className: "flex items-center gap-2 px-4 py-2.5 rounded-xl border border-border-default text-text-primary bg-bg-surface hover:bg-bg-sunken disabled:opacity-50 disabled:cursor-not-allowed transition-colors font-medium",
|
|
253
|
-
children:
|
|
247
|
+
children: T ? /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p(c, {
|
|
254
248
|
className: "size-4 animate-spin",
|
|
255
249
|
"aria-hidden": "true"
|
|
256
|
-
}),
|
|
250
|
+
}), y("auth.users.exporting", "Exporting...")] }) : /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p("svg", {
|
|
257
251
|
className: "size-4",
|
|
258
252
|
fill: "none",
|
|
259
253
|
viewBox: "0 0 24 24",
|
|
260
254
|
stroke: "currentColor",
|
|
261
255
|
"aria-hidden": "true",
|
|
262
|
-
children: /* @__PURE__ */
|
|
256
|
+
children: /* @__PURE__ */ p("path", {
|
|
263
257
|
strokeLinecap: "round",
|
|
264
258
|
strokeLinejoin: "round",
|
|
265
259
|
strokeWidth: 2,
|
|
266
260
|
d: "M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4"
|
|
267
261
|
})
|
|
268
|
-
}),
|
|
262
|
+
}), y("auth.users.export", "Export")] })
|
|
269
263
|
})]
|
|
270
264
|
}),
|
|
271
|
-
/* @__PURE__ */
|
|
265
|
+
/* @__PURE__ */ p(oe, {
|
|
272
266
|
className: "mb-6",
|
|
273
|
-
children:
|
|
267
|
+
children: y("auth.users.purpose", "Manage everyone with access to your organization. Search and filter accounts, review their role and status, edit details, or deactivate people who should no longer have access.")
|
|
274
268
|
}),
|
|
275
|
-
/* @__PURE__ */
|
|
269
|
+
/* @__PURE__ */ m(ie, {
|
|
276
270
|
className: "mb-6",
|
|
277
271
|
children: [
|
|
278
|
-
/* @__PURE__ */
|
|
272
|
+
/* @__PURE__ */ p("p", {
|
|
279
273
|
className: "text-sm font-medium text-text-secondary",
|
|
280
|
-
children:
|
|
274
|
+
children: y("auth.users.summaryLabel", "People in this organization")
|
|
281
275
|
}),
|
|
282
|
-
/* @__PURE__ */
|
|
276
|
+
/* @__PURE__ */ p("p", {
|
|
283
277
|
className: "mt-1 text-3xl font-semibold text-text-primary",
|
|
284
|
-
children:
|
|
278
|
+
children: k
|
|
285
279
|
}),
|
|
286
|
-
/* @__PURE__ */
|
|
280
|
+
/* @__PURE__ */ p("p", {
|
|
287
281
|
className: "mt-1 text-sm text-text-secondary",
|
|
288
|
-
children:
|
|
282
|
+
children: y("auth.users.summaryHint", "Use the filters below to find a specific person or role.")
|
|
289
283
|
})
|
|
290
284
|
]
|
|
291
285
|
}),
|
|
292
|
-
/* @__PURE__ */
|
|
286
|
+
/* @__PURE__ */ p("div", {
|
|
293
287
|
"aria-live": "polite",
|
|
294
288
|
"aria-atomic": "true",
|
|
295
289
|
className: "sr-only",
|
|
296
|
-
children:
|
|
290
|
+
children: V
|
|
297
291
|
}),
|
|
298
|
-
/* @__PURE__ */
|
|
292
|
+
/* @__PURE__ */ p("div", {
|
|
299
293
|
role: "alert",
|
|
300
294
|
"aria-live": "assertive",
|
|
301
295
|
"aria-atomic": "true",
|
|
302
296
|
className: "sr-only",
|
|
303
|
-
children:
|
|
297
|
+
children: I
|
|
304
298
|
}),
|
|
305
|
-
|
|
306
|
-
id:
|
|
299
|
+
V && /* @__PURE__ */ m("output", {
|
|
300
|
+
id: ve,
|
|
307
301
|
className: "block mb-6 p-4 rounded-xl bg-status-success-bg-subtle border border-status-success-border",
|
|
308
|
-
children: [/* @__PURE__ */
|
|
302
|
+
children: [/* @__PURE__ */ p("p", {
|
|
309
303
|
className: "text-status-success-text",
|
|
310
|
-
children:
|
|
311
|
-
}), /* @__PURE__ */
|
|
304
|
+
children: V
|
|
305
|
+
}), /* @__PURE__ */ p("button", {
|
|
312
306
|
type: "button",
|
|
313
|
-
onClick: () =>
|
|
307
|
+
onClick: () => H(null),
|
|
314
308
|
className: "mt-2 text-sm text-status-success-text hover:underline",
|
|
315
|
-
children:
|
|
309
|
+
children: y("auth.users.dismiss", "Dismiss")
|
|
316
310
|
})]
|
|
317
311
|
}),
|
|
318
|
-
|
|
319
|
-
id:
|
|
312
|
+
I && /* @__PURE__ */ m("div", {
|
|
313
|
+
id: _e,
|
|
320
314
|
role: "alert",
|
|
321
315
|
className: "mb-6 flex items-start gap-3 p-4 rounded-xl bg-status-error-bg-subtle border border-status-error-border",
|
|
322
|
-
children: [/* @__PURE__ */
|
|
316
|
+
children: [/* @__PURE__ */ p(s, {
|
|
323
317
|
className: "size-5 text-status-error-text flex-shrink-0 mt-0.5",
|
|
324
318
|
"aria-hidden": "true"
|
|
325
|
-
}), /* @__PURE__ */
|
|
319
|
+
}), /* @__PURE__ */ m("div", {
|
|
326
320
|
className: "flex-1",
|
|
327
|
-
children: [/* @__PURE__ */
|
|
321
|
+
children: [/* @__PURE__ */ p("p", {
|
|
328
322
|
className: "text-sm text-status-error-text",
|
|
329
|
-
children:
|
|
330
|
-
}), /* @__PURE__ */
|
|
323
|
+
children: I
|
|
324
|
+
}), /* @__PURE__ */ p("button", {
|
|
331
325
|
type: "button",
|
|
332
|
-
onClick: () =>
|
|
326
|
+
onClick: () => L(null),
|
|
333
327
|
className: "mt-2 text-sm text-status-error-text hover:underline",
|
|
334
|
-
children:
|
|
328
|
+
children: y("auth.users.dismiss", "Dismiss")
|
|
335
329
|
})]
|
|
336
330
|
})]
|
|
337
331
|
}),
|
|
338
|
-
/* @__PURE__ */
|
|
332
|
+
/* @__PURE__ */ p("div", {
|
|
339
333
|
className: "mb-6 p-4 rounded-xl border border-border-subtle bg-bg-surface",
|
|
340
|
-
children: /* @__PURE__ */
|
|
334
|
+
children: /* @__PURE__ */ m("div", {
|
|
341
335
|
className: "flex flex-wrap gap-4 items-end",
|
|
342
336
|
children: [
|
|
343
|
-
/* @__PURE__ */
|
|
337
|
+
/* @__PURE__ */ m("div", {
|
|
344
338
|
className: "flex-1 min-w-[200px]",
|
|
345
|
-
children: [/* @__PURE__ */
|
|
346
|
-
htmlFor:
|
|
339
|
+
children: [/* @__PURE__ */ p("label", {
|
|
340
|
+
htmlFor: w,
|
|
347
341
|
className: "sr-only",
|
|
348
|
-
children:
|
|
349
|
-
}), /* @__PURE__ */
|
|
350
|
-
id:
|
|
342
|
+
children: y("auth.users.searchLabel", "Search users")
|
|
343
|
+
}), /* @__PURE__ */ p("input", {
|
|
344
|
+
id: w,
|
|
351
345
|
type: "search",
|
|
352
|
-
"aria-label":
|
|
353
|
-
placeholder:
|
|
354
|
-
value:
|
|
346
|
+
"aria-label": y("auth.users.searchLabel", "Search users"),
|
|
347
|
+
placeholder: y("auth.users.searchPlaceholder", "Search by email, username, or name..."),
|
|
348
|
+
value: G,
|
|
355
349
|
onChange: (e) => {
|
|
356
|
-
|
|
350
|
+
we(e.target.value), Y(0);
|
|
357
351
|
},
|
|
358
352
|
className: "w-full px-4 py-2.5 border border-border-default rounded-xl bg-bg-surface text-text-primary placeholder-text-tertiary focus:outline-none focus:ring-2 focus:ring-action-primary-bg/20 focus:border-action-primary-bg transition-all"
|
|
359
353
|
})]
|
|
360
354
|
}),
|
|
361
|
-
/* @__PURE__ */
|
|
362
|
-
htmlFor:
|
|
355
|
+
/* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("label", {
|
|
356
|
+
htmlFor: he,
|
|
363
357
|
className: "sr-only",
|
|
364
|
-
children:
|
|
365
|
-
}), /* @__PURE__ */
|
|
366
|
-
id:
|
|
367
|
-
value:
|
|
358
|
+
children: y("auth.users.filterRoleLabel", "Filter by role")
|
|
359
|
+
}), /* @__PURE__ */ m("select", {
|
|
360
|
+
id: he,
|
|
361
|
+
value: K,
|
|
368
362
|
onChange: (e) => {
|
|
369
|
-
|
|
363
|
+
Te(e.target.value), Y(0);
|
|
370
364
|
},
|
|
371
365
|
className: "px-4 py-2.5 border border-border-default rounded-xl bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-action-primary-bg/20 focus:border-action-primary-bg transition-all scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary",
|
|
372
|
-
children: [/* @__PURE__ */
|
|
366
|
+
children: [/* @__PURE__ */ p("option", {
|
|
373
367
|
value: "",
|
|
374
|
-
children:
|
|
375
|
-
}),
|
|
368
|
+
children: y("auth.users.allRoles", "All Roles")
|
|
369
|
+
}), _.map((e) => /* @__PURE__ */ p("option", {
|
|
376
370
|
value: e,
|
|
377
371
|
children: e.replace("_", " ")
|
|
378
372
|
}, e))]
|
|
379
373
|
})] }),
|
|
380
|
-
/* @__PURE__ */
|
|
381
|
-
htmlFor:
|
|
374
|
+
/* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("label", {
|
|
375
|
+
htmlFor: ge,
|
|
382
376
|
className: "sr-only",
|
|
383
|
-
children:
|
|
384
|
-
}), /* @__PURE__ */
|
|
385
|
-
id:
|
|
386
|
-
value:
|
|
377
|
+
children: y("auth.users.filterStatusLabel", "Filter by status")
|
|
378
|
+
}), /* @__PURE__ */ m("select", {
|
|
379
|
+
id: ge,
|
|
380
|
+
value: q,
|
|
387
381
|
onChange: (e) => {
|
|
388
|
-
|
|
382
|
+
Ee(e.target.value), Y(0);
|
|
389
383
|
},
|
|
390
384
|
className: "px-4 py-2.5 border border-border-default rounded-xl bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-action-primary-bg/20 focus:border-action-primary-bg transition-all scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary",
|
|
391
|
-
children: [/* @__PURE__ */
|
|
385
|
+
children: [/* @__PURE__ */ p("option", {
|
|
392
386
|
value: "",
|
|
393
|
-
children:
|
|
394
|
-
}),
|
|
387
|
+
children: y("auth.users.allStatuses", "All Statuses")
|
|
388
|
+
}), v.map((e) => /* @__PURE__ */ p("option", {
|
|
395
389
|
value: e,
|
|
396
390
|
children: e
|
|
397
391
|
}, e))]
|
|
@@ -399,165 +393,165 @@ function v() {
|
|
|
399
393
|
]
|
|
400
394
|
})
|
|
401
395
|
}),
|
|
402
|
-
|
|
396
|
+
C ? /* @__PURE__ */ m("div", {
|
|
403
397
|
"aria-live": "polite",
|
|
404
398
|
"aria-busy": "true",
|
|
405
399
|
className: "flex items-center justify-center py-12",
|
|
406
|
-
children: [/* @__PURE__ */
|
|
400
|
+
children: [/* @__PURE__ */ p(c, {
|
|
407
401
|
className: "size-8 text-text-link animate-spin",
|
|
408
402
|
"aria-hidden": "true"
|
|
409
|
-
}), /* @__PURE__ */
|
|
403
|
+
}), /* @__PURE__ */ p("span", {
|
|
410
404
|
className: "ml-3 text-text-secondary",
|
|
411
|
-
children:
|
|
405
|
+
children: y("auth.users.loadingUsers", "Loading users...")
|
|
412
406
|
})]
|
|
413
|
-
}) :
|
|
414
|
-
illustration:
|
|
415
|
-
title:
|
|
416
|
-
description:
|
|
417
|
-
}) : /* @__PURE__ */
|
|
418
|
-
/* @__PURE__ */
|
|
407
|
+
}) : O.length === 0 ? /* @__PURE__ */ p(g, {
|
|
408
|
+
illustration: G || K || q ? "empty-search" : "empty-people",
|
|
409
|
+
title: y("auth.users.noUsersFound", "No users found"),
|
|
410
|
+
description: G || K || q ? y("auth.users.noUsersFilteredDesc", "No users match your current search or filters. Try clearing them to see everyone.") : y("auth.users.noUsersDesc", "Once people join your organization they'll show up here for you to manage.")
|
|
411
|
+
}) : /* @__PURE__ */ m(f, { children: [
|
|
412
|
+
/* @__PURE__ */ p("div", {
|
|
419
413
|
className: "rounded-xl border border-border-subtle bg-bg-surface overflow-hidden shadow-sm",
|
|
420
|
-
children: /* @__PURE__ */
|
|
414
|
+
children: /* @__PURE__ */ p("div", {
|
|
421
415
|
className: "overflow-x-auto",
|
|
422
|
-
children: /* @__PURE__ */
|
|
416
|
+
children: /* @__PURE__ */ m("table", {
|
|
423
417
|
className: "w-full min-w-[800px]",
|
|
424
|
-
"aria-label":
|
|
425
|
-
children: [/* @__PURE__ */
|
|
418
|
+
"aria-label": y("auth.users.tableAriaLabel", "Users table"),
|
|
419
|
+
children: [/* @__PURE__ */ p("thead", { children: /* @__PURE__ */ m("tr", {
|
|
426
420
|
className: "border-b border-border-subtle bg-bg-canvas",
|
|
427
421
|
children: [
|
|
428
|
-
/* @__PURE__ */
|
|
422
|
+
/* @__PURE__ */ p("th", {
|
|
429
423
|
scope: "col",
|
|
430
424
|
className: "text-left p-4 text-sm font-medium text-text-secondary w-[280px]",
|
|
431
|
-
children:
|
|
425
|
+
children: y("auth.users.columnUser", "User")
|
|
432
426
|
}),
|
|
433
|
-
/* @__PURE__ */
|
|
427
|
+
/* @__PURE__ */ p("th", {
|
|
434
428
|
scope: "col",
|
|
435
429
|
className: "text-left p-4 text-sm font-medium text-text-secondary w-[130px]",
|
|
436
|
-
children:
|
|
430
|
+
children: y("auth.users.columnRole", "Role")
|
|
437
431
|
}),
|
|
438
|
-
/* @__PURE__ */
|
|
432
|
+
/* @__PURE__ */ p("th", {
|
|
439
433
|
scope: "col",
|
|
440
434
|
className: "text-left p-4 text-sm font-medium text-text-secondary w-[100px]",
|
|
441
|
-
children:
|
|
435
|
+
children: y("auth.users.columnStatus", "Status")
|
|
442
436
|
}),
|
|
443
|
-
/* @__PURE__ */
|
|
437
|
+
/* @__PURE__ */ p("th", {
|
|
444
438
|
scope: "col",
|
|
445
439
|
className: "text-left p-4 text-sm font-medium text-text-secondary w-[80px]",
|
|
446
|
-
children:
|
|
440
|
+
children: y("auth.users.columnVerified", "Verified")
|
|
447
441
|
}),
|
|
448
|
-
/* @__PURE__ */
|
|
442
|
+
/* @__PURE__ */ p("th", {
|
|
449
443
|
scope: "col",
|
|
450
444
|
className: "text-left p-4 text-sm font-medium text-text-secondary w-[100px]",
|
|
451
|
-
children:
|
|
445
|
+
children: y("auth.users.columnLastLogin", "Last Login")
|
|
452
446
|
}),
|
|
453
|
-
/* @__PURE__ */
|
|
447
|
+
/* @__PURE__ */ p("th", {
|
|
454
448
|
scope: "col",
|
|
455
449
|
className: "text-right p-4 text-sm font-medium text-text-secondary w-[180px]",
|
|
456
|
-
children:
|
|
450
|
+
children: y("auth.users.columnActions", "Actions")
|
|
457
451
|
})
|
|
458
452
|
]
|
|
459
|
-
}) }), /* @__PURE__ */
|
|
453
|
+
}) }), /* @__PURE__ */ p("tbody", { children: O.map((e) => /* @__PURE__ */ m("tr", {
|
|
460
454
|
className: "border-b border-border-subtle last:border-b-0 hover:bg-bg-sunken/50 transition-colors",
|
|
461
455
|
children: [
|
|
462
|
-
/* @__PURE__ */
|
|
456
|
+
/* @__PURE__ */ p("td", {
|
|
463
457
|
className: "p-4",
|
|
464
|
-
children: /* @__PURE__ */
|
|
458
|
+
children: /* @__PURE__ */ m("div", {
|
|
465
459
|
className: "flex items-center gap-3 min-w-0",
|
|
466
|
-
children: [/* @__PURE__ */
|
|
460
|
+
children: [/* @__PURE__ */ p("div", {
|
|
467
461
|
className: "auth-brand-badge flex size-10 shrink-0 items-center justify-center rounded-full font-medium",
|
|
468
462
|
children: (e.name || e.username || e.email).charAt(0).toUpperCase()
|
|
469
|
-
}), /* @__PURE__ */
|
|
463
|
+
}), /* @__PURE__ */ m("div", {
|
|
470
464
|
className: "min-w-0 flex-1",
|
|
471
|
-
children: [/* @__PURE__ */
|
|
465
|
+
children: [/* @__PURE__ */ p("p", {
|
|
472
466
|
className: "font-medium text-text-primary truncate",
|
|
473
467
|
children: e.name || e.username
|
|
474
|
-
}), /* @__PURE__ */
|
|
468
|
+
}), /* @__PURE__ */ p("p", {
|
|
475
469
|
className: "text-sm text-text-secondary truncate",
|
|
476
470
|
children: e.email
|
|
477
471
|
})]
|
|
478
472
|
})]
|
|
479
473
|
})
|
|
480
474
|
}),
|
|
481
|
-
/* @__PURE__ */
|
|
475
|
+
/* @__PURE__ */ p("td", {
|
|
482
476
|
className: "p-4",
|
|
483
|
-
children: /* @__PURE__ */
|
|
484
|
-
className: `inline-block px-2.5 py-1 rounded-full text-xs font-medium whitespace-nowrap ${
|
|
477
|
+
children: /* @__PURE__ */ p("span", {
|
|
478
|
+
className: `inline-block px-2.5 py-1 rounded-full text-xs font-medium whitespace-nowrap ${je(e.role)}`,
|
|
485
479
|
children: e.role.replace("_", " ")
|
|
486
480
|
})
|
|
487
481
|
}),
|
|
488
|
-
/* @__PURE__ */
|
|
482
|
+
/* @__PURE__ */ p("td", {
|
|
489
483
|
className: "p-4",
|
|
490
|
-
children: /* @__PURE__ */
|
|
491
|
-
className: `inline-block px-2.5 py-1 rounded-full text-xs font-medium whitespace-nowrap ${
|
|
484
|
+
children: /* @__PURE__ */ p("span", {
|
|
485
|
+
className: `inline-block px-2.5 py-1 rounded-full text-xs font-medium whitespace-nowrap ${$(e.status)}`,
|
|
492
486
|
children: e.status
|
|
493
487
|
})
|
|
494
488
|
}),
|
|
495
|
-
/* @__PURE__ */
|
|
489
|
+
/* @__PURE__ */ p("td", {
|
|
496
490
|
className: "p-4",
|
|
497
|
-
children: e.emailVerified ? /* @__PURE__ */
|
|
491
|
+
children: e.emailVerified ? /* @__PURE__ */ m("span", {
|
|
498
492
|
className: "inline-flex items-center gap-1 text-status-success-text whitespace-nowrap",
|
|
499
|
-
children: [/* @__PURE__ */
|
|
493
|
+
children: [/* @__PURE__ */ p("svg", {
|
|
500
494
|
className: "size-4 flex-shrink-0",
|
|
501
495
|
fill: "currentColor",
|
|
502
496
|
viewBox: "0 0 20 20",
|
|
503
|
-
children: /* @__PURE__ */
|
|
497
|
+
children: /* @__PURE__ */ p("path", {
|
|
504
498
|
fillRule: "evenodd",
|
|
505
499
|
d: "M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z",
|
|
506
500
|
clipRule: "evenodd"
|
|
507
501
|
})
|
|
508
|
-
}), /* @__PURE__ */
|
|
502
|
+
}), /* @__PURE__ */ p("span", {
|
|
509
503
|
className: "text-sm",
|
|
510
|
-
children:
|
|
504
|
+
children: y("auth.users.verifiedYes", "Yes")
|
|
511
505
|
})]
|
|
512
|
-
}) : /* @__PURE__ */
|
|
506
|
+
}) : /* @__PURE__ */ m("span", {
|
|
513
507
|
className: "inline-flex items-center gap-1 text-status-warning-text whitespace-nowrap",
|
|
514
|
-
children: [/* @__PURE__ */
|
|
508
|
+
children: [/* @__PURE__ */ p("svg", {
|
|
515
509
|
className: "size-4 flex-shrink-0",
|
|
516
510
|
fill: "currentColor",
|
|
517
511
|
viewBox: "0 0 20 20",
|
|
518
|
-
children: /* @__PURE__ */
|
|
512
|
+
children: /* @__PURE__ */ p("path", {
|
|
519
513
|
fillRule: "evenodd",
|
|
520
514
|
d: "M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z",
|
|
521
515
|
clipRule: "evenodd"
|
|
522
516
|
})
|
|
523
|
-
}), /* @__PURE__ */
|
|
517
|
+
}), /* @__PURE__ */ p("span", {
|
|
524
518
|
className: "text-sm",
|
|
525
|
-
children:
|
|
519
|
+
children: y("auth.users.verifiedNo", "No")
|
|
526
520
|
})]
|
|
527
521
|
})
|
|
528
522
|
}),
|
|
529
|
-
/* @__PURE__ */
|
|
523
|
+
/* @__PURE__ */ p("td", {
|
|
530
524
|
className: "p-4 text-sm text-text-secondary whitespace-nowrap",
|
|
531
|
-
children: e.lastLoginAt ? new Date(e.lastLoginAt).toLocaleDateString() :
|
|
525
|
+
children: e.lastLoginAt ? new Date(e.lastLoginAt).toLocaleDateString() : y("auth.users.lastLoginNever", "Never")
|
|
532
526
|
}),
|
|
533
|
-
/* @__PURE__ */
|
|
527
|
+
/* @__PURE__ */ p("td", {
|
|
534
528
|
className: "p-4",
|
|
535
|
-
children: /* @__PURE__ */
|
|
529
|
+
children: /* @__PURE__ */ m("div", {
|
|
536
530
|
className: "flex justify-end gap-1.5 flex-nowrap",
|
|
537
531
|
children: [
|
|
538
|
-
/* @__PURE__ */
|
|
532
|
+
/* @__PURE__ */ p("button", {
|
|
539
533
|
type: "button",
|
|
540
|
-
onClick: () =>
|
|
541
|
-
"aria-label": `${
|
|
534
|
+
onClick: () => se(`/auth/users/${e.id}`),
|
|
535
|
+
"aria-label": `${y("auth.users.actionView", "View")} ${e.name || e.username || e.email}`,
|
|
542
536
|
className: "px-2.5 py-1.5 rounded-lg text-xs font-medium border border-border-default text-text-primary bg-bg-surface hover:bg-bg-sunken transition-colors whitespace-nowrap flex-shrink-0",
|
|
543
|
-
children:
|
|
537
|
+
children: y("auth.users.actionView", "View")
|
|
544
538
|
}),
|
|
545
|
-
|
|
539
|
+
ue && /* @__PURE__ */ p("button", {
|
|
546
540
|
type: "button",
|
|
547
|
-
onClick: () =>
|
|
548
|
-
"aria-label": `${
|
|
541
|
+
onClick: () => Ae(e),
|
|
542
|
+
"aria-label": `${y("auth.users.actionEdit", "Edit")} ${e.name || e.username || e.email}`,
|
|
549
543
|
className: "px-2.5 py-1.5 rounded-lg text-xs font-medium border border-status-info-border text-text-link bg-bg-surface hover:bg-status-info-bg-subtle transition-colors whitespace-nowrap flex-shrink-0",
|
|
550
|
-
children:
|
|
544
|
+
children: y("auth.users.actionEdit", "Edit")
|
|
551
545
|
}),
|
|
552
|
-
|
|
546
|
+
x && e.status !== "DELETED" && /* @__PURE__ */ p("button", {
|
|
553
547
|
type: "button",
|
|
554
|
-
onClick: () =>
|
|
548
|
+
onClick: () => W({
|
|
555
549
|
type: "deactivate",
|
|
556
550
|
user: e
|
|
557
551
|
}),
|
|
558
|
-
"aria-label": `${
|
|
552
|
+
"aria-label": `${y("auth.users.actionDelete", "Delete")} ${e.name || e.username || e.email}`,
|
|
559
553
|
className: "px-2.5 py-1.5 rounded-lg text-xs font-medium border border-status-error-border text-status-error-text bg-bg-surface hover:bg-status-error-bg-subtle transition-colors whitespace-nowrap flex-shrink-0",
|
|
560
|
-
children:
|
|
554
|
+
children: y("auth.users.actionDelete", "Delete")
|
|
561
555
|
})
|
|
562
556
|
]
|
|
563
557
|
})
|
|
@@ -567,466 +561,466 @@ function v() {
|
|
|
567
561
|
})
|
|
568
562
|
})
|
|
569
563
|
}),
|
|
570
|
-
/* @__PURE__ */
|
|
564
|
+
/* @__PURE__ */ m("div", {
|
|
571
565
|
className: "mt-6 flex items-center justify-between",
|
|
572
|
-
children: [/* @__PURE__ */
|
|
566
|
+
children: [/* @__PURE__ */ m("p", {
|
|
573
567
|
className: "text-sm text-text-secondary",
|
|
574
568
|
children: [
|
|
575
|
-
|
|
569
|
+
y("auth.users.showing", "Showing"),
|
|
576
570
|
" ",
|
|
577
|
-
|
|
571
|
+
J * 10 + 1,
|
|
578
572
|
" ",
|
|
579
|
-
|
|
573
|
+
y("auth.users.to", "to"),
|
|
580
574
|
" ",
|
|
581
|
-
Math.min((
|
|
575
|
+
Math.min((J + 1) * 10, k),
|
|
582
576
|
" ",
|
|
583
|
-
|
|
577
|
+
y("auth.users.of", "of"),
|
|
584
578
|
" ",
|
|
585
|
-
|
|
579
|
+
k,
|
|
586
580
|
" ",
|
|
587
|
-
|
|
581
|
+
y("auth.users.paginationUsers", "users")
|
|
588
582
|
]
|
|
589
|
-
}), /* @__PURE__ */
|
|
590
|
-
"aria-label":
|
|
591
|
-
children: /* @__PURE__ */
|
|
583
|
+
}), /* @__PURE__ */ p("nav", {
|
|
584
|
+
"aria-label": y("auth.users.paginationAriaLabel", "User list pagination"),
|
|
585
|
+
children: /* @__PURE__ */ m("div", {
|
|
592
586
|
className: "flex gap-2",
|
|
593
|
-
children: [/* @__PURE__ */
|
|
587
|
+
children: [/* @__PURE__ */ p("button", {
|
|
594
588
|
type: "button",
|
|
595
|
-
onClick: () =>
|
|
596
|
-
disabled:
|
|
597
|
-
"aria-label":
|
|
589
|
+
onClick: () => Y((e) => Math.max(0, e - 1)),
|
|
590
|
+
disabled: J === 0,
|
|
591
|
+
"aria-label": y("auth.users.previousPageAriaLabel", "Go to previous page"),
|
|
598
592
|
className: "px-4 py-2 rounded-lg border border-border-default text-text-primary bg-bg-surface disabled:opacity-50 disabled:cursor-not-allowed hover:bg-bg-sunken transition-colors",
|
|
599
|
-
children:
|
|
600
|
-
}), /* @__PURE__ */
|
|
593
|
+
children: y("auth.users.previousPage", "Previous")
|
|
594
|
+
}), /* @__PURE__ */ p("button", {
|
|
601
595
|
type: "button",
|
|
602
|
-
onClick: () =>
|
|
603
|
-
disabled: !
|
|
604
|
-
"aria-label":
|
|
596
|
+
onClick: () => Y((e) => e + 1),
|
|
597
|
+
disabled: !xe,
|
|
598
|
+
"aria-label": y("auth.users.nextPageAriaLabel", "Go to next page"),
|
|
605
599
|
className: "px-4 py-2 rounded-lg border border-border-default text-text-primary bg-bg-surface disabled:opacity-50 disabled:cursor-not-allowed hover:bg-bg-sunken transition-colors",
|
|
606
|
-
children:
|
|
600
|
+
children: y("auth.users.nextPage", "Next")
|
|
607
601
|
})]
|
|
608
602
|
})
|
|
609
603
|
})]
|
|
610
604
|
}),
|
|
611
|
-
/* @__PURE__ */
|
|
605
|
+
/* @__PURE__ */ p(ae, {
|
|
612
606
|
className: "mt-8",
|
|
613
607
|
storageKey: "auth-users",
|
|
614
608
|
steps: [{
|
|
615
609
|
id: "search-user",
|
|
616
|
-
label:
|
|
617
|
-
description:
|
|
610
|
+
label: y("auth.users.nextSearch", "Find a specific person"),
|
|
611
|
+
description: y("auth.users.nextSearchDesc", "Use the search and role / status filters above to narrow the list."),
|
|
618
612
|
onClick: () => {
|
|
619
|
-
let e = document.getElementById(
|
|
613
|
+
let e = document.getElementById(w);
|
|
620
614
|
e instanceof HTMLInputElement && e.focus();
|
|
621
615
|
}
|
|
622
616
|
}, {
|
|
623
617
|
id: "export-users",
|
|
624
|
-
label:
|
|
625
|
-
description:
|
|
626
|
-
onClick: () => void
|
|
618
|
+
label: y("auth.users.nextExport", "Export the user list"),
|
|
619
|
+
description: y("auth.users.nextExportDesc", "Download a CSV of users matching your current filters."),
|
|
620
|
+
onClick: () => void D()
|
|
627
621
|
}]
|
|
628
622
|
})
|
|
629
623
|
] })
|
|
630
624
|
]
|
|
631
|
-
}) :
|
|
625
|
+
}) : A === "view" && M ? /* @__PURE__ */ m("div", {
|
|
632
626
|
className: "max-w-4xl mx-auto p-6",
|
|
633
627
|
children: [
|
|
634
|
-
|
|
635
|
-
/* @__PURE__ */
|
|
628
|
+
Q,
|
|
629
|
+
/* @__PURE__ */ m("button", {
|
|
636
630
|
type: "button",
|
|
637
631
|
onClick: () => {
|
|
638
|
-
|
|
632
|
+
j("list"), Z();
|
|
639
633
|
},
|
|
640
634
|
className: "mb-6 flex items-center gap-2 text-text-link hover:underline font-medium",
|
|
641
|
-
children: [/* @__PURE__ */
|
|
635
|
+
children: [/* @__PURE__ */ p("svg", {
|
|
642
636
|
className: "size-4",
|
|
643
637
|
fill: "none",
|
|
644
638
|
viewBox: "0 0 24 24",
|
|
645
639
|
stroke: "currentColor",
|
|
646
|
-
children: /* @__PURE__ */
|
|
640
|
+
children: /* @__PURE__ */ p("path", {
|
|
647
641
|
strokeLinecap: "round",
|
|
648
642
|
strokeLinejoin: "round",
|
|
649
643
|
strokeWidth: 2,
|
|
650
644
|
d: "M10 19l-7-7m0 0l7-7m-7 7h18"
|
|
651
645
|
})
|
|
652
|
-
}),
|
|
646
|
+
}), y("auth.users.backToUsers", "Back to Users")]
|
|
653
647
|
}),
|
|
654
|
-
/* @__PURE__ */
|
|
648
|
+
/* @__PURE__ */ m("div", {
|
|
655
649
|
className: "p-6 rounded-xl border border-border-subtle bg-bg-surface shadow-sm",
|
|
656
650
|
children: [
|
|
657
|
-
/* @__PURE__ */
|
|
651
|
+
/* @__PURE__ */ m("div", {
|
|
658
652
|
className: "flex items-center gap-4 mb-8",
|
|
659
|
-
children: [/* @__PURE__ */
|
|
653
|
+
children: [/* @__PURE__ */ p("div", {
|
|
660
654
|
className: "auth-brand-badge flex size-20 items-center justify-center rounded-full text-3xl font-semibold",
|
|
661
|
-
children: (
|
|
662
|
-
}), /* @__PURE__ */
|
|
663
|
-
/* @__PURE__ */
|
|
655
|
+
children: (M.name || M.username || M.email).charAt(0).toUpperCase()
|
|
656
|
+
}), /* @__PURE__ */ m("div", { children: [
|
|
657
|
+
/* @__PURE__ */ p("h1", {
|
|
664
658
|
className: "text-2xl font-semibold text-text-primary",
|
|
665
|
-
children:
|
|
659
|
+
children: M.name || M.username
|
|
666
660
|
}),
|
|
667
|
-
/* @__PURE__ */
|
|
661
|
+
/* @__PURE__ */ p("p", {
|
|
668
662
|
className: "text-text-secondary",
|
|
669
|
-
children:
|
|
663
|
+
children: M.email
|
|
670
664
|
}),
|
|
671
|
-
/* @__PURE__ */
|
|
665
|
+
/* @__PURE__ */ m("div", {
|
|
672
666
|
className: "flex items-center gap-2 mt-2",
|
|
673
|
-
children: [/* @__PURE__ */
|
|
674
|
-
className: `px-2.5 py-1 rounded-full text-xs font-medium ${
|
|
675
|
-
children:
|
|
676
|
-
}), /* @__PURE__ */
|
|
677
|
-
className: `px-2.5 py-1 rounded-full text-xs font-medium ${
|
|
678
|
-
children:
|
|
667
|
+
children: [/* @__PURE__ */ p("span", {
|
|
668
|
+
className: `px-2.5 py-1 rounded-full text-xs font-medium ${je(M.role)}`,
|
|
669
|
+
children: M.role.replace("_", " ")
|
|
670
|
+
}), /* @__PURE__ */ p("span", {
|
|
671
|
+
className: `px-2.5 py-1 rounded-full text-xs font-medium ${$(M.status)}`,
|
|
672
|
+
children: M.status
|
|
679
673
|
})]
|
|
680
674
|
})
|
|
681
675
|
] })]
|
|
682
676
|
}),
|
|
683
|
-
/* @__PURE__ */
|
|
677
|
+
/* @__PURE__ */ m("div", {
|
|
684
678
|
className: "grid grid-cols-2 gap-6",
|
|
685
679
|
children: [
|
|
686
|
-
/* @__PURE__ */
|
|
680
|
+
/* @__PURE__ */ m("div", {
|
|
687
681
|
className: "p-4 rounded-lg bg-bg-canvas/50",
|
|
688
|
-
children: [/* @__PURE__ */
|
|
682
|
+
children: [/* @__PURE__ */ p("label", {
|
|
689
683
|
className: "block text-sm font-medium text-text-secondary mb-1",
|
|
690
|
-
children:
|
|
691
|
-
}), /* @__PURE__ */
|
|
684
|
+
children: y("auth.users.viewDetailsUsername", "Username")
|
|
685
|
+
}), /* @__PURE__ */ p("p", {
|
|
692
686
|
className: "text-text-primary font-medium",
|
|
693
|
-
children:
|
|
687
|
+
children: M.username
|
|
694
688
|
})]
|
|
695
689
|
}),
|
|
696
|
-
/* @__PURE__ */
|
|
690
|
+
/* @__PURE__ */ m("div", {
|
|
697
691
|
className: "p-4 rounded-lg bg-bg-canvas/50",
|
|
698
|
-
children: [/* @__PURE__ */
|
|
692
|
+
children: [/* @__PURE__ */ p("label", {
|
|
699
693
|
className: "block text-sm font-medium text-text-secondary mb-1",
|
|
700
|
-
children:
|
|
701
|
-
}), /* @__PURE__ */
|
|
694
|
+
children: y("auth.users.viewDetailsEmail", "Email")
|
|
695
|
+
}), /* @__PURE__ */ p("p", {
|
|
702
696
|
className: "text-text-primary font-medium",
|
|
703
|
-
children:
|
|
697
|
+
children: M.email
|
|
704
698
|
})]
|
|
705
699
|
}),
|
|
706
|
-
/* @__PURE__ */
|
|
700
|
+
/* @__PURE__ */ m("div", {
|
|
707
701
|
className: "p-4 rounded-lg bg-bg-canvas/50",
|
|
708
|
-
children: [/* @__PURE__ */
|
|
702
|
+
children: [/* @__PURE__ */ p("label", {
|
|
709
703
|
className: "block text-sm font-medium text-text-secondary mb-1",
|
|
710
|
-
children:
|
|
711
|
-
}), /* @__PURE__ */
|
|
704
|
+
children: y("auth.users.viewDetailsEmailVerified", "Email Verified")
|
|
705
|
+
}), /* @__PURE__ */ p("p", {
|
|
712
706
|
className: "text-text-primary font-medium",
|
|
713
|
-
children:
|
|
707
|
+
children: M.emailVerified ? /* @__PURE__ */ p("span", {
|
|
714
708
|
className: "text-status-success-text",
|
|
715
|
-
children:
|
|
716
|
-
}) : /* @__PURE__ */
|
|
709
|
+
children: y("auth.users.verifiedYes", "Yes")
|
|
710
|
+
}) : /* @__PURE__ */ p("span", {
|
|
717
711
|
className: "text-status-warning-text",
|
|
718
|
-
children:
|
|
712
|
+
children: y("auth.users.verifiedNo", "No")
|
|
719
713
|
})
|
|
720
714
|
})]
|
|
721
715
|
}),
|
|
722
|
-
/* @__PURE__ */
|
|
716
|
+
/* @__PURE__ */ m("div", {
|
|
723
717
|
className: "p-4 rounded-lg bg-bg-canvas/50",
|
|
724
|
-
children: [/* @__PURE__ */
|
|
718
|
+
children: [/* @__PURE__ */ p("label", {
|
|
725
719
|
className: "block text-sm font-medium text-text-secondary mb-1",
|
|
726
|
-
children:
|
|
727
|
-
}), /* @__PURE__ */
|
|
720
|
+
children: y("auth.users.viewDetailsMfaEnabled", "MFA Enabled")
|
|
721
|
+
}), /* @__PURE__ */ p("p", {
|
|
728
722
|
className: "text-text-primary font-medium",
|
|
729
|
-
children:
|
|
723
|
+
children: M.mfaEnabled ? /* @__PURE__ */ p("span", {
|
|
730
724
|
className: "text-status-success-text",
|
|
731
|
-
children:
|
|
732
|
-
}) : /* @__PURE__ */
|
|
725
|
+
children: y("auth.users.verifiedYes", "Yes")
|
|
726
|
+
}) : /* @__PURE__ */ p("span", {
|
|
733
727
|
className: "text-text-secondary",
|
|
734
|
-
children:
|
|
728
|
+
children: y("auth.users.verifiedNo", "No")
|
|
735
729
|
})
|
|
736
730
|
})]
|
|
737
731
|
}),
|
|
738
|
-
|
|
732
|
+
M.phoneNumber && /* @__PURE__ */ m("div", {
|
|
739
733
|
className: "p-4 rounded-lg bg-bg-canvas/50",
|
|
740
|
-
children: [/* @__PURE__ */
|
|
734
|
+
children: [/* @__PURE__ */ p("label", {
|
|
741
735
|
className: "block text-sm font-medium text-text-secondary mb-1",
|
|
742
|
-
children:
|
|
743
|
-
}), /* @__PURE__ */
|
|
736
|
+
children: y("auth.users.viewDetailsPhoneNumber", "Phone Number")
|
|
737
|
+
}), /* @__PURE__ */ p("p", {
|
|
744
738
|
className: "text-text-primary font-medium",
|
|
745
|
-
children:
|
|
739
|
+
children: M.phoneNumber
|
|
746
740
|
})]
|
|
747
741
|
}),
|
|
748
|
-
/* @__PURE__ */
|
|
742
|
+
/* @__PURE__ */ m("div", {
|
|
749
743
|
className: "p-4 rounded-lg bg-bg-canvas/50",
|
|
750
|
-
children: [/* @__PURE__ */
|
|
744
|
+
children: [/* @__PURE__ */ p("label", {
|
|
751
745
|
className: "block text-sm font-medium text-text-secondary mb-1",
|
|
752
|
-
children:
|
|
753
|
-
}), /* @__PURE__ */
|
|
746
|
+
children: y("auth.users.viewDetailsLastLogin", "Last Login")
|
|
747
|
+
}), /* @__PURE__ */ p("p", {
|
|
754
748
|
className: "text-text-primary font-medium",
|
|
755
|
-
children:
|
|
749
|
+
children: M.lastLoginAt ? new Date(M.lastLoginAt).toLocaleString() : y("auth.users.lastLoginNever", "Never")
|
|
756
750
|
})]
|
|
757
751
|
}),
|
|
758
|
-
/* @__PURE__ */
|
|
752
|
+
/* @__PURE__ */ m("div", {
|
|
759
753
|
className: "p-4 rounded-lg bg-bg-canvas/50",
|
|
760
|
-
children: [/* @__PURE__ */
|
|
754
|
+
children: [/* @__PURE__ */ p("label", {
|
|
761
755
|
className: "block text-sm font-medium text-text-secondary mb-1",
|
|
762
|
-
children:
|
|
763
|
-
}), /* @__PURE__ */
|
|
756
|
+
children: y("auth.users.viewDetailsCreated", "Created")
|
|
757
|
+
}), /* @__PURE__ */ p("p", {
|
|
764
758
|
className: "text-text-primary font-medium",
|
|
765
|
-
children: new Date(
|
|
759
|
+
children: new Date(M.createdAt).toLocaleString()
|
|
766
760
|
})]
|
|
767
761
|
}),
|
|
768
|
-
/* @__PURE__ */
|
|
762
|
+
/* @__PURE__ */ m("div", {
|
|
769
763
|
className: "p-4 rounded-lg bg-bg-canvas/50",
|
|
770
|
-
children: [/* @__PURE__ */
|
|
764
|
+
children: [/* @__PURE__ */ p("label", {
|
|
771
765
|
className: "block text-sm font-medium text-text-secondary mb-1",
|
|
772
|
-
children:
|
|
773
|
-
}), /* @__PURE__ */
|
|
766
|
+
children: y("auth.users.viewDetailsLastUpdated", "Last Updated")
|
|
767
|
+
}), /* @__PURE__ */ p("p", {
|
|
774
768
|
className: "text-text-primary font-medium",
|
|
775
|
-
children: new Date(
|
|
769
|
+
children: new Date(M.updatedAt).toLocaleString()
|
|
776
770
|
})]
|
|
777
771
|
})
|
|
778
772
|
]
|
|
779
773
|
}),
|
|
780
|
-
/* @__PURE__ */
|
|
774
|
+
/* @__PURE__ */ m("div", {
|
|
781
775
|
className: "mt-8 pt-6 border-t border-border-subtle flex gap-3",
|
|
782
776
|
children: [
|
|
783
|
-
/* @__PURE__ */
|
|
777
|
+
/* @__PURE__ */ p(h, {
|
|
784
778
|
type: "button",
|
|
785
|
-
onClick: () =>
|
|
779
|
+
onClick: () => Ae(M),
|
|
786
780
|
variant: "default",
|
|
787
781
|
className: "font-semibold",
|
|
788
|
-
children:
|
|
782
|
+
children: y("auth.users.editUser", "Edit User")
|
|
789
783
|
}),
|
|
790
|
-
|
|
784
|
+
M.status !== "DELETED" && /* @__PURE__ */ p("button", {
|
|
791
785
|
type: "button",
|
|
792
|
-
onClick: () =>
|
|
786
|
+
onClick: () => W({
|
|
793
787
|
type: "deactivate",
|
|
794
|
-
user:
|
|
788
|
+
user: M
|
|
795
789
|
}),
|
|
796
790
|
className: "px-4 py-2.5 rounded-xl border border-status-error-border text-status-error-text font-medium hover:bg-status-error-bg-subtle transition-colors",
|
|
797
|
-
children:
|
|
791
|
+
children: y("auth.users.deleteUser", "Delete User")
|
|
798
792
|
}),
|
|
799
|
-
|
|
793
|
+
x && M.status === "DELETED" && ce?.role === "SUPER_ADMIN" && /* @__PURE__ */ p("button", {
|
|
800
794
|
type: "button",
|
|
801
|
-
onClick: () =>
|
|
795
|
+
onClick: () => W({
|
|
802
796
|
type: "hard-delete",
|
|
803
|
-
user:
|
|
797
|
+
user: M
|
|
804
798
|
}),
|
|
805
799
|
className: "px-4 py-2.5 rounded-xl bg-status-error-bg text-white font-medium hover:bg-status-error-bg-hover transition-colors",
|
|
806
|
-
children:
|
|
800
|
+
children: y("auth.users.permanentlyDelete", "Permanently Delete")
|
|
807
801
|
})
|
|
808
802
|
]
|
|
809
803
|
})
|
|
810
804
|
]
|
|
811
805
|
})
|
|
812
806
|
]
|
|
813
|
-
}) : /* @__PURE__ */
|
|
807
|
+
}) : /* @__PURE__ */ m("div", {
|
|
814
808
|
className: "max-w-2xl mx-auto p-6",
|
|
815
809
|
children: [
|
|
816
|
-
|
|
817
|
-
/* @__PURE__ */
|
|
810
|
+
Q,
|
|
811
|
+
/* @__PURE__ */ m("button", {
|
|
818
812
|
type: "button",
|
|
819
813
|
onClick: () => {
|
|
820
|
-
|
|
814
|
+
j("list"), Z();
|
|
821
815
|
},
|
|
822
816
|
className: "mb-6 flex items-center gap-2 text-text-link hover:underline font-medium",
|
|
823
|
-
children: [/* @__PURE__ */
|
|
817
|
+
children: [/* @__PURE__ */ p("svg", {
|
|
824
818
|
className: "size-4",
|
|
825
819
|
fill: "none",
|
|
826
820
|
viewBox: "0 0 24 24",
|
|
827
821
|
stroke: "currentColor",
|
|
828
|
-
children: /* @__PURE__ */
|
|
822
|
+
children: /* @__PURE__ */ p("path", {
|
|
829
823
|
strokeLinecap: "round",
|
|
830
824
|
strokeLinejoin: "round",
|
|
831
825
|
strokeWidth: 2,
|
|
832
826
|
d: "M10 19l-7-7m0 0l7-7m-7 7h18"
|
|
833
827
|
})
|
|
834
|
-
}),
|
|
828
|
+
}), y("auth.users.backToUsers", "Back to Users")]
|
|
835
829
|
}),
|
|
836
|
-
/* @__PURE__ */
|
|
830
|
+
/* @__PURE__ */ m("div", {
|
|
837
831
|
className: "p-6 rounded-xl border border-border-subtle bg-bg-surface shadow-sm",
|
|
838
832
|
children: [
|
|
839
|
-
/* @__PURE__ */
|
|
833
|
+
/* @__PURE__ */ p("h1", {
|
|
840
834
|
className: "text-2xl font-semibold text-text-primary mb-2",
|
|
841
|
-
children:
|
|
835
|
+
children: y("auth.users.editUser", "Edit User")
|
|
842
836
|
}),
|
|
843
|
-
|
|
837
|
+
M && /* @__PURE__ */ m("p", {
|
|
844
838
|
className: "text-text-secondary mb-6",
|
|
845
839
|
children: [
|
|
846
|
-
|
|
840
|
+
y("auth.users.editingUser", "Editing:"),
|
|
847
841
|
" ",
|
|
848
|
-
/* @__PURE__ */
|
|
842
|
+
/* @__PURE__ */ p("strong", { children: M.email })
|
|
849
843
|
]
|
|
850
844
|
}),
|
|
851
|
-
|
|
845
|
+
I && /* @__PURE__ */ m("div", {
|
|
852
846
|
className: "mb-6 flex items-start gap-3 p-4 rounded-xl bg-status-error-bg-subtle border border-status-error-border",
|
|
853
|
-
children: [/* @__PURE__ */
|
|
847
|
+
children: [/* @__PURE__ */ p(s, { className: "size-5 text-status-error-text flex-shrink-0 mt-0.5" }), /* @__PURE__ */ p("div", {
|
|
854
848
|
className: "flex-1",
|
|
855
|
-
children: /* @__PURE__ */
|
|
849
|
+
children: /* @__PURE__ */ p("p", {
|
|
856
850
|
className: "text-sm text-status-error-text",
|
|
857
|
-
children:
|
|
851
|
+
children: I
|
|
858
852
|
})
|
|
859
853
|
})]
|
|
860
854
|
}),
|
|
861
|
-
/* @__PURE__ */
|
|
862
|
-
onSubmit:
|
|
855
|
+
/* @__PURE__ */ m("form", {
|
|
856
|
+
onSubmit: De,
|
|
863
857
|
className: "space-y-6",
|
|
864
|
-
"aria-describedby":
|
|
858
|
+
"aria-describedby": I ? _e : void 0,
|
|
865
859
|
noValidate: !0,
|
|
866
860
|
children: [
|
|
867
|
-
/* @__PURE__ */
|
|
861
|
+
/* @__PURE__ */ m("div", {
|
|
868
862
|
className: "grid grid-cols-2 gap-4",
|
|
869
|
-
children: [/* @__PURE__ */
|
|
863
|
+
children: [/* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("label", {
|
|
870
864
|
htmlFor: "edit-username",
|
|
871
865
|
className: "block text-sm font-medium text-text-primary mb-2",
|
|
872
|
-
children:
|
|
873
|
-
}), /* @__PURE__ */
|
|
866
|
+
children: y("auth.users.fieldUsername", "Username")
|
|
867
|
+
}), /* @__PURE__ */ p("input", {
|
|
874
868
|
id: "edit-username",
|
|
875
869
|
type: "text",
|
|
876
|
-
"aria-label":
|
|
877
|
-
value:
|
|
878
|
-
onChange: (e) =>
|
|
879
|
-
...
|
|
870
|
+
"aria-label": y("auth.users.fieldUsername", "Username"),
|
|
871
|
+
value: P.username,
|
|
872
|
+
onChange: (e) => F({
|
|
873
|
+
...P,
|
|
880
874
|
username: e.target.value
|
|
881
875
|
}),
|
|
882
876
|
className: "block w-full px-4 py-3 border border-border-default rounded-xl bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-action-primary-bg/20 focus:border-action-primary-bg transition-all"
|
|
883
|
-
})] }), /* @__PURE__ */
|
|
877
|
+
})] }), /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("label", {
|
|
884
878
|
htmlFor: "edit-name",
|
|
885
879
|
className: "block text-sm font-medium text-text-primary mb-2",
|
|
886
|
-
children:
|
|
887
|
-
}), /* @__PURE__ */
|
|
880
|
+
children: y("auth.users.fieldName", "Name")
|
|
881
|
+
}), /* @__PURE__ */ p("input", {
|
|
888
882
|
id: "edit-name",
|
|
889
883
|
type: "text",
|
|
890
|
-
"aria-label":
|
|
891
|
-
value:
|
|
892
|
-
onChange: (e) =>
|
|
893
|
-
...
|
|
884
|
+
"aria-label": y("auth.users.fieldName", "Name"),
|
|
885
|
+
value: P.name,
|
|
886
|
+
onChange: (e) => F({
|
|
887
|
+
...P,
|
|
894
888
|
name: e.target.value
|
|
895
889
|
}),
|
|
896
890
|
className: "block w-full px-4 py-3 border border-border-default rounded-xl bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-action-primary-bg/20 focus:border-action-primary-bg transition-all"
|
|
897
891
|
})] })]
|
|
898
892
|
}),
|
|
899
|
-
/* @__PURE__ */
|
|
893
|
+
/* @__PURE__ */ m("div", {
|
|
900
894
|
className: "grid grid-cols-2 gap-4",
|
|
901
|
-
children: [/* @__PURE__ */
|
|
895
|
+
children: [/* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("label", {
|
|
902
896
|
htmlFor: "edit-firstName",
|
|
903
897
|
className: "block text-sm font-medium text-text-primary mb-2",
|
|
904
|
-
children:
|
|
905
|
-
}), /* @__PURE__ */
|
|
898
|
+
children: y("auth.users.fieldFirstName", "First Name")
|
|
899
|
+
}), /* @__PURE__ */ p("input", {
|
|
906
900
|
id: "edit-firstName",
|
|
907
901
|
type: "text",
|
|
908
|
-
"aria-label":
|
|
909
|
-
value:
|
|
910
|
-
onChange: (e) =>
|
|
911
|
-
...
|
|
902
|
+
"aria-label": y("auth.users.fieldFirstName", "First Name"),
|
|
903
|
+
value: P.firstName,
|
|
904
|
+
onChange: (e) => F({
|
|
905
|
+
...P,
|
|
912
906
|
firstName: e.target.value
|
|
913
907
|
}),
|
|
914
908
|
className: "block w-full px-4 py-3 border border-border-default rounded-xl bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-action-primary-bg/20 focus:border-action-primary-bg transition-all"
|
|
915
|
-
})] }), /* @__PURE__ */
|
|
909
|
+
})] }), /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("label", {
|
|
916
910
|
htmlFor: "edit-lastName",
|
|
917
911
|
className: "block text-sm font-medium text-text-primary mb-2",
|
|
918
|
-
children:
|
|
919
|
-
}), /* @__PURE__ */
|
|
912
|
+
children: y("auth.users.fieldLastName", "Last Name")
|
|
913
|
+
}), /* @__PURE__ */ p("input", {
|
|
920
914
|
id: "edit-lastName",
|
|
921
915
|
type: "text",
|
|
922
|
-
"aria-label":
|
|
923
|
-
value:
|
|
924
|
-
onChange: (e) =>
|
|
925
|
-
...
|
|
916
|
+
"aria-label": y("auth.users.fieldLastName", "Last Name"),
|
|
917
|
+
value: P.lastName,
|
|
918
|
+
onChange: (e) => F({
|
|
919
|
+
...P,
|
|
926
920
|
lastName: e.target.value
|
|
927
921
|
}),
|
|
928
922
|
className: "block w-full px-4 py-3 border border-border-default rounded-xl bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-action-primary-bg/20 focus:border-action-primary-bg transition-all"
|
|
929
923
|
})] })]
|
|
930
924
|
}),
|
|
931
|
-
/* @__PURE__ */
|
|
932
|
-
/* @__PURE__ */
|
|
925
|
+
/* @__PURE__ */ m("div", { children: [
|
|
926
|
+
/* @__PURE__ */ p("label", {
|
|
933
927
|
htmlFor: "edit-phoneNumber",
|
|
934
928
|
className: "block text-sm font-medium text-text-primary mb-2",
|
|
935
|
-
children:
|
|
929
|
+
children: y("auth.users.fieldPhoneNumber", "Phone Number")
|
|
936
930
|
}),
|
|
937
|
-
/* @__PURE__ */
|
|
931
|
+
/* @__PURE__ */ p("input", {
|
|
938
932
|
id: "edit-phoneNumber",
|
|
939
933
|
type: "tel",
|
|
940
|
-
"aria-label":
|
|
941
|
-
"aria-invalid":
|
|
942
|
-
"aria-describedby":
|
|
943
|
-
value:
|
|
934
|
+
"aria-label": y("auth.users.fieldPhoneNumber", "Phone Number"),
|
|
935
|
+
"aria-invalid": R ? !0 : void 0,
|
|
936
|
+
"aria-describedby": R ? "edit-phoneNumber-error" : void 0,
|
|
937
|
+
value: P.phoneNumber,
|
|
944
938
|
onChange: (e) => {
|
|
945
|
-
|
|
946
|
-
...
|
|
939
|
+
F({
|
|
940
|
+
...P,
|
|
947
941
|
phoneNumber: e.target.value
|
|
948
|
-
}),
|
|
942
|
+
}), R && (z(null), L(null));
|
|
949
943
|
},
|
|
950
944
|
className: "block w-full px-4 py-3 border border-border-default rounded-xl bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-action-primary-bg/20 focus:border-action-primary-bg transition-all"
|
|
951
945
|
}),
|
|
952
|
-
|
|
946
|
+
R && /* @__PURE__ */ p("p", {
|
|
953
947
|
id: "edit-phoneNumber-error",
|
|
954
948
|
role: "alert",
|
|
955
949
|
className: "mt-2 text-sm text-[var(--color-status-error-text)]",
|
|
956
|
-
children:
|
|
950
|
+
children: R
|
|
957
951
|
})
|
|
958
952
|
] }),
|
|
959
|
-
/* @__PURE__ */
|
|
953
|
+
/* @__PURE__ */ m("div", {
|
|
960
954
|
className: "grid grid-cols-2 gap-4",
|
|
961
|
-
children: [/* @__PURE__ */
|
|
955
|
+
children: [/* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("label", {
|
|
962
956
|
htmlFor: "edit-role",
|
|
963
957
|
className: "block text-sm font-medium text-text-primary mb-2",
|
|
964
|
-
children:
|
|
965
|
-
}), /* @__PURE__ */
|
|
958
|
+
children: y("auth.users.fieldRole", "Role")
|
|
959
|
+
}), /* @__PURE__ */ p("select", {
|
|
966
960
|
id: "edit-role",
|
|
967
|
-
"aria-label":
|
|
968
|
-
value:
|
|
969
|
-
onChange: (e) =>
|
|
970
|
-
...
|
|
961
|
+
"aria-label": y("auth.users.fieldRole", "Role"),
|
|
962
|
+
value: P.role,
|
|
963
|
+
onChange: (e) => F({
|
|
964
|
+
...P,
|
|
971
965
|
role: e.target.value
|
|
972
966
|
}),
|
|
973
967
|
className: "block w-full px-4 py-3 border border-border-default rounded-xl bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-action-primary-bg/20 focus:border-action-primary-bg transition-all scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary",
|
|
974
|
-
children:
|
|
968
|
+
children: _.map((e) => /* @__PURE__ */ p("option", {
|
|
975
969
|
value: e,
|
|
976
970
|
children: e.replace("_", " ")
|
|
977
971
|
}, e))
|
|
978
|
-
})] }), /* @__PURE__ */
|
|
972
|
+
})] }), /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("label", {
|
|
979
973
|
htmlFor: "edit-status",
|
|
980
974
|
className: "block text-sm font-medium text-text-primary mb-2",
|
|
981
|
-
children:
|
|
982
|
-
}), /* @__PURE__ */
|
|
975
|
+
children: y("auth.users.fieldStatus", "Status")
|
|
976
|
+
}), /* @__PURE__ */ p("select", {
|
|
983
977
|
id: "edit-status",
|
|
984
|
-
"aria-label":
|
|
985
|
-
value:
|
|
986
|
-
onChange: (e) =>
|
|
987
|
-
...
|
|
978
|
+
"aria-label": y("auth.users.fieldStatus", "Status"),
|
|
979
|
+
value: P.status,
|
|
980
|
+
onChange: (e) => F({
|
|
981
|
+
...P,
|
|
988
982
|
status: e.target.value
|
|
989
983
|
}),
|
|
990
984
|
className: "block w-full px-4 py-3 border border-border-default rounded-xl bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-action-primary-bg/20 focus:border-action-primary-bg transition-all scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary",
|
|
991
|
-
children:
|
|
985
|
+
children: v.map((e) => /* @__PURE__ */ p("option", {
|
|
992
986
|
value: e,
|
|
993
987
|
children: e
|
|
994
988
|
}, e))
|
|
995
989
|
})] })]
|
|
996
990
|
}),
|
|
997
|
-
/* @__PURE__ */
|
|
991
|
+
/* @__PURE__ */ m("div", {
|
|
998
992
|
className: "flex items-center gap-3 p-4 rounded-xl bg-bg-canvas/50",
|
|
999
|
-
children: [/* @__PURE__ */
|
|
993
|
+
children: [/* @__PURE__ */ p("input", {
|
|
1000
994
|
type: "checkbox",
|
|
1001
995
|
id: "emailVerified",
|
|
1002
|
-
checked:
|
|
1003
|
-
onChange: (e) =>
|
|
1004
|
-
...
|
|
996
|
+
checked: P.emailVerified,
|
|
997
|
+
onChange: (e) => F({
|
|
998
|
+
...P,
|
|
1005
999
|
emailVerified: e.target.checked
|
|
1006
1000
|
}),
|
|
1007
1001
|
className: "size-5 rounded border-border-default text-text-link focus:ring-action-primary-bg"
|
|
1008
|
-
}), /* @__PURE__ */
|
|
1002
|
+
}), /* @__PURE__ */ p("label", {
|
|
1009
1003
|
htmlFor: "emailVerified",
|
|
1010
1004
|
className: "text-sm font-medium text-text-primary",
|
|
1011
|
-
children:
|
|
1005
|
+
children: y("auth.users.fieldEmailVerified", "Email Verified")
|
|
1012
1006
|
})]
|
|
1013
1007
|
}),
|
|
1014
|
-
/* @__PURE__ */
|
|
1008
|
+
/* @__PURE__ */ m("div", {
|
|
1015
1009
|
className: "flex gap-3 pt-6 mt-6 border-t border-border-default",
|
|
1016
|
-
children: [/* @__PURE__ */
|
|
1010
|
+
children: [/* @__PURE__ */ p(h, {
|
|
1017
1011
|
type: "submit",
|
|
1018
|
-
disabled:
|
|
1012
|
+
disabled: C,
|
|
1019
1013
|
variant: "default",
|
|
1020
1014
|
size: "lg",
|
|
1021
1015
|
className: "font-semibold",
|
|
1022
|
-
children:
|
|
1023
|
-
}), /* @__PURE__ */
|
|
1016
|
+
children: C ? /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p(c, { className: "size-4 animate-spin" }), y("auth.users.saving", "Saving...")] }) : y("auth.users.saveChanges", "Save Changes")
|
|
1017
|
+
}), /* @__PURE__ */ p("button", {
|
|
1024
1018
|
type: "button",
|
|
1025
1019
|
onClick: () => {
|
|
1026
|
-
|
|
1020
|
+
j("list"), Z();
|
|
1027
1021
|
},
|
|
1028
1022
|
className: "inline-flex items-center h-10 px-8 rounded-xl border border-border-default text-text-primary font-medium hover:bg-bg-sunken transition-colors",
|
|
1029
|
-
children:
|
|
1023
|
+
children: y("auth.users.cancel", "Cancel")
|
|
1030
1024
|
})]
|
|
1031
1025
|
})
|
|
1032
1026
|
]
|
|
@@ -1034,16 +1028,15 @@ function v() {
|
|
|
1034
1028
|
]
|
|
1035
1029
|
})
|
|
1036
1030
|
]
|
|
1037
|
-
}) : /* @__PURE__ */
|
|
1031
|
+
}) : /* @__PURE__ */ p("div", {
|
|
1038
1032
|
className: "max-w-6xl mx-auto p-6",
|
|
1039
|
-
children: /* @__PURE__ */
|
|
1033
|
+
children: /* @__PURE__ */ p(g, {
|
|
1040
1034
|
illustration: "empty-generic",
|
|
1041
|
-
title:
|
|
1042
|
-
description:
|
|
1035
|
+
title: y("auth.users.authRequired", "Authentication Required"),
|
|
1036
|
+
description: y("auth.users.signInToManage", "Please sign in to manage users")
|
|
1043
1037
|
})
|
|
1044
1038
|
});
|
|
1045
1039
|
}
|
|
1046
|
-
|
|
1047
|
-
export { v as UsersPage };
|
|
1040
|
+
export { y as UsersPage };
|
|
1048
1041
|
|
|
1049
1042
|
//# sourceMappingURL=UsersPage.js.map
|