@carlonicora/nextjs-jsonapi 1.44.2 → 1.45.0
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/README.md +2 -2
- package/dist/{BlockNoteEditor-2ZP2BEZC.mjs → BlockNoteEditor-IAA6SRJD.mjs} +4 -4
- package/dist/{BlockNoteEditor-C7CVGQDG.js → BlockNoteEditor-JYQVZHSR.js} +14 -14
- package/dist/{BlockNoteEditor-C7CVGQDG.js.map → BlockNoteEditor-JYQVZHSR.js.map} +1 -1
- package/dist/{auth.interface-BJGKQ0zr.d.ts → auth.interface-DgpoGNZN.d.ts} +1 -0
- package/dist/{auth.interface-8XglqHir.d.mts → auth.interface-quk7psiq.d.mts} +1 -0
- package/dist/billing/index.js +346 -346
- package/dist/billing/index.mjs +3 -3
- package/dist/{chunk-LBIC4GJK.mjs → chunk-4HMQNMP6.mjs} +28 -2
- package/dist/chunk-4HMQNMP6.mjs.map +1 -0
- package/dist/{chunk-L5F5ZN5F.js → chunk-AHXRHXZ2.js} +84 -2
- package/dist/chunk-AHXRHXZ2.js.map +1 -0
- package/dist/{chunk-CLXIZJVH.mjs → chunk-EA3EPEDL.mjs} +839 -450
- package/dist/chunk-EA3EPEDL.mjs.map +1 -0
- package/dist/{chunk-OODZEX6P.js → chunk-GP3MDKGE.js} +28 -2
- package/dist/chunk-GP3MDKGE.js.map +1 -0
- package/dist/{chunk-24E7WD4J.js → chunk-XRBK4J6U.js} +954 -565
- package/dist/chunk-XRBK4J6U.js.map +1 -0
- package/dist/{chunk-PHNL4QUF.mjs → chunk-ZMGUP2AI.mjs} +84 -2
- package/dist/chunk-ZMGUP2AI.mjs.map +1 -0
- package/dist/client/index.js +4 -4
- package/dist/client/index.mjs +3 -3
- package/dist/components/index.d.mts +160 -3
- package/dist/components/index.d.ts +160 -3
- package/dist/components/index.js +10 -4
- package/dist/components/index.js.map +1 -1
- package/dist/components/index.mjs +9 -3
- package/dist/contexts/index.js +4 -4
- package/dist/contexts/index.mjs +3 -3
- package/dist/core/index.d.mts +42 -5
- package/dist/core/index.d.ts +42 -5
- package/dist/core/index.js +10 -2
- package/dist/core/index.js.map +1 -1
- package/dist/core/index.mjs +9 -1
- package/dist/index.d.mts +66 -5
- package/dist/index.d.ts +66 -5
- package/dist/index.js +17 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +16 -2
- package/dist/{s3.service-DOwqcUDT.d.ts → s3.service--8IFzWsB.d.ts} +1 -1
- package/dist/{s3.service-D0rbmLFp.d.mts → s3.service-GQa6F4Ks.d.mts} +1 -1
- package/dist/server/index.d.mts +2 -2
- package/dist/server/index.d.ts +2 -2
- package/dist/server/index.js +3 -3
- package/dist/server/index.mjs +1 -1
- package/package.json +1 -1
- package/scripts/generate-web-module/types/template-data.interface.ts +1 -1
- package/src/components/index.ts +1 -0
- package/src/core/index.ts +3 -0
- package/src/core/registry/ModuleRegistry.ts +3 -0
- package/src/features/auth/components/buttons/GoogleSignInButton.tsx +13 -2
- package/src/features/auth/components/forms/Login.tsx +24 -2
- package/src/features/auth/components/forms/Logout.tsx +9 -1
- package/src/features/auth/components/forms/Register.tsx +45 -5
- package/src/features/auth/components/forms/__tests__/Logout.spec.tsx +118 -0
- package/src/features/auth/config.ts +1 -1
- package/src/features/auth/data/auth.interface.ts +1 -0
- package/src/features/auth/data/auth.ts +1 -0
- package/src/features/auth/utils/__tests__/clearClientStorage.spec.ts +81 -0
- package/src/features/auth/utils/clearClientStorage.ts +11 -0
- package/src/features/auth/utils/index.ts +1 -0
- package/src/features/index.ts +1 -0
- package/src/features/referral/__tests__/config.spec.ts +105 -0
- package/src/features/referral/__tests__/referral-cookie.spec.ts +188 -0
- package/src/features/referral/components/ReferralCodeCapture.tsx +51 -0
- package/src/features/referral/components/ReferralDialog.tsx +94 -0
- package/src/features/referral/components/ReferralWidget.tsx +334 -0
- package/src/features/referral/components/index.ts +3 -0
- package/src/features/referral/config.ts +89 -0
- package/src/features/referral/data/ReferralService.ts +38 -0
- package/src/features/referral/data/ReferralStats.ts +31 -0
- package/src/features/referral/data/index.ts +2 -0
- package/src/features/referral/hooks/index.ts +2 -0
- package/src/features/referral/hooks/useReferralInvite.ts +32 -0
- package/src/features/referral/hooks/useReferralStats.ts +26 -0
- package/src/features/referral/index.ts +21 -0
- package/src/features/referral/interfaces/index.ts +1 -0
- package/src/features/referral/interfaces/referral.interface.ts +5 -0
- package/src/features/referral/referral-stats.module.ts +9 -0
- package/src/features/referral/referral.module.ts +9 -0
- package/src/features/referral/utils/index.ts +1 -0
- package/src/features/referral/utils/referral-cookie.ts +35 -0
- package/src/index.ts +4 -0
- package/dist/chunk-24E7WD4J.js.map +0 -1
- package/dist/chunk-CLXIZJVH.mjs.map +0 -1
- package/dist/chunk-L5F5ZN5F.js.map +0 -1
- package/dist/chunk-LBIC4GJK.mjs.map +0 -1
- package/dist/chunk-OODZEX6P.js.map +0 -1
- package/dist/chunk-PHNL4QUF.mjs.map +0 -1
- /package/dist/{BlockNoteEditor-2ZP2BEZC.mjs.map → BlockNoteEditor-IAA6SRJD.mjs.map} +0 -0
|
@@ -2,6 +2,7 @@ import {
|
|
|
2
2
|
getApiUrl,
|
|
3
3
|
getAppUrl,
|
|
4
4
|
getI18nLink,
|
|
5
|
+
getReferralConfig,
|
|
5
6
|
getRegistrationMode,
|
|
6
7
|
getRoleId,
|
|
7
8
|
getTrackablePages,
|
|
@@ -9,13 +10,14 @@ import {
|
|
|
9
10
|
isDiscordAuthEnabled,
|
|
10
11
|
isGoogleAuthEnabled,
|
|
11
12
|
isInternalAuthEnabled,
|
|
13
|
+
isReferralEnabled,
|
|
12
14
|
isRegistrationAllowed,
|
|
13
15
|
isRolesConfigured,
|
|
14
16
|
useI18nDateFnsLocale,
|
|
15
17
|
useI18nLocale,
|
|
16
18
|
useI18nRouter,
|
|
17
19
|
useI18nTranslations
|
|
18
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-4HMQNMP6.mjs";
|
|
19
21
|
import {
|
|
20
22
|
AVAILABLE_OAUTH_SCOPES,
|
|
21
23
|
AuthService,
|
|
@@ -29,6 +31,7 @@ import {
|
|
|
29
31
|
OAUTH_SCOPE_DISPLAY,
|
|
30
32
|
OAuthService,
|
|
31
33
|
PushService,
|
|
34
|
+
ReferralService,
|
|
32
35
|
RehydrationFactory,
|
|
33
36
|
RoleService,
|
|
34
37
|
S3Service,
|
|
@@ -45,7 +48,7 @@ import {
|
|
|
45
48
|
showToast,
|
|
46
49
|
useComposedRefs,
|
|
47
50
|
useIsMobile
|
|
48
|
-
} from "./chunk-
|
|
51
|
+
} from "./chunk-ZMGUP2AI.mjs";
|
|
49
52
|
import {
|
|
50
53
|
JsonApiContext
|
|
51
54
|
} from "./chunk-VOXD3ZLY.mjs";
|
|
@@ -10922,7 +10925,7 @@ __name(AllowedUsersDetails, "AllowedUsersDetails");
|
|
|
10922
10925
|
import dynamic from "next/dynamic";
|
|
10923
10926
|
import React15 from "react";
|
|
10924
10927
|
import { jsx as jsx126 } from "react/jsx-runtime";
|
|
10925
|
-
var BlockNoteEditor = dynamic(() => import("./BlockNoteEditor-
|
|
10928
|
+
var BlockNoteEditor = dynamic(() => import("./BlockNoteEditor-IAA6SRJD.mjs"), {
|
|
10926
10929
|
ssr: false
|
|
10927
10930
|
});
|
|
10928
10931
|
var BlockNoteEditorContainer = React15.memo(/* @__PURE__ */ __name(function EditorContainer(props) {
|
|
@@ -12282,6 +12285,31 @@ __name(GdprConsentSection, "GdprConsentSection");
|
|
|
12282
12285
|
|
|
12283
12286
|
// src/features/auth/components/forms/Register.tsx
|
|
12284
12287
|
import { Fragment as Fragment21, jsx as jsx141, jsxs as jsxs82 } from "react/jsx-runtime";
|
|
12288
|
+
var REFERRAL_COOKIE_NAME = "referral_code";
|
|
12289
|
+
function getReferralCode() {
|
|
12290
|
+
if (typeof document === "undefined") return null;
|
|
12291
|
+
const cookies = document.cookie.split("; ");
|
|
12292
|
+
for (const cookie of cookies) {
|
|
12293
|
+
const [name, value] = cookie.split("=");
|
|
12294
|
+
if (name === REFERRAL_COOKIE_NAME && value) {
|
|
12295
|
+
return decodeURIComponent(value);
|
|
12296
|
+
}
|
|
12297
|
+
}
|
|
12298
|
+
return null;
|
|
12299
|
+
}
|
|
12300
|
+
__name(getReferralCode, "getReferralCode");
|
|
12301
|
+
function clearReferralCode() {
|
|
12302
|
+
if (typeof document === "undefined") return;
|
|
12303
|
+
document.cookie = `${REFERRAL_COOKIE_NAME}=; path=/; max-age=0; SameSite=Lax`;
|
|
12304
|
+
}
|
|
12305
|
+
__name(clearReferralCode, "clearReferralCode");
|
|
12306
|
+
function buildOAuthQueryParams(inviteCode, referralCode) {
|
|
12307
|
+
const params = new URLSearchParams();
|
|
12308
|
+
if (inviteCode) params.set("invite", inviteCode);
|
|
12309
|
+
if (referralCode) params.set("referral", referralCode);
|
|
12310
|
+
return params.toString() ? `?${params.toString()}` : "";
|
|
12311
|
+
}
|
|
12312
|
+
__name(buildOAuthQueryParams, "buildOAuthQueryParams");
|
|
12285
12313
|
function Register() {
|
|
12286
12314
|
const t = useTranslations49();
|
|
12287
12315
|
const { setComponentType } = useAuthContext();
|
|
@@ -12294,6 +12322,12 @@ function Register() {
|
|
|
12294
12322
|
const [isValidatingInvite, setIsValidatingInvite] = useState46(
|
|
12295
12323
|
registrationMode === "waitlist" && !!inviteCode
|
|
12296
12324
|
);
|
|
12325
|
+
const [referralCode, setReferralCode2] = useState46(null);
|
|
12326
|
+
useEffect40(() => {
|
|
12327
|
+
const code = getReferralCode();
|
|
12328
|
+
console.log("[REFERRAL] Register.tsx - cookie value on mount:", code);
|
|
12329
|
+
setReferralCode2(code);
|
|
12330
|
+
}, []);
|
|
12297
12331
|
const formSchema = z4.object({
|
|
12298
12332
|
company: z4.string().min(1, {
|
|
12299
12333
|
message: t(`common.errors.missing_company_name`)
|
|
@@ -12349,6 +12383,7 @@ function Register() {
|
|
|
12349
12383
|
}, [registrationMode, inviteCode, form, t]);
|
|
12350
12384
|
const onSubmit = /* @__PURE__ */ __name(async (values) => {
|
|
12351
12385
|
try {
|
|
12386
|
+
console.log("[REFERRAL] Register.tsx - referralCode at submit:", referralCode);
|
|
12352
12387
|
const payload = {
|
|
12353
12388
|
id: v44(),
|
|
12354
12389
|
companyName: values.company,
|
|
@@ -12358,9 +12393,12 @@ function Register() {
|
|
|
12358
12393
|
termsAcceptedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
12359
12394
|
marketingConsent: values.marketingConsent ?? false,
|
|
12360
12395
|
marketingConsentAt: values.marketingConsent ? (/* @__PURE__ */ new Date()).toISOString() : null,
|
|
12361
|
-
inviteCode: inviteCode ?? void 0
|
|
12396
|
+
inviteCode: inviteCode ?? void 0,
|
|
12397
|
+
referralCode: referralCode ?? void 0
|
|
12362
12398
|
};
|
|
12399
|
+
console.log("[REFERRAL] Register.tsx - payload.referralCode:", payload.referralCode);
|
|
12363
12400
|
await AuthService.register(payload);
|
|
12401
|
+
clearReferralCode();
|
|
12364
12402
|
setShowConfirmation(true);
|
|
12365
12403
|
} catch (e) {
|
|
12366
12404
|
errorToast({ error: e });
|
|
@@ -12457,7 +12495,7 @@ function Register() {
|
|
|
12457
12495
|
),
|
|
12458
12496
|
/* @__PURE__ */ jsx141(GdprConsentSection, { form }),
|
|
12459
12497
|
/* @__PURE__ */ jsx141(Button, { className: "mt-4 w-full", type: "submit", children: t(`auth.buttons.register`) }),
|
|
12460
|
-
registrationMode
|
|
12498
|
+
(registrationMode !== "waitlist" || inviteValidated) && (isGoogleAuthEnabled() || isDiscordAuthEnabled()) && /* @__PURE__ */ jsxs82("div", { className: "space-y-4 pt-4", children: [
|
|
12461
12499
|
/* @__PURE__ */ jsxs82("div", { className: "relative", children: [
|
|
12462
12500
|
/* @__PURE__ */ jsx141("div", { className: "absolute inset-0 flex items-center", children: /* @__PURE__ */ jsx141("span", { className: "w-full border-t" }) }),
|
|
12463
12501
|
/* @__PURE__ */ jsx141("div", { className: "relative flex justify-center text-xs uppercase", children: /* @__PURE__ */ jsx141("span", { className: "bg-card px-2 text-muted-foreground", children: t("auth.buttons.or") }) })
|
|
@@ -12466,7 +12504,7 @@ function Register() {
|
|
|
12466
12504
|
isGoogleAuthEnabled() && /* @__PURE__ */ jsx141(
|
|
12467
12505
|
Link,
|
|
12468
12506
|
{
|
|
12469
|
-
href: `${getApiUrl()}auth/google${inviteCode
|
|
12507
|
+
href: `${getApiUrl()}auth/google${buildOAuthQueryParams(inviteCode, referralCode)}`,
|
|
12470
12508
|
className: "flex w-full",
|
|
12471
12509
|
children: /* @__PURE__ */ jsxs82(
|
|
12472
12510
|
Button,
|
|
@@ -12514,7 +12552,7 @@ function Register() {
|
|
|
12514
12552
|
isDiscordAuthEnabled() && /* @__PURE__ */ jsx141(
|
|
12515
12553
|
Link,
|
|
12516
12554
|
{
|
|
12517
|
-
href: `${getApiUrl()}auth/discord${inviteCode
|
|
12555
|
+
href: `${getApiUrl()}auth/discord${buildOAuthQueryParams(inviteCode, referralCode)}`,
|
|
12518
12556
|
className: "flex w-full",
|
|
12519
12557
|
children: /* @__PURE__ */ jsxs82(Button, { className: "w-full", variant: "outline", type: "button", children: [
|
|
12520
12558
|
/* @__PURE__ */ jsx141("svg", { className: "mr-2 h-5 w-5", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ jsx141("path", { d: "M20.317 4.37a19.791 19.791 0 0 0-4.885-1.515.074.074 0 0 0-.079.037c-.21.375-.444.864-.608 1.25a18.27 18.27 0 0 0-5.487 0 12.64 12.64 0 0 0-.617-1.25.077.077 0 0 0-.079-.037A19.736 19.736 0 0 0 3.677 4.37a.07.07 0 0 0-.032.027C.533 9.046-.32 13.58.099 18.057a.082.082 0 0 0 .031.057 19.9 19.9 0 0 0 5.993 3.03.078.078 0 0 0 .084-.028 14.09 14.09 0 0 0 1.226-1.994.076.076 0 0 0-.041-.106 13.107 13.107 0 0 1-1.872-.892.077.077 0 0 1-.008-.128 10.2 10.2 0 0 0 .372-.292.074.074 0 0 1 .077-.01c3.928 1.793 8.18 1.793 12.062 0a.074.074 0 0 1 .078.01c.12.098.246.198.373.292a.077.077 0 0 1-.006.127 12.299 12.299 0 0 1-1.873.892.077.077 0 0 0-.041.107c.36.698.772 1.362 1.225 1.993a.076.076 0 0 0 .084.028 19.839 19.839 0 0 0 6.002-3.03.077.077 0 0 0 .032-.054c.5-5.177-.838-9.674-3.549-13.66a.061.061 0 0 0-.031-.03zM8.02 15.33c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.956-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.956 2.418-2.157 2.418zm7.975 0c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.955-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.946 2.418-2.157 2.418z" }) }),
|
|
@@ -13342,11 +13380,16 @@ import Image10 from "next/image";
|
|
|
13342
13380
|
|
|
13343
13381
|
// src/features/auth/components/buttons/GoogleSignInButton.tsx
|
|
13344
13382
|
import { jsx as jsx153, jsxs as jsxs91 } from "react/jsx-runtime";
|
|
13345
|
-
function GoogleSignInButton() {
|
|
13383
|
+
function GoogleSignInButton({ referralCode }) {
|
|
13346
13384
|
if (!isGoogleAuthEnabled()) {
|
|
13347
13385
|
return null;
|
|
13348
13386
|
}
|
|
13349
|
-
|
|
13387
|
+
const buildGoogleOAuthUrl = /* @__PURE__ */ __name(() => {
|
|
13388
|
+
const baseUrl = `${getApiUrl()}auth/google`;
|
|
13389
|
+
if (!referralCode) return baseUrl;
|
|
13390
|
+
return `${baseUrl}?referral=${encodeURIComponent(referralCode)}`;
|
|
13391
|
+
}, "buildGoogleOAuthUrl");
|
|
13392
|
+
return /* @__PURE__ */ jsx153(Link, { href: buildGoogleOAuthUrl(), className: "flex w-full justify-end", children: /* @__PURE__ */ jsxs91(
|
|
13350
13393
|
Button,
|
|
13351
13394
|
{
|
|
13352
13395
|
className: "w-full bg-white hover:bg-gray-50 text-gray-700 border border-gray-300",
|
|
@@ -13677,6 +13720,7 @@ import { zodResolver as zodResolver7 } from "@hookform/resolvers/zod";
|
|
|
13677
13720
|
import { useTranslations as useTranslations61 } from "next-intl";
|
|
13678
13721
|
import Image14 from "next/image";
|
|
13679
13722
|
import { useRouter, useSearchParams as useSearchParams2 } from "next/navigation";
|
|
13723
|
+
import { useEffect as useEffect46, useState as useState60 } from "react";
|
|
13680
13724
|
import { useForm as useForm7 } from "react-hook-form";
|
|
13681
13725
|
import { z as z7 } from "zod";
|
|
13682
13726
|
import { Fragment as Fragment28, jsx as jsx158, jsxs as jsxs96 } from "react/jsx-runtime";
|
|
@@ -13689,6 +13733,22 @@ function Login() {
|
|
|
13689
13733
|
const nativeRouter = useRouter();
|
|
13690
13734
|
const searchParams = useSearchParams2();
|
|
13691
13735
|
const callbackUrl = searchParams.get("callbackUrl");
|
|
13736
|
+
const [referralCode, setReferralCode2] = useState60(null);
|
|
13737
|
+
useEffect46(() => {
|
|
13738
|
+
const cookies = document.cookie.split("; ");
|
|
13739
|
+
for (const cookie of cookies) {
|
|
13740
|
+
const [name, value] = cookie.split("=");
|
|
13741
|
+
if (name === "referral_code" && value) {
|
|
13742
|
+
setReferralCode2(decodeURIComponent(value));
|
|
13743
|
+
break;
|
|
13744
|
+
}
|
|
13745
|
+
}
|
|
13746
|
+
}, []);
|
|
13747
|
+
const buildDiscordOAuthUrl = /* @__PURE__ */ __name(() => {
|
|
13748
|
+
const baseUrl = `${getApiUrl()}auth/discord`;
|
|
13749
|
+
if (!referralCode) return baseUrl;
|
|
13750
|
+
return `${baseUrl}?referral=${encodeURIComponent(referralCode)}`;
|
|
13751
|
+
}, "buildDiscordOAuthUrl");
|
|
13692
13752
|
const formSchema = z7.object({
|
|
13693
13753
|
email: z7.string().email({
|
|
13694
13754
|
message: t(`common.errors.invalid_email`)
|
|
@@ -13763,8 +13823,8 @@ function Login() {
|
|
|
13763
13823
|
/* @__PURE__ */ jsx158(Button, { className: "mt-4 w-full", type: "submit", "data-testid": "form-login-button-submit", children: t(`auth.buttons.login`) })
|
|
13764
13824
|
] }) }),
|
|
13765
13825
|
/* @__PURE__ */ jsxs96(CardFooter, { className: "flex w-full flex-col gap-y-4 mt-4", children: [
|
|
13766
|
-
isGoogleAuthEnabled() && /* @__PURE__ */ jsx158(GoogleSignInButton, {}),
|
|
13767
|
-
isDiscordAuthEnabled() && /* @__PURE__ */ jsx158(Link, { href:
|
|
13826
|
+
isGoogleAuthEnabled() && /* @__PURE__ */ jsx158(GoogleSignInButton, { referralCode }),
|
|
13827
|
+
isDiscordAuthEnabled() && /* @__PURE__ */ jsx158(Link, { href: buildDiscordOAuthUrl(), className: "flex w-full justify-end", children: /* @__PURE__ */ jsx158(Button, { className: "w-full", variant: `outline`, "data-testid": "page-login-button-initial-login", children: "Login with Discord" }) }),
|
|
13768
13828
|
/* @__PURE__ */ jsxs96("div", { className: "flex w-full flex-row justify-between", children: [
|
|
13769
13829
|
/* @__PURE__ */ jsx158(
|
|
13770
13830
|
Link,
|
|
@@ -13793,12 +13853,26 @@ function Login() {
|
|
|
13793
13853
|
__name(Login, "Login");
|
|
13794
13854
|
|
|
13795
13855
|
// src/features/auth/components/forms/Logout.tsx
|
|
13796
|
-
import { useEffect as
|
|
13856
|
+
import { useEffect as useEffect47 } from "react";
|
|
13857
|
+
|
|
13858
|
+
// src/features/auth/utils/clearClientStorage.ts
|
|
13859
|
+
function clearClientStorage(keys) {
|
|
13860
|
+
if (typeof window === "undefined") return;
|
|
13861
|
+
keys.forEach((key) => {
|
|
13862
|
+
window.localStorage.removeItem(key);
|
|
13863
|
+
});
|
|
13864
|
+
}
|
|
13865
|
+
__name(clearClientStorage, "clearClientStorage");
|
|
13866
|
+
|
|
13867
|
+
// src/features/auth/components/forms/Logout.tsx
|
|
13797
13868
|
import { Fragment as Fragment29, jsx as jsx159 } from "react/jsx-runtime";
|
|
13798
|
-
function Logout() {
|
|
13869
|
+
function Logout({ storageKeys }) {
|
|
13799
13870
|
const generateUrl = usePageUrlGenerator();
|
|
13800
|
-
|
|
13871
|
+
useEffect47(() => {
|
|
13801
13872
|
const logOut = /* @__PURE__ */ __name(async () => {
|
|
13873
|
+
if (storageKeys?.length) {
|
|
13874
|
+
clearClientStorage(storageKeys);
|
|
13875
|
+
}
|
|
13802
13876
|
await AuthService.logout();
|
|
13803
13877
|
window.location.href = generateUrl({ page: `/` });
|
|
13804
13878
|
}, "logOut");
|
|
@@ -13810,7 +13884,7 @@ __name(Logout, "Logout");
|
|
|
13810
13884
|
|
|
13811
13885
|
// src/features/auth/components/forms/RefreshUser.tsx
|
|
13812
13886
|
import { deleteCookie, getCookie as getCookie2 } from "cookies-next";
|
|
13813
|
-
import { useEffect as
|
|
13887
|
+
import { useEffect as useEffect48 } from "react";
|
|
13814
13888
|
function RefreshUser() {
|
|
13815
13889
|
const { setUser } = useCurrentUserContext();
|
|
13816
13890
|
const loadFullUser = /* @__PURE__ */ __name(async () => {
|
|
@@ -13830,7 +13904,7 @@ function RefreshUser() {
|
|
|
13830
13904
|
deleteCookie("reloadData");
|
|
13831
13905
|
}
|
|
13832
13906
|
}, "loadFullUser");
|
|
13833
|
-
|
|
13907
|
+
useEffect48(() => {
|
|
13834
13908
|
const reloadData = getCookie2("reloadData");
|
|
13835
13909
|
if (reloadData !== void 0) loadFullUser();
|
|
13836
13910
|
}, []);
|
|
@@ -13842,16 +13916,16 @@ __name(RefreshUser, "RefreshUser");
|
|
|
13842
13916
|
import { zodResolver as zodResolver8 } from "@hookform/resolvers/zod";
|
|
13843
13917
|
import { useTranslations as useTranslations62 } from "next-intl";
|
|
13844
13918
|
import Image15 from "next/image";
|
|
13845
|
-
import { useEffect as
|
|
13919
|
+
import { useEffect as useEffect49, useState as useState61 } from "react";
|
|
13846
13920
|
import { useForm as useForm8 } from "react-hook-form";
|
|
13847
13921
|
import { z as z8 } from "zod";
|
|
13848
13922
|
import { Fragment as Fragment30, jsx as jsx160, jsxs as jsxs97 } from "react/jsx-runtime";
|
|
13849
13923
|
function ResetPassword() {
|
|
13850
13924
|
const { setComponentType, params, setParams } = useAuthContext();
|
|
13851
|
-
const [showConfirmation, setShowConfirmation] =
|
|
13852
|
-
const [error, setError] =
|
|
13925
|
+
const [showConfirmation, setShowConfirmation] = useState61(false);
|
|
13926
|
+
const [error, setError] = useState61(void 0);
|
|
13853
13927
|
const t = useTranslations62();
|
|
13854
|
-
|
|
13928
|
+
useEffect49(() => {
|
|
13855
13929
|
async function validateResetPasswordCode(code) {
|
|
13856
13930
|
try {
|
|
13857
13931
|
const payload = {
|
|
@@ -13928,18 +14002,18 @@ __name(ResetPassword, "ResetPassword");
|
|
|
13928
14002
|
// src/features/auth/components/forms/TwoFactorChallenge.tsx
|
|
13929
14003
|
import { useTranslations as useTranslations64 } from "next-intl";
|
|
13930
14004
|
import { useRouter as useRouter2, useSearchParams as useSearchParams3 } from "next/navigation";
|
|
13931
|
-
import { useState as
|
|
14005
|
+
import { useState as useState63 } from "react";
|
|
13932
14006
|
import { v4 as v49 } from "uuid";
|
|
13933
14007
|
|
|
13934
14008
|
// src/features/auth/components/two-factor/PasskeyButton.tsx
|
|
13935
14009
|
import { startAuthentication } from "@simplewebauthn/browser";
|
|
13936
14010
|
import { useTranslations as useTranslations63 } from "next-intl";
|
|
13937
|
-
import { useState as
|
|
14011
|
+
import { useState as useState62 } from "react";
|
|
13938
14012
|
import { v4 as v48 } from "uuid";
|
|
13939
14013
|
import { jsx as jsx161 } from "react/jsx-runtime";
|
|
13940
14014
|
function PasskeyButton({ pendingToken, onSuccess, onError, disabled = false }) {
|
|
13941
14015
|
const t = useTranslations63();
|
|
13942
|
-
const [isLoading, setIsLoading] =
|
|
14016
|
+
const [isLoading, setIsLoading] = useState62(false);
|
|
13943
14017
|
const handleClick = /* @__PURE__ */ __name(async () => {
|
|
13944
14018
|
setIsLoading(true);
|
|
13945
14019
|
try {
|
|
@@ -13984,10 +14058,10 @@ function TwoFactorChallenge() {
|
|
|
13984
14058
|
const nativeRouter = useRouter2();
|
|
13985
14059
|
const searchParams = useSearchParams3();
|
|
13986
14060
|
const callbackUrl = searchParams.get("callbackUrl");
|
|
13987
|
-
const [isVerifying, setIsVerifying] =
|
|
13988
|
-
const [totpError, setTotpError] =
|
|
13989
|
-
const [backupCode, setBackupCode] =
|
|
13990
|
-
const [backupError, setBackupError] =
|
|
14061
|
+
const [isVerifying, setIsVerifying] = useState63(false);
|
|
14062
|
+
const [totpError, setTotpError] = useState63();
|
|
14063
|
+
const [backupCode, setBackupCode] = useState63("");
|
|
14064
|
+
const [backupError, setBackupError] = useState63();
|
|
13991
14065
|
if (!pendingTwoFactor) {
|
|
13992
14066
|
return null;
|
|
13993
14067
|
}
|
|
@@ -14320,7 +14394,7 @@ __name(NotificationsListContainer, "NotificationsListContainer");
|
|
|
14320
14394
|
// src/features/notification/components/modals/NotificationModal.tsx
|
|
14321
14395
|
import { BellIcon } from "lucide-react";
|
|
14322
14396
|
import { useTranslations as useTranslations70 } from "next-intl";
|
|
14323
|
-
import { Fragment as Fragment33, useCallback as useCallback23, useEffect as
|
|
14397
|
+
import { Fragment as Fragment33, useCallback as useCallback23, useEffect as useEffect50, useMemo as useMemo21, useRef as useRef20, useState as useState64 } from "react";
|
|
14324
14398
|
import { jsx as jsx169, jsxs as jsxs103 } from "react/jsx-runtime";
|
|
14325
14399
|
function NotificationModalContent({ isOpen, setIsOpen }) {
|
|
14326
14400
|
const _instanceId = useRef20(Math.random().toString(36).substr(2, 9));
|
|
@@ -14343,7 +14417,7 @@ function NotificationModalContent({ isOpen, setIsOpen }) {
|
|
|
14343
14417
|
} = useSocketContext();
|
|
14344
14418
|
const t = useTranslations70();
|
|
14345
14419
|
const generateUrl = usePageUrlGenerator();
|
|
14346
|
-
const [newNotifications, setNewNotifications] =
|
|
14420
|
+
const [newNotifications, setNewNotifications] = useState64(false);
|
|
14347
14421
|
const preventAutoClose = useRef20(false);
|
|
14348
14422
|
const circuitBreakerRef = useRef20({
|
|
14349
14423
|
count: 0,
|
|
@@ -14372,10 +14446,10 @@ function NotificationModalContent({ isOpen, setIsOpen }) {
|
|
|
14372
14446
|
unreadIds: unreadNotifications2.map((notif) => notif.id)
|
|
14373
14447
|
};
|
|
14374
14448
|
}, [notifications]);
|
|
14375
|
-
|
|
14449
|
+
useEffect50(() => {
|
|
14376
14450
|
setNewNotifications(unreadCount > 0);
|
|
14377
14451
|
}, [unreadCount]);
|
|
14378
|
-
|
|
14452
|
+
useEffect50(() => {
|
|
14379
14453
|
if (lastLoaded === 0) loadNotifications();
|
|
14380
14454
|
}, [lastLoaded, loadNotifications]);
|
|
14381
14455
|
const processSocketNotificationsRef = useRef20(null);
|
|
@@ -14418,7 +14492,7 @@ function NotificationModalContent({ isOpen, setIsOpen }) {
|
|
|
14418
14492
|
generateUrl,
|
|
14419
14493
|
checkCircuitBreaker
|
|
14420
14494
|
]);
|
|
14421
|
-
|
|
14495
|
+
useEffect50(() => {
|
|
14422
14496
|
if (processSocketNotificationsRef.current) {
|
|
14423
14497
|
clearTimeout(processSocketNotificationsRef.current);
|
|
14424
14498
|
}
|
|
@@ -14493,39 +14567,351 @@ function PushNotificationProvider({ children }) {
|
|
|
14493
14567
|
}
|
|
14494
14568
|
__name(PushNotificationProvider, "PushNotificationProvider");
|
|
14495
14569
|
|
|
14570
|
+
// src/features/referral/components/ReferralCodeCapture.tsx
|
|
14571
|
+
import { useSearchParams as useSearchParams4 } from "next/navigation";
|
|
14572
|
+
import { useEffect as useEffect51 } from "react";
|
|
14573
|
+
|
|
14574
|
+
// src/features/referral/utils/referral-cookie.ts
|
|
14575
|
+
function setReferralCode(code) {
|
|
14576
|
+
const config = getReferralConfig();
|
|
14577
|
+
const maxAge = config.cookieDays * 24 * 60 * 60;
|
|
14578
|
+
document.cookie = `${config.cookieName}=${encodeURIComponent(code)}; path=/; max-age=${maxAge}; SameSite=Lax`;
|
|
14579
|
+
}
|
|
14580
|
+
__name(setReferralCode, "setReferralCode");
|
|
14581
|
+
function getReferralCode2() {
|
|
14582
|
+
const config = getReferralConfig();
|
|
14583
|
+
const cookies = document.cookie.split("; ");
|
|
14584
|
+
for (const cookie of cookies) {
|
|
14585
|
+
const [name, value] = cookie.split("=");
|
|
14586
|
+
if (name === config.cookieName && value) {
|
|
14587
|
+
return decodeURIComponent(value);
|
|
14588
|
+
}
|
|
14589
|
+
}
|
|
14590
|
+
return null;
|
|
14591
|
+
}
|
|
14592
|
+
__name(getReferralCode2, "getReferralCode");
|
|
14593
|
+
|
|
14594
|
+
// src/features/referral/components/ReferralCodeCapture.tsx
|
|
14595
|
+
function ReferralCodeCapture() {
|
|
14596
|
+
const searchParams = useSearchParams4();
|
|
14597
|
+
useEffect51(() => {
|
|
14598
|
+
console.log("[REFERRAL] ReferralCodeCapture mounted");
|
|
14599
|
+
console.log("[REFERRAL] isReferralEnabled():", isReferralEnabled());
|
|
14600
|
+
if (!isReferralEnabled()) {
|
|
14601
|
+
console.log("[REFERRAL] Feature DISABLED - not capturing");
|
|
14602
|
+
return;
|
|
14603
|
+
}
|
|
14604
|
+
const config = getReferralConfig();
|
|
14605
|
+
const refCode = searchParams.get(config.urlParamName);
|
|
14606
|
+
console.log("[REFERRAL] URL param '" + config.urlParamName + "':", refCode);
|
|
14607
|
+
if (refCode) {
|
|
14608
|
+
const existingCode = getReferralCode2();
|
|
14609
|
+
console.log("[REFERRAL] Existing cookie:", existingCode);
|
|
14610
|
+
if (!existingCode) {
|
|
14611
|
+
setReferralCode(refCode);
|
|
14612
|
+
console.log("[REFERRAL] Cookie SET to:", refCode);
|
|
14613
|
+
} else {
|
|
14614
|
+
console.log("[REFERRAL] Cookie already exists, not overwriting");
|
|
14615
|
+
}
|
|
14616
|
+
}
|
|
14617
|
+
}, [searchParams]);
|
|
14618
|
+
return null;
|
|
14619
|
+
}
|
|
14620
|
+
__name(ReferralCodeCapture, "ReferralCodeCapture");
|
|
14621
|
+
|
|
14622
|
+
// src/features/referral/components/ReferralWidget.tsx
|
|
14623
|
+
import { Copy as Copy2, Loader2 as Loader24, Mail, Users } from "lucide-react";
|
|
14624
|
+
import { useCallback as useCallback24, useRef as useRef21, useState as useState67 } from "react";
|
|
14625
|
+
|
|
14626
|
+
// src/features/referral/hooks/useReferralInvite.ts
|
|
14627
|
+
import { useState as useState65 } from "react";
|
|
14628
|
+
function useReferralInvite() {
|
|
14629
|
+
const [sending, setSending] = useState65(false);
|
|
14630
|
+
const [error, setError] = useState65(null);
|
|
14631
|
+
const [success, setSuccess] = useState65(false);
|
|
14632
|
+
const sendInvite = /* @__PURE__ */ __name(async (email) => {
|
|
14633
|
+
if (!isReferralEnabled()) {
|
|
14634
|
+
return;
|
|
14635
|
+
}
|
|
14636
|
+
setSending(true);
|
|
14637
|
+
setError(null);
|
|
14638
|
+
setSuccess(false);
|
|
14639
|
+
try {
|
|
14640
|
+
await ReferralService.sendReferralEmail(email);
|
|
14641
|
+
setSuccess(true);
|
|
14642
|
+
} catch (err) {
|
|
14643
|
+
setError(err);
|
|
14644
|
+
} finally {
|
|
14645
|
+
setSending(false);
|
|
14646
|
+
}
|
|
14647
|
+
}, "sendInvite");
|
|
14648
|
+
return { sendInvite, sending, error, success };
|
|
14649
|
+
}
|
|
14650
|
+
__name(useReferralInvite, "useReferralInvite");
|
|
14651
|
+
|
|
14652
|
+
// src/features/referral/hooks/useReferralStats.ts
|
|
14653
|
+
import { useEffect as useEffect52, useState as useState66 } from "react";
|
|
14654
|
+
function useReferralStats() {
|
|
14655
|
+
const [stats, setStats] = useState66(null);
|
|
14656
|
+
const [loading, setLoading] = useState66(true);
|
|
14657
|
+
const [error, setError] = useState66(null);
|
|
14658
|
+
useEffect52(() => {
|
|
14659
|
+
if (!isReferralEnabled()) {
|
|
14660
|
+
setLoading(false);
|
|
14661
|
+
return;
|
|
14662
|
+
}
|
|
14663
|
+
ReferralService.getMyReferralStats().then(setStats).catch(setError).finally(() => setLoading(false));
|
|
14664
|
+
}, []);
|
|
14665
|
+
return { stats, loading, error };
|
|
14666
|
+
}
|
|
14667
|
+
__name(useReferralStats, "useReferralStats");
|
|
14668
|
+
|
|
14669
|
+
// src/features/referral/components/ReferralWidget.tsx
|
|
14670
|
+
import { jsx as jsx171, jsxs as jsxs104 } from "react/jsx-runtime";
|
|
14671
|
+
var DEFAULT_TRANSLATIONS = {
|
|
14672
|
+
title: "Invite Friends",
|
|
14673
|
+
description: "Share your referral link and earn rewards when your friends subscribe.",
|
|
14674
|
+
yourLink: "Your referral link",
|
|
14675
|
+
copyButton: "Copy",
|
|
14676
|
+
copiedMessage: "Link copied to clipboard!",
|
|
14677
|
+
statsLabel: "Your referral stats",
|
|
14678
|
+
completedLabel: "Successful referrals",
|
|
14679
|
+
tokensLabel: "Tokens earned",
|
|
14680
|
+
inviteTitle: "Invite by email",
|
|
14681
|
+
inviteDescription: "Send an invitation directly to a friend's email.",
|
|
14682
|
+
emailPlaceholder: "friend@example.com",
|
|
14683
|
+
sendButton: "Send",
|
|
14684
|
+
sendingButton: "Sending...",
|
|
14685
|
+
inviteSent: "Invitation sent successfully!",
|
|
14686
|
+
inviteError: "Failed to send invitation",
|
|
14687
|
+
copyError: "Failed to copy link",
|
|
14688
|
+
invalidEmail: "Please enter a valid email address"
|
|
14689
|
+
};
|
|
14690
|
+
async function copyToClipboard(text) {
|
|
14691
|
+
if (navigator.clipboard?.writeText) {
|
|
14692
|
+
try {
|
|
14693
|
+
await navigator.clipboard.writeText(text);
|
|
14694
|
+
return true;
|
|
14695
|
+
} catch (err) {
|
|
14696
|
+
console.warn("Clipboard API failed, trying fallback:", err);
|
|
14697
|
+
}
|
|
14698
|
+
}
|
|
14699
|
+
try {
|
|
14700
|
+
const textArea = document.createElement("textarea");
|
|
14701
|
+
textArea.value = text;
|
|
14702
|
+
textArea.style.position = "fixed";
|
|
14703
|
+
textArea.style.left = "-999999px";
|
|
14704
|
+
textArea.style.top = "-999999px";
|
|
14705
|
+
document.body.appendChild(textArea);
|
|
14706
|
+
textArea.focus();
|
|
14707
|
+
textArea.select();
|
|
14708
|
+
const success = document.execCommand("copy");
|
|
14709
|
+
document.body.removeChild(textArea);
|
|
14710
|
+
return success;
|
|
14711
|
+
} catch (err) {
|
|
14712
|
+
console.error("Fallback copy failed:", err);
|
|
14713
|
+
return false;
|
|
14714
|
+
}
|
|
14715
|
+
}
|
|
14716
|
+
__name(copyToClipboard, "copyToClipboard");
|
|
14717
|
+
function ReferralWidget({
|
|
14718
|
+
translations,
|
|
14719
|
+
className,
|
|
14720
|
+
isDialog = false,
|
|
14721
|
+
onLinkCopied,
|
|
14722
|
+
onInviteSent,
|
|
14723
|
+
onInviteError
|
|
14724
|
+
}) {
|
|
14725
|
+
const t = { ...DEFAULT_TRANSLATIONS, ...translations };
|
|
14726
|
+
const { stats, loading, error } = useReferralStats();
|
|
14727
|
+
const { sendInvite, sending } = useReferralInvite();
|
|
14728
|
+
const [email, setEmail] = useState67("");
|
|
14729
|
+
const [copied, setCopied] = useState67(false);
|
|
14730
|
+
const linkInputRef = useRef21(null);
|
|
14731
|
+
const config = getReferralConfig();
|
|
14732
|
+
const baseUrl = config.referralUrlBase || (typeof window !== "undefined" ? window.location.origin : "");
|
|
14733
|
+
const referralUrl = stats?.referralCode ? `${baseUrl}${config.referralPath}?${config.urlParamName}=${stats.referralCode}` : "";
|
|
14734
|
+
if (!isReferralEnabled()) {
|
|
14735
|
+
return null;
|
|
14736
|
+
}
|
|
14737
|
+
const handleCopyLink = useCallback24(async () => {
|
|
14738
|
+
if (!referralUrl) return;
|
|
14739
|
+
const success = await copyToClipboard(referralUrl);
|
|
14740
|
+
if (success) {
|
|
14741
|
+
setCopied(true);
|
|
14742
|
+
showToast(t.copiedMessage);
|
|
14743
|
+
onLinkCopied?.();
|
|
14744
|
+
setTimeout(() => setCopied(false), 2e3);
|
|
14745
|
+
} else {
|
|
14746
|
+
showError(t.copyError);
|
|
14747
|
+
}
|
|
14748
|
+
}, [referralUrl, t.copiedMessage, t.copyError, onLinkCopied]);
|
|
14749
|
+
const handleSendInvite = useCallback24(async () => {
|
|
14750
|
+
if (!email || !email.includes("@")) {
|
|
14751
|
+
showError(t.invalidEmail);
|
|
14752
|
+
return;
|
|
14753
|
+
}
|
|
14754
|
+
try {
|
|
14755
|
+
await sendInvite(email);
|
|
14756
|
+
showToast(t.inviteSent);
|
|
14757
|
+
onInviteSent?.(email);
|
|
14758
|
+
setEmail("");
|
|
14759
|
+
} catch (err) {
|
|
14760
|
+
const error2 = err instanceof Error ? err : new Error(t.inviteError);
|
|
14761
|
+
showError(error2.message);
|
|
14762
|
+
onInviteError?.(error2);
|
|
14763
|
+
}
|
|
14764
|
+
}, [email, sendInvite, t.inviteSent, t.inviteError, t.invalidEmail, onInviteSent, onInviteError]);
|
|
14765
|
+
const handleEmailKeyDown = useCallback24(
|
|
14766
|
+
(e) => {
|
|
14767
|
+
if (e.key === "Enter" && !sending) {
|
|
14768
|
+
e.preventDefault();
|
|
14769
|
+
handleSendInvite();
|
|
14770
|
+
}
|
|
14771
|
+
},
|
|
14772
|
+
[handleSendInvite, sending]
|
|
14773
|
+
);
|
|
14774
|
+
if (loading) {
|
|
14775
|
+
if (isDialog) {
|
|
14776
|
+
return /* @__PURE__ */ jsx171("div", { className: "flex items-center justify-center py-4", children: /* @__PURE__ */ jsx171(Loader24, { className: "text-muted-foreground h-6 w-6 animate-spin" }) });
|
|
14777
|
+
}
|
|
14778
|
+
return /* @__PURE__ */ jsx171(Card, { className: `p-6 ${className ?? ""}`, children: /* @__PURE__ */ jsx171("div", { className: "flex items-center justify-center py-4", children: /* @__PURE__ */ jsx171(Loader24, { className: "text-muted-foreground h-6 w-6 animate-spin" }) }) });
|
|
14779
|
+
}
|
|
14780
|
+
if (error) {
|
|
14781
|
+
const errorMessage = error instanceof Error ? error.message : "Failed to load referral data";
|
|
14782
|
+
if (isDialog) {
|
|
14783
|
+
return /* @__PURE__ */ jsx171("div", { className: "text-destructive text-center text-sm", children: errorMessage });
|
|
14784
|
+
}
|
|
14785
|
+
return /* @__PURE__ */ jsx171(Card, { className: `p-6 ${className ?? ""}`, children: /* @__PURE__ */ jsx171("div", { className: "text-destructive text-center text-sm", children: errorMessage }) });
|
|
14786
|
+
}
|
|
14787
|
+
const content = /* @__PURE__ */ jsxs104("div", { className: "flex flex-col gap-4", children: [
|
|
14788
|
+
!isDialog && /* @__PURE__ */ jsxs104("div", { className: "flex items-start gap-3", children: [
|
|
14789
|
+
/* @__PURE__ */ jsx171("div", { className: "bg-primary/10 rounded-full p-2", children: /* @__PURE__ */ jsx171(Users, { className: "text-primary h-5 w-5" }) }),
|
|
14790
|
+
/* @__PURE__ */ jsxs104("div", { className: "flex flex-col gap-1", children: [
|
|
14791
|
+
/* @__PURE__ */ jsx171("h3", { className: "text-lg font-semibold", children: t.title }),
|
|
14792
|
+
/* @__PURE__ */ jsx171("p", { className: "text-muted-foreground text-sm", children: t.description })
|
|
14793
|
+
] })
|
|
14794
|
+
] }),
|
|
14795
|
+
/* @__PURE__ */ jsxs104("div", { className: "flex flex-col gap-2", children: [
|
|
14796
|
+
/* @__PURE__ */ jsx171(Label, { className: "text-sm font-medium", children: t.yourLink }),
|
|
14797
|
+
/* @__PURE__ */ jsxs104("div", { className: "flex gap-2", children: [
|
|
14798
|
+
/* @__PURE__ */ jsx171(Input, { ref: linkInputRef, value: referralUrl, readOnly: true, className: "font-mono text-sm" }),
|
|
14799
|
+
/* @__PURE__ */ jsx171(
|
|
14800
|
+
Button,
|
|
14801
|
+
{
|
|
14802
|
+
type: "button",
|
|
14803
|
+
variant: "outline",
|
|
14804
|
+
size: "icon",
|
|
14805
|
+
onClick: handleCopyLink,
|
|
14806
|
+
disabled: !referralUrl,
|
|
14807
|
+
"aria-label": t.copyButton,
|
|
14808
|
+
children: /* @__PURE__ */ jsx171(Copy2, { className: `h-4 w-4 ${copied ? "text-green-500" : ""}` })
|
|
14809
|
+
}
|
|
14810
|
+
)
|
|
14811
|
+
] })
|
|
14812
|
+
] }),
|
|
14813
|
+
/* @__PURE__ */ jsxs104("div", { className: "flex flex-col gap-2", children: [
|
|
14814
|
+
/* @__PURE__ */ jsx171(Label, { className: "text-sm font-medium", children: t.inviteTitle }),
|
|
14815
|
+
/* @__PURE__ */ jsx171("p", { className: "text-muted-foreground text-sm", children: t.inviteDescription }),
|
|
14816
|
+
/* @__PURE__ */ jsxs104("div", { className: "flex gap-2", children: [
|
|
14817
|
+
/* @__PURE__ */ jsx171(
|
|
14818
|
+
Input,
|
|
14819
|
+
{
|
|
14820
|
+
type: "email",
|
|
14821
|
+
value: email,
|
|
14822
|
+
onChange: (e) => setEmail(e.target.value),
|
|
14823
|
+
onKeyDown: handleEmailKeyDown,
|
|
14824
|
+
placeholder: t.emailPlaceholder,
|
|
14825
|
+
disabled: sending
|
|
14826
|
+
}
|
|
14827
|
+
),
|
|
14828
|
+
/* @__PURE__ */ jsx171(
|
|
14829
|
+
Button,
|
|
14830
|
+
{
|
|
14831
|
+
type: "button",
|
|
14832
|
+
variant: "outline",
|
|
14833
|
+
size: "icon",
|
|
14834
|
+
onClick: handleSendInvite,
|
|
14835
|
+
disabled: sending || !email,
|
|
14836
|
+
"aria-label": sending ? t.sendingButton : t.sendButton,
|
|
14837
|
+
children: sending ? /* @__PURE__ */ jsx171(Loader24, { className: "h-4 w-4 animate-spin" }) : /* @__PURE__ */ jsx171(Mail, { className: "h-4 w-4" })
|
|
14838
|
+
}
|
|
14839
|
+
)
|
|
14840
|
+
] })
|
|
14841
|
+
] }),
|
|
14842
|
+
stats && stats.completedReferrals > 0 && /* @__PURE__ */ jsx171("div", { className: "border-border border-t pt-3", children: /* @__PURE__ */ jsxs104("p", { className: "text-muted-foreground text-sm", children: [
|
|
14843
|
+
t.completedLabel,
|
|
14844
|
+
": ",
|
|
14845
|
+
stats.completedReferrals
|
|
14846
|
+
] }) })
|
|
14847
|
+
] });
|
|
14848
|
+
if (isDialog) {
|
|
14849
|
+
return content;
|
|
14850
|
+
}
|
|
14851
|
+
return /* @__PURE__ */ jsx171(Card, { className: `p-6 ${className ?? ""}`, children: content });
|
|
14852
|
+
}
|
|
14853
|
+
__name(ReferralWidget, "ReferralWidget");
|
|
14854
|
+
|
|
14855
|
+
// src/features/referral/components/ReferralDialog.tsx
|
|
14856
|
+
import { jsx as jsx172, jsxs as jsxs105 } from "react/jsx-runtime";
|
|
14857
|
+
var DEFAULT_DIALOG_TRANSLATIONS = {
|
|
14858
|
+
dialogTitle: "Invite Friends",
|
|
14859
|
+
dialogDescription: "Share your referral link and earn rewards when your friends subscribe."
|
|
14860
|
+
};
|
|
14861
|
+
function ReferralDialog({
|
|
14862
|
+
open,
|
|
14863
|
+
onOpenChange,
|
|
14864
|
+
translations,
|
|
14865
|
+
dialogClassName,
|
|
14866
|
+
...widgetProps
|
|
14867
|
+
}) {
|
|
14868
|
+
if (!isReferralEnabled()) {
|
|
14869
|
+
return null;
|
|
14870
|
+
}
|
|
14871
|
+
const t = { ...DEFAULT_DIALOG_TRANSLATIONS, ...translations };
|
|
14872
|
+
return /* @__PURE__ */ jsx172(Dialog, { open, onOpenChange, children: /* @__PURE__ */ jsxs105(DialogContent, { className: dialogClassName ?? "max-w-md", children: [
|
|
14873
|
+
/* @__PURE__ */ jsxs105(DialogHeader, { children: [
|
|
14874
|
+
/* @__PURE__ */ jsx172(DialogTitle, { children: t.dialogTitle }),
|
|
14875
|
+
/* @__PURE__ */ jsx172(DialogDescription, { children: t.dialogDescription })
|
|
14876
|
+
] }),
|
|
14877
|
+
/* @__PURE__ */ jsx172(ReferralWidget, { ...widgetProps, translations, isDialog: true })
|
|
14878
|
+
] }) });
|
|
14879
|
+
}
|
|
14880
|
+
__name(ReferralDialog, "ReferralDialog");
|
|
14881
|
+
|
|
14496
14882
|
// src/features/role/components/details/RoleDetails.tsx
|
|
14497
14883
|
import { useTranslations as useTranslations71 } from "next-intl";
|
|
14498
|
-
import { jsx as
|
|
14884
|
+
import { jsx as jsx173 } from "react/jsx-runtime";
|
|
14499
14885
|
function RoleDetails() {
|
|
14500
14886
|
const { role } = useRoleContext();
|
|
14501
14887
|
const t = useTranslations71();
|
|
14502
14888
|
if (!role) return null;
|
|
14503
|
-
return /* @__PURE__ */
|
|
14889
|
+
return /* @__PURE__ */ jsx173(Card, { className: "w-full", children: /* @__PURE__ */ jsx173(CardContent, { className: "p-4", children: /* @__PURE__ */ jsx173(AttributeElement, { title: t(`role.fields.description.label`), value: role.description }) }) });
|
|
14504
14890
|
}
|
|
14505
14891
|
__name(RoleDetails, "RoleDetails");
|
|
14506
14892
|
|
|
14507
14893
|
// src/features/role/components/containers/RoleContainer.tsx
|
|
14508
|
-
import { Fragment as Fragment35, jsx as
|
|
14894
|
+
import { Fragment as Fragment35, jsx as jsx174, jsxs as jsxs106 } from "react/jsx-runtime";
|
|
14509
14895
|
function RoleContainer() {
|
|
14510
14896
|
const { role } = useRoleContext();
|
|
14511
14897
|
if (!role) return null;
|
|
14512
|
-
return /* @__PURE__ */
|
|
14513
|
-
/* @__PURE__ */
|
|
14514
|
-
/* @__PURE__ */
|
|
14898
|
+
return /* @__PURE__ */ jsxs106(Fragment35, { children: [
|
|
14899
|
+
/* @__PURE__ */ jsx174(RoleDetails, {}),
|
|
14900
|
+
/* @__PURE__ */ jsx174(RoleUsersList, { role })
|
|
14515
14901
|
] });
|
|
14516
14902
|
}
|
|
14517
14903
|
__name(RoleContainer, "RoleContainer");
|
|
14518
14904
|
|
|
14519
14905
|
// src/features/role/components/forms/FormRoles.tsx
|
|
14520
14906
|
import { useTranslations as useTranslations72 } from "next-intl";
|
|
14521
|
-
import { jsx as
|
|
14907
|
+
import { jsx as jsx175, jsxs as jsxs107 } from "react/jsx-runtime";
|
|
14522
14908
|
function FormRoles({ form, id, name, roles }) {
|
|
14523
14909
|
const t = useTranslations72();
|
|
14524
14910
|
const { hasAccesToFeature } = useCurrentUserContext();
|
|
14525
|
-
return /* @__PURE__ */
|
|
14911
|
+
return /* @__PURE__ */ jsx175("div", { className: "flex w-full flex-col", children: /* @__PURE__ */ jsx175(FormFieldWrapper, { form, name: id, label: name, children: (field) => /* @__PURE__ */ jsx175("div", { children: roles.filter((role) => role.isSelectable).sort((a, b) => a.name.localeCompare(b.name)).map((role) => {
|
|
14526
14912
|
if (role.requiredFeature && !hasAccesToFeature(role.requiredFeature.id)) return null;
|
|
14527
|
-
return /* @__PURE__ */
|
|
14528
|
-
/* @__PURE__ */
|
|
14913
|
+
return /* @__PURE__ */ jsxs107("div", { children: [
|
|
14914
|
+
/* @__PURE__ */ jsx175(
|
|
14529
14915
|
Checkbox,
|
|
14530
14916
|
{
|
|
14531
14917
|
defaultChecked: field.value.some((roleId) => roleId === role.id),
|
|
@@ -14541,9 +14927,9 @@ function FormRoles({ form, id, name, roles }) {
|
|
|
14541
14927
|
}
|
|
14542
14928
|
}
|
|
14543
14929
|
),
|
|
14544
|
-
/* @__PURE__ */
|
|
14545
|
-
/* @__PURE__ */
|
|
14546
|
-
/* @__PURE__ */
|
|
14930
|
+
/* @__PURE__ */ jsxs107(Tooltip2, { children: [
|
|
14931
|
+
/* @__PURE__ */ jsx175(TooltipTrigger, { children: /* @__PURE__ */ jsx175(FieldLabel, { className: "ml-3 font-normal", children: t(`role.roles`, { role: role.id.replaceAll(`-`, ``) }) }) }),
|
|
14932
|
+
/* @__PURE__ */ jsx175(TooltipContent, { children: t(`role.roles_descriptions`, { role: role.id.replaceAll(`-`, ``) }) })
|
|
14547
14933
|
] })
|
|
14548
14934
|
] }, role.id);
|
|
14549
14935
|
}) }) }) });
|
|
@@ -14552,13 +14938,13 @@ __name(FormRoles, "FormRoles");
|
|
|
14552
14938
|
|
|
14553
14939
|
// src/features/role/components/forms/RemoveUserFromRole.tsx
|
|
14554
14940
|
import { useTranslations as useTranslations73 } from "next-intl";
|
|
14555
|
-
import { useEffect as
|
|
14556
|
-
import { Fragment as Fragment36, jsx as
|
|
14941
|
+
import { useEffect as useEffect53, useState as useState68 } from "react";
|
|
14942
|
+
import { Fragment as Fragment36, jsx as jsx176, jsxs as jsxs108 } from "react/jsx-runtime";
|
|
14557
14943
|
function RemoveUserFromRole({ role, user, refresh }) {
|
|
14558
|
-
const [open, setOpen] =
|
|
14559
|
-
const [canRemove, setCanRemove] =
|
|
14944
|
+
const [open, setOpen] = useState68(false);
|
|
14945
|
+
const [canRemove, setCanRemove] = useState68(false);
|
|
14560
14946
|
const t = useTranslations73();
|
|
14561
|
-
|
|
14947
|
+
useEffect53(() => {
|
|
14562
14948
|
async function checkCompanyAdminDeletability() {
|
|
14563
14949
|
const roleUsers = await UserService.findAllUsersByRole({
|
|
14564
14950
|
roleId: role.id
|
|
@@ -14585,8 +14971,8 @@ function RemoveUserFromRole({ role, user, refresh }) {
|
|
|
14585
14971
|
}
|
|
14586
14972
|
}, "remove");
|
|
14587
14973
|
const roleName = t(`role.roles`, { role: role.id.replaceAll(`-`, ``) });
|
|
14588
|
-
return /* @__PURE__ */
|
|
14589
|
-
/* @__PURE__ */
|
|
14974
|
+
return /* @__PURE__ */ jsxs108(Dialog, { open, onOpenChange: setOpen, children: [
|
|
14975
|
+
/* @__PURE__ */ jsx176(
|
|
14590
14976
|
DialogTrigger,
|
|
14591
14977
|
{
|
|
14592
14978
|
onClick: (e) => {
|
|
@@ -14594,19 +14980,19 @@ function RemoveUserFromRole({ role, user, refresh }) {
|
|
|
14594
14980
|
e.preventDefault();
|
|
14595
14981
|
setOpen(true);
|
|
14596
14982
|
},
|
|
14597
|
-
children: /* @__PURE__ */
|
|
14983
|
+
children: /* @__PURE__ */ jsx176("span", { className: "hover:text-destructive cursor-pointer", children: t(`role.remove_user.title`) })
|
|
14598
14984
|
}
|
|
14599
14985
|
),
|
|
14600
|
-
/* @__PURE__ */
|
|
14601
|
-
/* @__PURE__ */
|
|
14602
|
-
/* @__PURE__ */
|
|
14603
|
-
/* @__PURE__ */
|
|
14986
|
+
/* @__PURE__ */ jsxs108(DialogContent, { className: `flex max-h-[70vh] max-w-3xl flex-col overflow-y-auto`, children: [
|
|
14987
|
+
/* @__PURE__ */ jsxs108(DialogHeader, { children: [
|
|
14988
|
+
/* @__PURE__ */ jsx176(DialogTitle, { children: t(`role.remove_user.title`) }),
|
|
14989
|
+
/* @__PURE__ */ jsx176(DialogDescription, { children: canRemove ? t(`role.remove_user.subtitle_allowed`) : t(`role.remove_user.subtitle_not_allowed`) })
|
|
14604
14990
|
] }),
|
|
14605
|
-
canRemove ? /* @__PURE__ */
|
|
14991
|
+
canRemove ? /* @__PURE__ */ jsxs108(Fragment36, { children: [
|
|
14606
14992
|
t(`role.remove_user.description_allowed`, { role: roleName, user: user.name }),
|
|
14607
|
-
/* @__PURE__ */
|
|
14608
|
-
/* @__PURE__ */
|
|
14609
|
-
/* @__PURE__ */
|
|
14993
|
+
/* @__PURE__ */ jsxs108("div", { className: "flex justify-end", children: [
|
|
14994
|
+
/* @__PURE__ */ jsx176(Button, { className: "mr-2", variant: "outline", type: `button`, onClick: () => setOpen(false), children: t(`ui.buttons.cancel`) }),
|
|
14995
|
+
/* @__PURE__ */ jsx176(
|
|
14610
14996
|
Button,
|
|
14611
14997
|
{
|
|
14612
14998
|
type: "submit",
|
|
@@ -14619,7 +15005,7 @@ function RemoveUserFromRole({ role, user, refresh }) {
|
|
|
14619
15005
|
}
|
|
14620
15006
|
)
|
|
14621
15007
|
] })
|
|
14622
|
-
] }) : /* @__PURE__ */
|
|
15008
|
+
] }) : /* @__PURE__ */ jsx176(Fragment36, { children: t(`role.remove_user.description_not_allowed`, { role: roleName, user: user.name }) })
|
|
14623
15009
|
] })
|
|
14624
15010
|
] });
|
|
14625
15011
|
}
|
|
@@ -14628,13 +15014,13 @@ __name(RemoveUserFromRole, "RemoveUserFromRole");
|
|
|
14628
15014
|
// src/features/role/components/forms/UserRoleAdd.tsx
|
|
14629
15015
|
import { PlusCircle as PlusCircle2 } from "lucide-react";
|
|
14630
15016
|
import { useTranslations as useTranslations74 } from "next-intl";
|
|
14631
|
-
import { useCallback as
|
|
14632
|
-
import { Fragment as Fragment37, jsx as
|
|
15017
|
+
import { useCallback as useCallback25, useEffect as useEffect54, useRef as useRef22, useState as useState69 } from "react";
|
|
15018
|
+
import { Fragment as Fragment37, jsx as jsx177, jsxs as jsxs109 } from "react/jsx-runtime";
|
|
14633
15019
|
function UserRoleAdd({ user, refresh }) {
|
|
14634
|
-
const [open, setOpen] =
|
|
14635
|
-
const inputRef =
|
|
14636
|
-
const [searchTerm, setSearchTerm] =
|
|
14637
|
-
const [roles, setRoles] =
|
|
15020
|
+
const [open, setOpen] = useState69(false);
|
|
15021
|
+
const inputRef = useRef22(null);
|
|
15022
|
+
const [searchTerm, setSearchTerm] = useState69("");
|
|
15023
|
+
const [roles, setRoles] = useState69([]);
|
|
14638
15024
|
const t = useTranslations74();
|
|
14639
15025
|
const addUserToRole = /* @__PURE__ */ __name(async (role) => {
|
|
14640
15026
|
await RoleService.addUserToRole({
|
|
@@ -14658,7 +15044,7 @@ function UserRoleAdd({ user, refresh }) {
|
|
|
14658
15044
|
);
|
|
14659
15045
|
refresh();
|
|
14660
15046
|
}, "addUserToRole");
|
|
14661
|
-
const searchRoles =
|
|
15047
|
+
const searchRoles = useCallback25(
|
|
14662
15048
|
async (term) => {
|
|
14663
15049
|
setRoles(
|
|
14664
15050
|
await RoleService.findAllRolesUserNotIn({
|
|
@@ -14670,32 +15056,32 @@ function UserRoleAdd({ user, refresh }) {
|
|
|
14670
15056
|
[searchTerm, user]
|
|
14671
15057
|
);
|
|
14672
15058
|
const updateSearchTerm = useDebounce(searchRoles, 500);
|
|
14673
|
-
|
|
15059
|
+
useEffect54(() => {
|
|
14674
15060
|
if (open) updateSearchTerm(searchTerm);
|
|
14675
15061
|
}, [open, searchTerm]);
|
|
14676
|
-
|
|
15062
|
+
useEffect54(() => {
|
|
14677
15063
|
if (open) searchRoles("");
|
|
14678
15064
|
}, [open]);
|
|
14679
|
-
return /* @__PURE__ */
|
|
14680
|
-
/* @__PURE__ */
|
|
14681
|
-
/* @__PURE__ */
|
|
15065
|
+
return /* @__PURE__ */ jsxs109(Fragment37, { children: [
|
|
15066
|
+
/* @__PURE__ */ jsxs109(Button, { size: "sm", onClick: () => setOpen(true), children: [
|
|
15067
|
+
/* @__PURE__ */ jsx177(PlusCircle2, { className: "mr-3 h-3.5 w-3.5" }),
|
|
14682
15068
|
t(`common.association.label`, {
|
|
14683
15069
|
source: t(`entities.roles`, { count: 1 }),
|
|
14684
15070
|
destination: t(`entities.users`, { count: 1 })
|
|
14685
15071
|
})
|
|
14686
15072
|
] }),
|
|
14687
|
-
/* @__PURE__ */
|
|
14688
|
-
/* @__PURE__ */
|
|
15073
|
+
/* @__PURE__ */ jsxs109(CommandDialog, { open, onOpenChange: setOpen, children: [
|
|
15074
|
+
/* @__PURE__ */ jsx177(DialogTitle, { children: t(`common.association.label`, {
|
|
14689
15075
|
source: t(`entities.roles`, { count: 1 }),
|
|
14690
15076
|
destination: t(`entities.users`, { count: 1 })
|
|
14691
15077
|
}) }),
|
|
14692
|
-
/* @__PURE__ */
|
|
15078
|
+
/* @__PURE__ */ jsx177(DialogDescription, { children: t(`common.association.description`, {
|
|
14693
15079
|
source: t(`entities.roles`, { count: 1 }),
|
|
14694
15080
|
destination: t(`entities.users`, { count: 1 }),
|
|
14695
15081
|
destination_name: user.name
|
|
14696
15082
|
}) }),
|
|
14697
|
-
/* @__PURE__ */
|
|
14698
|
-
/* @__PURE__ */
|
|
15083
|
+
/* @__PURE__ */ jsxs109(Command, { shouldFilter: false, children: [
|
|
15084
|
+
/* @__PURE__ */ jsx177(
|
|
14699
15085
|
CommandInput,
|
|
14700
15086
|
{
|
|
14701
15087
|
placeholder: t(`ui.search.placeholder`, { type: t(`entities.roles`, { count: 1 }) }),
|
|
@@ -14704,9 +15090,9 @@ function UserRoleAdd({ user, refresh }) {
|
|
|
14704
15090
|
ref: inputRef
|
|
14705
15091
|
}
|
|
14706
15092
|
),
|
|
14707
|
-
/* @__PURE__ */
|
|
14708
|
-
/* @__PURE__ */
|
|
14709
|
-
roles.map((role) => /* @__PURE__ */
|
|
15093
|
+
/* @__PURE__ */ jsxs109(CommandList, { className: "mt-3 h-auto max-h-96 min-h-96 max-w-full overflow-x-hidden overflow-y-auto", children: [
|
|
15094
|
+
/* @__PURE__ */ jsx177(CommandEmpty, { children: t(`ui.search.no_results`, { type: t(`entities.roles`, { count: 1 }) }) }),
|
|
15095
|
+
roles.map((role) => /* @__PURE__ */ jsx177(
|
|
14710
15096
|
CommandItem,
|
|
14711
15097
|
{
|
|
14712
15098
|
className: "cursor-pointer hover:bg-muted data-selected:hover:bg-muted bg-transparent data-selected:bg-transparent",
|
|
@@ -14725,7 +15111,7 @@ __name(UserRoleAdd, "UserRoleAdd");
|
|
|
14725
15111
|
|
|
14726
15112
|
// src/features/role/components/lists/RolesList.tsx
|
|
14727
15113
|
import { useTranslations as useTranslations75 } from "next-intl";
|
|
14728
|
-
import { jsx as
|
|
15114
|
+
import { jsx as jsx178 } from "react/jsx-runtime";
|
|
14729
15115
|
function RolesList() {
|
|
14730
15116
|
const t = useTranslations75();
|
|
14731
15117
|
const data = useDataListRetriever({
|
|
@@ -14733,7 +15119,7 @@ function RolesList() {
|
|
|
14733
15119
|
retrieverParams: {},
|
|
14734
15120
|
module: Modules.Role
|
|
14735
15121
|
});
|
|
14736
|
-
return /* @__PURE__ */
|
|
15122
|
+
return /* @__PURE__ */ jsx178(
|
|
14737
15123
|
ContentListTable,
|
|
14738
15124
|
{
|
|
14739
15125
|
data,
|
|
@@ -14747,7 +15133,7 @@ __name(RolesList, "RolesList");
|
|
|
14747
15133
|
|
|
14748
15134
|
// src/features/role/components/lists/UserRolesList.tsx
|
|
14749
15135
|
import { useTranslations as useTranslations76 } from "next-intl";
|
|
14750
|
-
import { jsx as
|
|
15136
|
+
import { jsx as jsx179 } from "react/jsx-runtime";
|
|
14751
15137
|
function UserRolesList({ user }) {
|
|
14752
15138
|
const t = useTranslations76();
|
|
14753
15139
|
const data = useDataListRetriever({
|
|
@@ -14755,7 +15141,7 @@ function UserRolesList({ user }) {
|
|
|
14755
15141
|
retrieverParams: { userId: user.id },
|
|
14756
15142
|
module: Modules.Role
|
|
14757
15143
|
});
|
|
14758
|
-
return /* @__PURE__ */
|
|
15144
|
+
return /* @__PURE__ */ jsx179(
|
|
14759
15145
|
ContentListTable,
|
|
14760
15146
|
{
|
|
14761
15147
|
data,
|
|
@@ -14768,9 +15154,9 @@ function UserRolesList({ user }) {
|
|
|
14768
15154
|
__name(UserRolesList, "UserRolesList");
|
|
14769
15155
|
|
|
14770
15156
|
// src/features/oauth/components/OAuthRedirectUriInput.tsx
|
|
14771
|
-
import { useCallback as
|
|
15157
|
+
import { useCallback as useCallback26 } from "react";
|
|
14772
15158
|
import { Plus, Trash2 as Trash23 } from "lucide-react";
|
|
14773
|
-
import { jsx as
|
|
15159
|
+
import { jsx as jsx180, jsxs as jsxs110 } from "react/jsx-runtime";
|
|
14774
15160
|
function isValidRedirectUri(uri) {
|
|
14775
15161
|
if (!uri.trim()) return false;
|
|
14776
15162
|
if (uri.startsWith("http://localhost") || uri.startsWith("http://127.0.0.1")) {
|
|
@@ -14798,17 +15184,17 @@ function OAuthRedirectUriInput({
|
|
|
14798
15184
|
disabled = false,
|
|
14799
15185
|
label = "Redirect URIs"
|
|
14800
15186
|
}) {
|
|
14801
|
-
const handleAdd =
|
|
15187
|
+
const handleAdd = useCallback26(() => {
|
|
14802
15188
|
onChange([...value, ""]);
|
|
14803
15189
|
}, [value, onChange]);
|
|
14804
|
-
const handleRemove =
|
|
15190
|
+
const handleRemove = useCallback26(
|
|
14805
15191
|
(index) => {
|
|
14806
15192
|
const newUris = value.filter((_, i) => i !== index);
|
|
14807
15193
|
onChange(newUris.length > 0 ? newUris : [""]);
|
|
14808
15194
|
},
|
|
14809
15195
|
[value, onChange]
|
|
14810
15196
|
);
|
|
14811
|
-
const handleChange =
|
|
15197
|
+
const handleChange = useCallback26(
|
|
14812
15198
|
(index, newValue) => {
|
|
14813
15199
|
const newUris = [...value];
|
|
14814
15200
|
newUris[index] = newValue;
|
|
@@ -14816,17 +15202,17 @@ function OAuthRedirectUriInput({
|
|
|
14816
15202
|
},
|
|
14817
15203
|
[value, onChange]
|
|
14818
15204
|
);
|
|
14819
|
-
return /* @__PURE__ */
|
|
14820
|
-
/* @__PURE__ */
|
|
15205
|
+
return /* @__PURE__ */ jsxs110("div", { className: "space-y-2", children: [
|
|
15206
|
+
/* @__PURE__ */ jsxs110(Label, { children: [
|
|
14821
15207
|
label,
|
|
14822
15208
|
" *"
|
|
14823
15209
|
] }),
|
|
14824
|
-
/* @__PURE__ */
|
|
14825
|
-
/* @__PURE__ */
|
|
15210
|
+
/* @__PURE__ */ jsx180("p", { className: "text-sm text-muted-foreground", children: "Enter the URIs where users will be redirected after authorization. Use https:// for production, or custom schemes for mobile apps." }),
|
|
15211
|
+
/* @__PURE__ */ jsx180("div", { className: "space-y-2", children: value.map((uri, index) => {
|
|
14826
15212
|
const isValid3 = !uri || isValidRedirectUri(uri);
|
|
14827
|
-
return /* @__PURE__ */
|
|
14828
|
-
/* @__PURE__ */
|
|
14829
|
-
/* @__PURE__ */
|
|
15213
|
+
return /* @__PURE__ */ jsxs110("div", { className: "flex gap-2", children: [
|
|
15214
|
+
/* @__PURE__ */ jsxs110("div", { className: "flex-1", children: [
|
|
15215
|
+
/* @__PURE__ */ jsx180(
|
|
14830
15216
|
Input,
|
|
14831
15217
|
{
|
|
14832
15218
|
value: uri,
|
|
@@ -14836,9 +15222,9 @@ function OAuthRedirectUriInput({
|
|
|
14836
15222
|
className: !isValid3 ? "border-destructive" : ""
|
|
14837
15223
|
}
|
|
14838
15224
|
),
|
|
14839
|
-
!isValid3 && /* @__PURE__ */
|
|
15225
|
+
!isValid3 && /* @__PURE__ */ jsx180("p", { className: "text-xs text-destructive mt-1", children: "Must be https://, http://localhost, or a custom scheme (app://)" })
|
|
14840
15226
|
] }),
|
|
14841
|
-
/* @__PURE__ */
|
|
15227
|
+
/* @__PURE__ */ jsx180(
|
|
14842
15228
|
Button,
|
|
14843
15229
|
{
|
|
14844
15230
|
type: "button",
|
|
@@ -14847,23 +15233,23 @@ function OAuthRedirectUriInput({
|
|
|
14847
15233
|
onClick: () => handleRemove(index),
|
|
14848
15234
|
disabled: disabled || value.length === 1,
|
|
14849
15235
|
title: "Remove URI",
|
|
14850
|
-
children: /* @__PURE__ */
|
|
15236
|
+
children: /* @__PURE__ */ jsx180(Trash23, { className: "h-4 w-4" })
|
|
14851
15237
|
}
|
|
14852
15238
|
)
|
|
14853
15239
|
] }, index);
|
|
14854
15240
|
}) }),
|
|
14855
|
-
/* @__PURE__ */
|
|
14856
|
-
/* @__PURE__ */
|
|
15241
|
+
/* @__PURE__ */ jsxs110(Button, { type: "button", variant: "outline", size: "sm", onClick: handleAdd, disabled, className: "mt-2", children: [
|
|
15242
|
+
/* @__PURE__ */ jsx180(Plus, { className: "h-4 w-4 mr-2" }),
|
|
14857
15243
|
"Add Redirect URI"
|
|
14858
15244
|
] }),
|
|
14859
|
-
error && /* @__PURE__ */
|
|
15245
|
+
error && /* @__PURE__ */ jsx180("p", { className: "text-sm text-destructive", children: error })
|
|
14860
15246
|
] });
|
|
14861
15247
|
}
|
|
14862
15248
|
__name(OAuthRedirectUriInput, "OAuthRedirectUriInput");
|
|
14863
15249
|
|
|
14864
15250
|
// src/features/oauth/components/OAuthScopeSelector.tsx
|
|
14865
|
-
import { useCallback as
|
|
14866
|
-
import { jsx as
|
|
15251
|
+
import { useCallback as useCallback27 } from "react";
|
|
15252
|
+
import { jsx as jsx181, jsxs as jsxs111 } from "react/jsx-runtime";
|
|
14867
15253
|
function OAuthScopeSelector({
|
|
14868
15254
|
value,
|
|
14869
15255
|
onChange,
|
|
@@ -14872,7 +15258,7 @@ function OAuthScopeSelector({
|
|
|
14872
15258
|
error,
|
|
14873
15259
|
label = "Allowed Scopes"
|
|
14874
15260
|
}) {
|
|
14875
|
-
const handleToggle =
|
|
15261
|
+
const handleToggle = useCallback27(
|
|
14876
15262
|
(scope, checked) => {
|
|
14877
15263
|
if (checked) {
|
|
14878
15264
|
onChange([...value, scope]);
|
|
@@ -14894,25 +15280,25 @@ function OAuthScopeSelector({
|
|
|
14894
15280
|
},
|
|
14895
15281
|
{}
|
|
14896
15282
|
);
|
|
14897
|
-
return /* @__PURE__ */
|
|
14898
|
-
/* @__PURE__ */
|
|
14899
|
-
/* @__PURE__ */
|
|
15283
|
+
return /* @__PURE__ */ jsxs111("div", { className: "space-y-4", children: [
|
|
15284
|
+
/* @__PURE__ */ jsxs111("div", { children: [
|
|
15285
|
+
/* @__PURE__ */ jsxs111(Label, { children: [
|
|
14900
15286
|
label,
|
|
14901
15287
|
" *"
|
|
14902
15288
|
] }),
|
|
14903
|
-
/* @__PURE__ */
|
|
15289
|
+
/* @__PURE__ */ jsx181("p", { className: "text-sm text-muted-foreground", children: "Select the permissions your application needs." })
|
|
14904
15290
|
] }),
|
|
14905
|
-
/* @__PURE__ */
|
|
14906
|
-
/* @__PURE__ */
|
|
14907
|
-
/* @__PURE__ */
|
|
15291
|
+
/* @__PURE__ */ jsx181("div", { className: "space-y-4", children: Object.entries(groupedScopes).map(([groupName, scopes]) => /* @__PURE__ */ jsxs111("div", { className: "space-y-2", children: [
|
|
15292
|
+
/* @__PURE__ */ jsx181("h4", { className: "text-sm font-medium capitalize", children: groupName }),
|
|
15293
|
+
/* @__PURE__ */ jsx181("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-2 pl-2", children: scopes.map((scopeInfo) => {
|
|
14908
15294
|
const isChecked = value.includes(scopeInfo.scope);
|
|
14909
15295
|
const isAdmin = scopeInfo.scope === "admin";
|
|
14910
|
-
return /* @__PURE__ */
|
|
15296
|
+
return /* @__PURE__ */ jsxs111(
|
|
14911
15297
|
"div",
|
|
14912
15298
|
{
|
|
14913
15299
|
className: `flex items-start space-x-3 p-2 rounded-md border ${isChecked ? "bg-primary/5 border-primary/20" : "border-transparent"} ${isAdmin ? "bg-destructive/5" : ""}`,
|
|
14914
15300
|
children: [
|
|
14915
|
-
/* @__PURE__ */
|
|
15301
|
+
/* @__PURE__ */ jsx181(
|
|
14916
15302
|
Checkbox,
|
|
14917
15303
|
{
|
|
14918
15304
|
id: `scope-${scopeInfo.scope}`,
|
|
@@ -14921,12 +15307,12 @@ function OAuthScopeSelector({
|
|
|
14921
15307
|
disabled
|
|
14922
15308
|
}
|
|
14923
15309
|
),
|
|
14924
|
-
/* @__PURE__ */
|
|
14925
|
-
/* @__PURE__ */
|
|
15310
|
+
/* @__PURE__ */ jsxs111("div", { className: "flex-1", children: [
|
|
15311
|
+
/* @__PURE__ */ jsxs111(Label, { htmlFor: `scope-${scopeInfo.scope}`, className: "text-sm font-medium cursor-pointer", children: [
|
|
14926
15312
|
scopeInfo.name,
|
|
14927
|
-
isAdmin && /* @__PURE__ */
|
|
15313
|
+
isAdmin && /* @__PURE__ */ jsx181("span", { className: "ml-2 text-xs text-destructive", children: "(Dangerous)" })
|
|
14928
15314
|
] }),
|
|
14929
|
-
/* @__PURE__ */
|
|
15315
|
+
/* @__PURE__ */ jsx181("p", { className: "text-xs text-muted-foreground", children: scopeInfo.description })
|
|
14930
15316
|
] })
|
|
14931
15317
|
]
|
|
14932
15318
|
},
|
|
@@ -14934,18 +15320,18 @@ function OAuthScopeSelector({
|
|
|
14934
15320
|
);
|
|
14935
15321
|
}) })
|
|
14936
15322
|
] }, groupName)) }),
|
|
14937
|
-
error && /* @__PURE__ */
|
|
15323
|
+
error && /* @__PURE__ */ jsx181("p", { className: "text-sm text-destructive", children: error })
|
|
14938
15324
|
] });
|
|
14939
15325
|
}
|
|
14940
15326
|
__name(OAuthScopeSelector, "OAuthScopeSelector");
|
|
14941
15327
|
|
|
14942
15328
|
// src/features/oauth/components/OAuthClientSecretDisplay.tsx
|
|
14943
|
-
import { useState as
|
|
14944
|
-
import { Copy as
|
|
14945
|
-
import { jsx as
|
|
15329
|
+
import { useState as useState70, useCallback as useCallback28 } from "react";
|
|
15330
|
+
import { Copy as Copy3, Check, AlertTriangle } from "lucide-react";
|
|
15331
|
+
import { jsx as jsx182, jsxs as jsxs112 } from "react/jsx-runtime";
|
|
14946
15332
|
function OAuthClientSecretDisplay({ secret, onDismiss, open, clientName }) {
|
|
14947
|
-
const [copied, setCopied] =
|
|
14948
|
-
const handleCopy =
|
|
15333
|
+
const [copied, setCopied] = useState70(false);
|
|
15334
|
+
const handleCopy = useCallback28(async () => {
|
|
14949
15335
|
try {
|
|
14950
15336
|
await navigator.clipboard.writeText(secret);
|
|
14951
15337
|
setCopied(true);
|
|
@@ -14954,29 +15340,29 @@ function OAuthClientSecretDisplay({ secret, onDismiss, open, clientName }) {
|
|
|
14954
15340
|
console.error("Failed to copy to clipboard:", err);
|
|
14955
15341
|
}
|
|
14956
15342
|
}, [secret]);
|
|
14957
|
-
const handleDismiss =
|
|
15343
|
+
const handleDismiss = useCallback28(() => {
|
|
14958
15344
|
setCopied(false);
|
|
14959
15345
|
onDismiss();
|
|
14960
15346
|
}, [onDismiss]);
|
|
14961
|
-
return /* @__PURE__ */
|
|
14962
|
-
/* @__PURE__ */
|
|
14963
|
-
/* @__PURE__ */
|
|
14964
|
-
/* @__PURE__ */
|
|
15347
|
+
return /* @__PURE__ */ jsx182(Dialog, { open, onOpenChange: (isOpen) => !isOpen && handleDismiss(), children: /* @__PURE__ */ jsxs112(DialogContent, { className: "sm:max-w-md", children: [
|
|
15348
|
+
/* @__PURE__ */ jsxs112(DialogHeader, { children: [
|
|
15349
|
+
/* @__PURE__ */ jsxs112(DialogTitle, { className: "flex items-center gap-2", children: [
|
|
15350
|
+
/* @__PURE__ */ jsx182(AlertTriangle, { className: "h-5 w-5 text-warning" }),
|
|
14965
15351
|
"Save Your Client Secret"
|
|
14966
15352
|
] }),
|
|
14967
|
-
/* @__PURE__ */
|
|
15353
|
+
/* @__PURE__ */ jsx182(DialogDescription, { children: clientName ? `Your client secret for "${clientName}" is shown below.` : "Your client secret is shown below." })
|
|
14968
15354
|
] }),
|
|
14969
|
-
/* @__PURE__ */
|
|
14970
|
-
/* @__PURE__ */
|
|
14971
|
-
/* @__PURE__ */
|
|
14972
|
-
/* @__PURE__ */
|
|
14973
|
-
/* @__PURE__ */
|
|
15355
|
+
/* @__PURE__ */ jsxs112(Alert, { variant: "destructive", className: "my-4", children: [
|
|
15356
|
+
/* @__PURE__ */ jsx182(AlertTriangle, { className: "h-4 w-4" }),
|
|
15357
|
+
/* @__PURE__ */ jsxs112(AlertDescription, { children: [
|
|
15358
|
+
/* @__PURE__ */ jsx182("strong", { children: "This is the only time your client secret will be displayed." }),
|
|
15359
|
+
/* @__PURE__ */ jsx182("br", {}),
|
|
14974
15360
|
"Copy it now and store it securely. You will not be able to retrieve it later."
|
|
14975
15361
|
] })
|
|
14976
15362
|
] }),
|
|
14977
|
-
/* @__PURE__ */
|
|
14978
|
-
/* @__PURE__ */
|
|
14979
|
-
/* @__PURE__ */
|
|
15363
|
+
/* @__PURE__ */ jsxs112("div", { className: "flex items-center space-x-2", children: [
|
|
15364
|
+
/* @__PURE__ */ jsx182("div", { className: "flex-1", children: /* @__PURE__ */ jsx182(Input, { value: secret, readOnly: true, className: "font-mono text-sm", onClick: (e) => e.currentTarget.select() }) }),
|
|
15365
|
+
/* @__PURE__ */ jsx182(
|
|
14980
15366
|
Button,
|
|
14981
15367
|
{
|
|
14982
15368
|
type: "button",
|
|
@@ -14984,12 +15370,12 @@ function OAuthClientSecretDisplay({ secret, onDismiss, open, clientName }) {
|
|
|
14984
15370
|
size: "icon",
|
|
14985
15371
|
onClick: handleCopy,
|
|
14986
15372
|
title: copied ? "Copied!" : "Copy to clipboard",
|
|
14987
|
-
children: copied ? /* @__PURE__ */
|
|
15373
|
+
children: copied ? /* @__PURE__ */ jsx182(Check, { className: "h-4 w-4 text-green-600" }) : /* @__PURE__ */ jsx182(Copy3, { className: "h-4 w-4" })
|
|
14988
15374
|
}
|
|
14989
15375
|
)
|
|
14990
15376
|
] }),
|
|
14991
|
-
copied && /* @__PURE__ */
|
|
14992
|
-
/* @__PURE__ */
|
|
15377
|
+
copied && /* @__PURE__ */ jsx182("p", { className: "text-sm text-green-600 text-center", children: "Copied to clipboard!" }),
|
|
15378
|
+
/* @__PURE__ */ jsx182(DialogFooter, { className: "mt-4", children: /* @__PURE__ */ jsx182(Button, { onClick: handleDismiss, className: "w-full", children: "I've Saved My Secret" }) })
|
|
14993
15379
|
] }) });
|
|
14994
15380
|
}
|
|
14995
15381
|
__name(OAuthClientSecretDisplay, "OAuthClientSecretDisplay");
|
|
@@ -14997,28 +15383,28 @@ __name(OAuthClientSecretDisplay, "OAuthClientSecretDisplay");
|
|
|
14997
15383
|
// src/features/oauth/components/OAuthClientCard.tsx
|
|
14998
15384
|
import { formatDistanceToNow } from "date-fns";
|
|
14999
15385
|
import { Key as Key2, MoreVertical, Pencil, Trash2 as Trash24 } from "lucide-react";
|
|
15000
|
-
import { jsx as
|
|
15386
|
+
import { jsx as jsx183, jsxs as jsxs113 } from "react/jsx-runtime";
|
|
15001
15387
|
function OAuthClientCard({ client, onClick, onEdit, onDelete }) {
|
|
15002
15388
|
const truncatedId = client.clientId.length > 12 ? `${client.clientId.slice(0, 8)}...${client.clientId.slice(-4)}` : client.clientId;
|
|
15003
15389
|
const createdAgo = client.createdAt ? formatDistanceToNow(new Date(client.createdAt), { addSuffix: true }) : "Unknown";
|
|
15004
|
-
return /* @__PURE__ */
|
|
15390
|
+
return /* @__PURE__ */ jsxs113(
|
|
15005
15391
|
Card,
|
|
15006
15392
|
{
|
|
15007
15393
|
className: `cursor-pointer transition-colors hover:bg-accent/50 ${!client.isActive ? "opacity-60" : ""}`,
|
|
15008
15394
|
onClick,
|
|
15009
15395
|
children: [
|
|
15010
|
-
/* @__PURE__ */
|
|
15011
|
-
/* @__PURE__ */
|
|
15012
|
-
/* @__PURE__ */
|
|
15013
|
-
/* @__PURE__ */
|
|
15014
|
-
/* @__PURE__ */
|
|
15396
|
+
/* @__PURE__ */ jsxs113(CardHeader, { className: "pb-2", children: [
|
|
15397
|
+
/* @__PURE__ */ jsxs113("div", { className: "flex items-start justify-between", children: [
|
|
15398
|
+
/* @__PURE__ */ jsxs113("div", { className: "flex items-center gap-2", children: [
|
|
15399
|
+
/* @__PURE__ */ jsx183(Key2, { className: "h-5 w-5 text-muted-foreground" }),
|
|
15400
|
+
/* @__PURE__ */ jsx183(CardTitle, { className: "text-lg", children: client.name })
|
|
15015
15401
|
] }),
|
|
15016
|
-
/* @__PURE__ */
|
|
15017
|
-
/* @__PURE__ */
|
|
15018
|
-
(onEdit || onDelete) && /* @__PURE__ */
|
|
15019
|
-
/* @__PURE__ */
|
|
15020
|
-
/* @__PURE__ */
|
|
15021
|
-
onEdit && /* @__PURE__ */
|
|
15402
|
+
/* @__PURE__ */ jsxs113("div", { className: "flex items-center gap-2", children: [
|
|
15403
|
+
/* @__PURE__ */ jsx183(Badge, { variant: client.isActive ? "default" : "secondary", children: client.isActive ? "Active" : "Inactive" }),
|
|
15404
|
+
(onEdit || onDelete) && /* @__PURE__ */ jsxs113(DropdownMenu, { children: [
|
|
15405
|
+
/* @__PURE__ */ jsx183(DropdownMenuTrigger, { onClick: (e) => e.stopPropagation(), children: /* @__PURE__ */ jsx183(Button, { render: /* @__PURE__ */ jsx183("div", {}), nativeButton: false, variant: "ghost", size: "icon", className: "h-8 w-8", children: /* @__PURE__ */ jsx183(MoreVertical, { className: "h-4 w-4" }) }) }),
|
|
15406
|
+
/* @__PURE__ */ jsxs113(DropdownMenuContent, { align: "end", children: [
|
|
15407
|
+
onEdit && /* @__PURE__ */ jsxs113(
|
|
15022
15408
|
DropdownMenuItem,
|
|
15023
15409
|
{
|
|
15024
15410
|
onClick: (e) => {
|
|
@@ -15026,12 +15412,12 @@ function OAuthClientCard({ client, onClick, onEdit, onDelete }) {
|
|
|
15026
15412
|
onEdit();
|
|
15027
15413
|
},
|
|
15028
15414
|
children: [
|
|
15029
|
-
/* @__PURE__ */
|
|
15415
|
+
/* @__PURE__ */ jsx183(Pencil, { className: "h-4 w-4 mr-2" }),
|
|
15030
15416
|
"Edit"
|
|
15031
15417
|
]
|
|
15032
15418
|
}
|
|
15033
15419
|
),
|
|
15034
|
-
onDelete && /* @__PURE__ */
|
|
15420
|
+
onDelete && /* @__PURE__ */ jsxs113(
|
|
15035
15421
|
DropdownMenuItem,
|
|
15036
15422
|
{
|
|
15037
15423
|
onClick: (e) => {
|
|
@@ -15040,7 +15426,7 @@ function OAuthClientCard({ client, onClick, onEdit, onDelete }) {
|
|
|
15040
15426
|
},
|
|
15041
15427
|
className: "text-destructive",
|
|
15042
15428
|
children: [
|
|
15043
|
-
/* @__PURE__ */
|
|
15429
|
+
/* @__PURE__ */ jsx183(Trash24, { className: "h-4 w-4 mr-2" }),
|
|
15044
15430
|
"Delete"
|
|
15045
15431
|
]
|
|
15046
15432
|
}
|
|
@@ -15049,15 +15435,15 @@ function OAuthClientCard({ client, onClick, onEdit, onDelete }) {
|
|
|
15049
15435
|
] })
|
|
15050
15436
|
] })
|
|
15051
15437
|
] }),
|
|
15052
|
-
client.description && /* @__PURE__ */
|
|
15438
|
+
client.description && /* @__PURE__ */ jsx183(CardDescription, { className: "line-clamp-2", children: client.description })
|
|
15053
15439
|
] }),
|
|
15054
|
-
/* @__PURE__ */
|
|
15055
|
-
/* @__PURE__ */
|
|
15056
|
-
/* @__PURE__ */
|
|
15440
|
+
/* @__PURE__ */ jsx183(CardContent, { children: /* @__PURE__ */ jsxs113("div", { className: "flex flex-wrap gap-x-4 gap-y-1 text-sm text-muted-foreground", children: [
|
|
15441
|
+
/* @__PURE__ */ jsx183("span", { className: "font-mono", children: truncatedId }),
|
|
15442
|
+
/* @__PURE__ */ jsxs113("span", { children: [
|
|
15057
15443
|
"Created ",
|
|
15058
15444
|
createdAgo
|
|
15059
15445
|
] }),
|
|
15060
|
-
/* @__PURE__ */
|
|
15446
|
+
/* @__PURE__ */ jsx183("span", { children: client.isConfidential ? "Confidential" : "Public" })
|
|
15061
15447
|
] }) })
|
|
15062
15448
|
]
|
|
15063
15449
|
}
|
|
@@ -15067,7 +15453,7 @@ __name(OAuthClientCard, "OAuthClientCard");
|
|
|
15067
15453
|
|
|
15068
15454
|
// src/features/oauth/components/OAuthClientList.tsx
|
|
15069
15455
|
import { Plus as Plus2, Key as Key3 } from "lucide-react";
|
|
15070
|
-
import { jsx as
|
|
15456
|
+
import { jsx as jsx184, jsxs as jsxs114 } from "react/jsx-runtime";
|
|
15071
15457
|
function OAuthClientList({
|
|
15072
15458
|
clients,
|
|
15073
15459
|
isLoading = false,
|
|
@@ -15080,49 +15466,49 @@ function OAuthClientList({
|
|
|
15080
15466
|
title = "OAuth Applications"
|
|
15081
15467
|
}) {
|
|
15082
15468
|
if (isLoading && clients.length === 0) {
|
|
15083
|
-
return /* @__PURE__ */
|
|
15084
|
-
/* @__PURE__ */
|
|
15085
|
-
/* @__PURE__ */
|
|
15086
|
-
/* @__PURE__ */
|
|
15469
|
+
return /* @__PURE__ */ jsxs114("div", { className: "space-y-4", children: [
|
|
15470
|
+
/* @__PURE__ */ jsxs114("div", { className: "flex items-center justify-between", children: [
|
|
15471
|
+
/* @__PURE__ */ jsx184("h2", { className: "text-2xl font-bold", children: title }),
|
|
15472
|
+
/* @__PURE__ */ jsx184(Skeleton, { className: "h-10 w-32" })
|
|
15087
15473
|
] }),
|
|
15088
|
-
/* @__PURE__ */
|
|
15474
|
+
/* @__PURE__ */ jsx184("div", { className: "space-y-3", children: [1, 2, 3].map((i) => /* @__PURE__ */ jsx184(Skeleton, { className: "h-32 w-full" }, i)) })
|
|
15089
15475
|
] });
|
|
15090
15476
|
}
|
|
15091
15477
|
if (error) {
|
|
15092
|
-
return /* @__PURE__ */
|
|
15093
|
-
/* @__PURE__ */
|
|
15094
|
-
/* @__PURE__ */
|
|
15478
|
+
return /* @__PURE__ */ jsxs114("div", { className: "space-y-4", children: [
|
|
15479
|
+
/* @__PURE__ */ jsx184("div", { className: "flex items-center justify-between", children: /* @__PURE__ */ jsx184("h2", { className: "text-2xl font-bold", children: title }) }),
|
|
15480
|
+
/* @__PURE__ */ jsx184("div", { className: "rounded-lg border border-destructive/50 bg-destructive/10 p-6 text-center", children: /* @__PURE__ */ jsx184("p", { className: "text-destructive", children: error.message }) })
|
|
15095
15481
|
] });
|
|
15096
15482
|
}
|
|
15097
15483
|
if (clients.length === 0) {
|
|
15098
|
-
return /* @__PURE__ */
|
|
15099
|
-
/* @__PURE__ */
|
|
15100
|
-
/* @__PURE__ */
|
|
15101
|
-
onCreateClick && /* @__PURE__ */
|
|
15102
|
-
/* @__PURE__ */
|
|
15484
|
+
return /* @__PURE__ */ jsxs114("div", { className: "space-y-4", children: [
|
|
15485
|
+
/* @__PURE__ */ jsxs114("div", { className: "flex items-center justify-between", children: [
|
|
15486
|
+
/* @__PURE__ */ jsx184("h2", { className: "text-2xl font-bold", children: title }),
|
|
15487
|
+
onCreateClick && /* @__PURE__ */ jsxs114(Button, { onClick: onCreateClick, children: [
|
|
15488
|
+
/* @__PURE__ */ jsx184(Plus2, { className: "h-4 w-4 mr-2" }),
|
|
15103
15489
|
"New App"
|
|
15104
15490
|
] })
|
|
15105
15491
|
] }),
|
|
15106
|
-
/* @__PURE__ */
|
|
15107
|
-
/* @__PURE__ */
|
|
15108
|
-
/* @__PURE__ */
|
|
15109
|
-
/* @__PURE__ */
|
|
15110
|
-
onCreateClick && /* @__PURE__ */
|
|
15111
|
-
/* @__PURE__ */
|
|
15492
|
+
/* @__PURE__ */ jsxs114("div", { className: "rounded-lg border border-dashed p-12 text-center", children: [
|
|
15493
|
+
/* @__PURE__ */ jsx184(Key3, { className: "h-12 w-12 mx-auto text-muted-foreground mb-4" }),
|
|
15494
|
+
/* @__PURE__ */ jsx184("h3", { className: "text-lg font-medium mb-2", children: "No OAuth Applications" }),
|
|
15495
|
+
/* @__PURE__ */ jsx184("p", { className: "text-muted-foreground mb-4", children: emptyStateMessage }),
|
|
15496
|
+
onCreateClick && /* @__PURE__ */ jsxs114(Button, { onClick: onCreateClick, children: [
|
|
15497
|
+
/* @__PURE__ */ jsx184(Plus2, { className: "h-4 w-4 mr-2" }),
|
|
15112
15498
|
"Create Application"
|
|
15113
15499
|
] })
|
|
15114
15500
|
] })
|
|
15115
15501
|
] });
|
|
15116
15502
|
}
|
|
15117
|
-
return /* @__PURE__ */
|
|
15118
|
-
/* @__PURE__ */
|
|
15119
|
-
/* @__PURE__ */
|
|
15120
|
-
onCreateClick && /* @__PURE__ */
|
|
15121
|
-
/* @__PURE__ */
|
|
15503
|
+
return /* @__PURE__ */ jsxs114("div", { className: "space-y-4", children: [
|
|
15504
|
+
/* @__PURE__ */ jsxs114("div", { className: "flex items-center justify-between", children: [
|
|
15505
|
+
/* @__PURE__ */ jsx184("h2", { className: "text-2xl font-bold", children: title }),
|
|
15506
|
+
onCreateClick && /* @__PURE__ */ jsxs114(Button, { onClick: onCreateClick, children: [
|
|
15507
|
+
/* @__PURE__ */ jsx184(Plus2, { className: "h-4 w-4 mr-2" }),
|
|
15122
15508
|
"New App"
|
|
15123
15509
|
] })
|
|
15124
15510
|
] }),
|
|
15125
|
-
/* @__PURE__ */
|
|
15511
|
+
/* @__PURE__ */ jsx184("div", { className: "space-y-3", children: clients.map((client) => /* @__PURE__ */ jsx184(
|
|
15126
15512
|
OAuthClientCard,
|
|
15127
15513
|
{
|
|
15128
15514
|
client,
|
|
@@ -15137,19 +15523,19 @@ function OAuthClientList({
|
|
|
15137
15523
|
__name(OAuthClientList, "OAuthClientList");
|
|
15138
15524
|
|
|
15139
15525
|
// src/features/oauth/components/OAuthClientForm.tsx
|
|
15140
|
-
import { useState as
|
|
15141
|
-
import { jsx as
|
|
15526
|
+
import { useState as useState71, useCallback as useCallback29 } from "react";
|
|
15527
|
+
import { jsx as jsx185, jsxs as jsxs115 } from "react/jsx-runtime";
|
|
15142
15528
|
function OAuthClientForm({ client, onSubmit, onCancel, isLoading = false }) {
|
|
15143
15529
|
const isEditMode = !!client;
|
|
15144
|
-
const [formState, setFormState] =
|
|
15530
|
+
const [formState, setFormState] = useState71({
|
|
15145
15531
|
name: client?.name || "",
|
|
15146
15532
|
description: client?.description || "",
|
|
15147
15533
|
redirectUris: client?.redirectUris?.length ? client.redirectUris : [""],
|
|
15148
15534
|
allowedScopes: client?.allowedScopes || [],
|
|
15149
15535
|
isConfidential: client?.isConfidential ?? true
|
|
15150
15536
|
});
|
|
15151
|
-
const [errors, setErrors] =
|
|
15152
|
-
const validate =
|
|
15537
|
+
const [errors, setErrors] = useState71({});
|
|
15538
|
+
const validate = useCallback29(() => {
|
|
15153
15539
|
const newErrors = {};
|
|
15154
15540
|
if (!formState.name.trim()) {
|
|
15155
15541
|
newErrors.name = "Application name is required";
|
|
@@ -15164,7 +15550,7 @@ function OAuthClientForm({ client, onSubmit, onCancel, isLoading = false }) {
|
|
|
15164
15550
|
setErrors(newErrors);
|
|
15165
15551
|
return Object.keys(newErrors).length === 0;
|
|
15166
15552
|
}, [formState]);
|
|
15167
|
-
const handleSubmit =
|
|
15553
|
+
const handleSubmit = useCallback29(
|
|
15168
15554
|
async (e) => {
|
|
15169
15555
|
e.preventDefault();
|
|
15170
15556
|
if (!validate()) return;
|
|
@@ -15180,15 +15566,15 @@ function OAuthClientForm({ client, onSubmit, onCancel, isLoading = false }) {
|
|
|
15180
15566
|
},
|
|
15181
15567
|
[formState, validate, onSubmit]
|
|
15182
15568
|
);
|
|
15183
|
-
return /* @__PURE__ */
|
|
15184
|
-
/* @__PURE__ */
|
|
15185
|
-
/* @__PURE__ */
|
|
15186
|
-
/* @__PURE__ */
|
|
15569
|
+
return /* @__PURE__ */ jsx185(Card, { children: /* @__PURE__ */ jsxs115("form", { onSubmit: handleSubmit, children: [
|
|
15570
|
+
/* @__PURE__ */ jsxs115(CardHeader, { children: [
|
|
15571
|
+
/* @__PURE__ */ jsx185(CardTitle, { children: isEditMode ? "Edit Application" : "Create OAuth Application" }),
|
|
15572
|
+
/* @__PURE__ */ jsx185(CardDescription, { children: isEditMode ? "Update your OAuth application settings." : "Register a new application to access the API." })
|
|
15187
15573
|
] }),
|
|
15188
|
-
/* @__PURE__ */
|
|
15189
|
-
/* @__PURE__ */
|
|
15190
|
-
/* @__PURE__ */
|
|
15191
|
-
/* @__PURE__ */
|
|
15574
|
+
/* @__PURE__ */ jsxs115(CardContent, { className: "space-y-6", children: [
|
|
15575
|
+
/* @__PURE__ */ jsxs115("div", { className: "space-y-2", children: [
|
|
15576
|
+
/* @__PURE__ */ jsx185(Label, { htmlFor: "name", children: "Application Name *" }),
|
|
15577
|
+
/* @__PURE__ */ jsx185(
|
|
15192
15578
|
Input,
|
|
15193
15579
|
{
|
|
15194
15580
|
id: "name",
|
|
@@ -15199,11 +15585,11 @@ function OAuthClientForm({ client, onSubmit, onCancel, isLoading = false }) {
|
|
|
15199
15585
|
className: errors.name ? "border-destructive" : ""
|
|
15200
15586
|
}
|
|
15201
15587
|
),
|
|
15202
|
-
errors.name && /* @__PURE__ */
|
|
15588
|
+
errors.name && /* @__PURE__ */ jsx185("p", { className: "text-sm text-destructive", children: errors.name })
|
|
15203
15589
|
] }),
|
|
15204
|
-
/* @__PURE__ */
|
|
15205
|
-
/* @__PURE__ */
|
|
15206
|
-
/* @__PURE__ */
|
|
15590
|
+
/* @__PURE__ */ jsxs115("div", { className: "space-y-2", children: [
|
|
15591
|
+
/* @__PURE__ */ jsx185(Label, { htmlFor: "description", children: "Description" }),
|
|
15592
|
+
/* @__PURE__ */ jsx185(
|
|
15207
15593
|
Textarea,
|
|
15208
15594
|
{
|
|
15209
15595
|
id: "description",
|
|
@@ -15215,7 +15601,7 @@ function OAuthClientForm({ client, onSubmit, onCancel, isLoading = false }) {
|
|
|
15215
15601
|
}
|
|
15216
15602
|
)
|
|
15217
15603
|
] }),
|
|
15218
|
-
/* @__PURE__ */
|
|
15604
|
+
/* @__PURE__ */ jsx185(
|
|
15219
15605
|
OAuthRedirectUriInput,
|
|
15220
15606
|
{
|
|
15221
15607
|
value: formState.redirectUris,
|
|
@@ -15224,7 +15610,7 @@ function OAuthClientForm({ client, onSubmit, onCancel, isLoading = false }) {
|
|
|
15224
15610
|
disabled: isLoading
|
|
15225
15611
|
}
|
|
15226
15612
|
),
|
|
15227
|
-
/* @__PURE__ */
|
|
15613
|
+
/* @__PURE__ */ jsx185(
|
|
15228
15614
|
OAuthScopeSelector,
|
|
15229
15615
|
{
|
|
15230
15616
|
value: formState.allowedScopes,
|
|
@@ -15233,48 +15619,48 @@ function OAuthClientForm({ client, onSubmit, onCancel, isLoading = false }) {
|
|
|
15233
15619
|
disabled: isLoading
|
|
15234
15620
|
}
|
|
15235
15621
|
),
|
|
15236
|
-
/* @__PURE__ */
|
|
15237
|
-
/* @__PURE__ */
|
|
15238
|
-
/* @__PURE__ */
|
|
15622
|
+
/* @__PURE__ */ jsxs115("div", { className: "space-y-3", children: [
|
|
15623
|
+
/* @__PURE__ */ jsx185(Label, { children: "Client Type" }),
|
|
15624
|
+
/* @__PURE__ */ jsxs115(
|
|
15239
15625
|
RadioGroup,
|
|
15240
15626
|
{
|
|
15241
15627
|
value: formState.isConfidential ? "confidential" : "public",
|
|
15242
15628
|
onValueChange: (v) => setFormState((s) => ({ ...s, isConfidential: v === "confidential" })),
|
|
15243
15629
|
disabled: isLoading || isEditMode,
|
|
15244
15630
|
children: [
|
|
15245
|
-
/* @__PURE__ */
|
|
15246
|
-
/* @__PURE__ */
|
|
15247
|
-
/* @__PURE__ */
|
|
15248
|
-
/* @__PURE__ */
|
|
15249
|
-
/* @__PURE__ */
|
|
15631
|
+
/* @__PURE__ */ jsxs115("div", { className: "flex items-start space-x-3 p-3 rounded-md border", children: [
|
|
15632
|
+
/* @__PURE__ */ jsx185(RadioGroupItem, { value: "confidential", id: "confidential", className: "mt-1" }),
|
|
15633
|
+
/* @__PURE__ */ jsxs115("div", { children: [
|
|
15634
|
+
/* @__PURE__ */ jsx185(Label, { htmlFor: "confidential", className: "font-medium cursor-pointer", children: "Confidential" }),
|
|
15635
|
+
/* @__PURE__ */ jsx185("p", { className: "text-sm text-muted-foreground", children: "Server-side application that can securely store the client secret." })
|
|
15250
15636
|
] })
|
|
15251
15637
|
] }),
|
|
15252
|
-
/* @__PURE__ */
|
|
15253
|
-
/* @__PURE__ */
|
|
15254
|
-
/* @__PURE__ */
|
|
15255
|
-
/* @__PURE__ */
|
|
15256
|
-
/* @__PURE__ */
|
|
15638
|
+
/* @__PURE__ */ jsxs115("div", { className: "flex items-start space-x-3 p-3 rounded-md border", children: [
|
|
15639
|
+
/* @__PURE__ */ jsx185(RadioGroupItem, { value: "public", id: "public", className: "mt-1" }),
|
|
15640
|
+
/* @__PURE__ */ jsxs115("div", { children: [
|
|
15641
|
+
/* @__PURE__ */ jsx185(Label, { htmlFor: "public", className: "font-medium cursor-pointer", children: "Public" }),
|
|
15642
|
+
/* @__PURE__ */ jsx185("p", { className: "text-sm text-muted-foreground", children: "Mobile or desktop application. Requires PKCE for authorization." })
|
|
15257
15643
|
] })
|
|
15258
15644
|
] })
|
|
15259
15645
|
]
|
|
15260
15646
|
}
|
|
15261
15647
|
),
|
|
15262
|
-
isEditMode && /* @__PURE__ */
|
|
15648
|
+
isEditMode && /* @__PURE__ */ jsx185("p", { className: "text-sm text-muted-foreground", children: "Client type cannot be changed after creation." })
|
|
15263
15649
|
] })
|
|
15264
15650
|
] }),
|
|
15265
|
-
/* @__PURE__ */
|
|
15266
|
-
/* @__PURE__ */
|
|
15267
|
-
/* @__PURE__ */
|
|
15651
|
+
/* @__PURE__ */ jsxs115(CardFooter, { className: "flex justify-end gap-3", children: [
|
|
15652
|
+
/* @__PURE__ */ jsx185(Button, { type: "button", variant: "outline", onClick: onCancel, disabled: isLoading, children: "Cancel" }),
|
|
15653
|
+
/* @__PURE__ */ jsx185(Button, { type: "submit", disabled: isLoading, children: isLoading ? "Saving..." : isEditMode ? "Save Changes" : "Create Application" })
|
|
15268
15654
|
] })
|
|
15269
15655
|
] }) });
|
|
15270
15656
|
}
|
|
15271
15657
|
__name(OAuthClientForm, "OAuthClientForm");
|
|
15272
15658
|
|
|
15273
15659
|
// src/features/oauth/components/OAuthClientDetail.tsx
|
|
15274
|
-
import { useState as
|
|
15660
|
+
import { useState as useState72, useCallback as useCallback30 } from "react";
|
|
15275
15661
|
import { format as format2 } from "date-fns";
|
|
15276
|
-
import { Copy as
|
|
15277
|
-
import { Fragment as Fragment38, jsx as
|
|
15662
|
+
import { Copy as Copy4, Check as Check2, RefreshCw as RefreshCw3, Pencil as Pencil2, Trash2 as Trash25, ExternalLink } from "lucide-react";
|
|
15663
|
+
import { Fragment as Fragment38, jsx as jsx186, jsxs as jsxs116 } from "react/jsx-runtime";
|
|
15278
15664
|
function OAuthClientDetail({
|
|
15279
15665
|
client,
|
|
15280
15666
|
isLoading = false,
|
|
@@ -15282,12 +15668,12 @@ function OAuthClientDetail({
|
|
|
15282
15668
|
onDelete,
|
|
15283
15669
|
onRegenerateSecret
|
|
15284
15670
|
}) {
|
|
15285
|
-
const [copiedField, setCopiedField] =
|
|
15286
|
-
const [showDeleteConfirm, setShowDeleteConfirm] =
|
|
15287
|
-
const [showRegenerateConfirm, setShowRegenerateConfirm] =
|
|
15288
|
-
const [isDeleting, setIsDeleting] =
|
|
15289
|
-
const [isRegenerating, setIsRegenerating] =
|
|
15290
|
-
const
|
|
15671
|
+
const [copiedField, setCopiedField] = useState72(null);
|
|
15672
|
+
const [showDeleteConfirm, setShowDeleteConfirm] = useState72(false);
|
|
15673
|
+
const [showRegenerateConfirm, setShowRegenerateConfirm] = useState72(false);
|
|
15674
|
+
const [isDeleting, setIsDeleting] = useState72(false);
|
|
15675
|
+
const [isRegenerating, setIsRegenerating] = useState72(false);
|
|
15676
|
+
const copyToClipboard2 = useCallback30(async (text, field) => {
|
|
15291
15677
|
try {
|
|
15292
15678
|
await navigator.clipboard.writeText(text);
|
|
15293
15679
|
setCopiedField(field);
|
|
@@ -15296,7 +15682,7 @@ function OAuthClientDetail({
|
|
|
15296
15682
|
console.error("Failed to copy:", err);
|
|
15297
15683
|
}
|
|
15298
15684
|
}, []);
|
|
15299
|
-
const handleDelete =
|
|
15685
|
+
const handleDelete = useCallback30(async () => {
|
|
15300
15686
|
if (!onDelete) return;
|
|
15301
15687
|
setIsDeleting(true);
|
|
15302
15688
|
try {
|
|
@@ -15306,7 +15692,7 @@ function OAuthClientDetail({
|
|
|
15306
15692
|
setShowDeleteConfirm(false);
|
|
15307
15693
|
}
|
|
15308
15694
|
}, [onDelete]);
|
|
15309
|
-
const handleRegenerateSecret =
|
|
15695
|
+
const handleRegenerateSecret = useCallback30(async () => {
|
|
15310
15696
|
if (!onRegenerateSecret) return;
|
|
15311
15697
|
setIsRegenerating(true);
|
|
15312
15698
|
try {
|
|
@@ -15317,40 +15703,40 @@ function OAuthClientDetail({
|
|
|
15317
15703
|
}
|
|
15318
15704
|
}, [onRegenerateSecret]);
|
|
15319
15705
|
const createdDate = client.createdAt ? format2(new Date(client.createdAt), "MMMM d, yyyy") : "Unknown";
|
|
15320
|
-
return /* @__PURE__ */
|
|
15321
|
-
/* @__PURE__ */
|
|
15322
|
-
/* @__PURE__ */
|
|
15323
|
-
/* @__PURE__ */
|
|
15324
|
-
/* @__PURE__ */
|
|
15325
|
-
client.description && /* @__PURE__ */
|
|
15706
|
+
return /* @__PURE__ */ jsxs116(Fragment38, { children: [
|
|
15707
|
+
/* @__PURE__ */ jsxs116(Card, { children: [
|
|
15708
|
+
/* @__PURE__ */ jsx186(CardHeader, { children: /* @__PURE__ */ jsxs116("div", { className: "flex items-start justify-between", children: [
|
|
15709
|
+
/* @__PURE__ */ jsxs116("div", { children: [
|
|
15710
|
+
/* @__PURE__ */ jsx186(CardTitle, { className: "text-2xl", children: client.name }),
|
|
15711
|
+
client.description && /* @__PURE__ */ jsx186(CardDescription, { className: "mt-1", children: client.description })
|
|
15326
15712
|
] }),
|
|
15327
|
-
/* @__PURE__ */
|
|
15328
|
-
/* @__PURE__ */
|
|
15329
|
-
/* @__PURE__ */
|
|
15713
|
+
/* @__PURE__ */ jsxs116("div", { className: "flex items-center gap-2", children: [
|
|
15714
|
+
/* @__PURE__ */ jsx186(Badge, { variant: client.isActive ? "default" : "secondary", children: client.isActive ? "Active" : "Inactive" }),
|
|
15715
|
+
/* @__PURE__ */ jsx186(Badge, { variant: "outline", children: client.isConfidential ? "Confidential" : "Public" })
|
|
15330
15716
|
] })
|
|
15331
15717
|
] }) }),
|
|
15332
|
-
/* @__PURE__ */
|
|
15333
|
-
/* @__PURE__ */
|
|
15334
|
-
/* @__PURE__ */
|
|
15335
|
-
/* @__PURE__ */
|
|
15336
|
-
/* @__PURE__ */
|
|
15337
|
-
/* @__PURE__ */
|
|
15718
|
+
/* @__PURE__ */ jsxs116(CardContent, { className: "space-y-6", children: [
|
|
15719
|
+
/* @__PURE__ */ jsxs116("div", { className: "space-y-2", children: [
|
|
15720
|
+
/* @__PURE__ */ jsx186(Label, { children: "Client ID" }),
|
|
15721
|
+
/* @__PURE__ */ jsxs116("div", { className: "flex gap-2", children: [
|
|
15722
|
+
/* @__PURE__ */ jsx186(Input, { value: client.clientId, readOnly: true, className: "font-mono" }),
|
|
15723
|
+
/* @__PURE__ */ jsx186(
|
|
15338
15724
|
Button,
|
|
15339
15725
|
{
|
|
15340
15726
|
variant: "outline",
|
|
15341
15727
|
size: "icon",
|
|
15342
|
-
onClick: () =>
|
|
15728
|
+
onClick: () => copyToClipboard2(client.clientId, "clientId"),
|
|
15343
15729
|
title: "Copy Client ID",
|
|
15344
|
-
children: copiedField === "clientId" ? /* @__PURE__ */
|
|
15730
|
+
children: copiedField === "clientId" ? /* @__PURE__ */ jsx186(Check2, { className: "h-4 w-4 text-green-600" }) : /* @__PURE__ */ jsx186(Copy4, { className: "h-4 w-4" })
|
|
15345
15731
|
}
|
|
15346
15732
|
)
|
|
15347
15733
|
] })
|
|
15348
15734
|
] }),
|
|
15349
|
-
/* @__PURE__ */
|
|
15350
|
-
/* @__PURE__ */
|
|
15351
|
-
/* @__PURE__ */
|
|
15352
|
-
/* @__PURE__ */
|
|
15353
|
-
onRegenerateSecret && /* @__PURE__ */
|
|
15735
|
+
/* @__PURE__ */ jsxs116("div", { className: "space-y-2", children: [
|
|
15736
|
+
/* @__PURE__ */ jsx186(Label, { children: "Client Secret" }),
|
|
15737
|
+
/* @__PURE__ */ jsxs116("div", { className: "flex gap-2", children: [
|
|
15738
|
+
/* @__PURE__ */ jsx186(Input, { value: "\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022", readOnly: true, className: "font-mono" }),
|
|
15739
|
+
onRegenerateSecret && /* @__PURE__ */ jsx186(
|
|
15354
15740
|
Button,
|
|
15355
15741
|
{
|
|
15356
15742
|
variant: "outline",
|
|
@@ -15358,57 +15744,57 @@ function OAuthClientDetail({
|
|
|
15358
15744
|
onClick: () => setShowRegenerateConfirm(true),
|
|
15359
15745
|
title: "Regenerate Secret",
|
|
15360
15746
|
disabled: isLoading,
|
|
15361
|
-
children: /* @__PURE__ */
|
|
15747
|
+
children: /* @__PURE__ */ jsx186(RefreshCw3, { className: "h-4 w-4" })
|
|
15362
15748
|
}
|
|
15363
15749
|
)
|
|
15364
15750
|
] }),
|
|
15365
|
-
/* @__PURE__ */
|
|
15751
|
+
/* @__PURE__ */ jsx186("p", { className: "text-xs text-muted-foreground", children: "Regenerating will invalidate the current secret and all existing tokens." })
|
|
15366
15752
|
] }),
|
|
15367
|
-
/* @__PURE__ */
|
|
15368
|
-
/* @__PURE__ */
|
|
15369
|
-
/* @__PURE__ */
|
|
15370
|
-
/* @__PURE__ */
|
|
15371
|
-
/* @__PURE__ */
|
|
15753
|
+
/* @__PURE__ */ jsx186(Separator, {}),
|
|
15754
|
+
/* @__PURE__ */ jsxs116("div", { className: "space-y-2", children: [
|
|
15755
|
+
/* @__PURE__ */ jsx186(Label, { children: "Redirect URIs" }),
|
|
15756
|
+
/* @__PURE__ */ jsx186("ul", { className: "space-y-1", children: client.redirectUris.map((uri, index) => /* @__PURE__ */ jsxs116("li", { className: "flex items-center gap-2 text-sm font-mono", children: [
|
|
15757
|
+
/* @__PURE__ */ jsx186(ExternalLink, { className: "h-3 w-3 text-muted-foreground" }),
|
|
15372
15758
|
uri
|
|
15373
15759
|
] }, index)) })
|
|
15374
15760
|
] }),
|
|
15375
|
-
/* @__PURE__ */
|
|
15376
|
-
/* @__PURE__ */
|
|
15377
|
-
/* @__PURE__ */
|
|
15761
|
+
/* @__PURE__ */ jsxs116("div", { className: "space-y-2", children: [
|
|
15762
|
+
/* @__PURE__ */ jsx186(Label, { children: "Allowed Scopes" }),
|
|
15763
|
+
/* @__PURE__ */ jsx186("div", { className: "flex flex-wrap gap-2", children: client.allowedScopes.map((scope) => /* @__PURE__ */ jsx186(Badge, { variant: "secondary", children: OAUTH_SCOPE_DISPLAY[scope]?.name || scope }, scope)) })
|
|
15378
15764
|
] }),
|
|
15379
|
-
/* @__PURE__ */
|
|
15380
|
-
/* @__PURE__ */
|
|
15381
|
-
/* @__PURE__ */
|
|
15765
|
+
/* @__PURE__ */ jsxs116("div", { className: "space-y-2", children: [
|
|
15766
|
+
/* @__PURE__ */ jsx186(Label, { children: "Grant Types" }),
|
|
15767
|
+
/* @__PURE__ */ jsx186("div", { className: "flex flex-wrap gap-2", children: client.allowedGrantTypes.map((grant) => /* @__PURE__ */ jsx186(Badge, { variant: "outline", children: grant.replace(/_/g, " ") }, grant)) })
|
|
15382
15768
|
] }),
|
|
15383
|
-
/* @__PURE__ */
|
|
15384
|
-
/* @__PURE__ */
|
|
15769
|
+
/* @__PURE__ */ jsx186(Separator, {}),
|
|
15770
|
+
/* @__PURE__ */ jsx186("div", { className: "flex flex-wrap gap-x-6 gap-y-2 text-sm text-muted-foreground", children: /* @__PURE__ */ jsxs116("span", { children: [
|
|
15385
15771
|
"Created: ",
|
|
15386
15772
|
createdDate
|
|
15387
15773
|
] }) }),
|
|
15388
|
-
/* @__PURE__ */
|
|
15389
|
-
onEdit && /* @__PURE__ */
|
|
15390
|
-
/* @__PURE__ */
|
|
15774
|
+
/* @__PURE__ */ jsxs116("div", { className: "flex gap-3 pt-4", children: [
|
|
15775
|
+
onEdit && /* @__PURE__ */ jsxs116(Button, { variant: "outline", onClick: onEdit, disabled: isLoading, children: [
|
|
15776
|
+
/* @__PURE__ */ jsx186(Pencil2, { className: "h-4 w-4 mr-2" }),
|
|
15391
15777
|
"Edit"
|
|
15392
15778
|
] }),
|
|
15393
|
-
onDelete && /* @__PURE__ */
|
|
15394
|
-
/* @__PURE__ */
|
|
15779
|
+
onDelete && /* @__PURE__ */ jsxs116(Button, { variant: "destructive", onClick: () => setShowDeleteConfirm(true), disabled: isLoading, children: [
|
|
15780
|
+
/* @__PURE__ */ jsx186(Trash25, { className: "h-4 w-4 mr-2" }),
|
|
15395
15781
|
"Delete"
|
|
15396
15782
|
] })
|
|
15397
15783
|
] })
|
|
15398
15784
|
] })
|
|
15399
15785
|
] }),
|
|
15400
|
-
/* @__PURE__ */
|
|
15401
|
-
/* @__PURE__ */
|
|
15402
|
-
/* @__PURE__ */
|
|
15403
|
-
/* @__PURE__ */
|
|
15786
|
+
/* @__PURE__ */ jsx186(AlertDialog, { open: showDeleteConfirm, onOpenChange: setShowDeleteConfirm, children: /* @__PURE__ */ jsxs116(AlertDialogContent, { children: [
|
|
15787
|
+
/* @__PURE__ */ jsxs116(AlertDialogHeader, { children: [
|
|
15788
|
+
/* @__PURE__ */ jsx186(AlertDialogTitle, { children: "Delete OAuth Application?" }),
|
|
15789
|
+
/* @__PURE__ */ jsxs116(AlertDialogDescription, { children: [
|
|
15404
15790
|
'This will permanently delete "',
|
|
15405
15791
|
client.name,
|
|
15406
15792
|
'" and revoke all access tokens. This action cannot be undone.'
|
|
15407
15793
|
] })
|
|
15408
15794
|
] }),
|
|
15409
|
-
/* @__PURE__ */
|
|
15410
|
-
/* @__PURE__ */
|
|
15411
|
-
/* @__PURE__ */
|
|
15795
|
+
/* @__PURE__ */ jsxs116(AlertDialogFooter, { children: [
|
|
15796
|
+
/* @__PURE__ */ jsx186(AlertDialogCancel, { disabled: isDeleting, children: "Cancel" }),
|
|
15797
|
+
/* @__PURE__ */ jsx186(
|
|
15412
15798
|
AlertDialogAction,
|
|
15413
15799
|
{
|
|
15414
15800
|
onClick: handleDelete,
|
|
@@ -15419,14 +15805,14 @@ function OAuthClientDetail({
|
|
|
15419
15805
|
)
|
|
15420
15806
|
] })
|
|
15421
15807
|
] }) }),
|
|
15422
|
-
/* @__PURE__ */
|
|
15423
|
-
/* @__PURE__ */
|
|
15424
|
-
/* @__PURE__ */
|
|
15425
|
-
/* @__PURE__ */
|
|
15808
|
+
/* @__PURE__ */ jsx186(AlertDialog, { open: showRegenerateConfirm, onOpenChange: setShowRegenerateConfirm, children: /* @__PURE__ */ jsxs116(AlertDialogContent, { children: [
|
|
15809
|
+
/* @__PURE__ */ jsxs116(AlertDialogHeader, { children: [
|
|
15810
|
+
/* @__PURE__ */ jsx186(AlertDialogTitle, { children: "Regenerate Client Secret?" }),
|
|
15811
|
+
/* @__PURE__ */ jsx186(AlertDialogDescription, { children: "This will generate a new client secret and invalidate the old one. All existing tokens will be revoked. You will need to update your application with the new secret." })
|
|
15426
15812
|
] }),
|
|
15427
|
-
/* @__PURE__ */
|
|
15428
|
-
/* @__PURE__ */
|
|
15429
|
-
/* @__PURE__ */
|
|
15813
|
+
/* @__PURE__ */ jsxs116(AlertDialogFooter, { children: [
|
|
15814
|
+
/* @__PURE__ */ jsx186(AlertDialogCancel, { disabled: isRegenerating, children: "Cancel" }),
|
|
15815
|
+
/* @__PURE__ */ jsx186(AlertDialogAction, { onClick: handleRegenerateSecret, disabled: isRegenerating, children: isRegenerating ? "Regenerating..." : "Regenerate" })
|
|
15430
15816
|
] })
|
|
15431
15817
|
] }) })
|
|
15432
15818
|
] });
|
|
@@ -15435,17 +15821,17 @@ __name(OAuthClientDetail, "OAuthClientDetail");
|
|
|
15435
15821
|
|
|
15436
15822
|
// src/features/oauth/components/consent/OAuthConsentHeader.tsx
|
|
15437
15823
|
import { Shield } from "lucide-react";
|
|
15438
|
-
import { jsx as
|
|
15824
|
+
import { jsx as jsx187, jsxs as jsxs117 } from "react/jsx-runtime";
|
|
15439
15825
|
function OAuthConsentHeader({ client, logoUrl, appName = "Only35" }) {
|
|
15440
|
-
return /* @__PURE__ */
|
|
15441
|
-
/* @__PURE__ */
|
|
15442
|
-
/* @__PURE__ */
|
|
15443
|
-
/* @__PURE__ */
|
|
15826
|
+
return /* @__PURE__ */ jsxs117("div", { className: "text-center space-y-4", children: [
|
|
15827
|
+
/* @__PURE__ */ jsx187("div", { className: "flex justify-center", children: logoUrl ? /* @__PURE__ */ jsx187("img", { src: logoUrl, alt: appName, className: "h-12 w-auto" }) : /* @__PURE__ */ jsx187("div", { className: "h-12 w-12 rounded-full bg-primary flex items-center justify-center", children: /* @__PURE__ */ jsx187(Shield, { className: "h-6 w-6 text-primary-foreground" }) }) }),
|
|
15828
|
+
/* @__PURE__ */ jsxs117("div", { className: "space-y-2", children: [
|
|
15829
|
+
/* @__PURE__ */ jsxs117("h1", { className: "text-2xl font-bold", children: [
|
|
15444
15830
|
"Authorize ",
|
|
15445
15831
|
client.name
|
|
15446
15832
|
] }),
|
|
15447
|
-
/* @__PURE__ */
|
|
15448
|
-
/* @__PURE__ */
|
|
15833
|
+
/* @__PURE__ */ jsxs117("p", { className: "text-muted-foreground", children: [
|
|
15834
|
+
/* @__PURE__ */ jsx187("span", { className: "font-medium text-foreground", children: client.name }),
|
|
15449
15835
|
" wants to access your ",
|
|
15450
15836
|
appName,
|
|
15451
15837
|
" account"
|
|
@@ -15457,7 +15843,7 @@ __name(OAuthConsentHeader, "OAuthConsentHeader");
|
|
|
15457
15843
|
|
|
15458
15844
|
// src/features/oauth/components/consent/OAuthScopeList.tsx
|
|
15459
15845
|
import { Eye, Pencil as Pencil3, Image as Image16, Upload, Film, FolderPlus, User, Shield as Shield2 } from "lucide-react";
|
|
15460
|
-
import { jsx as
|
|
15846
|
+
import { jsx as jsx188, jsxs as jsxs118 } from "react/jsx-runtime";
|
|
15461
15847
|
var SCOPE_ICONS = {
|
|
15462
15848
|
eye: Eye,
|
|
15463
15849
|
pencil: Pencil3,
|
|
@@ -15472,15 +15858,15 @@ function OAuthScopeList({ scopes }) {
|
|
|
15472
15858
|
if (scopes.length === 0) {
|
|
15473
15859
|
return null;
|
|
15474
15860
|
}
|
|
15475
|
-
return /* @__PURE__ */
|
|
15476
|
-
/* @__PURE__ */
|
|
15477
|
-
/* @__PURE__ */
|
|
15861
|
+
return /* @__PURE__ */ jsxs118("div", { className: "space-y-3", children: [
|
|
15862
|
+
/* @__PURE__ */ jsx188("h2", { className: "text-sm font-medium text-muted-foreground uppercase tracking-wide", children: "This will allow the application to:" }),
|
|
15863
|
+
/* @__PURE__ */ jsx188("ul", { className: "space-y-3", children: scopes.map((scope) => {
|
|
15478
15864
|
const IconComponent = scope.icon ? SCOPE_ICONS[scope.icon] : Eye;
|
|
15479
|
-
return /* @__PURE__ */
|
|
15480
|
-
/* @__PURE__ */
|
|
15481
|
-
/* @__PURE__ */
|
|
15482
|
-
/* @__PURE__ */
|
|
15483
|
-
/* @__PURE__ */
|
|
15865
|
+
return /* @__PURE__ */ jsxs118("li", { className: "flex items-start gap-3 p-3 rounded-lg bg-muted/50", children: [
|
|
15866
|
+
/* @__PURE__ */ jsx188("div", { className: "flex-shrink-0 mt-0.5", children: /* @__PURE__ */ jsx188("div", { className: "h-8 w-8 rounded-full bg-primary/10 flex items-center justify-center", children: IconComponent && /* @__PURE__ */ jsx188(IconComponent, { className: "h-4 w-4 text-primary" }) }) }),
|
|
15867
|
+
/* @__PURE__ */ jsxs118("div", { className: "flex-1", children: [
|
|
15868
|
+
/* @__PURE__ */ jsx188("p", { className: "font-medium", children: scope.name }),
|
|
15869
|
+
/* @__PURE__ */ jsx188("p", { className: "text-sm text-muted-foreground", children: scope.description })
|
|
15484
15870
|
] })
|
|
15485
15871
|
] }, scope.scope);
|
|
15486
15872
|
}) })
|
|
@@ -15489,18 +15875,18 @@ function OAuthScopeList({ scopes }) {
|
|
|
15489
15875
|
__name(OAuthScopeList, "OAuthScopeList");
|
|
15490
15876
|
|
|
15491
15877
|
// src/features/oauth/components/consent/OAuthConsentActions.tsx
|
|
15492
|
-
import { jsx as
|
|
15878
|
+
import { jsx as jsx189, jsxs as jsxs119 } from "react/jsx-runtime";
|
|
15493
15879
|
function OAuthConsentActions({ onApprove, onDeny, isLoading = false }) {
|
|
15494
|
-
return /* @__PURE__ */
|
|
15495
|
-
/* @__PURE__ */
|
|
15496
|
-
/* @__PURE__ */
|
|
15880
|
+
return /* @__PURE__ */ jsxs119("div", { className: "flex flex-col sm:flex-row gap-3", children: [
|
|
15881
|
+
/* @__PURE__ */ jsx189(Button, { variant: "outline", onClick: onDeny, disabled: isLoading, className: "flex-1", children: "Deny" }),
|
|
15882
|
+
/* @__PURE__ */ jsx189(Button, { onClick: onApprove, disabled: isLoading, className: "flex-1", children: isLoading ? "Authorizing..." : "Authorize" })
|
|
15497
15883
|
] });
|
|
15498
15884
|
}
|
|
15499
15885
|
__name(OAuthConsentActions, "OAuthConsentActions");
|
|
15500
15886
|
|
|
15501
15887
|
// src/features/oauth/components/consent/OAuthConsentScreen.tsx
|
|
15502
|
-
import { ExternalLink as ExternalLink2, AlertTriangle as AlertTriangle2, Loader2 as
|
|
15503
|
-
import { jsx as
|
|
15888
|
+
import { ExternalLink as ExternalLink2, AlertTriangle as AlertTriangle2, Loader2 as Loader25 } from "lucide-react";
|
|
15889
|
+
import { jsx as jsx190, jsxs as jsxs120 } from "react/jsx-runtime";
|
|
15504
15890
|
function OAuthConsentScreen({
|
|
15505
15891
|
params,
|
|
15506
15892
|
logoUrl,
|
|
@@ -15510,41 +15896,41 @@ function OAuthConsentScreen({
|
|
|
15510
15896
|
}) {
|
|
15511
15897
|
const { clientInfo, isLoading, error, approve, deny, isSubmitting } = useOAuthConsent(params);
|
|
15512
15898
|
if (isLoading) {
|
|
15513
|
-
return /* @__PURE__ */
|
|
15514
|
-
/* @__PURE__ */
|
|
15515
|
-
/* @__PURE__ */
|
|
15899
|
+
return /* @__PURE__ */ jsx190("div", { className: "min-h-screen flex items-center justify-center p-4", children: /* @__PURE__ */ jsx190(Card, { className: "w-full max-w-md", children: /* @__PURE__ */ jsxs120(CardContent, { className: "flex flex-col items-center justify-center py-12", children: [
|
|
15900
|
+
/* @__PURE__ */ jsx190(Loader25, { className: "h-8 w-8 animate-spin text-muted-foreground" }),
|
|
15901
|
+
/* @__PURE__ */ jsx190("p", { className: "mt-4 text-muted-foreground", children: "Loading authorization request..." })
|
|
15516
15902
|
] }) }) });
|
|
15517
15903
|
}
|
|
15518
15904
|
if (error || !clientInfo) {
|
|
15519
|
-
return /* @__PURE__ */
|
|
15520
|
-
/* @__PURE__ */
|
|
15521
|
-
/* @__PURE__ */
|
|
15905
|
+
return /* @__PURE__ */ jsx190("div", { className: "min-h-screen flex items-center justify-center p-4", children: /* @__PURE__ */ jsx190(Card, { className: "w-full max-w-md", children: /* @__PURE__ */ jsx190(CardContent, { className: "py-8", children: /* @__PURE__ */ jsxs120(Alert, { variant: "destructive", children: [
|
|
15906
|
+
/* @__PURE__ */ jsx190(AlertTriangle2, { className: "h-4 w-4" }),
|
|
15907
|
+
/* @__PURE__ */ jsx190(AlertDescription, { children: error?.message || "Invalid authorization request. Please try again." })
|
|
15522
15908
|
] }) }) }) });
|
|
15523
15909
|
}
|
|
15524
15910
|
const { client, scopes } = clientInfo;
|
|
15525
|
-
return /* @__PURE__ */
|
|
15526
|
-
/* @__PURE__ */
|
|
15527
|
-
/* @__PURE__ */
|
|
15528
|
-
/* @__PURE__ */
|
|
15529
|
-
/* @__PURE__ */
|
|
15530
|
-
/* @__PURE__ */
|
|
15531
|
-
/* @__PURE__ */
|
|
15532
|
-
/* @__PURE__ */
|
|
15533
|
-
/* @__PURE__ */
|
|
15534
|
-
/* @__PURE__ */
|
|
15535
|
-
/* @__PURE__ */
|
|
15911
|
+
return /* @__PURE__ */ jsx190("div", { className: "min-h-screen flex items-center justify-center p-4 bg-muted/30", children: /* @__PURE__ */ jsxs120(Card, { className: "w-full max-w-md", children: [
|
|
15912
|
+
/* @__PURE__ */ jsxs120(CardContent, { className: "pt-6 space-y-6", children: [
|
|
15913
|
+
/* @__PURE__ */ jsx190(OAuthConsentHeader, { client, logoUrl, appName }),
|
|
15914
|
+
/* @__PURE__ */ jsx190(Separator, {}),
|
|
15915
|
+
/* @__PURE__ */ jsx190(OAuthScopeList, { scopes }),
|
|
15916
|
+
/* @__PURE__ */ jsx190(Separator, {}),
|
|
15917
|
+
/* @__PURE__ */ jsxs120("div", { className: "flex items-start gap-2 text-sm text-muted-foreground", children: [
|
|
15918
|
+
/* @__PURE__ */ jsx190(ExternalLink2, { className: "h-4 w-4 mt-0.5 flex-shrink-0" }),
|
|
15919
|
+
/* @__PURE__ */ jsxs120("div", { children: [
|
|
15920
|
+
/* @__PURE__ */ jsx190("span", { children: "Authorizing will redirect you to:" }),
|
|
15921
|
+
/* @__PURE__ */ jsx190("p", { className: "font-mono text-xs mt-1 break-all", children: params.redirectUri })
|
|
15536
15922
|
] })
|
|
15537
15923
|
] }),
|
|
15538
|
-
/* @__PURE__ */
|
|
15924
|
+
/* @__PURE__ */ jsx190(OAuthConsentActions, { onApprove: approve, onDeny: deny, isLoading: isSubmitting })
|
|
15539
15925
|
] }),
|
|
15540
|
-
/* @__PURE__ */
|
|
15926
|
+
/* @__PURE__ */ jsx190(CardFooter, { className: "justify-center", children: /* @__PURE__ */ jsxs120("p", { className: "text-xs text-center text-muted-foreground", children: [
|
|
15541
15927
|
"By authorizing, you agree to the app's",
|
|
15542
15928
|
" ",
|
|
15543
|
-
/* @__PURE__ */
|
|
15929
|
+
/* @__PURE__ */ jsx190("a", { href: termsUrl, className: "underline hover:text-foreground", target: "_blank", rel: "noopener", children: "Terms of Service" }),
|
|
15544
15930
|
" ",
|
|
15545
15931
|
"and",
|
|
15546
15932
|
" ",
|
|
15547
|
-
/* @__PURE__ */
|
|
15933
|
+
/* @__PURE__ */ jsx190("a", { href: privacyUrl, className: "underline hover:text-foreground", target: "_blank", rel: "noopener", children: "Privacy Policy" }),
|
|
15548
15934
|
"."
|
|
15549
15935
|
] }) })
|
|
15550
15936
|
] }) });
|
|
@@ -15553,15 +15939,15 @@ __name(OAuthConsentScreen, "OAuthConsentScreen");
|
|
|
15553
15939
|
|
|
15554
15940
|
// src/features/waitlist/components/forms/WaitlistForm.tsx
|
|
15555
15941
|
import { zodResolver as zodResolver9 } from "@hookform/resolvers/zod";
|
|
15556
|
-
import { CheckCircle, Mail } from "lucide-react";
|
|
15942
|
+
import { CheckCircle, Mail as Mail2 } from "lucide-react";
|
|
15557
15943
|
import { useTranslations as useTranslations77 } from "next-intl";
|
|
15558
|
-
import { useState as
|
|
15944
|
+
import { useState as useState73 } from "react";
|
|
15559
15945
|
import { useForm as useForm9 } from "react-hook-form";
|
|
15560
15946
|
import { v4 as v410 } from "uuid";
|
|
15561
15947
|
import { z as z9 } from "zod";
|
|
15562
15948
|
|
|
15563
15949
|
// src/features/waitlist/components/forms/WaitlistQuestionnaireRenderer.tsx
|
|
15564
|
-
import { jsx as
|
|
15950
|
+
import { jsx as jsx191, jsxs as jsxs121 } from "react/jsx-runtime";
|
|
15565
15951
|
function WaitlistQuestionnaireRenderer({
|
|
15566
15952
|
form,
|
|
15567
15953
|
fields,
|
|
@@ -15570,11 +15956,11 @@ function WaitlistQuestionnaireRenderer({
|
|
|
15570
15956
|
if (!fields || fields.length === 0) {
|
|
15571
15957
|
return null;
|
|
15572
15958
|
}
|
|
15573
|
-
return /* @__PURE__ */
|
|
15959
|
+
return /* @__PURE__ */ jsx191("div", { className: "space-y-4", children: fields.map((field) => {
|
|
15574
15960
|
const fieldId = `${fieldPrefix}.${field.id}`;
|
|
15575
15961
|
switch (field.type) {
|
|
15576
15962
|
case "text":
|
|
15577
|
-
return /* @__PURE__ */
|
|
15963
|
+
return /* @__PURE__ */ jsx191(
|
|
15578
15964
|
FormInput,
|
|
15579
15965
|
{
|
|
15580
15966
|
form,
|
|
@@ -15586,7 +15972,7 @@ function WaitlistQuestionnaireRenderer({
|
|
|
15586
15972
|
field.id
|
|
15587
15973
|
);
|
|
15588
15974
|
case "textarea":
|
|
15589
|
-
return /* @__PURE__ */
|
|
15975
|
+
return /* @__PURE__ */ jsx191(
|
|
15590
15976
|
FormTextarea,
|
|
15591
15977
|
{
|
|
15592
15978
|
form,
|
|
@@ -15601,7 +15987,7 @@ function WaitlistQuestionnaireRenderer({
|
|
|
15601
15987
|
if (!field.options || field.options.length === 0) {
|
|
15602
15988
|
return null;
|
|
15603
15989
|
}
|
|
15604
|
-
return /* @__PURE__ */
|
|
15990
|
+
return /* @__PURE__ */ jsx191(
|
|
15605
15991
|
FormSelect,
|
|
15606
15992
|
{
|
|
15607
15993
|
form,
|
|
@@ -15616,7 +16002,7 @@ function WaitlistQuestionnaireRenderer({
|
|
|
15616
16002
|
);
|
|
15617
16003
|
case "checkbox":
|
|
15618
16004
|
if (!field.options || field.options.length === 0) {
|
|
15619
|
-
return /* @__PURE__ */
|
|
16005
|
+
return /* @__PURE__ */ jsx191(
|
|
15620
16006
|
FormCheckbox,
|
|
15621
16007
|
{
|
|
15622
16008
|
form,
|
|
@@ -15628,13 +16014,13 @@ function WaitlistQuestionnaireRenderer({
|
|
|
15628
16014
|
field.id
|
|
15629
16015
|
);
|
|
15630
16016
|
}
|
|
15631
|
-
return /* @__PURE__ */
|
|
15632
|
-
/* @__PURE__ */
|
|
16017
|
+
return /* @__PURE__ */ jsxs121("div", { className: "space-y-2", children: [
|
|
16018
|
+
/* @__PURE__ */ jsxs121("span", { className: "text-sm font-medium", children: [
|
|
15633
16019
|
field.label,
|
|
15634
|
-
field.required && /* @__PURE__ */
|
|
16020
|
+
field.required && /* @__PURE__ */ jsx191("span", { className: "text-destructive ml-1", children: "*" })
|
|
15635
16021
|
] }),
|
|
15636
|
-
field.description && /* @__PURE__ */
|
|
15637
|
-
/* @__PURE__ */
|
|
16022
|
+
field.description && /* @__PURE__ */ jsx191("p", { className: "text-muted-foreground text-xs", children: field.description }),
|
|
16023
|
+
/* @__PURE__ */ jsx191("div", { className: "space-y-2", children: field.options.map((option) => /* @__PURE__ */ jsx191(
|
|
15638
16024
|
FormCheckbox,
|
|
15639
16025
|
{
|
|
15640
16026
|
form,
|
|
@@ -15653,11 +16039,11 @@ function WaitlistQuestionnaireRenderer({
|
|
|
15653
16039
|
__name(WaitlistQuestionnaireRenderer, "WaitlistQuestionnaireRenderer");
|
|
15654
16040
|
|
|
15655
16041
|
// src/features/waitlist/components/forms/WaitlistForm.tsx
|
|
15656
|
-
import { Fragment as Fragment39, jsx as
|
|
16042
|
+
import { Fragment as Fragment39, jsx as jsx192, jsxs as jsxs122 } from "react/jsx-runtime";
|
|
15657
16043
|
function WaitlistForm({ onSuccess }) {
|
|
15658
16044
|
const t = useTranslations77();
|
|
15659
|
-
const [isSubmitting, setIsSubmitting] =
|
|
15660
|
-
const [isSuccess, setIsSuccess] =
|
|
16045
|
+
const [isSubmitting, setIsSubmitting] = useState73(false);
|
|
16046
|
+
const [isSuccess, setIsSuccess] = useState73(false);
|
|
15661
16047
|
const config = getWaitlistConfig();
|
|
15662
16048
|
const questionnaireFields = config.questionnaire ?? [];
|
|
15663
16049
|
const questionnaireSchema = questionnaireFields.reduce(
|
|
@@ -15742,20 +16128,20 @@ function WaitlistForm({ onSuccess }) {
|
|
|
15742
16128
|
}
|
|
15743
16129
|
}, "onSubmit");
|
|
15744
16130
|
if (isSuccess) {
|
|
15745
|
-
return /* @__PURE__ */
|
|
15746
|
-
/* @__PURE__ */
|
|
15747
|
-
/* @__PURE__ */
|
|
15748
|
-
/* @__PURE__ */
|
|
15749
|
-
/* @__PURE__ */
|
|
16131
|
+
return /* @__PURE__ */ jsxs122("div", { className: "space-y-6 text-center", children: [
|
|
16132
|
+
/* @__PURE__ */ jsx192("div", { className: "mx-auto flex h-16 w-16 items-center justify-center rounded-full bg-green-100", children: /* @__PURE__ */ jsx192(CheckCircle, { className: "h-8 w-8 text-green-600" }) }),
|
|
16133
|
+
/* @__PURE__ */ jsxs122("div", { className: "space-y-2", children: [
|
|
16134
|
+
/* @__PURE__ */ jsx192("h3", { className: "text-xl font-semibold", children: t("waitlist.success.title") }),
|
|
16135
|
+
/* @__PURE__ */ jsx192("p", { className: "text-muted-foreground", children: t("waitlist.success.description") })
|
|
15750
16136
|
] }),
|
|
15751
|
-
/* @__PURE__ */
|
|
15752
|
-
/* @__PURE__ */
|
|
15753
|
-
/* @__PURE__ */
|
|
16137
|
+
/* @__PURE__ */ jsxs122("div", { className: "flex items-center justify-center gap-2 text-muted-foreground text-sm", children: [
|
|
16138
|
+
/* @__PURE__ */ jsx192(Mail2, { className: "h-4 w-4" }),
|
|
16139
|
+
/* @__PURE__ */ jsx192("span", { children: t("waitlist.success.hint") })
|
|
15754
16140
|
] })
|
|
15755
16141
|
] });
|
|
15756
16142
|
}
|
|
15757
|
-
return /* @__PURE__ */
|
|
15758
|
-
/* @__PURE__ */
|
|
16143
|
+
return /* @__PURE__ */ jsx192(Form, { ...form, children: /* @__PURE__ */ jsxs122("form", { onSubmit: form.handleSubmit(onSubmit), className: "space-y-4", children: [
|
|
16144
|
+
/* @__PURE__ */ jsx192(
|
|
15759
16145
|
FormInput,
|
|
15760
16146
|
{
|
|
15761
16147
|
isRequired: true,
|
|
@@ -15765,23 +16151,23 @@ function WaitlistForm({ onSuccess }) {
|
|
|
15765
16151
|
placeholder: t("common.fields.email.placeholder")
|
|
15766
16152
|
}
|
|
15767
16153
|
),
|
|
15768
|
-
questionnaireFields.length > 0 && /* @__PURE__ */
|
|
15769
|
-
/* @__PURE__ */
|
|
15770
|
-
/* @__PURE__ */
|
|
16154
|
+
questionnaireFields.length > 0 && /* @__PURE__ */ jsx192(WaitlistQuestionnaireRenderer, { form, fields: questionnaireFields }),
|
|
16155
|
+
/* @__PURE__ */ jsxs122("div", { className: "space-y-4 py-4", children: [
|
|
16156
|
+
/* @__PURE__ */ jsx192(
|
|
15771
16157
|
GdprConsentCheckbox,
|
|
15772
16158
|
{
|
|
15773
16159
|
form,
|
|
15774
16160
|
id: "gdprConsent",
|
|
15775
|
-
label: /* @__PURE__ */
|
|
16161
|
+
label: /* @__PURE__ */ jsxs122(Fragment39, { children: [
|
|
15776
16162
|
t("auth.gdpr.terms_prefix"),
|
|
15777
|
-
/* @__PURE__ */
|
|
16163
|
+
/* @__PURE__ */ jsx192(Link, { href: "/terms", target: "_blank", rel: "noopener", className: "underline", children: t("auth.gdpr.terms_of_service") }),
|
|
15778
16164
|
t("auth.gdpr.and"),
|
|
15779
|
-
/* @__PURE__ */
|
|
16165
|
+
/* @__PURE__ */ jsx192(Link, { href: "/privacy", target: "_blank", rel: "noopener", className: "underline", children: t("auth.gdpr.privacy_policy") })
|
|
15780
16166
|
] }),
|
|
15781
16167
|
required: true
|
|
15782
16168
|
}
|
|
15783
16169
|
),
|
|
15784
|
-
/* @__PURE__ */
|
|
16170
|
+
/* @__PURE__ */ jsx192(
|
|
15785
16171
|
GdprConsentCheckbox,
|
|
15786
16172
|
{
|
|
15787
16173
|
form,
|
|
@@ -15791,29 +16177,29 @@ function WaitlistForm({ onSuccess }) {
|
|
|
15791
16177
|
}
|
|
15792
16178
|
)
|
|
15793
16179
|
] }),
|
|
15794
|
-
/* @__PURE__ */
|
|
16180
|
+
/* @__PURE__ */ jsx192(Button, { type: "submit", className: "w-full", disabled: isSubmitting, children: isSubmitting ? t("common.actions.submitting") : t("waitlist.buttons.join") })
|
|
15795
16181
|
] }) });
|
|
15796
16182
|
}
|
|
15797
16183
|
__name(WaitlistForm, "WaitlistForm");
|
|
15798
16184
|
|
|
15799
16185
|
// src/features/waitlist/components/sections/WaitlistHeroSection.tsx
|
|
15800
16186
|
import { CheckCircle as CheckCircle2 } from "lucide-react";
|
|
15801
|
-
import { jsx as
|
|
16187
|
+
import { jsx as jsx193, jsxs as jsxs123 } from "react/jsx-runtime";
|
|
15802
16188
|
function WaitlistHeroSection() {
|
|
15803
16189
|
const config = getWaitlistConfig();
|
|
15804
|
-
return /* @__PURE__ */
|
|
15805
|
-
/* @__PURE__ */
|
|
15806
|
-
/* @__PURE__ */
|
|
15807
|
-
config.heroTitle && /* @__PURE__ */
|
|
15808
|
-
config.heroSubtitle && /* @__PURE__ */
|
|
15809
|
-
config.heroDescription && /* @__PURE__ */
|
|
16190
|
+
return /* @__PURE__ */ jsx193("section", { className: "relative overflow-hidden py-16 md:py-24", children: /* @__PURE__ */ jsx193("div", { className: "container mx-auto px-4", children: /* @__PURE__ */ jsxs123("div", { className: "grid gap-12 lg:grid-cols-2 lg:items-center", children: [
|
|
16191
|
+
/* @__PURE__ */ jsxs123("div", { className: "space-y-8", children: [
|
|
16192
|
+
/* @__PURE__ */ jsxs123("div", { className: "space-y-4", children: [
|
|
16193
|
+
config.heroTitle && /* @__PURE__ */ jsx193("h1", { className: "text-4xl font-bold tracking-tight md:text-5xl lg:text-6xl", children: config.heroTitle }),
|
|
16194
|
+
config.heroSubtitle && /* @__PURE__ */ jsx193("p", { className: "text-muted-foreground text-xl md:text-2xl", children: config.heroSubtitle }),
|
|
16195
|
+
config.heroDescription && /* @__PURE__ */ jsx193("p", { className: "text-muted-foreground", children: config.heroDescription })
|
|
15810
16196
|
] }),
|
|
15811
|
-
config.benefits && config.benefits.length > 0 && /* @__PURE__ */
|
|
15812
|
-
/* @__PURE__ */
|
|
15813
|
-
/* @__PURE__ */
|
|
16197
|
+
config.benefits && config.benefits.length > 0 && /* @__PURE__ */ jsx193("ul", { className: "space-y-3", children: config.benefits.map((benefit, index) => /* @__PURE__ */ jsxs123("li", { className: "flex items-start gap-3", children: [
|
|
16198
|
+
/* @__PURE__ */ jsx193(CheckCircle2, { className: "text-primary mt-0.5 h-5 w-5 shrink-0" }),
|
|
16199
|
+
/* @__PURE__ */ jsx193("span", { children: benefit })
|
|
15814
16200
|
] }, index)) })
|
|
15815
16201
|
] }),
|
|
15816
|
-
/* @__PURE__ */
|
|
16202
|
+
/* @__PURE__ */ jsx193("div", { className: "lg:pl-8", children: /* @__PURE__ */ jsx193("div", { className: "bg-card rounded-lg border p-6 shadow-lg md:p-8", children: /* @__PURE__ */ jsx193(WaitlistForm, {}) }) })
|
|
15817
16203
|
] }) }) });
|
|
15818
16204
|
}
|
|
15819
16205
|
__name(WaitlistHeroSection, "WaitlistHeroSection");
|
|
@@ -15821,28 +16207,28 @@ __name(WaitlistHeroSection, "WaitlistHeroSection");
|
|
|
15821
16207
|
// src/features/waitlist/components/sections/WaitlistSuccessState.tsx
|
|
15822
16208
|
import { CheckCircle as CheckCircle3 } from "lucide-react";
|
|
15823
16209
|
import { useTranslations as useTranslations78 } from "next-intl";
|
|
15824
|
-
import { jsx as
|
|
16210
|
+
import { jsx as jsx194, jsxs as jsxs124 } from "react/jsx-runtime";
|
|
15825
16211
|
function WaitlistSuccessState() {
|
|
15826
16212
|
const t = useTranslations78();
|
|
15827
|
-
return /* @__PURE__ */
|
|
15828
|
-
/* @__PURE__ */
|
|
15829
|
-
/* @__PURE__ */
|
|
15830
|
-
/* @__PURE__ */
|
|
15831
|
-
/* @__PURE__ */
|
|
16213
|
+
return /* @__PURE__ */ jsxs124("div", { className: "flex flex-col items-center justify-center space-y-4 py-8 text-center", children: [
|
|
16214
|
+
/* @__PURE__ */ jsx194("div", { className: "bg-primary/10 rounded-full p-4", children: /* @__PURE__ */ jsx194(CheckCircle3, { className: "text-primary h-12 w-12" }) }),
|
|
16215
|
+
/* @__PURE__ */ jsx194("h2", { className: "text-2xl font-bold", children: t("waitlist.success.title") }),
|
|
16216
|
+
/* @__PURE__ */ jsx194("p", { className: "text-muted-foreground max-w-md", children: t("waitlist.success.description") }),
|
|
16217
|
+
/* @__PURE__ */ jsx194("p", { className: "text-muted-foreground text-sm", children: t("waitlist.success.hint") })
|
|
15832
16218
|
] });
|
|
15833
16219
|
}
|
|
15834
16220
|
__name(WaitlistSuccessState, "WaitlistSuccessState");
|
|
15835
16221
|
|
|
15836
16222
|
// src/features/waitlist/components/sections/WaitlistConfirmation.tsx
|
|
15837
|
-
import { CheckCircle as CheckCircle4, Loader2 as
|
|
16223
|
+
import { CheckCircle as CheckCircle4, Loader2 as Loader26, XCircle as XCircle2 } from "lucide-react";
|
|
15838
16224
|
import { useTranslations as useTranslations79 } from "next-intl";
|
|
15839
|
-
import { useEffect as
|
|
15840
|
-
import { jsx as
|
|
16225
|
+
import { useEffect as useEffect55, useState as useState74 } from "react";
|
|
16226
|
+
import { jsx as jsx195, jsxs as jsxs125 } from "react/jsx-runtime";
|
|
15841
16227
|
function WaitlistConfirmation({ code }) {
|
|
15842
16228
|
const t = useTranslations79();
|
|
15843
|
-
const [state, setState] =
|
|
15844
|
-
const [errorMessage, setErrorMessage] =
|
|
15845
|
-
|
|
16229
|
+
const [state, setState] = useState74("loading");
|
|
16230
|
+
const [errorMessage, setErrorMessage] = useState74("");
|
|
16231
|
+
useEffect55(() => {
|
|
15846
16232
|
async function confirmEmail() {
|
|
15847
16233
|
try {
|
|
15848
16234
|
await WaitlistService.confirm(code);
|
|
@@ -15856,38 +16242,38 @@ function WaitlistConfirmation({ code }) {
|
|
|
15856
16242
|
confirmEmail();
|
|
15857
16243
|
}, [code, t]);
|
|
15858
16244
|
if (state === "loading") {
|
|
15859
|
-
return /* @__PURE__ */
|
|
15860
|
-
/* @__PURE__ */
|
|
15861
|
-
/* @__PURE__ */
|
|
16245
|
+
return /* @__PURE__ */ jsxs125("div", { className: "flex flex-col items-center justify-center space-y-4 py-16 text-center", children: [
|
|
16246
|
+
/* @__PURE__ */ jsx195(Loader26, { className: "text-primary h-12 w-12 animate-spin" }),
|
|
16247
|
+
/* @__PURE__ */ jsx195("p", { className: "text-muted-foreground", children: t("waitlist.confirmation.loading") })
|
|
15862
16248
|
] });
|
|
15863
16249
|
}
|
|
15864
16250
|
if (state === "error") {
|
|
15865
|
-
return /* @__PURE__ */
|
|
15866
|
-
/* @__PURE__ */
|
|
15867
|
-
/* @__PURE__ */
|
|
15868
|
-
/* @__PURE__ */
|
|
15869
|
-
/* @__PURE__ */
|
|
16251
|
+
return /* @__PURE__ */ jsxs125("div", { className: "flex flex-col items-center justify-center space-y-4 py-16 text-center", children: [
|
|
16252
|
+
/* @__PURE__ */ jsx195("div", { className: "bg-destructive/10 rounded-full p-4", children: /* @__PURE__ */ jsx195(XCircle2, { className: "text-destructive h-12 w-12" }) }),
|
|
16253
|
+
/* @__PURE__ */ jsx195("h2", { className: "text-2xl font-bold", children: t("waitlist.confirmation.error_title") }),
|
|
16254
|
+
/* @__PURE__ */ jsx195("p", { className: "text-muted-foreground max-w-md", children: errorMessage }),
|
|
16255
|
+
/* @__PURE__ */ jsx195(Link, { href: "/waitlist", className: buttonVariants({ variant: "outline" }), children: t("waitlist.buttons.return") })
|
|
15870
16256
|
] });
|
|
15871
16257
|
}
|
|
15872
|
-
return /* @__PURE__ */
|
|
15873
|
-
/* @__PURE__ */
|
|
15874
|
-
/* @__PURE__ */
|
|
15875
|
-
/* @__PURE__ */
|
|
15876
|
-
/* @__PURE__ */
|
|
16258
|
+
return /* @__PURE__ */ jsxs125("div", { className: "flex flex-col items-center justify-center space-y-4 py-16 text-center", children: [
|
|
16259
|
+
/* @__PURE__ */ jsx195("div", { className: "bg-primary/10 rounded-full p-4", children: /* @__PURE__ */ jsx195(CheckCircle4, { className: "text-primary h-12 w-12" }) }),
|
|
16260
|
+
/* @__PURE__ */ jsx195("h2", { className: "text-2xl font-bold", children: t("waitlist.confirmation.success_title") }),
|
|
16261
|
+
/* @__PURE__ */ jsx195("p", { className: "text-muted-foreground max-w-md", children: t("waitlist.confirmation.success_description") }),
|
|
16262
|
+
/* @__PURE__ */ jsx195("p", { className: "text-muted-foreground text-sm", children: t("waitlist.confirmation.success_hint") })
|
|
15877
16263
|
] });
|
|
15878
16264
|
}
|
|
15879
16265
|
__name(WaitlistConfirmation, "WaitlistConfirmation");
|
|
15880
16266
|
|
|
15881
16267
|
// src/features/waitlist/components/lists/WaitlistList.tsx
|
|
15882
16268
|
import { flexRender as flexRender2, getCoreRowModel as getCoreRowModel2, useReactTable as useReactTable2 } from "@tanstack/react-table";
|
|
15883
|
-
import { RefreshCw as RefreshCw4, Users } from "lucide-react";
|
|
16269
|
+
import { RefreshCw as RefreshCw4, Users as Users2 } from "lucide-react";
|
|
15884
16270
|
import { useTranslations as useTranslations81 } from "next-intl";
|
|
15885
|
-
import { useCallback as
|
|
16271
|
+
import { useCallback as useCallback31, useEffect as useEffect56, useState as useState75 } from "react";
|
|
15886
16272
|
|
|
15887
16273
|
// src/features/waitlist/hooks/useWaitlistTableStructure.tsx
|
|
15888
16274
|
import { Send } from "lucide-react";
|
|
15889
16275
|
import { useTranslations as useTranslations80 } from "next-intl";
|
|
15890
|
-
import { jsx as
|
|
16276
|
+
import { jsx as jsx196, jsxs as jsxs126 } from "react/jsx-runtime";
|
|
15891
16277
|
function parseQuestionnaire(questionnaire) {
|
|
15892
16278
|
if (!questionnaire) return null;
|
|
15893
16279
|
try {
|
|
@@ -15909,13 +16295,13 @@ function useWaitlistTableStructure({
|
|
|
15909
16295
|
registered: { variant: "default" }
|
|
15910
16296
|
};
|
|
15911
16297
|
const config = variants[status];
|
|
15912
|
-
return /* @__PURE__ */
|
|
16298
|
+
return /* @__PURE__ */ jsx196(Badge, { variant: config.variant, children: t(`waitlist.admin.status.${status}`) });
|
|
15913
16299
|
}, "getStatusBadge");
|
|
15914
16300
|
return [
|
|
15915
16301
|
{
|
|
15916
16302
|
accessorKey: "email",
|
|
15917
16303
|
header: t("waitlist.admin.columns.email"),
|
|
15918
|
-
cell: /* @__PURE__ */ __name(({ row }) => /* @__PURE__ */
|
|
16304
|
+
cell: /* @__PURE__ */ __name(({ row }) => /* @__PURE__ */ jsx196("span", { className: "font-medium", children: row.original.email }), "cell")
|
|
15919
16305
|
},
|
|
15920
16306
|
{
|
|
15921
16307
|
accessorKey: "status",
|
|
@@ -15936,17 +16322,17 @@ function useWaitlistTableStructure({
|
|
|
15936
16322
|
cell: /* @__PURE__ */ __name(({ row }) => {
|
|
15937
16323
|
const questionnaire = parseQuestionnaire(row.original.questionnaire);
|
|
15938
16324
|
if (!questionnaire || Object.keys(questionnaire).length === 0) {
|
|
15939
|
-
return /* @__PURE__ */
|
|
16325
|
+
return /* @__PURE__ */ jsx196("span", { className: "text-muted-foreground", children: "-" });
|
|
15940
16326
|
}
|
|
15941
|
-
return /* @__PURE__ */
|
|
15942
|
-
/* @__PURE__ */
|
|
15943
|
-
/* @__PURE__ */
|
|
15944
|
-
/* @__PURE__ */
|
|
16327
|
+
return /* @__PURE__ */ jsxs126("details", { className: "cursor-pointer", children: [
|
|
16328
|
+
/* @__PURE__ */ jsx196("summary", { className: "text-primary text-sm", children: t("waitlist.admin.questionnaire.view_answers") }),
|
|
16329
|
+
/* @__PURE__ */ jsx196("div", { className: "bg-muted mt-2 rounded p-2 text-sm", children: Object.entries(questionnaire).map(([key, value]) => /* @__PURE__ */ jsxs126("div", { className: "mb-1", children: [
|
|
16330
|
+
/* @__PURE__ */ jsxs126("span", { className: "font-medium", children: [
|
|
15945
16331
|
key,
|
|
15946
16332
|
":"
|
|
15947
16333
|
] }),
|
|
15948
16334
|
" ",
|
|
15949
|
-
/* @__PURE__ */
|
|
16335
|
+
/* @__PURE__ */ jsx196("span", { className: "text-muted-foreground", children: Array.isArray(value) ? value.join(", ") : String(value) })
|
|
15950
16336
|
] }, key)) })
|
|
15951
16337
|
] });
|
|
15952
16338
|
}, "cell")
|
|
@@ -15957,18 +16343,18 @@ function useWaitlistTableStructure({
|
|
|
15957
16343
|
cell: /* @__PURE__ */ __name(({ row }) => {
|
|
15958
16344
|
const entry = row.original;
|
|
15959
16345
|
if (entry.status === "confirmed") {
|
|
15960
|
-
return /* @__PURE__ */
|
|
15961
|
-
/* @__PURE__ */
|
|
16346
|
+
return /* @__PURE__ */ jsxs126(Button, { size: "sm", variant: "outline", onClick: () => onInvite(entry), children: [
|
|
16347
|
+
/* @__PURE__ */ jsx196(Send, { className: "mr-2 h-4 w-4" }),
|
|
15962
16348
|
t("waitlist.admin.actions.invite")
|
|
15963
16349
|
] });
|
|
15964
16350
|
}
|
|
15965
16351
|
if (entry.status === "invited" && entry.invitedAt) {
|
|
15966
|
-
return /* @__PURE__ */
|
|
16352
|
+
return /* @__PURE__ */ jsx196("span", { className: "text-muted-foreground text-sm", children: t("waitlist.admin.actions.invited_on", { date: new Date(entry.invitedAt).toLocaleDateString() }) });
|
|
15967
16353
|
}
|
|
15968
16354
|
if (entry.status === "registered") {
|
|
15969
|
-
return /* @__PURE__ */
|
|
16355
|
+
return /* @__PURE__ */ jsx196("span", { className: "text-muted-foreground text-sm", children: t("waitlist.admin.actions.registered") });
|
|
15970
16356
|
}
|
|
15971
|
-
return /* @__PURE__ */
|
|
16357
|
+
return /* @__PURE__ */ jsx196("span", { className: "text-muted-foreground text-sm", children: t("waitlist.admin.actions.awaiting_confirmation") });
|
|
15972
16358
|
}, "cell")
|
|
15973
16359
|
}
|
|
15974
16360
|
];
|
|
@@ -15976,14 +16362,14 @@ function useWaitlistTableStructure({
|
|
|
15976
16362
|
__name(useWaitlistTableStructure, "useWaitlistTableStructure");
|
|
15977
16363
|
|
|
15978
16364
|
// src/features/waitlist/components/lists/WaitlistList.tsx
|
|
15979
|
-
import { jsx as
|
|
16365
|
+
import { jsx as jsx197, jsxs as jsxs127 } from "react/jsx-runtime";
|
|
15980
16366
|
function WaitlistList() {
|
|
15981
16367
|
const t = useTranslations81();
|
|
15982
|
-
const [entries, setEntries] =
|
|
15983
|
-
const [total, setTotal] =
|
|
15984
|
-
const [isLoading, setIsLoading] =
|
|
15985
|
-
const [statusFilter, setStatusFilter] =
|
|
15986
|
-
const loadEntries =
|
|
16368
|
+
const [entries, setEntries] = useState75([]);
|
|
16369
|
+
const [total, setTotal] = useState75(0);
|
|
16370
|
+
const [isLoading, setIsLoading] = useState75(true);
|
|
16371
|
+
const [statusFilter, setStatusFilter] = useState75("all");
|
|
16372
|
+
const loadEntries = useCallback31(async () => {
|
|
15987
16373
|
setIsLoading(true);
|
|
15988
16374
|
try {
|
|
15989
16375
|
const result = await WaitlistService.findMany({
|
|
@@ -15998,7 +16384,7 @@ function WaitlistList() {
|
|
|
15998
16384
|
setIsLoading(false);
|
|
15999
16385
|
}
|
|
16000
16386
|
}, [statusFilter]);
|
|
16001
|
-
|
|
16387
|
+
useEffect56(() => {
|
|
16002
16388
|
loadEntries();
|
|
16003
16389
|
}, [loadEntries]);
|
|
16004
16390
|
const handleInvite = /* @__PURE__ */ __name(async (entry) => {
|
|
@@ -16016,34 +16402,34 @@ function WaitlistList() {
|
|
|
16016
16402
|
columns,
|
|
16017
16403
|
getCoreRowModel: getCoreRowModel2()
|
|
16018
16404
|
});
|
|
16019
|
-
return /* @__PURE__ */
|
|
16020
|
-
/* @__PURE__ */
|
|
16021
|
-
/* @__PURE__ */
|
|
16022
|
-
/* @__PURE__ */
|
|
16023
|
-
/* @__PURE__ */
|
|
16024
|
-
/* @__PURE__ */
|
|
16405
|
+
return /* @__PURE__ */ jsxs127("div", { className: "space-y-4", children: [
|
|
16406
|
+
/* @__PURE__ */ jsxs127("div", { className: "flex items-center justify-between", children: [
|
|
16407
|
+
/* @__PURE__ */ jsxs127("div", { className: "flex items-center gap-2", children: [
|
|
16408
|
+
/* @__PURE__ */ jsx197(Users2, { className: "h-5 w-5" }),
|
|
16409
|
+
/* @__PURE__ */ jsx197("h2", { className: "text-xl font-semibold", children: t("waitlist.admin.title") }),
|
|
16410
|
+
/* @__PURE__ */ jsxs127("span", { className: "text-muted-foreground", children: [
|
|
16025
16411
|
"(",
|
|
16026
16412
|
t("waitlist.admin.entries_count", { count: total }),
|
|
16027
16413
|
")"
|
|
16028
16414
|
] })
|
|
16029
16415
|
] }),
|
|
16030
|
-
/* @__PURE__ */
|
|
16031
|
-
/* @__PURE__ */
|
|
16032
|
-
/* @__PURE__ */
|
|
16033
|
-
/* @__PURE__ */
|
|
16034
|
-
/* @__PURE__ */
|
|
16035
|
-
/* @__PURE__ */
|
|
16036
|
-
/* @__PURE__ */
|
|
16037
|
-
/* @__PURE__ */
|
|
16038
|
-
/* @__PURE__ */
|
|
16416
|
+
/* @__PURE__ */ jsxs127("div", { className: "flex items-center gap-4", children: [
|
|
16417
|
+
/* @__PURE__ */ jsxs127(Select, { value: statusFilter, onValueChange: (value) => setStatusFilter(value ?? "all"), children: [
|
|
16418
|
+
/* @__PURE__ */ jsx197(SelectTrigger, { className: "w-40", children: /* @__PURE__ */ jsx197(SelectValue, { placeholder: t("waitlist.admin.filter_placeholder") }) }),
|
|
16419
|
+
/* @__PURE__ */ jsxs127(SelectContent, { children: [
|
|
16420
|
+
/* @__PURE__ */ jsx197(SelectItem, { value: "all", children: t("waitlist.admin.all_statuses") }),
|
|
16421
|
+
/* @__PURE__ */ jsx197(SelectItem, { value: "pending", children: t("waitlist.admin.status.pending") }),
|
|
16422
|
+
/* @__PURE__ */ jsx197(SelectItem, { value: "confirmed", children: t("waitlist.admin.status.confirmed") }),
|
|
16423
|
+
/* @__PURE__ */ jsx197(SelectItem, { value: "invited", children: t("waitlist.admin.status.invited") }),
|
|
16424
|
+
/* @__PURE__ */ jsx197(SelectItem, { value: "registered", children: t("waitlist.admin.status.registered") })
|
|
16039
16425
|
] })
|
|
16040
16426
|
] }),
|
|
16041
|
-
/* @__PURE__ */
|
|
16427
|
+
/* @__PURE__ */ jsx197(Button, { variant: "outline", size: "icon", onClick: loadEntries, disabled: isLoading, children: /* @__PURE__ */ jsx197(RefreshCw4, { className: `h-4 w-4 ${isLoading ? "animate-spin" : ""}` }) })
|
|
16042
16428
|
] })
|
|
16043
16429
|
] }),
|
|
16044
|
-
/* @__PURE__ */
|
|
16045
|
-
/* @__PURE__ */
|
|
16046
|
-
/* @__PURE__ */
|
|
16430
|
+
/* @__PURE__ */ jsx197("div", { className: "rounded-md border", children: /* @__PURE__ */ jsxs127(Table, { children: [
|
|
16431
|
+
/* @__PURE__ */ jsx197(TableHeader, { children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsx197(TableRow, { children: headerGroup.headers.map((header) => /* @__PURE__ */ jsx197(TableHead, { children: header.isPlaceholder ? null : flexRender2(header.column.columnDef.header, header.getContext()) }, header.id)) }, headerGroup.id)) }),
|
|
16432
|
+
/* @__PURE__ */ jsx197(TableBody, { children: isLoading ? /* @__PURE__ */ jsx197(TableRow, { children: /* @__PURE__ */ jsx197(TableCell, { colSpan: columns.length, className: "h-24 text-center", children: t("waitlist.admin.loading") }) }) : entries.length === 0 ? /* @__PURE__ */ jsx197(TableRow, { children: /* @__PURE__ */ jsx197(TableCell, { colSpan: columns.length, className: "h-24 text-center", children: t("waitlist.admin.empty") }) }) : table.getRowModel().rows.map((row) => /* @__PURE__ */ jsx197(TableRow, { children: row.getVisibleCells().map((cell) => /* @__PURE__ */ jsx197(TableCell, { children: flexRender2(cell.column.columnDef.cell, cell.getContext()) }, cell.id)) }, row.id)) })
|
|
16047
16433
|
] }) })
|
|
16048
16434
|
] });
|
|
16049
16435
|
}
|
|
@@ -16435,6 +16821,9 @@ export {
|
|
|
16435
16821
|
NotificationModal,
|
|
16436
16822
|
PushNotificationProvider,
|
|
16437
16823
|
OnboardingCard,
|
|
16824
|
+
ReferralCodeCapture,
|
|
16825
|
+
ReferralWidget,
|
|
16826
|
+
ReferralDialog,
|
|
16438
16827
|
RoleProvider,
|
|
16439
16828
|
useRoleContext,
|
|
16440
16829
|
RoleDetails,
|
|
@@ -16490,4 +16879,4 @@ export {
|
|
|
16490
16879
|
useOAuthClients,
|
|
16491
16880
|
useOAuthClient
|
|
16492
16881
|
};
|
|
16493
|
-
//# sourceMappingURL=chunk-
|
|
16882
|
+
//# sourceMappingURL=chunk-EA3EPEDL.mjs.map
|