@better-auth-ui/heroui 1.6.19 → 1.6.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/auth/auth.d.ts +2 -1
- package/dist/components/auth/forgot-password.d.ts +1 -1
- package/dist/components/auth/magic-link/magic-link.d.ts +1 -1
- package/dist/components/auth/reset-password.d.ts +1 -1
- package/dist/components/auth/sign-in.d.ts +1 -1
- package/dist/components/auth/sign-up.d.ts +1 -1
- package/dist/components/auth/username/sign-in-username.d.ts +1 -1
- package/dist/index.js +446 -447
- package/dist/lib/auth/auth-plugin.d.ts +4 -2
- package/dist/plugins.js +925 -927
- package/package.json +3 -3
- package/src/components/auth/auth.tsx +11 -6
- package/src/components/auth/forgot-password.tsx +1 -6
- package/src/components/auth/magic-link/magic-link.tsx +2 -4
- package/src/components/auth/reset-password.tsx +1 -6
- package/src/components/auth/sign-in.tsx +2 -4
- package/src/components/auth/sign-up.tsx +2 -4
- package/src/components/auth/user/user-button.tsx +2 -2
- package/src/components/auth/username/sign-in-username.tsx +2 -4
- package/src/lib/auth/auth-plugin.ts +4 -2
package/dist/plugins.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { a as e, r as t, t as n } from "./user-view--47tVtJ3.js";
|
|
3
3
|
import { authMutationKeys as r, authQueryKeys as i, createAuthPlugin as a, fileToBase64 as o } from "@better-auth-ui/core";
|
|
4
|
-
import { ThemePreviewDark as s, ThemePreviewLight as c, ThemePreviewSystem as l, useAcceptInvitation as u, useActiveOrganization as d, useAddPasskey as f, useAuth as p, useAuthPlugin as m, useAuthenticate as h, useCancelInvitation as g, useCheckSlug as _, useCreateApiKey as v, useCreateOrganization as y, useDeleteApiKey as b, useDeleteOrganization as x, useDeletePasskey as S, useDeleteUser as C, useFetchOptions as
|
|
5
|
-
import { ArrowRightArrowLeft as
|
|
6
|
-
import { AlertDialog as
|
|
7
|
-
import { useEffect as
|
|
8
|
-
import { Fragment as
|
|
9
|
-
import { useIsMutating as
|
|
10
|
-
import { apiKeyPlugin as
|
|
11
|
-
import { buttonVariants as
|
|
12
|
-
import { useDebouncer as
|
|
4
|
+
import { ThemePreviewDark as s, ThemePreviewLight as c, ThemePreviewSystem as l, useAcceptInvitation as u, useActiveOrganization as d, useAddPasskey as f, useAuth as p, useAuthPlugin as m, useAuthenticate as h, useCancelInvitation as g, useCheckSlug as _, useCreateApiKey as v, useCreateOrganization as y, useDeleteApiKey as b, useDeleteOrganization as x, useDeletePasskey as S, useDeleteUser as C, useFetchOptions as ee, useHasPermission as w, useInviteMember as te, useIsUsernameAvailable as ne, useLeaveOrganization as re, useListAccounts as ie, useListApiKeys as ae, useListDeviceSessions as oe, useListOrganizationInvitations as se, useListOrganizationMembers as ce, useListOrganizations as le, useListPasskeys as ue, useListUserInvitations as de, useRejectInvitation as fe, useRemoveMember as pe, useRevokeMultiSession as me, useSendVerificationEmail as he, useSession as T, useSetActiveOrganization as ge, useSetActiveSession as _e, useSignInEmail as ve, useSignInMagicLink as ye, useSignInPasskey as be, useSignInUsername as xe, useUpdateMemberRole as Se, useUpdateOrganization as Ce, useUser as we } from "@better-auth-ui/react";
|
|
5
|
+
import { ArrowRightArrowLeft as Te, ArrowRightFromSquare as Ee, Briefcase as De, Check as Oe, ChevronUp as ke, ChevronsExpandVertical as Ae, CirclePlus as je, Clock as Me, CloudArrowUpIn as Ne, Copy as Pe, Display as Fe, Ellipsis as Ie, Envelope as Le, Fingerprint as Re, Funnel as ze, Gear as Be, Key as Ve, Lock as He, Moon as Ue, Palette as We, PaperPlane as Ge, Pencil as Ke, Person as qe, PersonPlus as Je, Sun as Ye, TrashBin as Xe, TriangleExclamation as Ze, Xmark as E } from "@gravity-ui/icons";
|
|
6
|
+
import { AlertDialog as D, Avatar as Qe, Button as O, Card as k, Checkbox as $e, Chip as A, Description as et, Dropdown as j, EmptyState as tt, FieldError as M, Form as N, Input as P, InputGroup as F, Label as I, Link as nt, ListBox as rt, Radio as L, RadioGroup as it, SearchField as R, Select as at, Skeleton as z, Spinner as B, Table as V, Tabs as H, TextField as U, cn as W, toast as G, useIsHydrated as ot } from "@heroui/react";
|
|
7
|
+
import { useEffect as st, useMemo as ct, useRef as lt, useState as K } from "react";
|
|
8
|
+
import { Fragment as q, jsx as J, jsxs as Y } from "react/jsx-runtime";
|
|
9
|
+
import { useIsMutating as X, useQueryClient as ut } from "@tanstack/react-query";
|
|
10
|
+
import { apiKeyPlugin as dt, deleteUserPlugin as ft, magicLinkPlugin as pt, multiSessionPlugin as mt, organizationPlugin as ht, passkeyPlugin as gt, themePlugin as _t, usernamePlugin as vt } from "@better-auth-ui/core/plugins";
|
|
11
|
+
import { buttonVariants as yt } from "@heroui/styles";
|
|
12
|
+
import { useDebouncer as bt } from "@tanstack/react-pacer";
|
|
13
13
|
//#region src/components/auth/api-key/organization-api-keys.tsx
|
|
14
|
-
function
|
|
15
|
-
let { authClient: n } = p(), { data: r } =
|
|
16
|
-
return o?.members.some((e) => e.role === "owner" && e.userId === r?.user.id) ? /* @__PURE__ */
|
|
14
|
+
function xt({ className: e, variant: t }) {
|
|
15
|
+
let { authClient: n } = p(), { data: r } = T(n), { data: i, isPending: a } = d(n), { data: o } = ce(n);
|
|
16
|
+
return o?.members.some((e) => e.role === "owner" && e.userId === r?.user.id) ? /* @__PURE__ */ J(kt, {
|
|
17
17
|
className: e,
|
|
18
18
|
variant: t,
|
|
19
19
|
organizationId: i?.id,
|
|
@@ -22,55 +22,55 @@ function bt({ className: e, variant: t }) {
|
|
|
22
22
|
}
|
|
23
23
|
//#endregion
|
|
24
24
|
//#region src/lib/auth/api-key-plugin.ts
|
|
25
|
-
var
|
|
26
|
-
let t =
|
|
25
|
+
var St = a(dt.id, (e = {}) => {
|
|
26
|
+
let t = dt(e);
|
|
27
27
|
return {
|
|
28
28
|
...t,
|
|
29
|
-
securityCards: [
|
|
30
|
-
...t.organization ? { organizationCards: [
|
|
29
|
+
securityCards: [kt],
|
|
30
|
+
...t.organization ? { organizationCards: [xt] } : {}
|
|
31
31
|
};
|
|
32
32
|
});
|
|
33
33
|
//#endregion
|
|
34
34
|
//#region src/components/auth/api-key/delete-api-key-dialog.tsx
|
|
35
|
-
function
|
|
36
|
-
let { authClient: i, localization: a } = p(), { localization: o } = m(
|
|
37
|
-
return /* @__PURE__ */
|
|
35
|
+
function Ct({ isOpen: e, onOpenChange: t, apiKey: n, organizationId: r }) {
|
|
36
|
+
let { authClient: i, localization: a } = p(), { localization: o } = m(St), s = `${n.start}${"*".repeat(16)}`, { mutate: c, isPending: l } = b(i, { onSuccess: () => t(!1) });
|
|
37
|
+
return /* @__PURE__ */ J(D.Backdrop, {
|
|
38
38
|
isOpen: e,
|
|
39
39
|
onOpenChange: t,
|
|
40
|
-
children: /* @__PURE__ */
|
|
41
|
-
/* @__PURE__ */
|
|
42
|
-
/* @__PURE__ */
|
|
40
|
+
children: /* @__PURE__ */ J(D.Container, { children: /* @__PURE__ */ Y(D.Dialog, { children: [
|
|
41
|
+
/* @__PURE__ */ J(D.CloseTrigger, {}),
|
|
42
|
+
/* @__PURE__ */ Y(D.Header, { children: [/* @__PURE__ */ J(D.Icon, {
|
|
43
43
|
status: "danger",
|
|
44
|
-
children: /* @__PURE__ */
|
|
45
|
-
}), /* @__PURE__ */
|
|
46
|
-
/* @__PURE__ */
|
|
44
|
+
children: /* @__PURE__ */ J(Ve, {})
|
|
45
|
+
}), /* @__PURE__ */ J(D.Heading, { children: o.deleteApiKey })] }),
|
|
46
|
+
/* @__PURE__ */ Y(D.Body, {
|
|
47
47
|
className: "flex flex-col gap-4 overflow-visible",
|
|
48
|
-
children: [/* @__PURE__ */
|
|
48
|
+
children: [/* @__PURE__ */ J("p", {
|
|
49
49
|
className: "text-muted text-sm",
|
|
50
50
|
children: o.deleteApiKeyWarning
|
|
51
|
-
}), /* @__PURE__ */
|
|
51
|
+
}), /* @__PURE__ */ Y(U, {
|
|
52
52
|
value: s,
|
|
53
53
|
className: "font-mono text-xs",
|
|
54
54
|
variant: "secondary",
|
|
55
|
-
children: [/* @__PURE__ */
|
|
55
|
+
children: [/* @__PURE__ */ J(I, { children: n.name || o.apiKey }), /* @__PURE__ */ J(P, {
|
|
56
56
|
readOnly: !0,
|
|
57
57
|
className: "font-mono text-xs"
|
|
58
58
|
})]
|
|
59
59
|
})]
|
|
60
60
|
}),
|
|
61
|
-
/* @__PURE__ */
|
|
61
|
+
/* @__PURE__ */ Y(D.Footer, { children: [/* @__PURE__ */ J(O, {
|
|
62
62
|
slot: "close",
|
|
63
63
|
variant: "tertiary",
|
|
64
64
|
isDisabled: l,
|
|
65
65
|
children: a.settings.cancel
|
|
66
|
-
}), /* @__PURE__ */
|
|
66
|
+
}), /* @__PURE__ */ Y(O, {
|
|
67
67
|
variant: "danger",
|
|
68
68
|
onPress: () => c({
|
|
69
69
|
keyId: n.id,
|
|
70
70
|
...r ? { configId: "organization" } : {}
|
|
71
71
|
}),
|
|
72
72
|
isPending: l,
|
|
73
|
-
children: [l && /* @__PURE__ */
|
|
73
|
+
children: [l && /* @__PURE__ */ J(B, {
|
|
74
74
|
color: "current",
|
|
75
75
|
size: "sm"
|
|
76
76
|
}), o.deleteApiKey]
|
|
@@ -80,27 +80,27 @@ function St({ isOpen: e, onOpenChange: t, apiKey: n, organizationId: r }) {
|
|
|
80
80
|
}
|
|
81
81
|
//#endregion
|
|
82
82
|
//#region src/components/auth/api-key/api-key.tsx
|
|
83
|
-
function
|
|
84
|
-
let { localization: r } = p(), { localization: i } = m(
|
|
85
|
-
return /* @__PURE__ */
|
|
83
|
+
function wt({ apiKey: e, hideDelete: t, organizationId: n }) {
|
|
84
|
+
let { localization: r } = p(), { localization: i } = m(St), [a, o] = K(!1), s = `${e.start}${"*".repeat(16)}`;
|
|
85
|
+
return /* @__PURE__ */ Y("div", {
|
|
86
86
|
className: "flex items-center gap-3",
|
|
87
87
|
children: [
|
|
88
|
-
/* @__PURE__ */
|
|
88
|
+
/* @__PURE__ */ J("div", {
|
|
89
89
|
className: "flex size-10 shrink-0 items-center justify-center rounded-xl bg-surface-secondary",
|
|
90
|
-
children: /* @__PURE__ */
|
|
90
|
+
children: /* @__PURE__ */ J(Ve, { className: "size-4.5" })
|
|
91
91
|
}),
|
|
92
|
-
/* @__PURE__ */
|
|
92
|
+
/* @__PURE__ */ Y("div", {
|
|
93
93
|
className: "flex flex-col min-w-0",
|
|
94
94
|
children: [
|
|
95
|
-
/* @__PURE__ */
|
|
95
|
+
/* @__PURE__ */ J("span", {
|
|
96
96
|
className: "text-sm font-medium leading-tight truncate",
|
|
97
97
|
children: e.name || i.apiKey
|
|
98
98
|
}),
|
|
99
|
-
/* @__PURE__ */
|
|
99
|
+
/* @__PURE__ */ J("span", {
|
|
100
100
|
className: "text-xs text-muted font-mono truncate",
|
|
101
101
|
children: s
|
|
102
102
|
}),
|
|
103
|
-
/* @__PURE__ */
|
|
103
|
+
/* @__PURE__ */ J("span", {
|
|
104
104
|
className: "text-xs text-muted",
|
|
105
105
|
children: new Date(e.createdAt).toLocaleString(void 0, {
|
|
106
106
|
dateStyle: "medium",
|
|
@@ -109,14 +109,14 @@ function Ct({ apiKey: e, hideDelete: t, organizationId: n }) {
|
|
|
109
109
|
})
|
|
110
110
|
]
|
|
111
111
|
}),
|
|
112
|
-
!t && /* @__PURE__ */
|
|
112
|
+
!t && /* @__PURE__ */ Y(q, { children: [/* @__PURE__ */ Y(O, {
|
|
113
113
|
className: "ml-auto shrink-0",
|
|
114
114
|
variant: "outline",
|
|
115
115
|
size: "sm",
|
|
116
116
|
onPress: () => o(!0),
|
|
117
117
|
"aria-label": i.deleteApiKey,
|
|
118
|
-
children: [/* @__PURE__ */
|
|
119
|
-
}), /* @__PURE__ */
|
|
118
|
+
children: [/* @__PURE__ */ J(E, {}), r.settings.delete]
|
|
119
|
+
}), /* @__PURE__ */ J(Ct, {
|
|
120
120
|
isOpen: a,
|
|
121
121
|
onOpenChange: o,
|
|
122
122
|
apiKey: e,
|
|
@@ -127,17 +127,17 @@ function Ct({ apiKey: e, hideDelete: t, organizationId: n }) {
|
|
|
127
127
|
}
|
|
128
128
|
//#endregion
|
|
129
129
|
//#region src/components/auth/api-key/api-key-skeleton.tsx
|
|
130
|
-
function
|
|
131
|
-
return /* @__PURE__ */
|
|
130
|
+
function Tt() {
|
|
131
|
+
return /* @__PURE__ */ J("div", {
|
|
132
132
|
className: "flex items-center justify-between",
|
|
133
|
-
children: /* @__PURE__ */
|
|
133
|
+
children: /* @__PURE__ */ Y("div", {
|
|
134
134
|
className: "flex items-center gap-3",
|
|
135
|
-
children: [/* @__PURE__ */
|
|
135
|
+
children: [/* @__PURE__ */ J(z, { className: "size-10 rounded-xl" }), /* @__PURE__ */ Y("div", {
|
|
136
136
|
className: "flex flex-col gap-1",
|
|
137
137
|
children: [
|
|
138
|
-
/* @__PURE__ */
|
|
139
|
-
/* @__PURE__ */
|
|
140
|
-
/* @__PURE__ */
|
|
138
|
+
/* @__PURE__ */ J(z, { className: "h-4 w-28 rounded-lg" }),
|
|
139
|
+
/* @__PURE__ */ J(z, { className: "h-3 w-36 rounded-lg" }),
|
|
140
|
+
/* @__PURE__ */ J(z, { className: "h-3 w-32 rounded-lg" })
|
|
141
141
|
]
|
|
142
142
|
})]
|
|
143
143
|
})
|
|
@@ -145,26 +145,26 @@ function wt() {
|
|
|
145
145
|
}
|
|
146
146
|
//#endregion
|
|
147
147
|
//#region src/components/auth/api-key/api-keys-empty.tsx
|
|
148
|
-
function
|
|
149
|
-
let { localization: n } = m(
|
|
150
|
-
return /* @__PURE__ */
|
|
148
|
+
function Et({ onCreatePress: e, hideCreate: t }) {
|
|
149
|
+
let { localization: n } = m(St);
|
|
150
|
+
return /* @__PURE__ */ Y("div", {
|
|
151
151
|
className: "flex flex-col items-center justify-center gap-4",
|
|
152
152
|
children: [
|
|
153
|
-
/* @__PURE__ */
|
|
153
|
+
/* @__PURE__ */ J("div", {
|
|
154
154
|
className: "flex size-10 items-center justify-center rounded-xl bg-surface-secondary",
|
|
155
|
-
children: /* @__PURE__ */
|
|
155
|
+
children: /* @__PURE__ */ J(Ve, { className: "size-4.5" })
|
|
156
156
|
}),
|
|
157
|
-
/* @__PURE__ */
|
|
157
|
+
/* @__PURE__ */ Y("div", {
|
|
158
158
|
className: "flex flex-col items-center justify-center gap-1 text-center",
|
|
159
|
-
children: [/* @__PURE__ */
|
|
159
|
+
children: [/* @__PURE__ */ J("p", {
|
|
160
160
|
className: "text-sm font-semibold",
|
|
161
161
|
children: n.noApiKeys
|
|
162
|
-
}), /* @__PURE__ */
|
|
162
|
+
}), /* @__PURE__ */ J("p", {
|
|
163
163
|
className: "text-muted text-xs",
|
|
164
164
|
children: n.apiKeysDescription
|
|
165
165
|
})]
|
|
166
166
|
}),
|
|
167
|
-
!t && /* @__PURE__ */
|
|
167
|
+
!t && /* @__PURE__ */ J(O, {
|
|
168
168
|
size: "sm",
|
|
169
169
|
onPress: e,
|
|
170
170
|
children: n.createApiKey
|
|
@@ -174,33 +174,33 @@ function Tt({ onCreatePress: e, hideCreate: t }) {
|
|
|
174
174
|
}
|
|
175
175
|
//#endregion
|
|
176
176
|
//#region src/components/auth/api-key/new-api-key-dialog.tsx
|
|
177
|
-
function
|
|
178
|
-
let { localization: i } = p(), { localization: a } = m(
|
|
179
|
-
return /* @__PURE__ */
|
|
177
|
+
function Dt({ isOpen: e, onOpenChange: t, name: n, secretKey: r }) {
|
|
178
|
+
let { localization: i } = p(), { localization: a } = m(St), [o, s] = K(!1);
|
|
179
|
+
return /* @__PURE__ */ J(D.Backdrop, {
|
|
180
180
|
isOpen: e,
|
|
181
181
|
onOpenChange: t,
|
|
182
|
-
children: /* @__PURE__ */
|
|
183
|
-
/* @__PURE__ */
|
|
184
|
-
/* @__PURE__ */
|
|
182
|
+
children: /* @__PURE__ */ J(D.Container, { children: /* @__PURE__ */ Y(D.Dialog, { children: [
|
|
183
|
+
/* @__PURE__ */ J(D.CloseTrigger, {}),
|
|
184
|
+
/* @__PURE__ */ Y(D.Header, { children: [/* @__PURE__ */ J(D.Icon, {
|
|
185
185
|
status: "warning",
|
|
186
|
-
children: /* @__PURE__ */
|
|
187
|
-
}), /* @__PURE__ */
|
|
188
|
-
/* @__PURE__ */
|
|
186
|
+
children: /* @__PURE__ */ J(Ve, {})
|
|
187
|
+
}), /* @__PURE__ */ J(D.Heading, { children: a.newApiKey })] }),
|
|
188
|
+
/* @__PURE__ */ Y(D.Body, {
|
|
189
189
|
className: "flex flex-col gap-4 overflow-visible",
|
|
190
|
-
children: [/* @__PURE__ */
|
|
190
|
+
children: [/* @__PURE__ */ J("p", {
|
|
191
191
|
className: "text-muted text-sm",
|
|
192
192
|
children: a.newApiKeyWarning
|
|
193
|
-
}), /* @__PURE__ */
|
|
193
|
+
}), /* @__PURE__ */ Y(U, {
|
|
194
194
|
value: r ?? "",
|
|
195
195
|
className: "font-mono text-xs",
|
|
196
|
-
children: [/* @__PURE__ */
|
|
196
|
+
children: [/* @__PURE__ */ J(I, { children: n || a.apiKey }), /* @__PURE__ */ Y(F, {
|
|
197
197
|
variant: "secondary",
|
|
198
|
-
children: [/* @__PURE__ */
|
|
198
|
+
children: [/* @__PURE__ */ J(F.Input, {
|
|
199
199
|
readOnly: !0,
|
|
200
200
|
className: "font-mono text-xs"
|
|
201
|
-
}), /* @__PURE__ */
|
|
201
|
+
}), /* @__PURE__ */ J(F.Suffix, {
|
|
202
202
|
className: "px-0",
|
|
203
|
-
children: /* @__PURE__ */
|
|
203
|
+
children: /* @__PURE__ */ J(O, {
|
|
204
204
|
isIconOnly: !0,
|
|
205
205
|
"aria-label": i.settings.copyToClipboard,
|
|
206
206
|
size: "sm",
|
|
@@ -209,16 +209,16 @@ function Et({ isOpen: e, onOpenChange: t, name: n, secretKey: r }) {
|
|
|
209
209
|
if (r) try {
|
|
210
210
|
await navigator.clipboard.writeText(r), s(!0), setTimeout(() => s(!1), 1500);
|
|
211
211
|
} catch (e) {
|
|
212
|
-
|
|
212
|
+
G.danger(e instanceof Error ? e.message : String(e));
|
|
213
213
|
}
|
|
214
214
|
},
|
|
215
|
-
children:
|
|
215
|
+
children: J(o ? Oe : Pe, {})
|
|
216
216
|
})
|
|
217
217
|
})]
|
|
218
218
|
})]
|
|
219
219
|
})]
|
|
220
220
|
}),
|
|
221
|
-
/* @__PURE__ */
|
|
221
|
+
/* @__PURE__ */ J(D.Footer, { children: /* @__PURE__ */ J(O, {
|
|
222
222
|
slot: "close",
|
|
223
223
|
children: a.dismissNewKey
|
|
224
224
|
}) })
|
|
@@ -227,14 +227,14 @@ function Et({ isOpen: e, onOpenChange: t, name: n, secretKey: r }) {
|
|
|
227
227
|
}
|
|
228
228
|
//#endregion
|
|
229
229
|
//#region src/components/auth/api-key/create-api-key-dialog.tsx
|
|
230
|
-
function
|
|
231
|
-
let { authClient: r, localization: i } = p(), { localization: a } = m(
|
|
230
|
+
function Ot({ isOpen: e, onOpenChange: t, organizationId: n }) {
|
|
231
|
+
let { authClient: r, localization: i } = p(), { localization: a } = m(St), { mutate: o, isPending: s } = v(r), [c, l] = K(!1), [u, d] = K(null), [f, h] = K(null), g = (e) => {
|
|
232
232
|
e || (d(null), h(null)), t(e);
|
|
233
233
|
};
|
|
234
|
-
return /* @__PURE__ */
|
|
234
|
+
return /* @__PURE__ */ Y(q, { children: [/* @__PURE__ */ J(D.Backdrop, {
|
|
235
235
|
isOpen: e,
|
|
236
236
|
onOpenChange: g,
|
|
237
|
-
children: /* @__PURE__ */
|
|
237
|
+
children: /* @__PURE__ */ J(D.Container, { children: /* @__PURE__ */ J(D.Dialog, { children: /* @__PURE__ */ Y(N, {
|
|
238
238
|
onSubmit: (e) => {
|
|
239
239
|
e.preventDefault();
|
|
240
240
|
let t = new FormData(e.target).get("name")?.trim();
|
|
@@ -249,48 +249,48 @@ function Dt({ isOpen: e, onOpenChange: t, organizationId: n }) {
|
|
|
249
249
|
} });
|
|
250
250
|
},
|
|
251
251
|
children: [
|
|
252
|
-
/* @__PURE__ */
|
|
253
|
-
/* @__PURE__ */
|
|
252
|
+
/* @__PURE__ */ J(D.CloseTrigger, {}),
|
|
253
|
+
/* @__PURE__ */ Y(D.Header, { children: [/* @__PURE__ */ J(D.Icon, {
|
|
254
254
|
status: "default",
|
|
255
|
-
children: /* @__PURE__ */
|
|
256
|
-
}), /* @__PURE__ */
|
|
257
|
-
/* @__PURE__ */
|
|
255
|
+
children: /* @__PURE__ */ J(Ve, {})
|
|
256
|
+
}), /* @__PURE__ */ J(D.Heading, { children: a.createApiKey })] }),
|
|
257
|
+
/* @__PURE__ */ Y(D.Body, {
|
|
258
258
|
className: "overflow-visible",
|
|
259
|
-
children: [/* @__PURE__ */
|
|
259
|
+
children: [/* @__PURE__ */ J("p", {
|
|
260
260
|
className: "text-muted text-sm",
|
|
261
261
|
children: a.apiKeysDescription
|
|
262
|
-
}), /* @__PURE__ */
|
|
262
|
+
}), /* @__PURE__ */ Y(U, {
|
|
263
263
|
className: "mt-4",
|
|
264
264
|
id: "name",
|
|
265
265
|
name: "name",
|
|
266
266
|
isDisabled: s,
|
|
267
267
|
children: [
|
|
268
|
-
/* @__PURE__ */
|
|
269
|
-
/* @__PURE__ */
|
|
268
|
+
/* @__PURE__ */ J(I, { children: a.name }),
|
|
269
|
+
/* @__PURE__ */ J(P, {
|
|
270
270
|
autoFocus: !0,
|
|
271
271
|
placeholder: i.settings.optional,
|
|
272
272
|
variant: "secondary"
|
|
273
273
|
}),
|
|
274
|
-
/* @__PURE__ */
|
|
274
|
+
/* @__PURE__ */ J(M, {})
|
|
275
275
|
]
|
|
276
276
|
})]
|
|
277
277
|
}),
|
|
278
|
-
/* @__PURE__ */
|
|
278
|
+
/* @__PURE__ */ Y(D.Footer, { children: [/* @__PURE__ */ J(O, {
|
|
279
279
|
slot: "close",
|
|
280
280
|
variant: "tertiary",
|
|
281
281
|
isDisabled: s,
|
|
282
282
|
children: i.settings.cancel
|
|
283
|
-
}), /* @__PURE__ */
|
|
283
|
+
}), /* @__PURE__ */ Y(O, {
|
|
284
284
|
type: "submit",
|
|
285
285
|
isPending: s,
|
|
286
|
-
children: [s && /* @__PURE__ */
|
|
286
|
+
children: [s && /* @__PURE__ */ J(B, {
|
|
287
287
|
color: "current",
|
|
288
288
|
size: "sm"
|
|
289
289
|
}), a.createApiKey]
|
|
290
290
|
})] })
|
|
291
291
|
]
|
|
292
292
|
}) }) })
|
|
293
|
-
}), /* @__PURE__ */
|
|
293
|
+
}), /* @__PURE__ */ J(Dt, {
|
|
294
294
|
isOpen: c,
|
|
295
295
|
onOpenChange: l,
|
|
296
296
|
secretKey: f,
|
|
@@ -299,23 +299,23 @@ function Dt({ isOpen: e, onOpenChange: t, organizationId: n }) {
|
|
|
299
299
|
}
|
|
300
300
|
//#endregion
|
|
301
301
|
//#region src/components/auth/api-key/api-keys.tsx
|
|
302
|
-
function
|
|
303
|
-
let { authClient: o } = p(), { localization: s } = m(
|
|
302
|
+
function kt({ className: e, variant: t, organizationId: n, isPending: r, hideCreate: i, hideDelete: a }) {
|
|
303
|
+
let { authClient: o } = p(), { localization: s } = m(St), { data: c, isPending: l } = ae(o, {
|
|
304
304
|
enabled: !r,
|
|
305
305
|
...n ? { query: {
|
|
306
306
|
organizationId: n,
|
|
307
307
|
configId: "organization"
|
|
308
308
|
} } : {}
|
|
309
|
-
}), u = r || l, [d, f] =
|
|
310
|
-
return /* @__PURE__ */
|
|
311
|
-
className:
|
|
309
|
+
}), u = r || l, [d, f] = K(!1);
|
|
310
|
+
return /* @__PURE__ */ Y("div", {
|
|
311
|
+
className: W("flex flex-col gap-3", e),
|
|
312
312
|
children: [
|
|
313
|
-
/* @__PURE__ */
|
|
313
|
+
/* @__PURE__ */ Y("div", {
|
|
314
314
|
className: "flex items-end justify-between gap-3",
|
|
315
|
-
children: [/* @__PURE__ */
|
|
315
|
+
children: [/* @__PURE__ */ J("h2", {
|
|
316
316
|
className: "text-sm font-semibold truncate",
|
|
317
317
|
children: s.apiKeys
|
|
318
|
-
}), !i && /* @__PURE__ */
|
|
318
|
+
}), !i && /* @__PURE__ */ J(O, {
|
|
319
319
|
className: "shrink-0",
|
|
320
320
|
size: "sm",
|
|
321
321
|
isDisabled: u,
|
|
@@ -323,18 +323,18 @@ function Ot({ className: e, variant: t, organizationId: n, isPending: r, hideCre
|
|
|
323
323
|
children: s.createApiKey
|
|
324
324
|
})]
|
|
325
325
|
}),
|
|
326
|
-
/* @__PURE__ */
|
|
326
|
+
/* @__PURE__ */ J(k, {
|
|
327
327
|
variant: t,
|
|
328
|
-
children: /* @__PURE__ */
|
|
328
|
+
children: /* @__PURE__ */ J(k.Content, { children: u ? /* @__PURE__ */ J(Tt, {}) : c?.apiKeys.length ? c?.apiKeys.map((e, t) => /* @__PURE__ */ Y("div", { children: [t > 0 && /* @__PURE__ */ J("div", { className: "border-b border-dashed -mx-4 my-4" }), /* @__PURE__ */ J(wt, {
|
|
329
329
|
apiKey: e,
|
|
330
330
|
hideDelete: a,
|
|
331
331
|
organizationId: n
|
|
332
|
-
})] }, e.id)) : /* @__PURE__ */
|
|
332
|
+
})] }, e.id)) : /* @__PURE__ */ J(Et, {
|
|
333
333
|
onCreatePress: () => f(!0),
|
|
334
334
|
hideCreate: i
|
|
335
335
|
}) })
|
|
336
336
|
}),
|
|
337
|
-
!i && /* @__PURE__ */
|
|
337
|
+
!i && /* @__PURE__ */ J(Ot, {
|
|
338
338
|
isOpen: d,
|
|
339
339
|
onOpenChange: f,
|
|
340
340
|
organizationId: n
|
|
@@ -344,58 +344,58 @@ function Ot({ className: e, variant: t, organizationId: n, isPending: r, hideCre
|
|
|
344
344
|
}
|
|
345
345
|
//#endregion
|
|
346
346
|
//#region src/lib/auth/delete-user-plugin.ts
|
|
347
|
-
var
|
|
348
|
-
...
|
|
349
|
-
securityCards: [
|
|
347
|
+
var At = a(ft.id, (e = {}) => ({
|
|
348
|
+
...ft(e),
|
|
349
|
+
securityCards: [Mt]
|
|
350
350
|
}));
|
|
351
351
|
//#endregion
|
|
352
352
|
//#region src/components/auth/delete-user/delete-account.tsx
|
|
353
|
-
function
|
|
354
|
-
let { authClient: r, basePaths: a, localization: o, navigate: s, viewPaths: c } = p(), { localization: l, sendDeleteAccountVerification: u } = m(
|
|
353
|
+
function jt({ className: e, variant: t, ...n }) {
|
|
354
|
+
let { authClient: r, basePaths: a, localization: o, navigate: s, viewPaths: c } = p(), { localization: l, sendDeleteAccountVerification: u } = m(At), { data: d } = ie(r), f = ut(), [h, g] = K(!1), [_, v] = K(""), y = d?.some((e) => e.providerId === "credential"), b = !u && y, { mutate: x, isPending: S } = C(r), ee = (e) => {
|
|
355
355
|
g(e), v("");
|
|
356
|
-
},
|
|
356
|
+
}, w = async (e) => {
|
|
357
357
|
e.preventDefault(), x({ ...b ? { password: _ } : {} }, { onSuccess: () => {
|
|
358
|
-
g(!1), v(""), u ?
|
|
358
|
+
g(!1), v(""), u ? G.success(l.deleteUserVerificationSent) : (G.success(l.deleteUserSuccess), f.removeQueries({ queryKey: i.all }), s({
|
|
359
359
|
to: `${a.auth}/${c.auth.signIn}`,
|
|
360
360
|
replace: !0
|
|
361
361
|
}));
|
|
362
362
|
} });
|
|
363
363
|
};
|
|
364
|
-
return /* @__PURE__ */
|
|
364
|
+
return /* @__PURE__ */ J(k, {
|
|
365
365
|
className: e,
|
|
366
366
|
variant: t,
|
|
367
367
|
...n,
|
|
368
|
-
children: /* @__PURE__ */
|
|
368
|
+
children: /* @__PURE__ */ Y(k.Content, {
|
|
369
369
|
className: "flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",
|
|
370
|
-
children: [/* @__PURE__ */
|
|
370
|
+
children: [/* @__PURE__ */ Y("div", { children: [/* @__PURE__ */ J("p", {
|
|
371
371
|
className: "text-sm font-medium leading-tight",
|
|
372
372
|
children: l.deleteAccount
|
|
373
|
-
}), /* @__PURE__ */
|
|
373
|
+
}), /* @__PURE__ */ J("p", {
|
|
374
374
|
className: "text-muted text-xs mt-0.5",
|
|
375
375
|
children: l.deleteAccountDescription
|
|
376
|
-
})] }), /* @__PURE__ */
|
|
376
|
+
})] }), /* @__PURE__ */ Y(D, { children: [/* @__PURE__ */ J(O, {
|
|
377
377
|
isDisabled: !d,
|
|
378
378
|
size: "sm",
|
|
379
379
|
variant: "danger-soft",
|
|
380
380
|
onPress: () => g(!0),
|
|
381
381
|
children: l.deleteAccount
|
|
382
|
-
}), /* @__PURE__ */
|
|
382
|
+
}), /* @__PURE__ */ J(D.Backdrop, {
|
|
383
383
|
isOpen: h,
|
|
384
|
-
onOpenChange:
|
|
385
|
-
children: /* @__PURE__ */
|
|
386
|
-
onSubmit:
|
|
384
|
+
onOpenChange: ee,
|
|
385
|
+
children: /* @__PURE__ */ J(D.Container, { children: /* @__PURE__ */ J(D.Dialog, { children: /* @__PURE__ */ Y(N, {
|
|
386
|
+
onSubmit: w,
|
|
387
387
|
children: [
|
|
388
|
-
/* @__PURE__ */
|
|
389
|
-
/* @__PURE__ */
|
|
388
|
+
/* @__PURE__ */ J(D.CloseTrigger, {}),
|
|
389
|
+
/* @__PURE__ */ Y(D.Header, { children: [/* @__PURE__ */ J(D.Icon, {
|
|
390
390
|
status: "danger",
|
|
391
|
-
children: /* @__PURE__ */
|
|
392
|
-
}), /* @__PURE__ */
|
|
393
|
-
/* @__PURE__ */
|
|
391
|
+
children: /* @__PURE__ */ J(Ze, {})
|
|
392
|
+
}), /* @__PURE__ */ J(D.Heading, { children: l.deleteAccount })] }),
|
|
393
|
+
/* @__PURE__ */ Y(D.Body, {
|
|
394
394
|
className: "overflow-visible",
|
|
395
|
-
children: [/* @__PURE__ */
|
|
395
|
+
children: [/* @__PURE__ */ J("p", {
|
|
396
396
|
className: "text-muted text-sm",
|
|
397
397
|
children: l.deleteAccountDescription
|
|
398
|
-
}), b && /* @__PURE__ */
|
|
398
|
+
}), b && /* @__PURE__ */ Y(U, {
|
|
399
399
|
className: "mt-4",
|
|
400
400
|
name: "password",
|
|
401
401
|
type: "password",
|
|
@@ -403,27 +403,27 @@ function At({ className: e, variant: t, ...n }) {
|
|
|
403
403
|
value: _,
|
|
404
404
|
onChange: v,
|
|
405
405
|
children: [
|
|
406
|
-
/* @__PURE__ */
|
|
407
|
-
/* @__PURE__ */
|
|
406
|
+
/* @__PURE__ */ J(I, { children: o.auth.password }),
|
|
407
|
+
/* @__PURE__ */ J(P, {
|
|
408
408
|
autoComplete: "current-password",
|
|
409
409
|
placeholder: o.auth.passwordPlaceholder,
|
|
410
410
|
required: !0,
|
|
411
411
|
variant: "secondary"
|
|
412
412
|
}),
|
|
413
|
-
/* @__PURE__ */
|
|
413
|
+
/* @__PURE__ */ J(M, {})
|
|
414
414
|
]
|
|
415
415
|
})]
|
|
416
416
|
}),
|
|
417
|
-
/* @__PURE__ */
|
|
417
|
+
/* @__PURE__ */ Y(D.Footer, { children: [/* @__PURE__ */ J(O, {
|
|
418
418
|
slot: "close",
|
|
419
419
|
variant: "tertiary",
|
|
420
420
|
isDisabled: S,
|
|
421
421
|
children: o.settings.cancel
|
|
422
|
-
}), /* @__PURE__ */
|
|
422
|
+
}), /* @__PURE__ */ Y(O, {
|
|
423
423
|
type: "submit",
|
|
424
424
|
variant: "danger",
|
|
425
425
|
isPending: S,
|
|
426
|
-
children: [S && /* @__PURE__ */
|
|
426
|
+
children: [S && /* @__PURE__ */ J(B, {
|
|
427
427
|
color: "current",
|
|
428
428
|
size: "sm"
|
|
429
429
|
}), l.deleteAccount]
|
|
@@ -436,106 +436,105 @@ function At({ className: e, variant: t, ...n }) {
|
|
|
436
436
|
}
|
|
437
437
|
//#endregion
|
|
438
438
|
//#region src/components/auth/delete-user/danger-zone.tsx
|
|
439
|
-
function
|
|
439
|
+
function Mt({ className: e, variant: t, ...n }) {
|
|
440
440
|
let { localization: r } = p();
|
|
441
|
-
return /* @__PURE__ */
|
|
442
|
-
className:
|
|
441
|
+
return /* @__PURE__ */ Y("div", {
|
|
442
|
+
className: W("flex w-full flex-col", e),
|
|
443
443
|
...n,
|
|
444
|
-
children: [/* @__PURE__ */
|
|
445
|
-
className:
|
|
444
|
+
children: [/* @__PURE__ */ J("h2", {
|
|
445
|
+
className: W("text-sm font-semibold mb-3 text-danger"),
|
|
446
446
|
children: r.settings.dangerZone
|
|
447
|
-
}), /* @__PURE__ */
|
|
447
|
+
}), /* @__PURE__ */ J(jt, { variant: t })]
|
|
448
448
|
});
|
|
449
449
|
}
|
|
450
450
|
//#endregion
|
|
451
451
|
//#region src/components/auth/magic-link/magic-link-button.tsx
|
|
452
|
-
function
|
|
453
|
-
let { basePaths: t, emailAndPassword: n, viewPaths: i, localization: a } = p(), o =
|
|
454
|
-
return l && !n?.enabled ? null : /* @__PURE__ */
|
|
452
|
+
function Nt({ view: e }) {
|
|
453
|
+
let { basePaths: t, emailAndPassword: n, viewPaths: i, localization: a } = p(), o = X({ mutationKey: r.signIn.all }) + X({ mutationKey: r.signUp.all }) > 0, { localization: s, viewPaths: c } = m(Pt), l = e === "magicLink";
|
|
454
|
+
return l && !n?.enabled ? null : /* @__PURE__ */ Y(nt, {
|
|
455
455
|
href: `${t.auth}/${l ? i.auth.signIn : c.auth.magicLink}`,
|
|
456
456
|
isDisabled: o,
|
|
457
|
-
className:
|
|
458
|
-
children: [
|
|
457
|
+
className: W(yt({ variant: "tertiary" }), "w-full gap-2", o && "status-disabled"),
|
|
458
|
+
children: [J(l ? He : Le, {}), a.auth.continueWith.replace("{{provider}}", l ? a.auth.password : s.magicLink)]
|
|
459
459
|
});
|
|
460
460
|
}
|
|
461
461
|
//#endregion
|
|
462
462
|
//#region src/lib/auth/magic-link-plugin.ts
|
|
463
|
-
var
|
|
464
|
-
...
|
|
465
|
-
authButtons: [
|
|
466
|
-
views: { auth: { magicLink:
|
|
467
|
-
fallbackViews: { auth: { signIn:
|
|
463
|
+
var Pt = a(pt.id, (e = {}) => ({
|
|
464
|
+
...pt(e),
|
|
465
|
+
authButtons: [Nt],
|
|
466
|
+
views: { auth: { magicLink: Ft } },
|
|
467
|
+
fallbackViews: { auth: { signIn: Ft } }
|
|
468
468
|
}));
|
|
469
469
|
//#endregion
|
|
470
470
|
//#region src/components/auth/magic-link/magic-link.tsx
|
|
471
|
-
function
|
|
472
|
-
let { authClient:
|
|
473
|
-
|
|
474
|
-
} }),
|
|
475
|
-
e.preventDefault(),
|
|
476
|
-
email:
|
|
477
|
-
callbackURL: `${
|
|
471
|
+
function Ft({ className: n, socialLayout: i, socialPosition: a = "bottom", variant: o }) {
|
|
472
|
+
let { authClient: s, basePaths: c, baseURL: l, emailAndPassword: u, localization: d, plugins: f, redirectTo: h, socialProviders: g, viewPaths: _ } = p(), { localization: v } = m(Pt), [y, b] = K(""), { mutate: x, isPending: S } = ye(s, { onSuccess: () => {
|
|
473
|
+
b(""), G.success(v.magicLinkSent);
|
|
474
|
+
} }), C = X({ mutationKey: r.signIn.all }) + X({ mutationKey: r.signUp.all }) > 0, ee = (e) => {
|
|
475
|
+
e.preventDefault(), x({
|
|
476
|
+
email: y,
|
|
477
|
+
callbackURL: `${l}${h}`
|
|
478
478
|
});
|
|
479
|
-
},
|
|
480
|
-
return /* @__PURE__ */
|
|
481
|
-
className:
|
|
479
|
+
}, w = !!g?.length;
|
|
480
|
+
return /* @__PURE__ */ Y(k, {
|
|
481
|
+
className: W("w-full max-w-sm gap-4 md:p-6", n),
|
|
482
482
|
variant: o,
|
|
483
|
-
...s,
|
|
484
483
|
children: [
|
|
485
|
-
/* @__PURE__ */
|
|
484
|
+
/* @__PURE__ */ J(k.Header, { children: /* @__PURE__ */ J(k.Title, {
|
|
486
485
|
className: "text-xl font-semibold mb-1",
|
|
487
|
-
children:
|
|
486
|
+
children: d.auth.signIn
|
|
488
487
|
}) }),
|
|
489
|
-
/* @__PURE__ */
|
|
488
|
+
/* @__PURE__ */ Y(k.Content, {
|
|
490
489
|
className: "gap-4",
|
|
491
490
|
children: [
|
|
492
|
-
a === "top" && /* @__PURE__ */
|
|
493
|
-
/* @__PURE__ */
|
|
494
|
-
onSubmit:
|
|
491
|
+
a === "top" && /* @__PURE__ */ Y(q, { children: [!!g?.length && /* @__PURE__ */ J(t, { socialLayout: i }), w && /* @__PURE__ */ J(e, { children: d.auth.or })] }),
|
|
492
|
+
/* @__PURE__ */ Y(N, {
|
|
493
|
+
onSubmit: ee,
|
|
495
494
|
className: "flex flex-col gap-4",
|
|
496
|
-
children: [/* @__PURE__ */
|
|
495
|
+
children: [/* @__PURE__ */ Y(U, {
|
|
497
496
|
name: "email",
|
|
498
497
|
type: "email",
|
|
499
498
|
autoComplete: "email",
|
|
500
|
-
isDisabled:
|
|
501
|
-
value:
|
|
502
|
-
onChange:
|
|
499
|
+
isDisabled: C,
|
|
500
|
+
value: y,
|
|
501
|
+
onChange: b,
|
|
503
502
|
children: [
|
|
504
|
-
/* @__PURE__ */
|
|
505
|
-
/* @__PURE__ */
|
|
506
|
-
placeholder:
|
|
503
|
+
/* @__PURE__ */ J(I, { children: d.auth.email }),
|
|
504
|
+
/* @__PURE__ */ J(P, {
|
|
505
|
+
placeholder: d.auth.emailPlaceholder,
|
|
507
506
|
required: !0,
|
|
508
507
|
variant: o === "transparent" ? "primary" : "secondary"
|
|
509
508
|
}),
|
|
510
|
-
/* @__PURE__ */
|
|
509
|
+
/* @__PURE__ */ J(M, {})
|
|
511
510
|
]
|
|
512
|
-
}), /* @__PURE__ */
|
|
511
|
+
}), /* @__PURE__ */ Y("div", {
|
|
513
512
|
className: "flex flex-col gap-3",
|
|
514
|
-
children: [/* @__PURE__ */
|
|
513
|
+
children: [/* @__PURE__ */ Y(O, {
|
|
515
514
|
type: "submit",
|
|
516
515
|
className: "w-full",
|
|
517
|
-
isPending:
|
|
518
|
-
children: [
|
|
516
|
+
isPending: C,
|
|
517
|
+
children: [S && /* @__PURE__ */ J(B, {
|
|
519
518
|
color: "current",
|
|
520
519
|
size: "sm"
|
|
521
|
-
}),
|
|
522
|
-
}),
|
|
520
|
+
}), v.sendMagicLink]
|
|
521
|
+
}), f.flatMap((e) => (e.authButtons ?? []).map((t, n) => /* @__PURE__ */ J(t, { view: "magicLink" }, `${e.id}-${n.toString()}`)))]
|
|
523
522
|
})]
|
|
524
523
|
}),
|
|
525
|
-
a === "bottom" && /* @__PURE__ */
|
|
524
|
+
a === "bottom" && /* @__PURE__ */ Y(q, { children: [w && /* @__PURE__ */ J(e, { children: d.auth.or }), !!g?.length && /* @__PURE__ */ J(t, { socialLayout: i })] })
|
|
526
525
|
]
|
|
527
526
|
}),
|
|
528
|
-
|
|
527
|
+
u?.enabled && /* @__PURE__ */ J(k.Footer, {
|
|
529
528
|
className: "flex-col gap-3",
|
|
530
|
-
children: /* @__PURE__ */
|
|
529
|
+
children: /* @__PURE__ */ Y(et, {
|
|
531
530
|
className: "text-sm",
|
|
532
531
|
children: [
|
|
533
|
-
|
|
532
|
+
d.auth.needToCreateAnAccount,
|
|
534
533
|
" ",
|
|
535
|
-
/* @__PURE__ */
|
|
536
|
-
href: `${
|
|
534
|
+
/* @__PURE__ */ J(nt, {
|
|
535
|
+
href: `${c.auth}/${_.auth.signUp}`,
|
|
537
536
|
className: "text-accent no-underline hover:underline decoration-accent-hover",
|
|
538
|
-
children:
|
|
537
|
+
children: d.auth.signUp
|
|
539
538
|
})
|
|
540
539
|
]
|
|
541
540
|
})
|
|
@@ -545,8 +544,8 @@ function Pt({ className: n, socialLayout: i, socialPosition: a = "bottom", varia
|
|
|
545
544
|
}
|
|
546
545
|
//#endregion
|
|
547
546
|
//#region src/components/auth/multi-session/manage-accounts.tsx
|
|
548
|
-
function
|
|
549
|
-
let { authClient: r } = p(), { localization: i } = m(
|
|
547
|
+
function It({ className: e, variant: t, ...n }) {
|
|
548
|
+
let { authClient: r } = p(), { localization: i } = m(Bt), { data: a } = T(r), { data: o, isPending: s } = oe(r), c = o?.filter((e) => e.session.id !== a?.session.id), l = [{
|
|
550
549
|
key: a?.session.id ?? "current",
|
|
551
550
|
deviceSession: s ? null : a,
|
|
552
551
|
isPending: s
|
|
@@ -555,16 +554,16 @@ function Ft({ className: e, variant: t, ...n }) {
|
|
|
555
554
|
deviceSession: e,
|
|
556
555
|
isPending: !1
|
|
557
556
|
})) ?? []];
|
|
558
|
-
return /* @__PURE__ */
|
|
559
|
-
className:
|
|
557
|
+
return /* @__PURE__ */ Y("div", { children: [/* @__PURE__ */ J("h2", {
|
|
558
|
+
className: W("text-sm font-semibold mb-3"),
|
|
560
559
|
children: i.manageAccounts
|
|
561
|
-
}), /* @__PURE__ */
|
|
562
|
-
className:
|
|
560
|
+
}), /* @__PURE__ */ J(k, {
|
|
561
|
+
className: W(e),
|
|
563
562
|
variant: t,
|
|
564
563
|
...n,
|
|
565
|
-
children: /* @__PURE__ */
|
|
564
|
+
children: /* @__PURE__ */ J(k.Content, {
|
|
566
565
|
className: "gap-0",
|
|
567
|
-
children: l.map((e, t) => /* @__PURE__ */
|
|
566
|
+
children: l.map((e, t) => /* @__PURE__ */ Y("div", { children: [t > 0 && /* @__PURE__ */ J("div", { className: "border-b border-dashed -mx-4 my-4" }), /* @__PURE__ */ J(Vt, {
|
|
568
567
|
deviceSession: e.deviceSession,
|
|
569
568
|
isPending: e.isPending
|
|
570
569
|
})] }, e.key))
|
|
@@ -573,16 +572,16 @@ function Ft({ className: e, variant: t, ...n }) {
|
|
|
573
572
|
}
|
|
574
573
|
//#endregion
|
|
575
574
|
//#region src/components/auth/multi-session/switch-account-submenu-item.tsx
|
|
576
|
-
function
|
|
577
|
-
let { authClient: r } = p(), { mutate: i, isPending: a } =
|
|
578
|
-
return /* @__PURE__ */
|
|
575
|
+
function Lt({ deviceSession: e, hideSubtitle: t }) {
|
|
576
|
+
let { authClient: r } = p(), { mutate: i, isPending: a } = _e(r, { onSuccess: () => window.scrollTo({ top: 0 }) });
|
|
577
|
+
return /* @__PURE__ */ Y(j.Item, {
|
|
579
578
|
className: "px-2",
|
|
580
579
|
isDisabled: a,
|
|
581
580
|
onPress: () => i({ sessionToken: e.session.token }),
|
|
582
|
-
children: [/* @__PURE__ */
|
|
581
|
+
children: [/* @__PURE__ */ J(n, {
|
|
583
582
|
user: e.user,
|
|
584
583
|
hideSubtitle: t
|
|
585
|
-
}), a && /* @__PURE__ */
|
|
584
|
+
}), a && /* @__PURE__ */ J(B, {
|
|
586
585
|
color: "current",
|
|
587
586
|
size: "sm",
|
|
588
587
|
className: "ml-auto"
|
|
@@ -591,106 +590,106 @@ function It({ deviceSession: e, hideSubtitle: t }) {
|
|
|
591
590
|
}
|
|
592
591
|
//#endregion
|
|
593
592
|
//#region src/components/auth/multi-session/switch-account-submenu-content.tsx
|
|
594
|
-
function
|
|
595
|
-
let { authClient: t, basePaths: r, viewPaths: i } = p(), { localization: a } = m(
|
|
596
|
-
return /* @__PURE__ */
|
|
593
|
+
function Rt({ hideSubtitle: e }) {
|
|
594
|
+
let { authClient: t, basePaths: r, viewPaths: i } = p(), { localization: a } = m(Bt), { data: o } = T(t), { data: s, isPending: c } = oe(t);
|
|
595
|
+
return /* @__PURE__ */ J(j.Popover, {
|
|
597
596
|
className: "min-w-40 md:min-w-56 max-w-[48svw]",
|
|
598
|
-
children: /* @__PURE__ */
|
|
599
|
-
/* @__PURE__ */
|
|
597
|
+
children: /* @__PURE__ */ Y(j.Menu, { children: [
|
|
598
|
+
/* @__PURE__ */ Y(j.Item, {
|
|
600
599
|
className: "px-2",
|
|
601
|
-
children: [/* @__PURE__ */
|
|
600
|
+
children: [/* @__PURE__ */ J(n, {
|
|
602
601
|
isPending: c,
|
|
603
602
|
hideSubtitle: e
|
|
604
|
-
}), !c && /* @__PURE__ */
|
|
603
|
+
}), !c && /* @__PURE__ */ J(Oe, { className: "ml-auto" })]
|
|
605
604
|
}),
|
|
606
|
-
s?.filter((e) => e.session.id !== o?.session?.id).map((t) => /* @__PURE__ */
|
|
605
|
+
s?.filter((e) => e.session.id !== o?.session?.id).map((t) => /* @__PURE__ */ J(Lt, {
|
|
607
606
|
deviceSession: t,
|
|
608
607
|
hideSubtitle: e
|
|
609
608
|
}, t.session.id)),
|
|
610
|
-
/* @__PURE__ */
|
|
609
|
+
/* @__PURE__ */ Y(j.Item, {
|
|
611
610
|
textValue: a.addAccount,
|
|
612
611
|
href: `${r.auth}/${i.auth.signIn}`,
|
|
613
|
-
children: [/* @__PURE__ */
|
|
612
|
+
children: [/* @__PURE__ */ J(je, { className: "text-muted" }), /* @__PURE__ */ J(I, { children: a.addAccount })]
|
|
614
613
|
})
|
|
615
614
|
] })
|
|
616
615
|
});
|
|
617
616
|
}
|
|
618
617
|
//#endregion
|
|
619
618
|
//#region src/components/auth/multi-session/switch-account-submenu.tsx
|
|
620
|
-
function
|
|
621
|
-
let { authClient: n } = p(), { data: r } =
|
|
622
|
-
return r ? /* @__PURE__ */
|
|
619
|
+
function zt({ className: e, hideSubtitle: t }) {
|
|
620
|
+
let { authClient: n } = p(), { data: r } = T(n), { localization: i } = m(Bt);
|
|
621
|
+
return r ? /* @__PURE__ */ Y(j.SubmenuTrigger, { children: [/* @__PURE__ */ Y(j.Item, {
|
|
623
622
|
className: e,
|
|
624
623
|
textValue: i.switchAccount,
|
|
625
624
|
children: [
|
|
626
|
-
/* @__PURE__ */
|
|
627
|
-
/* @__PURE__ */
|
|
628
|
-
/* @__PURE__ */
|
|
625
|
+
/* @__PURE__ */ J(Te, { className: "text-muted" }),
|
|
626
|
+
/* @__PURE__ */ J(I, { children: i.switchAccount }),
|
|
627
|
+
/* @__PURE__ */ J(j.SubmenuIndicator, {})
|
|
629
628
|
]
|
|
630
|
-
}), /* @__PURE__ */
|
|
629
|
+
}), /* @__PURE__ */ J(j.Popover, {
|
|
631
630
|
className: "min-w-40 md:min-w-56 max-w-[48svw]",
|
|
632
|
-
children: /* @__PURE__ */
|
|
631
|
+
children: /* @__PURE__ */ J(Rt, { hideSubtitle: t })
|
|
633
632
|
})] }) : null;
|
|
634
633
|
}
|
|
635
634
|
//#endregion
|
|
636
635
|
//#region src/lib/auth/multi-session-plugin.ts
|
|
637
|
-
var
|
|
638
|
-
...
|
|
639
|
-
accountCards: [
|
|
640
|
-
userMenuItems: [
|
|
636
|
+
var Bt = a(mt.id, (e = {}) => ({
|
|
637
|
+
...mt(e),
|
|
638
|
+
accountCards: [It],
|
|
639
|
+
userMenuItems: [zt]
|
|
641
640
|
}));
|
|
642
641
|
//#endregion
|
|
643
642
|
//#region src/components/auth/multi-session/manage-account.tsx
|
|
644
|
-
function
|
|
645
|
-
let { authClient: r, localization: i } = p(), { localization: a } = m(
|
|
646
|
-
return /* @__PURE__ */
|
|
643
|
+
function Vt({ deviceSession: e, isPending: t }) {
|
|
644
|
+
let { authClient: r, localization: i } = p(), { localization: a } = m(Bt), { data: o } = we(r), { mutate: s, isPending: c } = _e(r, { onSuccess: () => window.scrollTo({ top: 0 }) }), { mutate: l, isPending: u } = me(r, { onSuccess: () => G.success(i.settings.revokeSessionSuccess) }), d = e?.session.userId === o?.id, f = c || u;
|
|
645
|
+
return /* @__PURE__ */ Y("div", {
|
|
647
646
|
className: "flex items-center justify-between gap-3",
|
|
648
647
|
children: [
|
|
649
|
-
/* @__PURE__ */
|
|
648
|
+
/* @__PURE__ */ J(n, {
|
|
650
649
|
user: e?.user,
|
|
651
650
|
isPending: t,
|
|
652
651
|
size: "md"
|
|
653
652
|
}),
|
|
654
|
-
e && d && /* @__PURE__ */
|
|
653
|
+
e && d && /* @__PURE__ */ Y(O, {
|
|
655
654
|
className: "shrink-0",
|
|
656
655
|
variant: "outline",
|
|
657
656
|
size: "sm",
|
|
658
657
|
onPress: () => l({ sessionToken: e.session.token }),
|
|
659
658
|
isDisabled: f,
|
|
660
|
-
children: [u ? /* @__PURE__ */
|
|
659
|
+
children: [u ? /* @__PURE__ */ J(B, {
|
|
661
660
|
color: "current",
|
|
662
661
|
size: "sm"
|
|
663
|
-
}) : /* @__PURE__ */
|
|
662
|
+
}) : /* @__PURE__ */ J(Ee, {}), i.auth.signOut]
|
|
664
663
|
}),
|
|
665
|
-
e && !d && /* @__PURE__ */
|
|
664
|
+
e && !d && /* @__PURE__ */ Y(j, { children: [/* @__PURE__ */ J(O, {
|
|
666
665
|
isIconOnly: !0,
|
|
667
666
|
variant: "ghost",
|
|
668
667
|
className: "shrink-0",
|
|
669
668
|
size: "sm",
|
|
670
669
|
isDisabled: f,
|
|
671
|
-
children: /* @__PURE__ */
|
|
672
|
-
}), /* @__PURE__ */
|
|
670
|
+
children: /* @__PURE__ */ J(Ie, {})
|
|
671
|
+
}), /* @__PURE__ */ J(j.Popover, { children: /* @__PURE__ */ Y(j.Menu, { children: [/* @__PURE__ */ Y(j.Item, {
|
|
673
672
|
textValue: a.switchAccount,
|
|
674
673
|
onAction: () => s({ sessionToken: e.session.token }),
|
|
675
|
-
children: [/* @__PURE__ */
|
|
676
|
-
}), /* @__PURE__ */
|
|
674
|
+
children: [/* @__PURE__ */ J(Te, { className: "text-muted" }), a.switchAccount]
|
|
675
|
+
}), /* @__PURE__ */ Y(j.Item, {
|
|
677
676
|
textValue: i.auth.signOut,
|
|
678
677
|
onAction: () => l({ sessionToken: e.session.token }),
|
|
679
|
-
children: [/* @__PURE__ */
|
|
678
|
+
children: [/* @__PURE__ */ J(Ee, { className: "text-muted" }), i.auth.signOut]
|
|
680
679
|
})] }) })] })
|
|
681
680
|
]
|
|
682
681
|
});
|
|
683
682
|
}
|
|
684
683
|
//#endregion
|
|
685
684
|
//#region src/components/auth/organization/slug-field.tsx
|
|
686
|
-
function
|
|
685
|
+
function Ht(e) {
|
|
687
686
|
return e.toLowerCase().replace(/[^a-z0-9]+/g, "-");
|
|
688
687
|
}
|
|
689
|
-
function
|
|
690
|
-
let { authClient: a, localization: o } = p(), { localization: s, checkSlug: c } = m(
|
|
688
|
+
function Ut({ value: e, onChange: t, currentSlug: n, variant: r, ...i }) {
|
|
689
|
+
let { authClient: a, localization: o } = p(), { localization: s, checkSlug: c } = m(Q), { mutate: l, data: u, error: d, reset: f } = _(a), h = bt((e) => {
|
|
691
690
|
!c || !e.trim() || e.trim() === n || l({ slug: e.trim() });
|
|
692
691
|
}, { wait: 500 });
|
|
693
|
-
|
|
692
|
+
st(() => {
|
|
694
693
|
c && (f(), h.maybeExecute(e));
|
|
695
694
|
}, [
|
|
696
695
|
c,
|
|
@@ -699,9 +698,9 @@ function Ht({ value: e, onChange: t, currentSlug: n, variant: r, ...i }) {
|
|
|
699
698
|
f
|
|
700
699
|
]);
|
|
701
700
|
let g = (e) => {
|
|
702
|
-
t(
|
|
701
|
+
t(Ht(e));
|
|
703
702
|
};
|
|
704
|
-
return /* @__PURE__ */
|
|
703
|
+
return /* @__PURE__ */ Y(U, {
|
|
705
704
|
id: "slug",
|
|
706
705
|
name: "slug",
|
|
707
706
|
...i,
|
|
@@ -711,36 +710,36 @@ function Ht({ value: e, onChange: t, currentSlug: n, variant: r, ...i }) {
|
|
|
711
710
|
if (!e) return o.auth.fieldRequired;
|
|
712
711
|
},
|
|
713
712
|
children: [
|
|
714
|
-
/* @__PURE__ */
|
|
715
|
-
/* @__PURE__ */
|
|
713
|
+
/* @__PURE__ */ J(I, { children: s.slug }),
|
|
714
|
+
/* @__PURE__ */ Y(F, {
|
|
716
715
|
variant: r,
|
|
717
|
-
children: [/* @__PURE__ */
|
|
716
|
+
children: [/* @__PURE__ */ J(F.Input, {
|
|
718
717
|
placeholder: s.slugPlaceholder,
|
|
719
718
|
required: !0
|
|
720
|
-
}), c && !!e.trim() && e.trim() !== n && /* @__PURE__ */
|
|
719
|
+
}), c && !!e.trim() && e.trim() !== n && /* @__PURE__ */ J(F.Suffix, {
|
|
721
720
|
className: "px-2",
|
|
722
|
-
children: u?.status ? /* @__PURE__ */
|
|
721
|
+
children: u?.status ? /* @__PURE__ */ J(Oe, { className: "text-success" }) : d ? /* @__PURE__ */ J(E, { className: "text-danger" }) : /* @__PURE__ */ J(B, {
|
|
723
722
|
size: "sm",
|
|
724
723
|
color: "current"
|
|
725
724
|
})
|
|
726
725
|
})]
|
|
727
726
|
}),
|
|
728
|
-
/* @__PURE__ */
|
|
727
|
+
/* @__PURE__ */ J(M, {})
|
|
729
728
|
]
|
|
730
729
|
});
|
|
731
730
|
}
|
|
732
731
|
//#endregion
|
|
733
732
|
//#region src/components/auth/organization/create-organization-dialog.tsx
|
|
734
|
-
function
|
|
735
|
-
let { authClient: n, localization: r } = p(), { localization: i } = m(
|
|
736
|
-
return
|
|
733
|
+
function Wt({ isOpen: e, onOpenChange: t }) {
|
|
734
|
+
let { authClient: n, localization: r } = p(), { localization: i } = m(Q), [a, o] = K(""), [s, c] = K(""), { mutate: l, isPending: u } = y(n, { onSuccess: () => t(!1) });
|
|
735
|
+
return st(() => {
|
|
737
736
|
e || (c(""), o(""));
|
|
738
|
-
}, [e]),
|
|
739
|
-
c(
|
|
740
|
-
}, [a]), /* @__PURE__ */
|
|
737
|
+
}, [e]), st(() => {
|
|
738
|
+
c(Ht(a));
|
|
739
|
+
}, [a]), /* @__PURE__ */ J(D.Backdrop, {
|
|
741
740
|
isOpen: e,
|
|
742
741
|
onOpenChange: t,
|
|
743
|
-
children: /* @__PURE__ */
|
|
742
|
+
children: /* @__PURE__ */ J(D.Container, { children: /* @__PURE__ */ J(D.Dialog, { children: /* @__PURE__ */ Y(N, {
|
|
744
743
|
onSubmit: (e) => {
|
|
745
744
|
e.preventDefault(), l({
|
|
746
745
|
name: a,
|
|
@@ -748,19 +747,19 @@ function Ut({ isOpen: e, onOpenChange: t }) {
|
|
|
748
747
|
});
|
|
749
748
|
},
|
|
750
749
|
children: [
|
|
751
|
-
/* @__PURE__ */
|
|
752
|
-
/* @__PURE__ */
|
|
750
|
+
/* @__PURE__ */ J(D.CloseTrigger, {}),
|
|
751
|
+
/* @__PURE__ */ Y(D.Header, { children: [/* @__PURE__ */ J(D.Icon, {
|
|
753
752
|
status: "default",
|
|
754
|
-
children: /* @__PURE__ */
|
|
755
|
-
}), /* @__PURE__ */
|
|
756
|
-
/* @__PURE__ */
|
|
753
|
+
children: /* @__PURE__ */ J(De, {})
|
|
754
|
+
}), /* @__PURE__ */ J(D.Heading, { children: i.createOrganization })] }),
|
|
755
|
+
/* @__PURE__ */ Y(D.Body, {
|
|
757
756
|
className: "flex flex-col gap-4 overflow-visible",
|
|
758
757
|
children: [
|
|
759
|
-
/* @__PURE__ */
|
|
758
|
+
/* @__PURE__ */ J("p", {
|
|
760
759
|
className: "text-muted text-sm",
|
|
761
760
|
children: i.organizationsDescription
|
|
762
761
|
}),
|
|
763
|
-
/* @__PURE__ */
|
|
762
|
+
/* @__PURE__ */ Y(U, {
|
|
764
763
|
id: "name",
|
|
765
764
|
name: "name",
|
|
766
765
|
isDisabled: u,
|
|
@@ -770,17 +769,17 @@ function Ut({ isOpen: e, onOpenChange: t }) {
|
|
|
770
769
|
if (!e) return r.auth.fieldRequired;
|
|
771
770
|
},
|
|
772
771
|
children: [
|
|
773
|
-
/* @__PURE__ */
|
|
774
|
-
/* @__PURE__ */
|
|
772
|
+
/* @__PURE__ */ J(I, { children: i.name }),
|
|
773
|
+
/* @__PURE__ */ J(P, {
|
|
775
774
|
required: !0,
|
|
776
775
|
autoFocus: !0,
|
|
777
776
|
placeholder: i.namePlaceholder,
|
|
778
777
|
variant: "secondary"
|
|
779
778
|
}),
|
|
780
|
-
/* @__PURE__ */
|
|
779
|
+
/* @__PURE__ */ J(M, {})
|
|
781
780
|
]
|
|
782
781
|
}),
|
|
783
|
-
/* @__PURE__ */
|
|
782
|
+
/* @__PURE__ */ J(Ut, {
|
|
784
783
|
value: s,
|
|
785
784
|
onChange: c,
|
|
786
785
|
isDisabled: u,
|
|
@@ -788,15 +787,15 @@ function Ut({ isOpen: e, onOpenChange: t }) {
|
|
|
788
787
|
})
|
|
789
788
|
]
|
|
790
789
|
}),
|
|
791
|
-
/* @__PURE__ */
|
|
790
|
+
/* @__PURE__ */ Y(D.Footer, { children: [/* @__PURE__ */ J(O, {
|
|
792
791
|
slot: "close",
|
|
793
792
|
variant: "tertiary",
|
|
794
793
|
isDisabled: u,
|
|
795
794
|
children: r.settings.cancel
|
|
796
|
-
}), /* @__PURE__ */
|
|
795
|
+
}), /* @__PURE__ */ Y(O, {
|
|
797
796
|
type: "submit",
|
|
798
797
|
isPending: u,
|
|
799
|
-
children: [u && /* @__PURE__ */
|
|
798
|
+
children: [u && /* @__PURE__ */ J(B, {
|
|
800
799
|
color: "current",
|
|
801
800
|
size: "sm"
|
|
802
801
|
}), i.createOrganization]
|
|
@@ -807,75 +806,75 @@ function Ut({ isOpen: e, onOpenChange: t }) {
|
|
|
807
806
|
}
|
|
808
807
|
//#endregion
|
|
809
808
|
//#region src/components/auth/organization/organization-logo.tsx
|
|
810
|
-
function
|
|
811
|
-
if (n && !r) return /* @__PURE__ */
|
|
812
|
-
className:
|
|
809
|
+
function Gt({ className: e, fallback: t, isPending: n, organization: r, size: i = "sm", style: a, ...o }) {
|
|
810
|
+
if (n && !r) return /* @__PURE__ */ J(z, {
|
|
811
|
+
className: W("rounded-full", i === "sm" ? "size-8" : i === "md" ? "size-10" : "size-12", e),
|
|
813
812
|
style: a
|
|
814
813
|
});
|
|
815
814
|
let s = r?.name?.slice(0, 2).toUpperCase();
|
|
816
|
-
return /* @__PURE__ */
|
|
815
|
+
return /* @__PURE__ */ Y(Qe, {
|
|
817
816
|
size: i,
|
|
818
|
-
className:
|
|
817
|
+
className: W("rounded-full", e),
|
|
819
818
|
style: a,
|
|
820
819
|
...o,
|
|
821
|
-
children: [/* @__PURE__ */
|
|
820
|
+
children: [/* @__PURE__ */ J(Qe.Image, {
|
|
822
821
|
alt: r?.name ?? "Organization",
|
|
823
822
|
src: r?.logo ?? void 0
|
|
824
|
-
}), /* @__PURE__ */
|
|
825
|
-
className:
|
|
823
|
+
}), /* @__PURE__ */ J(Qe.Fallback, {
|
|
824
|
+
className: W(i === "lg" ? "text-xl" : i === "md" ? "text-base" : "text-sm"),
|
|
826
825
|
delayMs: r?.logo ? 600 : void 0,
|
|
827
|
-
children: t || s || /* @__PURE__ */
|
|
826
|
+
children: t || s || /* @__PURE__ */ J(De, { className: "size-4" })
|
|
828
827
|
})]
|
|
829
828
|
});
|
|
830
829
|
}
|
|
831
830
|
//#endregion
|
|
832
831
|
//#region src/components/auth/organization/organization-view-skeleton.tsx
|
|
833
|
-
function
|
|
834
|
-
return /* @__PURE__ */
|
|
835
|
-
className:
|
|
832
|
+
function Kt({ className: e, hideSlug: t, size: n = "md", ...r }) {
|
|
833
|
+
return /* @__PURE__ */ Y("div", {
|
|
834
|
+
className: W("flex min-w-0 items-center gap-2", e),
|
|
836
835
|
...r,
|
|
837
|
-
children: [/* @__PURE__ */
|
|
836
|
+
children: [/* @__PURE__ */ J(Gt, {
|
|
838
837
|
isPending: !0,
|
|
839
838
|
className: n === "sm" ? "size-5" : void 0,
|
|
840
839
|
size: n === "lg" ? "md" : "sm"
|
|
841
|
-
}), /* @__PURE__ */
|
|
840
|
+
}), /* @__PURE__ */ Y("div", {
|
|
842
841
|
className: "flex flex-col min-w-0 gap-1",
|
|
843
|
-
children: [/* @__PURE__ */
|
|
842
|
+
children: [/* @__PURE__ */ J(z, { className: "h-3.5 w-20 rounded-lg" }), !t && /* @__PURE__ */ J(z, { className: "h-3 w-28 rounded-lg mt-[0.5px] mb-0.5" })]
|
|
844
843
|
})]
|
|
845
844
|
});
|
|
846
845
|
}
|
|
847
846
|
//#endregion
|
|
848
847
|
//#region src/components/auth/organization/organization-view.tsx
|
|
849
|
-
function
|
|
850
|
-
let { authClient: s } = p(), { roles: c } = m(
|
|
848
|
+
function Z({ className: e, isPending: t, size: n = "md", hideSlug: r, hideRole: i, organization: a, ...o }) {
|
|
849
|
+
let { authClient: s } = p(), { roles: c } = m(Q), { data: l } = T(s), { data: u, isPending: f } = d(s, { enabled: !a && !t }), h = a ?? u, { data: g, isPending: _ } = ce(s, {
|
|
851
850
|
query: { organizationId: h?.id },
|
|
852
851
|
enabled: !!h?.id && !i
|
|
853
852
|
}), v = g?.members?.find((e) => e.userId === l?.user.id);
|
|
854
|
-
return t || !a && f || !i && h?.id && _ ? /* @__PURE__ */
|
|
853
|
+
return t || !a && f || !i && h?.id && _ ? /* @__PURE__ */ J(Kt, {
|
|
855
854
|
className: e,
|
|
856
855
|
hideSlug: r,
|
|
857
856
|
size: n,
|
|
858
857
|
...o
|
|
859
|
-
}) : /* @__PURE__ */
|
|
860
|
-
className:
|
|
858
|
+
}) : /* @__PURE__ */ Y("div", {
|
|
859
|
+
className: W("flex min-w-0 items-center gap-2", e),
|
|
861
860
|
...o,
|
|
862
|
-
children: [/* @__PURE__ */
|
|
861
|
+
children: [/* @__PURE__ */ J(Gt, {
|
|
863
862
|
organization: h,
|
|
864
863
|
className: n === "sm" ? "size-5 [&>span]:text-xs" : void 0,
|
|
865
864
|
size: n === "lg" ? "md" : "sm"
|
|
866
|
-
}), /* @__PURE__ */
|
|
865
|
+
}), /* @__PURE__ */ Y("div", {
|
|
867
866
|
className: "flex flex-col min-w-0",
|
|
868
|
-
children: [/* @__PURE__ */
|
|
867
|
+
children: [/* @__PURE__ */ Y("div", {
|
|
869
868
|
className: "flex min-w-0 items-center gap-2",
|
|
870
|
-
children: [/* @__PURE__ */
|
|
869
|
+
children: [/* @__PURE__ */ J("p", {
|
|
871
870
|
className: "text-foreground text-sm font-medium truncate leading-tight",
|
|
872
871
|
children: h?.name
|
|
873
|
-
}), !i && !!v && /* @__PURE__ */
|
|
872
|
+
}), !i && !!v && /* @__PURE__ */ J(A, {
|
|
874
873
|
className: "shrink-0 -my-0.5",
|
|
875
874
|
size: "sm",
|
|
876
875
|
children: c?.[v.role] ?? v.role
|
|
877
876
|
})]
|
|
878
|
-
}), !r && /* @__PURE__ */
|
|
877
|
+
}), !r && /* @__PURE__ */ J("p", {
|
|
879
878
|
className: "text-muted text-xs truncate overflow-x-hidden font-mono leading-tight",
|
|
880
879
|
children: h?.slug
|
|
881
880
|
})]
|
|
@@ -884,51 +883,51 @@ function Q({ className: e, isPending: t, size: n = "md", hideSlug: r, hideRole:
|
|
|
884
883
|
}
|
|
885
884
|
//#endregion
|
|
886
885
|
//#region src/components/auth/organization/organization-row.tsx
|
|
887
|
-
function
|
|
888
|
-
let { authClient: t, basePaths: n, navigate: r } = p(), { localization: i, viewPaths: a, slug: o } = m(
|
|
886
|
+
function qt({ organization: e }) {
|
|
887
|
+
let { authClient: t, basePaths: n, navigate: r } = p(), { localization: i, viewPaths: a, slug: o } = m(Q), { mutate: s, isPending: c } = ge(t, { onSuccess: () => {
|
|
889
888
|
r({ to: `${n.organization}/${a.organization.settings}` });
|
|
890
889
|
} });
|
|
891
890
|
function l() {
|
|
892
891
|
o === void 0 ? s({ organizationId: e.id }) : r({ to: `${n.organization}/${e.slug}/${a.organization.settings}` });
|
|
893
892
|
}
|
|
894
|
-
return /* @__PURE__ */
|
|
893
|
+
return /* @__PURE__ */ Y("div", {
|
|
895
894
|
className: "flex items-center gap-3",
|
|
896
|
-
children: [/* @__PURE__ */
|
|
895
|
+
children: [/* @__PURE__ */ J(Z, { organization: e }), /* @__PURE__ */ Y(O, {
|
|
897
896
|
className: "ml-auto shrink-0",
|
|
898
897
|
variant: "outline",
|
|
899
898
|
size: "sm",
|
|
900
899
|
isPending: c,
|
|
901
900
|
onPress: l,
|
|
902
901
|
"aria-label": i.manage,
|
|
903
|
-
children: [c ? /* @__PURE__ */
|
|
902
|
+
children: [c ? /* @__PURE__ */ J(B, {
|
|
904
903
|
color: "current",
|
|
905
904
|
size: "sm"
|
|
906
|
-
}) : /* @__PURE__ */
|
|
905
|
+
}) : /* @__PURE__ */ J(Be, {}), i.manage]
|
|
907
906
|
})]
|
|
908
907
|
});
|
|
909
908
|
}
|
|
910
909
|
//#endregion
|
|
911
910
|
//#region src/components/auth/organization/organizations-empty.tsx
|
|
912
|
-
function
|
|
913
|
-
let { localization: t } = m(
|
|
914
|
-
return /* @__PURE__ */
|
|
911
|
+
function Jt({ onCreatePress: e }) {
|
|
912
|
+
let { localization: t } = m(Q);
|
|
913
|
+
return /* @__PURE__ */ Y(tt, {
|
|
915
914
|
className: "flex flex-col items-center gap-4 text-center",
|
|
916
915
|
children: [
|
|
917
|
-
/* @__PURE__ */
|
|
916
|
+
/* @__PURE__ */ J("div", {
|
|
918
917
|
className: "flex size-12 items-center justify-center rounded-full bg-surface-secondary",
|
|
919
|
-
children: /* @__PURE__ */
|
|
918
|
+
children: /* @__PURE__ */ J(De, { className: "size-5" })
|
|
920
919
|
}),
|
|
921
|
-
/* @__PURE__ */
|
|
920
|
+
/* @__PURE__ */ Y("div", {
|
|
922
921
|
className: "flex flex-col gap-2",
|
|
923
|
-
children: [/* @__PURE__ */
|
|
922
|
+
children: [/* @__PURE__ */ J("p", {
|
|
924
923
|
className: "text-sm font-semibold text-foreground",
|
|
925
924
|
children: t.noOrganizations
|
|
926
|
-
}), /* @__PURE__ */
|
|
925
|
+
}), /* @__PURE__ */ J("span", {
|
|
927
926
|
className: "text-sm text-muted",
|
|
928
927
|
children: t.organizationsDescription
|
|
929
928
|
})]
|
|
930
929
|
}),
|
|
931
|
-
/* @__PURE__ */
|
|
930
|
+
/* @__PURE__ */ J(O, {
|
|
932
931
|
size: "sm",
|
|
933
932
|
onPress: e,
|
|
934
933
|
children: t.createOrganization
|
|
@@ -938,57 +937,57 @@ function qt({ onCreatePress: e }) {
|
|
|
938
937
|
}
|
|
939
938
|
//#endregion
|
|
940
939
|
//#region src/components/auth/organization/organizations.tsx
|
|
941
|
-
function
|
|
942
|
-
let { authClient: t } = p(), { localization: n } = m(
|
|
943
|
-
return /* @__PURE__ */
|
|
940
|
+
function Yt({ variant: e }) {
|
|
941
|
+
let { authClient: t } = p(), { localization: n } = m(Q), [r, i] = K(!1), { data: a, isPending: o } = le(t);
|
|
942
|
+
return /* @__PURE__ */ Y(q, { children: [/* @__PURE__ */ Y("div", {
|
|
944
943
|
className: "flex flex-col gap-3",
|
|
945
|
-
children: [/* @__PURE__ */
|
|
944
|
+
children: [/* @__PURE__ */ Y("div", {
|
|
946
945
|
className: "flex items-end justify-between gap-3",
|
|
947
|
-
children: [/* @__PURE__ */
|
|
946
|
+
children: [/* @__PURE__ */ J("h2", {
|
|
948
947
|
className: "truncate text-sm font-semibold",
|
|
949
948
|
children: n.organizations
|
|
950
|
-
}), /* @__PURE__ */
|
|
949
|
+
}), /* @__PURE__ */ J(O, {
|
|
951
950
|
className: "shrink-0",
|
|
952
951
|
size: "sm",
|
|
953
952
|
isDisabled: o,
|
|
954
953
|
onPress: () => i(!0),
|
|
955
954
|
children: n.createOrganization
|
|
956
955
|
})]
|
|
957
|
-
}), /* @__PURE__ */
|
|
956
|
+
}), /* @__PURE__ */ J(k, {
|
|
958
957
|
variant: e,
|
|
959
|
-
children: /* @__PURE__ */
|
|
958
|
+
children: /* @__PURE__ */ J(k.Content, {
|
|
960
959
|
className: "gap-0",
|
|
961
|
-
children: o ? /* @__PURE__ */
|
|
960
|
+
children: o ? /* @__PURE__ */ J(Kt, {}) : a?.length ? a.map((e, t) => /* @__PURE__ */ Y("div", { children: [t > 0 && /* @__PURE__ */ J("div", { className: "-mx-4 my-4 border-b border-dashed" }), /* @__PURE__ */ J(qt, { organization: e })] }, e.id)) : /* @__PURE__ */ J(Jt, { onCreatePress: () => i(!0) })
|
|
962
961
|
})
|
|
963
962
|
})]
|
|
964
|
-
}), /* @__PURE__ */
|
|
963
|
+
}), /* @__PURE__ */ J(Wt, {
|
|
965
964
|
isOpen: r,
|
|
966
965
|
onOpenChange: i
|
|
967
966
|
})] });
|
|
968
967
|
}
|
|
969
968
|
//#endregion
|
|
970
969
|
//#region src/components/auth/organization/user-invitation-row.tsx
|
|
971
|
-
function
|
|
972
|
-
let { authClient: t } = p(), { localization: n, roles: r } = m(
|
|
973
|
-
return /* @__PURE__ */
|
|
970
|
+
function Xt({ invitation: e }) {
|
|
971
|
+
let { authClient: t } = p(), { localization: n, roles: r } = m(Q), { mutate: i, isPending: a } = u(t), { mutate: o, isPending: s } = fe(t);
|
|
972
|
+
return /* @__PURE__ */ Y("div", {
|
|
974
973
|
className: "flex items-center gap-3",
|
|
975
974
|
children: [
|
|
976
|
-
/* @__PURE__ */
|
|
975
|
+
/* @__PURE__ */ J("div", {
|
|
977
976
|
className: "flex size-10 shrink-0 items-center justify-center rounded-xl bg-surface-secondary",
|
|
978
|
-
children: /* @__PURE__ */
|
|
977
|
+
children: /* @__PURE__ */ J(Me, { className: "size-4.5" })
|
|
979
978
|
}),
|
|
980
|
-
/* @__PURE__ */
|
|
979
|
+
/* @__PURE__ */ Y("div", {
|
|
981
980
|
className: "flex flex-col",
|
|
982
|
-
children: [/* @__PURE__ */
|
|
981
|
+
children: [/* @__PURE__ */ Y("div", {
|
|
983
982
|
className: "flex items-center gap-1.5",
|
|
984
|
-
children: [/* @__PURE__ */
|
|
983
|
+
children: [/* @__PURE__ */ J("span", {
|
|
985
984
|
className: "truncate text-sm font-medium leading-tight",
|
|
986
985
|
children: e.organizationName
|
|
987
|
-
}), /* @__PURE__ */
|
|
986
|
+
}), /* @__PURE__ */ J(A, {
|
|
988
987
|
size: "sm",
|
|
989
988
|
children: r?.[e.role] ?? e.role
|
|
990
989
|
})]
|
|
991
|
-
}), /* @__PURE__ */
|
|
990
|
+
}), /* @__PURE__ */ J("span", {
|
|
992
991
|
className: "truncate text-muted text-xs",
|
|
993
992
|
children: new Date(e.createdAt).toLocaleString(void 0, {
|
|
994
993
|
dateStyle: "medium",
|
|
@@ -996,19 +995,19 @@ function Yt({ invitation: e }) {
|
|
|
996
995
|
})
|
|
997
996
|
})]
|
|
998
997
|
}),
|
|
999
|
-
/* @__PURE__ */
|
|
998
|
+
/* @__PURE__ */ Y("div", {
|
|
1000
999
|
className: "ml-auto flex shrink-0 items-center gap-2",
|
|
1001
|
-
children: [/* @__PURE__ */
|
|
1000
|
+
children: [/* @__PURE__ */ Y(O, {
|
|
1002
1001
|
variant: "outline",
|
|
1003
1002
|
size: "sm",
|
|
1004
1003
|
isPending: a,
|
|
1005
1004
|
isDisabled: s,
|
|
1006
1005
|
onPress: () => i({ invitationId: e.id }),
|
|
1007
|
-
children: [a ? /* @__PURE__ */
|
|
1006
|
+
children: [a ? /* @__PURE__ */ J(B, {
|
|
1008
1007
|
color: "current",
|
|
1009
1008
|
size: "sm"
|
|
1010
|
-
}) : /* @__PURE__ */
|
|
1011
|
-
}), /* @__PURE__ */
|
|
1009
|
+
}) : /* @__PURE__ */ J(Oe, {}), n.accept]
|
|
1010
|
+
}), /* @__PURE__ */ J(O, {
|
|
1012
1011
|
variant: "danger-soft",
|
|
1013
1012
|
size: "sm",
|
|
1014
1013
|
isIconOnly: !0,
|
|
@@ -1016,10 +1015,10 @@ function Yt({ invitation: e }) {
|
|
|
1016
1015
|
isDisabled: a,
|
|
1017
1016
|
onPress: () => o({ invitationId: e.id }),
|
|
1018
1017
|
"aria-label": n.rejectInvitation,
|
|
1019
|
-
children: s ? /* @__PURE__ */
|
|
1018
|
+
children: s ? /* @__PURE__ */ J(B, {
|
|
1020
1019
|
color: "current",
|
|
1021
1020
|
size: "sm"
|
|
1022
|
-
}) : /* @__PURE__ */
|
|
1021
|
+
}) : /* @__PURE__ */ J(E, {})
|
|
1023
1022
|
})]
|
|
1024
1023
|
})
|
|
1025
1024
|
]
|
|
@@ -1027,30 +1026,30 @@ function Yt({ invitation: e }) {
|
|
|
1027
1026
|
}
|
|
1028
1027
|
//#endregion
|
|
1029
1028
|
//#region src/components/auth/organization/user-invitation-row-skeleton.tsx
|
|
1030
|
-
function
|
|
1031
|
-
return /* @__PURE__ */
|
|
1029
|
+
function Zt() {
|
|
1030
|
+
return /* @__PURE__ */ Y("div", {
|
|
1032
1031
|
className: "flex items-center gap-3",
|
|
1033
|
-
children: [/* @__PURE__ */
|
|
1032
|
+
children: [/* @__PURE__ */ J(z, { className: "size-10 shrink-0 rounded-xl" }), /* @__PURE__ */ Y("div", {
|
|
1034
1033
|
className: "flex flex-col gap-1",
|
|
1035
|
-
children: [/* @__PURE__ */
|
|
1034
|
+
children: [/* @__PURE__ */ J(z, { className: "h-4 w-40 rounded-lg" }), /* @__PURE__ */ J(z, { className: "h-3 w-28 rounded-lg" })]
|
|
1036
1035
|
})]
|
|
1037
1036
|
});
|
|
1038
1037
|
}
|
|
1039
1038
|
//#endregion
|
|
1040
1039
|
//#region src/components/auth/organization/user-invitations-empty.tsx
|
|
1041
|
-
function
|
|
1042
|
-
let { localization: e } = m(
|
|
1043
|
-
return /* @__PURE__ */
|
|
1040
|
+
function Qt() {
|
|
1041
|
+
let { localization: e } = m(Q);
|
|
1042
|
+
return /* @__PURE__ */ Y(tt, {
|
|
1044
1043
|
className: "flex flex-col items-center gap-4 text-center",
|
|
1045
|
-
children: [/* @__PURE__ */
|
|
1044
|
+
children: [/* @__PURE__ */ J("div", {
|
|
1046
1045
|
className: "flex size-12 items-center justify-center rounded-full bg-surface-secondary",
|
|
1047
|
-
children: /* @__PURE__ */
|
|
1048
|
-
}), /* @__PURE__ */
|
|
1046
|
+
children: /* @__PURE__ */ J(Ge, { className: "size-5" })
|
|
1047
|
+
}), /* @__PURE__ */ Y("div", {
|
|
1049
1048
|
className: "flex flex-col gap-2",
|
|
1050
|
-
children: [/* @__PURE__ */
|
|
1049
|
+
children: [/* @__PURE__ */ J("p", {
|
|
1051
1050
|
className: "text-sm font-semibold text-foreground",
|
|
1052
1051
|
children: e.noInvitations
|
|
1053
|
-
}), /* @__PURE__ */
|
|
1052
|
+
}), /* @__PURE__ */ J("span", {
|
|
1054
1053
|
className: "text-sm text-muted",
|
|
1055
1054
|
children: e.userInvitationsEmptyDescription
|
|
1056
1055
|
})]
|
|
@@ -1059,46 +1058,46 @@ function Zt() {
|
|
|
1059
1058
|
}
|
|
1060
1059
|
//#endregion
|
|
1061
1060
|
//#region src/components/auth/organization/user-invitations.tsx
|
|
1062
|
-
function
|
|
1063
|
-
let { authClient: t } = p(), { localization: n } = m(
|
|
1064
|
-
return /* @__PURE__ */
|
|
1061
|
+
function $t({ variant: e }) {
|
|
1062
|
+
let { authClient: t } = p(), { localization: n } = m(Q), { data: r, isPending: i } = de(t);
|
|
1063
|
+
return /* @__PURE__ */ Y("div", {
|
|
1065
1064
|
className: "flex flex-col gap-3",
|
|
1066
|
-
children: [/* @__PURE__ */
|
|
1065
|
+
children: [/* @__PURE__ */ J("h2", {
|
|
1067
1066
|
className: "truncate text-sm font-semibold",
|
|
1068
1067
|
children: n.invitations
|
|
1069
|
-
}), /* @__PURE__ */
|
|
1068
|
+
}), /* @__PURE__ */ J(k, {
|
|
1070
1069
|
variant: e,
|
|
1071
|
-
children: /* @__PURE__ */
|
|
1070
|
+
children: /* @__PURE__ */ J(k.Content, { children: i ? /* @__PURE__ */ J(Zt, {}) : r?.length ? r?.map((e, t) => /* @__PURE__ */ Y("div", { children: [t > 0 && /* @__PURE__ */ J("div", { className: "border-b border-dashed -mx-4 my-4" }), /* @__PURE__ */ J(Xt, { invitation: e })] }, e.id)) : /* @__PURE__ */ J(Qt, {}) })
|
|
1072
1071
|
})]
|
|
1073
1072
|
});
|
|
1074
1073
|
}
|
|
1075
1074
|
//#endregion
|
|
1076
1075
|
//#region src/components/auth/organization/organizations-settings.tsx
|
|
1077
|
-
function
|
|
1078
|
-
return /* @__PURE__ */
|
|
1079
|
-
className:
|
|
1076
|
+
function en({ className: e, variant: t, ...n }) {
|
|
1077
|
+
return /* @__PURE__ */ Y("div", {
|
|
1078
|
+
className: W("flex w-full flex-col gap-4 md:gap-6", e),
|
|
1080
1079
|
...n,
|
|
1081
|
-
children: [/* @__PURE__ */
|
|
1080
|
+
children: [/* @__PURE__ */ J(Yt, { variant: t }), /* @__PURE__ */ J($t, { variant: t })]
|
|
1082
1081
|
});
|
|
1083
1082
|
}
|
|
1084
1083
|
//#endregion
|
|
1085
1084
|
//#region src/lib/auth/organization-plugin.tsx
|
|
1086
|
-
var
|
|
1087
|
-
let t =
|
|
1085
|
+
var Q = a(ht.id, (e = {}) => {
|
|
1086
|
+
let t = ht(e);
|
|
1088
1087
|
return {
|
|
1089
1088
|
...t,
|
|
1090
1089
|
localization: t.localization,
|
|
1091
1090
|
settingsTabs: [{
|
|
1092
1091
|
view: "organizations",
|
|
1093
|
-
label: /* @__PURE__ */
|
|
1094
|
-
component:
|
|
1092
|
+
label: /* @__PURE__ */ Y(q, { children: [/* @__PURE__ */ J(De, { className: "text-muted" }), t.localization.organizations] }),
|
|
1093
|
+
component: en
|
|
1095
1094
|
}]
|
|
1096
1095
|
};
|
|
1097
1096
|
});
|
|
1098
1097
|
//#endregion
|
|
1099
1098
|
//#region src/components/auth/organization/change-organization-logo.tsx
|
|
1100
|
-
function
|
|
1101
|
-
let { authClient: t } = p(), { logo: n, localization: r } = m(
|
|
1099
|
+
function tn({ className: e }) {
|
|
1100
|
+
let { authClient: t } = p(), { logo: n, localization: r } = m(Q), { data: i, isPending: a } = d(t), { mutate: s, isPending: c } = Ce(t), l = lt(null), [u, f] = K(!1), [h, g] = K(!1), _ = c || u || h;
|
|
1102
1101
|
async function v(e) {
|
|
1103
1102
|
let t = e.target.files?.[0];
|
|
1104
1103
|
if (!(!t || !i)) {
|
|
@@ -1106,11 +1105,11 @@ function en({ className: e }) {
|
|
|
1106
1105
|
try {
|
|
1107
1106
|
let e = await n.resize?.(t, n.size, n.extension) || t;
|
|
1108
1107
|
s({ data: { logo: await n.upload?.(e) || await o(e) } }, {
|
|
1109
|
-
onSuccess: () =>
|
|
1108
|
+
onSuccess: () => G.success(r.logoChangedSuccess),
|
|
1110
1109
|
onSettled: () => f(!1)
|
|
1111
1110
|
});
|
|
1112
1111
|
} catch (e) {
|
|
1113
|
-
f(!1), e instanceof Error &&
|
|
1112
|
+
f(!1), e instanceof Error && G.danger(e.message);
|
|
1114
1113
|
}
|
|
1115
1114
|
}
|
|
1116
1115
|
}
|
|
@@ -1118,64 +1117,64 @@ function en({ className: e }) {
|
|
|
1118
1117
|
let e = i?.logo;
|
|
1119
1118
|
s({ data: { logo: "" } }, { onSuccess: async () => {
|
|
1120
1119
|
if (!e) {
|
|
1121
|
-
|
|
1120
|
+
G.success(r.logoDeletedSuccess);
|
|
1122
1121
|
return;
|
|
1123
1122
|
}
|
|
1124
1123
|
g(!0);
|
|
1125
1124
|
try {
|
|
1126
|
-
await n.delete?.(e),
|
|
1125
|
+
await n.delete?.(e), G.success(r.logoDeletedSuccess);
|
|
1127
1126
|
} catch (e) {
|
|
1128
|
-
e instanceof Error &&
|
|
1127
|
+
e instanceof Error && G.danger(e.message);
|
|
1129
1128
|
} finally {
|
|
1130
1129
|
g(!1);
|
|
1131
1130
|
}
|
|
1132
1131
|
} });
|
|
1133
1132
|
}
|
|
1134
|
-
return n.enabled ? /* @__PURE__ */
|
|
1135
|
-
className:
|
|
1133
|
+
return n.enabled ? /* @__PURE__ */ Y("div", {
|
|
1134
|
+
className: W("flex flex-col gap-1", e),
|
|
1136
1135
|
children: [
|
|
1137
|
-
/* @__PURE__ */
|
|
1136
|
+
/* @__PURE__ */ J(I, {
|
|
1138
1137
|
isDisabled: !i,
|
|
1139
1138
|
children: r.logo
|
|
1140
1139
|
}),
|
|
1141
|
-
/* @__PURE__ */
|
|
1140
|
+
/* @__PURE__ */ J("input", {
|
|
1142
1141
|
ref: l,
|
|
1143
1142
|
type: "file",
|
|
1144
1143
|
accept: "image/*",
|
|
1145
1144
|
className: "hidden",
|
|
1146
1145
|
onChange: v
|
|
1147
1146
|
}),
|
|
1148
|
-
/* @__PURE__ */
|
|
1147
|
+
/* @__PURE__ */ Y("div", {
|
|
1149
1148
|
className: "flex items-center gap-4",
|
|
1150
|
-
children: [/* @__PURE__ */
|
|
1149
|
+
children: [/* @__PURE__ */ J(O, {
|
|
1151
1150
|
type: "button",
|
|
1152
1151
|
isIconOnly: !0,
|
|
1153
1152
|
variant: "ghost",
|
|
1154
1153
|
className: "p-0 h-auto w-auto rounded-full",
|
|
1155
1154
|
isDisabled: !i || _,
|
|
1156
1155
|
onPress: () => l.current?.click(),
|
|
1157
|
-
children: /* @__PURE__ */
|
|
1156
|
+
children: /* @__PURE__ */ J(Gt, {
|
|
1158
1157
|
size: "lg",
|
|
1159
1158
|
isPending: a,
|
|
1160
1159
|
organization: i
|
|
1161
1160
|
})
|
|
1162
|
-
}), /* @__PURE__ */
|
|
1161
|
+
}), /* @__PURE__ */ Y(j, { children: [/* @__PURE__ */ Y(O, {
|
|
1163
1162
|
isDisabled: !i || _,
|
|
1164
1163
|
size: "sm",
|
|
1165
1164
|
variant: "secondary",
|
|
1166
|
-
children: [_ && /* @__PURE__ */
|
|
1167
|
-
}), /* @__PURE__ */
|
|
1165
|
+
children: [_ && /* @__PURE__ */ J(B, { size: "sm" }), r.changeLogo]
|
|
1166
|
+
}), /* @__PURE__ */ J(j.Popover, {
|
|
1168
1167
|
className: "min-w-fit",
|
|
1169
|
-
children: /* @__PURE__ */
|
|
1168
|
+
children: /* @__PURE__ */ Y(j.Menu, { children: [/* @__PURE__ */ Y(j.Item, {
|
|
1170
1169
|
textValue: r.uploadLogo,
|
|
1171
1170
|
onAction: () => l.current?.click(),
|
|
1172
|
-
children: [/* @__PURE__ */
|
|
1173
|
-
}), /* @__PURE__ */
|
|
1171
|
+
children: [/* @__PURE__ */ J(Ne, { className: "text-muted" }), /* @__PURE__ */ J(I, { children: r.uploadLogo })]
|
|
1172
|
+
}), /* @__PURE__ */ Y(j.Item, {
|
|
1174
1173
|
textValue: r.deleteLogo,
|
|
1175
1174
|
isDisabled: !i?.logo,
|
|
1176
1175
|
onAction: y,
|
|
1177
1176
|
variant: "danger",
|
|
1178
|
-
children: [/* @__PURE__ */
|
|
1177
|
+
children: [/* @__PURE__ */ J(Xe, { className: "text-danger" }), /* @__PURE__ */ J(I, { children: r.deleteLogo })]
|
|
1179
1178
|
})] })
|
|
1180
1179
|
})] })]
|
|
1181
1180
|
})
|
|
@@ -1184,9 +1183,9 @@ function en({ className: e }) {
|
|
|
1184
1183
|
}
|
|
1185
1184
|
//#endregion
|
|
1186
1185
|
//#region src/components/auth/organization/delete-organization-dialog.tsx
|
|
1187
|
-
function
|
|
1188
|
-
let { authClient: r, basePaths: i, localization: a, navigate: o } = p(), { localization: s, viewPaths: c } = m(
|
|
1189
|
-
t(!1),
|
|
1186
|
+
function nn({ isOpen: e, onOpenChange: t, organization: n }) {
|
|
1187
|
+
let { authClient: r, basePaths: i, localization: a, navigate: o } = p(), { localization: s, viewPaths: c } = m(Q), { mutate: l, isPending: u } = x(r, { onSuccess: () => {
|
|
1188
|
+
t(!1), G.success(s.organizationDeleted), o({
|
|
1190
1189
|
to: `${i.settings}/${c.settings.organizations}`,
|
|
1191
1190
|
replace: !0
|
|
1192
1191
|
});
|
|
@@ -1194,40 +1193,40 @@ function tn({ isOpen: e, onOpenChange: t, organization: n }) {
|
|
|
1194
1193
|
function d(e) {
|
|
1195
1194
|
e.preventDefault(), l({ organizationId: n.id });
|
|
1196
1195
|
}
|
|
1197
|
-
return /* @__PURE__ */
|
|
1196
|
+
return /* @__PURE__ */ J(D.Backdrop, {
|
|
1198
1197
|
isOpen: e,
|
|
1199
1198
|
onOpenChange: t,
|
|
1200
|
-
children: /* @__PURE__ */
|
|
1199
|
+
children: /* @__PURE__ */ J(D.Container, { children: /* @__PURE__ */ J(D.Dialog, { children: /* @__PURE__ */ Y(N, {
|
|
1201
1200
|
onSubmit: d,
|
|
1202
1201
|
children: [
|
|
1203
|
-
/* @__PURE__ */
|
|
1204
|
-
/* @__PURE__ */
|
|
1202
|
+
/* @__PURE__ */ J(D.CloseTrigger, {}),
|
|
1203
|
+
/* @__PURE__ */ Y(D.Header, { children: [/* @__PURE__ */ J(D.Icon, {
|
|
1205
1204
|
status: "danger",
|
|
1206
|
-
children: /* @__PURE__ */
|
|
1207
|
-
}), /* @__PURE__ */
|
|
1208
|
-
/* @__PURE__ */
|
|
1205
|
+
children: /* @__PURE__ */ J(Ze, {})
|
|
1206
|
+
}), /* @__PURE__ */ J(D.Heading, { children: s.deleteOrganization })] }),
|
|
1207
|
+
/* @__PURE__ */ Y(D.Body, {
|
|
1209
1208
|
className: "flex flex-col gap-4 overflow-visible",
|
|
1210
|
-
children: [/* @__PURE__ */
|
|
1209
|
+
children: [/* @__PURE__ */ J("p", {
|
|
1211
1210
|
className: "text-muted text-sm",
|
|
1212
1211
|
children: s.deleteOrganizationDescription
|
|
1213
|
-
}), /* @__PURE__ */
|
|
1212
|
+
}), /* @__PURE__ */ J(k, {
|
|
1214
1213
|
variant: "secondary",
|
|
1215
|
-
children: /* @__PURE__ */
|
|
1214
|
+
children: /* @__PURE__ */ J(k.Content, { children: /* @__PURE__ */ J(Z, {
|
|
1216
1215
|
organization: n,
|
|
1217
1216
|
hideRole: !0
|
|
1218
1217
|
}) })
|
|
1219
1218
|
})]
|
|
1220
1219
|
}),
|
|
1221
|
-
/* @__PURE__ */
|
|
1220
|
+
/* @__PURE__ */ Y(D.Footer, { children: [/* @__PURE__ */ J(O, {
|
|
1222
1221
|
slot: "close",
|
|
1223
1222
|
variant: "tertiary",
|
|
1224
1223
|
isDisabled: u,
|
|
1225
1224
|
children: a.settings.cancel
|
|
1226
|
-
}), /* @__PURE__ */
|
|
1225
|
+
}), /* @__PURE__ */ Y(O, {
|
|
1227
1226
|
type: "submit",
|
|
1228
1227
|
variant: "danger",
|
|
1229
1228
|
isPending: u,
|
|
1230
|
-
children: [u && /* @__PURE__ */
|
|
1229
|
+
children: [u && /* @__PURE__ */ J(B, {
|
|
1231
1230
|
color: "current",
|
|
1232
1231
|
size: "sm"
|
|
1233
1232
|
}), s.deleteOrganization]
|
|
@@ -1238,34 +1237,34 @@ function tn({ isOpen: e, onOpenChange: t, organization: n }) {
|
|
|
1238
1237
|
}
|
|
1239
1238
|
//#endregion
|
|
1240
1239
|
//#region src/components/auth/organization/delete-organization-skeleton.tsx
|
|
1241
|
-
function
|
|
1242
|
-
return /* @__PURE__ */
|
|
1240
|
+
function rn() {
|
|
1241
|
+
return /* @__PURE__ */ Y("div", {
|
|
1243
1242
|
className: "flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",
|
|
1244
|
-
children: [/* @__PURE__ */
|
|
1243
|
+
children: [/* @__PURE__ */ Y("div", {
|
|
1245
1244
|
className: "flex flex-col gap-1",
|
|
1246
|
-
children: [/* @__PURE__ */
|
|
1247
|
-
}), /* @__PURE__ */
|
|
1245
|
+
children: [/* @__PURE__ */ J(z, { className: "h-3.5 w-40 rounded-lg" }), /* @__PURE__ */ J(z, { className: "h-3 w-64 rounded-lg" })]
|
|
1246
|
+
}), /* @__PURE__ */ J(z, { className: "h-8 w-36 shrink-0 rounded-full" })]
|
|
1248
1247
|
});
|
|
1249
1248
|
}
|
|
1250
1249
|
//#endregion
|
|
1251
1250
|
//#region src/components/auth/organization/delete-organization.tsx
|
|
1252
|
-
function
|
|
1253
|
-
let { authClient: e } = p(), { localization: t } = m(
|
|
1254
|
-
return i ? /* @__PURE__ */
|
|
1251
|
+
function an() {
|
|
1252
|
+
let { authClient: e } = p(), { localization: t } = m(Q), { data: n } = d(e), { data: r, isPending: i } = w(e, { permissions: { organization: ["delete"] } }), [a, o] = K(!1);
|
|
1253
|
+
return i ? /* @__PURE__ */ J(rn, {}) : r?.success ? /* @__PURE__ */ Y("div", {
|
|
1255
1254
|
className: "flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",
|
|
1256
|
-
children: [/* @__PURE__ */
|
|
1255
|
+
children: [/* @__PURE__ */ Y("div", { children: [/* @__PURE__ */ J("p", {
|
|
1257
1256
|
className: "text-sm font-medium leading-tight",
|
|
1258
1257
|
children: t.deleteOrganization
|
|
1259
|
-
}), /* @__PURE__ */
|
|
1258
|
+
}), /* @__PURE__ */ J("p", {
|
|
1260
1259
|
className: "text-muted mt-0.5 text-xs",
|
|
1261
1260
|
children: t.deleteOrganizationDescription
|
|
1262
|
-
})] }), /* @__PURE__ */
|
|
1261
|
+
})] }), /* @__PURE__ */ Y(D, { children: [/* @__PURE__ */ J(O, {
|
|
1263
1262
|
isDisabled: !n,
|
|
1264
1263
|
size: "sm",
|
|
1265
1264
|
variant: "danger-soft",
|
|
1266
1265
|
onPress: () => o(!0),
|
|
1267
1266
|
children: t.deleteOrganization
|
|
1268
|
-
}), n && /* @__PURE__ */
|
|
1267
|
+
}), n && /* @__PURE__ */ J(nn, {
|
|
1269
1268
|
isOpen: a,
|
|
1270
1269
|
onOpenChange: o,
|
|
1271
1270
|
organization: n
|
|
@@ -1274,22 +1273,22 @@ function rn() {
|
|
|
1274
1273
|
}
|
|
1275
1274
|
//#endregion
|
|
1276
1275
|
//#region src/components/auth/organization/invite-member-dialog.tsx
|
|
1277
|
-
var
|
|
1278
|
-
function
|
|
1279
|
-
let { authClient: n, localization: r } = p(), { localization: i, roles: a } = m(
|
|
1280
|
-
|
|
1276
|
+
var on = (e) => e.includes("member") ? "member" : e.at(-1) ?? "";
|
|
1277
|
+
function sn({ isOpen: e, onOpenChange: t }) {
|
|
1278
|
+
let { authClient: n, localization: r } = p(), { localization: i, roles: a } = m(Q), [o, s] = K(() => on(Object.keys(a)));
|
|
1279
|
+
st(() => {
|
|
1281
1280
|
s((e) => {
|
|
1282
1281
|
let t = Object.keys(a);
|
|
1283
|
-
return t.includes(e) ? e :
|
|
1282
|
+
return t.includes(e) ? e : on(t);
|
|
1284
1283
|
});
|
|
1285
1284
|
}, [a]);
|
|
1286
|
-
let { mutate: c, isPending: l } =
|
|
1287
|
-
t(!1),
|
|
1285
|
+
let { mutate: c, isPending: l } = te(n, { onSuccess: () => {
|
|
1286
|
+
t(!1), G.success(i.inviteMemberSuccess);
|
|
1288
1287
|
} }), u = Object.keys(a).includes(o);
|
|
1289
|
-
return /* @__PURE__ */
|
|
1288
|
+
return /* @__PURE__ */ J(D.Backdrop, {
|
|
1290
1289
|
isOpen: e,
|
|
1291
1290
|
onOpenChange: t,
|
|
1292
|
-
children: /* @__PURE__ */
|
|
1291
|
+
children: /* @__PURE__ */ J(D.Container, { children: /* @__PURE__ */ J(D.Dialog, { children: /* @__PURE__ */ Y(N, {
|
|
1293
1292
|
onSubmit: (e) => {
|
|
1294
1293
|
e.preventDefault(), u && c({
|
|
1295
1294
|
email: new FormData(e.target).get("email").trim(),
|
|
@@ -1297,19 +1296,19 @@ function on({ isOpen: e, onOpenChange: t }) {
|
|
|
1297
1296
|
});
|
|
1298
1297
|
},
|
|
1299
1298
|
children: [
|
|
1300
|
-
/* @__PURE__ */
|
|
1301
|
-
/* @__PURE__ */
|
|
1299
|
+
/* @__PURE__ */ J(D.CloseTrigger, {}),
|
|
1300
|
+
/* @__PURE__ */ Y(D.Header, { children: [/* @__PURE__ */ J(D.Icon, {
|
|
1302
1301
|
status: "default",
|
|
1303
|
-
children: /* @__PURE__ */
|
|
1304
|
-
}), /* @__PURE__ */
|
|
1305
|
-
/* @__PURE__ */
|
|
1302
|
+
children: /* @__PURE__ */ J(Je, {})
|
|
1303
|
+
}), /* @__PURE__ */ J(D.Heading, { children: i.inviteMember })] }),
|
|
1304
|
+
/* @__PURE__ */ Y(D.Body, {
|
|
1306
1305
|
className: "flex flex-col gap-4 overflow-visible",
|
|
1307
1306
|
children: [
|
|
1308
|
-
/* @__PURE__ */
|
|
1307
|
+
/* @__PURE__ */ J("p", {
|
|
1309
1308
|
className: "text-muted text-sm",
|
|
1310
1309
|
children: i.inviteMemberDescription
|
|
1311
1310
|
}),
|
|
1312
|
-
/* @__PURE__ */
|
|
1311
|
+
/* @__PURE__ */ Y(U, {
|
|
1313
1312
|
id: "email",
|
|
1314
1313
|
name: "email",
|
|
1315
1314
|
type: "email",
|
|
@@ -1319,17 +1318,17 @@ function on({ isOpen: e, onOpenChange: t }) {
|
|
|
1319
1318
|
if (!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e)) return r.auth.invalidEmail;
|
|
1320
1319
|
},
|
|
1321
1320
|
children: [
|
|
1322
|
-
/* @__PURE__ */
|
|
1323
|
-
/* @__PURE__ */
|
|
1321
|
+
/* @__PURE__ */ J(I, { children: r.auth.email }),
|
|
1322
|
+
/* @__PURE__ */ J(P, {
|
|
1324
1323
|
autoFocus: !0,
|
|
1325
1324
|
placeholder: r.auth.email,
|
|
1326
1325
|
variant: "secondary",
|
|
1327
1326
|
required: !0
|
|
1328
1327
|
}),
|
|
1329
|
-
/* @__PURE__ */
|
|
1328
|
+
/* @__PURE__ */ J(M, {})
|
|
1330
1329
|
]
|
|
1331
1330
|
}),
|
|
1332
|
-
/* @__PURE__ */
|
|
1331
|
+
/* @__PURE__ */ Y(at, {
|
|
1333
1332
|
name: "role",
|
|
1334
1333
|
value: o,
|
|
1335
1334
|
onChange: (e) => {
|
|
@@ -1339,28 +1338,28 @@ function on({ isOpen: e, onOpenChange: t }) {
|
|
|
1339
1338
|
variant: "secondary",
|
|
1340
1339
|
fullWidth: !0,
|
|
1341
1340
|
children: [
|
|
1342
|
-
/* @__PURE__ */
|
|
1343
|
-
/* @__PURE__ */
|
|
1344
|
-
/* @__PURE__ */
|
|
1341
|
+
/* @__PURE__ */ J(I, { children: i.role }),
|
|
1342
|
+
/* @__PURE__ */ Y(at.Trigger, { children: [/* @__PURE__ */ J(at.Value, {}), /* @__PURE__ */ J(at.Indicator, {})] }),
|
|
1343
|
+
/* @__PURE__ */ J(at.Popover, { children: /* @__PURE__ */ J(rt, { children: Object.entries(a).map(([e, t]) => /* @__PURE__ */ Y(rt.Item, {
|
|
1345
1344
|
id: e,
|
|
1346
1345
|
textValue: t,
|
|
1347
|
-
children: [t, /* @__PURE__ */
|
|
1346
|
+
children: [t, /* @__PURE__ */ J(rt.ItemIndicator, {})]
|
|
1348
1347
|
}, e)) }) }),
|
|
1349
|
-
/* @__PURE__ */
|
|
1348
|
+
/* @__PURE__ */ J(M, {})
|
|
1350
1349
|
]
|
|
1351
1350
|
})
|
|
1352
1351
|
]
|
|
1353
1352
|
}),
|
|
1354
|
-
/* @__PURE__ */
|
|
1353
|
+
/* @__PURE__ */ Y(D.Footer, { children: [/* @__PURE__ */ J(O, {
|
|
1355
1354
|
slot: "close",
|
|
1356
1355
|
variant: "tertiary",
|
|
1357
1356
|
isDisabled: l,
|
|
1358
1357
|
children: r.settings.cancel
|
|
1359
|
-
}), /* @__PURE__ */
|
|
1358
|
+
}), /* @__PURE__ */ Y(O, {
|
|
1360
1359
|
type: "submit",
|
|
1361
1360
|
isPending: l,
|
|
1362
1361
|
isDisabled: !u,
|
|
1363
|
-
children: [l && /* @__PURE__ */
|
|
1362
|
+
children: [l && /* @__PURE__ */ J(B, {
|
|
1364
1363
|
color: "current",
|
|
1365
1364
|
size: "sm"
|
|
1366
1365
|
}), i.inviteMember]
|
|
@@ -1371,45 +1370,45 @@ function on({ isOpen: e, onOpenChange: t }) {
|
|
|
1371
1370
|
}
|
|
1372
1371
|
//#endregion
|
|
1373
1372
|
//#region src/components/auth/organization/leave-organization-dialog.tsx
|
|
1374
|
-
function
|
|
1375
|
-
let { authClient: r, basePaths: i, localization: a, navigate: o } = p(), { localization: s, viewPaths: c } = m(
|
|
1376
|
-
t(!1),
|
|
1373
|
+
function cn({ isOpen: e, onOpenChange: t, organization: n }) {
|
|
1374
|
+
let { authClient: r, basePaths: i, localization: a, navigate: o } = p(), { localization: s, viewPaths: c } = m(Q), { mutate: l, isPending: u } = re(r, { onSuccess: () => {
|
|
1375
|
+
t(!1), G.success(s.leftOrganization), o({
|
|
1377
1376
|
to: `${i.settings}/${c.settings.organizations}`,
|
|
1378
1377
|
replace: !0
|
|
1379
1378
|
});
|
|
1380
1379
|
} });
|
|
1381
|
-
return /* @__PURE__ */
|
|
1380
|
+
return /* @__PURE__ */ J(D.Backdrop, {
|
|
1382
1381
|
isOpen: e,
|
|
1383
1382
|
onOpenChange: t,
|
|
1384
|
-
children: /* @__PURE__ */
|
|
1385
|
-
/* @__PURE__ */
|
|
1386
|
-
/* @__PURE__ */
|
|
1383
|
+
children: /* @__PURE__ */ J(D.Container, { children: /* @__PURE__ */ Y(D.Dialog, { children: [
|
|
1384
|
+
/* @__PURE__ */ J(D.CloseTrigger, {}),
|
|
1385
|
+
/* @__PURE__ */ Y(D.Header, { children: [/* @__PURE__ */ J(D.Icon, {
|
|
1387
1386
|
status: "danger",
|
|
1388
|
-
children: /* @__PURE__ */
|
|
1389
|
-
}), /* @__PURE__ */
|
|
1390
|
-
/* @__PURE__ */
|
|
1387
|
+
children: /* @__PURE__ */ J(Ee, {})
|
|
1388
|
+
}), /* @__PURE__ */ J(D.Heading, { children: s.leaveOrganization })] }),
|
|
1389
|
+
/* @__PURE__ */ Y(D.Body, {
|
|
1391
1390
|
className: "flex flex-col gap-4 overflow-visible",
|
|
1392
|
-
children: [/* @__PURE__ */
|
|
1391
|
+
children: [/* @__PURE__ */ J("p", {
|
|
1393
1392
|
className: "text-muted text-sm",
|
|
1394
1393
|
children: s.leaveOrganizationDescription
|
|
1395
|
-
}), /* @__PURE__ */
|
|
1394
|
+
}), /* @__PURE__ */ J(k, {
|
|
1396
1395
|
variant: "secondary",
|
|
1397
|
-
children: /* @__PURE__ */
|
|
1396
|
+
children: /* @__PURE__ */ J(k.Content, { children: /* @__PURE__ */ J(Z, {
|
|
1398
1397
|
organization: n,
|
|
1399
1398
|
hideRole: !0
|
|
1400
1399
|
}) })
|
|
1401
1400
|
})]
|
|
1402
1401
|
}),
|
|
1403
|
-
/* @__PURE__ */
|
|
1402
|
+
/* @__PURE__ */ Y(D.Footer, { children: [/* @__PURE__ */ J(O, {
|
|
1404
1403
|
slot: "close",
|
|
1405
1404
|
variant: "tertiary",
|
|
1406
1405
|
isDisabled: u,
|
|
1407
1406
|
children: a.settings.cancel
|
|
1408
|
-
}), /* @__PURE__ */
|
|
1407
|
+
}), /* @__PURE__ */ Y(O, {
|
|
1409
1408
|
variant: "danger",
|
|
1410
1409
|
isPending: u,
|
|
1411
1410
|
onPress: () => l({ organizationId: n.id }),
|
|
1412
|
-
children: [u && /* @__PURE__ */
|
|
1411
|
+
children: [u && /* @__PURE__ */ J(B, {
|
|
1413
1412
|
color: "current",
|
|
1414
1413
|
size: "sm"
|
|
1415
1414
|
}), s.leaveOrganization]
|
|
@@ -1419,23 +1418,23 @@ function sn({ isOpen: e, onOpenChange: t, organization: n }) {
|
|
|
1419
1418
|
}
|
|
1420
1419
|
//#endregion
|
|
1421
1420
|
//#region src/components/auth/organization/leave-organization.tsx
|
|
1422
|
-
function
|
|
1423
|
-
let { authClient: e } = p(), { localization: t } = m(
|
|
1424
|
-
return /* @__PURE__ */
|
|
1421
|
+
function ln() {
|
|
1422
|
+
let { authClient: e } = p(), { localization: t } = m(Q), { data: n } = d(e), [r, i] = K(!1);
|
|
1423
|
+
return /* @__PURE__ */ Y("div", {
|
|
1425
1424
|
className: "flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",
|
|
1426
|
-
children: [/* @__PURE__ */
|
|
1425
|
+
children: [/* @__PURE__ */ Y("div", { children: [/* @__PURE__ */ J("p", {
|
|
1427
1426
|
className: "text-sm font-medium leading-tight",
|
|
1428
1427
|
children: t.leaveOrganization
|
|
1429
|
-
}), /* @__PURE__ */
|
|
1428
|
+
}), /* @__PURE__ */ J("p", {
|
|
1430
1429
|
className: "text-muted mt-0.5 text-xs",
|
|
1431
1430
|
children: t.leaveOrganizationDescription
|
|
1432
|
-
})] }), /* @__PURE__ */
|
|
1431
|
+
})] }), /* @__PURE__ */ Y(D, { children: [/* @__PURE__ */ J(O, {
|
|
1433
1432
|
isDisabled: !n,
|
|
1434
1433
|
size: "sm",
|
|
1435
1434
|
variant: "danger-soft",
|
|
1436
1435
|
onPress: () => i(!0),
|
|
1437
1436
|
children: t.leaveOrganization
|
|
1438
|
-
}), n && /* @__PURE__ */
|
|
1437
|
+
}), n && /* @__PURE__ */ J(cn, {
|
|
1439
1438
|
isOpen: r,
|
|
1440
1439
|
onOpenChange: i,
|
|
1441
1440
|
organization: n
|
|
@@ -1444,80 +1443,80 @@ function cn() {
|
|
|
1444
1443
|
}
|
|
1445
1444
|
//#endregion
|
|
1446
1445
|
//#region src/components/auth/organization/organization-invitation-row-skeleton.tsx
|
|
1447
|
-
function
|
|
1448
|
-
return /* @__PURE__ */
|
|
1449
|
-
/* @__PURE__ */
|
|
1450
|
-
/* @__PURE__ */
|
|
1451
|
-
/* @__PURE__ */
|
|
1452
|
-
/* @__PURE__ */
|
|
1453
|
-
/* @__PURE__ */
|
|
1446
|
+
function un() {
|
|
1447
|
+
return /* @__PURE__ */ Y(V.Row, { children: [
|
|
1448
|
+
/* @__PURE__ */ J(V.Cell, { children: /* @__PURE__ */ J(z, { className: "h-4 w-48 rounded-lg" }) }),
|
|
1449
|
+
/* @__PURE__ */ J(V.Cell, { children: /* @__PURE__ */ J(z, { className: "h-4 w-36 rounded-lg" }) }),
|
|
1450
|
+
/* @__PURE__ */ J(V.Cell, { children: /* @__PURE__ */ J(z, { className: "h-4 w-16 rounded-lg" }) }),
|
|
1451
|
+
/* @__PURE__ */ J(V.Cell, { children: /* @__PURE__ */ J(z, { className: "h-4 w-14 rounded-full" }) }),
|
|
1452
|
+
/* @__PURE__ */ J(V.Cell, {})
|
|
1454
1453
|
] });
|
|
1455
1454
|
}
|
|
1456
1455
|
//#endregion
|
|
1457
1456
|
//#region src/components/auth/organization/organization-invitation-row.tsx
|
|
1458
|
-
function
|
|
1459
|
-
let { authClient: t } = p(), { localization: n, roles: r } = m(
|
|
1460
|
-
return a ? /* @__PURE__ */
|
|
1461
|
-
/* @__PURE__ */
|
|
1457
|
+
function dn({ invitation: e }) {
|
|
1458
|
+
let { authClient: t } = p(), { localization: n, roles: r } = m(Q), { data: i, isPending: a } = w(t, { permissions: { invitation: ["cancel"] } }), { mutate: o, isPending: s } = g(t), c = r?.[e.role] ?? e.role, l = n[e.status] ?? e.status, u = e.status === "pending" ? "warning" : e.status === "accepted" ? "success" : e.status === "rejected" ? "danger" : "default";
|
|
1459
|
+
return a ? /* @__PURE__ */ J(un, {}) : /* @__PURE__ */ Y(V.Row, { children: [
|
|
1460
|
+
/* @__PURE__ */ J(V.Cell, {
|
|
1462
1461
|
className: "font-medium text-sm",
|
|
1463
1462
|
children: e.email
|
|
1464
1463
|
}),
|
|
1465
|
-
/* @__PURE__ */
|
|
1464
|
+
/* @__PURE__ */ J(V.Cell, {
|
|
1466
1465
|
className: "text-muted text-xs tabular-nums whitespace-nowrap",
|
|
1467
1466
|
children: new Date(e.createdAt).toLocaleString(void 0, {
|
|
1468
1467
|
dateStyle: "short",
|
|
1469
1468
|
timeStyle: "short"
|
|
1470
1469
|
})
|
|
1471
1470
|
}),
|
|
1472
|
-
/* @__PURE__ */
|
|
1471
|
+
/* @__PURE__ */ J(V.Cell, {
|
|
1473
1472
|
className: "text-sm",
|
|
1474
1473
|
children: c
|
|
1475
1474
|
}),
|
|
1476
|
-
/* @__PURE__ */
|
|
1475
|
+
/* @__PURE__ */ J(V.Cell, {
|
|
1477
1476
|
className: "text-sm",
|
|
1478
|
-
children: /* @__PURE__ */
|
|
1477
|
+
children: /* @__PURE__ */ J(A, {
|
|
1479
1478
|
color: u,
|
|
1480
1479
|
size: "sm",
|
|
1481
1480
|
variant: "soft",
|
|
1482
1481
|
children: l
|
|
1483
1482
|
})
|
|
1484
1483
|
}),
|
|
1485
|
-
/* @__PURE__ */
|
|
1484
|
+
/* @__PURE__ */ J(V.Cell, {
|
|
1486
1485
|
className: "text-end",
|
|
1487
|
-
children: i?.success && e.status === "pending" && /* @__PURE__ */
|
|
1486
|
+
children: i?.success && e.status === "pending" && /* @__PURE__ */ J(O, {
|
|
1488
1487
|
isIconOnly: !0,
|
|
1489
1488
|
size: "sm",
|
|
1490
1489
|
variant: "danger-soft",
|
|
1491
1490
|
isPending: s,
|
|
1492
1491
|
onPress: () => o({ invitationId: e.id }),
|
|
1493
1492
|
"aria-label": n.cancelInvitation,
|
|
1494
|
-
children: s ? /* @__PURE__ */
|
|
1493
|
+
children: s ? /* @__PURE__ */ J(B, {
|
|
1495
1494
|
color: "current",
|
|
1496
1495
|
size: "sm"
|
|
1497
|
-
}) : /* @__PURE__ */
|
|
1496
|
+
}) : /* @__PURE__ */ J(E, {})
|
|
1498
1497
|
})
|
|
1499
1498
|
})
|
|
1500
1499
|
] });
|
|
1501
1500
|
}
|
|
1502
1501
|
//#endregion
|
|
1503
1502
|
//#region src/components/auth/organization/organization-invitations-empty.tsx
|
|
1504
|
-
function
|
|
1505
|
-
let { localization: t } = m(
|
|
1506
|
-
return /* @__PURE__ */
|
|
1503
|
+
function fn({ onInvitePress: e }) {
|
|
1504
|
+
let { localization: t } = m(Q);
|
|
1505
|
+
return /* @__PURE__ */ Y(tt, {
|
|
1507
1506
|
className: "flex flex-col items-center gap-4 text-center p-4",
|
|
1508
1507
|
children: [
|
|
1509
|
-
/* @__PURE__ */
|
|
1510
|
-
/* @__PURE__ */
|
|
1508
|
+
/* @__PURE__ */ J(Ge, { className: "size-6 text-muted" }),
|
|
1509
|
+
/* @__PURE__ */ Y("div", {
|
|
1511
1510
|
className: "flex flex-col gap-2",
|
|
1512
|
-
children: [/* @__PURE__ */
|
|
1511
|
+
children: [/* @__PURE__ */ J("p", {
|
|
1513
1512
|
className: "text-sm font-semibold text-foreground",
|
|
1514
1513
|
children: t.noInvitations
|
|
1515
|
-
}), /* @__PURE__ */
|
|
1514
|
+
}), /* @__PURE__ */ J("span", {
|
|
1516
1515
|
className: "text-sm text-muted",
|
|
1517
1516
|
children: t.organizationInvitationsEmptyDescription
|
|
1518
1517
|
})]
|
|
1519
1518
|
}),
|
|
1520
|
-
/* @__PURE__ */
|
|
1519
|
+
/* @__PURE__ */ J(O, {
|
|
1521
1520
|
size: "sm",
|
|
1522
1521
|
onPress: e,
|
|
1523
1522
|
children: t.inviteMember
|
|
@@ -1527,256 +1526,256 @@ function dn({ onInvitePress: e }) {
|
|
|
1527
1526
|
}
|
|
1528
1527
|
//#endregion
|
|
1529
1528
|
//#region src/components/auth/organization/organization-invitations.tsx
|
|
1530
|
-
function
|
|
1531
|
-
let { authClient: n, localization: r } = p(), { localization: i, roles: a } = m(
|
|
1529
|
+
function pn({ className: e, ...t }) {
|
|
1530
|
+
let { authClient: n, localization: r } = p(), { localization: i, roles: a } = m(Q), { data: o, isPending: s } = se(n), { isPending: c } = w(n, { permissions: { invitation: ["cancel"] } }), l = s || c, [u, d] = K(), [f, h] = K("all"), [g, _] = K("all"), [v, y] = K(""), b = ct(() => o?.filter((e) => (f === "all" || e.role === f) && (g === "all" || e.status === g) && e.email.toLowerCase().includes(v.toLowerCase())), [
|
|
1532
1531
|
v,
|
|
1533
1532
|
o,
|
|
1534
1533
|
f,
|
|
1535
1534
|
g
|
|
1536
|
-
]), x =
|
|
1535
|
+
]), x = ct(() => !u || !b ? b : [...b].sort((e, t) => {
|
|
1537
1536
|
let n = u.column, r = 0;
|
|
1538
1537
|
return r = n === "createdAt" ? new Date(e.createdAt).getTime() - new Date(t.createdAt).getTime() : String(e[n]).localeCompare(String(t[n])), u.direction === "descending" && (r *= -1), r;
|
|
1539
|
-
}), [u, b]), [S, C] =
|
|
1540
|
-
return /* @__PURE__ */
|
|
1541
|
-
className:
|
|
1538
|
+
}), [u, b]), [S, C] = K(!1);
|
|
1539
|
+
return /* @__PURE__ */ Y("div", {
|
|
1540
|
+
className: W("flex flex-col gap-3", e),
|
|
1542
1541
|
...t,
|
|
1543
1542
|
children: [
|
|
1544
|
-
/* @__PURE__ */
|
|
1543
|
+
/* @__PURE__ */ J("h3", {
|
|
1545
1544
|
className: "truncate text-sm font-semibold",
|
|
1546
1545
|
children: i.invitations
|
|
1547
1546
|
}),
|
|
1548
|
-
/* @__PURE__ */
|
|
1547
|
+
/* @__PURE__ */ Y("div", {
|
|
1549
1548
|
className: "flex flex-col gap-4",
|
|
1550
1549
|
children: [
|
|
1551
|
-
/* @__PURE__ */
|
|
1550
|
+
/* @__PURE__ */ Y("div", {
|
|
1552
1551
|
className: "flex items-center gap-3",
|
|
1553
1552
|
children: [
|
|
1554
|
-
/* @__PURE__ */
|
|
1553
|
+
/* @__PURE__ */ J(R, {
|
|
1555
1554
|
className: "min-w-0",
|
|
1556
1555
|
"aria-label": i.search,
|
|
1557
1556
|
value: v,
|
|
1558
1557
|
onChange: y,
|
|
1559
1558
|
isDisabled: l,
|
|
1560
|
-
children: /* @__PURE__ */
|
|
1561
|
-
/* @__PURE__ */
|
|
1562
|
-
/* @__PURE__ */
|
|
1559
|
+
children: /* @__PURE__ */ Y(R.Group, { children: [
|
|
1560
|
+
/* @__PURE__ */ J(R.SearchIcon, {}),
|
|
1561
|
+
/* @__PURE__ */ J(R.Input, {
|
|
1563
1562
|
placeholder: i.search,
|
|
1564
1563
|
className: "sm:w-[200px]"
|
|
1565
1564
|
}),
|
|
1566
|
-
/* @__PURE__ */
|
|
1565
|
+
/* @__PURE__ */ J(R.ClearButton, {})
|
|
1567
1566
|
] })
|
|
1568
1567
|
}),
|
|
1569
|
-
/* @__PURE__ */
|
|
1568
|
+
/* @__PURE__ */ Y(j, { children: [/* @__PURE__ */ Y(O, {
|
|
1570
1569
|
size: "sm",
|
|
1571
1570
|
variant: "secondary",
|
|
1572
1571
|
isDisabled: l,
|
|
1573
|
-
children: [/* @__PURE__ */
|
|
1574
|
-
}), /* @__PURE__ */
|
|
1572
|
+
children: [/* @__PURE__ */ J(ze, {}), i.role]
|
|
1573
|
+
}), /* @__PURE__ */ J(j.Popover, { children: /* @__PURE__ */ Y(j.Menu, {
|
|
1575
1574
|
selectionMode: "single",
|
|
1576
1575
|
selectedKeys: new Set([f]),
|
|
1577
1576
|
onSelectionChange: (e) => {
|
|
1578
1577
|
let t = [...e][0];
|
|
1579
1578
|
h(t ?? "all");
|
|
1580
1579
|
},
|
|
1581
|
-
children: [/* @__PURE__ */
|
|
1580
|
+
children: [/* @__PURE__ */ Y(j.Item, {
|
|
1582
1581
|
id: "all",
|
|
1583
1582
|
textValue: i.all,
|
|
1584
|
-
children: [/* @__PURE__ */
|
|
1585
|
-
}), Object.entries(a).map(([e, t]) => /* @__PURE__ */
|
|
1583
|
+
children: [/* @__PURE__ */ J(I, { children: i.all }), /* @__PURE__ */ J(j.ItemIndicator, {})]
|
|
1584
|
+
}), Object.entries(a).map(([e, t]) => /* @__PURE__ */ Y(j.Item, {
|
|
1586
1585
|
id: e,
|
|
1587
1586
|
textValue: t,
|
|
1588
|
-
children: [/* @__PURE__ */
|
|
1587
|
+
children: [/* @__PURE__ */ J(I, { children: t }), /* @__PURE__ */ J(j.ItemIndicator, {})]
|
|
1589
1588
|
}, e))]
|
|
1590
1589
|
}) })] }),
|
|
1591
|
-
/* @__PURE__ */
|
|
1590
|
+
/* @__PURE__ */ Y(j, { children: [/* @__PURE__ */ Y(O, {
|
|
1592
1591
|
size: "sm",
|
|
1593
1592
|
variant: "secondary",
|
|
1594
1593
|
isDisabled: l,
|
|
1595
|
-
children: [/* @__PURE__ */
|
|
1596
|
-
}), /* @__PURE__ */
|
|
1594
|
+
children: [/* @__PURE__ */ J(ze, {}), i.status]
|
|
1595
|
+
}), /* @__PURE__ */ J(j.Popover, { children: /* @__PURE__ */ Y(j.Menu, {
|
|
1597
1596
|
selectionMode: "single",
|
|
1598
1597
|
selectedKeys: new Set([g]),
|
|
1599
1598
|
onSelectionChange: (e) => {
|
|
1600
1599
|
let t = [...e][0];
|
|
1601
1600
|
_(t ?? "all");
|
|
1602
1601
|
},
|
|
1603
|
-
children: [/* @__PURE__ */
|
|
1602
|
+
children: [/* @__PURE__ */ Y(j.Item, {
|
|
1604
1603
|
id: "all",
|
|
1605
1604
|
textValue: i.all,
|
|
1606
|
-
children: [/* @__PURE__ */
|
|
1605
|
+
children: [/* @__PURE__ */ J(I, { children: i.all }), /* @__PURE__ */ J(j.ItemIndicator, {})]
|
|
1607
1606
|
}), [
|
|
1608
1607
|
"pending",
|
|
1609
1608
|
"accepted",
|
|
1610
1609
|
"rejected",
|
|
1611
1610
|
"canceled"
|
|
1612
|
-
].map((e) => /* @__PURE__ */
|
|
1611
|
+
].map((e) => /* @__PURE__ */ Y(j.Item, {
|
|
1613
1612
|
id: e,
|
|
1614
1613
|
textValue: i[e] ?? e,
|
|
1615
|
-
children: [/* @__PURE__ */
|
|
1614
|
+
children: [/* @__PURE__ */ J(I, { children: i[e] ?? e }), /* @__PURE__ */ J(j.ItemIndicator, {})]
|
|
1616
1615
|
}, e))]
|
|
1617
1616
|
}) })] })
|
|
1618
1617
|
]
|
|
1619
1618
|
}),
|
|
1620
|
-
(f !== "all" || g !== "all") && /* @__PURE__ */
|
|
1619
|
+
(f !== "all" || g !== "all") && /* @__PURE__ */ Y("div", {
|
|
1621
1620
|
className: "flex flex-wrap gap-2",
|
|
1622
|
-
children: [f !== "all" && /* @__PURE__ */
|
|
1621
|
+
children: [f !== "all" && /* @__PURE__ */ Y(A, {
|
|
1623
1622
|
size: "sm",
|
|
1624
1623
|
variant: "secondary",
|
|
1625
1624
|
className: "w-fit",
|
|
1626
|
-
children: [/* @__PURE__ */
|
|
1625
|
+
children: [/* @__PURE__ */ Y(A.Label, { children: [
|
|
1627
1626
|
i.role,
|
|
1628
1627
|
":",
|
|
1629
1628
|
" ",
|
|
1630
|
-
/* @__PURE__ */
|
|
1629
|
+
/* @__PURE__ */ J("span", {
|
|
1631
1630
|
className: "capitalize",
|
|
1632
1631
|
children: a?.[f] ?? f
|
|
1633
1632
|
})
|
|
1634
|
-
] }), /* @__PURE__ */
|
|
1633
|
+
] }), /* @__PURE__ */ J("button", {
|
|
1635
1634
|
type: "button",
|
|
1636
1635
|
"aria-label": i.clear,
|
|
1637
1636
|
className: "text-muted hover:text-foreground inline-flex cursor-pointer items-center",
|
|
1638
1637
|
onClick: () => h("all"),
|
|
1639
|
-
children: /* @__PURE__ */
|
|
1638
|
+
children: /* @__PURE__ */ J(E, { className: "size-3" })
|
|
1640
1639
|
})]
|
|
1641
|
-
}), g !== "all" && /* @__PURE__ */
|
|
1640
|
+
}), g !== "all" && /* @__PURE__ */ Y(A, {
|
|
1642
1641
|
size: "sm",
|
|
1643
1642
|
variant: "secondary",
|
|
1644
1643
|
className: "w-fit",
|
|
1645
|
-
children: [/* @__PURE__ */
|
|
1644
|
+
children: [/* @__PURE__ */ Y(A.Label, { children: [
|
|
1646
1645
|
i.status,
|
|
1647
1646
|
":",
|
|
1648
1647
|
" ",
|
|
1649
1648
|
i[g] ?? g
|
|
1650
|
-
] }), /* @__PURE__ */
|
|
1649
|
+
] }), /* @__PURE__ */ J("button", {
|
|
1651
1650
|
type: "button",
|
|
1652
1651
|
"aria-label": i.clear,
|
|
1653
1652
|
className: "text-muted hover:text-foreground inline-flex cursor-pointer items-center",
|
|
1654
1653
|
onClick: () => _("all"),
|
|
1655
|
-
children: /* @__PURE__ */
|
|
1654
|
+
children: /* @__PURE__ */ J(E, { className: "size-3" })
|
|
1656
1655
|
})]
|
|
1657
1656
|
})]
|
|
1658
1657
|
}),
|
|
1659
|
-
/* @__PURE__ */
|
|
1658
|
+
/* @__PURE__ */ J(V, { children: /* @__PURE__ */ J(V.ScrollContainer, { children: /* @__PURE__ */ Y(V.Content, {
|
|
1660
1659
|
"aria-label": i.invitations,
|
|
1661
1660
|
sortDescriptor: u,
|
|
1662
1661
|
onSortChange: (e) => {
|
|
1663
1662
|
d(u?.column === e.column && e.direction === "ascending" ? void 0 : e);
|
|
1664
1663
|
},
|
|
1665
|
-
children: [/* @__PURE__ */
|
|
1666
|
-
/* @__PURE__ */
|
|
1664
|
+
children: [/* @__PURE__ */ Y(V.Header, { children: [
|
|
1665
|
+
/* @__PURE__ */ J(V.Column, {
|
|
1667
1666
|
allowsSorting: !0,
|
|
1668
1667
|
isRowHeader: !0,
|
|
1669
1668
|
id: "email",
|
|
1670
|
-
children: ({ sortDirection: e }) => /* @__PURE__ */
|
|
1669
|
+
children: ({ sortDirection: e }) => /* @__PURE__ */ J(mn, {
|
|
1671
1670
|
sortDirection: e,
|
|
1672
1671
|
children: r.auth.email
|
|
1673
1672
|
})
|
|
1674
1673
|
}),
|
|
1675
|
-
/* @__PURE__ */
|
|
1674
|
+
/* @__PURE__ */ J(V.Column, {
|
|
1676
1675
|
allowsSorting: !0,
|
|
1677
1676
|
id: "createdAt",
|
|
1678
|
-
children: ({ sortDirection: e }) => /* @__PURE__ */
|
|
1677
|
+
children: ({ sortDirection: e }) => /* @__PURE__ */ J(mn, {
|
|
1679
1678
|
sortDirection: e,
|
|
1680
1679
|
children: i.invitedAt
|
|
1681
1680
|
})
|
|
1682
1681
|
}),
|
|
1683
|
-
/* @__PURE__ */
|
|
1682
|
+
/* @__PURE__ */ J(V.Column, {
|
|
1684
1683
|
allowsSorting: !0,
|
|
1685
1684
|
id: "role",
|
|
1686
|
-
children: ({ sortDirection: e }) => /* @__PURE__ */
|
|
1685
|
+
children: ({ sortDirection: e }) => /* @__PURE__ */ J(mn, {
|
|
1687
1686
|
sortDirection: e,
|
|
1688
1687
|
children: i.role
|
|
1689
1688
|
})
|
|
1690
1689
|
}),
|
|
1691
|
-
/* @__PURE__ */
|
|
1690
|
+
/* @__PURE__ */ J(V.Column, {
|
|
1692
1691
|
allowsSorting: !0,
|
|
1693
1692
|
id: "status",
|
|
1694
|
-
children: ({ sortDirection: e }) => /* @__PURE__ */
|
|
1693
|
+
children: ({ sortDirection: e }) => /* @__PURE__ */ J(mn, {
|
|
1695
1694
|
sortDirection: e,
|
|
1696
1695
|
children: i.status
|
|
1697
1696
|
})
|
|
1698
1697
|
}),
|
|
1699
|
-
/* @__PURE__ */
|
|
1698
|
+
/* @__PURE__ */ J(V.Column, {
|
|
1700
1699
|
className: "text-end",
|
|
1701
1700
|
children: i.actions
|
|
1702
1701
|
})
|
|
1703
|
-
] }), /* @__PURE__ */
|
|
1704
|
-
renderEmptyState: () => /* @__PURE__ */
|
|
1705
|
-
children: l ? /* @__PURE__ */
|
|
1702
|
+
] }), /* @__PURE__ */ J(V.Body, {
|
|
1703
|
+
renderEmptyState: () => /* @__PURE__ */ J(fn, { onInvitePress: () => C(!0) }),
|
|
1704
|
+
children: l ? /* @__PURE__ */ J(un, {}) : x?.map((e) => /* @__PURE__ */ J(dn, { invitation: e }, e.id))
|
|
1706
1705
|
})]
|
|
1707
1706
|
}) }) })
|
|
1708
1707
|
]
|
|
1709
1708
|
}),
|
|
1710
|
-
/* @__PURE__ */
|
|
1709
|
+
/* @__PURE__ */ J(sn, {
|
|
1711
1710
|
isOpen: S,
|
|
1712
1711
|
onOpenChange: C
|
|
1713
1712
|
})
|
|
1714
1713
|
]
|
|
1715
1714
|
});
|
|
1716
1715
|
}
|
|
1717
|
-
function
|
|
1718
|
-
return /* @__PURE__ */
|
|
1716
|
+
function mn({ children: e, sortDirection: t }) {
|
|
1717
|
+
return /* @__PURE__ */ Y("span", {
|
|
1719
1718
|
className: "flex items-center justify-between",
|
|
1720
|
-
children: [e, !!t && /* @__PURE__ */
|
|
1719
|
+
children: [e, !!t && /* @__PURE__ */ J(ke, { className: W("size-3 transform transition-transform duration-100 ease-out", t === "descending" ? "rotate-180" : "") })]
|
|
1721
1720
|
});
|
|
1722
1721
|
}
|
|
1723
1722
|
//#endregion
|
|
1724
1723
|
//#region src/components/auth/organization/organization-member-row-skeleton.tsx
|
|
1725
|
-
function
|
|
1726
|
-
return /* @__PURE__ */
|
|
1727
|
-
/* @__PURE__ */
|
|
1728
|
-
/* @__PURE__ */
|
|
1729
|
-
/* @__PURE__ */
|
|
1724
|
+
function hn() {
|
|
1725
|
+
return /* @__PURE__ */ Y(V.Row, { children: [
|
|
1726
|
+
/* @__PURE__ */ J(V.Cell, { children: /* @__PURE__ */ J(n, { isPending: !0 }) }),
|
|
1727
|
+
/* @__PURE__ */ J(V.Cell, { children: /* @__PURE__ */ J(z, { className: "h-4 w-18 rounded-lg" }) }),
|
|
1728
|
+
/* @__PURE__ */ J(V.Cell, {
|
|
1730
1729
|
className: "flex justify-end",
|
|
1731
|
-
children: /* @__PURE__ */
|
|
1730
|
+
children: /* @__PURE__ */ J(z, { className: "size-8 rounded-full" })
|
|
1732
1731
|
})
|
|
1733
1732
|
] });
|
|
1734
1733
|
}
|
|
1735
1734
|
//#endregion
|
|
1736
1735
|
//#region src/components/auth/organization/remove-member-dialog.tsx
|
|
1737
|
-
function
|
|
1738
|
-
let { authClient: i, localization: a } = p(), { localization: o, roles: s } = m(
|
|
1739
|
-
t(!1),
|
|
1736
|
+
function gn({ isOpen: e, onOpenChange: t, member: r }) {
|
|
1737
|
+
let { authClient: i, localization: a } = p(), { localization: o, roles: s } = m(Q), { mutate: c, isPending: l } = pe(i, { onSuccess: () => {
|
|
1738
|
+
t(!1), G.success(o.memberRemoved);
|
|
1740
1739
|
} });
|
|
1741
|
-
return /* @__PURE__ */
|
|
1740
|
+
return /* @__PURE__ */ J(D.Backdrop, {
|
|
1742
1741
|
isOpen: e,
|
|
1743
1742
|
onOpenChange: t,
|
|
1744
|
-
children: /* @__PURE__ */
|
|
1745
|
-
/* @__PURE__ */
|
|
1746
|
-
/* @__PURE__ */
|
|
1743
|
+
children: /* @__PURE__ */ J(D.Container, { children: /* @__PURE__ */ Y(D.Dialog, { children: [
|
|
1744
|
+
/* @__PURE__ */ J(D.CloseTrigger, {}),
|
|
1745
|
+
/* @__PURE__ */ Y(D.Header, { children: [/* @__PURE__ */ J(D.Icon, {
|
|
1747
1746
|
status: "danger",
|
|
1748
|
-
children: /* @__PURE__ */
|
|
1749
|
-
}), /* @__PURE__ */
|
|
1750
|
-
/* @__PURE__ */
|
|
1747
|
+
children: /* @__PURE__ */ J(Xe, {})
|
|
1748
|
+
}), /* @__PURE__ */ J(D.Heading, { children: o.removeMember })] }),
|
|
1749
|
+
/* @__PURE__ */ Y(D.Body, {
|
|
1751
1750
|
className: "flex flex-col gap-4 overflow-visible",
|
|
1752
|
-
children: [/* @__PURE__ */
|
|
1751
|
+
children: [/* @__PURE__ */ J("p", {
|
|
1753
1752
|
className: "text-muted text-sm",
|
|
1754
1753
|
children: o.removeMemberWarning
|
|
1755
|
-
}), /* @__PURE__ */
|
|
1754
|
+
}), /* @__PURE__ */ J(k, {
|
|
1756
1755
|
variant: "secondary",
|
|
1757
|
-
children: /* @__PURE__ */
|
|
1756
|
+
children: /* @__PURE__ */ Y(k.Content, {
|
|
1758
1757
|
className: "justify-between flex-row items-center gap-2",
|
|
1759
|
-
children: [/* @__PURE__ */
|
|
1758
|
+
children: [/* @__PURE__ */ J(n, { user: r.user }), /* @__PURE__ */ J(A, {
|
|
1760
1759
|
size: "sm",
|
|
1761
1760
|
variant: "tertiary",
|
|
1762
|
-
children: /* @__PURE__ */
|
|
1761
|
+
children: /* @__PURE__ */ J(A.Label, { children: s?.[r.role] ?? r.role })
|
|
1763
1762
|
})]
|
|
1764
1763
|
})
|
|
1765
1764
|
})]
|
|
1766
1765
|
}),
|
|
1767
|
-
/* @__PURE__ */
|
|
1766
|
+
/* @__PURE__ */ Y(D.Footer, { children: [/* @__PURE__ */ J(O, {
|
|
1768
1767
|
slot: "close",
|
|
1769
1768
|
variant: "tertiary",
|
|
1770
1769
|
isDisabled: l,
|
|
1771
1770
|
children: a.settings.cancel
|
|
1772
|
-
}), /* @__PURE__ */
|
|
1771
|
+
}), /* @__PURE__ */ Y(O, {
|
|
1773
1772
|
variant: "danger",
|
|
1774
1773
|
isPending: l,
|
|
1775
1774
|
onPress: () => c({
|
|
1776
1775
|
memberIdOrEmail: r.id,
|
|
1777
1776
|
organizationId: r.organizationId
|
|
1778
1777
|
}),
|
|
1779
|
-
children: [l && /* @__PURE__ */
|
|
1778
|
+
children: [l && /* @__PURE__ */ J(B, {
|
|
1780
1779
|
color: "current",
|
|
1781
1780
|
size: "sm"
|
|
1782
1781
|
}), o.removeMember]
|
|
@@ -1786,54 +1785,54 @@ function hn({ isOpen: e, onOpenChange: t, member: r }) {
|
|
|
1786
1785
|
}
|
|
1787
1786
|
//#endregion
|
|
1788
1787
|
//#region src/components/auth/organization/organization-member-row.tsx
|
|
1789
|
-
function
|
|
1790
|
-
let { authClient: i } = p(), { localization: a, roles: o } = m(
|
|
1791
|
-
return f ? /* @__PURE__ */
|
|
1792
|
-
/* @__PURE__ */
|
|
1793
|
-
/* @__PURE__ */
|
|
1794
|
-
/* @__PURE__ */
|
|
1788
|
+
function _n({ member: e, isOwner: t, organization: r }) {
|
|
1789
|
+
let { authClient: i } = p(), { localization: a, roles: o } = m(Q), { data: s } = T(i), { data: c, isPending: l } = w(i, { permissions: { member: ["update"] } }), { data: u, isPending: d } = w(i, { permissions: { member: ["delete"] } }), f = l || d, { mutate: h, isPending: g } = Se(i, { onSuccess: () => G.success(a.memberRoleUpdated) }), _ = o?.[e.role] ?? e.role, v = Object.entries(o).filter(([e]) => t || e !== "owner"), y = s?.user.id === e.userId, [b, x] = K(!1), [S, C] = K(!1);
|
|
1790
|
+
return f ? /* @__PURE__ */ J(hn, {}) : /* @__PURE__ */ Y(V.Row, { children: [
|
|
1791
|
+
/* @__PURE__ */ J(V.Cell, { children: /* @__PURE__ */ J(n, { user: e.user }) }),
|
|
1792
|
+
/* @__PURE__ */ J(V.Cell, { children: _ }),
|
|
1793
|
+
/* @__PURE__ */ Y(V.Cell, { children: [/* @__PURE__ */ Y("div", {
|
|
1795
1794
|
className: "flex items-center justify-end gap-1",
|
|
1796
|
-
children: [c?.success && /* @__PURE__ */
|
|
1795
|
+
children: [c?.success && /* @__PURE__ */ Y(j, { children: [/* @__PURE__ */ J(O, {
|
|
1797
1796
|
isIconOnly: !0,
|
|
1798
1797
|
size: "sm",
|
|
1799
1798
|
variant: "tertiary",
|
|
1800
1799
|
isDisabled: g,
|
|
1801
1800
|
"aria-label": a.changeMemberRole,
|
|
1802
|
-
children: g ? /* @__PURE__ */
|
|
1801
|
+
children: g ? /* @__PURE__ */ J(B, {
|
|
1803
1802
|
color: "current",
|
|
1804
1803
|
size: "sm"
|
|
1805
|
-
}) : /* @__PURE__ */
|
|
1806
|
-
}), /* @__PURE__ */
|
|
1804
|
+
}) : /* @__PURE__ */ J(Ke, {})
|
|
1805
|
+
}), /* @__PURE__ */ J(j.Popover, {
|
|
1807
1806
|
className: "min-w-fit",
|
|
1808
|
-
children: /* @__PURE__ */
|
|
1807
|
+
children: /* @__PURE__ */ J(j.Menu, { children: v.map(([t, n]) => /* @__PURE__ */ J(j.Item, {
|
|
1809
1808
|
textValue: n,
|
|
1810
1809
|
isDisabled: e.role === t,
|
|
1811
1810
|
onAction: () => h({
|
|
1812
1811
|
memberId: e.id,
|
|
1813
1812
|
role: t
|
|
1814
1813
|
}),
|
|
1815
|
-
children: /* @__PURE__ */
|
|
1814
|
+
children: /* @__PURE__ */ J(I, { children: n })
|
|
1816
1815
|
}, t)) })
|
|
1817
|
-
})] }), y ? /* @__PURE__ */
|
|
1816
|
+
})] }), y ? /* @__PURE__ */ J(O, {
|
|
1818
1817
|
isIconOnly: !0,
|
|
1819
1818
|
size: "sm",
|
|
1820
1819
|
variant: "danger-soft",
|
|
1821
1820
|
"aria-label": a.leaveOrganization,
|
|
1822
1821
|
onPress: () => C(!0),
|
|
1823
|
-
children: /* @__PURE__ */
|
|
1824
|
-
}) : u?.success && /* @__PURE__ */
|
|
1822
|
+
children: /* @__PURE__ */ J(Ee, {})
|
|
1823
|
+
}) : u?.success && /* @__PURE__ */ J(O, {
|
|
1825
1824
|
isIconOnly: !0,
|
|
1826
1825
|
size: "sm",
|
|
1827
1826
|
variant: "danger-soft",
|
|
1828
1827
|
"aria-label": a.removeMember,
|
|
1829
1828
|
onPress: () => x(!0),
|
|
1830
|
-
children: /* @__PURE__ */
|
|
1829
|
+
children: /* @__PURE__ */ J(Xe, {})
|
|
1831
1830
|
})]
|
|
1832
|
-
}), y && r ? /* @__PURE__ */
|
|
1831
|
+
}), y && r ? /* @__PURE__ */ J(cn, {
|
|
1833
1832
|
isOpen: S,
|
|
1834
1833
|
onOpenChange: C,
|
|
1835
1834
|
organization: r
|
|
1836
|
-
}) : u?.success && /* @__PURE__ */
|
|
1835
|
+
}) : u?.success && /* @__PURE__ */ J(gn, {
|
|
1837
1836
|
isOpen: b,
|
|
1838
1837
|
onOpenChange: x,
|
|
1839
1838
|
member: e
|
|
@@ -1842,179 +1841,179 @@ function gn({ member: e, isOwner: t, organization: r }) {
|
|
|
1842
1841
|
}
|
|
1843
1842
|
//#endregion
|
|
1844
1843
|
//#region src/components/auth/organization/organization-members.tsx
|
|
1845
|
-
function
|
|
1846
|
-
let { authClient: n } = p(), { localization: r, roles: i } = m(
|
|
1844
|
+
function vn({ className: e, ...t }) {
|
|
1845
|
+
let { authClient: n } = p(), { localization: r, roles: i } = m(Q), { data: a } = T(n), { data: o, isPending: s } = d(n), { data: c, isPending: l } = ce(n), { isPending: u } = w(n, { permissions: { member: ["update"] } }), { isPending: f } = w(n, { permissions: { member: ["delete"] } }), h = s || l || u || f, [g, _] = K(), [v, y] = K("all"), [b, x] = K(""), S = ct(() => c?.members.filter((e) => (v === "all" || e.role === v) && (e.user.name.toLowerCase().includes(b.toLowerCase()) || e.user.email.toLowerCase().includes(b.toLowerCase()))), [
|
|
1847
1846
|
b,
|
|
1848
1847
|
c?.members,
|
|
1849
1848
|
v
|
|
1850
|
-
]), C =
|
|
1849
|
+
]), C = ct(() => !g || !S ? S : [...S].sort((e, t) => {
|
|
1851
1850
|
let n = g.column, r = n === "user" ? e.user.name || e.user.email : String(e[n]), i = n === "user" ? t.user.name || t.user.email : String(t[n]), a = r.localeCompare(i);
|
|
1852
1851
|
return g.direction === "descending" && (a *= -1), a;
|
|
1853
|
-
}), [g, S]), [
|
|
1854
|
-
return /* @__PURE__ */
|
|
1855
|
-
className:
|
|
1852
|
+
}), [g, S]), [ee, te] = K(!1), ne = c?.members.some((e) => e.role === "owner" && e.userId === a?.user.id);
|
|
1853
|
+
return /* @__PURE__ */ Y("div", {
|
|
1854
|
+
className: W("flex flex-col gap-3", e),
|
|
1856
1855
|
...t,
|
|
1857
1856
|
children: [
|
|
1858
|
-
/* @__PURE__ */
|
|
1857
|
+
/* @__PURE__ */ Y("div", {
|
|
1859
1858
|
className: "flex items-end justify-between gap-3",
|
|
1860
|
-
children: [/* @__PURE__ */
|
|
1859
|
+
children: [/* @__PURE__ */ J("h3", {
|
|
1861
1860
|
className: "truncate text-sm font-semibold",
|
|
1862
1861
|
children: r.members
|
|
1863
|
-
}), /* @__PURE__ */
|
|
1862
|
+
}), /* @__PURE__ */ J(O, {
|
|
1864
1863
|
className: "shrink-0",
|
|
1865
1864
|
size: "sm",
|
|
1866
1865
|
isDisabled: h,
|
|
1867
|
-
onPress: () =>
|
|
1866
|
+
onPress: () => te(!0),
|
|
1868
1867
|
children: r.inviteMember
|
|
1869
1868
|
})]
|
|
1870
1869
|
}),
|
|
1871
|
-
/* @__PURE__ */
|
|
1870
|
+
/* @__PURE__ */ Y("div", {
|
|
1872
1871
|
className: "flex flex-col gap-4",
|
|
1873
1872
|
children: [
|
|
1874
|
-
/* @__PURE__ */
|
|
1873
|
+
/* @__PURE__ */ Y("div", {
|
|
1875
1874
|
className: "flex items-center gap-3",
|
|
1876
|
-
children: [/* @__PURE__ */
|
|
1875
|
+
children: [/* @__PURE__ */ J(R, {
|
|
1877
1876
|
className: "min-w-0",
|
|
1878
1877
|
"aria-label": r.search,
|
|
1879
1878
|
value: b,
|
|
1880
1879
|
onChange: x,
|
|
1881
1880
|
isDisabled: h,
|
|
1882
|
-
children: /* @__PURE__ */
|
|
1883
|
-
/* @__PURE__ */
|
|
1884
|
-
/* @__PURE__ */
|
|
1881
|
+
children: /* @__PURE__ */ Y(R.Group, { children: [
|
|
1882
|
+
/* @__PURE__ */ J(R.SearchIcon, {}),
|
|
1883
|
+
/* @__PURE__ */ J(R.Input, {
|
|
1885
1884
|
placeholder: r.search,
|
|
1886
1885
|
className: "sm:w-[200px]"
|
|
1887
1886
|
}),
|
|
1888
|
-
/* @__PURE__ */
|
|
1887
|
+
/* @__PURE__ */ J(R.ClearButton, {})
|
|
1889
1888
|
] })
|
|
1890
|
-
}), /* @__PURE__ */
|
|
1889
|
+
}), /* @__PURE__ */ Y(j, { children: [/* @__PURE__ */ Y(O, {
|
|
1891
1890
|
size: "sm",
|
|
1892
1891
|
variant: "secondary",
|
|
1893
1892
|
isDisabled: h,
|
|
1894
|
-
children: [/* @__PURE__ */
|
|
1895
|
-
}), /* @__PURE__ */
|
|
1893
|
+
children: [/* @__PURE__ */ J(ze, {}), r.role]
|
|
1894
|
+
}), /* @__PURE__ */ J(j.Popover, { children: /* @__PURE__ */ Y(j.Menu, {
|
|
1896
1895
|
selectionMode: "single",
|
|
1897
1896
|
selectedKeys: new Set([v]),
|
|
1898
1897
|
onSelectionChange: (e) => {
|
|
1899
1898
|
let t = [...e][0];
|
|
1900
1899
|
y(t ?? "all");
|
|
1901
1900
|
},
|
|
1902
|
-
children: [/* @__PURE__ */
|
|
1901
|
+
children: [/* @__PURE__ */ Y(j.Item, {
|
|
1903
1902
|
id: "all",
|
|
1904
1903
|
textValue: r.all,
|
|
1905
|
-
children: [/* @__PURE__ */
|
|
1906
|
-
}), Object.entries(i).map(([e, t]) => /* @__PURE__ */
|
|
1904
|
+
children: [/* @__PURE__ */ J(I, { children: r.all }), /* @__PURE__ */ J(j.ItemIndicator, {})]
|
|
1905
|
+
}), Object.entries(i).map(([e, t]) => /* @__PURE__ */ Y(j.Item, {
|
|
1907
1906
|
id: e,
|
|
1908
1907
|
textValue: t,
|
|
1909
|
-
children: [/* @__PURE__ */
|
|
1908
|
+
children: [/* @__PURE__ */ J(I, { children: t }), /* @__PURE__ */ J(j.ItemIndicator, {})]
|
|
1910
1909
|
}, e))]
|
|
1911
1910
|
}) })] })]
|
|
1912
1911
|
}),
|
|
1913
|
-
v !== "all" && /* @__PURE__ */
|
|
1912
|
+
v !== "all" && /* @__PURE__ */ Y(A, {
|
|
1914
1913
|
size: "sm",
|
|
1915
1914
|
variant: "secondary",
|
|
1916
1915
|
className: "w-fit",
|
|
1917
|
-
children: [/* @__PURE__ */
|
|
1916
|
+
children: [/* @__PURE__ */ Y(A.Label, { children: [
|
|
1918
1917
|
r.role,
|
|
1919
1918
|
":",
|
|
1920
1919
|
" ",
|
|
1921
|
-
/* @__PURE__ */
|
|
1920
|
+
/* @__PURE__ */ J("span", {
|
|
1922
1921
|
className: "capitalize",
|
|
1923
1922
|
children: i?.[v] ?? v
|
|
1924
1923
|
})
|
|
1925
|
-
] }), /* @__PURE__ */
|
|
1924
|
+
] }), /* @__PURE__ */ J("button", {
|
|
1926
1925
|
type: "button",
|
|
1927
1926
|
"aria-label": r.clear,
|
|
1928
1927
|
className: "text-muted hover:text-foreground inline-flex cursor-pointer items-center",
|
|
1929
1928
|
onClick: () => y("all"),
|
|
1930
|
-
children: /* @__PURE__ */
|
|
1929
|
+
children: /* @__PURE__ */ J(E, { className: "size-3" })
|
|
1931
1930
|
})]
|
|
1932
1931
|
}),
|
|
1933
|
-
/* @__PURE__ */
|
|
1932
|
+
/* @__PURE__ */ J(V, { children: /* @__PURE__ */ J(V.ScrollContainer, { children: /* @__PURE__ */ Y(V.Content, {
|
|
1934
1933
|
"aria-label": r.members,
|
|
1935
1934
|
sortDescriptor: g,
|
|
1936
1935
|
onSortChange: (e) => {
|
|
1937
1936
|
_(g?.column === e.column && e.direction === "ascending" ? void 0 : e);
|
|
1938
1937
|
},
|
|
1939
|
-
children: [/* @__PURE__ */
|
|
1940
|
-
/* @__PURE__ */
|
|
1938
|
+
children: [/* @__PURE__ */ Y(V.Header, { children: [
|
|
1939
|
+
/* @__PURE__ */ J(V.Column, {
|
|
1941
1940
|
allowsSorting: !0,
|
|
1942
1941
|
isRowHeader: !0,
|
|
1943
1942
|
id: "user",
|
|
1944
|
-
children: ({ sortDirection: e }) => /* @__PURE__ */
|
|
1943
|
+
children: ({ sortDirection: e }) => /* @__PURE__ */ J(yn, {
|
|
1945
1944
|
sortDirection: e,
|
|
1946
1945
|
children: r.member
|
|
1947
1946
|
})
|
|
1948
1947
|
}),
|
|
1949
|
-
/* @__PURE__ */
|
|
1948
|
+
/* @__PURE__ */ J(V.Column, {
|
|
1950
1949
|
allowsSorting: !0,
|
|
1951
1950
|
id: "role",
|
|
1952
|
-
children: ({ sortDirection: e }) => /* @__PURE__ */
|
|
1951
|
+
children: ({ sortDirection: e }) => /* @__PURE__ */ J(yn, {
|
|
1953
1952
|
sortDirection: e,
|
|
1954
1953
|
children: r.role
|
|
1955
1954
|
})
|
|
1956
1955
|
}),
|
|
1957
|
-
/* @__PURE__ */
|
|
1956
|
+
/* @__PURE__ */ J(V.Column, {
|
|
1958
1957
|
className: "text-end",
|
|
1959
1958
|
children: r.actions
|
|
1960
1959
|
})
|
|
1961
|
-
] }), /* @__PURE__ */
|
|
1960
|
+
] }), /* @__PURE__ */ J(V.Body, { children: h ? /* @__PURE__ */ J(hn, {}) : !!o && C?.map((e) => /* @__PURE__ */ J(_n, {
|
|
1962
1961
|
member: e,
|
|
1963
|
-
isOwner:
|
|
1962
|
+
isOwner: ne,
|
|
1964
1963
|
organization: o
|
|
1965
1964
|
}, e.id)) })]
|
|
1966
1965
|
}) }) })
|
|
1967
1966
|
]
|
|
1968
1967
|
}),
|
|
1969
|
-
/* @__PURE__ */
|
|
1970
|
-
isOpen:
|
|
1971
|
-
onOpenChange:
|
|
1968
|
+
/* @__PURE__ */ J(sn, {
|
|
1969
|
+
isOpen: ee,
|
|
1970
|
+
onOpenChange: te
|
|
1972
1971
|
})
|
|
1973
1972
|
]
|
|
1974
1973
|
});
|
|
1975
1974
|
}
|
|
1976
|
-
function
|
|
1977
|
-
return /* @__PURE__ */
|
|
1975
|
+
function yn({ children: e, sortDirection: t }) {
|
|
1976
|
+
return /* @__PURE__ */ Y("span", {
|
|
1978
1977
|
className: "flex items-center justify-between",
|
|
1979
|
-
children: [e, !!t && /* @__PURE__ */
|
|
1978
|
+
children: [e, !!t && /* @__PURE__ */ J(ke, { className: W("size-3 transform transition-transform duration-100 ease-out", t === "descending" ? "rotate-180" : "") })]
|
|
1980
1979
|
});
|
|
1981
1980
|
}
|
|
1982
1981
|
//#endregion
|
|
1983
1982
|
//#region src/components/auth/organization/organization-people.tsx
|
|
1984
|
-
function
|
|
1985
|
-
return /* @__PURE__ */
|
|
1986
|
-
className:
|
|
1983
|
+
function bn({ className: e, ...t }) {
|
|
1984
|
+
return /* @__PURE__ */ Y("div", {
|
|
1985
|
+
className: W("flex flex-col gap-4 md:gap-6", e),
|
|
1987
1986
|
...t,
|
|
1988
|
-
children: [/* @__PURE__ */
|
|
1987
|
+
children: [/* @__PURE__ */ J(vn, {}), /* @__PURE__ */ J(pn, {})]
|
|
1989
1988
|
});
|
|
1990
1989
|
}
|
|
1991
1990
|
//#endregion
|
|
1992
1991
|
//#region src/components/auth/organization/organization-danger-zone.tsx
|
|
1993
|
-
function
|
|
1994
|
-
let { authClient: r, localization: i } = p(), { data: a, isPending: o } =
|
|
1995
|
-
return /* @__PURE__ */
|
|
1996
|
-
className:
|
|
1992
|
+
function xn({ className: e, variant: t, ...n }) {
|
|
1993
|
+
let { authClient: r, localization: i } = p(), { data: a, isPending: o } = w(r, { permissions: { organization: ["delete"] } }), s = !!a?.success;
|
|
1994
|
+
return /* @__PURE__ */ Y("div", {
|
|
1995
|
+
className: W("flex w-full flex-col", e),
|
|
1997
1996
|
...n,
|
|
1998
|
-
children: [/* @__PURE__ */
|
|
1999
|
-
className:
|
|
1997
|
+
children: [/* @__PURE__ */ J("h2", {
|
|
1998
|
+
className: W("mb-3 text-sm font-semibold text-danger"),
|
|
2000
1999
|
children: i.settings.dangerZone
|
|
2001
|
-
}), /* @__PURE__ */
|
|
2000
|
+
}), /* @__PURE__ */ J(k, {
|
|
2002
2001
|
variant: t,
|
|
2003
|
-
children: /* @__PURE__ */
|
|
2002
|
+
children: /* @__PURE__ */ J(k.Content, {
|
|
2004
2003
|
className: "gap-0",
|
|
2005
|
-
children: o ? /* @__PURE__ */
|
|
2004
|
+
children: o ? /* @__PURE__ */ J(rn, {}) : /* @__PURE__ */ Y(q, { children: [/* @__PURE__ */ J(ln, {}), s && /* @__PURE__ */ Y(q, { children: [/* @__PURE__ */ J("div", { className: "border-b border-dashed -mx-4 my-4" }), /* @__PURE__ */ J(an, {})] })] })
|
|
2006
2005
|
})
|
|
2007
2006
|
})]
|
|
2008
2007
|
});
|
|
2009
2008
|
}
|
|
2010
2009
|
//#endregion
|
|
2011
2010
|
//#region src/components/auth/organization/organization-profile.tsx
|
|
2012
|
-
function
|
|
2013
|
-
let { authClient: r, localization: i } = p(), { localization: a } = m(
|
|
2014
|
-
|
|
2011
|
+
function Sn({ className: e, variant: t, ...n }) {
|
|
2012
|
+
let { authClient: r, localization: i } = p(), { localization: a } = m(Q), { data: o } = d(r), [s, c] = K(o?.slug ?? "");
|
|
2013
|
+
st(() => {
|
|
2015
2014
|
c(o?.slug ?? "");
|
|
2016
2015
|
}, [o?.slug]);
|
|
2017
|
-
let { mutate: l, isPending: u } =
|
|
2016
|
+
let { mutate: l, isPending: u } = Ce(r, { onSuccess: () => G.success(a.organizationUpdatedSuccess) });
|
|
2018
2017
|
function f(e) {
|
|
2019
2018
|
e.preventDefault(), o && l({ data: {
|
|
2020
2019
|
name: new FormData(e.currentTarget).get("name"),
|
|
@@ -2022,51 +2021,51 @@ function xn({ className: e, variant: t, ...n }) {
|
|
|
2022
2021
|
} });
|
|
2023
2022
|
}
|
|
2024
2023
|
let h = t === "transparent" ? "primary" : "secondary";
|
|
2025
|
-
return /* @__PURE__ */
|
|
2026
|
-
className:
|
|
2024
|
+
return /* @__PURE__ */ Y("div", { children: [/* @__PURE__ */ J("h2", {
|
|
2025
|
+
className: W("mb-3 text-sm font-semibold"),
|
|
2027
2026
|
children: a.organizationProfile
|
|
2028
|
-
}), /* @__PURE__ */
|
|
2029
|
-
className:
|
|
2027
|
+
}), /* @__PURE__ */ J(k, {
|
|
2028
|
+
className: W(e),
|
|
2030
2029
|
variant: t,
|
|
2031
2030
|
...n,
|
|
2032
|
-
children: /* @__PURE__ */
|
|
2031
|
+
children: /* @__PURE__ */ J(k.Content, { children: /* @__PURE__ */ Y(N, {
|
|
2033
2032
|
onSubmit: f,
|
|
2034
2033
|
className: "flex flex-col gap-4",
|
|
2035
2034
|
children: [
|
|
2036
|
-
/* @__PURE__ */
|
|
2037
|
-
/* @__PURE__ */
|
|
2035
|
+
/* @__PURE__ */ J(tn, {}),
|
|
2036
|
+
/* @__PURE__ */ Y(U, {
|
|
2038
2037
|
name: "name",
|
|
2039
2038
|
defaultValue: o?.name,
|
|
2040
2039
|
isDisabled: u || !o,
|
|
2041
2040
|
children: [
|
|
2042
|
-
/* @__PURE__ */
|
|
2043
|
-
/* @__PURE__ */
|
|
2044
|
-
className:
|
|
2041
|
+
/* @__PURE__ */ J(I, { children: a.name }),
|
|
2042
|
+
/* @__PURE__ */ J(P, {
|
|
2043
|
+
className: W(!o && "hidden"),
|
|
2045
2044
|
autoComplete: "organization",
|
|
2046
2045
|
placeholder: a.namePlaceholder,
|
|
2047
2046
|
variant: h
|
|
2048
2047
|
}),
|
|
2049
|
-
!o && /* @__PURE__ */
|
|
2050
|
-
/* @__PURE__ */
|
|
2048
|
+
!o && /* @__PURE__ */ J(z, { className: "h-10 w-full rounded-xl md:h-9" }),
|
|
2049
|
+
/* @__PURE__ */ J(M, {})
|
|
2051
2050
|
]
|
|
2052
2051
|
}, `${o?.id}-${o?.name}-name`),
|
|
2053
|
-
o ? /* @__PURE__ */
|
|
2052
|
+
o ? /* @__PURE__ */ J(Ut, {
|
|
2054
2053
|
value: s,
|
|
2055
2054
|
onChange: c,
|
|
2056
2055
|
currentSlug: o.slug,
|
|
2057
2056
|
isDisabled: u,
|
|
2058
2057
|
variant: h
|
|
2059
|
-
}) : /* @__PURE__ */
|
|
2058
|
+
}) : /* @__PURE__ */ Y(U, {
|
|
2060
2059
|
isDisabled: !0,
|
|
2061
|
-
children: [/* @__PURE__ */
|
|
2060
|
+
children: [/* @__PURE__ */ J(I, { children: a.slug }), /* @__PURE__ */ J(z, { className: "h-10 w-full rounded-xl md:h-9" })]
|
|
2062
2061
|
}),
|
|
2063
|
-
/* @__PURE__ */
|
|
2062
|
+
/* @__PURE__ */ Y(O, {
|
|
2064
2063
|
type: "submit",
|
|
2065
2064
|
isPending: u,
|
|
2066
2065
|
isDisabled: !o,
|
|
2067
2066
|
size: "sm",
|
|
2068
2067
|
className: "mt-1",
|
|
2069
|
-
children: [u && /* @__PURE__ */
|
|
2068
|
+
children: [u && /* @__PURE__ */ J(B, {
|
|
2070
2069
|
color: "current",
|
|
2071
2070
|
size: "sm"
|
|
2072
2071
|
}), i.settings.saveChanges]
|
|
@@ -2077,26 +2076,26 @@ function xn({ className: e, variant: t, ...n }) {
|
|
|
2077
2076
|
}
|
|
2078
2077
|
//#endregion
|
|
2079
2078
|
//#region src/components/auth/organization/organization-settings.tsx
|
|
2080
|
-
function
|
|
2079
|
+
function Cn({ className: e, variant: t, ...n }) {
|
|
2081
2080
|
let { plugins: r } = p();
|
|
2082
|
-
return /* @__PURE__ */
|
|
2083
|
-
className:
|
|
2081
|
+
return /* @__PURE__ */ Y("div", {
|
|
2082
|
+
className: W("flex flex-col gap-4 md:gap-6", e),
|
|
2084
2083
|
...n,
|
|
2085
2084
|
children: [
|
|
2086
|
-
/* @__PURE__ */
|
|
2087
|
-
r.flatMap((e) => e.organizationCards?.map((n, r) => /* @__PURE__ */
|
|
2088
|
-
/* @__PURE__ */
|
|
2085
|
+
/* @__PURE__ */ J(Sn, { variant: t }),
|
|
2086
|
+
r.flatMap((e) => e.organizationCards?.map((n, r) => /* @__PURE__ */ J(n, { variant: t }, `${e.id}-${r.toString()}`))),
|
|
2087
|
+
/* @__PURE__ */ J(xn, { variant: t })
|
|
2089
2088
|
]
|
|
2090
2089
|
});
|
|
2091
2090
|
}
|
|
2092
2091
|
//#endregion
|
|
2093
2092
|
//#region src/components/auth/organization/organization.tsx
|
|
2094
|
-
function
|
|
2093
|
+
function wn({ className: e, hideNav: t, path: n, variant: r, view: i, ...a }) {
|
|
2095
2094
|
if (!i && !n) throw Error("[Better Auth UI] Either `view` or `path` must be provided");
|
|
2096
2095
|
let { authClient: o, basePaths: s, localization: c, navigate: l } = p();
|
|
2097
2096
|
h(o);
|
|
2098
|
-
let { localization: u, viewPaths: f, slug: g } = m(
|
|
2099
|
-
|
|
2097
|
+
let { localization: u, viewPaths: f, slug: g } = m(Q), { data: _, isPending: v } = d(o);
|
|
2098
|
+
st(() => {
|
|
2100
2099
|
!v && !_ && l({
|
|
2101
2100
|
to: `${s.settings}/${f.settings?.organizations}`,
|
|
2102
2101
|
replace: !0
|
|
@@ -2108,7 +2107,7 @@ function Cn({ className: e, hideNav: t, path: n, variant: r, view: i, ...a }) {
|
|
|
2108
2107
|
f.settings?.organizations,
|
|
2109
2108
|
_
|
|
2110
2109
|
]);
|
|
2111
|
-
let y =
|
|
2110
|
+
let y = ct(() => i || Object.entries(f.organization).find(([, e]) => e === n)?.[0], [
|
|
2112
2111
|
i,
|
|
2113
2112
|
n,
|
|
2114
2113
|
f.organization
|
|
@@ -2117,16 +2116,16 @@ function Cn({ className: e, hideNav: t, path: n, variant: r, view: i, ...a }) {
|
|
|
2117
2116
|
let e = Object.values(f.organization).join(", ");
|
|
2118
2117
|
throw Error(`[Better Auth UI] Unknown organization path "${n}". Valid paths are: ${e}`);
|
|
2119
2118
|
}
|
|
2120
|
-
return !v && !_ ? null : /* @__PURE__ */
|
|
2121
|
-
className:
|
|
2119
|
+
return !v && !_ ? null : /* @__PURE__ */ Y(H, {
|
|
2120
|
+
className: W(e),
|
|
2122
2121
|
orientation: "horizontal",
|
|
2123
2122
|
selectedKey: y,
|
|
2124
2123
|
...a,
|
|
2125
2124
|
children: [
|
|
2126
|
-
!t && /* @__PURE__ */
|
|
2125
|
+
!t && /* @__PURE__ */ J(H.ListContainer, { children: /* @__PURE__ */ Y(H.List, {
|
|
2127
2126
|
"aria-label": c.settings.settings,
|
|
2128
2127
|
className: "max-w-fit overflow-x-auto [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden",
|
|
2129
|
-
children: [/* @__PURE__ */
|
|
2128
|
+
children: [/* @__PURE__ */ Y(H.Tab, {
|
|
2130
2129
|
id: "settings",
|
|
2131
2130
|
href: g ? `${s.organization}/${g}/${f.organization.settings}` : `${s.organization}/${f.organization.settings}`,
|
|
2132
2131
|
className: "gap-2",
|
|
@@ -2135,11 +2134,11 @@ function Cn({ className: e, hideNav: t, path: n, variant: r, view: i, ...a }) {
|
|
|
2135
2134
|
inline: "center"
|
|
2136
2135
|
}),
|
|
2137
2136
|
children: [
|
|
2138
|
-
/* @__PURE__ */
|
|
2137
|
+
/* @__PURE__ */ J(Be, { className: "text-muted" }),
|
|
2139
2138
|
c.settings.settings,
|
|
2140
|
-
/* @__PURE__ */
|
|
2139
|
+
/* @__PURE__ */ J(H.Indicator, {})
|
|
2141
2140
|
]
|
|
2142
|
-
}), /* @__PURE__ */
|
|
2141
|
+
}), /* @__PURE__ */ Y(H.Tab, {
|
|
2143
2142
|
id: "people",
|
|
2144
2143
|
href: g ? `${s.organization}/${g}/${f.organization.people}` : `${s.organization}/${f.organization.people}`,
|
|
2145
2144
|
className: "gap-2",
|
|
@@ -2148,189 +2147,189 @@ function Cn({ className: e, hideNav: t, path: n, variant: r, view: i, ...a }) {
|
|
|
2148
2147
|
inline: "center"
|
|
2149
2148
|
}),
|
|
2150
2149
|
children: [
|
|
2151
|
-
/* @__PURE__ */
|
|
2150
|
+
/* @__PURE__ */ J(qe, { className: "text-muted" }),
|
|
2152
2151
|
u.people,
|
|
2153
|
-
/* @__PURE__ */
|
|
2152
|
+
/* @__PURE__ */ J(H.Indicator, {})
|
|
2154
2153
|
]
|
|
2155
2154
|
})]
|
|
2156
2155
|
}) }),
|
|
2157
|
-
/* @__PURE__ */
|
|
2156
|
+
/* @__PURE__ */ J(H.Panel, {
|
|
2158
2157
|
id: "settings",
|
|
2159
2158
|
className: "px-0",
|
|
2160
|
-
children: /* @__PURE__ */
|
|
2159
|
+
children: /* @__PURE__ */ J(Cn, { variant: r })
|
|
2161
2160
|
}),
|
|
2162
|
-
/* @__PURE__ */
|
|
2161
|
+
/* @__PURE__ */ J(H.Panel, {
|
|
2163
2162
|
id: "people",
|
|
2164
2163
|
className: "px-0",
|
|
2165
|
-
children: /* @__PURE__ */
|
|
2164
|
+
children: /* @__PURE__ */ J(bn, {})
|
|
2166
2165
|
})
|
|
2167
2166
|
]
|
|
2168
2167
|
});
|
|
2169
2168
|
}
|
|
2170
2169
|
//#endregion
|
|
2171
2170
|
//#region src/components/auth/organization/organization-switcher.tsx
|
|
2172
|
-
function
|
|
2173
|
-
let { authClient: h, navigate: g, basePaths: _, localization: v, viewPaths: y } = p(), { data: b, isPending: x } =
|
|
2174
|
-
function
|
|
2175
|
-
o ? o(e) :
|
|
2171
|
+
function Tn({ className: e, hideCreate: t, hidePersonal: r, hideSettings: i, hideSlug: a = !0, setActive: o, placement: s, variant: c = "ghost", size: l = "md", trigger: u, ...f }) {
|
|
2172
|
+
let { authClient: h, navigate: g, basePaths: _, localization: v, viewPaths: y } = p(), { data: b, isPending: x } = T(h), { localization: S, viewPaths: C, slug: ee } = m(Q), { data: w, isPending: te } = d(h), { data: ne, isPending: re } = le(h), { mutate: ie } = ge(h), ae = x || !!b && (re || te), [oe, se] = K(!1), [ce, ue] = K(!1);
|
|
2173
|
+
function de(e) {
|
|
2174
|
+
o ? o(e) : ee === void 0 ? ie({ organizationId: e?.id ?? null }) : g({ to: e ? `${_.organization}/${e.slug}/${C.organization.settings}` : `${_.settings}/${y.settings.account}` });
|
|
2176
2175
|
}
|
|
2177
|
-
return /* @__PURE__ */
|
|
2178
|
-
isOpen:
|
|
2179
|
-
onOpenChange:
|
|
2180
|
-
children: [u ? /* @__PURE__ */
|
|
2176
|
+
return /* @__PURE__ */ Y(q, { children: [/* @__PURE__ */ Y(j, {
|
|
2177
|
+
isOpen: ce,
|
|
2178
|
+
onOpenChange: ue,
|
|
2179
|
+
children: [u ? /* @__PURE__ */ J(j.Trigger, { children: u }) : /* @__PURE__ */ Y(O, {
|
|
2181
2180
|
variant: c,
|
|
2182
|
-
className:
|
|
2183
|
-
isDisabled: !b ||
|
|
2181
|
+
className: W("h-auto px-2 py-2 text-left", e),
|
|
2182
|
+
isDisabled: !b || ae,
|
|
2184
2183
|
"aria-label": S.organization,
|
|
2185
2184
|
...f,
|
|
2186
|
-
children: [
|
|
2185
|
+
children: [ae ? /* @__PURE__ */ J(Z, {
|
|
2187
2186
|
size: l,
|
|
2188
2187
|
isPending: !0,
|
|
2189
2188
|
hideRole: !0,
|
|
2190
2189
|
hideSlug: a
|
|
2191
|
-
}) :
|
|
2190
|
+
}) : w ? /* @__PURE__ */ J(Z, {
|
|
2192
2191
|
size: l,
|
|
2193
2192
|
hideRole: !0,
|
|
2194
2193
|
hideSlug: a
|
|
2195
|
-
}) : b && !r ? /* @__PURE__ */
|
|
2194
|
+
}) : b && !r ? /* @__PURE__ */ J(n, {
|
|
2196
2195
|
size: l,
|
|
2197
2196
|
hideSubtitle: a
|
|
2198
|
-
}) : /* @__PURE__ */
|
|
2197
|
+
}) : /* @__PURE__ */ J(Z, {
|
|
2199
2198
|
size: l,
|
|
2200
2199
|
hideRole: !0,
|
|
2201
2200
|
hideSlug: a,
|
|
2202
2201
|
organization: { name: S.organization }
|
|
2203
|
-
}), /* @__PURE__ */
|
|
2204
|
-
}), /* @__PURE__ */
|
|
2202
|
+
}), /* @__PURE__ */ J(Ae, { className: "size-3 shrink-0 text-muted" })]
|
|
2203
|
+
}), /* @__PURE__ */ Y(j.Popover, {
|
|
2205
2204
|
placement: s,
|
|
2206
2205
|
className: "max-w-svw",
|
|
2207
|
-
children: [
|
|
2206
|
+
children: [w ? /* @__PURE__ */ Y("div", {
|
|
2208
2207
|
className: "flex items-center justify-between gap-4 px-4 pt-3",
|
|
2209
|
-
children: [/* @__PURE__ */
|
|
2208
|
+
children: [/* @__PURE__ */ J(Z, {
|
|
2210
2209
|
hideRole: !0,
|
|
2211
2210
|
hideSlug: a,
|
|
2212
|
-
organization:
|
|
2213
|
-
}), !i && /* @__PURE__ */
|
|
2214
|
-
href:
|
|
2215
|
-
className:
|
|
2211
|
+
organization: w
|
|
2212
|
+
}), !i && /* @__PURE__ */ Y(nt, {
|
|
2213
|
+
href: ee ? `${_.organization}/${ee}/${C.organization.settings}` : `${_.organization}/${C.organization.settings}`,
|
|
2214
|
+
className: W(yt({
|
|
2216
2215
|
variant: "outline",
|
|
2217
2216
|
size: "sm"
|
|
2218
2217
|
}), "shrink-0 gap-2"),
|
|
2219
|
-
onPress: () =>
|
|
2220
|
-
children: [/* @__PURE__ */
|
|
2218
|
+
onPress: () => ue(!1),
|
|
2219
|
+
children: [/* @__PURE__ */ J(Be, { className: "text-muted" }), S.manage]
|
|
2221
2220
|
})]
|
|
2222
|
-
}) : !
|
|
2221
|
+
}) : !ae && b?.user && !r ? /* @__PURE__ */ Y("div", {
|
|
2223
2222
|
className: "flex items-center justify-between gap-4 px-4 pt-3",
|
|
2224
|
-
children: [/* @__PURE__ */
|
|
2223
|
+
children: [/* @__PURE__ */ J(n, { hideSubtitle: a }), !i && /* @__PURE__ */ Y(nt, {
|
|
2225
2224
|
href: `${_.settings}/${y.settings.account}`,
|
|
2226
|
-
className:
|
|
2225
|
+
className: W(yt({
|
|
2227
2226
|
variant: "outline",
|
|
2228
2227
|
size: "sm"
|
|
2229
2228
|
}), "shrink-0 gap-2"),
|
|
2230
|
-
onPress: () =>
|
|
2231
|
-
children: [/* @__PURE__ */
|
|
2229
|
+
onPress: () => ue(!1),
|
|
2230
|
+
children: [/* @__PURE__ */ J(Be, { className: "text-muted" }), v.settings.settings]
|
|
2232
2231
|
})]
|
|
2233
|
-
}) : null, /* @__PURE__ */
|
|
2234
|
-
!!
|
|
2232
|
+
}) : null, /* @__PURE__ */ Y(j.Menu, { children: [
|
|
2233
|
+
!!w && !r && /* @__PURE__ */ J(j.Item, {
|
|
2235
2234
|
textValue: S.personalAccount,
|
|
2236
|
-
onPress: () =>
|
|
2237
|
-
children: /* @__PURE__ */
|
|
2235
|
+
onPress: () => de(null),
|
|
2236
|
+
children: /* @__PURE__ */ J(n, { hideSubtitle: a })
|
|
2238
2237
|
}),
|
|
2239
|
-
|
|
2238
|
+
ne?.filter((e) => e.id !== w?.id)?.map((e) => /* @__PURE__ */ J(j.Item, {
|
|
2240
2239
|
textValue: e.name,
|
|
2241
|
-
onPress: () =>
|
|
2242
|
-
children: /* @__PURE__ */
|
|
2240
|
+
onPress: () => de(e),
|
|
2241
|
+
children: /* @__PURE__ */ J(Z, {
|
|
2243
2242
|
hideRole: !0,
|
|
2244
2243
|
hideSlug: a,
|
|
2245
2244
|
organization: e
|
|
2246
2245
|
})
|
|
2247
2246
|
}, e.id)),
|
|
2248
|
-
!t && /* @__PURE__ */
|
|
2247
|
+
!t && /* @__PURE__ */ Y(j.Item, {
|
|
2249
2248
|
textValue: S.createOrganization,
|
|
2250
|
-
onPress: () =>
|
|
2251
|
-
children: [/* @__PURE__ */
|
|
2249
|
+
onPress: () => se(!0),
|
|
2250
|
+
children: [/* @__PURE__ */ J(je, { className: "text-muted" }), /* @__PURE__ */ J(I, { children: S.createOrganization })]
|
|
2252
2251
|
})
|
|
2253
2252
|
] })]
|
|
2254
2253
|
})]
|
|
2255
|
-
}), /* @__PURE__ */
|
|
2256
|
-
isOpen:
|
|
2257
|
-
onOpenChange:
|
|
2254
|
+
}), /* @__PURE__ */ J(Wt, {
|
|
2255
|
+
isOpen: oe,
|
|
2256
|
+
onOpenChange: se
|
|
2258
2257
|
})] });
|
|
2259
2258
|
}
|
|
2260
2259
|
//#endregion
|
|
2261
2260
|
//#region src/components/auth/passkey/passkey-button.tsx
|
|
2262
|
-
function
|
|
2263
|
-
let { authClient: t, localization: n, redirectTo: i, navigate: a } = p(), { localization: o } = m(
|
|
2264
|
-
return e === "signUp" ? null : /* @__PURE__ */
|
|
2261
|
+
function En({ view: e }) {
|
|
2262
|
+
let { authClient: t, localization: n, redirectTo: i, navigate: a } = p(), { localization: o } = m($), { mutate: s, isPending: c } = be(t, { onSuccess: () => a({ to: i }) }), l = X({ mutationKey: r.signIn.all }) + X({ mutationKey: r.signUp.all }) > 0;
|
|
2263
|
+
return e === "signUp" ? null : /* @__PURE__ */ Y(O, {
|
|
2265
2264
|
className: "w-full",
|
|
2266
2265
|
variant: "tertiary",
|
|
2267
2266
|
isDisabled: l,
|
|
2268
2267
|
isPending: c,
|
|
2269
2268
|
onPress: () => s(),
|
|
2270
|
-
children: [c ? /* @__PURE__ */
|
|
2269
|
+
children: [c ? /* @__PURE__ */ J(B, {
|
|
2271
2270
|
color: "current",
|
|
2272
2271
|
size: "sm"
|
|
2273
|
-
}) : /* @__PURE__ */
|
|
2272
|
+
}) : /* @__PURE__ */ J(Re, {}), n.auth.continueWith.replace("{{provider}}", o.passkey)]
|
|
2274
2273
|
});
|
|
2275
2274
|
}
|
|
2276
2275
|
//#endregion
|
|
2277
2276
|
//#region src/lib/auth/passkey-plugin.ts
|
|
2278
|
-
var
|
|
2279
|
-
...
|
|
2280
|
-
authButtons: [
|
|
2277
|
+
var $ = a(gt.id, (e = {}) => ({
|
|
2278
|
+
...gt(e),
|
|
2279
|
+
authButtons: [En],
|
|
2281
2280
|
securityCards: [Mn]
|
|
2282
2281
|
}));
|
|
2283
2282
|
//#endregion
|
|
2284
2283
|
//#region src/components/auth/passkey/add-passkey-dialog.tsx
|
|
2285
2284
|
function Dn({ isOpen: e, onOpenChange: t }) {
|
|
2286
|
-
let { authClient: n, localization: r } = p(), { localization: i } = m(
|
|
2285
|
+
let { authClient: n, localization: r } = p(), { localization: i } = m($), { mutate: a, isPending: o } = f(n), s = (e) => {
|
|
2287
2286
|
t(e);
|
|
2288
2287
|
};
|
|
2289
|
-
return /* @__PURE__ */
|
|
2288
|
+
return /* @__PURE__ */ J(D.Backdrop, {
|
|
2290
2289
|
isOpen: e,
|
|
2291
2290
|
onOpenChange: s,
|
|
2292
|
-
children: /* @__PURE__ */
|
|
2291
|
+
children: /* @__PURE__ */ J(D.Container, { children: /* @__PURE__ */ J(D.Dialog, { children: /* @__PURE__ */ Y(N, {
|
|
2293
2292
|
onSubmit: (e) => {
|
|
2294
2293
|
e.preventDefault();
|
|
2295
2294
|
let t = new FormData(e.target).get("name")?.trim();
|
|
2296
2295
|
a(t ? { name: t } : void 0, { onSuccess: () => s(!1) });
|
|
2297
2296
|
},
|
|
2298
2297
|
children: [
|
|
2299
|
-
/* @__PURE__ */
|
|
2300
|
-
/* @__PURE__ */
|
|
2298
|
+
/* @__PURE__ */ J(D.CloseTrigger, {}),
|
|
2299
|
+
/* @__PURE__ */ Y(D.Header, { children: [/* @__PURE__ */ J(D.Icon, {
|
|
2301
2300
|
status: "default",
|
|
2302
|
-
children: /* @__PURE__ */
|
|
2303
|
-
}), /* @__PURE__ */
|
|
2304
|
-
/* @__PURE__ */
|
|
2301
|
+
children: /* @__PURE__ */ J(Re, {})
|
|
2302
|
+
}), /* @__PURE__ */ J(D.Heading, { children: i.addPasskey })] }),
|
|
2303
|
+
/* @__PURE__ */ Y(D.Body, {
|
|
2305
2304
|
className: "overflow-visible",
|
|
2306
|
-
children: [/* @__PURE__ */
|
|
2305
|
+
children: [/* @__PURE__ */ J("p", {
|
|
2307
2306
|
className: "text-muted text-sm",
|
|
2308
2307
|
children: i.passkeysDescription
|
|
2309
|
-
}), /* @__PURE__ */
|
|
2308
|
+
}), /* @__PURE__ */ Y(U, {
|
|
2310
2309
|
className: "mt-4",
|
|
2311
2310
|
id: "name",
|
|
2312
2311
|
name: "name",
|
|
2313
2312
|
isDisabled: o,
|
|
2314
2313
|
children: [
|
|
2315
|
-
/* @__PURE__ */
|
|
2316
|
-
/* @__PURE__ */
|
|
2314
|
+
/* @__PURE__ */ J(I, { children: i.name }),
|
|
2315
|
+
/* @__PURE__ */ J(P, {
|
|
2317
2316
|
autoFocus: !0,
|
|
2318
2317
|
placeholder: r.settings.optional,
|
|
2319
2318
|
variant: "secondary"
|
|
2320
2319
|
}),
|
|
2321
|
-
/* @__PURE__ */
|
|
2320
|
+
/* @__PURE__ */ J(M, {})
|
|
2322
2321
|
]
|
|
2323
2322
|
})]
|
|
2324
2323
|
}),
|
|
2325
|
-
/* @__PURE__ */
|
|
2324
|
+
/* @__PURE__ */ Y(D.Footer, { children: [/* @__PURE__ */ J(O, {
|
|
2326
2325
|
slot: "close",
|
|
2327
2326
|
variant: "tertiary",
|
|
2328
2327
|
isDisabled: o,
|
|
2329
2328
|
children: r.settings.cancel
|
|
2330
|
-
}), /* @__PURE__ */
|
|
2329
|
+
}), /* @__PURE__ */ Y(O, {
|
|
2331
2330
|
type: "submit",
|
|
2332
2331
|
isPending: o,
|
|
2333
|
-
children: [o && /* @__PURE__ */
|
|
2332
|
+
children: [o && /* @__PURE__ */ J(B, {
|
|
2334
2333
|
color: "current",
|
|
2335
2334
|
size: "sm"
|
|
2336
2335
|
}), i.addPasskey]
|
|
@@ -2342,37 +2341,37 @@ function Dn({ isOpen: e, onOpenChange: t }) {
|
|
|
2342
2341
|
//#endregion
|
|
2343
2342
|
//#region src/components/auth/passkey/delete-passkey-dialog.tsx
|
|
2344
2343
|
function On({ isOpen: e, onOpenChange: t, passkey: n }) {
|
|
2345
|
-
let { authClient: r, localization: i } = p(), { localization: a } = m(
|
|
2346
|
-
return /* @__PURE__ */
|
|
2344
|
+
let { authClient: r, localization: i } = p(), { localization: a } = m($), o = n.name || a.passkey, { mutate: s, isPending: c } = S(r, { onSuccess: () => t(!1) });
|
|
2345
|
+
return /* @__PURE__ */ J(D.Backdrop, {
|
|
2347
2346
|
isOpen: e,
|
|
2348
2347
|
onOpenChange: t,
|
|
2349
|
-
children: /* @__PURE__ */
|
|
2350
|
-
/* @__PURE__ */
|
|
2351
|
-
/* @__PURE__ */
|
|
2348
|
+
children: /* @__PURE__ */ J(D.Container, { children: /* @__PURE__ */ Y(D.Dialog, { children: [
|
|
2349
|
+
/* @__PURE__ */ J(D.CloseTrigger, {}),
|
|
2350
|
+
/* @__PURE__ */ Y(D.Header, { children: [/* @__PURE__ */ J(D.Icon, {
|
|
2352
2351
|
status: "danger",
|
|
2353
|
-
children: /* @__PURE__ */
|
|
2354
|
-
}), /* @__PURE__ */
|
|
2355
|
-
/* @__PURE__ */
|
|
2352
|
+
children: /* @__PURE__ */ J(Re, {})
|
|
2353
|
+
}), /* @__PURE__ */ J(D.Heading, { children: a.deletePasskeyTitle })] }),
|
|
2354
|
+
/* @__PURE__ */ Y(D.Body, {
|
|
2356
2355
|
className: "flex flex-col gap-4 overflow-visible",
|
|
2357
|
-
children: [/* @__PURE__ */
|
|
2356
|
+
children: [/* @__PURE__ */ J("p", {
|
|
2358
2357
|
className: "text-muted text-sm",
|
|
2359
2358
|
children: a.deletePasskeyWarning
|
|
2360
|
-
}), /* @__PURE__ */
|
|
2359
|
+
}), /* @__PURE__ */ Y(U, {
|
|
2361
2360
|
value: o,
|
|
2362
2361
|
variant: "secondary",
|
|
2363
|
-
children: [/* @__PURE__ */
|
|
2362
|
+
children: [/* @__PURE__ */ J(I, { children: n.name || a.passkey }), /* @__PURE__ */ J(P, { readOnly: !0 })]
|
|
2364
2363
|
})]
|
|
2365
2364
|
}),
|
|
2366
|
-
/* @__PURE__ */
|
|
2365
|
+
/* @__PURE__ */ Y(D.Footer, { children: [/* @__PURE__ */ J(O, {
|
|
2367
2366
|
slot: "close",
|
|
2368
2367
|
variant: "tertiary",
|
|
2369
2368
|
isDisabled: c,
|
|
2370
2369
|
children: i.settings.cancel
|
|
2371
|
-
}), /* @__PURE__ */
|
|
2370
|
+
}), /* @__PURE__ */ Y(O, {
|
|
2372
2371
|
variant: "danger",
|
|
2373
2372
|
onPress: () => s({ id: n.id }),
|
|
2374
2373
|
isPending: c,
|
|
2375
|
-
children: [c && /* @__PURE__ */
|
|
2374
|
+
children: [c && /* @__PURE__ */ J(B, {
|
|
2376
2375
|
color: "current",
|
|
2377
2376
|
size: "sm"
|
|
2378
2377
|
}), a.deletePasskeyTitle]
|
|
@@ -2383,20 +2382,20 @@ function On({ isOpen: e, onOpenChange: t, passkey: n }) {
|
|
|
2383
2382
|
//#endregion
|
|
2384
2383
|
//#region src/components/auth/passkey/passkey.tsx
|
|
2385
2384
|
function kn({ passkey: e }) {
|
|
2386
|
-
let { localization: t } = p(), { localization: n } = m(
|
|
2387
|
-
return /* @__PURE__ */
|
|
2385
|
+
let { localization: t } = p(), { localization: n } = m($), [r, i] = K(!1), a = e.name || n.passkey;
|
|
2386
|
+
return /* @__PURE__ */ Y("div", {
|
|
2388
2387
|
className: "flex items-center gap-3",
|
|
2389
2388
|
children: [
|
|
2390
|
-
/* @__PURE__ */
|
|
2389
|
+
/* @__PURE__ */ J("div", {
|
|
2391
2390
|
className: "flex size-10 shrink-0 items-center justify-center rounded-xl bg-surface-secondary",
|
|
2392
|
-
children: /* @__PURE__ */
|
|
2391
|
+
children: /* @__PURE__ */ J(Re, { className: "size-4.5" })
|
|
2393
2392
|
}),
|
|
2394
|
-
/* @__PURE__ */
|
|
2393
|
+
/* @__PURE__ */ Y("div", {
|
|
2395
2394
|
className: "flex min-w-0 flex-col",
|
|
2396
|
-
children: [/* @__PURE__ */
|
|
2395
|
+
children: [/* @__PURE__ */ J("span", {
|
|
2397
2396
|
className: "truncate text-sm font-medium leading-tight",
|
|
2398
2397
|
children: a
|
|
2399
|
-
}), /* @__PURE__ */
|
|
2398
|
+
}), /* @__PURE__ */ J("span", {
|
|
2400
2399
|
className: "text-xs text-muted",
|
|
2401
2400
|
children: new Date(e.createdAt).toLocaleString(void 0, {
|
|
2402
2401
|
dateStyle: "medium",
|
|
@@ -2404,15 +2403,15 @@ function kn({ passkey: e }) {
|
|
|
2404
2403
|
})
|
|
2405
2404
|
})]
|
|
2406
2405
|
}),
|
|
2407
|
-
/* @__PURE__ */
|
|
2406
|
+
/* @__PURE__ */ Y(O, {
|
|
2408
2407
|
className: "ml-auto shrink-0",
|
|
2409
2408
|
variant: "outline",
|
|
2410
2409
|
size: "sm",
|
|
2411
2410
|
onPress: () => i(!0),
|
|
2412
2411
|
"aria-label": n.deletePasskey.replace("{{name}}", a),
|
|
2413
|
-
children: [/* @__PURE__ */
|
|
2412
|
+
children: [/* @__PURE__ */ J(E, {}), t.settings.delete]
|
|
2414
2413
|
}),
|
|
2415
|
-
/* @__PURE__ */
|
|
2414
|
+
/* @__PURE__ */ J(On, {
|
|
2416
2415
|
isOpen: r,
|
|
2417
2416
|
onOpenChange: i,
|
|
2418
2417
|
passkey: e
|
|
@@ -2423,13 +2422,13 @@ function kn({ passkey: e }) {
|
|
|
2423
2422
|
//#endregion
|
|
2424
2423
|
//#region src/components/auth/passkey/passkey-skeleton.tsx
|
|
2425
2424
|
function An() {
|
|
2426
|
-
return /* @__PURE__ */
|
|
2425
|
+
return /* @__PURE__ */ J("div", {
|
|
2427
2426
|
className: "flex items-center justify-between",
|
|
2428
|
-
children: /* @__PURE__ */
|
|
2427
|
+
children: /* @__PURE__ */ Y("div", {
|
|
2429
2428
|
className: "flex items-center gap-3",
|
|
2430
|
-
children: [/* @__PURE__ */
|
|
2429
|
+
children: [/* @__PURE__ */ J(z, { className: "size-10 rounded-xl" }), /* @__PURE__ */ Y("div", {
|
|
2431
2430
|
className: "flex flex-col gap-1",
|
|
2432
|
-
children: [/* @__PURE__ */
|
|
2431
|
+
children: [/* @__PURE__ */ J(z, { className: "h-4 w-28 rounded-lg" }), /* @__PURE__ */ J(z, { className: "h-3 w-32 rounded-lg" })]
|
|
2433
2432
|
})]
|
|
2434
2433
|
})
|
|
2435
2434
|
});
|
|
@@ -2437,25 +2436,25 @@ function An() {
|
|
|
2437
2436
|
//#endregion
|
|
2438
2437
|
//#region src/components/auth/passkey/passkeys-empty.tsx
|
|
2439
2438
|
function jn({ onAddPress: e }) {
|
|
2440
|
-
let { localization: t } = m(
|
|
2441
|
-
return /* @__PURE__ */
|
|
2439
|
+
let { localization: t } = m($);
|
|
2440
|
+
return /* @__PURE__ */ Y("div", {
|
|
2442
2441
|
className: "flex flex-col items-center justify-center gap-4",
|
|
2443
2442
|
children: [
|
|
2444
|
-
/* @__PURE__ */
|
|
2443
|
+
/* @__PURE__ */ J("div", {
|
|
2445
2444
|
className: "flex size-10 items-center justify-center rounded-xl bg-surface-secondary",
|
|
2446
|
-
children: /* @__PURE__ */
|
|
2445
|
+
children: /* @__PURE__ */ J(Re, { className: "size-4.5" })
|
|
2447
2446
|
}),
|
|
2448
|
-
/* @__PURE__ */
|
|
2447
|
+
/* @__PURE__ */ Y("div", {
|
|
2449
2448
|
className: "flex flex-col items-center justify-center gap-1 text-center",
|
|
2450
|
-
children: [/* @__PURE__ */
|
|
2449
|
+
children: [/* @__PURE__ */ J("p", {
|
|
2451
2450
|
className: "text-sm font-semibold",
|
|
2452
2451
|
children: t.noPasskeys
|
|
2453
|
-
}), /* @__PURE__ */
|
|
2452
|
+
}), /* @__PURE__ */ J("p", {
|
|
2454
2453
|
className: "text-muted text-xs",
|
|
2455
2454
|
children: t.passkeysDescription
|
|
2456
2455
|
})]
|
|
2457
2456
|
}),
|
|
2458
|
-
/* @__PURE__ */
|
|
2457
|
+
/* @__PURE__ */ J(O, {
|
|
2459
2458
|
size: "sm",
|
|
2460
2459
|
onPress: e,
|
|
2461
2460
|
children: t.addPasskey
|
|
@@ -2466,16 +2465,16 @@ function jn({ onAddPress: e }) {
|
|
|
2466
2465
|
//#endregion
|
|
2467
2466
|
//#region src/components/auth/passkey/passkeys.tsx
|
|
2468
2467
|
function Mn({ className: e, variant: t, ...n }) {
|
|
2469
|
-
let { authClient: r } = p(), { localization: i } = m(
|
|
2470
|
-
return /* @__PURE__ */
|
|
2471
|
-
className:
|
|
2468
|
+
let { authClient: r } = p(), { localization: i } = m($), { data: a, isPending: o } = ue(r), [s, c] = K(!1);
|
|
2469
|
+
return /* @__PURE__ */ Y("div", {
|
|
2470
|
+
className: W("flex flex-col gap-3", e),
|
|
2472
2471
|
children: [
|
|
2473
|
-
/* @__PURE__ */
|
|
2472
|
+
/* @__PURE__ */ Y("div", {
|
|
2474
2473
|
className: "flex items-end justify-between gap-3",
|
|
2475
|
-
children: [/* @__PURE__ */
|
|
2474
|
+
children: [/* @__PURE__ */ J("h2", {
|
|
2476
2475
|
className: "text-sm font-semibold truncate",
|
|
2477
2476
|
children: i.passkeys
|
|
2478
|
-
}), /* @__PURE__ */
|
|
2477
|
+
}), /* @__PURE__ */ J(O, {
|
|
2479
2478
|
className: "shrink-0",
|
|
2480
2479
|
size: "sm",
|
|
2481
2480
|
isDisabled: o,
|
|
@@ -2483,12 +2482,12 @@ function Mn({ className: e, variant: t, ...n }) {
|
|
|
2483
2482
|
children: i.addPasskey
|
|
2484
2483
|
})]
|
|
2485
2484
|
}),
|
|
2486
|
-
/* @__PURE__ */
|
|
2485
|
+
/* @__PURE__ */ J(k, {
|
|
2487
2486
|
variant: t,
|
|
2488
2487
|
...n,
|
|
2489
|
-
children: /* @__PURE__ */
|
|
2488
|
+
children: /* @__PURE__ */ J(k.Content, { children: o ? /* @__PURE__ */ J(An, {}) : a?.length ? a.map((e, t) => /* @__PURE__ */ Y("div", { children: [t > 0 && /* @__PURE__ */ J("div", { className: "border-b border-dashed -mx-4 my-4" }), /* @__PURE__ */ J(kn, { passkey: e })] }, e.id)) : /* @__PURE__ */ J(jn, { onAddPress: () => c(!0) }) })
|
|
2490
2489
|
}),
|
|
2491
|
-
/* @__PURE__ */
|
|
2490
|
+
/* @__PURE__ */ J(Dn, {
|
|
2492
2491
|
isOpen: s,
|
|
2493
2492
|
onOpenChange: c
|
|
2494
2493
|
})
|
|
@@ -2500,20 +2499,20 @@ function Mn({ className: e, variant: t, ...n }) {
|
|
|
2500
2499
|
var Nn = "[role=\"tab\"][aria-selected=\"true\"]";
|
|
2501
2500
|
function Pn() {
|
|
2502
2501
|
let { useTheme: e, localization: t } = m(Fn), { theme: n, setTheme: r, themes: i = [] } = e();
|
|
2503
|
-
return /* @__PURE__ */
|
|
2502
|
+
return /* @__PURE__ */ Y(j.Item, {
|
|
2504
2503
|
className: "py-1 pe-2",
|
|
2505
2504
|
onFocus: (e) => {
|
|
2506
2505
|
e.target === e.currentTarget && e.currentTarget.querySelector(Nn)?.focus({ preventScroll: !0 });
|
|
2507
2506
|
},
|
|
2508
2507
|
shouldCloseOnSelect: !1,
|
|
2509
2508
|
children: [
|
|
2510
|
-
/* @__PURE__ */
|
|
2511
|
-
/* @__PURE__ */
|
|
2512
|
-
/* @__PURE__ */
|
|
2509
|
+
/* @__PURE__ */ J(We, { className: "text-muted" }),
|
|
2510
|
+
/* @__PURE__ */ J(I, { children: t.theme }),
|
|
2511
|
+
/* @__PURE__ */ J(H, {
|
|
2513
2512
|
className: "ml-auto",
|
|
2514
2513
|
selectedKey: n,
|
|
2515
2514
|
onSelectionChange: (e) => r(e),
|
|
2516
|
-
children: /* @__PURE__ */
|
|
2515
|
+
children: /* @__PURE__ */ J(H.ListContainer, {
|
|
2517
2516
|
onKeyDown: (e) => {
|
|
2518
2517
|
if (e.key !== "ArrowUp" && e.key !== "ArrowDown") return;
|
|
2519
2518
|
let t = e.target;
|
|
@@ -2525,24 +2524,24 @@ function Pn() {
|
|
|
2525
2524
|
let o = i[e.key === "ArrowDown" ? a + 1 : a - 1];
|
|
2526
2525
|
o && (e.preventDefault(), o.focus());
|
|
2527
2526
|
},
|
|
2528
|
-
children: /* @__PURE__ */
|
|
2527
|
+
children: /* @__PURE__ */ Y(H.List, {
|
|
2529
2528
|
"aria-label": t.theme,
|
|
2530
2529
|
className: "*:h-5 *:w-5 *:p-0",
|
|
2531
2530
|
children: [
|
|
2532
|
-
i.includes("system") && /* @__PURE__ */
|
|
2531
|
+
i.includes("system") && /* @__PURE__ */ Y(H.Tab, {
|
|
2533
2532
|
id: "system",
|
|
2534
2533
|
"aria-label": t.system,
|
|
2535
|
-
children: [/* @__PURE__ */
|
|
2534
|
+
children: [/* @__PURE__ */ J(Fe, { className: "size-3" }), /* @__PURE__ */ J(H.Indicator, {})]
|
|
2536
2535
|
}),
|
|
2537
|
-
i.includes("light") && /* @__PURE__ */
|
|
2536
|
+
i.includes("light") && /* @__PURE__ */ Y(H.Tab, {
|
|
2538
2537
|
id: "light",
|
|
2539
2538
|
"aria-label": t.light,
|
|
2540
|
-
children: [/* @__PURE__ */
|
|
2539
|
+
children: [/* @__PURE__ */ J(Ye, { className: "size-3" }), /* @__PURE__ */ J(H.Indicator, {})]
|
|
2541
2540
|
}),
|
|
2542
|
-
i.includes("dark") && /* @__PURE__ */
|
|
2541
|
+
i.includes("dark") && /* @__PURE__ */ Y(H.Tab, {
|
|
2543
2542
|
id: "dark",
|
|
2544
2543
|
"aria-label": t.dark,
|
|
2545
|
-
children: [/* @__PURE__ */
|
|
2544
|
+
children: [/* @__PURE__ */ J(Ue, { className: "size-3" }), /* @__PURE__ */ J(H.Indicator, {})]
|
|
2546
2545
|
})
|
|
2547
2546
|
]
|
|
2548
2547
|
})
|
|
@@ -2553,8 +2552,8 @@ function Pn() {
|
|
|
2553
2552
|
}
|
|
2554
2553
|
//#endregion
|
|
2555
2554
|
//#region src/lib/auth/theme-plugin.ts
|
|
2556
|
-
var Fn = a(
|
|
2557
|
-
let n =
|
|
2555
|
+
var Fn = a(_t.id, ({ useTheme: e, ...t }) => {
|
|
2556
|
+
let n = _t({
|
|
2558
2557
|
setTheme: () => {},
|
|
2559
2558
|
...t
|
|
2560
2559
|
});
|
|
@@ -2572,62 +2571,62 @@ var Fn = a(gt.id, ({ useTheme: e, ...t }) => {
|
|
|
2572
2571
|
//#endregion
|
|
2573
2572
|
//#region src/components/auth/theme/appearance.tsx
|
|
2574
2573
|
function In({ className: e, variant: t, ...n }) {
|
|
2575
|
-
let { useTheme: r, localization: i } = m(Fn), { theme: a, setTheme: o, themes: u = [] } = r(), d =
|
|
2576
|
-
return /* @__PURE__ */
|
|
2577
|
-
className:
|
|
2574
|
+
let { useTheme: r, localization: i } = m(Fn), { theme: a, setTheme: o, themes: u = [] } = r(), d = ot();
|
|
2575
|
+
return /* @__PURE__ */ Y("div", { children: [/* @__PURE__ */ J("h2", {
|
|
2576
|
+
className: W("text-sm font-semibold mb-3"),
|
|
2578
2577
|
children: i.appearance
|
|
2579
|
-
}), /* @__PURE__ */
|
|
2580
|
-
className:
|
|
2578
|
+
}), /* @__PURE__ */ J(k, {
|
|
2579
|
+
className: W("p-4 gap-4", e),
|
|
2581
2580
|
variant: t,
|
|
2582
2581
|
...n,
|
|
2583
|
-
children: /* @__PURE__ */
|
|
2582
|
+
children: /* @__PURE__ */ Y(k.Content, { children: [/* @__PURE__ */ J(I, { children: i.theme }), /* @__PURE__ */ J(it, {
|
|
2584
2583
|
variant: t === "transparent" ? "secondary" : "primary",
|
|
2585
2584
|
value: d ? a : "",
|
|
2586
2585
|
onChange: o,
|
|
2587
2586
|
isDisabled: !d || !a,
|
|
2588
|
-
children: /* @__PURE__ */
|
|
2587
|
+
children: /* @__PURE__ */ Y("div", {
|
|
2589
2588
|
className: "grid gap-3 grid-cols-2 sm:grid-cols-3",
|
|
2590
2589
|
children: [
|
|
2591
|
-
u.includes("system") && /* @__PURE__ */
|
|
2590
|
+
u.includes("system") && /* @__PURE__ */ J(L, {
|
|
2592
2591
|
value: "system",
|
|
2593
|
-
className:
|
|
2594
|
-
children: /* @__PURE__ */
|
|
2592
|
+
className: W("mt-0 px-4 pb-4 pt-3 rounded-xl", "border border-transparent data-[selected=true]:border-accent data-[selected=true]:bg-accent/10", "data-[focus-visible=true]:border-accent data-[focus-visible=true]:bg-accent/10", t === "transparent" ? "bg-surface" : "bg-surface-secondary"),
|
|
2593
|
+
children: /* @__PURE__ */ Y(L.Content, {
|
|
2595
2594
|
className: "gap-2",
|
|
2596
|
-
children: [/* @__PURE__ */
|
|
2595
|
+
children: [/* @__PURE__ */ Y("div", {
|
|
2597
2596
|
className: "flex gap-2 justify-between",
|
|
2598
|
-
children: [/* @__PURE__ */
|
|
2597
|
+
children: [/* @__PURE__ */ Y(I, {
|
|
2599
2598
|
className: "flex gap-2 items-center",
|
|
2600
|
-
children: [/* @__PURE__ */
|
|
2601
|
-
}), /* @__PURE__ */
|
|
2602
|
-
}), /* @__PURE__ */
|
|
2599
|
+
children: [/* @__PURE__ */ J(Fe, { className: "text-muted" }), i.system]
|
|
2600
|
+
}), /* @__PURE__ */ J(L.Control, { children: /* @__PURE__ */ J(L.Indicator, {}) })]
|
|
2601
|
+
}), /* @__PURE__ */ J(l, { className: "w-full" })]
|
|
2603
2602
|
})
|
|
2604
2603
|
}),
|
|
2605
|
-
u.includes("light") && /* @__PURE__ */
|
|
2604
|
+
u.includes("light") && /* @__PURE__ */ J(L, {
|
|
2606
2605
|
value: "light",
|
|
2607
|
-
className:
|
|
2608
|
-
children: /* @__PURE__ */
|
|
2606
|
+
className: W("mt-0 px-4 pb-4 pt-3 rounded-xl", "border border-transparent data-[selected=true]:border-accent data-[selected=true]:bg-accent/10", "data-[focus-visible=true]:border-accent data-[focus-visible=true]:bg-accent/10", t === "transparent" ? "bg-surface" : "bg-surface-secondary"),
|
|
2607
|
+
children: /* @__PURE__ */ Y(L.Content, {
|
|
2609
2608
|
className: "gap-2",
|
|
2610
|
-
children: [/* @__PURE__ */
|
|
2609
|
+
children: [/* @__PURE__ */ Y("div", {
|
|
2611
2610
|
className: "flex gap-2 justify-between",
|
|
2612
|
-
children: [/* @__PURE__ */
|
|
2611
|
+
children: [/* @__PURE__ */ Y(I, {
|
|
2613
2612
|
className: "flex gap-2 items-center",
|
|
2614
|
-
children: [/* @__PURE__ */
|
|
2615
|
-
}), /* @__PURE__ */
|
|
2616
|
-
}), /* @__PURE__ */
|
|
2613
|
+
children: [/* @__PURE__ */ J(Ye, { className: "text-muted" }), i.light]
|
|
2614
|
+
}), /* @__PURE__ */ J(L.Control, { children: /* @__PURE__ */ J(L.Indicator, {}) })]
|
|
2615
|
+
}), /* @__PURE__ */ J(c, { className: "w-full" })]
|
|
2617
2616
|
})
|
|
2618
2617
|
}),
|
|
2619
|
-
u.includes("dark") && /* @__PURE__ */
|
|
2618
|
+
u.includes("dark") && /* @__PURE__ */ J(L, {
|
|
2620
2619
|
value: "dark",
|
|
2621
|
-
className:
|
|
2622
|
-
children: /* @__PURE__ */
|
|
2620
|
+
className: W("mt-0 px-4 pb-4 pt-3 rounded-xl", "border border-transparent data-[selected=true]:border-accent data-[selected=true]:bg-accent/10", "data-[focus-visible=true]:border-accent data-[focus-visible=true]:bg-accent/10", t === "transparent" ? "bg-surface" : "bg-surface-secondary"),
|
|
2621
|
+
children: /* @__PURE__ */ Y(L.Content, {
|
|
2623
2622
|
className: "gap-2",
|
|
2624
|
-
children: [/* @__PURE__ */
|
|
2623
|
+
children: [/* @__PURE__ */ Y("div", {
|
|
2625
2624
|
className: "flex gap-2 justify-between",
|
|
2626
|
-
children: [/* @__PURE__ */
|
|
2625
|
+
children: [/* @__PURE__ */ Y(I, {
|
|
2627
2626
|
className: "flex gap-2 items-center",
|
|
2628
|
-
children: [/* @__PURE__ */
|
|
2629
|
-
}), /* @__PURE__ */
|
|
2630
|
-
}), /* @__PURE__ */
|
|
2627
|
+
children: [/* @__PURE__ */ J(Ue, { className: "text-muted" }), i.dark]
|
|
2628
|
+
}), /* @__PURE__ */ J(L.Control, { children: /* @__PURE__ */ J(L.Indicator, {}) })]
|
|
2629
|
+
}), /* @__PURE__ */ J(s, { className: "w-full" })]
|
|
2631
2630
|
})
|
|
2632
2631
|
})
|
|
2633
2632
|
]
|
|
@@ -2638,7 +2637,7 @@ function In({ className: e, variant: t, ...n }) {
|
|
|
2638
2637
|
//#endregion
|
|
2639
2638
|
//#region src/components/auth/username/username-field.tsx
|
|
2640
2639
|
function Ln({ name: e, field: t, isPending: n, variant: r }) {
|
|
2641
|
-
let { authClient: i } = p(), { localization: a, minUsernameLength: o, maxUsernameLength: s, isUsernameAvailable: c } = m(Rn), l = String(t.defaultValue ?? ""), [u, d] =
|
|
2640
|
+
let { authClient: i } = p(), { localization: a, minUsernameLength: o, maxUsernameLength: s, isUsernameAvailable: c } = m(Rn), l = String(t.defaultValue ?? ""), [u, d] = K(l), { mutate: f, data: h, error: g, reset: _ } = ne(i, { onError: () => {} }), v = bt((e) => {
|
|
2642
2641
|
let t = e.trim();
|
|
2643
2642
|
if (!t || t === l) {
|
|
2644
2643
|
_();
|
|
@@ -2650,7 +2649,7 @@ function Ln({ name: e, field: t, isPending: n, variant: r }) {
|
|
|
2650
2649
|
d(e), _(), c && v.maybeExecute(e);
|
|
2651
2650
|
}
|
|
2652
2651
|
let b = !!c && !!u.trim() && u.trim() !== l, { localization: x } = p();
|
|
2653
|
-
return /* @__PURE__ */
|
|
2652
|
+
return /* @__PURE__ */ Y(U, {
|
|
2654
2653
|
name: e,
|
|
2655
2654
|
type: "text",
|
|
2656
2655
|
autoComplete: "username",
|
|
@@ -2666,29 +2665,29 @@ function Ln({ name: e, field: t, isPending: n, variant: r }) {
|
|
|
2666
2665
|
if (s && e.length > s) return x.auth.tooLong.replace("{{max}}", String(s));
|
|
2667
2666
|
},
|
|
2668
2667
|
children: [
|
|
2669
|
-
/* @__PURE__ */
|
|
2670
|
-
/* @__PURE__ */
|
|
2668
|
+
/* @__PURE__ */ J(I, { children: t.label }),
|
|
2669
|
+
/* @__PURE__ */ Y(F, {
|
|
2671
2670
|
variant: r === "transparent" ? "primary" : "secondary",
|
|
2672
|
-
children: [/* @__PURE__ */
|
|
2671
|
+
children: [/* @__PURE__ */ J(F.Input, {
|
|
2673
2672
|
placeholder: t.placeholder,
|
|
2674
2673
|
required: t.required
|
|
2675
|
-
}), b && /* @__PURE__ */
|
|
2674
|
+
}), b && /* @__PURE__ */ J(F.Suffix, {
|
|
2676
2675
|
"aria-label": h?.available ? a.usernameAvailable : h?.available === !1 ? a.usernameTaken : void 0,
|
|
2677
2676
|
className: "px-2",
|
|
2678
|
-
children: h?.available ? /* @__PURE__ */
|
|
2677
|
+
children: h?.available ? /* @__PURE__ */ J(Oe, { className: "text-success" }) : g || h?.available === !1 ? /* @__PURE__ */ J(E, { className: "text-danger" }) : /* @__PURE__ */ J(B, {
|
|
2679
2678
|
size: "sm",
|
|
2680
2679
|
color: "current"
|
|
2681
2680
|
})
|
|
2682
2681
|
})]
|
|
2683
2682
|
}),
|
|
2684
|
-
/* @__PURE__ */
|
|
2683
|
+
/* @__PURE__ */ J(M, {})
|
|
2685
2684
|
]
|
|
2686
2685
|
});
|
|
2687
2686
|
}
|
|
2688
2687
|
//#endregion
|
|
2689
2688
|
//#region src/lib/auth/username-plugin.tsx
|
|
2690
|
-
var Rn = a(
|
|
2691
|
-
let t =
|
|
2689
|
+
var Rn = a(vt.id, (e = {}) => {
|
|
2690
|
+
let t = vt(e);
|
|
2692
2691
|
return {
|
|
2693
2692
|
...t,
|
|
2694
2693
|
additionalFields: t.additionalFields?.map((e) => e.name === "username" ? {
|
|
@@ -2700,144 +2699,143 @@ var Rn = a(_t.id, (e = {}) => {
|
|
|
2700
2699
|
});
|
|
2701
2700
|
//#endregion
|
|
2702
2701
|
//#region src/components/auth/username/sign-in-username.tsx
|
|
2703
|
-
function zn({ className: n, socialLayout: i, socialPosition: a = "bottom", variant: o
|
|
2704
|
-
let { authClient:
|
|
2702
|
+
function zn({ className: n, socialLayout: i, socialPosition: a = "bottom", variant: o }) {
|
|
2703
|
+
let { authClient: s, basePaths: c, baseURL: l, emailAndPassword: u, localization: d, plugins: f, redirectTo: h, socialProviders: g, viewPaths: _, navigate: v } = p(), { fetchOptions: y, resetFetchOptions: b } = ee(), { localization: x } = m(Rn), [S, C] = K(""), { mutate: w } = he(s, { onSuccess: () => G.success(d.auth.verificationEmailSent) });
|
|
2705
2704
|
function te(e) {
|
|
2706
2705
|
return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e);
|
|
2707
2706
|
}
|
|
2708
|
-
let { mutate: ne, isPending: re } =
|
|
2707
|
+
let { mutate: ne, isPending: re } = ve(s, {
|
|
2709
2708
|
onError: (e, { email: t }) => {
|
|
2710
|
-
|
|
2711
|
-
children:
|
|
2712
|
-
onClick: () =>
|
|
2709
|
+
C(""), e.error?.code === "EMAIL_NOT_VERIFIED" && G.danger(e.error?.message || e.message, { actionProps: {
|
|
2710
|
+
children: d.auth.resend,
|
|
2711
|
+
onClick: () => w({
|
|
2713
2712
|
email: t,
|
|
2714
|
-
callbackURL: `${
|
|
2713
|
+
callbackURL: `${l}${h}`
|
|
2715
2714
|
})
|
|
2716
|
-
} }),
|
|
2715
|
+
} }), b();
|
|
2717
2716
|
},
|
|
2718
|
-
onSuccess: () =>
|
|
2719
|
-
}), { mutate: ie, isPending: ae } =
|
|
2717
|
+
onSuccess: () => v({ to: h })
|
|
2718
|
+
}), { mutate: ie, isPending: ae } = xe(s, {
|
|
2720
2719
|
onError: () => {
|
|
2721
|
-
|
|
2720
|
+
C(""), b();
|
|
2722
2721
|
},
|
|
2723
|
-
onSuccess: () =>
|
|
2722
|
+
onSuccess: () => v({ to: h })
|
|
2724
2723
|
}), oe = (e) => {
|
|
2725
2724
|
e.preventDefault();
|
|
2726
2725
|
let t = new FormData(e.currentTarget), n = t.get("email"), r = t.get("rememberMe") === "on";
|
|
2727
2726
|
te(n) ? ne({
|
|
2728
2727
|
email: n,
|
|
2729
|
-
password:
|
|
2730
|
-
...
|
|
2731
|
-
fetchOptions:
|
|
2728
|
+
password: S,
|
|
2729
|
+
...u?.rememberMe ? { rememberMe: r } : {},
|
|
2730
|
+
fetchOptions: y
|
|
2732
2731
|
}) : ie({
|
|
2733
2732
|
username: n,
|
|
2734
|
-
password:
|
|
2735
|
-
...
|
|
2736
|
-
fetchOptions:
|
|
2733
|
+
password: S,
|
|
2734
|
+
...u?.rememberMe ? { rememberMe: r } : {},
|
|
2735
|
+
fetchOptions: y
|
|
2737
2736
|
});
|
|
2738
|
-
},
|
|
2739
|
-
return /* @__PURE__ */
|
|
2740
|
-
className:
|
|
2737
|
+
}, se = X({ mutationKey: r.signIn.all }) + X({ mutationKey: r.signUp.all }) > 0, ce = re || ae, le = f.find((e) => e.captchaComponent)?.captchaComponent, ue = u?.enabled && !!g?.length;
|
|
2738
|
+
return /* @__PURE__ */ Y(k, {
|
|
2739
|
+
className: W("w-full max-w-sm gap-4 md:p-6", n),
|
|
2741
2740
|
variant: o,
|
|
2742
|
-
...s,
|
|
2743
2741
|
children: [
|
|
2744
|
-
/* @__PURE__ */
|
|
2742
|
+
/* @__PURE__ */ J(k.Header, { children: /* @__PURE__ */ J(k.Title, {
|
|
2745
2743
|
className: "text-xl font-semibold mb-1",
|
|
2746
|
-
children:
|
|
2744
|
+
children: d.auth.signIn
|
|
2747
2745
|
}) }),
|
|
2748
|
-
/* @__PURE__ */
|
|
2746
|
+
/* @__PURE__ */ Y(k.Content, {
|
|
2749
2747
|
className: "gap-4",
|
|
2750
2748
|
children: [
|
|
2751
|
-
a === "top" && /* @__PURE__ */
|
|
2752
|
-
|
|
2749
|
+
a === "top" && /* @__PURE__ */ Y(q, { children: [!!g?.length && /* @__PURE__ */ J(t, { socialLayout: i }), ue && /* @__PURE__ */ J(e, { children: d.auth.or })] }),
|
|
2750
|
+
u?.enabled && /* @__PURE__ */ Y(N, {
|
|
2753
2751
|
onSubmit: oe,
|
|
2754
2752
|
className: "flex flex-col gap-4",
|
|
2755
2753
|
children: [
|
|
2756
|
-
/* @__PURE__ */
|
|
2754
|
+
/* @__PURE__ */ Y(U, {
|
|
2757
2755
|
name: "email",
|
|
2758
2756
|
type: "text",
|
|
2759
2757
|
autoComplete: "username email",
|
|
2760
|
-
isDisabled:
|
|
2758
|
+
isDisabled: se,
|
|
2761
2759
|
validate: (e) => {
|
|
2762
|
-
if (!e) return
|
|
2760
|
+
if (!e) return d.auth.fieldRequired;
|
|
2763
2761
|
},
|
|
2764
2762
|
children: [
|
|
2765
|
-
/* @__PURE__ */
|
|
2766
|
-
/* @__PURE__ */
|
|
2767
|
-
placeholder:
|
|
2763
|
+
/* @__PURE__ */ J(I, { children: x.username }),
|
|
2764
|
+
/* @__PURE__ */ J(P, {
|
|
2765
|
+
placeholder: x.usernameOrEmailPlaceholder,
|
|
2768
2766
|
variant: o === "transparent" ? "primary" : "secondary",
|
|
2769
2767
|
required: !0
|
|
2770
2768
|
}),
|
|
2771
|
-
/* @__PURE__ */
|
|
2769
|
+
/* @__PURE__ */ J(M, {})
|
|
2772
2770
|
]
|
|
2773
2771
|
}),
|
|
2774
|
-
/* @__PURE__ */
|
|
2775
|
-
minLength:
|
|
2776
|
-
maxLength:
|
|
2772
|
+
/* @__PURE__ */ Y(U, {
|
|
2773
|
+
minLength: u?.minPasswordLength,
|
|
2774
|
+
maxLength: u?.maxPasswordLength,
|
|
2777
2775
|
name: "password",
|
|
2778
2776
|
type: "password",
|
|
2779
2777
|
autoComplete: "current-password",
|
|
2780
|
-
isDisabled:
|
|
2781
|
-
value:
|
|
2782
|
-
onChange:
|
|
2778
|
+
isDisabled: se,
|
|
2779
|
+
value: S,
|
|
2780
|
+
onChange: C,
|
|
2783
2781
|
validate: (e) => {
|
|
2784
|
-
if (!e) return
|
|
2785
|
-
let t =
|
|
2786
|
-
if (t && e.length < t) return
|
|
2787
|
-
if (n && e.length > n) return
|
|
2782
|
+
if (!e) return d.auth.fieldRequired;
|
|
2783
|
+
let t = u?.minPasswordLength, n = u?.maxPasswordLength;
|
|
2784
|
+
if (t && e.length < t) return d.auth.tooShort.replace("{{min}}", String(t));
|
|
2785
|
+
if (n && e.length > n) return d.auth.tooLong.replace("{{max}}", String(n));
|
|
2788
2786
|
},
|
|
2789
2787
|
children: [
|
|
2790
|
-
/* @__PURE__ */
|
|
2791
|
-
/* @__PURE__ */
|
|
2792
|
-
placeholder:
|
|
2788
|
+
/* @__PURE__ */ J(I, { children: d.auth.password }),
|
|
2789
|
+
/* @__PURE__ */ J(P, {
|
|
2790
|
+
placeholder: d.auth.passwordPlaceholder,
|
|
2793
2791
|
variant: o === "transparent" ? "primary" : "secondary",
|
|
2794
2792
|
required: !0
|
|
2795
2793
|
}),
|
|
2796
|
-
/* @__PURE__ */
|
|
2794
|
+
/* @__PURE__ */ J(M, {})
|
|
2797
2795
|
]
|
|
2798
2796
|
}),
|
|
2799
|
-
|
|
2797
|
+
u?.rememberMe && /* @__PURE__ */ Y($e, {
|
|
2800
2798
|
name: "rememberMe",
|
|
2801
|
-
isDisabled:
|
|
2799
|
+
isDisabled: se,
|
|
2802
2800
|
variant: o === "transparent" ? "primary" : "secondary",
|
|
2803
|
-
children: [/* @__PURE__ */
|
|
2801
|
+
children: [/* @__PURE__ */ J($e.Control, { children: /* @__PURE__ */ J($e.Indicator, {}) }), /* @__PURE__ */ J($e.Content, { children: /* @__PURE__ */ J(I, { children: d.auth.rememberMe }) })]
|
|
2804
2802
|
}),
|
|
2805
|
-
|
|
2803
|
+
le && /* @__PURE__ */ J("div", {
|
|
2806
2804
|
className: "flex justify-center",
|
|
2807
|
-
children:
|
|
2805
|
+
children: le
|
|
2808
2806
|
}),
|
|
2809
|
-
/* @__PURE__ */
|
|
2807
|
+
/* @__PURE__ */ Y("div", {
|
|
2810
2808
|
className: "flex flex-col gap-3",
|
|
2811
|
-
children: [/* @__PURE__ */
|
|
2809
|
+
children: [/* @__PURE__ */ Y(O, {
|
|
2812
2810
|
type: "submit",
|
|
2813
2811
|
className: "w-full",
|
|
2814
|
-
isPending:
|
|
2815
|
-
children: [
|
|
2812
|
+
isPending: ce || se,
|
|
2813
|
+
children: [ce && /* @__PURE__ */ J(B, {
|
|
2816
2814
|
color: "current",
|
|
2817
2815
|
size: "sm"
|
|
2818
|
-
}),
|
|
2819
|
-
}),
|
|
2816
|
+
}), d.auth.signIn]
|
|
2817
|
+
}), f.flatMap((e) => e.authButtons?.map((t, n) => /* @__PURE__ */ J(t, { view: "signIn" }, `${e.id}-${n.toString()}`)))]
|
|
2820
2818
|
})
|
|
2821
2819
|
]
|
|
2822
2820
|
}),
|
|
2823
|
-
a === "bottom" && /* @__PURE__ */
|
|
2821
|
+
a === "bottom" && /* @__PURE__ */ Y(q, { children: [ue && /* @__PURE__ */ J(e, { children: d.auth.or }), !!g?.length && /* @__PURE__ */ J(t, { socialLayout: i })] })
|
|
2824
2822
|
]
|
|
2825
2823
|
}),
|
|
2826
|
-
/* @__PURE__ */
|
|
2824
|
+
/* @__PURE__ */ Y(k.Footer, {
|
|
2827
2825
|
className: "flex-col gap-3",
|
|
2828
|
-
children: [
|
|
2829
|
-
href: `${
|
|
2826
|
+
children: [u?.enabled && u?.forgotPassword && /* @__PURE__ */ J(nt, {
|
|
2827
|
+
href: `${c.auth}/${_.auth.forgotPassword}`,
|
|
2830
2828
|
className: "no-underline hover:underline",
|
|
2831
|
-
children:
|
|
2832
|
-
}),
|
|
2829
|
+
children: d.auth.forgotPasswordLink
|
|
2830
|
+
}), u?.enabled && /* @__PURE__ */ Y(et, {
|
|
2833
2831
|
className: "text-sm",
|
|
2834
2832
|
children: [
|
|
2835
|
-
|
|
2833
|
+
d.auth.needToCreateAnAccount,
|
|
2836
2834
|
" ",
|
|
2837
|
-
/* @__PURE__ */
|
|
2838
|
-
href: `${
|
|
2835
|
+
/* @__PURE__ */ J(nt, {
|
|
2836
|
+
href: `${c.auth}/${_.auth.signUp}`,
|
|
2839
2837
|
className: "text-accent no-underline hover:underline decoration-accent-hover",
|
|
2840
|
-
children:
|
|
2838
|
+
children: d.auth.signUp
|
|
2841
2839
|
})
|
|
2842
2840
|
]
|
|
2843
2841
|
})]
|
|
@@ -2846,4 +2844,4 @@ function zn({ className: n, socialLayout: i, socialPosition: a = "bottom", varia
|
|
|
2846
2844
|
});
|
|
2847
2845
|
}
|
|
2848
2846
|
//#endregion
|
|
2849
|
-
export {
|
|
2847
|
+
export { kt as ApiKeys, In as Appearance, tn as ChangeOrganizationLogo, Wt as CreateOrganizationDialog, Mt as DangerZone, jt as DeleteAccount, an as DeleteOrganization, rn as DeleteOrganizationSkeleton, sn as InviteMemberDialog, ln as LeaveOrganization, Ft as MagicLink, Vt as ManageAccount, It as ManageAccounts, wn as Organization, xt as OrganizationApiKeys, xn as OrganizationDangerZone, pn as OrganizationInvitations, fn as OrganizationInvitationsEmpty, Gt as OrganizationLogo, vn as OrganizationMembers, bn as OrganizationPeople, Sn as OrganizationProfile, qt as OrganizationRow, Cn as OrganizationSettings, Tn as OrganizationSwitcher, Z as OrganizationView, Kt as OrganizationViewSkeleton, Yt as Organizations, en as OrganizationsSettings, Mn as Passkeys, zn as SignInUsername, zt as SwitchAccountSubmenu, Rt as SwitchAccountSubmenuContent, Lt as SwitchAccountSubmenuItem, Pn as ThemeToggleItem, $t as UserInvitations, Ln as UsernameField, St as apiKeyPlugin, At as deleteUserPlugin, Pt as magicLinkPlugin, Bt as multiSessionPlugin, Q as organizationPlugin, $ as passkeyPlugin, Fn as themePlugin, Rn as usernamePlugin };
|