@sylphx/auth-solid 0.1.2 → 0.1.4

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/browser.js CHANGED
@@ -1,9 +1,18 @@
1
1
  import { addEventListener as e, className as t, createComponent as n, delegateEvents as r, effect as i, getNextElement as a, getNextMarker as o, insert as s, memo as c, runHydrationEvents as l, setAttribute as u, setProperty as d, style as f, template as p, use as m } from "solid-js/web";
2
2
  import { authRoutePrefix as h, providerDestination as g, providers as _, safeReturnTo as v } from "@sylphx/auth/client";
3
- import { For as y, Match as b, Show as x, Switch as S, createEffect as ee, createMemo as C, createSignal as w, createUniqueId as T, onCleanup as E, onMount as te } from "solid-js";
3
+ import { For as y, Match as b, Show as x, Switch as S, createEffect as C, createMemo as w, createSignal as T, createUniqueId as E, onCleanup as D, onMount as ee } from "solid-js";
4
4
  // src/messages.ts
5
- var D = {
5
+ var O = {
6
6
  en: {
7
+ lastUsed: "Last used",
8
+ forgotPassword: "Forgot your password?",
9
+ recoverAccount: "Reset your password",
10
+ recoverDescription: "Enter the email address for your account.",
11
+ sendResetLink: "Send reset link",
12
+ recoverySent: "Check your inbox",
13
+ recoverySentDescription: "If an account exists for this address, you’ll receive a password reset link.",
14
+ addPasskey: "Add a passkey",
15
+ passkeyAdded: "Passkey added",
7
16
  signIn: "Sign in",
8
17
  enterPassword: "Enter your password",
9
18
  createYourAccount: "Create your account",
@@ -72,6 +81,15 @@ var D = {
72
81
  }
73
82
  },
74
83
  "zh-Hant-HK": {
84
+ lastUsed: "上次使用",
85
+ forgotPassword: "忘記密碼?",
86
+ recoverAccount: "重設密碼",
87
+ recoverDescription: "請輸入帳戶的電郵地址。",
88
+ sendResetLink: "傳送重設連結",
89
+ recoverySent: "查閱收件箱",
90
+ recoverySentDescription: "如這個電郵地址已連結帳戶,你將收到密碼重設連結。",
91
+ addPasskey: "新增通行密鑰",
92
+ passkeyAdded: "已新增通行密鑰",
75
93
  signIn: "登入",
76
94
  enterPassword: "輸入密碼",
77
95
  createYourAccount: "建立帳戶",
@@ -140,6 +158,15 @@ var D = {
140
158
  }
141
159
  },
142
160
  "zh-Hant-TW": {
161
+ lastUsed: "上次使用",
162
+ forgotPassword: "忘記密碼?",
163
+ recoverAccount: "重設密碼",
164
+ recoverDescription: "請輸入帳戶的電子郵件地址。",
165
+ sendResetLink: "傳送重設連結",
166
+ recoverySent: "查看收件匣",
167
+ recoverySentDescription: "如果這個電子郵件地址已連結帳戶,你會收到密碼重設連結。",
168
+ addPasskey: "新增通行密鑰",
169
+ passkeyAdded: "已新增通行密鑰",
143
170
  signIn: "登入",
144
171
  enterPassword: "輸入密碼",
145
172
  createYourAccount: "建立帳號",
@@ -208,6 +235,15 @@ var D = {
208
235
  }
209
236
  },
210
237
  "zh-Hans": {
238
+ lastUsed: "上次使用",
239
+ forgotPassword: "忘记密码?",
240
+ recoverAccount: "重置密码",
241
+ recoverDescription: "请输入账户的电子邮箱。",
242
+ sendResetLink: "发送重置链接",
243
+ recoverySent: "查看收件箱",
244
+ recoverySentDescription: "如果此邮箱关联了账户,你将收到密码重置链接。",
245
+ addPasskey: "添加通行密钥",
246
+ passkeyAdded: "已添加通行密钥",
211
247
  signIn: "登录",
212
248
  enterPassword: "输入密码",
213
249
  createYourAccount: "创建账号",
@@ -276,6 +312,15 @@ var D = {
276
312
  }
277
313
  },
278
314
  ja: {
315
+ lastUsed: "前回使用",
316
+ forgotPassword: "パスワードをお忘れですか?",
317
+ recoverAccount: "パスワードを再設定",
318
+ recoverDescription: "アカウントのメールアドレスを入力してください。",
319
+ sendResetLink: "再設定リンクを送信",
320
+ recoverySent: "メールを確認",
321
+ recoverySentDescription: "該当するアカウントがある場合、再設定リンクが届きます。",
322
+ addPasskey: "パスキーを追加",
323
+ passkeyAdded: "パスキーを追加しました",
279
324
  signIn: "ログイン",
280
325
  enterPassword: "パスワードを入力",
281
326
  createYourAccount: "アカウントを作成",
@@ -344,6 +389,15 @@ var D = {
344
389
  }
345
390
  },
346
391
  ko: {
392
+ lastUsed: "최근 사용",
393
+ forgotPassword: "비밀번호를 잊으셨나요?",
394
+ recoverAccount: "비밀번호 재설정",
395
+ recoverDescription: "계정의 이메일 주소를 입력하세요.",
396
+ sendResetLink: "재설정 링크 보내기",
397
+ recoverySent: "받은편지함을 확인하세요",
398
+ recoverySentDescription: "이 주소에 연결된 계정이 있다면 비밀번호 재설정 링크가 전송됩니다.",
399
+ addPasskey: "패스키 추가",
400
+ passkeyAdded: "패스키가 추가되었습니다",
347
401
  signIn: "로그인",
348
402
  enterPassword: "비밀번호를 입력하세요",
349
403
  createYourAccount: "계정 만들기",
@@ -410,16 +464,183 @@ var D = {
410
464
  try_later: "시도 횟수가 너무 많습니다. 잠시 후 다시 시도하세요.",
411
465
  unavailable: "연결하지 못했습니다. 잠시 후 다시 시도하세요."
412
466
  }
467
+ },
468
+ es: {
469
+ lastUsed: "Último método usado",
470
+ forgotPassword: "¿Olvidaste tu contraseña?",
471
+ recoverAccount: "Restablece tu contraseña",
472
+ recoverDescription: "Introduce el correo de tu cuenta.",
473
+ sendResetLink: "Enviar enlace de recuperación",
474
+ recoverySent: "Revisa tu bandeja de entrada",
475
+ recoverySentDescription: "Si hay una cuenta asociada a este correo, recibirás un enlace para restablecer la contraseña.",
476
+ addPasskey: "Añadir una llave de acceso",
477
+ passkeyAdded: "Llave de acceso añadida",
478
+ signIn: "Inicia sesión",
479
+ enterPassword: "Introduce tu contraseña",
480
+ createYourAccount: "Crea tu cuenta",
481
+ checkInbox: "Revisa tu bandeja de entrada",
482
+ confirmEmail: "Confirma tu correo electrónico",
483
+ verifyIdentity: "Verifica tu identidad",
484
+ chooseMethod: "Elige cómo quieres iniciar sesión.",
485
+ startWithEmail: "Usa tu correo electrónico para empezar.",
486
+ checkEmailDescription: "Si esta dirección es nueva, te enviaremos un enlace de confirmación. Ábrelo e introduce la contraseña que elegiste.",
487
+ confirmEmailDescription: "Introduce el correo y la contraseña que usaste para registrarte.",
488
+ enterEmailCode: (e) => `Introduce el código de seis dígitos que enviamos a ${e}.`,
489
+ enterRecovery: "Introduce uno de tus códigos de recuperación guardados.",
490
+ enterAuthenticator: "Introduce el código de tu aplicación de autenticación.",
491
+ loading: "Cargando opciones de acceso…",
492
+ retry: "Volver a intentar",
493
+ openingProvider: (e) => `Abriendo ${e}…`,
494
+ continueProvider: (e) => `Continuar con ${e}`,
495
+ orEmail: "o usa tu correo electrónico",
496
+ email: "Correo electrónico",
497
+ sendingCode: "Enviando el código…",
498
+ emailCodeAction: "Enviarme un código",
499
+ continueEmail: "Continuar con correo electrónico",
500
+ waitingPasskey: "Esperando tu llave de acceso…",
501
+ usePasskey: "Usar una llave de acceso",
502
+ newHere: "¿No tienes cuenta?",
503
+ createAnAccount: "Crea una cuenta",
504
+ noMethods: "No hay métodos de inicio de sesión disponibles ahora.",
505
+ password: "Contraseña",
506
+ hidePassword: "Ocultar contraseña",
507
+ showPassword: "Mostrar contraseña",
508
+ hide: "Ocultar",
509
+ show: "Mostrar",
510
+ minimumPassword: "Usa al menos 12 caracteres.",
511
+ working: "Un momento…",
512
+ createAccount: "Crear cuenta",
513
+ confirmAndSignIn: "Confirmar e iniciar sesión",
514
+ changeEmailOrMethod: "Cambiar de correo o método de acceso",
515
+ backToSignIn: "Volver al inicio de sesión",
516
+ emailCode: "Código de correo electrónico",
517
+ checkingCode: "Comprobando el código…",
518
+ verifyCode: "Verificar código",
519
+ resendIn: (e) => `Reenviar en ${e}`,
520
+ resendCode: "Reenviar código",
521
+ changeEmail: "Cambiar de correo",
522
+ usePassword: "Usar contraseña",
523
+ recoveryCode: "Código de recuperación",
524
+ authenticatorCode: "Código de autenticación",
525
+ verifyAndSignIn: "Verificar e iniciar sesión",
526
+ useAuthenticator: "Usar la aplicación de autenticación",
527
+ useRecovery: "Usar un código de recuperación",
528
+ language: "Idioma",
529
+ errors: {
530
+ signin: "No se completó el inicio de sesión. Inténtalo de nuevo o elige otro método.",
531
+ cancelled: "Se canceló el inicio de sesión. Puedes volver a intentarlo cuando quieras.",
532
+ use_existing: "Usa el método con el que iniciaste sesión la primera vez. Este proveedor no pudo confirmar tu correo.",
533
+ invalid_credentials: "El correo y la contraseña no coinciden. Comprueba ambos e inténtalo de nuevo.",
534
+ acceptance_required: "Acepta las condiciones vigentes para continuar.",
535
+ verify_email: "Confirma tu correo con el enlace de tu bandeja de entrada antes de iniciar sesión.",
536
+ verification_failed: "No se pudo usar este enlace de confirmación. Comprueba que abriste el más reciente.",
537
+ invalid_code: "El código no es válido. Revísalo e inténtalo de nuevo.",
538
+ method_unavailable: "Este método no está disponible ahora. Prueba otro.",
539
+ signup_failed: "No pudimos iniciar el registro. Comprueba tus datos e inténtalo de nuevo.",
540
+ invalid_input: "Comprueba tus datos e inténtalo de nuevo.",
541
+ try_later: "Demasiados intentos. Espera un momento antes de volver a intentarlo.",
542
+ unavailable: "No pudimos conectarnos. Inténtalo de nuevo en un momento."
543
+ }
544
+ },
545
+ "pt-BR": {
546
+ lastUsed: "Último método usado",
547
+ forgotPassword: "Esqueceu sua senha?",
548
+ recoverAccount: "Redefina sua senha",
549
+ recoverDescription: "Digite o e-mail da sua conta.",
550
+ sendResetLink: "Enviar link de redefinição",
551
+ recoverySent: "Confira sua caixa de entrada",
552
+ recoverySentDescription: "Se houver uma conta com esse e-mail, você receberá um link para redefinir a senha.",
553
+ addPasskey: "Adicionar uma chave de acesso",
554
+ passkeyAdded: "Chave de acesso adicionada",
555
+ signIn: "Entrar",
556
+ enterPassword: "Digite sua senha",
557
+ createYourAccount: "Crie sua conta",
558
+ checkInbox: "Confira sua caixa de entrada",
559
+ confirmEmail: "Confirme seu e-mail",
560
+ verifyIdentity: "Confirme que é você",
561
+ chooseMethod: "Escolha como você quer entrar.",
562
+ startWithEmail: "Use seu e-mail para começar.",
563
+ checkEmailDescription: "Se este endereço for novo, enviaremos um link de confirmação. Abra o link e digite a senha que você escolheu.",
564
+ confirmEmailDescription: "Digite o e-mail e a senha que você usou no cadastro.",
565
+ enterEmailCode: (e) => `Digite o código de seis dígitos que enviamos para ${e}.`,
566
+ enterRecovery: "Digite um dos códigos de recuperação que você guardou.",
567
+ enterAuthenticator: "Digite o código do seu aplicativo autenticador.",
568
+ loading: "Carregando opções de login…",
569
+ retry: "Tentar novamente",
570
+ openingProvider: (e) => `Abrindo ${e}…`,
571
+ continueProvider: (e) => `Continuar com ${e}`,
572
+ orEmail: "ou use seu e-mail",
573
+ email: "Endereço de e-mail",
574
+ sendingCode: "Enviando código…",
575
+ emailCodeAction: "Enviar um código por e-mail",
576
+ continueEmail: "Continuar com e-mail",
577
+ waitingPasskey: "Aguardando sua chave de acesso…",
578
+ usePasskey: "Usar uma chave de acesso",
579
+ newHere: "Ainda não tem conta?",
580
+ createAnAccount: "Crie uma conta",
581
+ noMethods: "Nenhum método de login está disponível no momento.",
582
+ password: "Senha",
583
+ hidePassword: "Ocultar senha",
584
+ showPassword: "Mostrar senha",
585
+ hide: "Ocultar",
586
+ show: "Mostrar",
587
+ minimumPassword: "Use pelo menos 12 caracteres.",
588
+ working: "Aguarde…",
589
+ createAccount: "Criar conta",
590
+ confirmAndSignIn: "Confirmar e entrar",
591
+ changeEmailOrMethod: "Trocar e-mail ou método de login",
592
+ backToSignIn: "Voltar para o login",
593
+ emailCode: "Código por e-mail",
594
+ checkingCode: "Verificando código…",
595
+ verifyCode: "Verificar código",
596
+ resendIn: (e) => `Reenviar em ${e}`,
597
+ resendCode: "Reenviar código",
598
+ changeEmail: "Trocar e-mail",
599
+ usePassword: "Usar senha",
600
+ recoveryCode: "Código de recuperação",
601
+ authenticatorCode: "Código do autenticador",
602
+ verifyAndSignIn: "Verificar e entrar",
603
+ useAuthenticator: "Usar o aplicativo autenticador",
604
+ useRecovery: "Usar um código de recuperação",
605
+ language: "Idioma",
606
+ errors: {
607
+ signin: "Não foi possível concluir o login. Tente novamente ou escolha outro método.",
608
+ cancelled: "O login foi cancelado. Você pode tentar novamente quando quiser.",
609
+ use_existing: "Use o método com o qual você entrou pela primeira vez. Este provedor não conseguiu confirmar seu e-mail.",
610
+ invalid_credentials: "O e-mail e a senha não correspondem. Confira os dois e tente novamente.",
611
+ acceptance_required: "Aceite os termos atuais para continuar.",
612
+ verify_email: "Antes de entrar, confirme seu e-mail pelo link na sua caixa de entrada.",
613
+ verification_failed: "Não foi possível usar este link de confirmação. Confira se você abriu o mais recente.",
614
+ invalid_code: "O código não funcionou. Confira e tente novamente.",
615
+ method_unavailable: "Este método de login não está disponível no momento. Tente outro.",
616
+ signup_failed: "Não foi possível iniciar o cadastro. Confira seus dados e tente novamente.",
617
+ invalid_input: "Confira seus dados e tente novamente.",
618
+ try_later: "Muitas tentativas. Aguarde um momento e tente novamente.",
619
+ unavailable: "Não foi possível conectar. Tente novamente em instantes."
620
+ }
413
621
  }
414
- }, ne = {
622
+ }, k = {
415
623
  en: "English",
416
624
  "zh-Hant-HK": "繁體中文(香港)",
417
625
  "zh-Hant-TW": "繁體中文(台灣)",
418
626
  "zh-Hans": "简体中文",
419
627
  ja: "日本語",
420
- ko: "한국어"
628
+ ko: "한국어",
629
+ es: "Español",
630
+ "pt-BR": "Português (Brasil)"
421
631
  };
422
- function O(e) {
632
+ function A(e, t) {
633
+ let n = O[e];
634
+ return t ? {
635
+ ...n,
636
+ ...t,
637
+ errors: {
638
+ ...n.errors,
639
+ ...t.errors
640
+ }
641
+ } : n;
642
+ }
643
+ function j(e) {
423
644
  for (let t of e) {
424
645
  let e;
425
646
  try {
@@ -427,8 +648,8 @@ function O(e) {
427
648
  } catch {
428
649
  continue;
429
650
  }
430
- if (Object.hasOwn(D, e.baseName)) return e.baseName;
431
- if (e.language === "en" || e.language === "ja" || e.language === "ko") return e.language;
651
+ if (Object.hasOwn(O, e.baseName)) return e.baseName;
652
+ if (e.language === "en" || e.language === "ja" || e.language === "ko" || e.language === "es") return e.language;
432
653
  if (e.language === "zh") {
433
654
  let t = e.maximize().script;
434
655
  if (t === "Hans") return "zh-Hans";
@@ -437,58 +658,186 @@ function O(e) {
437
658
  }
438
659
  return "en";
439
660
  }
440
- function k(e) {
661
+ function M(e) {
441
662
  return new Intl.NumberFormat(e, {
442
663
  style: "unit",
443
664
  unit: "second",
444
665
  unitDisplay: "short"
445
666
  });
446
667
  }
447
- // src/provider-icons.tsx
448
- var A = /*#__PURE__*/ p("<svg aria-hidden=true viewBox=\"0 0 24 24\"fill=currentColor width=19 height=19><path d=\"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z\"fill=#4285F4></path><path d=\"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z\"fill=#34A853></path><path d=\"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z\"fill=#FBBC05></path><path d=\"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z\"fill=#EA4335>"), re = /*#__PURE__*/ p("<svg aria-hidden=true viewBox=\"0 0 24 24\"fill=currentColor width=19 height=19><path d=\"M12 0C5.37 0 0 5.37 0 12c0 5.31 3.435 9.795 8.205 11.385.6.105.825-.255.825-.57 0-.285-.015-1.23-.015-2.235-3.015.555-3.795-.735-4.035-1.41-.135-.345-.72-1.41-1.23-1.695-.42-.225-1.02-.78-.015-.795.945-.015 1.62.87 1.845 1.23 1.08 1.815 2.805 1.305 3.495.99.105-.78.42-1.305.765-1.605-2.67-.3-5.46-1.335-5.46-5.925 0-1.305.465-2.385 1.23-3.225-.12-.3-.54-1.53.12-3.18 0 0 1.005-.315 3.3 1.23.96-.27 1.98-.405 3-.405s2.04.135 3 .405c2.295-1.56 3.3-1.23 3.3-1.23.66 1.65.24 2.88.12 3.18.765.84 1.23 1.905 1.23 3.225 0 4.605-2.805 5.625-5.475 5.925.435.375.81 1.095.81 2.22 0 1.605-.015 2.895-.015 3.3 0 .315.225.69.825.57A12.02 12.02 0 0024 12c0-6.63-5.37-12-12-12z\">"), ie = /*#__PURE__*/ p("<svg aria-hidden=true viewBox=\"0 0 24 24\"fill=currentColor width=19 height=19><path d=\"M12.152 6.896c-.948 0-2.415-1.078-3.96-1.04-2.04.027-3.91 1.183-4.961 3.014-2.117 3.675-.546 9.103 1.519 12.09 1.013 1.454 2.208 3.09 3.792 3.039 1.52-.065 2.09-.987 3.935-.987 1.831 0 2.35.987 3.96.948 1.637-.026 2.676-1.48 3.676-2.948 1.156-1.688 1.636-3.325 1.662-3.415-.039-.013-3.182-1.221-3.22-4.857-.026-3.04 2.48-4.494 2.597-4.559-1.429-2.09-3.623-2.324-4.39-2.376-2-.156-3.675 1.09-4.61 1.09zM15.53 3.83c.843-1.012 1.4-2.427 1.245-3.83-1.207.052-2.662.805-3.532 1.818-.78.896-1.454 2.338-1.273 3.714 1.338.104 2.715-.688 3.559-1.701\">"), j = /*#__PURE__*/ p("<svg aria-hidden=true viewBox=\"0 0 24 24\"fill=currentColor width=19 height=19><path d=\"M0 0h11.377v11.372H0zm12.623 0H24v11.372H12.623zM0 12.623h11.377V24H0zm12.623 0H24V24H12.623\"fill=#00A4EF>"), M = /*#__PURE__*/ p("<svg aria-hidden=true viewBox=\"0 0 24 24\"fill=currentColor width=19 height=19><path d=\"M24 12.073c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.99 4.388 10.954 10.125 11.854v-8.385H7.078v-3.47h3.047V9.43c0-3.007 1.792-4.669 4.533-4.669 1.312 0 2.686.235 2.686.235v2.953H15.83c-1.491 0-1.956.925-1.956 1.874v2.25h3.328l-.532 3.47h-2.796v8.385C19.612 23.027 24 18.062 24 12.073z\">");
449
- function N() {
450
- return a(A);
451
- }
452
- function P() {
453
- return a(re);
454
- }
455
- function F() {
456
- return a(ie);
457
- }
458
- function ae() {
459
- return a(j);
460
- }
461
- function I() {
462
- return a(M);
668
+ // src/sign-in-messages.ts
669
+ function te(e, t, n) {
670
+ if (t !== void 0 && n !== void 0) try {
671
+ return new Intl.Locale(t).toString();
672
+ } catch {}
673
+ return e;
463
674
  }
464
- // src/sign-in-controller.ts
465
- var oe = D.en.errors;
466
- oe.unavailable;
467
- function L(e) {
468
- return typeof e == "string" && Object.hasOwn(oe, e);
675
+ // src/sign-in-request.ts
676
+ var N = O.en.errors;
677
+ N.unavailable;
678
+ function ne(e) {
679
+ return typeof e == "string" && Object.hasOwn(N, e);
469
680
  }
470
- var se = class extends Error {
681
+ var P = class extends Error {
471
682
  code;
472
683
  constructor(e) {
473
684
  super(e), this.code = e;
474
685
  }
475
686
  };
476
- function ce(e) {
687
+ async function F(e, t, n) {
688
+ n.throwIfAborted();
689
+ let r = await fetch(e, {
690
+ method: "POST",
691
+ headers: { "Content-Type": "application/json" },
692
+ credentials: "same-origin",
693
+ referrerPolicy: "origin",
694
+ redirect: "error",
695
+ signal: AbortSignal.any([n, AbortSignal.timeout(45e3)]),
696
+ body: JSON.stringify(t)
697
+ }), i = await r.json();
698
+ if (!r.ok) {
699
+ let e = i && typeof i == "object" && "error" in i ? i.error : void 0;
700
+ throw new P(ne(e) ? e : "unavailable");
701
+ }
702
+ return i;
703
+ }
704
+ // src/sign-in-webauthn.ts
705
+ function I(e) {
477
706
  return Uint8Array.from(atob(e.replace(/-/g, "+").replace(/_/g, "/")), (e) => e.charCodeAt(0));
478
707
  }
479
- function R(e) {
480
- return btoa(String.fromCharCode(...new Uint8Array(e))).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
708
+ function L(e) {
709
+ return btoa(Array.from(new Uint8Array(e), (e) => String.fromCharCode(e)).join("")).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
710
+ }
711
+ // src/passkey-enroll.tsx
712
+ var re = /*#__PURE__*/ p("<output>"), R = /*#__PURE__*/ p("<div><button type=button></button><!$><!/><!$><!/>"), ie = /*#__PURE__*/ p("<p role=alert>");
713
+ function z(e, t) {
714
+ if (!e || typeof e != "object") throw Error();
715
+ let { challenge: n, challengeId: r, rpId: i, userId: a, userName: o, algorithms: s } = e, c = /^[A-Za-z0-9_-]+$/;
716
+ if (typeof n != "string" || !c.test(n) || typeof r != "string" || !r || i !== t || typeof a != "string" || !c.test(a) || typeof o != "string" || !o || !Array.isArray(s) || !s.length || !s.every(Number.isSafeInteger)) throw Error();
717
+ return {
718
+ challengeId: r,
719
+ publicKey: {
720
+ challenge: I(n),
721
+ rp: {
722
+ id: i,
723
+ name: i
724
+ },
725
+ user: {
726
+ id: I(a),
727
+ name: o,
728
+ displayName: o
729
+ },
730
+ pubKeyCredParams: s.map((e) => ({
731
+ type: "public-key",
732
+ alg: e
733
+ })),
734
+ authenticatorSelection: {
735
+ residentKey: "required",
736
+ userVerification: "required"
737
+ },
738
+ attestation: "none",
739
+ timeout: 6e4
740
+ }
741
+ };
742
+ }
743
+ function ae(e) {
744
+ let r = `${h(e.routePrefix)}/passkey/enroll`, f = new AbortController(), [p, m] = T(!1), [g, _] = T(!1), [v, y] = T(!1), [b, S] = T(), C = () => j(e.locale ? [e.locale] : []), E = w(() => A(C(), e.messages));
745
+ ee(() => m(window.isSecureContext && typeof PublicKeyCredential < "u")), D(() => f.abort());
746
+ async function O() {
747
+ if (!g() && p() && e.enabled && !f.signal.aborted) {
748
+ _(!0), S(void 0), y(!1);
749
+ try {
750
+ let t = await F(r, { action: "begin" }, f.signal);
751
+ if (f.signal.throwIfAborted(), !e.enabled) return;
752
+ let { challengeId: n, publicKey: i } = z(t, window.location.hostname), a = await navigator.credentials.create({
753
+ publicKey: i,
754
+ signal: f.signal
755
+ });
756
+ if (!e.enabled || f.signal.aborted) return;
757
+ if (!(a instanceof PublicKeyCredential) || !(a.response instanceof AuthenticatorAttestationResponse)) throw Error();
758
+ let o = a.response, s = await F(r, {
759
+ action: "verify",
760
+ challenge_id: n,
761
+ credential_id: L(a.rawId),
762
+ client_data_json: L(o.clientDataJSON),
763
+ attestation_object: L(o.attestationObject),
764
+ transports: o.getTransports?.() ?? []
765
+ }, f.signal);
766
+ if (!s || typeof s != "object" || !("enrolled" in s) || s.enrolled !== !0) throw Error();
767
+ f.signal.aborted || y(!0);
768
+ } catch (e) {
769
+ f.signal.aborted || S(e instanceof P ? e.code : "method_unavailable");
770
+ } finally {
771
+ f.signal.aborted || _(!1);
772
+ }
773
+ }
774
+ }
775
+ return n(x, {
776
+ get when() {
777
+ return c(() => !!p())() && e.enabled;
778
+ },
779
+ get children() {
780
+ var r = a(R), f = r.firstChild, p = f.nextSibling, [m, h] = o(p.nextSibling), _ = m.nextSibling, [y, S] = o(_.nextSibling);
781
+ return f.$$click = () => void O(), s(f, (() => {
782
+ var e = c(() => !!g());
783
+ return () => e() ? E().working : E().addPasskey;
784
+ })()), s(r, n(x, {
785
+ get when() {
786
+ return b();
787
+ },
788
+ children: (e) => (() => {
789
+ var t = a(ie);
790
+ return s(t, () => E().errors[e()]), t;
791
+ })()
792
+ }), m, h), s(r, n(x, {
793
+ get when() {
794
+ return v();
795
+ },
796
+ get children() {
797
+ var e = a(re);
798
+ return s(e, () => E().passkeyAdded), e;
799
+ }
800
+ }), y, S), i((n) => {
801
+ var i = te(C(), e.locale, e.messages), a = e.class ?? "auth-sign-in-secondary", o = g();
802
+ return i !== n.e && u(r, "lang", n.e = i), a !== n.t && t(f, n.t = a), o !== n.a && d(f, "disabled", n.a = o), n;
803
+ }, {
804
+ e: void 0,
805
+ t: void 0,
806
+ a: void 0
807
+ }), l(), r;
808
+ }
809
+ });
810
+ }
811
+ r(["click"]);
812
+ // src/provider-icons.tsx
813
+ var B = /*#__PURE__*/ p("<svg aria-hidden=true viewBox=\"0 0 24 24\"fill=currentColor width=19 height=19><path d=\"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z\"fill=#4285F4></path><path d=\"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z\"fill=#34A853></path><path d=\"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z\"fill=#FBBC05></path><path d=\"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z\"fill=#EA4335>"), oe = /*#__PURE__*/ p("<svg aria-hidden=true viewBox=\"0 0 24 24\"fill=currentColor width=19 height=19><path d=\"M12 0C5.37 0 0 5.37 0 12c0 5.31 3.435 9.795 8.205 11.385.6.105.825-.255.825-.57 0-.285-.015-1.23-.015-2.235-3.015.555-3.795-.735-4.035-1.41-.135-.345-.72-1.41-1.23-1.695-.42-.225-1.02-.78-.015-.795.945-.015 1.62.87 1.845 1.23 1.08 1.815 2.805 1.305 3.495.99.105-.78.42-1.305.765-1.605-2.67-.3-5.46-1.335-5.46-5.925 0-1.305.465-2.385 1.23-3.225-.12-.3-.54-1.53.12-3.18 0 0 1.005-.315 3.3 1.23.96-.27 1.98-.405 3-.405s2.04.135 3 .405c2.295-1.56 3.3-1.23 3.3-1.23.66 1.65.24 2.88.12 3.18.765.84 1.23 1.905 1.23 3.225 0 4.605-2.805 5.625-5.475 5.925.435.375.81 1.095.81 2.22 0 1.605-.015 2.895-.015 3.3 0 .315.225.69.825.57A12.02 12.02 0 0024 12c0-6.63-5.37-12-12-12z\">"), se = /*#__PURE__*/ p("<svg aria-hidden=true viewBox=\"0 0 24 24\"fill=currentColor width=19 height=19><path d=\"M12.152 6.896c-.948 0-2.415-1.078-3.96-1.04-2.04.027-3.91 1.183-4.961 3.014-2.117 3.675-.546 9.103 1.519 12.09 1.013 1.454 2.208 3.09 3.792 3.039 1.52-.065 2.09-.987 3.935-.987 1.831 0 2.35.987 3.96.948 1.637-.026 2.676-1.48 3.676-2.948 1.156-1.688 1.636-3.325 1.662-3.415-.039-.013-3.182-1.221-3.22-4.857-.026-3.04 2.48-4.494 2.597-4.559-1.429-2.09-3.623-2.324-4.39-2.376-2-.156-3.675 1.09-4.61 1.09zM15.53 3.83c.843-1.012 1.4-2.427 1.245-3.83-1.207.052-2.662.805-3.532 1.818-.78.896-1.454 2.338-1.273 3.714 1.338.104 2.715-.688 3.559-1.701\">"), ce = /*#__PURE__*/ p("<svg aria-hidden=true viewBox=\"0 0 24 24\"fill=currentColor width=19 height=19><path d=\"M0 0h11.377v11.372H0zm12.623 0H24v11.372H12.623zM0 12.623h11.377V24H0zm12.623 0H24V24H12.623\"fill=#00A4EF>"), le = /*#__PURE__*/ p("<svg aria-hidden=true viewBox=\"0 0 24 24\"fill=currentColor width=19 height=19><path d=\"M24 12.073c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.99 4.388 10.954 10.125 11.854v-8.385H7.078v-3.47h3.047V9.43c0-3.007 1.792-4.669 4.533-4.669 1.312 0 2.686.235 2.686.235v2.953H15.83c-1.491 0-1.956.925-1.956 1.874v2.25h3.328l-.532 3.47h-2.796v8.385C19.612 23.027 24 18.062 24 12.073z\">");
814
+ function ue() {
815
+ return a(B);
816
+ }
817
+ function de() {
818
+ return a(oe);
819
+ }
820
+ function V() {
821
+ return a(se);
481
822
  }
482
- function z(e) {
483
- let t = new URLSearchParams(e.search), n = v(e.next), r = h(e.routePrefix), i = v(e.loginPath, "/login").split(/[?#]/, 1)[0], a = t.get("challenge_id"), o = t.get("token"), s = !!a && !!o && t.get("type") === "email_verification", [c, l] = w(e.initialConfig), [u, d] = w(!1), [f, p] = w("choose"), [m, y] = w(""), b = t.get("error"), [x, S] = w(L(b) ? b : ""), C = () => {
823
+ function fe() {
824
+ return a(ce);
825
+ }
826
+ function H() {
827
+ return a(le);
828
+ }
829
+ // src/sign-in-controller.ts
830
+ var pe = O.en.errors;
831
+ function me(e) {
832
+ let t = new URLSearchParams(e.search), n = v(e.next), r = h(e.routePrefix), i = v(e.loginPath, "/login").split(/[?#]/, 1)[0], a = t.get("challenge_id"), o = t.get("token"), s = !!a && !!o && t.get("type") === "email_verification", [c, l] = T(e.initialConfig), [u, d] = T(!1), [f, p] = T("choose"), [m, y] = T(""), b = t.get("error"), [x, S] = T(ne(b) ? b : ""), w = () => {
484
833
  let e = x();
485
- return e ? oe[e] : "";
486
- }, [T, D] = w(""), [ne, O] = w(!1), [k, A] = w(!1), [re, ie] = w(!1), j, M = !1, [N, P] = w(""), [F, ae] = w(""), [I, z] = w(""), [B, le] = w(!1), [ue, V] = w(!1), [de, H] = w(0), [fe, pe] = w(0), me = () => Math.max(0, Math.ceil((de() - fe()) / 1e3)), he, U = new AbortController();
487
- async function ge() {
834
+ return e ? pe[e] : "";
835
+ }, [E, O] = T(""), k = () => !e.requireAgreement || e.agreementAccepted === !0, [A, j] = T(!1), [M, te] = T(!1), [N, re] = T(!1), R, ie = !1, [z, ae] = T(""), [B, oe] = T(""), [se, ce] = T(""), [le, ue] = T(!1), [de, V] = T(!1), [fe, H] = T(0), [me, he] = T(0), ge = () => Math.max(0, Math.ceil((fe() - me()) / 1e3)), _e, U = new AbortController();
836
+ async function ve() {
488
837
  if (U.signal.aborted) return;
489
- d(!1), l(void 0), he?.abort();
838
+ d(!1), l(void 0), _e?.abort();
490
839
  let e = new AbortController();
491
- he = e;
840
+ _e = e;
492
841
  try {
493
842
  let t = await fetch(`${r}/config`, {
494
843
  referrerPolicy: "origin",
@@ -502,48 +851,36 @@ function z(e) {
502
851
  n.signup,
503
852
  n.otp,
504
853
  n.passkey
505
- ].some((e) => typeof e != "boolean")) throw Error();
854
+ ].some((e) => typeof e != "boolean") || [n.recovery, n.passkeyEnrollment].some((e) => e !== void 0 && typeof e != "boolean")) throw Error();
506
855
  e.signal.aborted || l(n);
507
856
  } catch {
508
857
  !e.signal.aborted && !U.signal.aborted && d(!0);
509
858
  }
510
859
  }
511
- te(() => {
512
- A(window.isSecureContext && typeof PublicKeyCredential < "u"), s && (p("confirm"), window.history.replaceState(window.history.state, "", `${i}?${new URLSearchParams({ next: n })}`)), c() || ge(), e.conditionalPasskey && k() && PublicKeyCredential.isConditionalMediationAvailable?.().then((e) => {
513
- U.signal.aborted || ie(e);
860
+ ee(() => {
861
+ te(window.isSecureContext && typeof PublicKeyCredential < "u"), s && (p("confirm"), window.history.replaceState(window.history.state, "", `${i}?${new URLSearchParams({ next: n })}`)), c() || ve(), e.conditionalPasskey && M() && PublicKeyCredential.isConditionalMediationAvailable?.().then((e) => {
862
+ U.signal.aborted || re(e);
514
863
  }).catch(() => void 0);
515
- let t = window.setInterval(() => pe(Date.now()), 1e3);
516
- E(() => {
517
- window.clearInterval(t), he?.abort(), W(), U.abort();
864
+ let t = window.setInterval(() => he(Date.now()), 1e3);
865
+ D(() => {
866
+ window.clearInterval(t), _e?.abort(), ye(), U.abort();
518
867
  });
519
868
  });
520
- function W() {
521
- j?.abort(), j = void 0;
869
+ function ye() {
870
+ R?.abort(), R = void 0;
522
871
  }
523
- function G(e) {
524
- e !== "choose" && W(), S(""), O(!1), p(e);
872
+ function W(e) {
873
+ e !== "choose" && ye(), S(""), j(!1), p(e);
525
874
  }
526
- async function _e(t, n, r = U.signal) {
527
- let i = await fetch(t, {
528
- method: "POST",
529
- headers: { "Content-Type": "application/json" },
530
- referrerPolicy: "origin",
531
- redirect: "error",
532
- signal: AbortSignal.any([
533
- U.signal,
534
- r,
535
- AbortSignal.timeout(45e3)
536
- ]),
537
- body: JSON.stringify({
538
- ...n,
539
- acceptance: e.getAcceptance?.()
540
- })
541
- }), a = await i.json();
542
- if (!i.ok) throw new se(L(a.error) ? a.error : "unavailable");
543
- return a;
875
+ async function G(t, n, r = U.signal) {
876
+ if (!k()) throw new P("acceptance_required");
877
+ return await F(t, {
878
+ ...n,
879
+ acceptance: e.getAcceptance?.()
880
+ }, AbortSignal.any([U.signal, r]));
544
881
  }
545
882
  async function K(e, t = {}) {
546
- let i = await _e(`${r}/email`, {
883
+ let i = await G(`${r}/email`, {
547
884
  action: e,
548
885
  next: n,
549
886
  ...t
@@ -551,57 +888,75 @@ function z(e) {
551
888
  return !U.signal.aborted && typeof i.next == "string" && window.location.assign(v(i.next, n)), i;
552
889
  }
553
890
  async function q(e, t) {
554
- if (!(T() || U.signal.aborted)) {
555
- M = !0, W(), D(e), S("");
556
- try {
557
- await t();
558
- } catch (e) {
559
- U.signal.aborted || S(e instanceof se ? e.code : "unavailable");
560
- } finally {
561
- D("");
891
+ if (!(E() || U.signal.aborted)) {
892
+ if (!k()) S("acceptance_required");
893
+ else {
894
+ ie = !0, ye(), O(e), S("");
895
+ try {
896
+ await t();
897
+ } catch (e) {
898
+ U.signal.aborted || S(e instanceof P ? e.code : "unavailable");
899
+ } finally {
900
+ O("");
901
+ }
562
902
  }
563
903
  }
564
904
  }
565
- function ve(e) {
566
- if (c()?.providers.includes(e)) return q(_[e][0], async () => {
567
- let { authorize: t } = await _e(`${r}/start/${e}`, { next: n }), i = g(e, t);
568
- if (!i) throw Error();
569
- U.signal.aborted || window.location.assign(i);
905
+ function be(t) {
906
+ if (c()?.providers.includes(t)) return q(_[t][0], async () => {
907
+ let { authorize: i } = await G(`${r}/start/${t}`, { next: n }), a = g(t, i);
908
+ if (!a) throw Error();
909
+ if (!U.signal.aborted) {
910
+ if (!k() || (await e.beforeOAuthNavigate?.(t, a), !k())) throw new P("acceptance_required");
911
+ U.signal.aborted || window.location.assign(a);
912
+ }
570
913
  });
571
914
  }
572
- function ye() {
573
- if (!(!c()?.otp || f() === "otp" && me() > 0)) return q("email", async () => {
915
+ function xe() {
916
+ if (c()?.recovery && f() === "recover") return q("recovery", async () => {
917
+ if ((await G(`${r}/email`, {
918
+ action: "recovery_start",
919
+ email: m().trim(),
920
+ next: n
921
+ })).step !== "recovery_sent") throw Error();
922
+ U.signal.aborted || W("recovery_sent");
923
+ });
924
+ }
925
+ function Se() {
926
+ if (!(!c()?.otp || f() === "otp" && ge() > 0)) return q("email", async () => {
574
927
  let e = await K("otp_start", { email: m().trim() });
575
928
  if (!e.flow) throw Error();
576
- ae(e.flow), P("");
929
+ oe(e.flow), ae("");
577
930
  let t = Date.now();
578
- pe(t), H(t + 3e4), G("otp");
931
+ he(t), H(t + 3e4), W("otp");
579
932
  });
580
933
  }
581
- function be(e = N()) {
582
- if (f() === "otp" && !T() && /^\d{6}$/.test(e)) return P(e), q("verify", async () => {
934
+ function Ce(e = z()) {
935
+ if (f() === "otp" && !E() && /^\d{6}$/.test(e)) return ae(e), q("verify", async () => {
583
936
  (await K("otp_verify", {
584
- flow: F(),
937
+ flow: B(),
585
938
  code: e
586
- })).step === "mfa" && (z(""), V(!1), G("mfa"));
939
+ })).step === "mfa" && (ce(""), V(!1), W("mfa"));
587
940
  });
588
941
  }
589
- async function xe(e, t) {
590
- let { challenge: i, challengeId: a, rpId: o, credentials: s } = await _e(`${r}/email`, {
942
+ async function we(e, t) {
943
+ let { challenge: i, challengeId: a, rpId: o, credentials: s } = await G(`${r}/email`, {
591
944
  action: "passkey_start",
592
945
  next: n
593
946
  }, e);
594
- if (e.aborted || !i || !a || !o || !s || t && s.length) return;
947
+ if (e.aborted || !i || !a || !o || !s) return;
948
+ if (!k()) throw new P("acceptance_required");
949
+ if (t && s.length) return;
595
950
  let c = await navigator.credentials.get({
596
951
  signal: e,
597
952
  ...t && { mediation: "conditional" },
598
953
  publicKey: {
599
- challenge: ce(i),
954
+ challenge: I(i),
600
955
  rpId: o,
601
956
  ...t ? {} : { timeout: 6e4 },
602
957
  userVerification: "required",
603
958
  allowCredentials: s.map((e) => ({
604
- id: ce(e),
959
+ id: I(e),
605
960
  type: "public-key"
606
961
  }))
607
962
  }
@@ -610,39 +965,43 @@ function z(e) {
610
965
  let l = c.response;
611
966
  return {
612
967
  challenge_id: a,
613
- credential_id: R(c.rawId),
614
- client_data_json: R(l.clientDataJSON),
615
- authenticator_data: R(l.authenticatorData),
616
- signature: R(l.signature),
617
- user_handle: l.userHandle ? R(l.userHandle) : ""
968
+ credential_id: L(c.rawId),
969
+ client_data_json: L(l.clientDataJSON),
970
+ authenticator_data: L(l.authenticatorData),
971
+ signature: L(l.signature),
972
+ user_handle: l.userHandle ? L(l.userHandle) : ""
618
973
  };
619
974
  }
620
- function Se() {
621
- if (k() && c()?.passkey) return q("passkey", async () => {
622
- let e = await xe(U.signal, !1).catch((e) => {
975
+ function Te() {
976
+ if (M() && c()?.passkey && (f() === "choose" || f() === "confirm" && s)) return q("passkey", async () => {
977
+ let e = await we(U.signal, !1).catch((e) => {
623
978
  if (!(e instanceof DOMException && e.name === "NotAllowedError")) throw e;
624
979
  });
625
- if (!e) throw new se("method_unavailable");
980
+ if (!e) throw new P("method_unavailable");
626
981
  await K("passkey_verify", e);
627
982
  });
628
983
  }
629
- ee(() => {
630
- if (M || !re() || f() !== "choose" || !c()?.passkey || e.getAcceptance && !e.getAcceptance()) return;
631
- M = !0;
984
+ C(() => {
985
+ if (!k()) {
986
+ ye();
987
+ return;
988
+ }
989
+ if (ie || !N() || f() !== "choose" || !c()?.passkey || e.getAcceptance && !e.getAcceptance()) return;
990
+ ie = !0;
632
991
  let t = new AbortController();
633
- j = t, xe(t.signal, !0).then((e) => {
992
+ R = t, we(t.signal, !0).then((e) => {
634
993
  if (e && !t.signal.aborted && !U.signal.aborted) return q("passkey", async () => {
635
994
  await K("passkey_verify", e);
636
995
  });
637
996
  }).catch(() => void 0).finally(() => {
638
- j === t && (j = void 0);
997
+ R === t && (R = void 0);
639
998
  });
640
999
  });
641
- function Ce() {
642
- if (c()?.otp) return ye();
643
- c()?.password && !T() && G("password");
1000
+ function Ee(e) {
1001
+ if (e !== "password" && c()?.otp) return Se();
1002
+ e !== "otp" && c()?.password && !E() && W("password");
644
1003
  }
645
- function we(e) {
1004
+ function De(e) {
646
1005
  let t = f();
647
1006
  if ((t === "password" || t === "signup" || t === "confirm") && (t !== "confirm" || s)) return q("password", async () => {
648
1007
  let n = await K(t === "confirm" ? "verify_signup" : t, {
@@ -653,24 +1012,24 @@ function z(e) {
653
1012
  verification: o
654
1013
  } : {}
655
1014
  });
656
- n.step === "check_email" && G("check_email"), n.step === "mfa" && n.challenge && (z(n.challenge), le(t === "confirm"), V(!1), G("mfa"));
1015
+ n.step === "check_email" && W("check_email"), n.step === "mfa" && n.challenge && (ce(n.challenge), ue(t === "confirm"), V(!1), W("mfa"));
657
1016
  });
658
1017
  }
659
- function Te(e) {
1018
+ function Oe(e) {
660
1019
  if (f() !== "mfa") return;
661
- let t = e.trim(), n = ue() ? "recovery_code" : "totp";
1020
+ let t = e.trim(), n = de() ? "recovery_code" : "totp";
662
1021
  return q("verify", async () => {
663
- I() ? await K("mfa", {
664
- challenge: I(),
1022
+ se() ? await K("mfa", {
1023
+ challenge: se(),
665
1024
  code: t,
666
1025
  method: n,
667
- ...B() ? {
1026
+ ...le() ? {
668
1027
  challengeId: a,
669
1028
  verification: o
670
1029
  } : {}
671
1030
  }) : await K("otp_verify", {
672
- flow: F(),
673
- code: N(),
1031
+ flow: B(),
1032
+ code: z(),
674
1033
  factor: t,
675
1034
  method: n
676
1035
  });
@@ -680,98 +1039,130 @@ function z(e) {
680
1039
  emailRoute: `${r}/email`,
681
1040
  config: c,
682
1041
  configFailed: u,
683
- loadConfig: ge,
1042
+ loadConfig: ve,
684
1043
  step: f,
685
- go: G,
1044
+ go: W,
686
1045
  email: m,
687
1046
  setEmail: y,
688
- error: C,
1047
+ error: w,
689
1048
  errorCode: x,
690
- busy: T,
691
- showPassword: ne,
692
- setShowPassword: O,
693
- canPasskey: k,
694
- code: N,
695
- setCode: P,
696
- recovery: ue,
1049
+ agreementAllowed: k,
1050
+ busy: E,
1051
+ showPassword: A,
1052
+ setShowPassword: j,
1053
+ canPasskey: M,
1054
+ code: z,
1055
+ setCode: ae,
1056
+ recovery: de,
697
1057
  setRecovery: V,
698
- wait: me,
699
- continueWithEmail: Ce,
700
- social: ve,
701
- sendCode: ye,
702
- verifyCode: be,
703
- passkey: Se,
704
- submitPassword: we,
705
- submitMfa: Te
1058
+ wait: ge,
1059
+ continueWithEmail: Ee,
1060
+ social: be,
1061
+ sendCode: Se,
1062
+ sendRecovery: xe,
1063
+ verifyCode: Ce,
1064
+ passkey: Te,
1065
+ submitPassword: De,
1066
+ submitMfa: Oe
706
1067
  };
707
1068
  }
708
1069
  // src/sign-in.tsx
709
- var B = /*#__PURE__*/ p("<p>"), le = /*#__PURE__*/ p("<p role=alert>"), ue = /*#__PURE__*/ p("<label>"), V = /*#__PURE__*/ p("<input type=email name=username required maxlength=254>"), de = /*#__PURE__*/ p("<form method=post><!$><!/><label></label><div><input name=password required maxlength=1024><button type=button></button></div><!$><!/><button type=submit>"), H = /*#__PURE__*/ p("<button type=button>"), fe = /*#__PURE__*/ p("<form method=post><label></label><div><input type=text inputmode=numeric autocomplete=one-time-code><div aria-hidden=true></div></div><button type=submit>"), pe = /*#__PURE__*/ p("<div><button type=button></button><button type=button></button><!$><!/>"), me = /*#__PURE__*/ p("<form method=post><label></label><input name=code autocomplete=one-time-code required><button type=submit>"), he = /*#__PURE__*/ p("<div><button type=button></button><button type=button>"), U = /*#__PURE__*/ p("<div><label></label><select>"), ge = /*#__PURE__*/ p("<section><div><!$><!/><h1></h1><p></p><!$><!/><!$><!/><!$><!/><!$><!/>"), W = /*#__PURE__*/ p("<output>"), G = /*#__PURE__*/ p("<div>"), _e = /*#__PURE__*/ p("<form method=post><label></label><input type=email name=email required maxlength=254><button type=submit>"), K = /*#__PURE__*/ p("<p><!$><!/> <button type=button>"), q = /*#__PURE__*/ p("<button type=button><!$><!/><!$><!/>"), ve = /*#__PURE__*/ p("<input tabindex=-1 hidden name=username readonly>"), ye = /*#__PURE__*/ p("<span>"), be = /*#__PURE__*/ p("<option>"), xe = Object.keys(ne), Se = {
710
- google: N,
711
- github: P,
712
- apple: F,
713
- facebook: I,
714
- microsoft: ae
1070
+ var he = /*#__PURE__*/ p("<span>"), ge = /*#__PURE__*/ p("<button type=button><!$><!/><!$><!/>"), _e = /*#__PURE__*/ p("<p>"), U = /*#__PURE__*/ p("<p role=alert>"), ve = /*#__PURE__*/ p("<label>"), ye = /*#__PURE__*/ p("<input type=email name=username required maxlength=254>"), W = /*#__PURE__*/ p("<form method=post><!$><!/><label></label><div><input name=password required maxlength=1024><button type=button></button></div><!$><!/><button type=submit>"), G = /*#__PURE__*/ p("<button type=button>"), K = /*#__PURE__*/ p("<form method=post><label></label><input type=email autocomplete=email required maxlength=254><button type=submit>"), q = /*#__PURE__*/ p("<form method=post><label></label><div><input type=text inputmode=numeric autocomplete=one-time-code><div aria-hidden=true></div></div><button type=submit>"), be = /*#__PURE__*/ p("<div><button type=button></button><button type=button></button><!$><!/>"), xe = /*#__PURE__*/ p("<form method=post><label></label><input name=code autocomplete=one-time-code required><button type=submit>"), Se = /*#__PURE__*/ p("<div><button type=button></button><button type=button>"), Ce = /*#__PURE__*/ p("<div><label></label><select>"), we = /*#__PURE__*/ p("<div>"), Te = /*#__PURE__*/ p("<section><div><!$><!/><h1></h1><p></p><!$><!/><!$><!/><!$><!/><!$><!/>"), Ee = /*#__PURE__*/ p("<output>"), De = /*#__PURE__*/ p("<form method=post><label></label><input type=email name=email required maxlength=254><button type=submit><!$><!/><!$><!/>"), Oe = /*#__PURE__*/ p("<p><!$><!/> <button type=button>"), ke = /*#__PURE__*/ p("<button type=button><!$><!/><!$><!/><!$><!/>"), Ae = /*#__PURE__*/ p("<input tabindex=-1 hidden name=username readonly>"), je = /*#__PURE__*/ p("<option>"), Me = Object.keys(k), Ne = {
1071
+ google: ue,
1072
+ github: de,
1073
+ apple: V,
1074
+ facebook: H,
1075
+ microsoft: fe
715
1076
  };
716
- function Ce(r) {
717
- let p = z(r), { emailRoute: h, config: g, configFailed: v, loadConfig: ee, step: E, email: A, setEmail: re, errorCode: ie, busy: j, showPassword: M, setShowPassword: N, canPasskey: P, code: F, setCode: ae, recovery: I, setRecovery: oe, wait: L, continueWithEmail: se, social: ce, sendCode: R, verifyCode: Ce, passkey: we, submitPassword: Te, submitMfa: Ee } = p, [De, Oe] = w(), [ke, Ae] = w(), J = C(() => r.locale === void 0 ? ke() ?? De() ?? O(r.localePreferences ?? []) : O([r.locale, ...r.localePreferences ?? []])), Y = () => D[J()], je = C(() => k(J())), Me = () => {
718
- let e = ie();
719
- return e ? Y().errors[e] : "";
1077
+ function Pe(r) {
1078
+ let p = me(r), { emailRoute: h, config: g, configFailed: v, loadConfig: C, step: D, email: O, setEmail: N, errorCode: ne, busy: P, agreementAllowed: F, showPassword: I, setShowPassword: L, canPasskey: re, code: R, setCode: ie, recovery: z, setRecovery: ae, wait: B, continueWithEmail: oe, social: se, sendCode: ce, sendRecovery: le, verifyCode: ue, passkey: de, submitPassword: V, submitMfa: fe } = p, [H, pe] = T(), [Pe, Fe] = T(), Ie = w(() => r.locale === void 0 ? Pe() ?? H() ?? j(r.localePreferences ?? []) : j([r.locale, ...r.localePreferences ?? []])), J = w(() => A(Ie(), r.messages)), Le = () => te(Ie(), r.locale, r.messages), Re = w(() => M(Le())), Y = () => !!P() || !F(), ze = () => {
1079
+ let e = ne();
1080
+ return e ? J().errors[e] : "";
720
1081
  };
721
- te(() => {
722
- r.locale === void 0 && !r.localePreferences?.length && Oe(O(navigator.languages));
1082
+ ee(() => {
1083
+ r.locale === void 0 && !r.localePreferences?.length && pe(j(navigator.languages));
723
1084
  });
724
- let Ne = T(), X = (e) => `${Ne}-${e}`;
1085
+ let Be = E(), X = (e) => `${Be}-${e}`;
725
1086
  function Z(e) {
726
1087
  let t = r.appearance?.classes?.[e];
727
1088
  return r.appearance?.unstyled ? t : t ? `auth-sign-in-${e} ${t}` : `auth-sign-in-${e}`;
728
1089
  }
729
- let Pe;
1090
+ let [Ve, He] = T(!1), Ue;
730
1091
  function Q(e) {
731
1092
  queueMicrotask(() => e.focus());
732
1093
  }
733
1094
  function $(e) {
734
- p.go(e), e === "choose" && queueMicrotask(() => Pe?.focus());
1095
+ p.go(e), e === "choose" && queueMicrotask(() => Ue?.focus());
735
1096
  }
1097
+ let We = (e) => n(x, {
1098
+ get when() {
1099
+ return r.lastUsed === e;
1100
+ },
1101
+ get children() {
1102
+ var e = a(he);
1103
+ return s(e, () => J().lastUsed), i(() => t(e, Z("last-used"))), e;
1104
+ }
1105
+ }), Ge = () => n(x, {
1106
+ get when() {
1107
+ return c(() => !!g()?.passkey)() && re();
1108
+ },
1109
+ get children() {
1110
+ var e = a(ge), n = e.firstChild, [r, u] = o(n.nextSibling), f = r.nextSibling, [p, m] = o(f.nextSibling);
1111
+ return e.$$click = () => void de(), s(e, (() => {
1112
+ var e = c(() => P() === "passkey");
1113
+ return () => e() ? J().waitingPasskey : J().usePasskey;
1114
+ })(), r, u), s(e, () => We("passkey"), p, m), i((n) => {
1115
+ var r = Z("link"), i = Y();
1116
+ return r !== n.e && t(e, n.e = r), i !== n.t && d(e, "disabled", n.t = i), n;
1117
+ }, {
1118
+ e: void 0,
1119
+ t: void 0
1120
+ }), l(), e;
1121
+ }
1122
+ });
736
1123
  return (() => {
737
- var p = a(ge), C = p.firstChild, w = C.firstChild, [T, te] = o(w.nextSibling), D = T.nextSibling, k = D.nextSibling, ie = k.nextSibling, [z, De] = o(ie.nextSibling), Oe = z.nextSibling, [ke, Ne] = o(Oe.nextSibling), Fe = ke.nextSibling, [Ie, Le] = o(Fe.nextSibling), Re = Ie.nextSibling, [ze, Be] = o(Re.nextSibling);
738
- return s(C, n(x, {
1124
+ var p = a(Te), w = p.firstChild, T = w.firstChild, [E, ee] = o(T.nextSibling), A = E.nextSibling, M = A.nextSibling, te = M.nextSibling, [ne, F] = o(te.nextSibling), de = ne.nextSibling, [H, pe] = o(de.nextSibling), me = H.nextSibling, [Pe, Be] = o(me.nextSibling), Ke = Pe.nextSibling, [qe, Je] = o(Ke.nextSibling);
1125
+ return s(w, n(x, {
739
1126
  get when() {
740
1127
  return r.kicker;
741
1128
  },
742
1129
  get children() {
743
- var e = a(B);
1130
+ var e = a(_e);
744
1131
  return s(e, () => r.kicker), i(() => t(e, Z("kicker"))), e;
745
1132
  }
746
- }), T, te), s(D, () => ({
747
- choose: r.title ?? Y().signIn,
748
- password: Y().enterPassword,
749
- signup: Y().createYourAccount,
750
- check_email: Y().checkInbox,
751
- confirm: Y().confirmEmail,
752
- otp: Y().checkInbox,
753
- mfa: Y().verifyIdentity
754
- })[E()]), s(k, () => ({
755
- choose: r.description ?? Y().chooseMethod,
756
- password: A(),
757
- signup: Y().startWithEmail,
758
- check_email: Y().checkEmailDescription,
759
- confirm: Y().confirmEmailDescription,
760
- otp: Y().enterEmailCode(A()),
761
- mfa: I() ? Y().enterRecovery : Y().enterAuthenticator
762
- })[E()]), s(C, n(x, {
1133
+ }), E, ee), s(A, () => ({
1134
+ choose: r.title ?? J().signIn,
1135
+ password: J().enterPassword,
1136
+ signup: J().createYourAccount,
1137
+ check_email: J().checkInbox,
1138
+ confirm: J().confirmEmail,
1139
+ otp: J().checkInbox,
1140
+ mfa: J().verifyIdentity,
1141
+ recover: J().recoverAccount,
1142
+ recovery_sent: J().recoverySent
1143
+ })[D()]), s(M, () => ({
1144
+ choose: r.description ?? J().chooseMethod,
1145
+ password: O(),
1146
+ signup: J().startWithEmail,
1147
+ check_email: J().checkEmailDescription,
1148
+ confirm: J().confirmEmailDescription,
1149
+ otp: J().enterEmailCode(O()),
1150
+ mfa: z() ? J().enterRecovery : J().enterAuthenticator,
1151
+ recover: J().recoverDescription,
1152
+ recovery_sent: J().recoverySentDescription
1153
+ })[D()]), s(w, n(x, {
763
1154
  get when() {
764
- return Me();
1155
+ return ze();
765
1156
  },
766
1157
  get children() {
767
- var e = a(le);
768
- return s(e, Me), i(() => t(e, Z("error"))), e;
1158
+ var e = a(U);
1159
+ return s(e, ze), i(() => t(e, Z("error"))), e;
769
1160
  }
770
- }), z, De), s(C, n(S, { get children() {
1161
+ }), ne, F), s(w, n(S, { get children() {
771
1162
  return [
772
1163
  n(b, {
773
1164
  get when() {
774
- return E() === "choose";
1165
+ return D() === "choose";
775
1166
  },
776
1167
  get children() {
777
1168
  return n(x, {
@@ -785,37 +1176,37 @@ function Ce(r) {
785
1176
  },
786
1177
  get fallback() {
787
1178
  return (() => {
788
- var e = a(W);
789
- return s(e, () => Y().loading), i(() => t(e, Z("loading"))), e;
1179
+ var e = a(Ee);
1180
+ return s(e, () => J().loading), i(() => t(e, Z("loading"))), e;
790
1181
  })();
791
1182
  },
792
1183
  get children() {
793
1184
  return [(() => {
794
- var e = a(le);
795
- return s(e, () => Y().errors.unavailable), i(() => t(e, Z("error"))), e;
1185
+ var e = a(U);
1186
+ return s(e, () => J().errors.unavailable), i(() => t(e, Z("error"))), e;
796
1187
  })(), (() => {
797
- var n = a(H);
798
- return e(n, "click", ee, !0), s(n, () => Y().retry), i(() => t(n, Z("secondary"))), l(), n;
1188
+ var n = a(G);
1189
+ return e(n, "click", C, !0), s(n, () => J().retry), i(() => t(n, Z("secondary"))), l(), n;
799
1190
  })()];
800
1191
  }
801
1192
  });
802
1193
  },
803
1194
  children: (e) => [
804
1195
  (() => {
805
- var r = a(G);
1196
+ var r = a(we);
806
1197
  return s(r, n(y, {
807
1198
  get each() {
808
1199
  return e().providers;
809
1200
  },
810
1201
  children: (e) => {
811
- let r = Se[e];
1202
+ let r = Ne[e];
812
1203
  return (() => {
813
- var u = a(q), f = u.firstChild, [p, m] = o(f.nextSibling), h = p.nextSibling, [g, v] = o(h.nextSibling);
814
- return u.$$click = () => void ce(e), s(u, r && n(r, {}), p, m), s(u, (() => {
815
- var t = c(() => j() === _[e][0]);
816
- return () => t() ? Y().openingProvider(_[e][0]) : Y().continueProvider(_[e][0]);
817
- })(), g, v), i((e) => {
818
- var n = Z("secondary"), r = !!j();
1204
+ var u = a(ke), f = u.firstChild, [p, m] = o(f.nextSibling), h = p.nextSibling, [g, v] = o(h.nextSibling), y = g.nextSibling, [b, x] = o(y.nextSibling);
1205
+ return u.$$click = () => void se(e), s(u, r && n(r, {}), p, m), s(u, (() => {
1206
+ var t = c(() => P() === _[e][0]);
1207
+ return () => t() ? J().openingProvider(_[e][0]) : J().continueProvider(_[e][0]);
1208
+ })(), g, v), s(u, () => We(e), b, x), i((e) => {
1209
+ var n = Z("secondary"), r = Y();
819
1210
  return n !== e.e && t(u, e.e = n), r !== e.t && d(u, "disabled", e.t = r), e;
820
1211
  }, {
821
1212
  e: void 0,
@@ -835,21 +1226,21 @@ function Ce(r) {
835
1226
  return e().providers.length;
836
1227
  },
837
1228
  get children() {
838
- var e = a(G);
839
- return s(e, () => Y().orEmail), i(() => t(e, Z("divider"))), e;
1229
+ var e = a(we);
1230
+ return s(e, () => J().orEmail), i(() => t(e, Z("divider"))), e;
840
1231
  }
841
1232
  }), (() => {
842
- var n = a(_e), r = n.firstChild, o = r.nextSibling, f = o.nextSibling;
1233
+ var n = a(De), r = n.firstChild, f = r.nextSibling, p = f.nextSibling, _ = p.firstChild, [v, y] = o(_.nextSibling), b = v.nextSibling, [x, S] = o(b.nextSibling);
843
1234
  return n.addEventListener("submit", (e) => {
844
- e.preventDefault(), se();
845
- }), u(n, "action", h), s(r, () => Y().email), o.$$input = (e) => re(e.currentTarget.value), m((e) => {
846
- Pe = e;
847
- }, o), s(f, (() => {
848
- var t = c(() => j() === "email");
849
- return () => t() ? Y().sendingCode : c(() => !!e().otp)() ? Y().emailCodeAction : Y().continueEmail;
850
- })()), i((e) => {
851
- var i = Z("form"), a = X("email"), s = X("email"), c = g()?.passkey ? "username webauthn" : "username", l = Z("primary"), p = !!j();
852
- return i !== e.e && t(n, e.e = i), a !== e.t && u(r, "for", e.t = a), s !== e.a && u(o, "id", e.a = s), c !== e.o && u(o, "autocomplete", e.o = c), l !== e.i && t(f, e.i = l), p !== e.n && d(f, "disabled", e.n = p), e;
1235
+ e.preventDefault(), oe();
1236
+ }), u(n, "action", h), s(r, () => J().email), f.$$input = (e) => N(e.currentTarget.value), m((e) => {
1237
+ Ue = e;
1238
+ }, f), s(p, (() => {
1239
+ var t = c(() => P() === "email");
1240
+ return () => t() ? J().sendingCode : c(() => !!e().otp)() ? J().emailCodeAction : J().continueEmail;
1241
+ })(), v, y), s(p, () => We(e().otp ? "otp" : "password"), x, S), i((e) => {
1242
+ var i = Z("form"), a = X("email"), o = X("email"), s = g()?.passkey ? "username webauthn" : "username", c = Z("primary"), l = Y();
1243
+ return i !== e.e && t(n, e.e = i), a !== e.t && u(r, "for", e.t = a), o !== e.a && u(f, "id", e.a = o), s !== e.o && u(f, "autocomplete", e.o = s), c !== e.i && t(p, e.i = c), l !== e.n && d(p, "disabled", e.n = l), e;
853
1244
  }, {
854
1245
  e: void 0,
855
1246
  t: void 0,
@@ -857,21 +1248,20 @@ function Ce(r) {
857
1248
  o: void 0,
858
1249
  i: void 0,
859
1250
  n: void 0
860
- }), i(() => d(o, "value", A())), l(), n;
1251
+ }), i(() => d(f, "value", O())), l(), n;
861
1252
  })()];
862
1253
  }
863
1254
  }),
864
1255
  n(x, {
865
1256
  get when() {
866
- return c(() => !!e().passkey)() && P();
1257
+ return c(() => !!e().otp)() && e().password;
867
1258
  },
868
1259
  get children() {
869
- var e = a(H);
870
- return e.$$click = () => void we(), s(e, (() => {
871
- var e = c(() => j() === "passkey");
872
- return () => e() ? Y().waitingPasskey : Y().usePasskey;
873
- })()), i((n) => {
874
- var r = Z("link"), i = !!j();
1260
+ var e = a(ge), n = e.firstChild, [r, c] = o(n.nextSibling), u = r.nextSibling, [f, p] = o(u.nextSibling);
1261
+ return e.$$click = () => {
1262
+ He(!O().trim() || !Ue?.validity.valid), oe("password");
1263
+ }, s(e, () => J().usePassword, r, c), s(e, () => We("password"), f, p), i((n) => {
1264
+ var r = Z("link"), i = !!P();
875
1265
  return r !== n.e && t(e, n.e = r), i !== n.t && d(e, "disabled", n.t = i), n;
876
1266
  }, {
877
1267
  e: void 0,
@@ -879,14 +1269,15 @@ function Ce(r) {
879
1269
  }), l(), e;
880
1270
  }
881
1271
  }),
1272
+ c(Ge),
882
1273
  n(x, {
883
1274
  get when() {
884
1275
  return e().signup;
885
1276
  },
886
1277
  get children() {
887
- var e = a(K), n = e.firstChild, [r, c] = o(n.nextSibling), u = r.nextSibling.nextSibling;
888
- return s(e, () => Y().newHere, r, c), u.$$click = () => $("signup"), s(u, () => Y().createAnAccount), i((n) => {
889
- var r = Z("switch"), i = Z("link"), a = !!j();
1278
+ var e = a(Oe), n = e.firstChild, [r, c] = o(n.nextSibling), u = r.nextSibling.nextSibling;
1279
+ return s(e, () => J().newHere, r, c), u.$$click = () => $("signup"), s(u, () => J().createAnAccount), i((n) => {
1280
+ var r = Z("switch"), i = Z("link"), a = !!P();
890
1281
  return r !== n.e && t(e, n.e = r), i !== n.t && t(u, n.t = i), a !== n.a && d(u, "disabled", n.a = a), n;
891
1282
  }, {
892
1283
  e: void 0,
@@ -897,11 +1288,11 @@ function Ce(r) {
897
1288
  }),
898
1289
  n(x, {
899
1290
  get when() {
900
- return c(() => !(e().password || e().signup || e().otp || e().providers.length))() && !(e().passkey && P());
1291
+ return c(() => !(e().password || e().signup || e().otp || e().providers.length))() && !(e().passkey && re());
901
1292
  },
902
1293
  get children() {
903
- var e = a(W);
904
- return s(e, () => Y().noMethods), e;
1294
+ var e = a(Ee);
1295
+ return s(e, () => J().noMethods), e;
905
1296
  }
906
1297
  })
907
1298
  ]
@@ -910,86 +1301,148 @@ function Ce(r) {
910
1301
  }),
911
1302
  n(b, {
912
1303
  get when() {
913
- return E() === "password" || E() === "signup" || E() === "confirm";
1304
+ return D() === "password" || D() === "signup" || D() === "confirm";
914
1305
  },
915
1306
  get children() {
916
- return [(() => {
917
- var e = a(de), r = e.firstChild, [f, p] = o(r.nextSibling), _ = f.nextSibling, v = _.nextSibling, y = v.firstChild, b = y.nextSibling, S = v.nextSibling, [ee, C] = o(S.nextSibling), w = ee.nextSibling;
918
- return e.addEventListener("submit", (e) => {
919
- e.preventDefault(), Te(String(new FormData(e.currentTarget).get("password") ?? ""));
920
- }), u(e, "action", h), s(e, n(x, {
921
- get when() {
922
- return E() !== "password";
923
- },
924
- get fallback() {
925
- return (() => {
926
- var e = a(ve);
927
- return i(() => u(e, "autocomplete", g()?.passkey ? "username webauthn" : "username")), i(() => d(e, "value", A())), e;
928
- })();
929
- },
930
- get children() {
931
- return [(() => {
932
- var e = a(ue);
933
- return s(e, () => Y().email), i(() => u(e, "for", X("account-email"))), e;
934
- })(), (() => {
935
- var e = a(V);
936
- e.$$input = (e) => re(e.currentTarget.value);
937
- var t = Q;
938
- return typeof t == "function" ? m(t, e) : Q = e, i((t) => {
939
- var n = X("account-email"), r = g()?.passkey ? "username webauthn" : "username";
940
- return n !== t.e && u(e, "id", t.e = n), r !== t.t && u(e, "autocomplete", t.t = r), t;
1307
+ return [
1308
+ (() => {
1309
+ var e = a(W), r = e.firstChild, [f, p] = o(r.nextSibling), _ = f.nextSibling, v = _.nextSibling, y = v.firstChild, b = y.nextSibling, S = v.nextSibling, [C, w] = o(S.nextSibling), T = C.nextSibling;
1310
+ return e.addEventListener("submit", (e) => {
1311
+ e.preventDefault(), V(String(new FormData(e.currentTarget).get("password") ?? ""));
1312
+ }), u(e, "action", h), s(e, n(x, {
1313
+ get when() {
1314
+ return D() !== "password" || Ve();
1315
+ },
1316
+ get fallback() {
1317
+ return (() => {
1318
+ var e = a(Ae);
1319
+ return i(() => u(e, "autocomplete", g()?.passkey ? "username webauthn" : "username")), i(() => d(e, "value", O())), e;
1320
+ })();
1321
+ },
1322
+ get children() {
1323
+ return [(() => {
1324
+ var e = a(ve);
1325
+ return s(e, () => J().email), i(() => u(e, "for", X("account-email"))), e;
1326
+ })(), (() => {
1327
+ var e = a(ye);
1328
+ e.$$input = (e) => N(e.currentTarget.value);
1329
+ var t = Q;
1330
+ return typeof t == "function" ? m(t, e) : Q = e, i((t) => {
1331
+ var n = X("account-email"), r = g()?.passkey ? "username webauthn" : "username";
1332
+ return n !== t.e && u(e, "id", t.e = n), r !== t.t && u(e, "autocomplete", t.t = r), t;
1333
+ }, {
1334
+ e: void 0,
1335
+ t: void 0
1336
+ }), i(() => d(e, "value", O())), l(), e;
1337
+ })()];
1338
+ }
1339
+ }), f, p), s(_, () => J().password), m((e) => {
1340
+ D() === "password" && !Ve() && Q(e);
1341
+ }, y), b.$$click = () => L(!I()), s(b, (() => {
1342
+ var e = c(() => !!I());
1343
+ return () => e() ? J().hide : J().show;
1344
+ })()), s(e, n(x, {
1345
+ get when() {
1346
+ return D() === "signup";
1347
+ },
1348
+ get children() {
1349
+ var e = a(_e);
1350
+ return s(e, () => J().minimumPassword), i((n) => {
1351
+ var r = Z("hint"), i = X("password-hint");
1352
+ return r !== n.e && t(e, n.e = r), i !== n.t && u(e, "id", n.t = i), n;
941
1353
  }, {
942
1354
  e: void 0,
943
1355
  t: void 0
944
- }), i(() => d(e, "value", A())), l(), e;
945
- })()];
946
- }
947
- }), f, p), s(_, () => Y().password), m((e) => {
948
- E() === "password" && Q(e);
949
- }, y), b.$$click = () => N(!M()), s(b, (() => {
950
- var e = c(() => !!M());
951
- return () => e() ? Y().hide : Y().show;
952
- })()), s(e, n(x, {
1356
+ }), e;
1357
+ }
1358
+ }), C, w), s(T, (() => {
1359
+ var e = c(() => !!P());
1360
+ return () => e() ? J().working : c(() => D() === "signup")() ? J().createAccount : c(() => D() === "confirm")() ? J().confirmAndSignIn : J().signIn;
1361
+ })()), i((n) => {
1362
+ var r = Z("form"), i = X("password"), a = Z("password"), o = X("password"), s = I() ? "text" : "password", c = D() === "signup" ? "new-password" : "current-password", l = D() === "signup" ? 12 : void 0, f = D() === "signup" ? X("password-hint") : void 0, p = Z("link"), m = I() ? J().hidePassword : J().showPassword, h = Z("primary"), g = Y();
1363
+ return r !== n.e && t(e, n.e = r), i !== n.t && u(_, "for", n.t = i), a !== n.a && t(v, n.a = a), o !== n.o && u(y, "id", n.o = o), s !== n.i && u(y, "type", n.i = s), c !== n.n && u(y, "autocomplete", n.n = c), l !== n.s && u(y, "minlength", n.s = l), f !== n.h && u(y, "aria-describedby", n.h = f), p !== n.r && t(b, n.r = p), m !== n.d && u(b, "aria-label", n.d = m), h !== n.l && t(T, n.l = h), g !== n.u && d(T, "disabled", n.u = g), n;
1364
+ }, {
1365
+ e: void 0,
1366
+ t: void 0,
1367
+ a: void 0,
1368
+ o: void 0,
1369
+ i: void 0,
1370
+ n: void 0,
1371
+ s: void 0,
1372
+ h: void 0,
1373
+ r: void 0,
1374
+ d: void 0,
1375
+ l: void 0,
1376
+ u: void 0
1377
+ }), l(), e;
1378
+ })(),
1379
+ n(x, {
953
1380
  get when() {
954
- return E() === "signup";
1381
+ return c(() => D() === "password")() && g()?.recovery;
955
1382
  },
956
1383
  get children() {
957
- var e = a(B);
958
- return s(e, () => Y().minimumPassword), i((n) => {
959
- var r = Z("hint"), i = X("password-hint");
960
- return r !== n.e && t(e, n.e = r), i !== n.t && u(e, "id", n.t = i), n;
1384
+ var e = a(G);
1385
+ return e.$$click = () => $("recover"), s(e, () => J().forgotPassword), i((n) => {
1386
+ var r = Z("link"), i = !!P();
1387
+ return r !== n.e && t(e, n.e = r), i !== n.t && d(e, "disabled", n.t = i), n;
961
1388
  }, {
962
1389
  e: void 0,
963
1390
  t: void 0
964
- }), e;
1391
+ }), l(), e;
965
1392
  }
966
- }), ee, C), s(w, (() => {
967
- var e = c(() => !!j());
968
- return () => e() ? Y().working : c(() => E() === "signup")() ? Y().createAccount : c(() => E() === "confirm")() ? Y().confirmAndSignIn : Y().signIn;
969
- })()), i((n) => {
970
- var r = Z("form"), i = X("password"), a = Z("password"), o = X("password"), s = M() ? "text" : "password", c = E() === "signup" ? "new-password" : "current-password", l = E() === "signup" ? 12 : void 0, f = E() === "signup" ? X("password-hint") : void 0, p = Z("link"), m = M() ? Y().hidePassword : Y().showPassword, h = Z("primary"), g = !!j();
971
- return r !== n.e && t(e, n.e = r), i !== n.t && u(_, "for", n.t = i), a !== n.a && t(v, n.a = a), o !== n.o && u(y, "id", n.o = o), s !== n.i && u(y, "type", n.i = s), c !== n.n && u(y, "autocomplete", n.n = c), l !== n.s && u(y, "minlength", n.s = l), f !== n.h && u(y, "aria-describedby", n.h = f), p !== n.r && t(b, n.r = p), m !== n.d && u(b, "aria-label", n.d = m), h !== n.l && t(w, n.l = h), g !== n.u && d(w, "disabled", n.u = g), n;
1393
+ }),
1394
+ n(x, {
1395
+ get when() {
1396
+ return D() === "confirm";
1397
+ },
1398
+ get children() {
1399
+ return Ge();
1400
+ }
1401
+ }),
1402
+ (() => {
1403
+ var e = a(G);
1404
+ return e.$$click = () => $("choose"), s(e, (() => {
1405
+ var e = c(() => D() === "password");
1406
+ return () => e() ? J().changeEmailOrMethod : J().backToSignIn;
1407
+ })()), i((n) => {
1408
+ var r = Z("link"), i = !!P();
1409
+ return r !== n.e && t(e, n.e = r), i !== n.t && d(e, "disabled", n.t = i), n;
1410
+ }, {
1411
+ e: void 0,
1412
+ t: void 0
1413
+ }), l(), e;
1414
+ })()
1415
+ ];
1416
+ }
1417
+ }),
1418
+ n(b, {
1419
+ get when() {
1420
+ return D() === "recover";
1421
+ },
1422
+ get children() {
1423
+ return [(() => {
1424
+ var e = a(K), n = e.firstChild, r = n.nextSibling, o = r.nextSibling;
1425
+ e.addEventListener("submit", (e) => {
1426
+ e.preventDefault(), le();
1427
+ }), u(e, "action", h), s(n, () => J().email), r.$$input = (e) => N(e.currentTarget.value);
1428
+ var f = Q;
1429
+ return typeof f == "function" ? m(f, r) : Q = r, s(o, (() => {
1430
+ var e = c(() => !!P());
1431
+ return () => e() ? J().working : J().sendResetLink;
1432
+ })()), i((i) => {
1433
+ var a = Z("form"), s = X("recovery-email"), c = X("recovery-email"), l = Z("primary"), f = Y();
1434
+ return a !== i.e && t(e, i.e = a), s !== i.t && u(n, "for", i.t = s), c !== i.a && u(r, "id", i.a = c), l !== i.o && t(o, i.o = l), f !== i.i && d(o, "disabled", i.i = f), i;
972
1435
  }, {
973
1436
  e: void 0,
974
1437
  t: void 0,
975
1438
  a: void 0,
976
1439
  o: void 0,
977
- i: void 0,
978
- n: void 0,
979
- s: void 0,
980
- h: void 0,
981
- r: void 0,
982
- d: void 0,
983
- l: void 0,
984
- u: void 0
985
- }), l(), e;
1440
+ i: void 0
1441
+ }), i(() => d(r, "value", O())), l(), e;
986
1442
  })(), (() => {
987
- var e = a(H);
988
- return e.$$click = () => $("choose"), s(e, (() => {
989
- var e = c(() => E() === "password");
990
- return () => e() ? Y().changeEmailOrMethod : Y().backToSignIn;
991
- })()), i((n) => {
992
- var r = Z("link"), i = !!j();
1443
+ var e = a(G);
1444
+ return e.$$click = () => $("choose"), s(e, () => J().backToSignIn), i((n) => {
1445
+ var r = Z("link"), i = !!P();
993
1446
  return r !== n.e && t(e, n.e = r), i !== n.t && d(e, "disabled", n.t = i), n;
994
1447
  }, {
995
1448
  e: void 0,
@@ -1000,25 +1453,34 @@ function Ce(r) {
1000
1453
  }),
1001
1454
  n(b, {
1002
1455
  get when() {
1003
- return E() === "check_email";
1456
+ return D() === "recovery_sent";
1457
+ },
1458
+ get children() {
1459
+ var e = a(G);
1460
+ return e.$$click = () => $("choose"), s(e, () => J().backToSignIn), i(() => t(e, Z("secondary"))), l(), e;
1461
+ }
1462
+ }),
1463
+ n(b, {
1464
+ get when() {
1465
+ return D() === "check_email";
1004
1466
  },
1005
1467
  get children() {
1006
- var e = a(H);
1007
- return e.$$click = () => $("choose"), s(e, () => Y().backToSignIn), i(() => t(e, Z("secondary"))), l(), e;
1468
+ var e = a(G);
1469
+ return e.$$click = () => $("choose"), s(e, () => J().backToSignIn), i(() => t(e, Z("secondary"))), l(), e;
1008
1470
  }
1009
1471
  }),
1010
1472
  n(b, {
1011
1473
  get when() {
1012
- return E() === "otp";
1474
+ return D() === "otp";
1013
1475
  },
1014
1476
  get children() {
1015
1477
  return [(() => {
1016
- var e = a(fe), r = e.firstChild, o = r.nextSibling, f = o.firstChild, p = f.nextSibling, g = o.nextSibling;
1478
+ var e = a(q), r = e.firstChild, o = r.nextSibling, f = o.firstChild, p = f.nextSibling, g = o.nextSibling;
1017
1479
  e.addEventListener("submit", (e) => {
1018
- e.preventDefault(), Ce(F());
1019
- }), u(e, "action", h), s(r, () => Y().emailCode), f.$$input = (e) => {
1480
+ e.preventDefault(), ue(R());
1481
+ }), u(e, "action", h), s(r, () => J().emailCode), f.$$input = (e) => {
1020
1482
  let t = e.currentTarget.value.replace(/\D/g, "").slice(0, 6);
1021
- e.currentTarget.value = t, ae(t), Ce(t);
1483
+ e.currentTarget.value = t, ie(t), ue(t);
1022
1484
  };
1023
1485
  var _ = Q;
1024
1486
  return typeof _ == "function" ? m(_, f) : Q = f, s(p, n(y, {
@@ -1031,14 +1493,14 @@ function Ce(r) {
1031
1493
  5
1032
1494
  ],
1033
1495
  children: (e) => (() => {
1034
- var t = a(ye);
1035
- return s(t, () => F()[e] ?? ""), t;
1496
+ var t = a(he);
1497
+ return s(t, () => R()[e] ?? ""), t;
1036
1498
  })()
1037
1499
  })), s(g, (() => {
1038
- var e = c(() => j() === "verify");
1039
- return () => e() ? Y().checkingCode : Y().verifyCode;
1500
+ var e = c(() => P() === "verify");
1501
+ return () => e() ? J().checkingCode : J().verifyCode;
1040
1502
  })()), i((n) => {
1041
- var i = Z("form"), a = X("code"), s = Z("otp"), c = X("code"), l = !!j(), m = Z("cells"), h = Z("primary"), _ = !!j() || F().length !== 6;
1503
+ var i = Z("form"), a = X("code"), s = Z("otp"), c = X("code"), l = !!P(), m = Z("cells"), h = Z("primary"), _ = Y() || R().length !== 6;
1042
1504
  return i !== n.e && t(e, n.e = i), a !== n.t && u(r, "for", n.t = a), s !== n.a && t(o, n.a = s), c !== n.o && u(f, "id", n.o = c), l !== n.i && d(f, "readOnly", n.i = l), m !== n.n && t(p, n.n = m), h !== n.s && t(g, n.s = h), _ !== n.h && d(g, "disabled", n.h = _), n;
1043
1505
  }, {
1044
1506
  e: void 0,
@@ -1049,20 +1511,20 @@ function Ce(r) {
1049
1511
  n: void 0,
1050
1512
  s: void 0,
1051
1513
  h: void 0
1052
- }), i(() => d(f, "value", F())), l(), e;
1514
+ }), i(() => d(f, "value", R())), l(), e;
1053
1515
  })(), (() => {
1054
- var e = a(pe), r = e.firstChild, u = r.nextSibling, f = u.nextSibling, [p, m] = o(f.nextSibling);
1055
- return r.$$click = () => void R(), s(r, (() => {
1056
- var e = c(() => !!L());
1057
- return () => e() ? Y().resendIn(je().format(L())) : Y().resendCode;
1058
- })()), u.$$click = () => $("choose"), s(u, () => Y().changeEmail), s(e, n(x, {
1516
+ var e = a(be), r = e.firstChild, u = r.nextSibling, f = u.nextSibling, [p, m] = o(f.nextSibling);
1517
+ return r.$$click = () => void ce(), s(r, (() => {
1518
+ var e = c(() => !!B());
1519
+ return () => e() ? J().resendIn(Re().format(B())) : J().resendCode;
1520
+ })()), u.$$click = () => $("choose"), s(u, () => J().changeEmail), s(e, n(x, {
1059
1521
  get when() {
1060
1522
  return g()?.password;
1061
1523
  },
1062
1524
  get children() {
1063
- var e = a(H);
1064
- return e.$$click = () => $("password"), s(e, () => Y().usePassword), i((n) => {
1065
- var r = Z("link"), i = !!j();
1525
+ var e = a(G);
1526
+ return e.$$click = () => $("password"), s(e, () => J().usePassword), i((n) => {
1527
+ var r = Z("link"), i = !!P();
1066
1528
  return r !== n.e && t(e, n.e = r), i !== n.t && d(e, "disabled", n.t = i), n;
1067
1529
  }, {
1068
1530
  e: void 0,
@@ -1070,7 +1532,7 @@ function Ce(r) {
1070
1532
  }), l(), e;
1071
1533
  }
1072
1534
  }), p, m), i((n) => {
1073
- var i = Z("actions"), a = Z("link"), o = !!j() || L() > 0, s = Z("link"), c = !!j();
1535
+ var i = Z("actions"), a = Z("link"), o = Y() || B() > 0, s = Z("link"), c = !!P();
1074
1536
  return i !== n.e && t(e, n.e = i), a !== n.t && t(r, n.t = a), o !== n.a && d(r, "disabled", n.a = o), s !== n.o && t(u, n.o = s), c !== n.i && d(u, "disabled", n.i = c), n;
1075
1537
  }, {
1076
1538
  e: void 0,
@@ -1084,23 +1546,23 @@ function Ce(r) {
1084
1546
  }),
1085
1547
  n(b, {
1086
1548
  get when() {
1087
- return E() === "mfa";
1549
+ return D() === "mfa";
1088
1550
  },
1089
1551
  get children() {
1090
1552
  return [(() => {
1091
- var e = a(me), n = e.firstChild, r = n.nextSibling, o = r.nextSibling;
1553
+ var e = a(xe), n = e.firstChild, r = n.nextSibling, o = r.nextSibling;
1092
1554
  e.addEventListener("submit", (e) => {
1093
- e.preventDefault(), Ee(String(new FormData(e.currentTarget).get("code") ?? ""));
1555
+ e.preventDefault(), fe(String(new FormData(e.currentTarget).get("code") ?? ""));
1094
1556
  }), u(e, "action", h), s(n, (() => {
1095
- var e = c(() => !!I());
1096
- return () => e() ? Y().recoveryCode : Y().authenticatorCode;
1557
+ var e = c(() => !!z());
1558
+ return () => e() ? J().recoveryCode : J().authenticatorCode;
1097
1559
  })());
1098
1560
  var l = Q;
1099
1561
  return typeof l == "function" ? m(l, r) : Q = r, s(o, (() => {
1100
- var e = c(() => !!j());
1101
- return () => e() ? Y().checkingCode : Y().verifyAndSignIn;
1562
+ var e = c(() => !!P());
1563
+ return () => e() ? J().checkingCode : J().verifyAndSignIn;
1102
1564
  })()), i((i) => {
1103
- var a = Z("form"), s = X("mfa"), c = X("mfa"), l = I() ? "text" : "numeric", f = I() ? 128 : 6, p = Z("primary"), m = !!j();
1565
+ var a = Z("form"), s = X("mfa"), c = X("mfa"), l = z() ? "text" : "numeric", f = z() ? 128 : 6, p = Z("primary"), m = Y();
1104
1566
  return a !== i.e && t(e, i.e = a), s !== i.t && u(n, "for", i.t = s), c !== i.a && u(r, "id", i.a = c), l !== i.o && u(r, "inputmode", i.o = l), f !== i.i && u(r, "maxlength", i.i = f), p !== i.n && t(o, i.n = p), m !== i.s && d(o, "disabled", i.s = m), i;
1105
1567
  }, {
1106
1568
  e: void 0,
@@ -1112,12 +1574,12 @@ function Ce(r) {
1112
1574
  s: void 0
1113
1575
  }), e;
1114
1576
  })(), (() => {
1115
- var e = a(he), n = e.firstChild, r = n.nextSibling;
1116
- return n.$$click = () => oe(!I()), s(n, (() => {
1117
- var e = c(() => !!I());
1118
- return () => e() ? Y().useAuthenticator : Y().useRecovery;
1119
- })()), r.$$click = () => $("choose"), s(r, () => Y().backToSignIn), i((i) => {
1120
- var a = Z("actions"), o = !!j(), s = Z("link"), c = !!j(), l = Z("link");
1577
+ var e = a(Se), n = e.firstChild, r = n.nextSibling;
1578
+ return n.$$click = () => ae(!z()), s(n, (() => {
1579
+ var e = c(() => !!z());
1580
+ return () => e() ? J().useAuthenticator : J().useRecovery;
1581
+ })()), r.$$click = () => $("choose"), s(r, () => J().backToSignIn), i((i) => {
1582
+ var a = Z("actions"), o = !!P(), s = Z("link"), c = !!P(), l = Z("link");
1121
1583
  return a !== i.e && t(e, i.e = a), o !== i.t && d(n, "disabled", i.t = o), s !== i.a && t(n, i.a = s), c !== i.o && d(r, "disabled", i.o = c), l !== i.i && t(r, i.i = l), i;
1122
1584
  }, {
1123
1585
  e: void 0,
@@ -1130,20 +1592,20 @@ function Ce(r) {
1130
1592
  }
1131
1593
  })
1132
1594
  ];
1133
- } }), ke, Ne), s(C, n(x, {
1595
+ } }), H, pe), s(w, n(x, {
1134
1596
  get when() {
1135
1597
  return c(() => r.showLocaleSelector !== !1)() && (r.locale === void 0 || r.onLocaleChange);
1136
1598
  },
1137
1599
  get children() {
1138
- var e = a(U), o = e.firstChild, c = o.nextSibling;
1139
- return s(o, () => Y().language), c.addEventListener("change", (e) => {
1140
- let t = O([e.currentTarget.value]);
1141
- r.locale === void 0 && Ae(t), r.onLocaleChange?.(t);
1600
+ var e = a(Ce), o = e.firstChild, c = o.nextSibling;
1601
+ return s(o, () => J().language), c.addEventListener("change", (e) => {
1602
+ let t = j([e.currentTarget.value]);
1603
+ r.locale === void 0 && Fe(t), r.onLocaleChange?.(t);
1142
1604
  }), s(c, n(y, {
1143
- each: xe,
1605
+ each: Me,
1144
1606
  children: (e) => (() => {
1145
- var t = a(be);
1146
- return d(t, "value", e), u(t, "lang", e), s(t, () => ne[e]), i(() => d(t, "selected", J() === e)), t;
1607
+ var t = a(je);
1608
+ return d(t, "value", e), u(t, "lang", e), s(t, () => k[e]), i(() => d(t, "selected", Ie() === e)), t;
1147
1609
  })()
1148
1610
  })), i((n) => {
1149
1611
  var r = Z("locale"), i = X("locale"), a = X("locale");
@@ -1152,19 +1614,19 @@ function Ce(r) {
1152
1614
  e: void 0,
1153
1615
  t: void 0,
1154
1616
  a: void 0
1155
- }), i(() => d(c, "value", J())), e;
1617
+ }), i(() => d(c, "value", Ie())), e;
1156
1618
  }
1157
- }), Ie, Le), s(C, n(x, {
1619
+ }), Pe, Be), s(w, n(x, {
1158
1620
  get when() {
1159
1621
  return r.agreement;
1160
1622
  },
1161
1623
  get children() {
1162
- var e = a(B);
1624
+ var e = a(we);
1163
1625
  return s(e, () => r.agreement), i(() => t(e, Z("agreement"))), e;
1164
1626
  }
1165
- }), ze, Be), i((e) => {
1166
- var n = Z("panel"), i = r.appearance?.tokens, a = X("title"), o = J(), s = Z("content"), c = X("title"), l = Z("title"), d = Z("sub");
1167
- return n !== e.e && t(p, e.e = n), e.t = f(p, i, e.t), a !== e.a && u(p, "aria-labelledby", e.a = a), o !== e.o && u(p, "lang", e.o = o), s !== e.i && t(C, e.i = s), c !== e.n && u(D, "id", e.n = c), l !== e.s && t(D, e.s = l), d !== e.h && t(k, e.h = d), e;
1627
+ }), qe, Je), i((e) => {
1628
+ var n = Z("panel"), i = r.appearance?.tokens, a = X("title"), o = Le(), s = Z("content"), c = X("title"), l = Z("title"), d = Z("sub");
1629
+ return n !== e.e && t(p, e.e = n), e.t = f(p, i, e.t), a !== e.a && u(p, "aria-labelledby", e.a = a), o !== e.o && u(p, "lang", e.o = o), s !== e.i && t(w, e.i = s), c !== e.n && u(A, "id", e.n = c), l !== e.s && t(A, e.s = l), d !== e.h && t(M, e.h = d), e;
1168
1630
  }, {
1169
1631
  e: void 0,
1170
1632
  t: void 0,
@@ -1177,5 +1639,5 @@ function Ce(r) {
1177
1639
  }), p;
1178
1640
  })();
1179
1641
  }
1180
- r(["input", "click"]);
1181
- export { Ce as SylphxSignIn, z as createSignInController, ne as localeNames, O as resolveAuthLocale, D as signInMessages };
1642
+ r(["click", "input"]);
1643
+ export { ae as SylphxPasskeyEnroll, Pe as SylphxSignIn, me as createSignInController, k as localeNames, j as resolveAuthLocale, A as resolveSignInMessages, O as signInMessages };