@authowl/react 0.14.0 → 0.15.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/dist/index.js CHANGED
@@ -610,6 +610,8 @@ var en = {
610
610
  "userButton.openMenuAria": "Account menu",
611
611
  "signOut.button": "Sign out",
612
612
  "badge.securedBy": "Secured by {brand}",
613
+ "branding.environment.development": "Development",
614
+ "branding.environment.production": "Production",
613
615
  "qr.ariaLabel": "QR code",
614
616
  "serverError.INVALID_EMAIL_OR_PASSWORD": "Incorrect email or password.",
615
617
  "serverError.USER_ALREADY_EXISTS": "An account with this email already exists.",
@@ -1025,6 +1027,8 @@ var ar = {
1025
1027
  "userButton.openMenuAria": "\u0642\u0627\u0626\u0645\u0629 \u0627\u0644\u062D\u0633\u0627\u0628",
1026
1028
  "signOut.button": "\u062A\u0633\u062C\u064A\u0644 \u0627\u0644\u062E\u0631\u0648\u062C",
1027
1029
  "badge.securedBy": "\u0645\u062D\u0645\u064A \u0628\u0648\u0627\u0633\u0637\u0629 {brand}",
1030
+ "branding.environment.development": "\u0628\u064A\u0626\u0629 \u0627\u0644\u062A\u0637\u0648\u064A\u0631",
1031
+ "branding.environment.production": "\u0628\u064A\u0626\u0629 \u0627\u0644\u0625\u0646\u062A\u0627\u062C",
1028
1032
  "qr.ariaLabel": "\u0631\u0645\u0632 QR",
1029
1033
  "serverError.INVALID_EMAIL_OR_PASSWORD": "\u0627\u0644\u0628\u0631\u064A\u062F \u0627\u0644\u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A \u0623\u0648 \u0643\u0644\u0645\u0629 \u0627\u0644\u0645\u0631\u0648\u0631 \u063A\u064A\u0631 \u0635\u062D\u064A\u062D\u0629.",
1030
1034
  "serverError.USER_ALREADY_EXISTS": "\u064A\u0648\u062C\u062F \u062D\u0633\u0627\u0628 \u0645\u0633\u062C\u0644 \u0628\u0647\u0630\u0627 \u0627\u0644\u0628\u0631\u064A\u062F \u0627\u0644\u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A \u0628\u0627\u0644\u0641\u0639\u0644.",
@@ -1457,7 +1461,7 @@ function resolveSignInMethods(config) {
1457
1461
  const password = capabilities.passwordSignIn;
1458
1462
  const username = capabilities.usernameSignIn;
1459
1463
  const magicLink = capabilities.magicLinkSignIn;
1460
- const emailOtp = capabilities.emailOtpSignIn;
1464
+ const emailOtp = capabilities.emailOtpSignIn && !capabilities.totp && !capabilities.mfaRequired;
1461
1465
  const phoneOtp = capabilities.phoneSignIn;
1462
1466
  const passkey = capabilities.passkeySignIn;
1463
1467
  const sso = has("sso");
@@ -1488,7 +1492,7 @@ function resolveSignInMethods(config) {
1488
1492
  }
1489
1493
 
1490
1494
  // src/components/SignIn.tsx
1491
- import * as React12 from "react";
1495
+ import * as React13 from "react";
1492
1496
 
1493
1497
  // src/components/redirect.ts
1494
1498
  function isSafeRedirect(redirectTo, origin) {
@@ -2142,8 +2146,11 @@ function MFAChallenge({ onVerified, allowTrustDevice = true }) {
2142
2146
  }
2143
2147
  )
2144
2148
  ] }),
2145
- mode !== "backup" && allowTrustDevice && /* @__PURE__ */ jsxs8("label", { className: "ba-consent", children: [
2146
- /* @__PURE__ */ jsx12("input", { type: "checkbox", checked: trustDevice, onChange: (e) => setTrustDevice(e.target.checked) }),
2149
+ mode !== "backup" && allowTrustDevice && /* @__PURE__ */ jsxs8("label", { className: "ba-consent ba-consent-centered", children: [
2150
+ /* @__PURE__ */ jsxs8("span", { className: "ba-checkbox-control", children: [
2151
+ /* @__PURE__ */ jsx12("input", { className: "ba-checkbox", type: "checkbox", checked: trustDevice, onChange: (e) => setTrustDevice(e.target.checked) }),
2152
+ /* @__PURE__ */ jsx12("span", { className: "ba-checkbox-visual", "aria-hidden": "true", children: /* @__PURE__ */ jsx12("span", { className: "ba-checkbox-check" }) })
2153
+ ] }),
2147
2154
  /* @__PURE__ */ jsx12("span", { children: t("mfa.challenge.trustDevice", { days: 30 }) })
2148
2155
  ] }),
2149
2156
  /* @__PURE__ */ jsx12(FormError, { children: error }),
@@ -2409,9 +2416,65 @@ function PhoneOTP({ redirectTo, onSignedIn, onBack }) {
2409
2416
  );
2410
2417
  }
2411
2418
 
2419
+ // src/components/AuthOwlBranding.tsx
2420
+ import * as React12 from "react";
2421
+ import { jsx as jsx17, jsxs as jsxs13 } from "react/jsx-runtime";
2422
+ function AuthOwlBranding({ href, showEnvironment = true } = {}) {
2423
+ const t = useT();
2424
+ const { config } = usePublicConfig();
2425
+ const logoUrl = config?.branding?.logoUrl;
2426
+ const appName = config?.branding?.appName?.trim() ?? "";
2427
+ const showAppName = config?.branding?.showAppName !== false && appName.length > 0;
2428
+ const alignment = config?.branding?.alignment ?? "left";
2429
+ const [logoFailed, setLogoFailed] = React12.useState(false);
2430
+ React12.useEffect(() => setLogoFailed(false), [logoUrl]);
2431
+ if (!config) return null;
2432
+ if (!logoUrl && !showAppName && (!showEnvironment || !config.environmentType)) return null;
2433
+ const identity = /* @__PURE__ */ jsxs13("div", { className: "ba-branding-identity", children: [
2434
+ logoUrl && !logoFailed ? /* @__PURE__ */ jsx17(
2435
+ "img",
2436
+ {
2437
+ className: "ba-branding-logo",
2438
+ src: logoUrl,
2439
+ alt: showAppName ? `${appName} logo` : "Application logo",
2440
+ referrerPolicy: "no-referrer",
2441
+ onError: () => setLogoFailed(true)
2442
+ }
2443
+ ) : showAppName ? /* @__PURE__ */ jsx17("span", { className: "ba-branding-fallback", "aria-hidden": "true", children: appName.charAt(0).toLocaleUpperCase() }) : null,
2444
+ showAppName ? /* @__PURE__ */ jsx17("span", { className: "ba-branding-name", children: appName }) : null
2445
+ ] });
2446
+ return /* @__PURE__ */ jsxs13(
2447
+ "header",
2448
+ {
2449
+ className: `ba-branding ba-branding-align-${alignment}`,
2450
+ "data-testid": "authowl-branding",
2451
+ children: [
2452
+ href ? /* @__PURE__ */ jsx17("a", { className: "ba-branding-link", href, children: identity }) : identity,
2453
+ showEnvironment && config.environmentType ? /* @__PURE__ */ jsxs13(
2454
+ "span",
2455
+ {
2456
+ className: `ba-environment ba-environment-${config.environmentType}`,
2457
+ "data-testid": "authowl-environment",
2458
+ children: [
2459
+ /* @__PURE__ */ jsx17("span", { className: "ba-environment-dot", "aria-hidden": "true" }),
2460
+ t(`branding.environment.${config.environmentType}`)
2461
+ ]
2462
+ }
2463
+ ) : null
2464
+ ]
2465
+ }
2466
+ );
2467
+ }
2468
+
2412
2469
  // src/components/SignIn.tsx
2413
- import { Fragment as Fragment5, jsx as jsx17, jsxs as jsxs13 } from "react/jsx-runtime";
2414
- function SignIn({ redirectTo, onSignedIn, resetPasswordUrl, showBadge } = {}) {
2470
+ import { Fragment as Fragment5, jsx as jsx18, jsxs as jsxs14 } from "react/jsx-runtime";
2471
+ function SignIn({
2472
+ redirectTo,
2473
+ onSignedIn,
2474
+ resetPasswordUrl,
2475
+ showBadge,
2476
+ showBranding = true
2477
+ } = {}) {
2415
2478
  const t = useT();
2416
2479
  const { sessionStore } = useAuthClient();
2417
2480
  const {
@@ -2425,47 +2488,51 @@ function SignIn({ redirectTo, onSignedIn, resetPasswordUrl, showBadge } = {}) {
2425
2488
  const { config, isLoading, isError } = usePublicConfig();
2426
2489
  const { pending, error, setError, run } = useSubmitAction();
2427
2490
  const authChallenge = useAuthChallenge();
2428
- const [email, setEmail] = React12.useState("");
2429
- const [username, setUsername] = React12.useState("");
2430
- const [password, setPassword] = React12.useState("");
2431
- const [credentialMode, setCredentialMode] = React12.useState("email");
2432
- const [otp, setOtp] = React12.useState("");
2433
- const [view, setView] = React12.useState(
2491
+ const [email, setEmail] = React13.useState("");
2492
+ const [username, setUsername] = React13.useState("");
2493
+ const [password, setPassword] = React13.useState("");
2494
+ const [credentialMode, setCredentialMode] = React13.useState("email");
2495
+ const [otp, setOtp] = React13.useState("");
2496
+ const [view, setView] = React13.useState(
2434
2497
  "sign-in"
2435
2498
  );
2436
- const [inFlight, setInFlight] = React12.useState(null);
2437
- const [challenge, setChallenge] = React12.useState(false);
2438
- const emailRef = React12.useRef(null);
2499
+ const [inFlight, setInFlight] = React13.useState(null);
2500
+ const [challenge, setChallenge] = React13.useState(false);
2501
+ const emailRef = React13.useRef(null);
2439
2502
  const plan = resolveSignInMethods(config);
2440
2503
  usePasskeyAutofill({
2441
2504
  enabled: credentialMode === "email" && plan.autofillHost !== null,
2442
2505
  redirectTo,
2443
2506
  onSignedIn
2444
2507
  });
2445
- const badge = /* @__PURE__ */ jsx17(AuthOwlBadge, { force: showBadge });
2508
+ const badge = /* @__PURE__ */ jsx18(AuthOwlBadge, { force: showBadge });
2509
+ const branding = showBranding ? /* @__PURE__ */ jsx18(AuthOwlBranding, {}) : null;
2446
2510
  if (isLoading) {
2447
- return /* @__PURE__ */ jsxs13("div", { className: "ba-form", "data-testid": "signin-loading", "aria-busy": "true", children: [
2448
- /* @__PURE__ */ jsx17("div", { className: "ba-skeleton" }),
2449
- /* @__PURE__ */ jsx17("div", { className: "ba-skeleton" })
2511
+ return /* @__PURE__ */ jsxs14("div", { className: "ba-form", "data-testid": "signin-loading", "aria-busy": "true", children: [
2512
+ /* @__PURE__ */ jsx18("div", { className: "ba-skeleton" }),
2513
+ /* @__PURE__ */ jsx18("div", { className: "ba-skeleton" })
2450
2514
  ] });
2451
2515
  }
2452
2516
  if (challenge) {
2453
- return /* @__PURE__ */ jsxs13("div", { className: "ba-form", "data-testid": "signin-mfa", children: [
2454
- /* @__PURE__ */ jsx17(MFAChallenge, { onVerified: () => finishSignIn({ sessionStore, redirectTo, onSignedIn }) }),
2517
+ return /* @__PURE__ */ jsxs14("div", { className: "ba-form", "data-testid": "signin-mfa", children: [
2518
+ branding,
2519
+ /* @__PURE__ */ jsx18(MFAChallenge, { onVerified: () => finishSignIn({ sessionStore, redirectTo, onSignedIn }) }),
2455
2520
  badge
2456
2521
  ] });
2457
2522
  }
2458
2523
  if (view === "forgot" && resetPasswordUrl) {
2459
- return /* @__PURE__ */ jsxs13("div", { className: "ba-form", "data-testid": "signin-forgot", children: [
2460
- /* @__PURE__ */ jsx17("h2", { className: "ba-title", children: t("signIn.forgotTitle") }),
2461
- /* @__PURE__ */ jsx17(ForgotPassword, { resetPasswordUrl, onBack: () => setView("sign-in") }),
2524
+ return /* @__PURE__ */ jsxs14("div", { className: "ba-form", "data-testid": "signin-forgot", children: [
2525
+ branding,
2526
+ /* @__PURE__ */ jsx18("h2", { className: "ba-title", children: t("signIn.forgotTitle") }),
2527
+ /* @__PURE__ */ jsx18(ForgotPassword, { resetPasswordUrl, onBack: () => setView("sign-in") }),
2462
2528
  badge
2463
2529
  ] });
2464
2530
  }
2465
2531
  if (view === "otp-code") {
2466
- return /* @__PURE__ */ jsxs13("div", { className: "ba-form", "data-testid": "signin-otp-code", children: [
2467
- /* @__PURE__ */ jsx17("h2", { className: "ba-title", children: t("signIn.title") }),
2468
- /* @__PURE__ */ jsx17(
2532
+ return /* @__PURE__ */ jsxs14("div", { className: "ba-form", "data-testid": "signin-otp-code", children: [
2533
+ branding,
2534
+ /* @__PURE__ */ jsx18("h2", { className: "ba-title", children: t("signIn.title") }),
2535
+ /* @__PURE__ */ jsx18(
2469
2536
  OtpCodeForm,
2470
2537
  {
2471
2538
  email,
@@ -2491,16 +2558,18 @@ function SignIn({ redirectTo, onSignedIn, resetPasswordUrl, showBadge } = {}) {
2491
2558
  ] });
2492
2559
  }
2493
2560
  if (view === "magic-sent") {
2494
- return /* @__PURE__ */ jsxs13("div", { className: "ba-form", "data-testid": "signin-magic-sent", children: [
2495
- /* @__PURE__ */ jsx17("h2", { className: "ba-title", children: t("signIn.title") }),
2496
- /* @__PURE__ */ jsx17("p", { className: "ba-muted", children: t("magicLink.sent") }),
2497
- /* @__PURE__ */ jsx17("button", { type: "button", className: "ba-link-button", onClick: () => setView("sign-in"), children: t("forgotPassword.backToSignIn") }),
2561
+ return /* @__PURE__ */ jsxs14("div", { className: "ba-form", "data-testid": "signin-magic-sent", children: [
2562
+ branding,
2563
+ /* @__PURE__ */ jsx18("h2", { className: "ba-title", children: t("signIn.title") }),
2564
+ /* @__PURE__ */ jsx18("p", { className: "ba-muted", children: t("magicLink.sent") }),
2565
+ /* @__PURE__ */ jsx18("button", { type: "button", className: "ba-link-button", onClick: () => setView("sign-in"), children: t("forgotPassword.backToSignIn") }),
2498
2566
  badge
2499
2567
  ] });
2500
2568
  }
2501
2569
  if (view === "phone") {
2502
- return /* @__PURE__ */ jsxs13("div", { className: "ba-form", "data-testid": "signin-phone", children: [
2503
- /* @__PURE__ */ jsx17(
2570
+ return /* @__PURE__ */ jsxs14("div", { className: "ba-form", "data-testid": "signin-phone", children: [
2571
+ branding,
2572
+ /* @__PURE__ */ jsx18(
2504
2573
  PhoneOTP,
2505
2574
  {
2506
2575
  redirectTo,
@@ -2572,12 +2641,13 @@ function SignIn({ redirectTo, onSignedIn, resetPasswordUrl, showBadge } = {}) {
2572
2641
  { key: "otp", enabled: plan.emailOtp, action: doRequestOtp, label: t("emailOtp.requestSubmit"), pendingLabel: t("common.sending") },
2573
2642
  { key: "sso", enabled: plan.sso, action: doSso, label: t("sso.continueWith"), pendingLabel: t("sso.redirecting") }
2574
2643
  ];
2575
- return /* @__PURE__ */ jsxs13("div", { className: "ba-form", "data-testid": "signin-form", children: [
2576
- /* @__PURE__ */ jsx17("h2", { className: "ba-title", children: t("signIn.title") }),
2577
- process.env.NODE_ENV !== "production" && isError && /* @__PURE__ */ jsx17("p", { className: "ba-muted", "data-testid": "signin-dev-config-notice", children: "AuthOwl (dev): couldn't load this project's config, so this is a password-only fallback that may not match the project's enabled sign-in methods. Check apiUrl / publishableKey; see the console for details." }),
2578
- /* @__PURE__ */ jsx17(SocialButtons, { providers: plan.social, callbackURL: redirectTo }),
2579
- showDivider && /* @__PURE__ */ jsx17("div", { className: "ba-divider", children: t("common.orDivider") }),
2580
- hasCredentialForm && /* @__PURE__ */ jsxs13(
2644
+ return /* @__PURE__ */ jsxs14("div", { className: "ba-form", "data-testid": "signin-form", children: [
2645
+ branding,
2646
+ /* @__PURE__ */ jsx18("h2", { className: "ba-title", children: t("signIn.title") }),
2647
+ process.env.NODE_ENV !== "production" && isError && /* @__PURE__ */ jsx18("p", { className: "ba-muted", "data-testid": "signin-dev-config-notice", children: "AuthOwl (dev): couldn't load this project's config, so this is a password-only fallback that may not match the project's enabled sign-in methods. Check apiUrl / publishableKey; see the console for details." }),
2648
+ /* @__PURE__ */ jsx18(SocialButtons, { providers: plan.social, callbackURL: redirectTo }),
2649
+ showDivider && /* @__PURE__ */ jsx18("div", { className: "ba-divider", children: t("common.orDivider") }),
2650
+ hasCredentialForm && /* @__PURE__ */ jsxs14(
2581
2651
  "form",
2582
2652
  {
2583
2653
  method: "post",
@@ -2588,9 +2658,9 @@ function SignIn({ redirectTo, onSignedIn, resetPasswordUrl, showBadge } = {}) {
2588
2658
  else if (plan.primary) PRIMARY_ACTION[plan.primary]();
2589
2659
  },
2590
2660
  children: [
2591
- credentialMode === "email" ? /* @__PURE__ */ jsxs13("label", { className: "ba-label", children: [
2661
+ credentialMode === "email" ? /* @__PURE__ */ jsxs14("label", { className: "ba-label", children: [
2592
2662
  t("common.emailLabel"),
2593
- /* @__PURE__ */ jsx17(
2663
+ /* @__PURE__ */ jsx18(
2594
2664
  "input",
2595
2665
  {
2596
2666
  ref: emailRef,
@@ -2605,9 +2675,9 @@ function SignIn({ redirectTo, onSignedIn, resetPasswordUrl, showBadge } = {}) {
2605
2675
  required: true
2606
2676
  }
2607
2677
  )
2608
- ] }) : /* @__PURE__ */ jsxs13("label", { className: "ba-label", children: [
2678
+ ] }) : /* @__PURE__ */ jsxs14("label", { className: "ba-label", children: [
2609
2679
  t("common.usernameLabel"),
2610
- /* @__PURE__ */ jsx17(
2680
+ /* @__PURE__ */ jsx18(
2611
2681
  "input",
2612
2682
  {
2613
2683
  className: "ba-input",
@@ -2622,9 +2692,9 @@ function SignIn({ redirectTo, onSignedIn, resetPasswordUrl, showBadge } = {}) {
2622
2692
  }
2623
2693
  )
2624
2694
  ] }),
2625
- plan.password && /* @__PURE__ */ jsxs13("label", { className: "ba-label", children: [
2695
+ plan.password && /* @__PURE__ */ jsxs14("label", { className: "ba-label", children: [
2626
2696
  t("common.passwordLabel"),
2627
- /* @__PURE__ */ jsx17(
2697
+ /* @__PURE__ */ jsx18(
2628
2698
  "input",
2629
2699
  {
2630
2700
  className: "ba-input",
@@ -2640,19 +2710,19 @@ function SignIn({ redirectTo, onSignedIn, resetPasswordUrl, showBadge } = {}) {
2640
2710
  )
2641
2711
  ] }),
2642
2712
  authChallenge.control,
2643
- /* @__PURE__ */ jsx17(FormError, { children: error }),
2644
- plan.password && /* @__PURE__ */ jsxs13(Fragment5, { children: [
2645
- /* @__PURE__ */ jsx17(
2713
+ /* @__PURE__ */ jsx18(FormError, { children: error }),
2714
+ plan.password && /* @__PURE__ */ jsxs14(Fragment5, { children: [
2715
+ /* @__PURE__ */ jsx18(
2646
2716
  "button",
2647
2717
  {
2648
2718
  className: "ba-button",
2649
2719
  type: "submit",
2650
2720
  disabled: pending || authChallenge.configPending,
2651
2721
  "aria-busy": pending && inFlight === "password" || void 0,
2652
- children: /* @__PURE__ */ jsx17(Busy, { busy: pending && inFlight === "password", label: t("signIn.submitPending"), children: t("signIn.submit") })
2722
+ children: /* @__PURE__ */ jsx18(Busy, { busy: pending && inFlight === "password", label: t("signIn.submitPending"), children: t("signIn.submit") })
2653
2723
  }
2654
2724
  ),
2655
- resetPasswordUrl && /* @__PURE__ */ jsx17(
2725
+ resetPasswordUrl && /* @__PURE__ */ jsx18(
2656
2726
  "button",
2657
2727
  {
2658
2728
  type: "button",
@@ -2664,7 +2734,7 @@ function SignIn({ redirectTo, onSignedIn, resetPasswordUrl, showBadge } = {}) {
2664
2734
  ] }),
2665
2735
  credentialMode === "email" && alternates.filter((a) => a.enabled).map(({ key, action, label: label2, pendingLabel }) => {
2666
2736
  const isPrimary = plan.primary === key;
2667
- return /* @__PURE__ */ jsx17(
2737
+ return /* @__PURE__ */ jsx18(
2668
2738
  "button",
2669
2739
  {
2670
2740
  type: isPrimary ? "submit" : "button",
@@ -2672,12 +2742,12 @@ function SignIn({ redirectTo, onSignedIn, resetPasswordUrl, showBadge } = {}) {
2672
2742
  disabled: pending || authChallenge.configPending,
2673
2743
  "aria-busy": pending && inFlight === key || void 0,
2674
2744
  onClick: isPrimary ? void 0 : withEmail(action),
2675
- children: /* @__PURE__ */ jsx17(Busy, { busy: pending && inFlight === key, label: pendingLabel, children: label2 })
2745
+ children: /* @__PURE__ */ jsx18(Busy, { busy: pending && inFlight === key, label: pendingLabel, children: label2 })
2676
2746
  },
2677
2747
  key
2678
2748
  );
2679
2749
  }),
2680
- plan.username && /* @__PURE__ */ jsx17(
2750
+ plan.username && /* @__PURE__ */ jsx18(
2681
2751
  "button",
2682
2752
  {
2683
2753
  type: "button",
@@ -2693,8 +2763,8 @@ function SignIn({ redirectTo, onSignedIn, resetPasswordUrl, showBadge } = {}) {
2693
2763
  ]
2694
2764
  }
2695
2765
  ),
2696
- plan.passkey && /* @__PURE__ */ jsx17(PasskeyButton, { redirectTo, onSignedIn }),
2697
- plan.phoneOtp && /* @__PURE__ */ jsx17(
2766
+ plan.passkey && /* @__PURE__ */ jsx18(PasskeyButton, { redirectTo, onSignedIn }),
2767
+ plan.phoneOtp && /* @__PURE__ */ jsx18(
2698
2768
  "button",
2699
2769
  {
2700
2770
  type: "button",
@@ -2703,17 +2773,17 @@ function SignIn({ redirectTo, onSignedIn, resetPasswordUrl, showBadge } = {}) {
2703
2773
  children: t("phoneOtp.usePhone")
2704
2774
  }
2705
2775
  ),
2706
- !plan.renderable && /* @__PURE__ */ jsx17("p", { className: "ba-muted", children: plan.emptyReason === "unsupported" ? t("signIn.empty.unsupported") : t("signIn.empty.none") }),
2776
+ !plan.renderable && /* @__PURE__ */ jsx18("p", { className: "ba-muted", children: plan.emptyReason === "unsupported" ? t("signIn.empty.unsupported") : t("signIn.empty.none") }),
2707
2777
  badge
2708
2778
  ] });
2709
2779
  }
2710
2780
 
2711
2781
  // src/components/SignUp.tsx
2712
- import * as React16 from "react";
2782
+ import * as React17 from "react";
2713
2783
 
2714
2784
  // src/components/VerificationPending.tsx
2715
- import * as React13 from "react";
2716
- import { jsx as jsx18, jsxs as jsxs14 } from "react/jsx-runtime";
2785
+ import * as React14 from "react";
2786
+ import { jsx as jsx19, jsxs as jsxs15 } from "react/jsx-runtime";
2717
2787
  function VerificationPending({
2718
2788
  email,
2719
2789
  callbackURL,
@@ -2727,14 +2797,14 @@ function VerificationPending({
2727
2797
  } = useEmailVerification();
2728
2798
  const { pending, error, run } = useSubmitAction();
2729
2799
  const authChallenge = useAuthChallenge();
2730
- const [resent, setResent] = React13.useState(false);
2731
- const [code, setCode] = React13.useState("");
2732
- const [verified, setVerified] = React13.useState(false);
2800
+ const [resent, setResent] = React14.useState(false);
2801
+ const [code, setCode] = React14.useState("");
2802
+ const [verified, setVerified] = React14.useState(false);
2733
2803
  if (verified) {
2734
- return /* @__PURE__ */ jsx18("p", { className: "ba-success", role: "status", "data-testid": "verify-code-success", children: t("verifyEmail.success") });
2804
+ return /* @__PURE__ */ jsx19("p", { className: "ba-success", role: "status", "data-testid": "verify-code-success", children: t("verifyEmail.success") });
2735
2805
  }
2736
2806
  if (method === "code") {
2737
- return /* @__PURE__ */ jsxs14(
2807
+ return /* @__PURE__ */ jsxs15(
2738
2808
  "form",
2739
2809
  {
2740
2810
  method: "post",
@@ -2751,12 +2821,12 @@ function VerificationPending({
2751
2821
  );
2752
2822
  },
2753
2823
  children: [
2754
- /* @__PURE__ */ jsx18("p", { className: "ba-muted", children: richMessage(t("verifyPending.codeBody"), {
2755
- email: /* @__PURE__ */ jsx18("strong", { children: /* @__PURE__ */ jsx18(Bidi, { children: email }) })
2824
+ /* @__PURE__ */ jsx19("p", { className: "ba-muted", children: richMessage(t("verifyPending.codeBody"), {
2825
+ email: /* @__PURE__ */ jsx19("strong", { children: /* @__PURE__ */ jsx19(Bidi, { children: email }) })
2756
2826
  }) }),
2757
- /* @__PURE__ */ jsxs14("label", { className: "ba-label", children: [
2827
+ /* @__PURE__ */ jsxs15("label", { className: "ba-label", children: [
2758
2828
  t("verifyPending.codeLabel"),
2759
- /* @__PURE__ */ jsx18(
2829
+ /* @__PURE__ */ jsx19(
2760
2830
  "input",
2761
2831
  {
2762
2832
  className: "ba-input",
@@ -2768,20 +2838,20 @@ function VerificationPending({
2768
2838
  }
2769
2839
  )
2770
2840
  ] }),
2771
- resent && /* @__PURE__ */ jsx18("p", { className: "ba-muted", children: t("verifyPending.resent") }),
2841
+ resent && /* @__PURE__ */ jsx19("p", { className: "ba-muted", children: t("verifyPending.resent") }),
2772
2842
  authChallenge.control,
2773
- /* @__PURE__ */ jsx18(FormError, { children: error }),
2774
- /* @__PURE__ */ jsx18(
2843
+ /* @__PURE__ */ jsx19(FormError, { children: error }),
2844
+ /* @__PURE__ */ jsx19(
2775
2845
  "button",
2776
2846
  {
2777
2847
  className: "ba-button",
2778
2848
  type: "submit",
2779
2849
  disabled: pending || !code,
2780
2850
  "aria-busy": pending || void 0,
2781
- children: /* @__PURE__ */ jsx18(Busy, { busy: pending, label: t("common.verifying"), children: t("emailOtp.verifySubmit") })
2851
+ children: /* @__PURE__ */ jsx19(Busy, { busy: pending, label: t("common.verifying"), children: t("emailOtp.verifySubmit") })
2782
2852
  }
2783
2853
  ),
2784
- /* @__PURE__ */ jsx18(
2854
+ /* @__PURE__ */ jsx19(
2785
2855
  "button",
2786
2856
  {
2787
2857
  type: "button",
@@ -2807,14 +2877,14 @@ function VerificationPending({
2807
2877
  }
2808
2878
  );
2809
2879
  }
2810
- return /* @__PURE__ */ jsxs14("div", { className: "ba-fields", "data-testid": "verify-pending", children: [
2811
- /* @__PURE__ */ jsx18("p", { className: "ba-muted", children: richMessage(t("verifyPending.body"), {
2812
- email: /* @__PURE__ */ jsx18("strong", { children: /* @__PURE__ */ jsx18(Bidi, { children: email }) })
2880
+ return /* @__PURE__ */ jsxs15("div", { className: "ba-fields", "data-testid": "verify-pending", children: [
2881
+ /* @__PURE__ */ jsx19("p", { className: "ba-muted", children: richMessage(t("verifyPending.body"), {
2882
+ email: /* @__PURE__ */ jsx19("strong", { children: /* @__PURE__ */ jsx19(Bidi, { children: email }) })
2813
2883
  }) }),
2814
- resent && /* @__PURE__ */ jsx18("p", { className: "ba-muted", children: t("verifyPending.resent") }),
2884
+ resent && /* @__PURE__ */ jsx19("p", { className: "ba-muted", children: t("verifyPending.resent") }),
2815
2885
  authChallenge.control,
2816
- /* @__PURE__ */ jsx18(FormError, { children: error }),
2817
- /* @__PURE__ */ jsx18(
2886
+ /* @__PURE__ */ jsx19(FormError, { children: error }),
2887
+ /* @__PURE__ */ jsx19(
2818
2888
  "button",
2819
2889
  {
2820
2890
  type: "button",
@@ -2825,25 +2895,25 @@ function VerificationPending({
2825
2895
  failure: t("verifyPending.error.resendFailed"),
2826
2896
  onSuccess: () => setResent(true)
2827
2897
  }),
2828
- children: /* @__PURE__ */ jsx18(Busy, { busy: pending, label: t("common.sending"), children: t("verifyPending.resendButton") })
2898
+ children: /* @__PURE__ */ jsx19(Busy, { busy: pending, label: t("common.sending"), children: t("verifyPending.resendButton") })
2829
2899
  }
2830
2900
  )
2831
2901
  ] });
2832
2902
  }
2833
2903
 
2834
2904
  // src/components/PasswordlessSignUp.tsx
2835
- import * as React14 from "react";
2836
- import { jsx as jsx19, jsxs as jsxs15 } from "react/jsx-runtime";
2905
+ import * as React15 from "react";
2906
+ import { jsx as jsx20, jsxs as jsxs16 } from "react/jsx-runtime";
2837
2907
  function PasswordlessSignUp({ onAuthenticated }) {
2838
2908
  const t = useT();
2839
2909
  const { sendEmailOtp, signInEmailOtp } = useSignIn();
2840
2910
  const { pending, error, setError, run } = useSubmitAction();
2841
2911
  const authChallenge = useAuthChallenge();
2842
- const [email, setEmail] = React14.useState("");
2843
- const [code, setCode] = React14.useState("");
2844
- const [codeSent, setCodeSent] = React14.useState(false);
2912
+ const [email, setEmail] = React15.useState("");
2913
+ const [code, setCode] = React15.useState("");
2914
+ const [codeSent, setCodeSent] = React15.useState(false);
2845
2915
  if (codeSent) {
2846
- return /* @__PURE__ */ jsx19("div", { className: "ba-fields", "data-testid": "signup-emailotp-code", children: /* @__PURE__ */ jsx19(
2916
+ return /* @__PURE__ */ jsx20("div", { className: "ba-fields", "data-testid": "signup-emailotp-code", children: /* @__PURE__ */ jsx20(
2847
2917
  OtpCodeForm,
2848
2918
  {
2849
2919
  email,
@@ -2863,7 +2933,7 @@ function PasswordlessSignUp({ onAuthenticated }) {
2863
2933
  }
2864
2934
  ) });
2865
2935
  }
2866
- return /* @__PURE__ */ jsxs15(
2936
+ return /* @__PURE__ */ jsxs16(
2867
2937
  "form",
2868
2938
  {
2869
2939
  method: "post",
@@ -2877,9 +2947,9 @@ function PasswordlessSignUp({ onAuthenticated }) {
2877
2947
  });
2878
2948
  },
2879
2949
  children: [
2880
- /* @__PURE__ */ jsxs15("label", { className: "ba-label", children: [
2950
+ /* @__PURE__ */ jsxs16("label", { className: "ba-label", children: [
2881
2951
  t("common.emailLabel"),
2882
- /* @__PURE__ */ jsx19(
2952
+ /* @__PURE__ */ jsx20(
2883
2953
  "input",
2884
2954
  {
2885
2955
  className: "ba-input",
@@ -2892,15 +2962,15 @@ function PasswordlessSignUp({ onAuthenticated }) {
2892
2962
  )
2893
2963
  ] }),
2894
2964
  authChallenge.control,
2895
- /* @__PURE__ */ jsx19(FormError, { children: error }),
2896
- /* @__PURE__ */ jsx19(
2965
+ /* @__PURE__ */ jsx20(FormError, { children: error }),
2966
+ /* @__PURE__ */ jsx20(
2897
2967
  "button",
2898
2968
  {
2899
2969
  className: "ba-button ba-button-secondary",
2900
2970
  type: "submit",
2901
2971
  disabled: pending || authChallenge.configPending,
2902
2972
  "aria-busy": pending || void 0,
2903
- children: /* @__PURE__ */ jsx19(Busy, { busy: pending, label: t("common.sending"), children: t("signUp.passwordlessSubmit") })
2973
+ children: /* @__PURE__ */ jsx20(Busy, { busy: pending, label: t("common.sending"), children: t("signUp.passwordlessSubmit") })
2904
2974
  }
2905
2975
  )
2906
2976
  ]
@@ -2909,16 +2979,16 @@ function PasswordlessSignUp({ onAuthenticated }) {
2909
2979
  }
2910
2980
 
2911
2981
  // src/components/PasskeySignUpCompletion.tsx
2912
- import { jsx as jsx20, jsxs as jsxs16 } from "react/jsx-runtime";
2982
+ import { jsx as jsx21, jsxs as jsxs17 } from "react/jsx-runtime";
2913
2983
  function PasskeySignUpCompletion({ onComplete }) {
2914
2984
  const t = useT();
2915
2985
  const { addPasskey } = usePasskeys();
2916
2986
  const { pending, error, run } = useSubmitAction();
2917
- return /* @__PURE__ */ jsxs16("div", { className: "ba-fields", "data-testid": "signup-passkey-completion", children: [
2918
- /* @__PURE__ */ jsx20("h3", { className: "ba-title", children: t("signUp.passkeyTitle") }),
2919
- /* @__PURE__ */ jsx20("p", { className: "ba-muted", children: t("signUp.passkeyDescription") }),
2920
- /* @__PURE__ */ jsx20(FormError, { children: error }),
2921
- /* @__PURE__ */ jsx20(
2987
+ return /* @__PURE__ */ jsxs17("div", { className: "ba-fields", "data-testid": "signup-passkey-completion", children: [
2988
+ /* @__PURE__ */ jsx21("h3", { className: "ba-title", children: t("signUp.passkeyTitle") }),
2989
+ /* @__PURE__ */ jsx21("p", { className: "ba-muted", children: t("signUp.passkeyDescription") }),
2990
+ /* @__PURE__ */ jsx21(FormError, { children: error }),
2991
+ /* @__PURE__ */ jsx21(
2922
2992
  "button",
2923
2993
  {
2924
2994
  className: "ba-button",
@@ -2929,34 +2999,36 @@ function PasskeySignUpCompletion({ onComplete }) {
2929
2999
  failure: t("signUp.error.passkeyFailed"),
2930
3000
  onSuccess: onComplete
2931
3001
  }),
2932
- children: /* @__PURE__ */ jsx20(Busy, { busy: pending, label: t("passkey.waiting"), children: t("signUp.passkeySubmit") })
3002
+ children: /* @__PURE__ */ jsx21(Busy, { busy: pending, label: t("passkey.waiting"), children: t("signUp.passkeySubmit") })
2933
3003
  }
2934
3004
  ),
2935
- /* @__PURE__ */ jsx20("button", { className: "ba-link-button", type: "button", disabled: pending, onClick: onComplete, children: t("signUp.passkeySkip") })
3005
+ /* @__PURE__ */ jsx21("button", { className: "ba-link-button", type: "button", disabled: pending, onClick: onComplete, children: t("signUp.passkeySkip") })
2936
3006
  ] });
2937
3007
  }
2938
3008
 
2939
3009
  // src/components/Waitlist.tsx
2940
- import * as React15 from "react";
2941
- import { jsx as jsx21, jsxs as jsxs17 } from "react/jsx-runtime";
2942
- function Waitlist({ onJoined, showBadge } = {}) {
3010
+ import * as React16 from "react";
3011
+ import { jsx as jsx22, jsxs as jsxs18 } from "react/jsx-runtime";
3012
+ function Waitlist({ onJoined, showBadge, showBranding = true } = {}) {
2943
3013
  const t = useT();
2944
3014
  const { join } = useWaitlist();
2945
3015
  const { pending, error, run } = useSubmitAction();
2946
3016
  const authChallenge = useAuthChallenge();
2947
- const [email, setEmail] = React15.useState("");
2948
- const [joined, setJoined] = React15.useState(false);
3017
+ const [email, setEmail] = React16.useState("");
3018
+ const [joined, setJoined] = React16.useState(false);
2949
3019
  if (joined) {
2950
- return /* @__PURE__ */ jsxs17("div", { className: "ba-form", "data-testid": "waitlist-accepted", children: [
2951
- /* @__PURE__ */ jsx21("h2", { className: "ba-title", children: t("waitlist.acceptedTitle") }),
2952
- /* @__PURE__ */ jsx21("p", { className: "ba-muted", children: t("waitlist.acceptedDescription") }),
2953
- /* @__PURE__ */ jsx21(AuthOwlBadge, { force: showBadge })
3020
+ return /* @__PURE__ */ jsxs18("div", { className: "ba-form", "data-testid": "waitlist-accepted", children: [
3021
+ showBranding ? /* @__PURE__ */ jsx22(AuthOwlBranding, {}) : null,
3022
+ /* @__PURE__ */ jsx22("h2", { className: "ba-title", children: t("waitlist.acceptedTitle") }),
3023
+ /* @__PURE__ */ jsx22("p", { className: "ba-muted", children: t("waitlist.acceptedDescription") }),
3024
+ /* @__PURE__ */ jsx22(AuthOwlBadge, { force: showBadge })
2954
3025
  ] });
2955
3026
  }
2956
- return /* @__PURE__ */ jsxs17("div", { className: "ba-form", "data-testid": "waitlist-form", children: [
2957
- /* @__PURE__ */ jsx21("h2", { className: "ba-title", children: t("waitlist.title") }),
2958
- /* @__PURE__ */ jsx21("p", { className: "ba-muted", children: t("waitlist.description") }),
2959
- /* @__PURE__ */ jsxs17(
3027
+ return /* @__PURE__ */ jsxs18("div", { className: "ba-form", "data-testid": "waitlist-form", children: [
3028
+ showBranding ? /* @__PURE__ */ jsx22(AuthOwlBranding, {}) : null,
3029
+ /* @__PURE__ */ jsx22("h2", { className: "ba-title", children: t("waitlist.title") }),
3030
+ /* @__PURE__ */ jsx22("p", { className: "ba-muted", children: t("waitlist.description") }),
3031
+ /* @__PURE__ */ jsxs18(
2960
3032
  "form",
2961
3033
  {
2962
3034
  method: "post",
@@ -2978,9 +3050,9 @@ function Waitlist({ onJoined, showBadge } = {}) {
2978
3050
  );
2979
3051
  },
2980
3052
  children: [
2981
- /* @__PURE__ */ jsxs17("label", { className: "ba-label", children: [
3053
+ /* @__PURE__ */ jsxs18("label", { className: "ba-label", children: [
2982
3054
  t("common.emailLabel"),
2983
- /* @__PURE__ */ jsx21(
3055
+ /* @__PURE__ */ jsx22(
2984
3056
  "input",
2985
3057
  {
2986
3058
  className: "ba-input",
@@ -2994,47 +3066,48 @@ function Waitlist({ onJoined, showBadge } = {}) {
2994
3066
  )
2995
3067
  ] }),
2996
3068
  authChallenge.control,
2997
- /* @__PURE__ */ jsx21(FormError, { children: error }),
2998
- /* @__PURE__ */ jsx21(
3069
+ /* @__PURE__ */ jsx22(FormError, { children: error }),
3070
+ /* @__PURE__ */ jsx22(
2999
3071
  "button",
3000
3072
  {
3001
3073
  className: "ba-button",
3002
3074
  type: "submit",
3003
3075
  disabled: pending || authChallenge.configPending,
3004
3076
  "aria-busy": pending || void 0,
3005
- children: /* @__PURE__ */ jsx21(Busy, { busy: pending, label: t("waitlist.submitPending"), children: t("waitlist.submit") })
3077
+ children: /* @__PURE__ */ jsx22(Busy, { busy: pending, label: t("waitlist.submitPending"), children: t("waitlist.submit") })
3006
3078
  }
3007
3079
  )
3008
3080
  ]
3009
3081
  }
3010
3082
  ),
3011
- /* @__PURE__ */ jsx21(AuthOwlBadge, { force: showBadge })
3083
+ /* @__PURE__ */ jsx22(AuthOwlBadge, { force: showBadge })
3012
3084
  ] });
3013
3085
  }
3014
3086
 
3015
3087
  // src/components/SignUp.tsx
3016
- import { Fragment as Fragment6, jsx as jsx22, jsxs as jsxs18 } from "react/jsx-runtime";
3088
+ import { Fragment as Fragment6, jsx as jsx23, jsxs as jsxs19 } from "react/jsx-runtime";
3017
3089
  function SignUp({
3018
3090
  redirectTo,
3019
3091
  onSignedUp,
3020
3092
  verifyEmailUrl,
3021
3093
  showBadge,
3022
- onWaitlisted
3094
+ onWaitlisted,
3095
+ showBranding = true
3023
3096
  } = {}) {
3024
3097
  const t = useT();
3025
3098
  const toServerError = useServerError();
3026
3099
  const { signUp } = useSignUp();
3027
3100
  const { config, isLoading } = usePublicConfig();
3028
3101
  const authChallenge = useAuthChallenge();
3029
- const [email, setEmail] = React16.useState("");
3030
- const [password, setPassword] = React16.useState("");
3031
- const [name, setName] = React16.useState("");
3032
- const [firstName, setFirstName] = React16.useState("");
3033
- const [lastName, setLastName] = React16.useState("");
3034
- const [username, setUsername] = React16.useState("");
3035
- const [error, setError] = React16.useState(null);
3036
- const [submitting, setSubmitting] = React16.useState(false);
3037
- const [accepted, setAccepted] = React16.useState(false);
3102
+ const [email, setEmail] = React17.useState("");
3103
+ const [password, setPassword] = React17.useState("");
3104
+ const [name, setName] = React17.useState("");
3105
+ const [firstName, setFirstName] = React17.useState("");
3106
+ const [lastName, setLastName] = React17.useState("");
3107
+ const [username, setUsername] = React17.useState("");
3108
+ const [error, setError] = React17.useState(null);
3109
+ const [submitting, setSubmitting] = React17.useState(false);
3110
+ const [accepted, setAccepted] = React17.useState(false);
3038
3111
  const legal = config?.legal;
3039
3112
  const consentRequired = Boolean(legal?.required);
3040
3113
  const consentBlocked = consentRequired && !accepted;
@@ -3042,8 +3115,8 @@ function SignUp({
3042
3115
  const passwordMinLength = capabilities.passwordMinLength;
3043
3116
  const passwordMaxLength = capabilities.passwordMaxLength;
3044
3117
  const passkeysEnabled = capabilities.passkeyAdd;
3045
- const [pendingEmail, setPendingEmail] = React16.useState(null);
3046
- const [completeWithPasskey, setCompleteWithPasskey] = React16.useState(false);
3118
+ const [pendingEmail, setPendingEmail] = React17.useState(null);
3119
+ const [completeWithPasskey, setCompleteWithPasskey] = React17.useState(false);
3047
3120
  function finishSignUp() {
3048
3121
  onSignedUp?.();
3049
3122
  if (redirectTo) window.location.assign(redirectTo);
@@ -3096,17 +3169,18 @@ function SignUp({
3096
3169
  }
3097
3170
  }
3098
3171
  if (isLoading) {
3099
- return /* @__PURE__ */ jsxs18("div", { className: "ba-form", "data-testid": "signup-loading", "aria-busy": "true", children: [
3100
- /* @__PURE__ */ jsx22("div", { className: "ba-skeleton" }),
3101
- /* @__PURE__ */ jsx22("div", { className: "ba-skeleton" })
3172
+ return /* @__PURE__ */ jsxs19("div", { className: "ba-form", "data-testid": "signup-loading", "aria-busy": "true", children: [
3173
+ /* @__PURE__ */ jsx23("div", { className: "ba-skeleton" }),
3174
+ /* @__PURE__ */ jsx23("div", { className: "ba-skeleton" })
3102
3175
  ] });
3103
3176
  }
3104
3177
  if (config?.signUp?.mode === "waitlist") {
3105
- return /* @__PURE__ */ jsx22(Waitlist, { onJoined: onWaitlisted, showBadge });
3178
+ return /* @__PURE__ */ jsx23(Waitlist, { onJoined: onWaitlisted, showBadge, showBranding });
3106
3179
  }
3107
3180
  if (pendingEmail) {
3108
- return /* @__PURE__ */ jsxs18("div", { className: "ba-form", "data-testid": "signup-verify-pending", children: [
3109
- /* @__PURE__ */ jsx22(
3181
+ return /* @__PURE__ */ jsxs19("div", { className: "ba-form", "data-testid": "signup-verify-pending", children: [
3182
+ showBranding ? /* @__PURE__ */ jsx23(AuthOwlBranding, {}) : null,
3183
+ /* @__PURE__ */ jsx23(
3110
3184
  VerificationPending,
3111
3185
  {
3112
3186
  email: pendingEmail,
@@ -3114,7 +3188,7 @@ function SignUp({
3114
3188
  method: capabilities.emailVerificationMethod
3115
3189
  }
3116
3190
  ),
3117
- /* @__PURE__ */ jsx22(AuthOwlBadge, { force: showBadge })
3191
+ /* @__PURE__ */ jsx23(AuthOwlBadge, { force: showBadge })
3118
3192
  ] });
3119
3193
  }
3120
3194
  const methods = config?.enabledMethods ?? ["password"];
@@ -3124,14 +3198,16 @@ function SignUp({
3124
3198
  const showPasswordless = publicSignupAllowed && capabilities.emailOtpSignIn && capabilities.emailSignUp && !consentRequired && !capabilities.mfaRequired;
3125
3199
  const renderable = showPassword || showPasswordless || social.length > 0;
3126
3200
  if (completeWithPasskey) {
3127
- return /* @__PURE__ */ jsxs18("div", { className: "ba-form", "data-testid": "signup-passkey-step", children: [
3128
- /* @__PURE__ */ jsx22(PasskeySignUpCompletion, { onComplete: finishSignUp }),
3129
- /* @__PURE__ */ jsx22(AuthOwlBadge, { force: showBadge })
3201
+ return /* @__PURE__ */ jsxs19("div", { className: "ba-form", "data-testid": "signup-passkey-step", children: [
3202
+ showBranding ? /* @__PURE__ */ jsx23(AuthOwlBranding, {}) : null,
3203
+ /* @__PURE__ */ jsx23(PasskeySignUpCompletion, { onComplete: finishSignUp }),
3204
+ /* @__PURE__ */ jsx23(AuthOwlBadge, { force: showBadge })
3130
3205
  ] });
3131
3206
  }
3132
- return /* @__PURE__ */ jsxs18("div", { className: "ba-form", "data-testid": "signup-form", children: [
3133
- /* @__PURE__ */ jsx22("h2", { className: "ba-title", children: t("signUp.title") }),
3134
- legal && /* @__PURE__ */ jsx22(
3207
+ return /* @__PURE__ */ jsxs19("div", { className: "ba-form", "data-testid": "signup-form", children: [
3208
+ showBranding ? /* @__PURE__ */ jsx23(AuthOwlBranding, {}) : null,
3209
+ /* @__PURE__ */ jsx23("h2", { className: "ba-title", children: t("signUp.title") }),
3210
+ legal && /* @__PURE__ */ jsx23(
3135
3211
  LegalConsentCheckbox,
3136
3212
  {
3137
3213
  legal,
@@ -3140,12 +3216,12 @@ function SignUp({
3140
3216
  testId: "signup-consent"
3141
3217
  }
3142
3218
  ),
3143
- /* @__PURE__ */ jsx22(SocialButtons, { providers: social, callbackURL: redirectTo }),
3144
- showPassword && social.length > 0 && /* @__PURE__ */ jsx22("div", { className: "ba-divider", children: t("common.orDivider") }),
3145
- showPassword && /* @__PURE__ */ jsxs18("form", { method: "post", onSubmit, className: "ba-fields", children: [
3146
- capabilities.legacyNameField && /* @__PURE__ */ jsxs18("label", { className: "ba-label", children: [
3219
+ /* @__PURE__ */ jsx23(SocialButtons, { providers: social, callbackURL: redirectTo }),
3220
+ showPassword && social.length > 0 && /* @__PURE__ */ jsx23("div", { className: "ba-divider", children: t("common.orDivider") }),
3221
+ showPassword && /* @__PURE__ */ jsxs19("form", { method: "post", onSubmit, className: "ba-fields", children: [
3222
+ capabilities.legacyNameField && /* @__PURE__ */ jsxs19("label", { className: "ba-label", children: [
3147
3223
  t("signUp.nameLabel"),
3148
- /* @__PURE__ */ jsx22(
3224
+ /* @__PURE__ */ jsx23(
3149
3225
  "input",
3150
3226
  {
3151
3227
  className: "ba-input",
@@ -3159,10 +3235,10 @@ function SignUp({
3159
3235
  }
3160
3236
  )
3161
3237
  ] }),
3162
- capabilities.firstLastName && /* @__PURE__ */ jsxs18(Fragment6, { children: [
3163
- /* @__PURE__ */ jsxs18("label", { className: "ba-label", children: [
3238
+ capabilities.firstLastName && /* @__PURE__ */ jsxs19(Fragment6, { children: [
3239
+ /* @__PURE__ */ jsxs19("label", { className: "ba-label", children: [
3164
3240
  t("signUp.firstNameLabel"),
3165
- /* @__PURE__ */ jsx22(
3241
+ /* @__PURE__ */ jsx23(
3166
3242
  "input",
3167
3243
  {
3168
3244
  className: "ba-input",
@@ -3175,9 +3251,9 @@ function SignUp({
3175
3251
  }
3176
3252
  )
3177
3253
  ] }),
3178
- /* @__PURE__ */ jsxs18("label", { className: "ba-label", children: [
3254
+ /* @__PURE__ */ jsxs19("label", { className: "ba-label", children: [
3179
3255
  t("signUp.lastNameLabel"),
3180
- /* @__PURE__ */ jsx22(
3256
+ /* @__PURE__ */ jsx23(
3181
3257
  "input",
3182
3258
  {
3183
3259
  className: "ba-input",
@@ -3191,9 +3267,9 @@ function SignUp({
3191
3267
  )
3192
3268
  ] })
3193
3269
  ] }),
3194
- capabilities.collectUsername && /* @__PURE__ */ jsxs18("label", { className: "ba-label", children: [
3270
+ capabilities.collectUsername && /* @__PURE__ */ jsxs19("label", { className: "ba-label", children: [
3195
3271
  t("common.usernameLabel"),
3196
- /* @__PURE__ */ jsx22(
3272
+ /* @__PURE__ */ jsx23(
3197
3273
  "input",
3198
3274
  {
3199
3275
  className: "ba-input",
@@ -3207,9 +3283,9 @@ function SignUp({
3207
3283
  }
3208
3284
  )
3209
3285
  ] }),
3210
- /* @__PURE__ */ jsxs18("label", { className: "ba-label", children: [
3286
+ /* @__PURE__ */ jsxs19("label", { className: "ba-label", children: [
3211
3287
  t("common.emailLabel"),
3212
- /* @__PURE__ */ jsx22(
3288
+ /* @__PURE__ */ jsx23(
3213
3289
  "input",
3214
3290
  {
3215
3291
  className: "ba-input",
@@ -3224,9 +3300,9 @@ function SignUp({
3224
3300
  }
3225
3301
  )
3226
3302
  ] }),
3227
- /* @__PURE__ */ jsxs18("label", { className: "ba-label", children: [
3303
+ /* @__PURE__ */ jsxs19("label", { className: "ba-label", children: [
3228
3304
  t("common.passwordLabel"),
3229
- /* @__PURE__ */ jsx22(
3305
+ /* @__PURE__ */ jsx23(
3230
3306
  "input",
3231
3307
  {
3232
3308
  className: "ba-input",
@@ -3244,20 +3320,20 @@ function SignUp({
3244
3320
  )
3245
3321
  ] }),
3246
3322
  authChallenge.control,
3247
- /* @__PURE__ */ jsx22(FormError, { children: error }),
3248
- /* @__PURE__ */ jsx22(
3323
+ /* @__PURE__ */ jsx23(FormError, { children: error }),
3324
+ /* @__PURE__ */ jsx23(
3249
3325
  "button",
3250
3326
  {
3251
3327
  className: "ba-button",
3252
3328
  type: "submit",
3253
3329
  disabled: submitting || consentBlocked || authChallenge.configPending,
3254
3330
  "aria-busy": submitting || void 0,
3255
- children: /* @__PURE__ */ jsx22(Busy, { busy: submitting, label: t("signUp.submitPending"), children: t("signUp.submit") })
3331
+ children: /* @__PURE__ */ jsx23(Busy, { busy: submitting, label: t("signUp.submitPending"), children: t("signUp.submit") })
3256
3332
  }
3257
3333
  )
3258
3334
  ] }),
3259
- showPasswordless && (showPassword || social.length > 0) && /* @__PURE__ */ jsx22("div", { className: "ba-divider", children: t("common.orDivider") }),
3260
- showPasswordless && /* @__PURE__ */ jsx22(
3335
+ showPasswordless && (showPassword || social.length > 0) && /* @__PURE__ */ jsx23("div", { className: "ba-divider", children: t("common.orDivider") }),
3336
+ showPasswordless && /* @__PURE__ */ jsx23(
3261
3337
  PasswordlessSignUp,
3262
3338
  {
3263
3339
  onAuthenticated: () => {
@@ -3266,25 +3342,25 @@ function SignUp({
3266
3342
  }
3267
3343
  }
3268
3344
  ),
3269
- !renderable && /* @__PURE__ */ jsx22("p", { className: "ba-muted", children: publicSignupAllowed && methods.length > 0 ? t("signUp.empty.unsupported") : t("signUp.empty.none") }),
3270
- /* @__PURE__ */ jsx22(AuthOwlBadge, { force: showBadge })
3345
+ !renderable && /* @__PURE__ */ jsx23("p", { className: "ba-muted", children: publicSignupAllowed && methods.length > 0 ? t("signUp.empty.unsupported") : t("signUp.empty.none") }),
3346
+ /* @__PURE__ */ jsx23(AuthOwlBadge, { force: showBadge })
3271
3347
  ] });
3272
3348
  }
3273
3349
 
3274
3350
  // src/components/ConsentGate.tsx
3275
- import { Fragment as Fragment7, jsx as jsx23, jsxs as jsxs19 } from "react/jsx-runtime";
3351
+ import { Fragment as Fragment7, jsx as jsx24, jsxs as jsxs20 } from "react/jsx-runtime";
3276
3352
  function ConsentGate({ children, title }) {
3277
3353
  const t = useT();
3278
3354
  const { needsConsent, status, accept } = useConsent();
3279
3355
  const { pending, error, run } = useSubmitAction();
3280
- if (!needsConsent) return /* @__PURE__ */ jsx23(Fragment7, { children });
3281
- return /* @__PURE__ */ jsxs19("div", { className: "ba-form", "data-testid": "consent-gate", children: [
3282
- /* @__PURE__ */ jsx23("h2", { className: "ba-title", children: title ?? t("consent.gateTitle") }),
3283
- /* @__PURE__ */ jsx23("p", { className: "ba-muted", children: richMessage(t("consent.gateBody"), {
3284
- links: /* @__PURE__ */ jsx23(ConsentDocLinks, { termsUrl: status?.termsUrl, privacyUrl: status?.privacyUrl })
3356
+ if (!needsConsent) return /* @__PURE__ */ jsx24(Fragment7, { children });
3357
+ return /* @__PURE__ */ jsxs20("div", { className: "ba-form", "data-testid": "consent-gate", children: [
3358
+ /* @__PURE__ */ jsx24("h2", { className: "ba-title", children: title ?? t("consent.gateTitle") }),
3359
+ /* @__PURE__ */ jsx24("p", { className: "ba-muted", children: richMessage(t("consent.gateBody"), {
3360
+ links: /* @__PURE__ */ jsx24(ConsentDocLinks, { termsUrl: status?.termsUrl, privacyUrl: status?.privacyUrl })
3285
3361
  }) }),
3286
- /* @__PURE__ */ jsx23(FormError, { children: error }),
3287
- /* @__PURE__ */ jsx23(
3362
+ /* @__PURE__ */ jsx24(FormError, { children: error }),
3363
+ /* @__PURE__ */ jsx24(
3288
3364
  "button",
3289
3365
  {
3290
3366
  className: "ba-button",
@@ -3298,18 +3374,18 @@ function ConsentGate({ children, title }) {
3298
3374
  },
3299
3375
  { failure: t("consent.error.acceptFailed") }
3300
3376
  ),
3301
- children: /* @__PURE__ */ jsx23(Busy, { busy: pending, label: t("consent.acceptPending"), children: t("consent.acceptSubmit") })
3377
+ children: /* @__PURE__ */ jsx24(Busy, { busy: pending, label: t("consent.acceptPending"), children: t("consent.acceptSubmit") })
3302
3378
  }
3303
3379
  ),
3304
- /* @__PURE__ */ jsx23(AuthOwlBadge, {})
3380
+ /* @__PURE__ */ jsx24(AuthOwlBadge, {})
3305
3381
  ] });
3306
3382
  }
3307
3383
 
3308
3384
  // src/components/MFARequiredGate.tsx
3309
- import * as React19 from "react";
3385
+ import * as React20 from "react";
3310
3386
 
3311
3387
  // src/components/MFAEnrollment.tsx
3312
- import * as React18 from "react";
3388
+ import * as React19 from "react";
3313
3389
 
3314
3390
  // src/components/mfa-enrollment.ts
3315
3391
  function shouldDiscardSetup(args) {
@@ -3318,7 +3394,7 @@ function shouldDiscardSetup(args) {
3318
3394
  }
3319
3395
 
3320
3396
  // src/components/QrCode.tsx
3321
- import * as React17 from "react";
3397
+ import * as React18 from "react";
3322
3398
 
3323
3399
  // ../../node_modules/.pnpm/qrcode-generator@2.0.4/node_modules/qrcode-generator/dist/qrcode.mjs
3324
3400
  var qrcode = function(typeNumber, errorCorrectionLevel) {
@@ -4975,14 +5051,14 @@ function qrPath(value) {
4975
5051
  }
4976
5052
 
4977
5053
  // src/components/QrCode.tsx
4978
- import { jsx as jsx24, jsxs as jsxs20 } from "react/jsx-runtime";
5054
+ import { jsx as jsx25, jsxs as jsxs21 } from "react/jsx-runtime";
4979
5055
  function QrCode({ value, size = 200 }) {
4980
5056
  const t = useT();
4981
- const path = React17.useMemo(() => qrPath(value), [value]);
5057
+ const path = React18.useMemo(() => qrPath(value), [value]);
4982
5058
  if (!path) return null;
4983
5059
  const margin = 4;
4984
5060
  const dim = path.count + margin * 2;
4985
- return /* @__PURE__ */ jsxs20(
5061
+ return /* @__PURE__ */ jsxs21(
4986
5062
  "svg",
4987
5063
  {
4988
5064
  width: size,
@@ -4993,15 +5069,15 @@ function QrCode({ value, size = 200 }) {
4993
5069
  shapeRendering: "crispEdges",
4994
5070
  className: "ba-qr",
4995
5071
  children: [
4996
- /* @__PURE__ */ jsx24("rect", { width: dim, height: dim, fill: "#ffffff" }),
4997
- /* @__PURE__ */ jsx24("g", { transform: `translate(${margin} ${margin})`, children: /* @__PURE__ */ jsx24("path", { d: path.d, fill: "#000000" }) })
5072
+ /* @__PURE__ */ jsx25("rect", { width: dim, height: dim, fill: "#ffffff" }),
5073
+ /* @__PURE__ */ jsx25("g", { transform: `translate(${margin} ${margin})`, children: /* @__PURE__ */ jsx25("path", { d: path.d, fill: "#000000" }) })
4998
5074
  ]
4999
5075
  }
5000
5076
  );
5001
5077
  }
5002
5078
 
5003
5079
  // src/components/MFAEnrollment.tsx
5004
- import { jsx as jsx25, jsxs as jsxs21 } from "react/jsx-runtime";
5080
+ import { jsx as jsx26, jsxs as jsxs22 } from "react/jsx-runtime";
5005
5081
  function secretFromUri(uri) {
5006
5082
  try {
5007
5083
  return new URL(uri).searchParams.get("secret");
@@ -5014,11 +5090,11 @@ function MFAEnrollment({ onEnrolled, title }) {
5014
5090
  const { enable, verifyTotp } = useMFA();
5015
5091
  const { user, isLoaded } = useUser();
5016
5092
  const { pending, error, run } = useSubmitAction();
5017
- const [password, setPassword] = React18.useState("");
5018
- const [setup, setSetup] = React18.useState(null);
5019
- const [code, setCode] = React18.useState("");
5020
- const [done, setDone] = React18.useState(false);
5021
- const setupOwnerId = React18.useRef(null);
5093
+ const [password, setPassword] = React19.useState("");
5094
+ const [setup, setSetup] = React19.useState(null);
5095
+ const [code, setCode] = React19.useState("");
5096
+ const [done, setDone] = React19.useState(false);
5097
+ const setupOwnerId = React19.useRef(null);
5022
5098
  const userId = user?.id ?? null;
5023
5099
  const stale = shouldDiscardSetup({
5024
5100
  isLoaded,
@@ -5027,7 +5103,7 @@ function MFAEnrollment({ onEnrolled, title }) {
5027
5103
  currentUserId: userId
5028
5104
  });
5029
5105
  const activeSetup = stale ? null : setup;
5030
- React18.useEffect(() => {
5106
+ React19.useEffect(() => {
5031
5107
  if (stale) {
5032
5108
  setSetup(null);
5033
5109
  setPassword("");
@@ -5035,22 +5111,22 @@ function MFAEnrollment({ onEnrolled, title }) {
5035
5111
  }
5036
5112
  }, [stale]);
5037
5113
  if (done) {
5038
- return /* @__PURE__ */ jsxs21("div", { className: "ba-fields", "data-testid": "mfa-enroll-done", children: [
5039
- /* @__PURE__ */ jsx25("h2", { className: "ba-title", children: t("mfa.enroll.doneTitle") }),
5040
- /* @__PURE__ */ jsx25("p", { className: "ba-muted", children: t("mfa.enroll.doneBody") })
5114
+ return /* @__PURE__ */ jsxs22("div", { className: "ba-fields", "data-testid": "mfa-enroll-done", children: [
5115
+ /* @__PURE__ */ jsx26("h2", { className: "ba-title", children: t("mfa.enroll.doneTitle") }),
5116
+ /* @__PURE__ */ jsx26("p", { className: "ba-muted", children: t("mfa.enroll.doneBody") })
5041
5117
  ] });
5042
5118
  }
5043
5119
  if (!activeSetup) {
5044
5120
  if (!isLoaded) {
5045
- return /* @__PURE__ */ jsx25("div", { className: "ba-fields", "data-testid": "mfa-enroll-loading", "aria-busy": "true", children: /* @__PURE__ */ jsx25("div", { className: "ba-skeleton" }) });
5121
+ return /* @__PURE__ */ jsx26("div", { className: "ba-fields", "data-testid": "mfa-enroll-loading", "aria-busy": "true", children: /* @__PURE__ */ jsx26("div", { className: "ba-skeleton" }) });
5046
5122
  }
5047
5123
  if (user?.twoFactorEnabled) {
5048
- return /* @__PURE__ */ jsxs21("div", { className: "ba-fields", "data-testid": "mfa-enroll-active", children: [
5049
- /* @__PURE__ */ jsx25("h2", { className: "ba-title", children: t("mfa.enroll.activeTitle") }),
5050
- /* @__PURE__ */ jsx25("p", { className: "ba-muted", children: t("mfa.enroll.activeBody") })
5124
+ return /* @__PURE__ */ jsxs22("div", { className: "ba-fields", "data-testid": "mfa-enroll-active", children: [
5125
+ /* @__PURE__ */ jsx26("h2", { className: "ba-title", children: t("mfa.enroll.activeTitle") }),
5126
+ /* @__PURE__ */ jsx26("p", { className: "ba-muted", children: t("mfa.enroll.activeBody") })
5051
5127
  ] });
5052
5128
  }
5053
- return /* @__PURE__ */ jsxs21(
5129
+ return /* @__PURE__ */ jsxs22(
5054
5130
  "form",
5055
5131
  {
5056
5132
  method: "post",
@@ -5067,11 +5143,11 @@ function MFAEnrollment({ onEnrolled, title }) {
5067
5143
  });
5068
5144
  },
5069
5145
  children: [
5070
- title !== null && /* @__PURE__ */ jsx25("h2", { className: "ba-title", children: title ?? t("mfa.enroll.title") }),
5071
- /* @__PURE__ */ jsx25("p", { className: "ba-muted", children: t("mfa.enroll.passwordHint") }),
5072
- /* @__PURE__ */ jsxs21("label", { className: "ba-label", children: [
5146
+ title !== null && /* @__PURE__ */ jsx26("h2", { className: "ba-title", children: title ?? t("mfa.enroll.title") }),
5147
+ /* @__PURE__ */ jsx26("p", { className: "ba-muted", children: t("mfa.enroll.passwordHint") }),
5148
+ /* @__PURE__ */ jsxs22("label", { className: "ba-label", children: [
5073
5149
  t("common.passwordLabel"),
5074
- /* @__PURE__ */ jsx25(
5150
+ /* @__PURE__ */ jsx26(
5075
5151
  "input",
5076
5152
  {
5077
5153
  className: "ba-input",
@@ -5083,29 +5159,29 @@ function MFAEnrollment({ onEnrolled, title }) {
5083
5159
  }
5084
5160
  )
5085
5161
  ] }),
5086
- /* @__PURE__ */ jsx25(FormError, { children: error }),
5087
- /* @__PURE__ */ jsx25("button", { className: "ba-button", type: "submit", disabled: pending || !password, "aria-busy": pending || void 0, children: /* @__PURE__ */ jsx25(Busy, { busy: pending, label: t("mfa.enroll.startPending"), children: t("common.continue") }) })
5162
+ /* @__PURE__ */ jsx26(FormError, { children: error }),
5163
+ /* @__PURE__ */ jsx26("button", { className: "ba-button", type: "submit", disabled: pending || !password, "aria-busy": pending || void 0, children: /* @__PURE__ */ jsx26(Busy, { busy: pending, label: t("mfa.enroll.startPending"), children: t("common.continue") }) })
5088
5164
  ]
5089
5165
  }
5090
5166
  );
5091
5167
  }
5092
5168
  const secret = secretFromUri(activeSetup.totpURI);
5093
- return /* @__PURE__ */ jsxs21("div", { className: "ba-fields", "data-testid": "mfa-enroll-verify", children: [
5094
- /* @__PURE__ */ jsx25("h2", { className: "ba-title", children: t("mfa.enroll.scanQrTitle") }),
5095
- /* @__PURE__ */ jsx25("p", { className: "ba-muted", children: t("mfa.enroll.scanQrHint") }),
5096
- /* @__PURE__ */ jsx25(QrCode, { value: activeSetup.totpURI }),
5097
- secret && /* @__PURE__ */ jsx25("p", { className: "ba-muted", children: richMessage(t("mfa.enroll.manualKey"), {
5098
- secret: /* @__PURE__ */ jsx25("code", { className: "ba-code", children: /* @__PURE__ */ jsx25(Bidi, { children: secret }) })
5169
+ return /* @__PURE__ */ jsxs22("div", { className: "ba-fields", "data-testid": "mfa-enroll-verify", children: [
5170
+ /* @__PURE__ */ jsx26("h2", { className: "ba-title", children: t("mfa.enroll.scanQrTitle") }),
5171
+ /* @__PURE__ */ jsx26("p", { className: "ba-muted", children: t("mfa.enroll.scanQrHint") }),
5172
+ /* @__PURE__ */ jsx26(QrCode, { value: activeSetup.totpURI }),
5173
+ secret && /* @__PURE__ */ jsx26("p", { className: "ba-muted", children: richMessage(t("mfa.enroll.manualKey"), {
5174
+ secret: /* @__PURE__ */ jsx26("code", { className: "ba-code", children: /* @__PURE__ */ jsx26(Bidi, { children: secret }) })
5099
5175
  }) }),
5100
- /* @__PURE__ */ jsxs21("div", { children: [
5101
- /* @__PURE__ */ jsxs21("p", { className: "ba-muted", children: [
5102
- /* @__PURE__ */ jsx25("strong", { children: t("mfa.enroll.backupCodesWarningStrong") }),
5176
+ /* @__PURE__ */ jsxs22("div", { children: [
5177
+ /* @__PURE__ */ jsxs22("p", { className: "ba-muted", children: [
5178
+ /* @__PURE__ */ jsx26("strong", { children: t("mfa.enroll.backupCodesWarningStrong") }),
5103
5179
  " ",
5104
5180
  t("mfa.enroll.backupCodesWarningRest")
5105
5181
  ] }),
5106
- /* @__PURE__ */ jsx25("ul", { className: "ba-backup-codes", "data-testid": "mfa-backup-codes", children: activeSetup.backupCodes.map((c) => /* @__PURE__ */ jsx25("li", { children: /* @__PURE__ */ jsx25("code", { className: "ba-code", children: c }) }, c)) })
5182
+ /* @__PURE__ */ jsx26("ul", { className: "ba-backup-codes", "data-testid": "mfa-backup-codes", children: activeSetup.backupCodes.map((c) => /* @__PURE__ */ jsx26("li", { children: /* @__PURE__ */ jsx26("code", { className: "ba-code", children: c }) }, c)) })
5107
5183
  ] }),
5108
- /* @__PURE__ */ jsxs21(
5184
+ /* @__PURE__ */ jsxs22(
5109
5185
  "form",
5110
5186
  {
5111
5187
  method: "post",
@@ -5123,9 +5199,9 @@ function MFAEnrollment({ onEnrolled, title }) {
5123
5199
  });
5124
5200
  },
5125
5201
  children: [
5126
- /* @__PURE__ */ jsxs21("label", { className: "ba-label", children: [
5202
+ /* @__PURE__ */ jsxs22("label", { className: "ba-label", children: [
5127
5203
  t("mfa.enroll.codeLabel"),
5128
- /* @__PURE__ */ jsx25(
5204
+ /* @__PURE__ */ jsx26(
5129
5205
  "input",
5130
5206
  {
5131
5207
  className: "ba-input",
@@ -5137,8 +5213,8 @@ function MFAEnrollment({ onEnrolled, title }) {
5137
5213
  }
5138
5214
  )
5139
5215
  ] }),
5140
- /* @__PURE__ */ jsx25(FormError, { children: error }),
5141
- /* @__PURE__ */ jsx25("button", { className: "ba-button", type: "submit", disabled: pending || !code, "aria-busy": pending || void 0, children: /* @__PURE__ */ jsx25(Busy, { busy: pending, label: t("common.verifying"), children: t("mfa.enroll.activateSubmit") }) })
5216
+ /* @__PURE__ */ jsx26(FormError, { children: error }),
5217
+ /* @__PURE__ */ jsx26("button", { className: "ba-button", type: "submit", disabled: pending || !code, "aria-busy": pending || void 0, children: /* @__PURE__ */ jsx26(Busy, { busy: pending, label: t("common.verifying"), children: t("mfa.enroll.activateSubmit") }) })
5142
5218
  ]
5143
5219
  }
5144
5220
  )
@@ -5146,14 +5222,14 @@ function MFAEnrollment({ onEnrolled, title }) {
5146
5222
  }
5147
5223
 
5148
5224
  // src/components/MFARequiredGate.tsx
5149
- import { Fragment as Fragment8, jsx as jsx26, jsxs as jsxs22 } from "react/jsx-runtime";
5225
+ import { Fragment as Fragment8, jsx as jsx27, jsxs as jsxs23 } from "react/jsx-runtime";
5150
5226
  function MFARequiredGate({ children, title }) {
5151
5227
  const t = useT();
5152
5228
  const client = useAuthClient();
5153
5229
  const { needsMfaEnrollment } = useUser();
5154
5230
  const { refetch } = useSession();
5155
- const [confirmedPending, setConfirmedPending] = React19.useState(null);
5156
- React19.useEffect(() => {
5231
+ const [confirmedPending, setConfirmedPending] = React20.useState(null);
5232
+ React20.useEffect(() => {
5157
5233
  if (!needsMfaEnrollment) {
5158
5234
  setConfirmedPending(null);
5159
5235
  return;
@@ -5171,26 +5247,26 @@ function MFARequiredGate({ children, title }) {
5171
5247
  active = false;
5172
5248
  };
5173
5249
  }, [client, needsMfaEnrollment, refetch]);
5174
- if (!needsMfaEnrollment) return /* @__PURE__ */ jsx26(Fragment8, { children });
5250
+ if (!needsMfaEnrollment) return /* @__PURE__ */ jsx27(Fragment8, { children });
5175
5251
  if (confirmedPending !== true) return null;
5176
- return /* @__PURE__ */ jsxs22("div", { className: "ba-form", "data-testid": "mfa-required-gate", children: [
5177
- /* @__PURE__ */ jsx26("h2", { className: "ba-title", children: title ?? t("mfaGate.title") }),
5178
- /* @__PURE__ */ jsx26("p", { className: "ba-muted", children: t("mfaGate.body") }),
5179
- /* @__PURE__ */ jsx26(MFAEnrollment, { onEnrolled: () => refetch({ query: { disableCookieCache: true } }) }),
5180
- /* @__PURE__ */ jsx26(AuthOwlBadge, {})
5252
+ return /* @__PURE__ */ jsxs23("div", { className: "ba-form", "data-testid": "mfa-required-gate", children: [
5253
+ /* @__PURE__ */ jsx27("h2", { className: "ba-title", children: title ?? t("mfaGate.title") }),
5254
+ /* @__PURE__ */ jsx27("p", { className: "ba-muted", children: t("mfaGate.body") }),
5255
+ /* @__PURE__ */ jsx27(MFAEnrollment, { onEnrolled: () => refetch({ query: { disableCookieCache: true } }) }),
5256
+ /* @__PURE__ */ jsx27(AuthOwlBadge, {})
5181
5257
  ] });
5182
5258
  }
5183
5259
 
5184
5260
  // src/components/BackupCodesManager.tsx
5185
- import * as React20 from "react";
5186
- import { Fragment as Fragment9, jsx as jsx27, jsxs as jsxs23 } from "react/jsx-runtime";
5261
+ import * as React21 from "react";
5262
+ import { Fragment as Fragment9, jsx as jsx28, jsxs as jsxs24 } from "react/jsx-runtime";
5187
5263
  function BackupCodesManager({ title }) {
5188
5264
  const t = useT();
5189
5265
  const { user } = useUser();
5190
5266
  const { regenerateBackupCodes } = useMFA();
5191
5267
  const { pending, error, run } = useSubmitAction();
5192
- const [password, setPassword] = React20.useState("");
5193
- const [codes, setCodes] = React20.useState(null);
5268
+ const [password, setPassword] = React21.useState("");
5269
+ const [codes, setCodes] = React21.useState(null);
5194
5270
  if (!user?.twoFactorEnabled) return null;
5195
5271
  const submit = (e) => {
5196
5272
  e.preventDefault();
@@ -5202,20 +5278,20 @@ function BackupCodesManager({ title }) {
5202
5278
  }
5203
5279
  });
5204
5280
  };
5205
- return /* @__PURE__ */ jsxs23("div", { className: "ba-form", "data-testid": "backup-codes-manager", children: [
5206
- title !== null && /* @__PURE__ */ jsx27("h2", { className: "ba-title", children: title ?? t("backupCodes.title") }),
5207
- /* @__PURE__ */ jsx27("p", { className: "ba-muted", children: t("backupCodes.hint") }),
5208
- codes ? /* @__PURE__ */ jsxs23(Fragment9, { children: [
5209
- /* @__PURE__ */ jsxs23("p", { className: "ba-muted", children: [
5210
- /* @__PURE__ */ jsx27("strong", { children: t("mfa.enroll.backupCodesWarningStrong") }),
5281
+ return /* @__PURE__ */ jsxs24("div", { className: "ba-form", "data-testid": "backup-codes-manager", children: [
5282
+ title !== null && /* @__PURE__ */ jsx28("h2", { className: "ba-title", children: title ?? t("backupCodes.title") }),
5283
+ /* @__PURE__ */ jsx28("p", { className: "ba-muted", children: t("backupCodes.hint") }),
5284
+ codes ? /* @__PURE__ */ jsxs24(Fragment9, { children: [
5285
+ /* @__PURE__ */ jsxs24("p", { className: "ba-muted", children: [
5286
+ /* @__PURE__ */ jsx28("strong", { children: t("mfa.enroll.backupCodesWarningStrong") }),
5211
5287
  " ",
5212
5288
  t("mfa.enroll.backupCodesWarningRest")
5213
5289
  ] }),
5214
- /* @__PURE__ */ jsx27("ul", { className: "ba-passkey-list", "data-testid": "backup-codes-list", children: codes.map((c) => /* @__PURE__ */ jsx27("li", { className: "ba-passkey-item", children: /* @__PURE__ */ jsx27("code", { children: /* @__PURE__ */ jsx27("bdi", { children: c }) }) }, c)) })
5215
- ] }) : /* @__PURE__ */ jsxs23("form", { method: "post", className: "ba-fields", onSubmit: submit, children: [
5216
- /* @__PURE__ */ jsxs23("label", { className: "ba-label", children: [
5290
+ /* @__PURE__ */ jsx28("ul", { className: "ba-passkey-list", "data-testid": "backup-codes-list", children: codes.map((c) => /* @__PURE__ */ jsx28("li", { className: "ba-passkey-item", children: /* @__PURE__ */ jsx28("code", { children: /* @__PURE__ */ jsx28("bdi", { children: c }) }) }, c)) })
5291
+ ] }) : /* @__PURE__ */ jsxs24("form", { method: "post", className: "ba-fields", onSubmit: submit, children: [
5292
+ /* @__PURE__ */ jsxs24("label", { className: "ba-label", children: [
5217
5293
  t("common.passwordLabel"),
5218
- /* @__PURE__ */ jsx27(
5294
+ /* @__PURE__ */ jsx28(
5219
5295
  "input",
5220
5296
  {
5221
5297
  className: "ba-input",
@@ -5227,26 +5303,26 @@ function BackupCodesManager({ title }) {
5227
5303
  }
5228
5304
  )
5229
5305
  ] }),
5230
- /* @__PURE__ */ jsx27(FormError, { children: error }),
5231
- /* @__PURE__ */ jsx27("button", { className: "ba-button", type: "submit", disabled: pending || !password, "aria-busy": pending || void 0, children: /* @__PURE__ */ jsx27(Busy, { busy: pending, label: t("backupCodes.pending"), children: t("backupCodes.submit") }) })
5306
+ /* @__PURE__ */ jsx28(FormError, { children: error }),
5307
+ /* @__PURE__ */ jsx28("button", { className: "ba-button", type: "submit", disabled: pending || !password, "aria-busy": pending || void 0, children: /* @__PURE__ */ jsx28(Busy, { busy: pending, label: t("backupCodes.pending"), children: t("backupCodes.submit") }) })
5232
5308
  ] })
5233
5309
  ] });
5234
5310
  }
5235
5311
 
5236
5312
  // src/components/MagicLinkForm.tsx
5237
- import * as React21 from "react";
5238
- import { jsx as jsx28, jsxs as jsxs24 } from "react/jsx-runtime";
5313
+ import * as React22 from "react";
5314
+ import { jsx as jsx29, jsxs as jsxs25 } from "react/jsx-runtime";
5239
5315
  function MagicLinkForm({ callbackURL, webauthnAutofill }) {
5240
5316
  const t = useT();
5241
5317
  const { signInMagicLink } = useSignIn();
5242
5318
  const { pending, error, run } = useSubmitAction();
5243
5319
  const authChallenge = useAuthChallenge();
5244
- const [email, setEmail] = React21.useState("");
5245
- const [sent, setSent] = React21.useState(false);
5320
+ const [email, setEmail] = React22.useState("");
5321
+ const [sent, setSent] = React22.useState(false);
5246
5322
  if (sent) {
5247
- return /* @__PURE__ */ jsx28("p", { className: "ba-muted", "data-testid": "magiclink-sent", children: t("magicLink.sent") });
5323
+ return /* @__PURE__ */ jsx29("p", { className: "ba-muted", "data-testid": "magiclink-sent", children: t("magicLink.sent") });
5248
5324
  }
5249
- return /* @__PURE__ */ jsxs24(
5325
+ return /* @__PURE__ */ jsxs25(
5250
5326
  "form",
5251
5327
  {
5252
5328
  method: "post",
@@ -5260,9 +5336,9 @@ function MagicLinkForm({ callbackURL, webauthnAutofill }) {
5260
5336
  className: "ba-fields",
5261
5337
  "data-testid": "magiclink-form",
5262
5338
  children: [
5263
- /* @__PURE__ */ jsxs24("label", { className: "ba-label", children: [
5339
+ /* @__PURE__ */ jsxs25("label", { className: "ba-label", children: [
5264
5340
  t("common.emailLabel"),
5265
- /* @__PURE__ */ jsx28(
5341
+ /* @__PURE__ */ jsx29(
5266
5342
  "input",
5267
5343
  {
5268
5344
  className: "ba-input",
@@ -5275,15 +5351,15 @@ function MagicLinkForm({ callbackURL, webauthnAutofill }) {
5275
5351
  )
5276
5352
  ] }),
5277
5353
  authChallenge.control,
5278
- /* @__PURE__ */ jsx28(FormError, { children: error }),
5279
- /* @__PURE__ */ jsx28(
5354
+ /* @__PURE__ */ jsx29(FormError, { children: error }),
5355
+ /* @__PURE__ */ jsx29(
5280
5356
  "button",
5281
5357
  {
5282
5358
  className: "ba-button",
5283
5359
  type: "submit",
5284
5360
  disabled: pending || authChallenge.configPending,
5285
5361
  "aria-busy": pending || void 0,
5286
- children: /* @__PURE__ */ jsx28(Busy, { busy: pending, label: t("common.sending"), children: t("magicLink.submit") })
5362
+ children: /* @__PURE__ */ jsx29(Busy, { busy: pending, label: t("common.sending"), children: t("magicLink.submit") })
5287
5363
  }
5288
5364
  )
5289
5365
  ]
@@ -5292,19 +5368,19 @@ function MagicLinkForm({ callbackURL, webauthnAutofill }) {
5292
5368
  }
5293
5369
 
5294
5370
  // src/components/EmailOtpForm.tsx
5295
- import * as React22 from "react";
5296
- import { jsx as jsx29, jsxs as jsxs25 } from "react/jsx-runtime";
5371
+ import * as React23 from "react";
5372
+ import { jsx as jsx30, jsxs as jsxs26 } from "react/jsx-runtime";
5297
5373
  function EmailOtpForm({ redirectTo, onSignedIn, webauthnAutofill }) {
5298
5374
  const t = useT();
5299
5375
  const { sessionStore } = useAuthClient();
5300
5376
  const { sendEmailOtp, signInEmailOtp } = useSignIn();
5301
5377
  const { pending, error, setError, run } = useSubmitAction();
5302
5378
  const authChallenge = useAuthChallenge();
5303
- const [email, setEmail] = React22.useState("");
5304
- const [otp, setOtp] = React22.useState("");
5305
- const [stage, setStage] = React22.useState("email");
5379
+ const [email, setEmail] = React23.useState("");
5380
+ const [otp, setOtp] = React23.useState("");
5381
+ const [stage, setStage] = React23.useState("email");
5306
5382
  if (stage === "code") {
5307
- return /* @__PURE__ */ jsx29(
5383
+ return /* @__PURE__ */ jsx30(
5308
5384
  OtpCodeForm,
5309
5385
  {
5310
5386
  email,
@@ -5327,7 +5403,7 @@ function EmailOtpForm({ redirectTo, onSignedIn, webauthnAutofill }) {
5327
5403
  }
5328
5404
  );
5329
5405
  }
5330
- return /* @__PURE__ */ jsxs25(
5406
+ return /* @__PURE__ */ jsxs26(
5331
5407
  "form",
5332
5408
  {
5333
5409
  method: "post",
@@ -5341,9 +5417,9 @@ function EmailOtpForm({ redirectTo, onSignedIn, webauthnAutofill }) {
5341
5417
  className: "ba-fields",
5342
5418
  "data-testid": "emailotp-email",
5343
5419
  children: [
5344
- /* @__PURE__ */ jsxs25("label", { className: "ba-label", children: [
5420
+ /* @__PURE__ */ jsxs26("label", { className: "ba-label", children: [
5345
5421
  t("common.emailLabel"),
5346
- /* @__PURE__ */ jsx29(
5422
+ /* @__PURE__ */ jsx30(
5347
5423
  "input",
5348
5424
  {
5349
5425
  className: "ba-input",
@@ -5359,15 +5435,15 @@ function EmailOtpForm({ redirectTo, onSignedIn, webauthnAutofill }) {
5359
5435
  )
5360
5436
  ] }),
5361
5437
  authChallenge.control,
5362
- /* @__PURE__ */ jsx29(FormError, { children: error }),
5363
- /* @__PURE__ */ jsx29(
5438
+ /* @__PURE__ */ jsx30(FormError, { children: error }),
5439
+ /* @__PURE__ */ jsx30(
5364
5440
  "button",
5365
5441
  {
5366
5442
  className: "ba-button",
5367
5443
  type: "submit",
5368
5444
  disabled: pending || authChallenge.configPending,
5369
5445
  "aria-busy": pending || void 0,
5370
- children: /* @__PURE__ */ jsx29(Busy, { busy: pending, label: t("common.sending"), children: t("emailOtp.requestSubmit") })
5446
+ children: /* @__PURE__ */ jsx30(Busy, { busy: pending, label: t("common.sending"), children: t("emailOtp.requestSubmit") })
5371
5447
  }
5372
5448
  )
5373
5449
  ]
@@ -5376,8 +5452,8 @@ function EmailOtpForm({ redirectTo, onSignedIn, webauthnAutofill }) {
5376
5452
  }
5377
5453
 
5378
5454
  // src/components/ResetPassword.tsx
5379
- import * as React23 from "react";
5380
- import { jsx as jsx30, jsxs as jsxs26 } from "react/jsx-runtime";
5455
+ import * as React24 from "react";
5456
+ import { jsx as jsx31, jsxs as jsxs27 } from "react/jsx-runtime";
5381
5457
  function ResetPassword({ token: tokenProp, redirectTo, onReset }) {
5382
5458
  const t = useT();
5383
5459
  const { resetPassword } = usePasswordReset();
@@ -5385,27 +5461,27 @@ function ResetPassword({ token: tokenProp, redirectTo, onReset }) {
5385
5461
  const capabilities = resolveProjectCapabilities(config);
5386
5462
  const { passwordMinLength, passwordMaxLength } = capabilities;
5387
5463
  const { pending, error, setError, run } = useSubmitAction();
5388
- const [token, setToken] = React23.useState(tokenProp ?? null);
5389
- const [ready, setReady] = React23.useState(tokenProp != null);
5390
- const [password, setPassword] = React23.useState("");
5391
- const [confirm, setConfirm] = React23.useState("");
5392
- const [done, setDone] = React23.useState(false);
5393
- React23.useEffect(() => {
5464
+ const [token, setToken] = React24.useState(tokenProp ?? null);
5465
+ const [ready, setReady] = React24.useState(tokenProp != null);
5466
+ const [password, setPassword] = React24.useState("");
5467
+ const [confirm, setConfirm] = React24.useState("");
5468
+ const [done, setDone] = React24.useState(false);
5469
+ React24.useEffect(() => {
5394
5470
  if (tokenProp != null) return;
5395
5471
  const params = new URLSearchParams(window.location.search);
5396
5472
  setToken(params.get("token"));
5397
5473
  setReady(true);
5398
5474
  }, [tokenProp]);
5399
5475
  if (!ready) {
5400
- return /* @__PURE__ */ jsx30("div", { className: "ba-form", "aria-busy": "true", children: /* @__PURE__ */ jsx30("div", { className: "ba-skeleton" }) });
5476
+ return /* @__PURE__ */ jsx31("div", { className: "ba-form", "aria-busy": "true", children: /* @__PURE__ */ jsx31("div", { className: "ba-skeleton" }) });
5401
5477
  }
5402
5478
  if (!token) {
5403
- return /* @__PURE__ */ jsx30(FormError, { "data-testid": "reset-invalid", children: t("resetPassword.invalidLink") });
5479
+ return /* @__PURE__ */ jsx31(FormError, { "data-testid": "reset-invalid", children: t("resetPassword.invalidLink") });
5404
5480
  }
5405
5481
  if (done) {
5406
- return /* @__PURE__ */ jsx30("p", { className: "ba-muted", "data-testid": "reset-done", children: t("resetPassword.done") });
5482
+ return /* @__PURE__ */ jsx31("p", { className: "ba-muted", "data-testid": "reset-done", children: t("resetPassword.done") });
5407
5483
  }
5408
- return /* @__PURE__ */ jsxs26(
5484
+ return /* @__PURE__ */ jsxs27(
5409
5485
  "form",
5410
5486
  {
5411
5487
  method: "post",
@@ -5431,9 +5507,9 @@ function ResetPassword({ token: tokenProp, redirectTo, onReset }) {
5431
5507
  });
5432
5508
  },
5433
5509
  children: [
5434
- /* @__PURE__ */ jsxs26("label", { className: "ba-label", children: [
5510
+ /* @__PURE__ */ jsxs27("label", { className: "ba-label", children: [
5435
5511
  t("resetPassword.newPasswordLabel"),
5436
- /* @__PURE__ */ jsx30(
5512
+ /* @__PURE__ */ jsx31(
5437
5513
  "input",
5438
5514
  {
5439
5515
  className: "ba-input",
@@ -5450,9 +5526,9 @@ function ResetPassword({ token: tokenProp, redirectTo, onReset }) {
5450
5526
  }
5451
5527
  )
5452
5528
  ] }),
5453
- /* @__PURE__ */ jsxs26("label", { className: "ba-label", children: [
5529
+ /* @__PURE__ */ jsxs27("label", { className: "ba-label", children: [
5454
5530
  t("resetPassword.confirmPasswordLabel"),
5455
- /* @__PURE__ */ jsx30(
5531
+ /* @__PURE__ */ jsx31(
5456
5532
  "input",
5457
5533
  {
5458
5534
  className: "ba-input",
@@ -5469,26 +5545,26 @@ function ResetPassword({ token: tokenProp, redirectTo, onReset }) {
5469
5545
  }
5470
5546
  )
5471
5547
  ] }),
5472
- /* @__PURE__ */ jsx30(FormError, { children: error }),
5473
- /* @__PURE__ */ jsx30("button", { className: "ba-button", type: "submit", disabled: pending, "aria-busy": pending || void 0, children: /* @__PURE__ */ jsx30(Busy, { busy: pending, label: t("resetPassword.submitPending"), children: t("resetPassword.submit") }) })
5548
+ /* @__PURE__ */ jsx31(FormError, { children: error }),
5549
+ /* @__PURE__ */ jsx31("button", { className: "ba-button", type: "submit", disabled: pending, "aria-busy": pending || void 0, children: /* @__PURE__ */ jsx31(Busy, { busy: pending, label: t("resetPassword.submitPending"), children: t("resetPassword.submit") }) })
5474
5550
  ]
5475
5551
  }
5476
5552
  );
5477
5553
  }
5478
5554
 
5479
5555
  // src/components/VerifyEmail.tsx
5480
- import * as React24 from "react";
5481
- import { Fragment as Fragment10, jsx as jsx31, jsxs as jsxs27 } from "react/jsx-runtime";
5556
+ import * as React25 from "react";
5557
+ import { Fragment as Fragment10, jsx as jsx32, jsxs as jsxs28 } from "react/jsx-runtime";
5482
5558
  function VerifyEmail({ redirectTo, onVerified, callbackURL }) {
5483
5559
  const t = useT();
5484
5560
  const { sendVerificationEmail } = useEmailVerification();
5485
5561
  const { pending, error, run } = useSubmitAction();
5486
5562
  const authChallenge = useAuthChallenge();
5487
- const [ready, setReady] = React24.useState(false);
5488
- const [failed, setFailed] = React24.useState(false);
5489
- const [email, setEmail] = React24.useState("");
5490
- const [resent, setResent] = React24.useState(false);
5491
- React24.useEffect(() => {
5563
+ const [ready, setReady] = React25.useState(false);
5564
+ const [failed, setFailed] = React25.useState(false);
5565
+ const [email, setEmail] = React25.useState("");
5566
+ const [resent, setResent] = React25.useState(false);
5567
+ React25.useEffect(() => {
5492
5568
  const didFail = new URLSearchParams(window.location.search).has("error");
5493
5569
  setFailed(didFail);
5494
5570
  setReady(true);
@@ -5498,12 +5574,12 @@ function VerifyEmail({ redirectTo, onVerified, callbackURL }) {
5498
5574
  }
5499
5575
  }, [onVerified, redirectTo]);
5500
5576
  if (!ready) {
5501
- return /* @__PURE__ */ jsx31("div", { className: "ba-form", "aria-busy": "true", children: /* @__PURE__ */ jsx31("div", { className: "ba-skeleton" }) });
5577
+ return /* @__PURE__ */ jsx32("div", { className: "ba-form", "aria-busy": "true", children: /* @__PURE__ */ jsx32("div", { className: "ba-skeleton" }) });
5502
5578
  }
5503
5579
  if (!failed) {
5504
- return /* @__PURE__ */ jsx31("p", { className: "ba-muted", "data-testid": "verify-success", children: t("verifyEmail.success") });
5580
+ return /* @__PURE__ */ jsx32("p", { className: "ba-muted", "data-testid": "verify-success", children: t("verifyEmail.success") });
5505
5581
  }
5506
- return /* @__PURE__ */ jsxs27(
5582
+ return /* @__PURE__ */ jsxs28(
5507
5583
  "form",
5508
5584
  {
5509
5585
  method: "post",
@@ -5518,11 +5594,11 @@ function VerifyEmail({ redirectTo, onVerified, callbackURL }) {
5518
5594
  });
5519
5595
  },
5520
5596
  children: [
5521
- /* @__PURE__ */ jsx31(FormError, { children: t("verifyEmail.invalidLink") }),
5522
- resent ? /* @__PURE__ */ jsx31("p", { className: "ba-muted", children: richMessage(t("verifyEmail.resent"), { email: /* @__PURE__ */ jsx31(Bidi, { children: email }) }) }) : /* @__PURE__ */ jsxs27(Fragment10, { children: [
5523
- /* @__PURE__ */ jsxs27("label", { className: "ba-label", children: [
5597
+ /* @__PURE__ */ jsx32(FormError, { children: t("verifyEmail.invalidLink") }),
5598
+ resent ? /* @__PURE__ */ jsx32("p", { className: "ba-muted", children: richMessage(t("verifyEmail.resent"), { email: /* @__PURE__ */ jsx32(Bidi, { children: email }) }) }) : /* @__PURE__ */ jsxs28(Fragment10, { children: [
5599
+ /* @__PURE__ */ jsxs28("label", { className: "ba-label", children: [
5524
5600
  t("common.emailLabel"),
5525
- /* @__PURE__ */ jsx31(
5601
+ /* @__PURE__ */ jsx32(
5526
5602
  "input",
5527
5603
  {
5528
5604
  className: "ba-input",
@@ -5535,15 +5611,15 @@ function VerifyEmail({ redirectTo, onVerified, callbackURL }) {
5535
5611
  )
5536
5612
  ] }),
5537
5613
  authChallenge.control,
5538
- /* @__PURE__ */ jsx31(FormError, { children: error }),
5539
- /* @__PURE__ */ jsx31(
5614
+ /* @__PURE__ */ jsx32(FormError, { children: error }),
5615
+ /* @__PURE__ */ jsx32(
5540
5616
  "button",
5541
5617
  {
5542
5618
  className: "ba-button",
5543
5619
  type: "submit",
5544
5620
  disabled: pending || authChallenge.configPending,
5545
5621
  "aria-busy": pending || void 0,
5546
- children: /* @__PURE__ */ jsx31(Busy, { busy: pending, label: t("common.sending"), children: t("verifyEmail.resendSubmit") })
5622
+ children: /* @__PURE__ */ jsx32(Busy, { busy: pending, label: t("common.sending"), children: t("verifyEmail.resendSubmit") })
5547
5623
  }
5548
5624
  )
5549
5625
  ] })
@@ -5553,18 +5629,18 @@ function VerifyEmail({ redirectTo, onVerified, callbackURL }) {
5553
5629
  }
5554
5630
 
5555
5631
  // src/components/PasskeyManager.tsx
5556
- import * as React25 from "react";
5557
- import { jsx as jsx32, jsxs as jsxs28 } from "react/jsx-runtime";
5632
+ import * as React26 from "react";
5633
+ import { jsx as jsx33, jsxs as jsxs29 } from "react/jsx-runtime";
5558
5634
  function PasskeyManager({ title, allowAdd = true } = {}) {
5559
5635
  const t = useT();
5560
5636
  const { user, isLoaded, isSignedIn } = useUser();
5561
5637
  if (!isLoaded) {
5562
- return /* @__PURE__ */ jsx32("div", { className: "ba-form", "data-testid": "passkey-manager-loading", "aria-busy": "true", children: /* @__PURE__ */ jsx32("div", { className: "ba-skeleton" }) });
5638
+ return /* @__PURE__ */ jsx33("div", { className: "ba-form", "data-testid": "passkey-manager-loading", "aria-busy": "true", children: /* @__PURE__ */ jsx33("div", { className: "ba-skeleton" }) });
5563
5639
  }
5564
5640
  if (!isSignedIn || !user) {
5565
- return /* @__PURE__ */ jsx32("p", { className: "ba-muted", children: t("passkeys.signedOut") });
5641
+ return /* @__PURE__ */ jsx33("p", { className: "ba-muted", children: t("passkeys.signedOut") });
5566
5642
  }
5567
- return /* @__PURE__ */ jsx32(PasskeyManagerBody, { title, allowAdd }, user.id);
5643
+ return /* @__PURE__ */ jsx33(PasskeyManagerBody, { title, allowAdd }, user.id);
5568
5644
  }
5569
5645
  function PasskeyManagerBody({
5570
5646
  title,
@@ -5573,12 +5649,12 @@ function PasskeyManagerBody({
5573
5649
  const t = useT();
5574
5650
  const toServerError = useServerError();
5575
5651
  const api = usePasskeys();
5576
- const apiRef = React25.useRef(api);
5652
+ const apiRef = React26.useRef(api);
5577
5653
  apiRef.current = api;
5578
5654
  const { pending, error, setError, run } = useSubmitAction();
5579
- const [passkeys, setPasskeys] = React25.useState(null);
5580
- const loadTokenRef = React25.useRef(0);
5581
- const load = React25.useCallback(async () => {
5655
+ const [passkeys, setPasskeys] = React26.useState(null);
5656
+ const loadTokenRef = React26.useRef(0);
5657
+ const load = React26.useCallback(async () => {
5582
5658
  const token = ++loadTokenRef.current;
5583
5659
  try {
5584
5660
  const res = await apiRef.current.listPasskeys();
@@ -5594,7 +5670,7 @@ function PasskeyManagerBody({
5594
5670
  setError(t("passkeys.error.loadFailed"));
5595
5671
  }
5596
5672
  }, [setError, toServerError, t]);
5597
- React25.useEffect(() => {
5673
+ React26.useEffect(() => {
5598
5674
  void load();
5599
5675
  }, [load]);
5600
5676
  function onRename(id, current) {
@@ -5613,13 +5689,13 @@ function PasskeyManagerBody({
5613
5689
  onSuccess: load
5614
5690
  });
5615
5691
  }
5616
- return /* @__PURE__ */ jsxs28("div", { className: "ba-form", "data-testid": "passkey-manager", children: [
5617
- title !== null && /* @__PURE__ */ jsx32("h2", { className: "ba-title", children: title ?? t("passkeys.title") }),
5618
- passkeys === null ? error ? null : /* @__PURE__ */ jsx32("div", { className: "ba-skeleton" }) : /* @__PURE__ */ jsxs28("ul", { className: "ba-passkey-list", children: [
5619
- (passkeys ?? []).map((pk) => /* @__PURE__ */ jsxs28("li", { className: "ba-passkey-item", children: [
5620
- /* @__PURE__ */ jsx32("span", { className: "ba-passkey-name", children: pk.name?.trim() || t("passkeys.unnamed") }),
5621
- /* @__PURE__ */ jsxs28("span", { className: "ba-passkey-actions", children: [
5622
- /* @__PURE__ */ jsx32(
5692
+ return /* @__PURE__ */ jsxs29("div", { className: "ba-form", "data-testid": "passkey-manager", children: [
5693
+ title !== null && /* @__PURE__ */ jsx33("h2", { className: "ba-title", children: title ?? t("passkeys.title") }),
5694
+ passkeys === null ? error ? null : /* @__PURE__ */ jsx33("div", { className: "ba-skeleton" }) : /* @__PURE__ */ jsxs29("ul", { className: "ba-passkey-list", children: [
5695
+ (passkeys ?? []).map((pk) => /* @__PURE__ */ jsxs29("li", { className: "ba-passkey-item", children: [
5696
+ /* @__PURE__ */ jsx33("span", { className: "ba-passkey-name", children: pk.name?.trim() || t("passkeys.unnamed") }),
5697
+ /* @__PURE__ */ jsxs29("span", { className: "ba-passkey-actions", children: [
5698
+ /* @__PURE__ */ jsx33(
5623
5699
  "button",
5624
5700
  {
5625
5701
  type: "button",
@@ -5629,7 +5705,7 @@ function PasskeyManagerBody({
5629
5705
  children: t("passkeys.rename")
5630
5706
  }
5631
5707
  ),
5632
- /* @__PURE__ */ jsx32(
5708
+ /* @__PURE__ */ jsx33(
5633
5709
  "button",
5634
5710
  {
5635
5711
  type: "button",
@@ -5641,13 +5717,13 @@ function PasskeyManagerBody({
5641
5717
  )
5642
5718
  ] })
5643
5719
  ] }, pk.id)),
5644
- passkeys !== null && passkeys.length === 0 && /* @__PURE__ */ jsx32("li", { className: "ba-muted", children: t("passkeys.empty") })
5720
+ passkeys !== null && passkeys.length === 0 && /* @__PURE__ */ jsx33("li", { className: "ba-muted", children: t("passkeys.empty") })
5645
5721
  ] }),
5646
- error && /* @__PURE__ */ jsxs28("div", { className: "ba-inline-error", children: [
5647
- /* @__PURE__ */ jsx32(FormError, { children: error }),
5648
- passkeys === null && /* @__PURE__ */ jsx32("button", { className: "ba-link-button", type: "button", onClick: () => void load(), children: t("userProfile.retry") })
5722
+ error && /* @__PURE__ */ jsxs29("div", { className: "ba-inline-error", children: [
5723
+ /* @__PURE__ */ jsx33(FormError, { children: error }),
5724
+ passkeys === null && /* @__PURE__ */ jsx33("button", { className: "ba-link-button", type: "button", onClick: () => void load(), children: t("userProfile.retry") })
5649
5725
  ] }),
5650
- passkeys !== null && allowAdd && /* @__PURE__ */ jsx32(
5726
+ passkeys !== null && allowAdd && /* @__PURE__ */ jsx33(
5651
5727
  "button",
5652
5728
  {
5653
5729
  className: "ba-button",
@@ -5658,7 +5734,7 @@ function PasskeyManagerBody({
5658
5734
  failure: t("passkeys.error.addFailed"),
5659
5735
  onSuccess: load
5660
5736
  }),
5661
- children: /* @__PURE__ */ jsx32(Busy, { busy: pending, label: t("common.working"), children: t("passkeys.add") })
5737
+ children: /* @__PURE__ */ jsx33(Busy, { busy: pending, label: t("common.working"), children: t("passkeys.add") })
5662
5738
  }
5663
5739
  )
5664
5740
  ] });
@@ -5666,14 +5742,14 @@ function PasskeyManagerBody({
5666
5742
 
5667
5743
  // src/components/control.tsx
5668
5744
  import { membershipHas } from "@authowl/core";
5669
- import { Fragment as Fragment11, jsx as jsx33, jsxs as jsxs29 } from "react/jsx-runtime";
5745
+ import { Fragment as Fragment11, jsx as jsx34, jsxs as jsxs30 } from "react/jsx-runtime";
5670
5746
  function SignedIn({ children }) {
5671
5747
  const { isLoaded, isSignedIn } = useUser();
5672
- return isLoaded && isSignedIn ? /* @__PURE__ */ jsx33(Fragment11, { children }) : null;
5748
+ return isLoaded && isSignedIn ? /* @__PURE__ */ jsx34(Fragment11, { children }) : null;
5673
5749
  }
5674
5750
  function SignedOut({ children }) {
5675
5751
  const { isLoaded, isSignedIn } = useUser();
5676
- return isLoaded && !isSignedIn ? /* @__PURE__ */ jsx33(Fragment11, { children }) : null;
5752
+ return isLoaded && !isSignedIn ? /* @__PURE__ */ jsx34(Fragment11, { children }) : null;
5677
5753
  }
5678
5754
  function Protect({
5679
5755
  children,
@@ -5686,36 +5762,36 @@ function Protect({
5686
5762
  const { user, isLoaded, isSignedIn } = useUser();
5687
5763
  const membership = useSession().data?.session?.membership ?? null;
5688
5764
  if (!isLoaded) return null;
5689
- if (!isSignedIn || !user) return /* @__PURE__ */ jsx33(Fragment11, { children: fallback });
5765
+ if (!isSignedIn || !user) return /* @__PURE__ */ jsx34(Fragment11, { children: fallback });
5690
5766
  if ((role !== void 0 || permission !== void 0 || teamId !== void 0) && !membershipHas(membership, { role, permission, teamId })) {
5691
- return /* @__PURE__ */ jsx33(Fragment11, { children: fallback });
5767
+ return /* @__PURE__ */ jsx34(Fragment11, { children: fallback });
5692
5768
  }
5693
- if (condition && !condition(user)) return /* @__PURE__ */ jsx33(Fragment11, { children: fallback });
5694
- return /* @__PURE__ */ jsx33(Fragment11, { children });
5769
+ if (condition && !condition(user)) return /* @__PURE__ */ jsx34(Fragment11, { children: fallback });
5770
+ return /* @__PURE__ */ jsx34(Fragment11, { children });
5695
5771
  }
5696
5772
  function AuthLoading({ children }) {
5697
5773
  const t = useT();
5698
5774
  const { isLoaded } = useUser();
5699
5775
  if (isLoaded) return null;
5700
- if (children !== void 0) return /* @__PURE__ */ jsx33(Fragment11, { children });
5701
- return /* @__PURE__ */ jsxs29("div", { className: "ba-auth-loading", role: "status", "aria-busy": "true", "data-testid": "auth-loading", children: [
5702
- /* @__PURE__ */ jsx33(Spinner, {}),
5703
- /* @__PURE__ */ jsx33("span", { className: "ba-sr-only", children: t("common.loading") })
5776
+ if (children !== void 0) return /* @__PURE__ */ jsx34(Fragment11, { children });
5777
+ return /* @__PURE__ */ jsxs30("div", { className: "ba-auth-loading", role: "status", "aria-busy": "true", "data-testid": "auth-loading", children: [
5778
+ /* @__PURE__ */ jsx34(Spinner, {}),
5779
+ /* @__PURE__ */ jsx34("span", { className: "ba-sr-only", children: t("common.loading") })
5704
5780
  ] });
5705
5781
  }
5706
5782
  function AuthLoaded({ children }) {
5707
- return useUser().isLoaded ? /* @__PURE__ */ jsx33(Fragment11, { children }) : null;
5783
+ return useUser().isLoaded ? /* @__PURE__ */ jsx34(Fragment11, { children }) : null;
5708
5784
  }
5709
5785
 
5710
5786
  // src/components/SignOutButton.tsx
5711
- import * as React26 from "react";
5712
- import { jsx as jsx34 } from "react/jsx-runtime";
5787
+ import * as React27 from "react";
5788
+ import { jsx as jsx35 } from "react/jsx-runtime";
5713
5789
  function SignOutButton({ children, redirectTo, onSignedOut, className }) {
5714
5790
  const t = useT();
5715
5791
  const { signOut } = useSignOut();
5716
- const [pending, setPending] = React26.useState(false);
5792
+ const [pending, setPending] = React27.useState(false);
5717
5793
  const content = children ?? t("signOut.button");
5718
- return /* @__PURE__ */ jsx34(
5794
+ return /* @__PURE__ */ jsx35(
5719
5795
  "button",
5720
5796
  {
5721
5797
  type: "button",
@@ -5733,32 +5809,32 @@ function SignOutButton({ children, redirectTo, onSignedOut, className }) {
5733
5809
  setPending(false);
5734
5810
  }
5735
5811
  },
5736
- children: /* @__PURE__ */ jsx34(Busy, { busy: pending, label: content, children: content })
5812
+ children: /* @__PURE__ */ jsx35(Busy, { busy: pending, label: content, children: content })
5737
5813
  }
5738
5814
  );
5739
5815
  }
5740
5816
 
5741
5817
  // src/components/UserButton.tsx
5742
- import * as React40 from "react";
5818
+ import * as React41 from "react";
5743
5819
 
5744
5820
  // src/components/UserProfile.tsx
5745
- import * as React39 from "react";
5821
+ import * as React40 from "react";
5746
5822
 
5747
5823
  // src/components/user-profile/EmailSection.tsx
5748
- import * as React27 from "react";
5749
- import { jsx as jsx35, jsxs as jsxs30 } from "react/jsx-runtime";
5824
+ import * as React28 from "react";
5825
+ import { jsx as jsx36, jsxs as jsxs31 } from "react/jsx-runtime";
5750
5826
  function EmailSection({ allowChange }) {
5751
5827
  const t = useT();
5752
5828
  const account = useAccount();
5753
5829
  const { user } = useUser();
5754
5830
  const { pending, error, run } = useSubmitAction();
5755
- const [newEmail, setNewEmail] = React27.useState("");
5756
- const [sent, setSent] = React27.useState(false);
5757
- const titleId = React27.useId();
5831
+ const [newEmail, setNewEmail] = React28.useState("");
5832
+ const [sent, setSent] = React28.useState(false);
5833
+ const titleId = React28.useId();
5758
5834
  if (!user?.email) {
5759
- return /* @__PURE__ */ jsxs30("section", { className: "ba-profile-section", "aria-labelledby": titleId, children: [
5760
- /* @__PURE__ */ jsx35("h2", { id: titleId, className: "ba-title", children: t("userProfile.email.title") }),
5761
- /* @__PURE__ */ jsx35("p", { className: "ba-muted", children: t("userProfile.email.unavailable") })
5835
+ return /* @__PURE__ */ jsxs31("section", { className: "ba-profile-section", "aria-labelledby": titleId, children: [
5836
+ /* @__PURE__ */ jsx36("h2", { id: titleId, className: "ba-title", children: t("userProfile.email.title") }),
5837
+ /* @__PURE__ */ jsx36("p", { className: "ba-muted", children: t("userProfile.email.unavailable") })
5762
5838
  ] });
5763
5839
  }
5764
5840
  const submit = (event) => {
@@ -5778,19 +5854,19 @@ function EmailSection({ allowChange }) {
5778
5854
  }
5779
5855
  );
5780
5856
  };
5781
- return /* @__PURE__ */ jsxs30("section", { className: "ba-profile-section", "aria-labelledby": titleId, children: [
5782
- /* @__PURE__ */ jsxs30("header", { className: "ba-profile-section-header", children: [
5783
- /* @__PURE__ */ jsx35("h2", { id: titleId, className: "ba-title", children: t("userProfile.email.title") }),
5784
- /* @__PURE__ */ jsx35("p", { className: "ba-muted", children: t("userProfile.email.description") })
5857
+ return /* @__PURE__ */ jsxs31("section", { className: "ba-profile-section", "aria-labelledby": titleId, children: [
5858
+ /* @__PURE__ */ jsxs31("header", { className: "ba-profile-section-header", children: [
5859
+ /* @__PURE__ */ jsx36("h2", { id: titleId, className: "ba-title", children: t("userProfile.email.title") }),
5860
+ /* @__PURE__ */ jsx36("p", { className: "ba-muted", children: t("userProfile.email.description") })
5785
5861
  ] }),
5786
- /* @__PURE__ */ jsxs30("p", { className: "ba-profile-current", children: [
5787
- /* @__PURE__ */ jsx35("span", { children: t("userProfile.email.current") }),
5788
- /* @__PURE__ */ jsx35("strong", { children: /* @__PURE__ */ jsx35(Bidi, { children: user.email }) })
5862
+ /* @__PURE__ */ jsxs31("p", { className: "ba-profile-current", children: [
5863
+ /* @__PURE__ */ jsx36("span", { children: t("userProfile.email.current") }),
5864
+ /* @__PURE__ */ jsx36("strong", { children: /* @__PURE__ */ jsx36(Bidi, { children: user.email }) })
5789
5865
  ] }),
5790
- !allowChange ? /* @__PURE__ */ jsx35("p", { className: "ba-muted", "data-testid": "email-change-disabled", children: t("userProfile.email.changeDisabled") }) : /* @__PURE__ */ jsxs30("form", { method: "post", className: "ba-fields", onSubmit: submit, children: [
5791
- /* @__PURE__ */ jsxs30("label", { className: "ba-label", children: [
5866
+ !allowChange ? /* @__PURE__ */ jsx36("p", { className: "ba-muted", "data-testid": "email-change-disabled", children: t("userProfile.email.changeDisabled") }) : /* @__PURE__ */ jsxs31("form", { method: "post", className: "ba-fields", onSubmit: submit, children: [
5867
+ /* @__PURE__ */ jsxs31("label", { className: "ba-label", children: [
5792
5868
  t("userProfile.email.newLabel"),
5793
- /* @__PURE__ */ jsx35(
5869
+ /* @__PURE__ */ jsx36(
5794
5870
  "input",
5795
5871
  {
5796
5872
  className: "ba-input",
@@ -5802,16 +5878,16 @@ function EmailSection({ allowChange }) {
5802
5878
  }
5803
5879
  )
5804
5880
  ] }),
5805
- /* @__PURE__ */ jsx35(FormError, { children: error }),
5806
- sent && /* @__PURE__ */ jsx35("p", { className: "ba-success", role: "status", children: t("userProfile.email.sent") }),
5807
- /* @__PURE__ */ jsx35(
5881
+ /* @__PURE__ */ jsx36(FormError, { children: error }),
5882
+ sent && /* @__PURE__ */ jsx36("p", { className: "ba-success", role: "status", children: t("userProfile.email.sent") }),
5883
+ /* @__PURE__ */ jsx36(
5808
5884
  "button",
5809
5885
  {
5810
5886
  className: "ba-button ba-profile-submit",
5811
5887
  type: "submit",
5812
5888
  disabled: pending || !newEmail.trim(),
5813
5889
  "aria-busy": pending || void 0,
5814
- children: /* @__PURE__ */ jsx35(Busy, { busy: pending, label: t("common.sending"), children: t("userProfile.email.submit") })
5890
+ children: /* @__PURE__ */ jsx36(Busy, { busy: pending, label: t("common.sending"), children: t("userProfile.email.submit") })
5815
5891
  }
5816
5892
  )
5817
5893
  ] })
@@ -5819,16 +5895,16 @@ function EmailSection({ allowChange }) {
5819
5895
  }
5820
5896
 
5821
5897
  // src/components/user-profile/DeleteAccountSection.tsx
5822
- import * as React28 from "react";
5823
- import { jsx as jsx36, jsxs as jsxs31 } from "react/jsx-runtime";
5898
+ import * as React29 from "react";
5899
+ import { jsx as jsx37, jsxs as jsxs32 } from "react/jsx-runtime";
5824
5900
  function DeleteAccountSection({ onDeleted }) {
5825
5901
  const t = useT();
5826
5902
  const account = useAccount();
5827
5903
  const session = useSession();
5828
5904
  const { user } = useUser();
5829
5905
  const { pending, error, run } = useSubmitAction();
5830
- const [confirmation, setConfirmation] = React28.useState("");
5831
- const titleId = React28.useId();
5906
+ const [confirmation, setConfirmation] = React29.useState("");
5907
+ const titleId = React29.useId();
5832
5908
  const identifier = user?.email ?? user?.phoneNumber ?? user?.id ?? "";
5833
5909
  const confirmed = identifier.length > 0 && confirmation.trim().toLowerCase() === identifier.toLowerCase();
5834
5910
  const submit = (event) => {
@@ -5845,18 +5921,18 @@ function DeleteAccountSection({ onDeleted }) {
5845
5921
  }
5846
5922
  );
5847
5923
  };
5848
- return /* @__PURE__ */ jsxs31("section", { className: "ba-profile-section ba-profile-danger-zone", "aria-labelledby": titleId, children: [
5849
- /* @__PURE__ */ jsxs31("header", { className: "ba-profile-section-header", children: [
5850
- /* @__PURE__ */ jsx36("h2", { id: titleId, className: "ba-title", children: t("userProfile.delete.title") }),
5851
- /* @__PURE__ */ jsx36("p", { className: "ba-muted", children: t("userProfile.delete.description") })
5924
+ return /* @__PURE__ */ jsxs32("section", { className: "ba-profile-section ba-profile-danger-zone", "aria-labelledby": titleId, children: [
5925
+ /* @__PURE__ */ jsxs32("header", { className: "ba-profile-section-header", children: [
5926
+ /* @__PURE__ */ jsx37("h2", { id: titleId, className: "ba-title", children: t("userProfile.delete.title") }),
5927
+ /* @__PURE__ */ jsx37("p", { className: "ba-muted", children: t("userProfile.delete.description") })
5852
5928
  ] }),
5853
- /* @__PURE__ */ jsxs31("form", { method: "post", className: "ba-fields", onSubmit: submit, children: [
5854
- /* @__PURE__ */ jsx36("p", { className: "ba-profile-delete-warning", children: t("userProfile.delete.warning", { identifier }) }),
5855
- /* @__PURE__ */ jsxs31("label", { className: "ba-label", children: [
5929
+ /* @__PURE__ */ jsxs32("form", { method: "post", className: "ba-fields", onSubmit: submit, children: [
5930
+ /* @__PURE__ */ jsx37("p", { className: "ba-profile-delete-warning", children: t("userProfile.delete.warning", { identifier }) }),
5931
+ /* @__PURE__ */ jsxs32("label", { className: "ba-label", children: [
5856
5932
  t("userProfile.delete.confirmLabel"),
5857
5933
  " ",
5858
- /* @__PURE__ */ jsx36(Bidi, { children: identifier }),
5859
- /* @__PURE__ */ jsx36(
5934
+ /* @__PURE__ */ jsx37(Bidi, { children: identifier }),
5935
+ /* @__PURE__ */ jsx37(
5860
5936
  "input",
5861
5937
  {
5862
5938
  className: "ba-input",
@@ -5870,15 +5946,15 @@ function DeleteAccountSection({ onDeleted }) {
5870
5946
  }
5871
5947
  )
5872
5948
  ] }),
5873
- /* @__PURE__ */ jsx36(FormError, { children: error }),
5874
- /* @__PURE__ */ jsx36(
5949
+ /* @__PURE__ */ jsx37(FormError, { children: error }),
5950
+ /* @__PURE__ */ jsx37(
5875
5951
  "button",
5876
5952
  {
5877
5953
  className: "ba-button ba-danger-button ba-profile-submit",
5878
5954
  type: "submit",
5879
5955
  disabled: pending || !confirmed,
5880
5956
  "aria-busy": pending || void 0,
5881
- children: /* @__PURE__ */ jsx36(Busy, { busy: pending, label: t("common.working"), children: t("userProfile.delete.submit") })
5957
+ children: /* @__PURE__ */ jsx37(Busy, { busy: pending, label: t("common.working"), children: t("userProfile.delete.submit") })
5882
5958
  }
5883
5959
  )
5884
5960
  ] })
@@ -5886,8 +5962,8 @@ function DeleteAccountSection({ onDeleted }) {
5886
5962
  }
5887
5963
 
5888
5964
  // src/components/user-profile/MfaSection.tsx
5889
- import * as React29 from "react";
5890
- import { jsx as jsx37, jsxs as jsxs32 } from "react/jsx-runtime";
5965
+ import * as React30 from "react";
5966
+ import { jsx as jsx38, jsxs as jsxs33 } from "react/jsx-runtime";
5891
5967
  function MfaSection() {
5892
5968
  const t = useT();
5893
5969
  const { user } = useUser();
@@ -5895,17 +5971,17 @@ function MfaSection() {
5895
5971
  const { config } = usePublicConfig();
5896
5972
  const { disable } = useMFA();
5897
5973
  const { pending, error, run } = useSubmitAction();
5898
- const [password, setPassword] = React29.useState("");
5899
- const [showDisable, setShowDisable] = React29.useState(false);
5900
- const titleId = React29.useId();
5974
+ const [password, setPassword] = React30.useState("");
5975
+ const [showDisable, setShowDisable] = React30.useState(false);
5976
+ const titleId = React30.useId();
5901
5977
  const required = resolveProjectCapabilities(config).mfaRequired;
5902
5978
  if (!user?.twoFactorEnabled) {
5903
- return /* @__PURE__ */ jsxs32("section", { className: "ba-profile-section", "aria-labelledby": titleId, children: [
5904
- /* @__PURE__ */ jsxs32("header", { className: "ba-profile-section-header", children: [
5905
- /* @__PURE__ */ jsx37("h2", { id: titleId, className: "ba-title", children: t("userProfile.mfa.title") }),
5906
- /* @__PURE__ */ jsx37("p", { className: "ba-muted", children: required ? t("userProfile.mfa.requiredDescription") : t("userProfile.mfa.description") })
5979
+ return /* @__PURE__ */ jsxs33("section", { className: "ba-profile-section", "aria-labelledby": titleId, children: [
5980
+ /* @__PURE__ */ jsxs33("header", { className: "ba-profile-section-header", children: [
5981
+ /* @__PURE__ */ jsx38("h2", { id: titleId, className: "ba-title", children: t("userProfile.mfa.title") }),
5982
+ /* @__PURE__ */ jsx38("p", { className: "ba-muted", children: required ? t("userProfile.mfa.requiredDescription") : t("userProfile.mfa.description") })
5907
5983
  ] }),
5908
- /* @__PURE__ */ jsx37(
5984
+ /* @__PURE__ */ jsx38(
5909
5985
  MFAEnrollment,
5910
5986
  {
5911
5987
  title: null,
@@ -5928,16 +6004,16 @@ function MfaSection() {
5928
6004
  }
5929
6005
  );
5930
6006
  };
5931
- return /* @__PURE__ */ jsxs32("section", { className: "ba-profile-section", "aria-labelledby": titleId, children: [
5932
- /* @__PURE__ */ jsxs32("header", { className: "ba-profile-section-header", children: [
5933
- /* @__PURE__ */ jsx37("h2", { id: titleId, className: "ba-title", children: t("userProfile.mfa.title") }),
5934
- /* @__PURE__ */ jsx37("p", { className: "ba-muted", children: required ? t("userProfile.mfa.requiredActive") : t("userProfile.mfa.active") })
6007
+ return /* @__PURE__ */ jsxs33("section", { className: "ba-profile-section", "aria-labelledby": titleId, children: [
6008
+ /* @__PURE__ */ jsxs33("header", { className: "ba-profile-section-header", children: [
6009
+ /* @__PURE__ */ jsx38("h2", { id: titleId, className: "ba-title", children: t("userProfile.mfa.title") }),
6010
+ /* @__PURE__ */ jsx38("p", { className: "ba-muted", children: required ? t("userProfile.mfa.requiredActive") : t("userProfile.mfa.active") })
5935
6011
  ] }),
5936
- /* @__PURE__ */ jsxs32("div", { className: "ba-profile-status", role: "status", children: [
5937
- /* @__PURE__ */ jsx37("strong", { children: t("userProfile.mfa.enabled") }),
5938
- /* @__PURE__ */ jsx37("span", { children: t("userProfile.mfa.authenticator") })
6012
+ /* @__PURE__ */ jsxs33("div", { className: "ba-profile-status", role: "status", children: [
6013
+ /* @__PURE__ */ jsx38("strong", { children: t("userProfile.mfa.enabled") }),
6014
+ /* @__PURE__ */ jsx38("span", { children: t("userProfile.mfa.authenticator") })
5939
6015
  ] }),
5940
- !showDisable ? /* @__PURE__ */ jsx37(
6016
+ !showDisable ? /* @__PURE__ */ jsx38(
5941
6017
  "button",
5942
6018
  {
5943
6019
  className: "ba-button ba-button-secondary ba-profile-submit",
@@ -5945,11 +6021,11 @@ function MfaSection() {
5945
6021
  onClick: () => setShowDisable(true),
5946
6022
  children: required ? t("userProfile.mfa.replace") : t("userProfile.mfa.disable")
5947
6023
  }
5948
- ) : /* @__PURE__ */ jsxs32("form", { method: "post", className: "ba-fields ba-profile-security-form", onSubmit: submitDisable, children: [
5949
- /* @__PURE__ */ jsx37("p", { className: "ba-muted", children: required ? t("userProfile.mfa.replaceWarning") : t("userProfile.mfa.disableWarning") }),
5950
- /* @__PURE__ */ jsxs32("label", { className: "ba-label", children: [
6024
+ ) : /* @__PURE__ */ jsxs33("form", { method: "post", className: "ba-fields ba-profile-security-form", onSubmit: submitDisable, children: [
6025
+ /* @__PURE__ */ jsx38("p", { className: "ba-muted", children: required ? t("userProfile.mfa.replaceWarning") : t("userProfile.mfa.disableWarning") }),
6026
+ /* @__PURE__ */ jsxs33("label", { className: "ba-label", children: [
5951
6027
  t("common.passwordLabel"),
5952
- /* @__PURE__ */ jsx37(
6028
+ /* @__PURE__ */ jsx38(
5953
6029
  "input",
5954
6030
  {
5955
6031
  className: "ba-input",
@@ -5961,19 +6037,19 @@ function MfaSection() {
5961
6037
  }
5962
6038
  )
5963
6039
  ] }),
5964
- /* @__PURE__ */ jsx37(FormError, { children: error }),
5965
- /* @__PURE__ */ jsxs32("span", { className: "ba-profile-action-row", children: [
5966
- /* @__PURE__ */ jsx37(
6040
+ /* @__PURE__ */ jsx38(FormError, { children: error }),
6041
+ /* @__PURE__ */ jsxs33("span", { className: "ba-profile-action-row", children: [
6042
+ /* @__PURE__ */ jsx38(
5967
6043
  "button",
5968
6044
  {
5969
6045
  className: "ba-button ba-danger-button",
5970
6046
  type: "submit",
5971
6047
  disabled: pending || !password,
5972
6048
  "aria-busy": pending || void 0,
5973
- children: /* @__PURE__ */ jsx37(Busy, { busy: pending, label: t("common.working"), children: required ? t("userProfile.mfa.replaceConfirm") : t("userProfile.mfa.disableConfirm") })
6049
+ children: /* @__PURE__ */ jsx38(Busy, { busy: pending, label: t("common.working"), children: required ? t("userProfile.mfa.replaceConfirm") : t("userProfile.mfa.disableConfirm") })
5974
6050
  }
5975
6051
  ),
5976
- /* @__PURE__ */ jsx37(
6052
+ /* @__PURE__ */ jsx38(
5977
6053
  "button",
5978
6054
  {
5979
6055
  className: "ba-button ba-button-secondary",
@@ -5992,19 +6068,19 @@ function MfaSection() {
5992
6068
  }
5993
6069
 
5994
6070
  // src/components/user-profile/PasswordSection.tsx
5995
- import * as React30 from "react";
5996
- import { jsx as jsx38, jsxs as jsxs33 } from "react/jsx-runtime";
6071
+ import * as React31 from "react";
6072
+ import { jsx as jsx39, jsxs as jsxs34 } from "react/jsx-runtime";
5997
6073
  function PasswordSection() {
5998
6074
  const t = useT();
5999
6075
  const account = useAccount();
6000
6076
  const { config } = usePublicConfig();
6001
6077
  const { passwordMinLength, passwordMaxLength } = resolveProjectCapabilities(config);
6002
6078
  const { pending, error, setError, run } = useSubmitAction();
6003
- const [currentPassword, setCurrentPassword] = React30.useState("");
6004
- const [newPassword, setNewPassword] = React30.useState("");
6005
- const [confirmPassword, setConfirmPassword] = React30.useState("");
6006
- const [saved, setSaved] = React30.useState(false);
6007
- const titleId = React30.useId();
6079
+ const [currentPassword, setCurrentPassword] = React31.useState("");
6080
+ const [newPassword, setNewPassword] = React31.useState("");
6081
+ const [confirmPassword, setConfirmPassword] = React31.useState("");
6082
+ const [saved, setSaved] = React31.useState(false);
6083
+ const titleId = React31.useId();
6008
6084
  const submit = (event) => {
6009
6085
  event.preventDefault();
6010
6086
  setSaved(false);
@@ -6029,43 +6105,43 @@ function PasswordSection() {
6029
6105
  }
6030
6106
  );
6031
6107
  };
6032
- return /* @__PURE__ */ jsxs33("section", { className: "ba-profile-section", "aria-labelledby": titleId, children: [
6033
- /* @__PURE__ */ jsxs33("header", { className: "ba-profile-section-header", children: [
6034
- /* @__PURE__ */ jsx38("h2", { id: titleId, className: "ba-title", children: t("userProfile.password.title") }),
6035
- /* @__PURE__ */ jsx38("p", { className: "ba-muted", children: t("userProfile.password.description") })
6108
+ return /* @__PURE__ */ jsxs34("section", { className: "ba-profile-section", "aria-labelledby": titleId, children: [
6109
+ /* @__PURE__ */ jsxs34("header", { className: "ba-profile-section-header", children: [
6110
+ /* @__PURE__ */ jsx39("h2", { id: titleId, className: "ba-title", children: t("userProfile.password.title") }),
6111
+ /* @__PURE__ */ jsx39("p", { className: "ba-muted", children: t("userProfile.password.description") })
6036
6112
  ] }),
6037
- /* @__PURE__ */ jsxs33("form", { method: "post", className: "ba-fields", onSubmit: submit, children: [
6038
- /* @__PURE__ */ jsxs33("label", { className: "ba-label", children: [
6113
+ /* @__PURE__ */ jsxs34("form", { method: "post", className: "ba-fields", onSubmit: submit, children: [
6114
+ /* @__PURE__ */ jsxs34("label", { className: "ba-label", children: [
6039
6115
  t("userProfile.password.currentLabel"),
6040
- /* @__PURE__ */ jsx38("input", { className: "ba-input", type: "password", autoComplete: "current-password", value: currentPassword, onChange: (event) => {
6116
+ /* @__PURE__ */ jsx39("input", { className: "ba-input", type: "password", autoComplete: "current-password", value: currentPassword, onChange: (event) => {
6041
6117
  setCurrentPassword(event.target.value);
6042
6118
  setError(null);
6043
6119
  }, required: true })
6044
6120
  ] }),
6045
- /* @__PURE__ */ jsxs33("label", { className: "ba-label", children: [
6121
+ /* @__PURE__ */ jsxs34("label", { className: "ba-label", children: [
6046
6122
  t("resetPassword.newPasswordLabel"),
6047
- /* @__PURE__ */ jsx38("input", { className: "ba-input", type: "password", autoComplete: "new-password", value: newPassword, onChange: (event) => {
6123
+ /* @__PURE__ */ jsx39("input", { className: "ba-input", type: "password", autoComplete: "new-password", value: newPassword, onChange: (event) => {
6048
6124
  setNewPassword(event.target.value);
6049
6125
  setError(null);
6050
6126
  }, minLength: passwordMinLength, maxLength: passwordMaxLength, required: true })
6051
6127
  ] }),
6052
- /* @__PURE__ */ jsxs33("label", { className: "ba-label", children: [
6128
+ /* @__PURE__ */ jsxs34("label", { className: "ba-label", children: [
6053
6129
  t("resetPassword.confirmPasswordLabel"),
6054
- /* @__PURE__ */ jsx38("input", { className: "ba-input", type: "password", autoComplete: "new-password", value: confirmPassword, onChange: (event) => {
6130
+ /* @__PURE__ */ jsx39("input", { className: "ba-input", type: "password", autoComplete: "new-password", value: confirmPassword, onChange: (event) => {
6055
6131
  setConfirmPassword(event.target.value);
6056
6132
  setError(null);
6057
6133
  }, minLength: passwordMinLength, maxLength: passwordMaxLength, required: true })
6058
6134
  ] }),
6059
- /* @__PURE__ */ jsx38(FormError, { children: error }),
6060
- saved && /* @__PURE__ */ jsx38("p", { className: "ba-success", role: "status", children: t("userProfile.password.saved") }),
6061
- /* @__PURE__ */ jsx38(
6135
+ /* @__PURE__ */ jsx39(FormError, { children: error }),
6136
+ saved && /* @__PURE__ */ jsx39("p", { className: "ba-success", role: "status", children: t("userProfile.password.saved") }),
6137
+ /* @__PURE__ */ jsx39(
6062
6138
  "button",
6063
6139
  {
6064
6140
  className: "ba-button ba-profile-submit",
6065
6141
  type: "submit",
6066
6142
  disabled: pending || !currentPassword || !newPassword || !confirmPassword,
6067
6143
  "aria-busy": pending || void 0,
6068
- children: /* @__PURE__ */ jsx38(Busy, { busy: pending, label: t("common.working"), children: t("userProfile.password.submit") })
6144
+ children: /* @__PURE__ */ jsx39(Busy, { busy: pending, label: t("common.working"), children: t("userProfile.password.submit") })
6069
6145
  }
6070
6146
  )
6071
6147
  ] })
@@ -6073,23 +6149,23 @@ function PasswordSection() {
6073
6149
  }
6074
6150
 
6075
6151
  // src/components/user-profile/PasskeysSection.tsx
6076
- import * as React31 from "react";
6077
- import { jsx as jsx39, jsxs as jsxs34 } from "react/jsx-runtime";
6152
+ import * as React32 from "react";
6153
+ import { jsx as jsx40, jsxs as jsxs35 } from "react/jsx-runtime";
6078
6154
  function PasskeysSection({ allowAdd }) {
6079
6155
  const t = useT();
6080
- const titleId = React31.useId();
6081
- return /* @__PURE__ */ jsxs34("section", { className: "ba-profile-section", "aria-labelledby": titleId, children: [
6082
- /* @__PURE__ */ jsxs34("header", { className: "ba-profile-section-header", children: [
6083
- /* @__PURE__ */ jsx39("h2", { id: titleId, className: "ba-title", children: t("userProfile.passkeys.title") }),
6084
- /* @__PURE__ */ jsx39("p", { className: "ba-muted", children: t("userProfile.passkeys.description") })
6156
+ const titleId = React32.useId();
6157
+ return /* @__PURE__ */ jsxs35("section", { className: "ba-profile-section", "aria-labelledby": titleId, children: [
6158
+ /* @__PURE__ */ jsxs35("header", { className: "ba-profile-section-header", children: [
6159
+ /* @__PURE__ */ jsx40("h2", { id: titleId, className: "ba-title", children: t("userProfile.passkeys.title") }),
6160
+ /* @__PURE__ */ jsx40("p", { className: "ba-muted", children: t("userProfile.passkeys.description") })
6085
6161
  ] }),
6086
- /* @__PURE__ */ jsx39(PasskeyManager, { title: null, allowAdd })
6162
+ /* @__PURE__ */ jsx40(PasskeyManager, { title: null, allowAdd })
6087
6163
  ] });
6088
6164
  }
6089
6165
 
6090
6166
  // src/components/user-profile/ProfileSection.tsx
6091
- import * as React32 from "react";
6092
- import { Fragment as Fragment12, jsx as jsx40, jsxs as jsxs35 } from "react/jsx-runtime";
6167
+ import * as React33 from "react";
6168
+ import { Fragment as Fragment12, jsx as jsx41, jsxs as jsxs36 } from "react/jsx-runtime";
6093
6169
  function ProfileSection({
6094
6170
  firstLastName,
6095
6171
  usernameEnabled,
@@ -6100,15 +6176,15 @@ function ProfileSection({
6100
6176
  const { user } = useUser();
6101
6177
  const session = useSession();
6102
6178
  const { pending, error, run } = useSubmitAction();
6103
- const [name, setName] = React32.useState(user?.name ?? "");
6104
- const [firstName, setFirstName] = React32.useState(user?.firstName ?? "");
6105
- const [lastName, setLastName] = React32.useState(user?.lastName ?? "");
6106
- const [username, setUsername] = React32.useState(
6179
+ const [name, setName] = React33.useState(user?.name ?? "");
6180
+ const [firstName, setFirstName] = React33.useState(user?.firstName ?? "");
6181
+ const [lastName, setLastName] = React33.useState(user?.lastName ?? "");
6182
+ const [username, setUsername] = React33.useState(
6107
6183
  user?.displayUsername ?? user?.username ?? ""
6108
6184
  );
6109
- const [image, setImage] = React32.useState(user?.image ?? "");
6110
- const [saved, setSaved] = React32.useState(false);
6111
- const titleId = React32.useId();
6185
+ const [image, setImage] = React33.useState(user?.image ?? "");
6186
+ const [saved, setSaved] = React33.useState(false);
6187
+ const titleId = React33.useId();
6112
6188
  const submit = (event) => {
6113
6189
  event.preventDefault();
6114
6190
  setSaved(false);
@@ -6131,15 +6207,15 @@ function ProfileSection({
6131
6207
  }
6132
6208
  );
6133
6209
  };
6134
- return /* @__PURE__ */ jsxs35("section", { className: "ba-profile-section", "aria-labelledby": titleId, children: [
6135
- /* @__PURE__ */ jsxs35("header", { className: "ba-profile-section-header", children: [
6136
- /* @__PURE__ */ jsx40("h2", { id: titleId, className: "ba-title", children: t("userProfile.profile.title") }),
6137
- /* @__PURE__ */ jsx40("p", { className: "ba-muted", children: t("userProfile.profile.description") })
6210
+ return /* @__PURE__ */ jsxs36("section", { className: "ba-profile-section", "aria-labelledby": titleId, children: [
6211
+ /* @__PURE__ */ jsxs36("header", { className: "ba-profile-section-header", children: [
6212
+ /* @__PURE__ */ jsx41("h2", { id: titleId, className: "ba-title", children: t("userProfile.profile.title") }),
6213
+ /* @__PURE__ */ jsx41("p", { className: "ba-muted", children: t("userProfile.profile.description") })
6138
6214
  ] }),
6139
- /* @__PURE__ */ jsxs35("form", { method: "post", className: "ba-fields", onSubmit: submit, children: [
6140
- legacyNameField && /* @__PURE__ */ jsxs35("label", { className: "ba-label", children: [
6215
+ /* @__PURE__ */ jsxs36("form", { method: "post", className: "ba-fields", onSubmit: submit, children: [
6216
+ legacyNameField && /* @__PURE__ */ jsxs36("label", { className: "ba-label", children: [
6141
6217
  t("signUp.nameLabel"),
6142
- /* @__PURE__ */ jsx40(
6218
+ /* @__PURE__ */ jsx41(
6143
6219
  "input",
6144
6220
  {
6145
6221
  className: "ba-input",
@@ -6150,10 +6226,10 @@ function ProfileSection({
6150
6226
  }
6151
6227
  )
6152
6228
  ] }),
6153
- firstLastName && /* @__PURE__ */ jsxs35(Fragment12, { children: [
6154
- /* @__PURE__ */ jsxs35("label", { className: "ba-label", children: [
6229
+ firstLastName && /* @__PURE__ */ jsxs36(Fragment12, { children: [
6230
+ /* @__PURE__ */ jsxs36("label", { className: "ba-label", children: [
6155
6231
  t("signUp.firstNameLabel"),
6156
- /* @__PURE__ */ jsx40(
6232
+ /* @__PURE__ */ jsx41(
6157
6233
  "input",
6158
6234
  {
6159
6235
  className: "ba-input",
@@ -6163,9 +6239,9 @@ function ProfileSection({
6163
6239
  }
6164
6240
  )
6165
6241
  ] }),
6166
- /* @__PURE__ */ jsxs35("label", { className: "ba-label", children: [
6242
+ /* @__PURE__ */ jsxs36("label", { className: "ba-label", children: [
6167
6243
  t("signUp.lastNameLabel"),
6168
- /* @__PURE__ */ jsx40(
6244
+ /* @__PURE__ */ jsx41(
6169
6245
  "input",
6170
6246
  {
6171
6247
  className: "ba-input",
@@ -6176,9 +6252,9 @@ function ProfileSection({
6176
6252
  )
6177
6253
  ] })
6178
6254
  ] }),
6179
- usernameEnabled && /* @__PURE__ */ jsxs35("label", { className: "ba-label", children: [
6255
+ usernameEnabled && /* @__PURE__ */ jsxs36("label", { className: "ba-label", children: [
6180
6256
  t("common.usernameLabel"),
6181
- /* @__PURE__ */ jsx40(
6257
+ /* @__PURE__ */ jsx41(
6182
6258
  "input",
6183
6259
  {
6184
6260
  className: "ba-input",
@@ -6188,9 +6264,9 @@ function ProfileSection({
6188
6264
  }
6189
6265
  )
6190
6266
  ] }),
6191
- /* @__PURE__ */ jsxs35("label", { className: "ba-label", children: [
6267
+ /* @__PURE__ */ jsxs36("label", { className: "ba-label", children: [
6192
6268
  t("userProfile.profile.imageLabel"),
6193
- /* @__PURE__ */ jsx40(
6269
+ /* @__PURE__ */ jsx41(
6194
6270
  "input",
6195
6271
  {
6196
6272
  className: "ba-input",
@@ -6201,16 +6277,16 @@ function ProfileSection({
6201
6277
  }
6202
6278
  )
6203
6279
  ] }),
6204
- /* @__PURE__ */ jsx40(FormError, { children: error }),
6205
- saved && /* @__PURE__ */ jsx40("p", { className: "ba-success", role: "status", children: t("userProfile.profile.saved") }),
6206
- /* @__PURE__ */ jsx40(
6280
+ /* @__PURE__ */ jsx41(FormError, { children: error }),
6281
+ saved && /* @__PURE__ */ jsx41("p", { className: "ba-success", role: "status", children: t("userProfile.profile.saved") }),
6282
+ /* @__PURE__ */ jsx41(
6207
6283
  "button",
6208
6284
  {
6209
6285
  className: "ba-button ba-profile-submit",
6210
6286
  type: "submit",
6211
6287
  disabled: pending || legacyNameField && !name.trim(),
6212
6288
  "aria-busy": pending || void 0,
6213
- children: /* @__PURE__ */ jsx40(Busy, { busy: pending, label: t("common.working"), children: t("userProfile.save") })
6289
+ children: /* @__PURE__ */ jsx41(Busy, { busy: pending, label: t("common.working"), children: t("userProfile.save") })
6214
6290
  }
6215
6291
  )
6216
6292
  ] })
@@ -6218,30 +6294,30 @@ function ProfileSection({
6218
6294
  }
6219
6295
 
6220
6296
  // src/components/user-profile/RecoverySection.tsx
6221
- import * as React33 from "react";
6222
- import { Fragment as Fragment13, jsx as jsx41, jsxs as jsxs36 } from "react/jsx-runtime";
6297
+ import * as React34 from "react";
6298
+ import { Fragment as Fragment13, jsx as jsx42, jsxs as jsxs37 } from "react/jsx-runtime";
6223
6299
  function RecoverySection() {
6224
6300
  const t = useT();
6225
6301
  const { user } = useUser();
6226
- const titleId = React33.useId();
6227
- return /* @__PURE__ */ jsxs36("section", { className: "ba-profile-section", "aria-labelledby": titleId, children: [
6228
- /* @__PURE__ */ jsxs36("header", { className: "ba-profile-section-header", children: [
6229
- /* @__PURE__ */ jsx41("h2", { id: titleId, className: "ba-title", children: t("userProfile.recovery.title") }),
6230
- /* @__PURE__ */ jsx41("p", { className: "ba-muted", children: t("userProfile.recovery.description") })
6302
+ const titleId = React34.useId();
6303
+ return /* @__PURE__ */ jsxs37("section", { className: "ba-profile-section", "aria-labelledby": titleId, children: [
6304
+ /* @__PURE__ */ jsxs37("header", { className: "ba-profile-section-header", children: [
6305
+ /* @__PURE__ */ jsx42("h2", { id: titleId, className: "ba-title", children: t("userProfile.recovery.title") }),
6306
+ /* @__PURE__ */ jsx42("p", { className: "ba-muted", children: t("userProfile.recovery.description") })
6231
6307
  ] }),
6232
- /* @__PURE__ */ jsxs36("div", { className: "ba-profile-recovery-card", children: [
6233
- /* @__PURE__ */ jsx41("strong", { children: t("userProfile.recovery.emailTitle") }),
6234
- user?.email && user.emailVerified ? /* @__PURE__ */ jsxs36(Fragment13, { children: [
6235
- /* @__PURE__ */ jsx41("p", { children: t("userProfile.recovery.emailDescription") }),
6236
- /* @__PURE__ */ jsx41(Bidi, { children: user.email })
6237
- ] }) : /* @__PURE__ */ jsx41("p", { children: t("userProfile.recovery.emailUnavailable") })
6308
+ /* @__PURE__ */ jsxs37("div", { className: "ba-profile-recovery-card", children: [
6309
+ /* @__PURE__ */ jsx42("strong", { children: t("userProfile.recovery.emailTitle") }),
6310
+ user?.email && user.emailVerified ? /* @__PURE__ */ jsxs37(Fragment13, { children: [
6311
+ /* @__PURE__ */ jsx42("p", { children: t("userProfile.recovery.emailDescription") }),
6312
+ /* @__PURE__ */ jsx42(Bidi, { children: user.email })
6313
+ ] }) : /* @__PURE__ */ jsx42("p", { children: t("userProfile.recovery.emailUnavailable") })
6238
6314
  ] }),
6239
- /* @__PURE__ */ jsx41(BackupCodesManager, { title: null })
6315
+ /* @__PURE__ */ jsx42(BackupCodesManager, { title: null })
6240
6316
  ] });
6241
6317
  }
6242
6318
 
6243
6319
  // src/components/user-profile/SessionsSection.tsx
6244
- import * as React35 from "react";
6320
+ import * as React36 from "react";
6245
6321
 
6246
6322
  // src/components/user-profile/model.ts
6247
6323
  var USER_PROFILE_SECTIONS = [
@@ -6288,18 +6364,18 @@ function formatSessionTime(date, locale) {
6288
6364
  }
6289
6365
 
6290
6366
  // src/components/user-profile/use-account-resource.ts
6291
- import * as React34 from "react";
6367
+ import * as React35 from "react";
6292
6368
  function useAccountResource(loader2, failure) {
6293
- const loaderRef = React34.useRef(loader2);
6369
+ const loaderRef = React35.useRef(loader2);
6294
6370
  loaderRef.current = loader2;
6295
- const failureRef = React34.useRef(failure);
6371
+ const failureRef = React35.useRef(failure);
6296
6372
  failureRef.current = failure;
6297
6373
  const toServerError = useServerError();
6298
- const [data, setData] = React34.useState(null);
6299
- const [error, setError] = React34.useState(null);
6300
- const [loading, setLoading] = React34.useState(true);
6301
- const requestRef = React34.useRef(0);
6302
- const load = React34.useCallback(async () => {
6374
+ const [data, setData] = React35.useState(null);
6375
+ const [error, setError] = React35.useState(null);
6376
+ const [loading, setLoading] = React35.useState(true);
6377
+ const requestRef = React35.useRef(0);
6378
+ const load = React35.useCallback(async () => {
6303
6379
  const request = ++requestRef.current;
6304
6380
  setLoading(true);
6305
6381
  try {
@@ -6318,7 +6394,7 @@ function useAccountResource(loader2, failure) {
6318
6394
  if (request === requestRef.current) setLoading(false);
6319
6395
  }
6320
6396
  }, [toServerError]);
6321
- React34.useEffect(() => {
6397
+ React35.useEffect(() => {
6322
6398
  void load();
6323
6399
  return () => {
6324
6400
  requestRef.current += 1;
@@ -6328,14 +6404,14 @@ function useAccountResource(loader2, failure) {
6328
6404
  }
6329
6405
 
6330
6406
  // src/components/user-profile/SessionsSection.tsx
6331
- import { jsx as jsx42, jsxs as jsxs37 } from "react/jsx-runtime";
6407
+ import { jsx as jsx43, jsxs as jsxs38 } from "react/jsx-runtime";
6332
6408
  function SessionsSection() {
6333
6409
  const t = useT();
6334
6410
  const locale = useLocale();
6335
6411
  const account = useAccount();
6336
6412
  const sessionState = useSession();
6337
6413
  const mutation = useSubmitAction();
6338
- const titleId = React35.useId();
6414
+ const titleId = React36.useId();
6339
6415
  const resource = useAccountResource(
6340
6416
  () => account.listSessions(),
6341
6417
  t("userProfile.sessions.loadError")
@@ -6357,31 +6433,31 @@ function SessionsSection() {
6357
6433
  }
6358
6434
  );
6359
6435
  };
6360
- return /* @__PURE__ */ jsxs37("section", { className: "ba-profile-section", "aria-labelledby": titleId, children: [
6361
- /* @__PURE__ */ jsxs37("header", { className: "ba-profile-section-header", children: [
6362
- /* @__PURE__ */ jsx42("h2", { id: titleId, className: "ba-title", children: t("userProfile.sessions.title") }),
6363
- /* @__PURE__ */ jsx42("p", { className: "ba-muted", children: t("userProfile.sessions.description") })
6436
+ return /* @__PURE__ */ jsxs38("section", { className: "ba-profile-section", "aria-labelledby": titleId, children: [
6437
+ /* @__PURE__ */ jsxs38("header", { className: "ba-profile-section-header", children: [
6438
+ /* @__PURE__ */ jsx43("h2", { id: titleId, className: "ba-title", children: t("userProfile.sessions.title") }),
6439
+ /* @__PURE__ */ jsx43("p", { className: "ba-muted", children: t("userProfile.sessions.description") })
6364
6440
  ] }),
6365
- resource.data === null ? resource.loading ? /* @__PURE__ */ jsxs37("div", { className: "ba-profile-list-skeleton", "aria-busy": "true", children: [
6366
- /* @__PURE__ */ jsx42("div", { className: "ba-skeleton" }),
6367
- /* @__PURE__ */ jsx42("div", { className: "ba-skeleton" })
6368
- ] }) : null : /* @__PURE__ */ jsxs37("ul", { className: "ba-profile-list", children: [
6441
+ resource.data === null ? resource.loading ? /* @__PURE__ */ jsxs38("div", { className: "ba-profile-list-skeleton", "aria-busy": "true", children: [
6442
+ /* @__PURE__ */ jsx43("div", { className: "ba-skeleton" }),
6443
+ /* @__PURE__ */ jsx43("div", { className: "ba-skeleton" })
6444
+ ] }) : null : /* @__PURE__ */ jsxs38("ul", { className: "ba-profile-list", children: [
6369
6445
  sessions.map((session) => {
6370
6446
  const label2 = session.userAgent?.trim() || t("userProfile.sessions.unknownDevice");
6371
- return /* @__PURE__ */ jsxs37("li", { className: "ba-profile-list-item", children: [
6372
- /* @__PURE__ */ jsxs37("span", { children: [
6373
- /* @__PURE__ */ jsx42("strong", { children: label2 }),
6374
- /* @__PURE__ */ jsxs37("small", { children: [
6375
- session.id === currentId && /* @__PURE__ */ jsx42("em", { children: t("userProfile.sessions.current") }),
6447
+ return /* @__PURE__ */ jsxs38("li", { className: "ba-profile-list-item", children: [
6448
+ /* @__PURE__ */ jsxs38("span", { children: [
6449
+ /* @__PURE__ */ jsx43("strong", { children: label2 }),
6450
+ /* @__PURE__ */ jsxs38("small", { children: [
6451
+ session.id === currentId && /* @__PURE__ */ jsx43("em", { children: t("userProfile.sessions.current") }),
6376
6452
  formatSessionTime(session.updatedAt, locale)
6377
6453
  ] })
6378
6454
  ] }),
6379
- /* @__PURE__ */ jsx42("button", { className: "ba-link-button ba-danger", type: "button", disabled: mutation.pending, onClick: () => revoke(session.id, label2), children: t("userProfile.sessions.revoke") })
6455
+ /* @__PURE__ */ jsx43("button", { className: "ba-link-button ba-danger", type: "button", disabled: mutation.pending, onClick: () => revoke(session.id, label2), children: t("userProfile.sessions.revoke") })
6380
6456
  ] }, session.id);
6381
6457
  }),
6382
- sessions.length === 0 && /* @__PURE__ */ jsx42("li", { className: "ba-muted", children: t("userProfile.sessions.empty") })
6458
+ sessions.length === 0 && /* @__PURE__ */ jsx43("li", { className: "ba-muted", children: t("userProfile.sessions.empty") })
6383
6459
  ] }),
6384
- sessions.some((session) => session.id !== currentId) && /* @__PURE__ */ jsx42(
6460
+ sessions.some((session) => session.id !== currentId) && /* @__PURE__ */ jsx43(
6385
6461
  "button",
6386
6462
  {
6387
6463
  className: "ba-button ba-button-secondary ba-profile-submit",
@@ -6397,17 +6473,17 @@ function SessionsSection() {
6397
6473
  children: t("userProfile.sessions.revokeOthers")
6398
6474
  }
6399
6475
  ),
6400
- resource.error && /* @__PURE__ */ jsxs37("div", { className: "ba-profile-inline-error", children: [
6401
- /* @__PURE__ */ jsx42(FormError, { children: resource.error }),
6402
- /* @__PURE__ */ jsx42("button", { className: "ba-link-button", type: "button", onClick: () => void resource.load(), children: t("userProfile.retry") })
6476
+ resource.error && /* @__PURE__ */ jsxs38("div", { className: "ba-profile-inline-error", children: [
6477
+ /* @__PURE__ */ jsx43(FormError, { children: resource.error }),
6478
+ /* @__PURE__ */ jsx43("button", { className: "ba-link-button", type: "button", onClick: () => void resource.load(), children: t("userProfile.retry") })
6403
6479
  ] }),
6404
- /* @__PURE__ */ jsx42(FormError, { children: mutation.error })
6480
+ /* @__PURE__ */ jsx43(FormError, { children: mutation.error })
6405
6481
  ] });
6406
6482
  }
6407
6483
 
6408
6484
  // src/components/user-profile/SocialSection.tsx
6409
- import * as React36 from "react";
6410
- import { jsx as jsx43, jsxs as jsxs38 } from "react/jsx-runtime";
6485
+ import * as React37 from "react";
6486
+ import { jsx as jsx44, jsxs as jsxs39 } from "react/jsx-runtime";
6411
6487
  function providerLabel(provider) {
6412
6488
  return provider.charAt(0).toUpperCase() + provider.slice(1);
6413
6489
  }
@@ -6416,7 +6492,7 @@ function SocialSection() {
6416
6492
  const account = useAccount();
6417
6493
  const { config } = usePublicConfig();
6418
6494
  const mutation = useSubmitAction();
6419
- const titleId = React36.useId();
6495
+ const titleId = React37.useId();
6420
6496
  const resource = useAccountResource(
6421
6497
  () => account.listSocialAccounts(),
6422
6498
  t("userProfile.social.loadError")
@@ -6447,18 +6523,18 @@ function SocialSection() {
6447
6523
  { failure: t("userProfile.social.unlinkError"), onSuccess: resource.load }
6448
6524
  );
6449
6525
  };
6450
- return /* @__PURE__ */ jsxs38("section", { className: "ba-profile-section", "aria-labelledby": titleId, children: [
6451
- /* @__PURE__ */ jsxs38("header", { className: "ba-profile-section-header", children: [
6452
- /* @__PURE__ */ jsx43("h2", { id: titleId, className: "ba-title", children: t("userProfile.social.title") }),
6453
- /* @__PURE__ */ jsx43("p", { className: "ba-muted", children: t("userProfile.social.description") })
6526
+ return /* @__PURE__ */ jsxs39("section", { className: "ba-profile-section", "aria-labelledby": titleId, children: [
6527
+ /* @__PURE__ */ jsxs39("header", { className: "ba-profile-section-header", children: [
6528
+ /* @__PURE__ */ jsx44("h2", { id: titleId, className: "ba-title", children: t("userProfile.social.title") }),
6529
+ /* @__PURE__ */ jsx44("p", { className: "ba-muted", children: t("userProfile.social.description") })
6454
6530
  ] }),
6455
- resource.data === null ? resource.loading ? /* @__PURE__ */ jsx43("div", { className: "ba-profile-list-skeleton", "aria-busy": "true", children: /* @__PURE__ */ jsx43("div", { className: "ba-skeleton" }) }) : null : /* @__PURE__ */ jsxs38("ul", { className: "ba-profile-list", children: [
6456
- linked.map((item) => /* @__PURE__ */ jsxs38("li", { className: "ba-profile-list-item", children: [
6457
- /* @__PURE__ */ jsxs38("span", { children: [
6458
- /* @__PURE__ */ jsx43("strong", { children: providerLabel(item.providerId) }),
6459
- /* @__PURE__ */ jsx43("small", { children: item.canUnlink ? t("userProfile.social.connected") : t("userProfile.social.lastMethod") })
6531
+ resource.data === null ? resource.loading ? /* @__PURE__ */ jsx44("div", { className: "ba-profile-list-skeleton", "aria-busy": "true", children: /* @__PURE__ */ jsx44("div", { className: "ba-skeleton" }) }) : null : /* @__PURE__ */ jsxs39("ul", { className: "ba-profile-list", children: [
6532
+ linked.map((item) => /* @__PURE__ */ jsxs39("li", { className: "ba-profile-list-item", children: [
6533
+ /* @__PURE__ */ jsxs39("span", { children: [
6534
+ /* @__PURE__ */ jsx44("strong", { children: providerLabel(item.providerId) }),
6535
+ /* @__PURE__ */ jsx44("small", { children: item.canUnlink ? t("userProfile.social.connected") : t("userProfile.social.lastMethod") })
6460
6536
  ] }),
6461
- /* @__PURE__ */ jsx43(
6537
+ /* @__PURE__ */ jsx44(
6462
6538
  "button",
6463
6539
  {
6464
6540
  className: "ba-link-button ba-danger",
@@ -6473,26 +6549,26 @@ function SocialSection() {
6473
6549
  }
6474
6550
  )
6475
6551
  ] }, item.id)),
6476
- linked.length === 0 && /* @__PURE__ */ jsx43("li", { className: "ba-muted", children: t("userProfile.social.empty") })
6552
+ linked.length === 0 && /* @__PURE__ */ jsx44("li", { className: "ba-muted", children: t("userProfile.social.empty") })
6477
6553
  ] }),
6478
- available.length > 0 && /* @__PURE__ */ jsxs38("div", { className: "ba-profile-provider-actions", children: [
6479
- /* @__PURE__ */ jsx43("p", { className: "ba-profile-subtitle", children: t("userProfile.social.add") }),
6480
- available.map((provider) => /* @__PURE__ */ jsx43("button", { type: "button", className: "ba-button ba-button-secondary", disabled: mutation.pending, onClick: () => link(provider), children: t("userProfile.social.connectProvider", { provider: providerLabel(provider) }) }, provider))
6554
+ available.length > 0 && /* @__PURE__ */ jsxs39("div", { className: "ba-profile-provider-actions", children: [
6555
+ /* @__PURE__ */ jsx44("p", { className: "ba-profile-subtitle", children: t("userProfile.social.add") }),
6556
+ available.map((provider) => /* @__PURE__ */ jsx44("button", { type: "button", className: "ba-button ba-button-secondary", disabled: mutation.pending, onClick: () => link(provider), children: t("userProfile.social.connectProvider", { provider: providerLabel(provider) }) }, provider))
6481
6557
  ] }),
6482
- resource.error && /* @__PURE__ */ jsxs38("div", { className: "ba-profile-inline-error", children: [
6483
- /* @__PURE__ */ jsx43(FormError, { children: resource.error }),
6484
- /* @__PURE__ */ jsx43("button", { className: "ba-link-button", type: "button", onClick: () => void resource.load(), children: t("userProfile.retry") })
6558
+ resource.error && /* @__PURE__ */ jsxs39("div", { className: "ba-profile-inline-error", children: [
6559
+ /* @__PURE__ */ jsx44(FormError, { children: resource.error }),
6560
+ /* @__PURE__ */ jsx44("button", { className: "ba-link-button", type: "button", onClick: () => void resource.load(), children: t("userProfile.retry") })
6485
6561
  ] }),
6486
- /* @__PURE__ */ jsx43(FormError, { children: mutation.error })
6562
+ /* @__PURE__ */ jsx44(FormError, { children: mutation.error })
6487
6563
  ] });
6488
6564
  }
6489
6565
 
6490
6566
  // src/components/user-profile/UserProfileModal.tsx
6491
- import * as React38 from "react";
6567
+ import * as React39 from "react";
6492
6568
 
6493
6569
  // src/components/ModalSurface.tsx
6494
- import * as React37 from "react";
6495
- import { jsx as jsx44 } from "react/jsx-runtime";
6570
+ import * as React38 from "react";
6571
+ import { jsx as jsx45 } from "react/jsx-runtime";
6496
6572
  function ModalSurface({
6497
6573
  overlayClassName,
6498
6574
  panelClassName,
@@ -6502,12 +6578,12 @@ function ModalSurface({
6502
6578
  onClose,
6503
6579
  children
6504
6580
  }) {
6505
- const panelRef = React37.useRef(null);
6506
- const onCloseRef = React37.useRef(onClose);
6507
- const returnFocusRefRef = React37.useRef(returnFocusRef);
6581
+ const panelRef = React38.useRef(null);
6582
+ const onCloseRef = React38.useRef(onClose);
6583
+ const returnFocusRefRef = React38.useRef(returnFocusRef);
6508
6584
  onCloseRef.current = onClose;
6509
6585
  returnFocusRefRef.current = returnFocusRef;
6510
- React37.useEffect(() => {
6586
+ React38.useEffect(() => {
6511
6587
  const previousFocus = document.activeElement instanceof HTMLElement ? document.activeElement : null;
6512
6588
  const previousOverflow = document.body.style.overflow;
6513
6589
  document.body.style.overflow = "hidden";
@@ -6540,9 +6616,9 @@ function ModalSurface({
6540
6616
  window.setTimeout(() => returnTarget?.focus(), 0);
6541
6617
  };
6542
6618
  }, []);
6543
- return /* @__PURE__ */ jsx44("div", { className: overlayClassName, role: "presentation", onMouseDown: (event) => {
6619
+ return /* @__PURE__ */ jsx45("div", { className: overlayClassName, role: "presentation", onMouseDown: (event) => {
6544
6620
  if (event.target === event.currentTarget) onClose();
6545
- }, children: /* @__PURE__ */ jsx44(
6621
+ }, children: /* @__PURE__ */ jsx45(
6546
6622
  "div",
6547
6623
  {
6548
6624
  ref: panelRef,
@@ -6557,14 +6633,15 @@ function ModalSurface({
6557
6633
  }
6558
6634
 
6559
6635
  // src/components/user-profile/UserProfileModal.tsx
6560
- import { jsx as jsx45, jsxs as jsxs39 } from "react/jsx-runtime";
6636
+ import { jsx as jsx46, jsxs as jsxs40 } from "react/jsx-runtime";
6561
6637
  function UserProfileModal({
6562
6638
  children,
6563
- onClose
6639
+ onClose,
6640
+ branding
6564
6641
  }) {
6565
6642
  const t = useT();
6566
- const titleId = React38.useId();
6567
- return /* @__PURE__ */ jsxs39(
6643
+ const titleId = React39.useId();
6644
+ return /* @__PURE__ */ jsxs40(
6568
6645
  ModalSurface,
6569
6646
  {
6570
6647
  overlayClassName: "ba-profile-overlay",
@@ -6573,12 +6650,13 @@ function UserProfileModal({
6573
6650
  testId: "user-profile-modal",
6574
6651
  onClose,
6575
6652
  children: [
6576
- /* @__PURE__ */ jsxs39("header", { className: "ba-profile-modal-header", children: [
6577
- /* @__PURE__ */ jsxs39("span", { children: [
6578
- /* @__PURE__ */ jsx45("h1", { id: titleId, children: t("userProfile.title") }),
6579
- /* @__PURE__ */ jsx45("p", { children: t("userProfile.description") })
6653
+ /* @__PURE__ */ jsxs40("header", { className: "ba-profile-modal-header", children: [
6654
+ /* @__PURE__ */ jsxs40("span", { children: [
6655
+ branding,
6656
+ /* @__PURE__ */ jsx46("h1", { id: titleId, children: t("userProfile.title") }),
6657
+ /* @__PURE__ */ jsx46("p", { children: t("userProfile.description") })
6580
6658
  ] }),
6581
- /* @__PURE__ */ jsx45(
6659
+ /* @__PURE__ */ jsx46(
6582
6660
  "button",
6583
6661
  {
6584
6662
  type: "button",
@@ -6586,7 +6664,7 @@ function UserProfileModal({
6586
6664
  "aria-label": t("userProfile.close"),
6587
6665
  onClick: onClose,
6588
6666
  autoFocus: true,
6589
- children: /* @__PURE__ */ jsx45("svg", { viewBox: "0 0 24 24", "aria-hidden": "true", focusable: "false", children: /* @__PURE__ */ jsx45(
6667
+ children: /* @__PURE__ */ jsx46("svg", { viewBox: "0 0 24 24", "aria-hidden": "true", focusable: "false", children: /* @__PURE__ */ jsx46(
6590
6668
  "path",
6591
6669
  {
6592
6670
  d: "M6 6l12 12M18 6L6 18",
@@ -6599,14 +6677,14 @@ function UserProfileModal({
6599
6677
  )
6600
6678
  ] }),
6601
6679
  children,
6602
- /* @__PURE__ */ jsx45("footer", { className: "ba-profile-modal-footer", children: /* @__PURE__ */ jsx45(AuthOwlBadge, {}) })
6680
+ /* @__PURE__ */ jsx46("footer", { className: "ba-profile-modal-footer", children: /* @__PURE__ */ jsx46(AuthOwlBadge, {}) })
6603
6681
  ]
6604
6682
  }
6605
6683
  );
6606
6684
  }
6607
6685
 
6608
6686
  // src/components/UserProfile.tsx
6609
- import { jsx as jsx46, jsxs as jsxs40 } from "react/jsx-runtime";
6687
+ import { jsx as jsx47, jsxs as jsxs41 } from "react/jsx-runtime";
6610
6688
  var SECTION_KEYS = {
6611
6689
  profile: "userProfile.nav.profile",
6612
6690
  email: "userProfile.nav.email",
@@ -6628,13 +6706,14 @@ function UserProfile(props = {}) {
6628
6706
  section,
6629
6707
  defaultSection,
6630
6708
  onSectionChange,
6631
- onDeleted
6709
+ onDeleted,
6710
+ showBranding = true
6632
6711
  } = props;
6633
6712
  const mode = props.mode ?? "page";
6634
6713
  const t = useT();
6635
6714
  const { user, isLoaded, isSignedIn } = useUser();
6636
6715
  const { config } = usePublicConfig();
6637
- const [internalSection, setInternalSection] = React39.useState(() => initialSection(defaultSection));
6716
+ const [internalSection, setInternalSection] = React40.useState(() => initialSection(defaultSection));
6638
6717
  const active = section ?? internalSection;
6639
6718
  const capabilities = resolveProjectCapabilities(config);
6640
6719
  const passwordEnabled = config !== null && capabilities.passwordSignIn;
@@ -6643,7 +6722,7 @@ function UserProfile(props = {}) {
6643
6722
  const recoveryEnabled = capabilities.backupCodes && user?.twoFactorEnabled === true;
6644
6723
  const deletionEnabled = capabilities.accountDeletion;
6645
6724
  const socialEnabled = (config?.socialProviders?.length ?? 0) > 0;
6646
- const sections = React39.useMemo(
6725
+ const sections = React40.useMemo(
6647
6726
  () => userProfileSectionsFor({
6648
6727
  password: passwordEnabled,
6649
6728
  passkeys: passkeysEnabled,
@@ -6654,7 +6733,7 @@ function UserProfile(props = {}) {
6654
6733
  }),
6655
6734
  [deletionEnabled, mfaEnabled, passkeysEnabled, passwordEnabled, recoveryEnabled, socialEnabled]
6656
6735
  );
6657
- React39.useEffect(() => {
6736
+ React40.useEffect(() => {
6658
6737
  if (section || mode !== "page") return;
6659
6738
  const onHashChange = () => {
6660
6739
  const next = userProfileSectionFromHash(window.location.hash);
@@ -6671,11 +6750,11 @@ function UserProfile(props = {}) {
6671
6750
  window.history.replaceState(null, "", userProfileSectionHash(next));
6672
6751
  }
6673
6752
  };
6674
- const content = !isLoaded ? /* @__PURE__ */ jsxs40("div", { className: "ba-profile-loading", "aria-busy": "true", children: [
6675
- /* @__PURE__ */ jsx46("div", { className: "ba-skeleton" }),
6676
- /* @__PURE__ */ jsx46("div", { className: "ba-skeleton" }),
6677
- /* @__PURE__ */ jsx46("div", { className: "ba-skeleton" })
6678
- ] }) : !isSignedIn || !user ? /* @__PURE__ */ jsx46("p", { className: "ba-muted", children: t("userProfile.signedOut") }) : /* @__PURE__ */ jsx46(
6753
+ const content = !isLoaded ? /* @__PURE__ */ jsxs41("div", { className: "ba-profile-loading", "aria-busy": "true", children: [
6754
+ /* @__PURE__ */ jsx47("div", { className: "ba-skeleton" }),
6755
+ /* @__PURE__ */ jsx47("div", { className: "ba-skeleton" }),
6756
+ /* @__PURE__ */ jsx47("div", { className: "ba-skeleton" })
6757
+ ] }) : !isSignedIn || !user ? /* @__PURE__ */ jsx47("p", { className: "ba-muted", children: t("userProfile.signedOut") }) : /* @__PURE__ */ jsx47(
6679
6758
  UserProfileBody,
6680
6759
  {
6681
6760
  active: visibleActive,
@@ -6687,15 +6766,23 @@ function UserProfile(props = {}) {
6687
6766
  user.id
6688
6767
  );
6689
6768
  if (props.mode === "modal") {
6690
- return /* @__PURE__ */ jsx46(UserProfileModal, { onClose: props.onClose, children: content });
6769
+ return /* @__PURE__ */ jsx47(
6770
+ UserProfileModal,
6771
+ {
6772
+ onClose: props.onClose,
6773
+ branding: showBranding ? /* @__PURE__ */ jsx47(AuthOwlBranding, {}) : null,
6774
+ children: content
6775
+ }
6776
+ );
6691
6777
  }
6692
- return /* @__PURE__ */ jsxs40("article", { className: "ba-profile ba-profile-page", "data-testid": "user-profile", children: [
6693
- /* @__PURE__ */ jsxs40("header", { className: "ba-profile-heading", children: [
6694
- /* @__PURE__ */ jsx46("h1", { children: t("userProfile.title") }),
6695
- /* @__PURE__ */ jsx46("p", { children: t("userProfile.description") })
6778
+ return /* @__PURE__ */ jsxs41("article", { className: "ba-profile ba-profile-page", "data-testid": "user-profile", children: [
6779
+ /* @__PURE__ */ jsxs41("header", { className: "ba-profile-heading", children: [
6780
+ showBranding ? /* @__PURE__ */ jsx47(AuthOwlBranding, {}) : null,
6781
+ /* @__PURE__ */ jsx47("h1", { children: t("userProfile.title") }),
6782
+ /* @__PURE__ */ jsx47("p", { children: t("userProfile.description") })
6696
6783
  ] }),
6697
6784
  content,
6698
- /* @__PURE__ */ jsx46("footer", { className: "ba-profile-modal-footer", children: /* @__PURE__ */ jsx46(AuthOwlBadge, {}) })
6785
+ /* @__PURE__ */ jsx47("footer", { className: "ba-profile-modal-footer", children: /* @__PURE__ */ jsx47(AuthOwlBadge, {}) })
6699
6786
  ] });
6700
6787
  }
6701
6788
  function UserProfileBody({
@@ -6706,8 +6793,8 @@ function UserProfileBody({
6706
6793
  capabilities
6707
6794
  }) {
6708
6795
  const t = useT();
6709
- return /* @__PURE__ */ jsxs40("div", { className: "ba-profile-layout", children: [
6710
- /* @__PURE__ */ jsx46("nav", { className: "ba-profile-nav", "aria-label": t("userProfile.nav.aria"), children: sections.map((item) => /* @__PURE__ */ jsx46(
6796
+ return /* @__PURE__ */ jsxs41("div", { className: "ba-profile-layout", children: [
6797
+ /* @__PURE__ */ jsx47("nav", { className: "ba-profile-nav", "aria-label": t("userProfile.nav.aria"), children: sections.map((item) => /* @__PURE__ */ jsx47(
6711
6798
  "button",
6712
6799
  {
6713
6800
  type: "button",
@@ -6718,8 +6805,8 @@ function UserProfileBody({
6718
6805
  },
6719
6806
  item
6720
6807
  )) }),
6721
- /* @__PURE__ */ jsxs40("div", { className: "ba-profile-content", "data-section": active, children: [
6722
- active === "profile" && /* @__PURE__ */ jsx46(
6808
+ /* @__PURE__ */ jsxs41("div", { className: "ba-profile-content", "data-section": active, children: [
6809
+ active === "profile" && /* @__PURE__ */ jsx47(
6723
6810
  ProfileSection,
6724
6811
  {
6725
6812
  firstLastName: capabilities.firstLastName,
@@ -6727,43 +6814,43 @@ function UserProfileBody({
6727
6814
  legacyNameField: capabilities.legacyNameField
6728
6815
  }
6729
6816
  ),
6730
- active === "email" && /* @__PURE__ */ jsx46(EmailSection, { allowChange: capabilities.emailChange }),
6731
- active === "password" && /* @__PURE__ */ jsx46(PasswordSection, {}),
6732
- active === "social" && /* @__PURE__ */ jsx46(SocialSection, {}),
6733
- active === "sessions" && /* @__PURE__ */ jsx46(SessionsSection, {}),
6734
- active === "passkeys" && /* @__PURE__ */ jsx46(PasskeysSection, { allowAdd: capabilities.passkeyAdd }),
6735
- active === "mfa" && /* @__PURE__ */ jsx46(MfaSection, {}),
6736
- active === "recovery" && /* @__PURE__ */ jsx46(RecoverySection, {}),
6737
- active === "danger" && /* @__PURE__ */ jsx46(DeleteAccountSection, { onDeleted })
6817
+ active === "email" && /* @__PURE__ */ jsx47(EmailSection, { allowChange: capabilities.emailChange }),
6818
+ active === "password" && /* @__PURE__ */ jsx47(PasswordSection, {}),
6819
+ active === "social" && /* @__PURE__ */ jsx47(SocialSection, {}),
6820
+ active === "sessions" && /* @__PURE__ */ jsx47(SessionsSection, {}),
6821
+ active === "passkeys" && /* @__PURE__ */ jsx47(PasskeysSection, { allowAdd: capabilities.passkeyAdd }),
6822
+ active === "mfa" && /* @__PURE__ */ jsx47(MfaSection, {}),
6823
+ active === "recovery" && /* @__PURE__ */ jsx47(RecoverySection, {}),
6824
+ active === "danger" && /* @__PURE__ */ jsx47(DeleteAccountSection, { onDeleted })
6738
6825
  ] })
6739
6826
  ] });
6740
6827
  }
6741
6828
 
6742
6829
  // src/components/UserButton.tsx
6743
- import { jsx as jsx47, jsxs as jsxs41 } from "react/jsx-runtime";
6830
+ import { jsx as jsx48, jsxs as jsxs42 } from "react/jsx-runtime";
6744
6831
  function UserButton() {
6745
6832
  const t = useT();
6746
6833
  const { user, isLoaded } = useUser();
6747
6834
  const { signOut } = useSignOut();
6748
- const [open, setOpen] = React40.useState(false);
6749
- const [profileOpen, setProfileOpen] = React40.useState(false);
6750
- const triggerRef = React40.useRef(null);
6835
+ const [open, setOpen] = React41.useState(false);
6836
+ const [profileOpen, setProfileOpen] = React41.useState(false);
6837
+ const triggerRef = React41.useRef(null);
6751
6838
  if (!isLoaded || !user) return null;
6752
6839
  const identity = user.email ?? user.phoneNumber ?? user.name ?? "?";
6753
- return /* @__PURE__ */ jsxs41("div", { className: "ba-user-button", "data-testid": "user-button", children: [
6754
- /* @__PURE__ */ jsx47(
6840
+ return /* @__PURE__ */ jsxs42("div", { className: "ba-user-button", "data-testid": "user-button", children: [
6841
+ /* @__PURE__ */ jsx48(
6755
6842
  "button",
6756
6843
  {
6757
6844
  ref: triggerRef,
6758
6845
  className: "ba-user-button-trigger",
6759
6846
  "aria-label": t("userButton.openMenuAria"),
6760
6847
  onClick: () => setOpen((v) => !v),
6761
- children: user.image ? /* @__PURE__ */ jsx47("img", { className: "ba-avatar", src: user.image, alt: "" }) : /* @__PURE__ */ jsx47("span", { className: "ba-avatar ba-avatar-fallback", children: identity[0]?.toUpperCase() })
6848
+ children: user.image ? /* @__PURE__ */ jsx48("img", { className: "ba-avatar", src: user.image, alt: "" }) : /* @__PURE__ */ jsx48("span", { className: "ba-avatar ba-avatar-fallback", children: identity[0]?.toUpperCase() })
6762
6849
  }
6763
6850
  ),
6764
- open && /* @__PURE__ */ jsxs41("div", { className: "ba-menu", children: [
6765
- /* @__PURE__ */ jsx47("p", { className: "ba-menu-label", children: identity }),
6766
- /* @__PURE__ */ jsx47(
6851
+ open && /* @__PURE__ */ jsxs42("div", { className: "ba-menu", children: [
6852
+ /* @__PURE__ */ jsx48("p", { className: "ba-menu-label", children: identity }),
6853
+ /* @__PURE__ */ jsx48(
6767
6854
  "button",
6768
6855
  {
6769
6856
  className: "ba-menu-item",
@@ -6774,10 +6861,10 @@ function UserButton() {
6774
6861
  children: t("userButton.manageAccount")
6775
6862
  }
6776
6863
  ),
6777
- /* @__PURE__ */ jsx47("button", { className: "ba-menu-item", onClick: () => signOut(), children: t("userButton.signOut") }),
6778
- /* @__PURE__ */ jsx47("div", { className: "ba-menu-badge", children: /* @__PURE__ */ jsx47(AuthOwlBadge, {}) })
6864
+ /* @__PURE__ */ jsx48("button", { className: "ba-menu-item", onClick: () => signOut(), children: t("userButton.signOut") }),
6865
+ /* @__PURE__ */ jsx48("div", { className: "ba-menu-badge", children: /* @__PURE__ */ jsx48(AuthOwlBadge, {}) })
6779
6866
  ] }),
6780
- profileOpen && /* @__PURE__ */ jsx47(
6867
+ profileOpen && /* @__PURE__ */ jsx48(
6781
6868
  UserProfile,
6782
6869
  {
6783
6870
  mode: "modal",
@@ -6793,10 +6880,10 @@ function UserButton() {
6793
6880
  }
6794
6881
 
6795
6882
  // src/components/OrganizationSwitcher.tsx
6796
- import * as React49 from "react";
6883
+ import * as React50 from "react";
6797
6884
 
6798
6885
  // src/components/CreateOrganization.tsx
6799
- import * as React41 from "react";
6886
+ import * as React42 from "react";
6800
6887
 
6801
6888
  // src/components/organization/model.ts
6802
6889
  function organizationSlugFromName(name) {
@@ -6813,22 +6900,22 @@ function canManageOrganization(member) {
6813
6900
  }
6814
6901
 
6815
6902
  // src/components/CreateOrganization.tsx
6816
- import { jsx as jsx48, jsxs as jsxs42 } from "react/jsx-runtime";
6903
+ import { jsx as jsx49, jsxs as jsxs43 } from "react/jsx-runtime";
6817
6904
  function CreateOrganization({ onCreated, title } = {}) {
6818
6905
  const t = useT();
6819
6906
  const { config, isLoading: configLoading } = usePublicConfig();
6820
6907
  const { isLoaded, isSignedIn } = useUser();
6821
6908
  const api = useAuthClient().organization;
6822
6909
  const { pending, error, run } = useSubmitAction();
6823
- const [name, setName] = React41.useState("");
6824
- const [slug, setSlug] = React41.useState("");
6825
- const [logo, setLogo] = React41.useState("");
6826
- const [slugTouched, setSlugTouched] = React41.useState(false);
6910
+ const [name, setName] = React42.useState("");
6911
+ const [slug, setSlug] = React42.useState("");
6912
+ const [logo, setLogo] = React42.useState("");
6913
+ const [slugTouched, setSlugTouched] = React42.useState(false);
6827
6914
  if (configLoading || !isLoaded) {
6828
- return /* @__PURE__ */ jsx48("div", { className: "ba-skeleton", "aria-label": t("organization.loading") });
6915
+ return /* @__PURE__ */ jsx49("div", { className: "ba-skeleton", "aria-label": t("organization.loading") });
6829
6916
  }
6830
6917
  if (config?.organizations !== true) return null;
6831
- if (!isSignedIn) return /* @__PURE__ */ jsx48("p", { className: "ba-muted", children: t("organization.signedOut") });
6918
+ if (!isSignedIn) return /* @__PURE__ */ jsx49("p", { className: "ba-muted", children: t("organization.signedOut") });
6832
6919
  const submit = (event) => {
6833
6920
  event.preventDefault();
6834
6921
  const normalizedName = name.trim();
@@ -6853,15 +6940,15 @@ function CreateOrganization({ onCreated, title } = {}) {
6853
6940
  }
6854
6941
  );
6855
6942
  };
6856
- return /* @__PURE__ */ jsxs42("section", { className: "ba-organization-create", children: [
6857
- title !== null && /* @__PURE__ */ jsxs42("header", { className: "ba-organization-section-header", children: [
6858
- /* @__PURE__ */ jsx48("h2", { className: "ba-title", children: title ?? t("organization.create.title") }),
6859
- /* @__PURE__ */ jsx48("p", { className: "ba-muted", children: t("organization.create.description") })
6943
+ return /* @__PURE__ */ jsxs43("section", { className: "ba-organization-create", children: [
6944
+ title !== null && /* @__PURE__ */ jsxs43("header", { className: "ba-organization-section-header", children: [
6945
+ /* @__PURE__ */ jsx49("h2", { className: "ba-title", children: title ?? t("organization.create.title") }),
6946
+ /* @__PURE__ */ jsx49("p", { className: "ba-muted", children: t("organization.create.description") })
6860
6947
  ] }),
6861
- /* @__PURE__ */ jsxs42("form", { method: "post", className: "ba-fields", onSubmit: submit, children: [
6862
- /* @__PURE__ */ jsxs42("label", { className: "ba-label", children: [
6948
+ /* @__PURE__ */ jsxs43("form", { method: "post", className: "ba-fields", onSubmit: submit, children: [
6949
+ /* @__PURE__ */ jsxs43("label", { className: "ba-label", children: [
6863
6950
  t("organization.create.name"),
6864
- /* @__PURE__ */ jsx48(
6951
+ /* @__PURE__ */ jsx49(
6865
6952
  "input",
6866
6953
  {
6867
6954
  className: "ba-input",
@@ -6876,9 +6963,9 @@ function CreateOrganization({ onCreated, title } = {}) {
6876
6963
  }
6877
6964
  )
6878
6965
  ] }),
6879
- /* @__PURE__ */ jsxs42("label", { className: "ba-label", children: [
6966
+ /* @__PURE__ */ jsxs43("label", { className: "ba-label", children: [
6880
6967
  t("organization.create.slug"),
6881
- /* @__PURE__ */ jsx48(
6968
+ /* @__PURE__ */ jsx49(
6882
6969
  "input",
6883
6970
  {
6884
6971
  className: "ba-input",
@@ -6893,9 +6980,9 @@ function CreateOrganization({ onCreated, title } = {}) {
6893
6980
  }
6894
6981
  )
6895
6982
  ] }),
6896
- /* @__PURE__ */ jsxs42("label", { className: "ba-label", children: [
6983
+ /* @__PURE__ */ jsxs43("label", { className: "ba-label", children: [
6897
6984
  t("organization.create.logo"),
6898
- /* @__PURE__ */ jsx48(
6985
+ /* @__PURE__ */ jsx49(
6899
6986
  "input",
6900
6987
  {
6901
6988
  className: "ba-input",
@@ -6907,15 +6994,15 @@ function CreateOrganization({ onCreated, title } = {}) {
6907
6994
  }
6908
6995
  )
6909
6996
  ] }),
6910
- /* @__PURE__ */ jsx48(FormError, { children: error }),
6911
- /* @__PURE__ */ jsx48(
6997
+ /* @__PURE__ */ jsx49(FormError, { children: error }),
6998
+ /* @__PURE__ */ jsx49(
6912
6999
  "button",
6913
7000
  {
6914
7001
  className: "ba-button ba-profile-submit",
6915
7002
  type: "submit",
6916
7003
  disabled: pending || !name.trim() || !slug.trim(),
6917
7004
  "aria-busy": pending || void 0,
6918
- children: /* @__PURE__ */ jsx48(Busy, { busy: pending, label: t("common.working"), children: t("organization.create.submit") })
7005
+ children: /* @__PURE__ */ jsx49(Busy, { busy: pending, label: t("common.working"), children: t("organization.create.submit") })
6919
7006
  }
6920
7007
  )
6921
7008
  ] })
@@ -6923,8 +7010,8 @@ function CreateOrganization({ onCreated, title } = {}) {
6923
7010
  }
6924
7011
 
6925
7012
  // src/components/organization/OrganizationModal.tsx
6926
- import * as React42 from "react";
6927
- import { jsx as jsx49, jsxs as jsxs43 } from "react/jsx-runtime";
7013
+ import * as React43 from "react";
7014
+ import { jsx as jsx50, jsxs as jsxs44 } from "react/jsx-runtime";
6928
7015
  function OrganizationModal({
6929
7016
  title,
6930
7017
  onClose,
@@ -6932,8 +7019,8 @@ function OrganizationModal({
6932
7019
  children
6933
7020
  }) {
6934
7021
  const t = useT();
6935
- const titleId = React42.useId();
6936
- return /* @__PURE__ */ jsxs43(
7022
+ const titleId = React43.useId();
7023
+ return /* @__PURE__ */ jsxs44(
6937
7024
  ModalSurface,
6938
7025
  {
6939
7026
  overlayClassName: "ba-organization-overlay",
@@ -6942,9 +7029,9 @@ function OrganizationModal({
6942
7029
  returnFocusRef,
6943
7030
  onClose,
6944
7031
  children: [
6945
- /* @__PURE__ */ jsxs43("header", { className: "ba-organization-modal-header", children: [
6946
- /* @__PURE__ */ jsx49("h2", { id: titleId, className: "ba-title", children: title }),
6947
- /* @__PURE__ */ jsx49(
7032
+ /* @__PURE__ */ jsxs44("header", { className: "ba-organization-modal-header", children: [
7033
+ /* @__PURE__ */ jsx50("h2", { id: titleId, className: "ba-title", children: title }),
7034
+ /* @__PURE__ */ jsx50(
6948
7035
  "button",
6949
7036
  {
6950
7037
  className: "ba-profile-close",
@@ -6956,26 +7043,26 @@ function OrganizationModal({
6956
7043
  }
6957
7044
  )
6958
7045
  ] }),
6959
- /* @__PURE__ */ jsx49("div", { className: "ba-organization-modal-body", children })
7046
+ /* @__PURE__ */ jsx50("div", { className: "ba-organization-modal-body", children })
6960
7047
  ]
6961
7048
  }
6962
7049
  );
6963
7050
  }
6964
7051
 
6965
7052
  // src/components/organization/use-organizations-resource.ts
6966
- import * as React43 from "react";
7053
+ import * as React44 from "react";
6967
7054
  function useOrganizationsResource(enabled = true) {
6968
7055
  const api = useAuthClient().organization;
6969
- const apiRef = React43.useRef(api);
7056
+ const apiRef = React44.useRef(api);
6970
7057
  apiRef.current = api;
6971
7058
  const { user, isLoaded, isSignedIn } = useUser();
6972
7059
  const t = useT();
6973
7060
  const toServerError = useServerError();
6974
- const [organizations, setOrganizations] = React43.useState(null);
6975
- const [error, setError] = React43.useState(null);
6976
- const requestRef = React43.useRef(0);
7061
+ const [organizations, setOrganizations] = React44.useState(null);
7062
+ const [error, setError] = React44.useState(null);
7063
+ const requestRef = React44.useRef(0);
6977
7064
  const identity = user?.id ?? null;
6978
- const refresh = React43.useCallback(async () => {
7065
+ const refresh = React44.useCallback(async () => {
6979
7066
  const token = ++requestRef.current;
6980
7067
  if (!enabled || !identity || !isSignedIn) {
6981
7068
  setOrganizations([]);
@@ -6995,7 +7082,7 @@ function useOrganizationsResource(enabled = true) {
6995
7082
  if (token === requestRef.current) setError(t("organization.error.load"));
6996
7083
  }
6997
7084
  }, [enabled, identity, isSignedIn, t, toServerError]);
6998
- React43.useEffect(() => {
7085
+ React44.useEffect(() => {
6999
7086
  setOrganizations(null);
7000
7087
  setError(null);
7001
7088
  if (!isLoaded) return;
@@ -7013,11 +7100,11 @@ function useOrganizationsResource(enabled = true) {
7013
7100
  }
7014
7101
 
7015
7102
  // src/components/OrganizationProfile.tsx
7016
- import * as React48 from "react";
7103
+ import * as React49 from "react";
7017
7104
 
7018
7105
  // src/components/organization/DangerSection.tsx
7019
- import * as React44 from "react";
7020
- import { jsx as jsx50, jsxs as jsxs44 } from "react/jsx-runtime";
7106
+ import * as React45 from "react";
7107
+ import { jsx as jsx51, jsxs as jsxs45 } from "react/jsx-runtime";
7021
7108
  function DangerSection({
7022
7109
  organization,
7023
7110
  membership,
@@ -7028,7 +7115,7 @@ function DangerSection({
7028
7115
  const api = useAuthClient().organization;
7029
7116
  const session = useSession();
7030
7117
  const { pending, error, run } = useSubmitAction();
7031
- const [confirmation, setConfirmation] = React44.useState("");
7118
+ const [confirmation, setConfirmation] = React45.useState("");
7032
7119
  const isOwner = hasOrganizationRole(membership, "owner");
7033
7120
  const confirmed = confirmation.trim().toLowerCase() === organization.slug.toLowerCase();
7034
7121
  const leave = () => {
@@ -7058,43 +7145,43 @@ function DangerSection({
7058
7145
  }
7059
7146
  );
7060
7147
  };
7061
- return /* @__PURE__ */ jsxs44("section", { className: "ba-organization-section ba-organization-danger", children: [
7062
- /* @__PURE__ */ jsxs44("header", { className: "ba-organization-section-header", children: [
7063
- /* @__PURE__ */ jsx50("h3", { className: "ba-title", children: t("organization.profile.danger.title") }),
7064
- /* @__PURE__ */ jsx50("p", { className: "ba-muted", children: t("organization.profile.danger.description") })
7148
+ return /* @__PURE__ */ jsxs45("section", { className: "ba-organization-section ba-organization-danger", children: [
7149
+ /* @__PURE__ */ jsxs45("header", { className: "ba-organization-section-header", children: [
7150
+ /* @__PURE__ */ jsx51("h3", { className: "ba-title", children: t("organization.profile.danger.title") }),
7151
+ /* @__PURE__ */ jsx51("p", { className: "ba-muted", children: t("organization.profile.danger.description") })
7065
7152
  ] }),
7066
- /* @__PURE__ */ jsxs44("div", { className: "ba-organization-danger-action", children: [
7067
- /* @__PURE__ */ jsx50("strong", { children: t("organization.profile.danger.leaveTitle") }),
7068
- /* @__PURE__ */ jsx50("p", { className: "ba-muted", children: isOwner ? t("organization.profile.danger.ownerLeaveHint") : t("organization.profile.danger.leaveHint") }),
7069
- /* @__PURE__ */ jsx50("button", { className: "ba-button ba-button-secondary", type: "button", disabled: pending, onClick: leave, children: t("organization.profile.danger.leave") })
7153
+ /* @__PURE__ */ jsxs45("div", { className: "ba-organization-danger-action", children: [
7154
+ /* @__PURE__ */ jsx51("strong", { children: t("organization.profile.danger.leaveTitle") }),
7155
+ /* @__PURE__ */ jsx51("p", { className: "ba-muted", children: isOwner ? t("organization.profile.danger.ownerLeaveHint") : t("organization.profile.danger.leaveHint") }),
7156
+ /* @__PURE__ */ jsx51("button", { className: "ba-button ba-button-secondary", type: "button", disabled: pending, onClick: leave, children: t("organization.profile.danger.leave") })
7070
7157
  ] }),
7071
- isOwner && /* @__PURE__ */ jsxs44("form", { method: "post", className: "ba-organization-danger-action ba-organization-delete", onSubmit: remove, children: [
7072
- /* @__PURE__ */ jsx50("strong", { children: t("organization.profile.danger.deleteTitle") }),
7073
- /* @__PURE__ */ jsx50("p", { className: "ba-muted", children: t("organization.profile.danger.deleteHint") }),
7074
- /* @__PURE__ */ jsxs44("label", { className: "ba-label", children: [
7158
+ isOwner && /* @__PURE__ */ jsxs45("form", { method: "post", className: "ba-organization-danger-action ba-organization-delete", onSubmit: remove, children: [
7159
+ /* @__PURE__ */ jsx51("strong", { children: t("organization.profile.danger.deleteTitle") }),
7160
+ /* @__PURE__ */ jsx51("p", { className: "ba-muted", children: t("organization.profile.danger.deleteHint") }),
7161
+ /* @__PURE__ */ jsxs45("label", { className: "ba-label", children: [
7075
7162
  t("organization.profile.danger.deleteConfirm"),
7076
7163
  " ",
7077
- /* @__PURE__ */ jsx50(Bidi, { children: organization.slug }),
7078
- /* @__PURE__ */ jsx50("input", { className: "ba-input", dir: "ltr", value: confirmation, onChange: (event) => setConfirmation(event.target.value), autoComplete: "off", required: true })
7164
+ /* @__PURE__ */ jsx51(Bidi, { children: organization.slug }),
7165
+ /* @__PURE__ */ jsx51("input", { className: "ba-input", dir: "ltr", value: confirmation, onChange: (event) => setConfirmation(event.target.value), autoComplete: "off", required: true })
7079
7166
  ] }),
7080
- /* @__PURE__ */ jsx50(
7167
+ /* @__PURE__ */ jsx51(
7081
7168
  "button",
7082
7169
  {
7083
7170
  className: "ba-button ba-danger-button",
7084
7171
  type: "submit",
7085
7172
  disabled: pending || !confirmed,
7086
7173
  "aria-busy": pending || void 0,
7087
- children: /* @__PURE__ */ jsx50(Busy, { busy: pending, label: t("common.working"), children: t("organization.profile.danger.delete") })
7174
+ children: /* @__PURE__ */ jsx51(Busy, { busy: pending, label: t("common.working"), children: t("organization.profile.danger.delete") })
7088
7175
  }
7089
7176
  )
7090
7177
  ] }),
7091
- /* @__PURE__ */ jsx50(FormError, { children: error })
7178
+ /* @__PURE__ */ jsx51(FormError, { children: error })
7092
7179
  ] });
7093
7180
  }
7094
7181
 
7095
7182
  // src/components/organization/GeneralSection.tsx
7096
- import * as React45 from "react";
7097
- import { jsx as jsx51, jsxs as jsxs45 } from "react/jsx-runtime";
7183
+ import * as React46 from "react";
7184
+ import { jsx as jsx52, jsxs as jsxs46 } from "react/jsx-runtime";
7098
7185
  function GeneralSection({
7099
7186
  organization,
7100
7187
  canManage,
@@ -7103,25 +7190,25 @@ function GeneralSection({
7103
7190
  const t = useT();
7104
7191
  const api = useAuthClient().organization;
7105
7192
  const { pending, error, run } = useSubmitAction();
7106
- const [name, setName] = React45.useState(organization.name);
7107
- const [slug, setSlug] = React45.useState(organization.slug);
7108
- const [logo, setLogo] = React45.useState(organization.logo ?? "");
7109
- React45.useEffect(() => {
7193
+ const [name, setName] = React46.useState(organization.name);
7194
+ const [slug, setSlug] = React46.useState(organization.slug);
7195
+ const [logo, setLogo] = React46.useState(organization.logo ?? "");
7196
+ React46.useEffect(() => {
7110
7197
  setName(organization.name);
7111
7198
  setSlug(organization.slug);
7112
7199
  setLogo(organization.logo ?? "");
7113
7200
  }, [organization.id, organization.logo, organization.name, organization.slug]);
7114
7201
  if (!canManage) {
7115
- return /* @__PURE__ */ jsxs45("section", { className: "ba-organization-section", children: [
7116
- /* @__PURE__ */ jsx51("p", { className: "ba-muted", children: t("organization.profile.general.readOnly") }),
7117
- /* @__PURE__ */ jsxs45("dl", { className: "ba-organization-facts", children: [
7118
- /* @__PURE__ */ jsxs45("div", { children: [
7119
- /* @__PURE__ */ jsx51("dt", { children: t("organization.create.name") }),
7120
- /* @__PURE__ */ jsx51("dd", { children: organization.name })
7202
+ return /* @__PURE__ */ jsxs46("section", { className: "ba-organization-section", children: [
7203
+ /* @__PURE__ */ jsx52("p", { className: "ba-muted", children: t("organization.profile.general.readOnly") }),
7204
+ /* @__PURE__ */ jsxs46("dl", { className: "ba-organization-facts", children: [
7205
+ /* @__PURE__ */ jsxs46("div", { children: [
7206
+ /* @__PURE__ */ jsx52("dt", { children: t("organization.create.name") }),
7207
+ /* @__PURE__ */ jsx52("dd", { children: organization.name })
7121
7208
  ] }),
7122
- /* @__PURE__ */ jsxs45("div", { children: [
7123
- /* @__PURE__ */ jsx51("dt", { children: t("organization.create.slug") }),
7124
- /* @__PURE__ */ jsx51("dd", { children: /* @__PURE__ */ jsx51(Bidi, { children: organization.slug }) })
7209
+ /* @__PURE__ */ jsxs46("div", { children: [
7210
+ /* @__PURE__ */ jsx52("dt", { children: t("organization.create.slug") }),
7211
+ /* @__PURE__ */ jsx52("dd", { children: /* @__PURE__ */ jsx52(Bidi, { children: organization.slug }) })
7125
7212
  ] })
7126
7213
  ] })
7127
7214
  ] });
@@ -7139,19 +7226,19 @@ function GeneralSection({
7139
7226
  }
7140
7227
  );
7141
7228
  };
7142
- return /* @__PURE__ */ jsxs45("section", { className: "ba-organization-section", children: [
7143
- /* @__PURE__ */ jsxs45("header", { className: "ba-organization-section-header", children: [
7144
- /* @__PURE__ */ jsx51("h3", { className: "ba-title", children: t("organization.profile.general.title") }),
7145
- /* @__PURE__ */ jsx51("p", { className: "ba-muted", children: t("organization.profile.general.description") })
7229
+ return /* @__PURE__ */ jsxs46("section", { className: "ba-organization-section", children: [
7230
+ /* @__PURE__ */ jsxs46("header", { className: "ba-organization-section-header", children: [
7231
+ /* @__PURE__ */ jsx52("h3", { className: "ba-title", children: t("organization.profile.general.title") }),
7232
+ /* @__PURE__ */ jsx52("p", { className: "ba-muted", children: t("organization.profile.general.description") })
7146
7233
  ] }),
7147
- /* @__PURE__ */ jsxs45("form", { method: "post", className: "ba-fields", onSubmit: submit, children: [
7148
- /* @__PURE__ */ jsxs45("label", { className: "ba-label", children: [
7234
+ /* @__PURE__ */ jsxs46("form", { method: "post", className: "ba-fields", onSubmit: submit, children: [
7235
+ /* @__PURE__ */ jsxs46("label", { className: "ba-label", children: [
7149
7236
  t("organization.create.name"),
7150
- /* @__PURE__ */ jsx51("input", { className: "ba-input", value: name, onChange: (event) => setName(event.target.value), required: true })
7237
+ /* @__PURE__ */ jsx52("input", { className: "ba-input", value: name, onChange: (event) => setName(event.target.value), required: true })
7151
7238
  ] }),
7152
- /* @__PURE__ */ jsxs45("label", { className: "ba-label", children: [
7239
+ /* @__PURE__ */ jsxs46("label", { className: "ba-label", children: [
7153
7240
  t("organization.create.slug"),
7154
- /* @__PURE__ */ jsx51(
7241
+ /* @__PURE__ */ jsx52(
7155
7242
  "input",
7156
7243
  {
7157
7244
  className: "ba-input",
@@ -7163,19 +7250,19 @@ function GeneralSection({
7163
7250
  }
7164
7251
  )
7165
7252
  ] }),
7166
- /* @__PURE__ */ jsxs45("label", { className: "ba-label", children: [
7253
+ /* @__PURE__ */ jsxs46("label", { className: "ba-label", children: [
7167
7254
  t("organization.create.logo"),
7168
- /* @__PURE__ */ jsx51("input", { className: "ba-input", type: "url", dir: "ltr", value: logo, onChange: (event) => setLogo(event.target.value), placeholder: "https://" })
7255
+ /* @__PURE__ */ jsx52("input", { className: "ba-input", type: "url", dir: "ltr", value: logo, onChange: (event) => setLogo(event.target.value), placeholder: "https://" })
7169
7256
  ] }),
7170
- /* @__PURE__ */ jsx51(FormError, { children: error }),
7171
- /* @__PURE__ */ jsx51(
7257
+ /* @__PURE__ */ jsx52(FormError, { children: error }),
7258
+ /* @__PURE__ */ jsx52(
7172
7259
  "button",
7173
7260
  {
7174
7261
  className: "ba-button ba-profile-submit",
7175
7262
  type: "submit",
7176
7263
  disabled: pending || !name.trim() || !slug.trim(),
7177
7264
  "aria-busy": pending || void 0,
7178
- children: /* @__PURE__ */ jsx51(Busy, { busy: pending, label: t("common.working"), children: t("organization.profile.general.save") })
7265
+ children: /* @__PURE__ */ jsx52(Busy, { busy: pending, label: t("common.working"), children: t("organization.profile.general.save") })
7179
7266
  }
7180
7267
  )
7181
7268
  ] })
@@ -7183,7 +7270,7 @@ function GeneralSection({
7183
7270
  }
7184
7271
 
7185
7272
  // src/components/organization/InvitationsSection.tsx
7186
- import * as React47 from "react";
7273
+ import * as React48 from "react";
7187
7274
 
7188
7275
  // src/components/organization/role-label.ts
7189
7276
  function organizationRoleLabel(role, t) {
@@ -7195,15 +7282,15 @@ function organizationRoleLabel(role, t) {
7195
7282
  }
7196
7283
 
7197
7284
  // src/components/organization/use-organization-roles.ts
7198
- import * as React46 from "react";
7285
+ import * as React47 from "react";
7199
7286
  var BUILTIN_ROLES = ["owner", "admin", "member"];
7200
7287
  function useOrganizationRoles(organizationId) {
7201
7288
  const api = useAuthClient().organization;
7202
- const apiRef = React46.useRef(api);
7289
+ const apiRef = React47.useRef(api);
7203
7290
  apiRef.current = api;
7204
- const [dynamic, setDynamic] = React46.useState([]);
7205
- const requestRef = React46.useRef(0);
7206
- React46.useEffect(() => {
7291
+ const [dynamic, setDynamic] = React47.useState([]);
7292
+ const requestRef = React47.useRef(0);
7293
+ React47.useEffect(() => {
7207
7294
  const token = ++requestRef.current;
7208
7295
  setDynamic([]);
7209
7296
  if (!organizationId) return;
@@ -7219,7 +7306,7 @@ function useOrganizationRoles(organizationId) {
7219
7306
  requestRef.current += 1;
7220
7307
  };
7221
7308
  }, [organizationId]);
7222
- const roles = React46.useMemo(() => {
7309
+ const roles = React47.useMemo(() => {
7223
7310
  const seen = /* @__PURE__ */ new Set();
7224
7311
  const out = [];
7225
7312
  for (const candidate of [...BUILTIN_ROLES, ...dynamic]) {
@@ -7234,7 +7321,7 @@ function useOrganizationRoles(organizationId) {
7234
7321
  }
7235
7322
 
7236
7323
  // src/components/organization/InvitationsSection.tsx
7237
- import { jsx as jsx52, jsxs as jsxs46 } from "react/jsx-runtime";
7324
+ import { jsx as jsx53, jsxs as jsxs47 } from "react/jsx-runtime";
7238
7325
  function InvitationsSection({
7239
7326
  organization,
7240
7327
  onChanged
@@ -7243,8 +7330,8 @@ function InvitationsSection({
7243
7330
  const api = useAuthClient().organization;
7244
7331
  const { pending, error, run } = useSubmitAction();
7245
7332
  const { roles } = useOrganizationRoles(organization.id);
7246
- const [email, setEmail] = React47.useState("");
7247
- const [role, setRole] = React47.useState("member");
7333
+ const [email, setEmail] = React48.useState("");
7334
+ const [role, setRole] = React48.useState("member");
7248
7335
  const invitations = organization.invitations.filter((invitation) => invitation.status === "pending");
7249
7336
  const invite = (event) => {
7250
7337
  event.preventDefault();
@@ -7266,44 +7353,44 @@ function InvitationsSection({
7266
7353
  { failure: t("organization.profile.invitations.cancelError"), onSuccess: onChanged }
7267
7354
  );
7268
7355
  };
7269
- return /* @__PURE__ */ jsxs46("section", { className: "ba-organization-section", children: [
7270
- /* @__PURE__ */ jsxs46("header", { className: "ba-organization-section-header", children: [
7271
- /* @__PURE__ */ jsx52("h3", { className: "ba-title", children: t("organization.profile.invitations.title") }),
7272
- /* @__PURE__ */ jsx52("p", { className: "ba-muted", children: t("organization.profile.invitations.description") })
7356
+ return /* @__PURE__ */ jsxs47("section", { className: "ba-organization-section", children: [
7357
+ /* @__PURE__ */ jsxs47("header", { className: "ba-organization-section-header", children: [
7358
+ /* @__PURE__ */ jsx53("h3", { className: "ba-title", children: t("organization.profile.invitations.title") }),
7359
+ /* @__PURE__ */ jsx53("p", { className: "ba-muted", children: t("organization.profile.invitations.description") })
7273
7360
  ] }),
7274
- /* @__PURE__ */ jsxs46("form", { method: "post", className: "ba-organization-invite-form", onSubmit: invite, children: [
7275
- /* @__PURE__ */ jsxs46("label", { className: "ba-label", children: [
7361
+ /* @__PURE__ */ jsxs47("form", { method: "post", className: "ba-organization-invite-form", onSubmit: invite, children: [
7362
+ /* @__PURE__ */ jsxs47("label", { className: "ba-label", children: [
7276
7363
  t("organization.profile.invitations.email"),
7277
- /* @__PURE__ */ jsx52("input", { className: "ba-input", type: "email", dir: "ltr", value: email, onChange: (event) => setEmail(event.target.value), required: true })
7364
+ /* @__PURE__ */ jsx53("input", { className: "ba-input", type: "email", dir: "ltr", value: email, onChange: (event) => setEmail(event.target.value), required: true })
7278
7365
  ] }),
7279
- /* @__PURE__ */ jsxs46("label", { className: "ba-label", children: [
7366
+ /* @__PURE__ */ jsxs47("label", { className: "ba-label", children: [
7280
7367
  t("organization.profile.members.role"),
7281
- /* @__PURE__ */ jsx52("select", { className: "ba-input", value: role, onChange: (event) => setRole(event.target.value), children: roles.map((option) => /* @__PURE__ */ jsx52("option", { value: option, children: organizationRoleLabel(option, t) }, option)) })
7368
+ /* @__PURE__ */ jsx53("select", { className: "ba-input", value: role, onChange: (event) => setRole(event.target.value), children: roles.map((option) => /* @__PURE__ */ jsx53("option", { value: option, children: organizationRoleLabel(option, t) }, option)) })
7282
7369
  ] }),
7283
- /* @__PURE__ */ jsx52(
7370
+ /* @__PURE__ */ jsx53(
7284
7371
  "button",
7285
7372
  {
7286
7373
  className: "ba-button",
7287
7374
  type: "submit",
7288
7375
  disabled: pending || !email.trim(),
7289
7376
  "aria-busy": pending || void 0,
7290
- children: /* @__PURE__ */ jsx52(Busy, { busy: pending, label: t("common.working"), children: t("organization.profile.invitations.invite") })
7377
+ children: /* @__PURE__ */ jsx53(Busy, { busy: pending, label: t("common.working"), children: t("organization.profile.invitations.invite") })
7291
7378
  }
7292
7379
  )
7293
7380
  ] }),
7294
- /* @__PURE__ */ jsx52(FormError, { children: error }),
7295
- invitations.length === 0 ? /* @__PURE__ */ jsx52("p", { className: "ba-muted", children: t("organization.profile.invitations.empty") }) : /* @__PURE__ */ jsx52("ul", { className: "ba-organization-list", children: invitations.map((invitation) => /* @__PURE__ */ jsxs46("li", { className: "ba-organization-invitation", children: [
7296
- /* @__PURE__ */ jsxs46("span", { children: [
7297
- /* @__PURE__ */ jsx52("strong", { children: /* @__PURE__ */ jsx52(Bidi, { children: invitation.email }) }),
7298
- /* @__PURE__ */ jsx52("small", { children: organizationRoleLabel(invitation.role, t) })
7381
+ /* @__PURE__ */ jsx53(FormError, { children: error }),
7382
+ invitations.length === 0 ? /* @__PURE__ */ jsx53("p", { className: "ba-muted", children: t("organization.profile.invitations.empty") }) : /* @__PURE__ */ jsx53("ul", { className: "ba-organization-list", children: invitations.map((invitation) => /* @__PURE__ */ jsxs47("li", { className: "ba-organization-invitation", children: [
7383
+ /* @__PURE__ */ jsxs47("span", { children: [
7384
+ /* @__PURE__ */ jsx53("strong", { children: /* @__PURE__ */ jsx53(Bidi, { children: invitation.email }) }),
7385
+ /* @__PURE__ */ jsx53("small", { children: organizationRoleLabel(invitation.role, t) })
7299
7386
  ] }),
7300
- /* @__PURE__ */ jsx52("button", { className: "ba-link-button ba-danger", type: "button", disabled: pending, onClick: () => cancel(invitation), children: t("organization.profile.invitations.cancel") })
7387
+ /* @__PURE__ */ jsx53("button", { className: "ba-link-button ba-danger", type: "button", disabled: pending, onClick: () => cancel(invitation), children: t("organization.profile.invitations.cancel") })
7301
7388
  ] }, invitation.id)) })
7302
7389
  ] });
7303
7390
  }
7304
7391
 
7305
7392
  // src/components/organization/MembersSection.tsx
7306
- import { jsx as jsx53, jsxs as jsxs47 } from "react/jsx-runtime";
7393
+ import { jsx as jsx54, jsxs as jsxs48 } from "react/jsx-runtime";
7307
7394
  function MembersSection({
7308
7395
  organization,
7309
7396
  userId,
@@ -7330,27 +7417,27 @@ function MembersSection({
7330
7417
  { failure: t("organization.profile.members.removeError"), onSuccess: onChanged }
7331
7418
  );
7332
7419
  };
7333
- return /* @__PURE__ */ jsxs47("section", { className: "ba-organization-section", children: [
7334
- /* @__PURE__ */ jsxs47("header", { className: "ba-organization-section-header", children: [
7335
- /* @__PURE__ */ jsx53("h3", { className: "ba-title", children: t("organization.profile.members.title") }),
7336
- /* @__PURE__ */ jsx53("p", { className: "ba-muted", children: t("organization.profile.members.description") })
7420
+ return /* @__PURE__ */ jsxs48("section", { className: "ba-organization-section", children: [
7421
+ /* @__PURE__ */ jsxs48("header", { className: "ba-organization-section-header", children: [
7422
+ /* @__PURE__ */ jsx54("h3", { className: "ba-title", children: t("organization.profile.members.title") }),
7423
+ /* @__PURE__ */ jsx54("p", { className: "ba-muted", children: t("organization.profile.members.description") })
7337
7424
  ] }),
7338
- /* @__PURE__ */ jsx53(FormError, { children: error }),
7339
- /* @__PURE__ */ jsx53("ul", { className: "ba-organization-list", children: organization.members.map((member) => {
7425
+ /* @__PURE__ */ jsx54(FormError, { children: error }),
7426
+ /* @__PURE__ */ jsx54("ul", { className: "ba-organization-list", children: organization.members.map((member) => {
7340
7427
  const primaryRole = organizationRoles(member.role)[0] ?? member.role;
7341
7428
  const isCurrent = member.userId === userId;
7342
- return /* @__PURE__ */ jsxs47("li", { className: "ba-organization-member", children: [
7343
- /* @__PURE__ */ jsx53("span", { className: "ba-organization-avatar", "aria-hidden": "true", children: member.user.name.trim().charAt(0).toUpperCase() || "?" }),
7344
- /* @__PURE__ */ jsxs47("span", { className: "ba-organization-member-copy", children: [
7345
- /* @__PURE__ */ jsxs47("strong", { children: [
7429
+ return /* @__PURE__ */ jsxs48("li", { className: "ba-organization-member", children: [
7430
+ /* @__PURE__ */ jsx54("span", { className: "ba-organization-avatar", "aria-hidden": "true", children: member.user.name.trim().charAt(0).toUpperCase() || "?" }),
7431
+ /* @__PURE__ */ jsxs48("span", { className: "ba-organization-member-copy", children: [
7432
+ /* @__PURE__ */ jsxs48("strong", { children: [
7346
7433
  member.user.name,
7347
7434
  isCurrent ? ` ${t("organization.profile.members.you")}` : ""
7348
7435
  ] }),
7349
- /* @__PURE__ */ jsx53("small", { children: /* @__PURE__ */ jsx53(Bidi, { children: member.user.email }) })
7436
+ /* @__PURE__ */ jsx54("small", { children: /* @__PURE__ */ jsx54(Bidi, { children: member.user.email }) })
7350
7437
  ] }),
7351
- canManage && !isCurrent ? /* @__PURE__ */ jsxs47("span", { className: "ba-organization-member-actions", children: [
7352
- /* @__PURE__ */ jsx53("label", { className: "ba-sr-only", htmlFor: `organization-role-${member.id}`, children: t("organization.profile.members.role") }),
7353
- /* @__PURE__ */ jsx53(
7438
+ canManage && !isCurrent ? /* @__PURE__ */ jsxs48("span", { className: "ba-organization-member-actions", children: [
7439
+ /* @__PURE__ */ jsx54("label", { className: "ba-sr-only", htmlFor: `organization-role-${member.id}`, children: t("organization.profile.members.role") }),
7440
+ /* @__PURE__ */ jsx54(
7354
7441
  "select",
7355
7442
  {
7356
7443
  id: `organization-role-${member.id}`,
@@ -7358,18 +7445,18 @@ function MembersSection({
7358
7445
  value: primaryRole,
7359
7446
  disabled: pending,
7360
7447
  onChange: (event) => updateRole(member, event.target.value),
7361
- children: (roles.includes(primaryRole) ? roles : [primaryRole, ...roles]).map((role) => /* @__PURE__ */ jsx53("option", { value: role, children: organizationRoleLabel(role, t) }, role))
7448
+ children: (roles.includes(primaryRole) ? roles : [primaryRole, ...roles]).map((role) => /* @__PURE__ */ jsx54("option", { value: role, children: organizationRoleLabel(role, t) }, role))
7362
7449
  }
7363
7450
  ),
7364
- /* @__PURE__ */ jsx53("button", { className: "ba-link-button ba-danger", type: "button", disabled: pending, onClick: () => remove(member), children: t("organization.profile.members.remove") })
7365
- ] }) : /* @__PURE__ */ jsx53("span", { className: "ba-organization-role-label", children: organizationRoleLabel(primaryRole, t) })
7451
+ /* @__PURE__ */ jsx54("button", { className: "ba-link-button ba-danger", type: "button", disabled: pending, onClick: () => remove(member), children: t("organization.profile.members.remove") })
7452
+ ] }) : /* @__PURE__ */ jsx54("span", { className: "ba-organization-role-label", children: organizationRoleLabel(primaryRole, t) })
7366
7453
  ] }, member.id);
7367
7454
  }) })
7368
7455
  ] });
7369
7456
  }
7370
7457
 
7371
7458
  // src/components/OrganizationProfile.tsx
7372
- import { jsx as jsx54, jsxs as jsxs48 } from "react/jsx-runtime";
7459
+ import { jsx as jsx55, jsxs as jsxs49 } from "react/jsx-runtime";
7373
7460
  var SECTION_KEYS2 = {
7374
7461
  general: "organization.profile.nav.general",
7375
7462
  members: "organization.profile.nav.members",
@@ -7383,17 +7470,17 @@ function OrganizationProfile({ organizationId, defaultSection = "general", onDel
7383
7470
  const { user, isLoaded, isSignedIn } = useUser();
7384
7471
  const session = useSession();
7385
7472
  const api = useAuthClient().organization;
7386
- const apiRef = React48.useRef(api);
7473
+ const apiRef = React49.useRef(api);
7387
7474
  apiRef.current = api;
7388
7475
  const activeOrganizationId = session.data?.session.activeOrganizationId ?? null;
7389
7476
  const requestedId = organizationId ?? activeOrganizationId;
7390
7477
  const enabled = config?.organizations === true && isSignedIn;
7391
- const [organization, setOrganization] = React48.useState(null);
7392
- const [error, setError] = React48.useState(null);
7393
- const [wasRemoved, setWasRemoved] = React48.useState(false);
7394
- const [section, setSection] = React48.useState(defaultSection);
7395
- const requestRef = React48.useRef(0);
7396
- const load = React48.useCallback(async () => {
7478
+ const [organization, setOrganization] = React49.useState(null);
7479
+ const [error, setError] = React49.useState(null);
7480
+ const [wasRemoved, setWasRemoved] = React49.useState(false);
7481
+ const [section, setSection] = React49.useState(defaultSection);
7482
+ const requestRef = React49.useRef(0);
7483
+ const load = React49.useCallback(async () => {
7397
7484
  const token = ++requestRef.current;
7398
7485
  if (!enabled || !requestedId) {
7399
7486
  setOrganization(null);
@@ -7413,7 +7500,7 @@ function OrganizationProfile({ organizationId, defaultSection = "general", onDel
7413
7500
  if (token === requestRef.current) setError(t("organization.profile.loadError"));
7414
7501
  }
7415
7502
  }, [enabled, requestedId, t, toServerError]);
7416
- React48.useEffect(() => {
7503
+ React49.useEffect(() => {
7417
7504
  setOrganization(null);
7418
7505
  setError(null);
7419
7506
  setWasRemoved(false);
@@ -7422,20 +7509,20 @@ function OrganizationProfile({ organizationId, defaultSection = "general", onDel
7422
7509
  requestRef.current += 1;
7423
7510
  };
7424
7511
  }, [load]);
7425
- if (configLoading || !isLoaded) return /* @__PURE__ */ jsx54("div", { className: "ba-skeleton", "aria-label": t("organization.loading") });
7512
+ if (configLoading || !isLoaded) return /* @__PURE__ */ jsx55("div", { className: "ba-skeleton", "aria-label": t("organization.loading") });
7426
7513
  if (config?.organizations !== true) return null;
7427
- if (!isSignedIn || !user) return /* @__PURE__ */ jsx54("p", { className: "ba-muted", children: t("organization.signedOut") });
7428
- if (wasRemoved) return /* @__PURE__ */ jsx54("p", { className: "ba-muted", children: t("organization.profile.noActive") });
7429
- if (!requestedId) return /* @__PURE__ */ jsx54("p", { className: "ba-muted", children: t("organization.profile.noActive") });
7514
+ if (!isSignedIn || !user) return /* @__PURE__ */ jsx55("p", { className: "ba-muted", children: t("organization.signedOut") });
7515
+ if (wasRemoved) return /* @__PURE__ */ jsx55("p", { className: "ba-muted", children: t("organization.profile.noActive") });
7516
+ if (!requestedId) return /* @__PURE__ */ jsx55("p", { className: "ba-muted", children: t("organization.profile.noActive") });
7430
7517
  if (error) {
7431
- return /* @__PURE__ */ jsxs48("div", { className: "ba-inline-error", children: [
7432
- /* @__PURE__ */ jsx54(FormError, { children: error }),
7433
- /* @__PURE__ */ jsx54("button", { className: "ba-link-button", type: "button", onClick: () => void load(), children: t("organization.retry") })
7518
+ return /* @__PURE__ */ jsxs49("div", { className: "ba-inline-error", children: [
7519
+ /* @__PURE__ */ jsx55(FormError, { children: error }),
7520
+ /* @__PURE__ */ jsx55("button", { className: "ba-link-button", type: "button", onClick: () => void load(), children: t("organization.retry") })
7434
7521
  ] });
7435
7522
  }
7436
- if (!organization) return /* @__PURE__ */ jsx54("div", { className: "ba-skeleton", "aria-label": t("organization.loading") });
7523
+ if (!organization) return /* @__PURE__ */ jsx55("div", { className: "ba-skeleton", "aria-label": t("organization.loading") });
7437
7524
  const membership = organization.members.find((member) => member.userId === user.id);
7438
- if (!membership) return /* @__PURE__ */ jsx54("p", { className: "ba-muted", children: t("organization.profile.notMember") });
7525
+ if (!membership) return /* @__PURE__ */ jsx55("p", { className: "ba-muted", children: t("organization.profile.notMember") });
7439
7526
  const canManage = canManageOrganization(membership);
7440
7527
  const visibleSections = canManage ? ["general", "members", "invitations", "danger"] : ["general", "members", "danger"];
7441
7528
  const activeSection = visibleSections.includes(section) ? section : "general";
@@ -7444,16 +7531,16 @@ function OrganizationProfile({ organizationId, defaultSection = "general", onDel
7444
7531
  setOrganization(null);
7445
7532
  callback?.(removedOrganization);
7446
7533
  };
7447
- return /* @__PURE__ */ jsxs48("article", { className: "ba-organization-profile", children: [
7448
- /* @__PURE__ */ jsxs48("header", { className: "ba-organization-profile-heading", children: [
7449
- /* @__PURE__ */ jsx54("span", { className: "ba-organization-avatar ba-organization-avatar-large", "aria-hidden": "true", children: organization.name.trim().charAt(0).toUpperCase() || "?" }),
7450
- /* @__PURE__ */ jsxs48("span", { children: [
7451
- /* @__PURE__ */ jsx54("h2", { className: "ba-title", children: organization.name }),
7452
- /* @__PURE__ */ jsx54("p", { className: "ba-muted", children: organization.slug })
7534
+ return /* @__PURE__ */ jsxs49("article", { className: "ba-organization-profile", children: [
7535
+ /* @__PURE__ */ jsxs49("header", { className: "ba-organization-profile-heading", children: [
7536
+ /* @__PURE__ */ jsx55("span", { className: "ba-organization-avatar ba-organization-avatar-large", "aria-hidden": "true", children: organization.name.trim().charAt(0).toUpperCase() || "?" }),
7537
+ /* @__PURE__ */ jsxs49("span", { children: [
7538
+ /* @__PURE__ */ jsx55("h2", { className: "ba-title", children: organization.name }),
7539
+ /* @__PURE__ */ jsx55("p", { className: "ba-muted", children: organization.slug })
7453
7540
  ] })
7454
7541
  ] }),
7455
- /* @__PURE__ */ jsxs48("div", { className: "ba-organization-profile-layout", children: [
7456
- /* @__PURE__ */ jsx54("nav", { className: "ba-organization-profile-nav", "aria-label": t("organization.profile.nav.label"), children: visibleSections.map((item) => /* @__PURE__ */ jsx54(
7542
+ /* @__PURE__ */ jsxs49("div", { className: "ba-organization-profile-layout", children: [
7543
+ /* @__PURE__ */ jsx55("nav", { className: "ba-organization-profile-nav", "aria-label": t("organization.profile.nav.label"), children: visibleSections.map((item) => /* @__PURE__ */ jsx55(
7457
7544
  "button",
7458
7545
  {
7459
7546
  className: "ba-profile-nav-item",
@@ -7464,11 +7551,11 @@ function OrganizationProfile({ organizationId, defaultSection = "general", onDel
7464
7551
  },
7465
7552
  item
7466
7553
  )) }),
7467
- /* @__PURE__ */ jsxs48("div", { className: "ba-organization-profile-content", children: [
7468
- activeSection === "general" && /* @__PURE__ */ jsx54(GeneralSection, { organization, canManage, onChanged: load }),
7469
- activeSection === "members" && /* @__PURE__ */ jsx54(MembersSection, { organization, userId: user.id, canManage, onChanged: load }),
7470
- activeSection === "invitations" && /* @__PURE__ */ jsx54(InvitationsSection, { organization, onChanged: load }),
7471
- activeSection === "danger" && /* @__PURE__ */ jsx54(
7554
+ /* @__PURE__ */ jsxs49("div", { className: "ba-organization-profile-content", children: [
7555
+ activeSection === "general" && /* @__PURE__ */ jsx55(GeneralSection, { organization, canManage, onChanged: load }),
7556
+ activeSection === "members" && /* @__PURE__ */ jsx55(MembersSection, { organization, userId: user.id, canManage, onChanged: load }),
7557
+ activeSection === "invitations" && /* @__PURE__ */ jsx55(InvitationsSection, { organization, onChanged: load }),
7558
+ activeSection === "danger" && /* @__PURE__ */ jsx55(
7472
7559
  DangerSection,
7473
7560
  {
7474
7561
  organization,
@@ -7483,7 +7570,7 @@ function OrganizationProfile({ organizationId, defaultSection = "general", onDel
7483
7570
  }
7484
7571
 
7485
7572
  // src/components/OrganizationSwitcher.tsx
7486
- import { Fragment as Fragment14, jsx as jsx55, jsxs as jsxs49 } from "react/jsx-runtime";
7573
+ import { Fragment as Fragment14, jsx as jsx56, jsxs as jsxs50 } from "react/jsx-runtime";
7487
7574
  function OrganizationSwitcher({ showPersonalWorkspace = true, onOrganizationChange } = {}) {
7488
7575
  const t = useT();
7489
7576
  const { config, isLoading: configLoading } = usePublicConfig();
@@ -7493,15 +7580,15 @@ function OrganizationSwitcher({ showPersonalWorkspace = true, onOrganizationChan
7493
7580
  const enabled = config?.organizations === true && isSignedIn;
7494
7581
  const { organizations, isLoading, error: loadError, refresh } = useOrganizationsResource(enabled);
7495
7582
  const { pending, error, run } = useSubmitAction();
7496
- const [open, setOpen] = React49.useState(false);
7497
- const [dialog, setDialog] = React49.useState(null);
7498
- const rootRef = React49.useRef(null);
7499
- const triggerRef = React49.useRef(null);
7500
- const menuRef = React49.useRef(null);
7501
- const menuId = React49.useId();
7583
+ const [open, setOpen] = React50.useState(false);
7584
+ const [dialog, setDialog] = React50.useState(null);
7585
+ const rootRef = React50.useRef(null);
7586
+ const triggerRef = React50.useRef(null);
7587
+ const menuRef = React50.useRef(null);
7588
+ const menuId = React50.useId();
7502
7589
  const activeId = session.data?.session.activeOrganizationId ?? null;
7503
7590
  const active = organizations?.find((organization) => organization.id === activeId) ?? null;
7504
- React49.useEffect(() => {
7591
+ React50.useEffect(() => {
7505
7592
  if (!open) return;
7506
7593
  const onPointerDown = (event) => {
7507
7594
  if (!rootRef.current?.contains(event.target)) setOpen(false);
@@ -7516,9 +7603,9 @@ function OrganizationSwitcher({ showPersonalWorkspace = true, onOrganizationChan
7516
7603
  document.removeEventListener("keydown", onKeyDown);
7517
7604
  };
7518
7605
  }, [open]);
7519
- if (configLoading || !isLoaded) return /* @__PURE__ */ jsx55("div", { className: "ba-skeleton ba-organization-switcher-skeleton", "aria-label": t("organization.loading") });
7606
+ if (configLoading || !isLoaded) return /* @__PURE__ */ jsx56("div", { className: "ba-skeleton ba-organization-switcher-skeleton", "aria-label": t("organization.loading") });
7520
7607
  if (config?.organizations !== true) return null;
7521
- if (!isSignedIn) return /* @__PURE__ */ jsx55("p", { className: "ba-muted", children: t("organization.signedOut") });
7608
+ if (!isSignedIn) return /* @__PURE__ */ jsx56("p", { className: "ba-muted", children: t("organization.signedOut") });
7522
7609
  const select = (organization) => {
7523
7610
  void run(
7524
7611
  () => api.setActive({ organizationId: organization?.id ?? null }),
@@ -7561,9 +7648,9 @@ function OrganizationSwitcher({ showPersonalWorkspace = true, onOrganizationChan
7561
7648
  else if (event.key === "ArrowDown") items[(current + 1 + items.length) % items.length]?.focus();
7562
7649
  else items[(current - 1 + items.length) % items.length]?.focus();
7563
7650
  };
7564
- return /* @__PURE__ */ jsxs49(Fragment14, { children: [
7565
- /* @__PURE__ */ jsxs49("div", { ref: rootRef, className: "ba-organization-switcher", children: [
7566
- /* @__PURE__ */ jsxs49(
7651
+ return /* @__PURE__ */ jsxs50(Fragment14, { children: [
7652
+ /* @__PURE__ */ jsxs50("div", { ref: rootRef, className: "ba-organization-switcher", children: [
7653
+ /* @__PURE__ */ jsxs50(
7567
7654
  "button",
7568
7655
  {
7569
7656
  ref: triggerRef,
@@ -7580,43 +7667,43 @@ function OrganizationSwitcher({ showPersonalWorkspace = true, onOrganizationChan
7580
7667
  focusMenuItem(event.key === "ArrowDown" ? "first" : "last");
7581
7668
  },
7582
7669
  children: [
7583
- /* @__PURE__ */ jsx55("span", { className: "ba-organization-avatar", "aria-hidden": "true", children: active?.name.trim().charAt(0).toUpperCase() || "P" }),
7584
- /* @__PURE__ */ jsx55("span", { children: active?.name ?? t("organization.personal") }),
7585
- /* @__PURE__ */ jsx55("span", { "aria-hidden": "true", children: "\u2304" })
7670
+ /* @__PURE__ */ jsx56("span", { className: "ba-organization-avatar", "aria-hidden": "true", children: active?.name.trim().charAt(0).toUpperCase() || "P" }),
7671
+ /* @__PURE__ */ jsx56("span", { children: active?.name ?? t("organization.personal") }),
7672
+ /* @__PURE__ */ jsx56("span", { "aria-hidden": "true", children: "\u2304" })
7586
7673
  ]
7587
7674
  }
7588
7675
  ),
7589
- open && /* @__PURE__ */ jsxs49("div", { ref: menuRef, id: menuId, className: "ba-organization-menu", role: "menu", "aria-label": t("organization.switcher.label"), onKeyDown: onMenuKeyDown, children: [
7590
- isLoading ? /* @__PURE__ */ jsx55("div", { className: "ba-skeleton" }) : /* @__PURE__ */ jsxs49(Fragment14, { children: [
7591
- showPersonalWorkspace && /* @__PURE__ */ jsxs49("button", { className: "ba-organization-menu-item", type: "button", role: "menuitem", "aria-current": activeId === null ? "true" : void 0, disabled: pending, onClick: () => select(null), children: [
7592
- /* @__PURE__ */ jsx55("span", { className: "ba-organization-avatar", "aria-hidden": "true", children: "P" }),
7593
- /* @__PURE__ */ jsx55("span", { children: t("organization.personal") })
7676
+ open && /* @__PURE__ */ jsxs50("div", { ref: menuRef, id: menuId, className: "ba-organization-menu", role: "menu", "aria-label": t("organization.switcher.label"), onKeyDown: onMenuKeyDown, children: [
7677
+ isLoading ? /* @__PURE__ */ jsx56("div", { className: "ba-skeleton" }) : /* @__PURE__ */ jsxs50(Fragment14, { children: [
7678
+ showPersonalWorkspace && /* @__PURE__ */ jsxs50("button", { className: "ba-organization-menu-item", type: "button", role: "menuitem", "aria-current": activeId === null ? "true" : void 0, disabled: pending, onClick: () => select(null), children: [
7679
+ /* @__PURE__ */ jsx56("span", { className: "ba-organization-avatar", "aria-hidden": "true", children: "P" }),
7680
+ /* @__PURE__ */ jsx56("span", { children: t("organization.personal") })
7594
7681
  ] }),
7595
- organizations?.map((organization) => /* @__PURE__ */ jsxs49("button", { className: "ba-organization-menu-item", type: "button", role: "menuitem", "aria-current": activeId === organization.id ? "true" : void 0, disabled: pending, onClick: () => select(organization), children: [
7596
- /* @__PURE__ */ jsx55("span", { className: "ba-organization-avatar", "aria-hidden": "true", children: organization.name.trim().charAt(0).toUpperCase() || "?" }),
7597
- /* @__PURE__ */ jsxs49("span", { children: [
7682
+ organizations?.map((organization) => /* @__PURE__ */ jsxs50("button", { className: "ba-organization-menu-item", type: "button", role: "menuitem", "aria-current": activeId === organization.id ? "true" : void 0, disabled: pending, onClick: () => select(organization), children: [
7683
+ /* @__PURE__ */ jsx56("span", { className: "ba-organization-avatar", "aria-hidden": "true", children: organization.name.trim().charAt(0).toUpperCase() || "?" }),
7684
+ /* @__PURE__ */ jsxs50("span", { children: [
7598
7685
  organization.name,
7599
- /* @__PURE__ */ jsx55("small", { children: organization.slug })
7686
+ /* @__PURE__ */ jsx56("small", { children: organization.slug })
7600
7687
  ] })
7601
7688
  ] }, organization.id))
7602
7689
  ] }),
7603
- (loadError || error) && /* @__PURE__ */ jsxs49("div", { className: "ba-inline-error", children: [
7604
- /* @__PURE__ */ jsx55(FormError, { children: loadError ?? error }),
7605
- loadError && /* @__PURE__ */ jsx55("button", { className: "ba-link-button", type: "button", onClick: () => void refresh(), children: t("organization.retry") })
7690
+ (loadError || error) && /* @__PURE__ */ jsxs50("div", { className: "ba-inline-error", children: [
7691
+ /* @__PURE__ */ jsx56(FormError, { children: loadError ?? error }),
7692
+ loadError && /* @__PURE__ */ jsx56("button", { className: "ba-link-button", type: "button", onClick: () => void refresh(), children: t("organization.retry") })
7606
7693
  ] }),
7607
- /* @__PURE__ */ jsxs49("div", { className: "ba-organization-menu-actions", children: [
7608
- active && /* @__PURE__ */ jsx55("button", { className: "ba-menu-item", type: "button", role: "menuitem", onClick: () => {
7694
+ /* @__PURE__ */ jsxs50("div", { className: "ba-organization-menu-actions", children: [
7695
+ active && /* @__PURE__ */ jsx56("button", { className: "ba-menu-item", type: "button", role: "menuitem", onClick: () => {
7609
7696
  setOpen(false);
7610
7697
  setDialog("profile");
7611
7698
  }, children: t("organization.switcher.manage") }),
7612
- /* @__PURE__ */ jsx55("button", { className: "ba-menu-item", type: "button", role: "menuitem", onClick: () => {
7699
+ /* @__PURE__ */ jsx56("button", { className: "ba-menu-item", type: "button", role: "menuitem", onClick: () => {
7613
7700
  setOpen(false);
7614
7701
  setDialog("create");
7615
7702
  }, children: t("organization.switcher.create") })
7616
7703
  ] })
7617
7704
  ] })
7618
7705
  ] }),
7619
- dialog === "create" && /* @__PURE__ */ jsx55(OrganizationModal, { title: t("organization.create.title"), returnFocusRef: triggerRef, onClose: () => setDialog(null), children: /* @__PURE__ */ jsx55(
7706
+ dialog === "create" && /* @__PURE__ */ jsx56(OrganizationModal, { title: t("organization.create.title"), returnFocusRef: triggerRef, onClose: () => setDialog(null), children: /* @__PURE__ */ jsx56(
7620
7707
  CreateOrganization,
7621
7708
  {
7622
7709
  title: null,
@@ -7630,13 +7717,13 @@ function OrganizationSwitcher({ showPersonalWorkspace = true, onOrganizationChan
7630
7717
  }
7631
7718
  }
7632
7719
  ) }),
7633
- dialog === "profile" && active && /* @__PURE__ */ jsx55(OrganizationModal, { title: t("organization.profile.title"), returnFocusRef: triggerRef, onClose: () => setDialog(null), children: /* @__PURE__ */ jsx55(OrganizationProfile, { organizationId: active.id, onDeleted: () => void afterProfileRemoval(), onLeft: () => void afterProfileRemoval() }) })
7720
+ dialog === "profile" && active && /* @__PURE__ */ jsx56(OrganizationModal, { title: t("organization.profile.title"), returnFocusRef: triggerRef, onClose: () => setDialog(null), children: /* @__PURE__ */ jsx56(OrganizationProfile, { organizationId: active.id, onDeleted: () => void afterProfileRemoval(), onLeft: () => void afterProfileRemoval() }) })
7634
7721
  ] });
7635
7722
  }
7636
7723
 
7637
7724
  // src/components/OrganizationList.tsx
7638
- import * as React50 from "react";
7639
- import { Fragment as Fragment15, jsx as jsx56, jsxs as jsxs50 } from "react/jsx-runtime";
7725
+ import * as React51 from "react";
7726
+ import { Fragment as Fragment15, jsx as jsx57, jsxs as jsxs51 } from "react/jsx-runtime";
7640
7727
  function OrganizationList({ onOrganizationChange } = {}) {
7641
7728
  const t = useT();
7642
7729
  const toServerError = useServerError();
@@ -7644,19 +7731,19 @@ function OrganizationList({ onOrganizationChange } = {}) {
7644
7731
  const { user, isLoaded, isSignedIn } = useUser();
7645
7732
  const session = useSession();
7646
7733
  const api = useAuthClient().organization;
7647
- const apiRef = React50.useRef(api);
7734
+ const apiRef = React51.useRef(api);
7648
7735
  apiRef.current = api;
7649
7736
  const enabled = config?.organizations === true && isSignedIn;
7650
7737
  const { organizations, isLoading, error: organizationError, refresh } = useOrganizationsResource(enabled);
7651
7738
  const { pending, error, run } = useSubmitAction();
7652
- const [invitations, setInvitations] = React50.useState(null);
7653
- const [invitationError, setInvitationError] = React50.useState(null);
7654
- const [dialog, setDialog] = React50.useState(null);
7655
- const [profileId, setProfileId] = React50.useState(null);
7656
- const dialogReturnFocusRef = React50.useRef(null);
7657
- const invitationRequestRef = React50.useRef(0);
7739
+ const [invitations, setInvitations] = React51.useState(null);
7740
+ const [invitationError, setInvitationError] = React51.useState(null);
7741
+ const [dialog, setDialog] = React51.useState(null);
7742
+ const [profileId, setProfileId] = React51.useState(null);
7743
+ const dialogReturnFocusRef = React51.useRef(null);
7744
+ const invitationRequestRef = React51.useRef(0);
7658
7745
  const activeId = session.data?.session.activeOrganizationId ?? null;
7659
- const loadInvitations = React50.useCallback(async () => {
7746
+ const loadInvitations = React51.useCallback(async () => {
7660
7747
  const token = ++invitationRequestRef.current;
7661
7748
  if (!enabled) {
7662
7749
  setInvitations([]);
@@ -7676,7 +7763,7 @@ function OrganizationList({ onOrganizationChange } = {}) {
7676
7763
  if (token === invitationRequestRef.current) setInvitationError(t("organization.list.invitationsError"));
7677
7764
  }
7678
7765
  }, [enabled, t, toServerError]);
7679
- React50.useEffect(() => {
7766
+ React51.useEffect(() => {
7680
7767
  setInvitations(null);
7681
7768
  setInvitationError(null);
7682
7769
  if (!isLoaded) return;
@@ -7685,9 +7772,9 @@ function OrganizationList({ onOrganizationChange } = {}) {
7685
7772
  invitationRequestRef.current += 1;
7686
7773
  };
7687
7774
  }, [isLoaded, loadInvitations, user?.id]);
7688
- if (configLoading || !isLoaded) return /* @__PURE__ */ jsx56("div", { className: "ba-skeleton", "aria-label": t("organization.loading") });
7775
+ if (configLoading || !isLoaded) return /* @__PURE__ */ jsx57("div", { className: "ba-skeleton", "aria-label": t("organization.loading") });
7689
7776
  if (config?.organizations !== true) return null;
7690
- if (!isSignedIn) return /* @__PURE__ */ jsx56("p", { className: "ba-muted", children: t("organization.signedOut") });
7777
+ if (!isSignedIn) return /* @__PURE__ */ jsx57("p", { className: "ba-muted", children: t("organization.signedOut") });
7691
7778
  const setActive = (organization) => {
7692
7779
  void run(
7693
7780
  () => api.setActive({ organizationId: organization.id }),
@@ -7728,71 +7815,71 @@ function OrganizationList({ onOrganizationChange } = {}) {
7728
7815
  setDialog(null);
7729
7816
  setProfileId(null);
7730
7817
  };
7731
- return /* @__PURE__ */ jsxs50(Fragment15, { children: [
7732
- /* @__PURE__ */ jsxs50("section", { className: "ba-organization-directory", children: [
7733
- /* @__PURE__ */ jsxs50("header", { className: "ba-organization-directory-header", children: [
7734
- /* @__PURE__ */ jsxs50("span", { children: [
7735
- /* @__PURE__ */ jsx56("h2", { className: "ba-title", children: t("organization.list.title") }),
7736
- /* @__PURE__ */ jsx56("p", { className: "ba-muted", children: t("organization.list.description") })
7818
+ return /* @__PURE__ */ jsxs51(Fragment15, { children: [
7819
+ /* @__PURE__ */ jsxs51("section", { className: "ba-organization-directory", children: [
7820
+ /* @__PURE__ */ jsxs51("header", { className: "ba-organization-directory-header", children: [
7821
+ /* @__PURE__ */ jsxs51("span", { children: [
7822
+ /* @__PURE__ */ jsx57("h2", { className: "ba-title", children: t("organization.list.title") }),
7823
+ /* @__PURE__ */ jsx57("p", { className: "ba-muted", children: t("organization.list.description") })
7737
7824
  ] }),
7738
- /* @__PURE__ */ jsx56("button", { className: "ba-button", type: "button", onClick: (event) => {
7825
+ /* @__PURE__ */ jsx57("button", { className: "ba-button", type: "button", onClick: (event) => {
7739
7826
  dialogReturnFocusRef.current = event.currentTarget;
7740
7827
  setDialog("create");
7741
7828
  }, children: t("organization.switcher.create") })
7742
7829
  ] }),
7743
- (organizationError || error) && /* @__PURE__ */ jsxs50("div", { className: "ba-inline-error", children: [
7744
- /* @__PURE__ */ jsx56(FormError, { children: organizationError ?? error }),
7745
- organizationError && /* @__PURE__ */ jsx56("button", { className: "ba-link-button", type: "button", onClick: () => void refresh(), children: t("organization.retry") })
7830
+ (organizationError || error) && /* @__PURE__ */ jsxs51("div", { className: "ba-inline-error", children: [
7831
+ /* @__PURE__ */ jsx57(FormError, { children: organizationError ?? error }),
7832
+ organizationError && /* @__PURE__ */ jsx57("button", { className: "ba-link-button", type: "button", onClick: () => void refresh(), children: t("organization.retry") })
7746
7833
  ] }),
7747
- isLoading ? /* @__PURE__ */ jsxs50("div", { className: "ba-organization-card-grid", children: [
7748
- /* @__PURE__ */ jsx56("div", { className: "ba-skeleton" }),
7749
- /* @__PURE__ */ jsx56("div", { className: "ba-skeleton" })
7750
- ] }) : organizations?.length ? /* @__PURE__ */ jsx56("ul", { className: "ba-organization-card-grid", children: organizations.map((organization) => /* @__PURE__ */ jsxs50("li", { className: "ba-organization-card", children: [
7751
- /* @__PURE__ */ jsx56("span", { className: "ba-organization-avatar ba-organization-avatar-large", "aria-hidden": "true", children: organization.name.trim().charAt(0).toUpperCase() || "?" }),
7752
- /* @__PURE__ */ jsxs50("span", { className: "ba-organization-card-copy", children: [
7753
- /* @__PURE__ */ jsx56("strong", { children: organization.name }),
7754
- /* @__PURE__ */ jsx56("small", { children: /* @__PURE__ */ jsx56(Bidi, { children: organization.slug }) })
7834
+ isLoading ? /* @__PURE__ */ jsxs51("div", { className: "ba-organization-card-grid", children: [
7835
+ /* @__PURE__ */ jsx57("div", { className: "ba-skeleton" }),
7836
+ /* @__PURE__ */ jsx57("div", { className: "ba-skeleton" })
7837
+ ] }) : organizations?.length ? /* @__PURE__ */ jsx57("ul", { className: "ba-organization-card-grid", children: organizations.map((organization) => /* @__PURE__ */ jsxs51("li", { className: "ba-organization-card", children: [
7838
+ /* @__PURE__ */ jsx57("span", { className: "ba-organization-avatar ba-organization-avatar-large", "aria-hidden": "true", children: organization.name.trim().charAt(0).toUpperCase() || "?" }),
7839
+ /* @__PURE__ */ jsxs51("span", { className: "ba-organization-card-copy", children: [
7840
+ /* @__PURE__ */ jsx57("strong", { children: organization.name }),
7841
+ /* @__PURE__ */ jsx57("small", { children: /* @__PURE__ */ jsx57(Bidi, { children: organization.slug }) })
7755
7842
  ] }),
7756
- activeId === organization.id && /* @__PURE__ */ jsx56("span", { className: "ba-organization-active", children: t("organization.list.active") }),
7757
- /* @__PURE__ */ jsxs50("span", { className: "ba-organization-card-actions", children: [
7758
- activeId !== organization.id && /* @__PURE__ */ jsx56("button", { className: "ba-button ba-button-secondary", type: "button", disabled: pending, onClick: () => setActive(organization), children: t("organization.list.switch") }),
7759
- /* @__PURE__ */ jsx56("button", { className: "ba-link-button", type: "button", onClick: (event) => openProfile(organization, event.currentTarget), children: t("organization.list.manage") })
7843
+ activeId === organization.id && /* @__PURE__ */ jsx57("span", { className: "ba-organization-active", children: t("organization.list.active") }),
7844
+ /* @__PURE__ */ jsxs51("span", { className: "ba-organization-card-actions", children: [
7845
+ activeId !== organization.id && /* @__PURE__ */ jsx57("button", { className: "ba-button ba-button-secondary", type: "button", disabled: pending, onClick: () => setActive(organization), children: t("organization.list.switch") }),
7846
+ /* @__PURE__ */ jsx57("button", { className: "ba-link-button", type: "button", onClick: (event) => openProfile(organization, event.currentTarget), children: t("organization.list.manage") })
7760
7847
  ] })
7761
- ] }, organization.id)) }) : /* @__PURE__ */ jsx56("p", { className: "ba-muted", children: t("organization.list.empty") }),
7762
- /* @__PURE__ */ jsxs50("section", { className: "ba-organization-user-invitations", children: [
7763
- /* @__PURE__ */ jsxs50("header", { className: "ba-organization-section-header", children: [
7764
- /* @__PURE__ */ jsx56("h3", { className: "ba-title", children: t("organization.list.invitationsTitle") }),
7765
- /* @__PURE__ */ jsx56("p", { className: "ba-muted", children: t("organization.list.invitationsDescription") })
7848
+ ] }, organization.id)) }) : /* @__PURE__ */ jsx57("p", { className: "ba-muted", children: t("organization.list.empty") }),
7849
+ /* @__PURE__ */ jsxs51("section", { className: "ba-organization-user-invitations", children: [
7850
+ /* @__PURE__ */ jsxs51("header", { className: "ba-organization-section-header", children: [
7851
+ /* @__PURE__ */ jsx57("h3", { className: "ba-title", children: t("organization.list.invitationsTitle") }),
7852
+ /* @__PURE__ */ jsx57("p", { className: "ba-muted", children: t("organization.list.invitationsDescription") })
7766
7853
  ] }),
7767
- invitationError && /* @__PURE__ */ jsxs50("div", { className: "ba-inline-error", children: [
7768
- /* @__PURE__ */ jsx56(FormError, { children: invitationError }),
7769
- /* @__PURE__ */ jsx56("button", { className: "ba-link-button", type: "button", onClick: () => void loadInvitations(), children: t("organization.retry") })
7854
+ invitationError && /* @__PURE__ */ jsxs51("div", { className: "ba-inline-error", children: [
7855
+ /* @__PURE__ */ jsx57(FormError, { children: invitationError }),
7856
+ /* @__PURE__ */ jsx57("button", { className: "ba-link-button", type: "button", onClick: () => void loadInvitations(), children: t("organization.retry") })
7770
7857
  ] }),
7771
- invitations === null && !invitationError ? /* @__PURE__ */ jsx56("div", { className: "ba-skeleton" }) : invitations?.length ? /* @__PURE__ */ jsx56("ul", { className: "ba-organization-list", children: invitations.map((invitation) => /* @__PURE__ */ jsxs50("li", { className: "ba-organization-invitation", children: [
7772
- /* @__PURE__ */ jsxs50("span", { children: [
7773
- /* @__PURE__ */ jsx56("strong", { children: invitation.organizationName }),
7774
- /* @__PURE__ */ jsx56("small", { children: organizationRoleLabel(invitation.role, t) })
7858
+ invitations === null && !invitationError ? /* @__PURE__ */ jsx57("div", { className: "ba-skeleton" }) : invitations?.length ? /* @__PURE__ */ jsx57("ul", { className: "ba-organization-list", children: invitations.map((invitation) => /* @__PURE__ */ jsxs51("li", { className: "ba-organization-invitation", children: [
7859
+ /* @__PURE__ */ jsxs51("span", { children: [
7860
+ /* @__PURE__ */ jsx57("strong", { children: invitation.organizationName }),
7861
+ /* @__PURE__ */ jsx57("small", { children: organizationRoleLabel(invitation.role, t) })
7775
7862
  ] }),
7776
- /* @__PURE__ */ jsxs50("span", { className: "ba-organization-card-actions", children: [
7777
- /* @__PURE__ */ jsx56("button", { className: "ba-button", type: "button", disabled: pending, onClick: () => invitationAction(invitation, "accept"), children: t("organization.list.accept") }),
7778
- /* @__PURE__ */ jsx56("button", { className: "ba-link-button", type: "button", disabled: pending, onClick: () => invitationAction(invitation, "reject"), children: t("organization.list.reject") })
7863
+ /* @__PURE__ */ jsxs51("span", { className: "ba-organization-card-actions", children: [
7864
+ /* @__PURE__ */ jsx57("button", { className: "ba-button", type: "button", disabled: pending, onClick: () => invitationAction(invitation, "accept"), children: t("organization.list.accept") }),
7865
+ /* @__PURE__ */ jsx57("button", { className: "ba-link-button", type: "button", disabled: pending, onClick: () => invitationAction(invitation, "reject"), children: t("organization.list.reject") })
7779
7866
  ] })
7780
- ] }, invitation.id)) }) : /* @__PURE__ */ jsx56("p", { className: "ba-muted", children: t("organization.list.noInvitations") })
7867
+ ] }, invitation.id)) }) : /* @__PURE__ */ jsx57("p", { className: "ba-muted", children: t("organization.list.noInvitations") })
7781
7868
  ] })
7782
7869
  ] }),
7783
- dialog === "create" && /* @__PURE__ */ jsx56(OrganizationModal, { title: t("organization.create.title"), returnFocusRef: dialogReturnFocusRef, onClose: () => setDialog(null), children: /* @__PURE__ */ jsx56(CreateOrganization, { title: null, onCreated: () => {
7870
+ dialog === "create" && /* @__PURE__ */ jsx57(OrganizationModal, { title: t("organization.create.title"), returnFocusRef: dialogReturnFocusRef, onClose: () => setDialog(null), children: /* @__PURE__ */ jsx57(CreateOrganization, { title: null, onCreated: () => {
7784
7871
  void (async () => {
7785
7872
  await refresh();
7786
7873
  await session.refetch({ query: { disableCookieCache: true } });
7787
7874
  setDialog(null);
7788
7875
  })();
7789
7876
  } }) }),
7790
- dialog === "profile" && profileId && /* @__PURE__ */ jsx56(OrganizationModal, { title: t("organization.profile.title"), returnFocusRef: dialogReturnFocusRef, onClose: () => setDialog(null), children: /* @__PURE__ */ jsx56(OrganizationProfile, { organizationId: profileId, onDeleted: () => void afterProfileRemoval(), onLeft: () => void afterProfileRemoval() }) })
7877
+ dialog === "profile" && profileId && /* @__PURE__ */ jsx57(OrganizationModal, { title: t("organization.profile.title"), returnFocusRef: dialogReturnFocusRef, onClose: () => setDialog(null), children: /* @__PURE__ */ jsx57(OrganizationProfile, { organizationId: profileId, onDeleted: () => void afterProfileRemoval(), onLeft: () => void afterProfileRemoval() }) })
7791
7878
  ] });
7792
7879
  }
7793
7880
 
7794
7881
  // src/components/GoogleOneTap.tsx
7795
- import * as React51 from "react";
7882
+ import * as React52 from "react";
7796
7883
 
7797
7884
  // src/components/google-one-tap.ts
7798
7885
  var GOOGLE_IDENTITY_SCRIPT = "https://accounts.google.com/gsi/client";
@@ -7960,11 +8047,11 @@ function GoogleOneTap({
7960
8047
  const { config, isLoading: configLoading, isError: configError } = usePublicConfig();
7961
8048
  const { user, isLoaded: sessionLoaded } = useUser();
7962
8049
  const { signInSocial } = useSignIn();
7963
- const callbacks = React51.useRef({ onSignedIn, onSkipped, onDismissed, onError });
8050
+ const callbacks = React52.useRef({ onSignedIn, onSkipped, onDismissed, onError });
7964
8051
  callbacks.current = { onSignedIn, onSkipped, onDismissed, onError };
7965
8052
  const googleEnabled = config?.socialProviders.includes("google") === true;
7966
8053
  const clientId = config?.socialProviderClientIds?.google;
7967
- React51.useEffect(() => {
8054
+ React52.useEffect(() => {
7968
8055
  if (configLoading || !sessionLoaded) return;
7969
8056
  if (disabled) {
7970
8057
  callbacks.current.onSkipped?.("disabled");
@@ -8086,6 +8173,7 @@ export {
8086
8173
  AuthLoaded,
8087
8174
  AuthLoading,
8088
8175
  AuthOwlBadge,
8176
+ AuthOwlBranding,
8089
8177
  AuthOwlError,
8090
8178
  AuthOwlProvider,
8091
8179
  BackupCodesManager,