PageSourceSearch

https://statiko.io/_next/static/chunks/login-CdOcyqxq.js

js statiko.io collected 2026-10-08 23:41:44 UTC 6,409 bytes, 1 lines download raw bytes

1import{a as e}from"./rolldown-runtime-CNC7AqOf.js";import{i as t,r as n}from"./framework-DQ8ucxOY.js";import{ot as r}from"./vinext-foN4kYtp.js";import{r as i}from"./client-DWOz3IHF.js";import"./src-BkJOzV9i.js";import{t as a}from"./button-DIH-T3pl.js";import{t as o}from"./paths-DW7MZKq4.js";import{A as s,D as c,f as l,n as u}from"./client-BceTZo8l.js";import{t as d}from"./useMutation-C85-R1yS.js";import{t as f}from"./icons-DwbbbSAF.js";import{t as p}from"./checkbox-DPnFtUmP.js";import{t as m}from"./input-Cgs-HrKU.js";import{a as h,n as g,t as _}from"./standard-schema-BUi2SUcs.js";import{a as v,i as y,r as b,t as x}from"./field-BBN0jAiq.js";import{t as S}from"./api-DD2QAZ93.js";import{n as C}from"./social-providers-CfJzPXtC.js";import{t as w}from"./header-BG26eIqD.js";import{n as T,r as E,t as D}from"./input-otp-Dw42Dkh0.js";import{LoginForm as O}from"./form-CBYPaU9Z.js";import{RegisterCta as k}from"./register-form--B3IZ_yH.js";import{InvitationDisclaimer as A}from"./invitation-disclaimer-7BLa9SD3.js";import{t as j}from"./auth-CMmCk3Zg.js";var M=e(t(),1),N=[c.PASSWORD,c.MAGIC_LINK,c.EMAIL_OTP],P=n(),F=(0,M.memo)(({redirectTo:e=o.dashboard.user.index})=>{let t=r(),{t:n}=i([`common`,`auth`]),s=h({resolver:_(u),defaultValues:{code:``,trustDevice:!1}}),c=d({...S.mutations.twoFactor.backupCodes.verify,onSuccess:()=>{t.replace(e)}});return(0,P.jsxs)(`form`,{id:`two-factor-backup-code-form`,onSubmit:s.handleSubmit(e=>c.mutateAsync(e)),className:`space-y-6`,children:[(0,P.jsx)(g,{name:`code`,control:s.control,render:({field:e,fieldState:t})=>(0,P.jsxs)(x,{"data-invalid":t.invalid,children:[(0,P.jsx)(y,{htmlFor:`two-factor-backup-code`,className:`sr-only`,children:n(`login.twoFactor.backupCode.placeholder`)}),(0,P.jsx)(m,{...e,id:`two-factor-backup-code`,type:`text`,autoFocus:!0,disabled:s.formState.isSubmitting,"aria-invalid":t.invalid,autoComplete:`one-time-code`,placeholder:n(`login.twoFactor.backupCode.placeholder`)}),t.invalid&&(0,P.jsx)(b,{errors:[t.error]})]})}),(0,P.jsx)(g,{name:`trustDevice`,control:s.control,render:({field:e,fieldState:t})=>(0,P.jsxs)(x,{orientation:`horizontal`,"data-invalid":t.invalid,className:`-mt-2 ml-px items-center`,children:[(0,P.jsx)(p,{id:`two-factor-backup-code-trust-device`,name:e.name,checked:e.value,onCheckedChange:e.onChange,disabled:s.formState.isSubmitting,"aria-invalid":t.invalid}),(0,P.jsx)(y,{htmlFor:`two-factor-backup-code-trust-device`,children:n(`login.twoFactor.trustDevice`)}),t.invalid&&(0,P.jsx)(b,{errors:[t.error]})]})}),(0,P.jsx)(a,{type:`submit`,className:`w-full`,size:`lg`,disabled:s.formState.isSubmitting,children:s.formState.isSubmitting?(0,P.jsx)(f.Loader2,{className:`animate-spin`}):n(`verify`)})]})}),I=(0,M.memo)(({onFactorChange:e})=>{let{t}=i([`auth`]);return(0,P.jsx)(`div`,{className:`flex items-center justify-center pt-2`,children:(0,P.jsx)(`button`,{type:`button`,onClick:()=>e(s.BACKUP_CODE),className:`text-muted-foreground hover:text-primary cursor-pointer pl-2 text-sm font-medium underline underline-offset-4`,children:t(`login.twoFactor.backupCode.cta`)})})}),L=(0,M.memo)(({redirectTo:e=o.dashboard.user.index})=>{let t=r(),{t:n}=i([`common`,`auth`]),s=h({resolver:_(l),defaultValues:{code:``,trustDevice:!1}}),c=d({...S.mutations.twoFactor.totp.verify,onSuccess:()=>{t.replace(e)}});return(0,P.jsxs)(`form`,{id:`two-factor-totp-form`,onSubmit:s.handleSubmit(e=>c.mutateAsync(e)),className:`space-y-6`,children:[(0,P.jsx)(g,{name:`code`,control:s.control,render:({field:e,fieldState:t})=>(0,P.jsxs)(x,{"data-invalid":t.invalid,children:[(0,P.jsx)(y,{htmlFor:`two-factor-totp-code`,className:`sr-only`,children:n(`code`)}),(0,P.jsx)(D,{...e,maxLength:6,autoFocus:!0,disabled:s.formState.isSubmitting,"aria-invalid":t.invalid,onComplete:s.handleSubmit(e=>c.mutateAsync(e)),children:(0,P.jsx)(T,{id:`two-factor-totp-code`,children:Array.from({length:6}).map((e,t)=>(0,P.jsx)(E,{index:t},t))})}),t.invalid&&(0,P.jsx)(b,{errors:[t.error]})]})}),(0,P.jsx)(g,{name:`trustDevice`,control:s.control,render:({field:e,fieldState:t})=>
1(0,P.jsxs)(x,{orientation:`horizontal`,"data-invalid":t.invalid,className:`-mt-2 ml-px items-center`,children:[(0,P.jsx)(p,{id:`two-factor-totp-trust-device`,name:e.name,checked:e.value,onCheckedChange:e.onChange,disabled:s.formState.isSubmitting,"aria-invalid":t.invalid}),(0,P.jsx)(y,{htmlFor:`two-factor-totp-trust-device`,children:n(`login.twoFactor.trustDevice`)}),t.invalid&&(0,P.jsx)(b,{errors:[t.error]})]})}),(0,P.jsx)(a,{type:`submit`,className:`w-full`,size:`lg`,disabled:s.formState.isSubmitting,children:s.formState.isSubmitting?(0,P.jsx)(f.Loader2,{className:`animate-spin`}):n(`verify`)})]})}),R=(0,M.memo)(({onFactorChange:e})=>{let{t}=i([`auth`]);return(0,P.jsx)(`div`,{className:`flex items-center justify-center pt-2`,children:(0,P.jsx)(`button`,{type:`button`,onClick:()=>e(s.TOTP),className:`text-muted-foreground hover:text-primary cursor-pointer pl-2 text-sm font-medium underline underline-offset-4`,children:t(`login.twoFactor.totp.cta`)})})}),z={[s.TOTP]:L,[s.BACKUP_CODE]:F},B={[s.TOTP]:R,[s.BACKUP_CODE
1]:I},V={FORM:`form`,TWO_FACTOR:`twoFactor`},H=({redirectTo:e,invitationId:t,email:n})=>{let[r,i]=(0,M.useState)(V.FORM);switch(r){case V.FORM:return(0,P.jsx)(U,{redirectTo:e,invitationId:t,email:n,onTwoFactorRedirect:()=>i(V.TWO_FACTOR)});case V.TWO_FACTOR:return(0,P.jsx)(W,{redirectTo:e})}},U=(0,M.memo)(({redirectTo:e,invitationId:t,email:n,onTwoFactorRedirect:r})=>{let{t:a}=i(`auth`),o=Object.entries(j.providers).filter(([e,t])=>t&&N.includes(e)).map(([e])=>e);return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(w,{title:a(`login.header.title`),description:a(`login.header.description`)}),t&&(0,P.jsx)(A,{}),(0,P.jsx)(`div`,{className:`flex flex-col gap-2`,children:(0,P.jsx)(C,{providers:j.providers.oAuth,redirectTo:e,context:`signin`})}),j.providers.oAuth.length>0&&o.length>0&&(0,P.jsx)(v,{children:a(`divider`)}),(0,P.jsx)(`div`,{className:`flex flex-col gap-2`,children:(0,P.jsx)(O,{options:o,redirectTo:e,email:n,onTwoFactorRedirect:r})}),(0,P.jsx)(k,{})]})}),W=(0,M.memo)(({redirectTo:e})=>{let[t,n]=(0,M.useState)(s.TOTP),{t:r}=i(`auth`),a=z[t],o=t===s.TOTP?B[s.BACKUP_CODE]:B[s.TOTP];return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(w,{title:r(`login.twoFactor.${t}.header.title`),description:r(`login.twoFactor.${t}.header.description`)}),(0,P.jsx)(a,{redirectTo:e}),(0,P.jsx)(o,{onFactorChange:n})]})});export{H as LoginFlow};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.