@firebase-oss/ui-react 0.0.1

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 ADDED
@@ -0,0 +1,3 @@
1
+ import {registerFramework,getBehavior,createSignInAuthFormSchema,createSignUpAuthFormSchema,createForgotPasswordAuthFormSchema,createEmailLinkAuthFormSchema,createPhoneAuthNumberFormSchema,createPhoneAuthVerifyFormSchema,createMultiFactorPhoneAuthNumberFormSchema,createMultiFactorPhoneAuthVerifyFormSchema,createMultiFactorTotpAuthNumberFormSchema,createMultiFactorTotpAuthVerifyFormSchema,getTranslation,sendSignInLinkToEmail,FirebaseUIError,completeEmailLinkSignIn,sendPasswordResetEmail,verifyPhoneNumber,confirmPhoneNumber,signInWithEmailAndPassword,hasBehavior,createUserWithEmailAndPassword,signInWithMultiFactorAssertion,signInWithProvider,formatPhoneNumber,generateTotpQrCode,enrollWithMultiFactorAssertion,generateTotpSecret}from'@firebase-oss/ui-core';import {createContext,forwardRef,useState,useCallback,useImperativeHandle,useContext,useMemo,useRef,useEffect,cloneElement}from'react';import {useStore}from'@nanostores/react';import {jsx,jsxs,Fragment}from'react/jsx-runtime';import {createFormHookContexts,createFormHook}from'@tanstack/react-form';import {Slot}from'@radix-ui/react-slot';import {buttonVariant}from'@firebase-oss/ui-styles';import {twMerge}from'tailwind-merge';import {clsx}from'clsx';import {FactorId,TotpMultiFactorGenerator,PhoneAuthProvider,PhoneMultiFactorGenerator,OAuthProvider,FacebookAuthProvider,GithubAuthProvider,GoogleAuthProvider,TwitterAuthProvider,multiFactor}from'firebase/auth';var Qt={version:"0.0.1"};var yt=createContext({});function be({children:t,ui:e,policies:r}){let o=useStore(e);return jsx(yt.Provider,{value:o,children:jsx(Yt,{policies:r,children:t})})}function s(){let t=useContext(yt);if(!t)throw new Error("No FirebaseUI context found. Your application must be wrapped in a <FirebaseUIProvider> component.");return t}function Kt(){let t=s();return useMemo(()=>{if(t.redirectError)return t.redirectError instanceof Error?t.redirectError.message:String(t.redirectError)},[t.redirectError])}function Xt(){let t=s();return useMemo(()=>createSignInAuthFormSchema(t),[t])}function Zt(){let t=s();return useMemo(()=>createSignUpAuthFormSchema(t),[t])}function jt(){let t=s();return useMemo(()=>createForgotPasswordAuthFormSchema(t),[t])}function tr(){let t=s();return useMemo(()=>createEmailLinkAuthFormSchema(t),[t])}function rr(){let t=s();return useMemo(()=>createPhoneAuthNumberFormSchema(t),[t])}function er(){let t=s();return useMemo(()=>createPhoneAuthVerifyFormSchema(t),[t])}function it(){let t=s();return useMemo(()=>createMultiFactorPhoneAuthNumberFormSchema(t),[t])}function st(){let t=s();return useMemo(()=>createMultiFactorPhoneAuthVerifyFormSchema(t),[t])}function or(){let t=s();return useMemo(()=>createMultiFactorTotpAuthNumberFormSchema(t),[t])}function at(){let t=s();return useMemo(()=>createMultiFactorTotpAuthVerifyFormSchema(t),[t])}function O(t){let e=s(),r=useRef(null),o=useRef(e),n=useRef(null);return o.current=e,useEffect(()=>{let i=t.current,a=o.current;i!==n.current&&(n.current=i,i?(r.current=getBehavior(a,"recaptchaVerification")(a,i),r.current.render()):r.current=null);},[t]),r.current}var At=createContext(void 0);function Yt({children:t,policies:e}){return jsx(At.Provider,{value:e,children:t})}function b(){let t=s(),e=useContext(At);if(!e)return null;let{termsOfServiceUrl:r,privacyPolicyUrl:o,onNavigate:n}=e,a=getTranslation(t,"messages","termsAndPrivacy").split(/(\{tos\}|\{privacy\})/),N=n?jsx("button",{}):jsx("a",{target:"_blank",rel:"noopener noreferrer"});return jsx("div",{className:"fui-policies",children:a.map((y,T)=>y==="{tos}"?cloneElement(N,{key:T,onClick:n?()=>n(r):void 0,href:n?void 0:r,children:getTranslation(t,"labels","termsOfService")}):y==="{privacy}"?cloneElement(N,{key:T,onClick:n?()=>n(o):void 0,href:n?void 0:o,children:getTranslation(t,"labels","privacyPolicy")}):jsx("span",{children:y},T))})}function u(...t){return twMerge(clsx(...t))}function I({className:t,variant:e="primary",asChild:r,...o}){return jsx(r?Slot:"button",{className:u(buttonVariant({variant:e}),t),...o})}var{fieldContext:We,useFieldContext:qe,formContext:ze,useFormContext:ir}=createFormHookContexts();function $e({className:t,...e}){return !e.field.state.meta.isTouched||!e.field.state.meta.errors.length?null:jsx("div",{children:jsx("div",{role:"alert","aria-live":"polite",className:u("fui-form__error",t),...e,children:e.field.state.meta.errors.map(r=>r.message).join(", ")})})}function Qe({children:t,before:e,label:r,action:o,...n}){let i=qe();return jsxs("label",{htmlFor:i.name,children:[jsxs("div",{"data-input-label":true,children:[jsx("div",{children:r}),o?jsx("div",{children:o}):null]}),jsxs("div",{"data-input-group":true,children:[e,jsx("input",{...n,"aria-invalid":i.state.meta.isTouched&&i.state.meta.errors.length>0,id:i.name,name:i.name,value:i.state.value,onBlur:()=>{i.handleBlur();},onChange:a=>{i.handleChange(a.target.value);}})]}),t?jsx(Fragment,{children:t}):null,jsx($e,{field:i})]})}function Je({className:t,...e}){return jsx("button",{type:"button",...e,className:u("fui-form__action",t)})}function Ye(t){let e=ir();return jsx(e.Subscribe,{selector:r=>r.isSubmitting,children:r=>jsx(I,{...t,type:"submit",disabled:r})})}function Ke(){let t=ir();return jsx(t.Subscribe,{selector:e=>[e.errorMap],children:([e])=>e?.onSubmit&&typeof e.onSubmit=="string"?jsx("div",{className:"fui-form__error",children:e.onSubmit}):null})}var m=createFormHook({fieldComponents:{Input:Qe},formComponents:{SubmitButton:Ye,ErrorMessage:Ke,Action:Je},fieldContext:We,formContext:ze});function ar(){let t=s();return useCallback(async({email:e})=>{try{return await sendSignInLinkToEmail(t,e)}catch(r){throw r instanceof FirebaseUIError?new Error(r.message):(console.error(r),new Error(getTranslation(t,"errors","unknownError")))}},[t])}function ur(t){let e=tr(),r=ar();return m.useAppForm({defaultValues:{email:""},validators:{onBlur:e,onSubmit:e,onSubmitAsync:async({value:o})=>{try{return await r(o),t?.()}catch(n){return n instanceof Error?n.message:String(n)}}}})}function mr(t){let e=s();useEffect(()=>{(async()=>{let o=await completeEmailLinkSignIn(e,window.location.href);o&&t?.(o);})();},[e,t]);}function Ct({onEmailSent:t,onSignIn:e}){let r=s(),[o,n]=useState(false),i=ur(()=>{n(!0),t?.();});return mr(e),o?jsx("div",{className:"fui-success",children:getTranslation(r,"messages","signInLinkSent")}):jsx("form",{className:"fui-form",onSubmit:async a=>{a.preventDefault(),a.stopPropagation(),await i.handleSubmit();},children:jsxs(i.AppForm,{children:[jsx("fieldset",{children:jsx(i.AppField,{name:"email",children:a=>jsx(a.Input,{label:getTranslation(r,"labels","emailAddress"),type:"email"})})}),jsx(b,{}),jsxs("fieldset",{children:[jsx(i.SubmitButton,{children:getTranslation(r,"labels","sendSignInLink")}),jsx(i.ErrorMessage,{})]})]})})}function lr(){let t=s();return useCallback(async({email:e})=>{try{return await sendPasswordResetEmail(t,e)}catch(r){throw r instanceof FirebaseUIError?new Error(r.message):(console.error(r),new Error(getTranslation(t,"errors","unknownError")))}},[t])}function pr(t){let e=jt(),r=lr();return m.useAppForm({defaultValues:{email:""},validators:{onBlur:e,onSubmit:e,onSubmitAsync:async({value:o})=>{try{return await r(o),t?.()}catch(n){return n instanceof Error?n.message:String(n)}}}})}function It({onBackToSignInClick:t,onPasswordSent:e}){let r=s(),[o,n]=useState(false),i=pr(()=>{n(!0),e?.();});return o?jsx("div",{className:"fui-success",children:getTranslation(r,"messages","checkEmailForReset")}):jsx("form",{className:"fui-form",onSubmit:async a=>{a.preventDefault(),a.stopPropagation(),await i.handleSubmit();},children:jsxs(i.AppForm,{children:[jsx("fieldset",{children:jsx(i.AppField,{name:"email",children:a=>jsx(a.Input,{label:getTranslation(r,"labels","emailAddress"),type:"email"})})}),jsx(b,{}),jsxs("fieldset",{children:[jsx(i.SubmitButton,{children:getTranslation(r,"labels","resetPassword")}),jsx(i.ErrorMessage,{})]}),t?jsx(i.Action,{onClick:t,children:getTranslation(r,"labels","backToSignIn")}):null]})})}function dr(){let t=s();return getBehavior(t,"countryCodes")().allowedCountries}function hr(){let t=s();return getBehavior(t,"countryCodes")().defaultCountry}var W=forwardRef(({className:t,...e},r)=>{let o=dr(),n=hr(),[i,a]=useState(n),N=useCallback(y=>{let T=o.find(gt=>gt.code===y);a(T);},[o]);return useImperativeHandle(r,()=>({getCountry:()=>i,setCountry:N}),[i,N]),jsx("div",{className:u("fui-country-selector",t),...e,children:jsxs("div",{className:"fui-country-selector__wrapper",children:[jsx("span",{className:"fui-country-selector__flag",children:i.emoji}),jsxs("div",{className:"fui-country-selector__select-wrapper",children:[jsx("span",{className:"fui-country-selector__dial-code",children:i.dialCode}),jsx("select",{className:"fui-country-selector__select",value:i.code,onChange:y=>{let T=o.find(gt=>gt.code===y.target.value);T&&a(T);},children:o.map(y=>jsxs("option",{value:y.code,children:[y.dialCode," (",y.name,")"]},`${y.code}-${y.dialCode}`))})]})]})})});W.displayName="CountrySelector";function yr(){let t=s();return useCallback(async({phoneNumber:e,recaptchaVerifier:r})=>await verifyPhoneNumber(t,e,r),[t])}function br({recaptchaVerifier:t,onSuccess:e,formatPhoneNumber:r}){let o=yr(),n=rr();return m.useAppForm({defaultValues:{phoneNumber:""},validators:{onBlur:n,onSubmit:n,onSubmitAsync:async({value:i})=>{try{let a=r?r(i.phoneNumber):i.phoneNumber,N=await o({phoneNumber:a,recaptchaVerifier:t});return e(N)}catch(a){return a instanceof FirebaseUIError?a.message:String(a)}}}})}function So(t){let e=s(),r=useRef(null),o=O(r),n=useRef(null),i=br({recaptchaVerifier:o,onSuccess:t.onSubmit,formatPhoneNumber:a=>formatPhoneNumber(a,n.current.getCountry())});return jsx("form",{className:"fui-form",onSubmit:async a=>{a.preventDefault(),a.stopPropagation(),await i.handleSubmit();},children:jsxs(i.AppForm,{children:[jsx("fieldset",{children:jsx(i.AppField,{name:"phoneNumber",children:a=>jsx(a.Input,{label:getTranslation(e,"labels","phoneNumber"),type:"tel",before:jsx(W,{ref:n})})})}),jsx("fieldset",{children:jsx("div",{className:"fui-recaptcha-container",ref:r})}),jsx(b,{}),jsxs("fieldset",{children:[jsx(i.SubmitButton,{children:getTranslation(e,"labels","sendCode")}),jsx(i.ErrorMessage,{})]})]})})}function vr(){let t=s();return useCallback(async({verificationId:e,verificationCode:r})=>await confirmPhoneNumber(t,e,r),[t])}function Ar({verificationId:t,onSuccess:e}){let r=er(),o=vr();return m.useAppForm({defaultValues:{verificationId:t,verificationCode:""},validators:{onSubmit:r,onBlur:r,onSubmitAsync:async({value:n})=>{try{let i=await o(n);return e(i)}catch(i){return i instanceof FirebaseUIError?i.message:String(i)}}}})}function go(t){let e=s(),r=Ar({verificationId:t.verificationId,onSuccess:t.onSuccess});return jsx("form",{className:"fui-form",onSubmit:async o=>{o.preventDefault(),o.stopPropagation(),await r.handleSubmit();},children:jsxs(r.AppForm,{children:[jsx("fieldset",{children:jsx(r.AppField,{name:"verificationCode",children:o=>jsx(o.Input,{label:getTranslation(e,"labels","verificationCode"),type:"text"})})}),jsxs("fieldset",{children:[jsx(r.SubmitButton,{children:getTranslation(e,"labels","verifyCode")}),jsx(r.ErrorMessage,{})]})]})})}function wt(t){let[e,r]=useState(null);return e?jsx(go,{verificationId:e,onSuccess:o=>{t.onSignIn?.(o);}}):jsx(So,{onSubmit:r})}function Pr(){let t=s();return useCallback(async({email:e,password:r})=>{try{return await signInWithEmailAndPassword(t,e,r)}catch(o){throw o instanceof FirebaseUIError?new Error(o.message):(console.error(o),new Error(getTranslation(t,"errors","unknownError")))}},[t])}function Cr(t){let e=Xt(),r=Pr();return m.useAppForm({defaultValues:{email:"",password:""},validators:{onBlur:e,onSubmit:e,onSubmitAsync:async({value:o})=>{try{let n=await r(o);return t?.(n)}catch(n){return n instanceof Error?n.message:String(n)}}}})}function Et({onSignIn:t,onForgotPasswordClick:e,onSignUpClick:r}){let o=s(),n=Cr(t);return jsx("form",{className:"fui-form",onSubmit:async i=>{i.preventDefault(),i.stopPropagation(),await n.handleSubmit();},children:jsxs(n.AppForm,{children:[jsx("fieldset",{children:jsx(n.AppField,{name:"email",children:i=>jsx(i.Input,{label:getTranslation(o,"labels","emailAddress"),type:"email"})})}),jsx("fieldset",{children:jsx(n.AppField,{name:"password",children:i=>jsx(i.Input,{label:getTranslation(o,"labels","password"),type:"password",action:e?jsx(n.Action,{onClick:e,children:getTranslation(o,"labels","forgotPassword")}):null})})}),jsx(b,{}),jsxs("fieldset",{children:[jsx(n.SubmitButton,{children:getTranslation(o,"labels","signIn")}),jsx(n.ErrorMessage,{})]}),r?jsxs(n.Action,{onClick:r,children:[getTranslation(o,"prompts","noAccount")," ",getTranslation(o,"labels","signUp")]}):null]})})}function Tt(){let t=s();return hasBehavior(t,"requireDisplayName")}function Ir(){let t=s();return useCallback(async({email:e,password:r,displayName:o})=>{try{return await createUserWithEmailAndPassword(t,e,r,o)}catch(n){throw n instanceof FirebaseUIError?new Error(n.message):(console.error(n),new Error(getTranslation(t,"errors","unknownError")))}},[t])}function xr(t){let e=Zt(),r=Ir(),o=Tt();return m.useAppForm({defaultValues:{email:"",password:"",displayName:o?"":void 0},validators:{onBlur:e,onSubmit:e,onSubmitAsync:async({value:n})=>{try{let i=await r(n);return t?.(i)}catch(i){return i instanceof Error?i.message:String(i)}}}})}function Vt({onBackToSignInClick:t,onSignUp:e}){let r=s(),o=xr(e),n=Tt();return jsx("form",{className:"fui-form",onSubmit:async i=>{i.preventDefault(),i.stopPropagation(),await o.handleSubmit();},children:jsxs(o.AppForm,{children:[n?jsx("fieldset",{children:jsx(o.AppField,{name:"displayName",children:i=>jsx(i.Input,{label:getTranslation(r,"labels","displayName")})})}):null,jsx("fieldset",{children:jsx(o.AppField,{name:"email",children:i=>jsx(i.Input,{label:getTranslation(r,"labels","emailAddress"),type:"email"})})}),jsx("fieldset",{children:jsx(o.AppField,{name:"password",children:i=>jsx(i.Input,{label:getTranslation(r,"labels","password"),type:"password"})})}),jsx(b,{}),jsxs("fieldset",{children:[jsx(o.SubmitButton,{children:getTranslation(r,"labels","createAccount")}),jsx(o.ErrorMessage,{})]}),t?jsxs(o.Action,{onClick:t,children:[getTranslation(r,"prompts","haveAccount")," ",getTranslation(r,"labels","signIn")]}):null]})})}function M({className:t,children:e,...r}){return e?jsxs("div",{className:u("fui-divider",t),...r,children:[jsx("div",{className:"fui-divider__line"}),jsx("div",{className:"fui-divider__text",children:e}),jsx("div",{className:"fui-divider__line"})]}):jsx("div",{className:u("fui-divider",t),...r,children:jsx("div",{className:"fui-divider__line"})})}function f({children:t,className:e,...r}){return jsx("div",{className:u("fui-card",e),...r,children:t})}function d({children:t,className:e,...r}){return jsx("div",{className:u("fui-card__header",e),...r,children:t})}function h({children:t,className:e,...r}){return jsx("h2",{className:u("fui-card__title",e),...r,children:t})}function F({children:t,className:e,...r}){return jsx("p",{className:u("fui-card__subtitle",e),...r,children:t})}function S({children:t,className:e,...r}){return jsx("div",{className:u("fui-card__content",e),...r,children:t})}function w(){let t=Kt();return t?jsx("div",{className:"fui-form__error",children:t}):null}function No({children:t,onEmailSent:e}){let r=s(),o=getTranslation(r,"labels","signIn"),n=getTranslation(r,"prompts","signInToAccount");return jsx("div",{className:"fui-screen",children:jsxs(f,{children:[jsxs(d,{children:[jsx(h,{children:o}),jsx(F,{children:n})]}),jsxs(S,{children:[jsx(Ct,{onEmailSent:e}),t?jsxs(Fragment,{children:[jsx(M,{children:getTranslation(r,"messages","dividerOr")}),jsxs("div",{className:"fui-screen__children",children:[t,jsx(w,{})]})]}):null]})]})})}function Mo(t){let e=s(),r=getTranslation(e,"labels","resetPassword"),o=getTranslation(e,"prompts","enterEmailToReset");return jsx("div",{className:"fui-screen",children:jsxs(f,{children:[jsxs(d,{children:[jsx(h,{children:r}),jsx(F,{children:o})]}),jsx(S,{children:jsx(It,{...t})})]})})}function Tr(){let t=s();return useCallback(async({verificationCode:e,hint:r})=>{let o=TotpMultiFactorGenerator.assertionForSignIn(r.uid,e);return await signInWithMultiFactorAssertion(t,o)},[t])}function ko({hint:t,onSuccess:e}){let r=Tr(),o=at();return m.useAppForm({defaultValues:{verificationCode:""},validators:{onSubmit:o,onBlur:o,onSubmitAsync:async({value:n})=>{try{return await r({verificationCode:n.verificationCode,hint:t}),e()}catch(i){return i instanceof FirebaseUIError?i.message:String(i)}}}})}function Bt(t){let e=s(),r=ko({hint:t.hint,onSuccess:()=>{t.onSuccess?.();}});return jsx("form",{className:"fui-form",onSubmit:async o=>{o.preventDefault(),o.stopPropagation(),await r.handleSubmit();},children:jsxs(r.AppForm,{children:[jsx("fieldset",{children:jsx(r.AppField,{name:"verificationCode",children:o=>jsx(o.Input,{label:getTranslation(e,"labels","verificationCode"),type:"text",placeholder:"123456",maxLength:6})})}),jsxs("fieldset",{children:[jsx(r.SubmitButton,{children:getTranslation(e,"labels","verifyCode")}),jsx(r.ErrorMessage,{})]})]})})}function Br(){let t=s();return useCallback(async({hint:e,recaptchaVerifier:r})=>await verifyPhoneNumber(t,"",r,void 0,e),[t])}function Oo({hint:t,recaptchaVerifier:e,onSuccess:r}){let o=Br(),n=it();return m.useAppForm({defaultValues:{phoneNumber:t.phoneNumber||""},validators:{onBlur:n,onSubmit:n,onSubmitAsync:async()=>{try{let i=await o({hint:t,recaptchaVerifier:e});return r(i)}catch(i){return i instanceof FirebaseUIError?i.message:String(i)}}}})}function Wo(t){let e=s(),r=useRef(null),o=O(r),n=Oo({hint:t.hint,recaptchaVerifier:o,onSuccess:t.onSubmit});return jsx("form",{className:"fui-form",onSubmit:async i=>{i.preventDefault(),i.stopPropagation(),await n.handleSubmit();},children:jsxs(n.AppForm,{children:[jsx("fieldset",{children:jsx(n.AppField,{name:"phoneNumber",children:i=>jsx(i.Input,{label:getTranslation(e,"labels","phoneNumber"),type:"tel",disabled:true,value:t.hint.phoneNumber||""})})}),jsx("fieldset",{children:jsx("div",{className:"fui-recaptcha-container",ref:r})}),jsxs("fieldset",{children:[jsx(n.SubmitButton,{children:getTranslation(e,"labels","sendCode")}),jsx(n.ErrorMessage,{})]})]})})}function kr(){let t=s();return useCallback(async({verificationId:e,verificationCode:r})=>{let o=PhoneAuthProvider.credential(e,r),n=PhoneMultiFactorGenerator.assertion(o);return await signInWithMultiFactorAssertion(t,n)},[t])}function qo({verificationId:t,onSuccess:e}){let r=kr(),o=st();return m.useAppForm({defaultValues:{verificationId:t,verificationCode:""},validators:{onSubmit:o,onBlur:o,onSubmitAsync:async({value:n})=>{try{return await r(n),e()}catch(i){return i instanceof FirebaseUIError?i.message:String(i)}}}})}function zo(t){let e=s(),r=qo({verificationId:t.verificationId,onSuccess:t.onSuccess});return jsx("form",{className:"fui-form",onSubmit:async o=>{o.preventDefault(),o.stopPropagation(),await r.handleSubmit();},children:jsxs(r.AppForm,{children:[jsx("fieldset",{children:jsx(r.AppField,{name:"verificationCode",children:o=>jsx(o.Input,{label:getTranslation(e,"labels","verificationCode"),type:"text"})})}),jsxs("fieldset",{children:[jsx(r.SubmitButton,{children:getTranslation(e,"labels","verifyCode")}),jsx(r.ErrorMessage,{})]})]})})}function kt(t){let[e,r]=useState(null);return e?jsx(zo,{verificationId:e.verificationId,onSuccess:()=>{t.onSuccess?.();}}):jsx(Wo,{hint:t.hint,onSubmit:o=>r({verificationId:o})})}function U(){let e=s().multiFactorResolver;if(!e)throw new Error("MultiFactorAuthAssertionForm requires a multi-factor resolver");let[r,o]=useState(e.hints.length===1?e.hints[0]:void 0);if(r){if(r.factorId===PhoneMultiFactorGenerator.FACTOR_ID)return jsx(kt,{hint:r});if(r.factorId===TotpMultiFactorGenerator.FACTOR_ID)return jsx(Bt,{hint:r})}return jsxs("div",{className:"fui-content",children:[jsx("p",{children:"TODO: Select a multi-factor authentication method"}),e.hints.map(n=>n.factorId===TotpMultiFactorGenerator.FACTOR_ID?jsx(Qo,{onClick:()=>o(n)},n.factorId):n.factorId===PhoneMultiFactorGenerator.FACTOR_ID?jsx(Jo,{onClick:()=>o(n)},n.factorId):null)]})}function Qo(t){let e=s(),r=getTranslation(e,"labels","mfaTotpVerification");return jsx(I,{...t,children:r})}function Jo(t){let e=s(),r=getTranslation(e,"labels","mfaSmsVerification");return jsx(I,{...t,children:r})}function Ko({children:t}){let e=s(),r=getTranslation(e,"labels","signIn"),o=getTranslation(e,"prompts","signInToAccount"),n=e.multiFactorResolver;return jsx("div",{className:"fui-screen",children:jsxs(f,{children:[jsxs(d,{children:[jsx(h,{children:r}),jsx(F,{children:o})]}),jsx(S,{className:"fui-screen__children",children:n?jsx(U,{}):jsxs(Fragment,{children:[t,jsx(w,{}),jsx(b,{})]})})]})})}function Zo({children:t,...e}){let r=s(),o=getTranslation(r,"labels","signIn"),n=getTranslation(r,"prompts","signInToAccount"),i=r.multiFactorResolver;return jsx("div",{className:"fui-screen",children:jsxs(f,{children:[jsxs(d,{children:[jsx(h,{children:o}),jsx(F,{children:n})]}),jsx(S,{children:i?jsx(U,{}):jsxs(Fragment,{children:[jsx(wt,{...e}),t?jsxs(Fragment,{children:[jsx(M,{children:getTranslation(r,"messages","dividerOr")}),jsxs("div",{className:"fui-screen__children",children:[t,jsx(w,{})]})]}):null]})})]})})}function jo({children:t,...e}){let r=s(),o=getTranslation(r,"labels","signIn"),n=getTranslation(r,"prompts","signInToAccount"),i=r.multiFactorResolver;return jsx("div",{className:"fui-screen",children:jsxs(f,{children:[jsxs(d,{children:[jsx(h,{children:o}),jsx(F,{children:n})]}),jsx(S,{children:i?jsx(U,{}):jsxs(Fragment,{children:[jsx(Et,{...e}),t?jsxs(Fragment,{children:[jsx(M,{children:getTranslation(r,"messages","dividerOr")}),jsxs("div",{className:"fui-screen__children",children:[t,jsx(w,{})]})]}):null]})})]})})}function tn({children:t,...e}){let r=s(),o=getTranslation(r,"labels","signUp"),n=getTranslation(r,"prompts","enterDetailsToCreate"),i=r.multiFactorResolver;return jsx("div",{className:"fui-screen",children:jsxs(f,{children:[jsxs(d,{children:[jsx(h,{children:o}),jsx(F,{children:n})]}),jsx(S,{children:i?jsx(U,{}):jsxs(Fragment,{children:[jsx(Vt,{...e}),t?jsxs(Fragment,{children:[jsx(M,{children:getTranslation(r,"messages","dividerOr")}),jsxs("div",{className:"fui-screen__children",children:[t,jsx(w,{})]})]}):null]})})]})})}function qr(t){let e=s(),[r,o]=useState(null),n=useCallback(async()=>{o(null);try{await signInWithProvider(e,t);}catch(i){if(i instanceof FirebaseUIError){o(i.message);return}console.error(i),o(getTranslation(e,"errors","unknownError"));}},[e,t,o]);return {error:r,callback:n}}function A({provider:t,children:e,themed:r}){let o=s(),{error:n,callback:i}=qr(t);return jsxs("div",{children:[jsx(I,{type:"button","data-themed":r,"data-provider":t.providerId,disabled:o.state!=="idle",onClick:i,className:"fui-provider__button",children:e}),n&&jsx("div",{className:"fui-form__error",children:n})]})}var un=t=>jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 50 50",...t,children:jsx("path",{fill:"currentColor",d:"M44.527 34.75c-1.078 2.395-1.597 3.465-2.984 5.578-1.941 2.953-4.68 6.64-8.063 6.664-3.011.028-3.789-1.965-7.878-1.93-4.086.02-4.938 1.97-7.954 1.938-3.386-.031-5.976-3.352-7.918-6.3-5.43-8.27-6.003-17.966-2.648-23.122 2.375-3.656 6.129-5.805 9.656-5.805 3.594 0 5.852 1.973 8.82 1.973 2.883 0 4.637-1.976 8.794-1.976 3.14 0 6.46 1.71 8.836 4.664-7.766 4.257-6.504 15.347 1.34 18.316M31.195 8.469c1.512-1.942 2.66-4.68 2.242-7.469-2.464.168-5.347 1.742-7.03 3.781-1.528 1.86-2.794 4.617-2.302 7.285 2.692.086 5.477-1.52 7.09-3.597"})}),$r=un;function ln({provider:t,themed:e}){let r=s();return jsxs(A,{provider:t||new OAuthProvider("apple.com"),themed:e,children:[jsx(Qr,{}),jsx("span",{children:getTranslation(r,"labels","signInWithApple")})]})}function Qr({className:t,...e}){return jsx($r,{className:u("fui-provider__icon",t),...e})}var fn=t=>jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 50 50",...t,children:jsx("path",{fill:"currentColor",d:"M25 3C12.85 3 3 12.85 3 25c0 11.03 8.125 20.137 18.712 21.728V30.831h-5.443v-5.783h5.443V21.2c0-6.371 3.104-9.168 8.399-9.168 2.536 0 3.877.188 4.512.274v5.048h-3.612c-2.248 0-3.033 2.131-3.033 4.533v3.161h6.588l-.894 5.783h-5.694v15.944C38.716 45.318 47 36.137 47 25c0-12.15-9.85-22-22-22"})}),Yr=fn;function Fn({provider:t,themed:e}){let r=s();return jsxs(A,{provider:t||new FacebookAuthProvider,themed:e,children:[jsx(Kr,{}),jsx("span",{children:getTranslation(r,"labels","signInWithFacebook")})]})}function Kr({className:t,...e}){return jsx(Yr,{className:u("fui-provider__icon",t),...e})}var gn=t=>jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 30 30",...t,children:jsx("path",{d:"M15 3C8.373 3 3 8.373 3 15c0 5.623 3.872 10.328 9.092 11.63a1.8 1.8 0 0 1-.092-.583v-2.051h-1.508c-.821 0-1.551-.353-1.905-1.009-.393-.729-.461-1.844-1.435-2.526-.289-.227-.069-.486.264-.451.615.174 1.125.596 1.605 1.222.478.627.703.769 1.596.769.433 0 1.081-.025 1.691-.121.328-.833.895-1.6 1.588-1.962-3.996-.411-5.903-2.399-5.903-5.098 0-1.162.495-2.286 1.336-3.233-.276-.94-.623-2.857.106-3.587 1.798 0 2.885 1.166 3.146 1.481A9 9 0 0 1 15.495 9c1.036 0 2.024.174 2.922.483C18.675 9.17 19.763 8 21.565 8c.732.731.381 2.656.102 3.594.836.945 1.328 2.066 1.328 3.226 0 2.697-1.904 4.684-5.894 5.097C18.199 20.49 19 22.1 19 23.313v2.734c0 .104-.023.179-.035.268C23.641 24.676 27 20.236 27 15c0-6.627-5.373-12-12-12"})}),Zr=gn;function vn({provider:t,themed:e}){let r=s();return jsxs(A,{provider:t||new GithubAuthProvider,themed:e,children:[jsx(jr,{}),jsx("span",{children:getTranslation(r,"labels","signInWithGitHub")})]})}function jr({className:t,...e}){return jsx(Zr,{className:u("fui-provider__icon",t),...e})}var Pn=t=>jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 48 48",...t,children:[jsx("path",{fill:"#FFC107",d:"M43.611 20.083H42V20H24v8h11.303c-1.649 4.657-6.08 8-11.303 8-6.627 0-12-5.373-12-12s5.373-12 12-12c3.059 0 5.842 1.154 7.961 3.039l5.657-5.657C34.046 6.053 29.268 4 24 4 12.955 4 4 12.955 4 24s8.955 20 20 20 20-8.955 20-20c0-1.341-.138-2.65-.389-3.917"}),jsx("path",{fill:"#FF3D00",d:"m6.306 14.691 6.571 4.819C14.655 15.108 18.961 12 24 12c3.059 0 5.842 1.154 7.961 3.039l5.657-5.657C34.046 6.053 29.268 4 24 4 16.318 4 9.656 8.337 6.306 14.691"}),jsx("path",{fill:"#4CAF50",d:"M24 44c5.166 0 9.86-1.977 13.409-5.192l-6.19-5.238A11.9 11.9 0 0 1 24 36c-5.202 0-9.619-3.317-11.283-7.946l-6.522 5.025C9.505 39.556 16.227 44 24 44"}),jsx("path",{fill:"#1976D2",d:"M43.611 20.083H42V20H24v8h11.303a12.04 12.04 0 0 1-4.087 5.571l.003-.002 6.19 5.238C36.971 39.205 44 34 44 24c0-1.341-.138-2.65-.389-3.917"})]}),te=Pn;function wn({provider:t,themed:e}){let r=s();return jsxs(A,{provider:t||new GoogleAuthProvider,themed:e,children:[jsx(re,{}),jsx("span",{children:getTranslation(r,"labels","signInWithGoogle")})]})}function re({className:t,...e}){return jsx(te,{className:u("fui-provider__icon",t),...e})}var En=t=>jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 48 48",...t,children:[jsx("path",{fill:"#ff5722",d:"M22 22H6V6h16z"}),jsx("path",{fill:"#4caf50",d:"M42 22H26V6h16z"}),jsx("path",{fill:"#ffc107",d:"M42 42H26V26h16z"}),jsx("path",{fill:"#03a9f4",d:"M22 42H6V26h16z"})]}),ee=En;function Un({provider:t,themed:e}){let r=s();return jsxs(A,{provider:t||new OAuthProvider("microsoft.com"),themed:e,children:[jsx(oe,{}),jsx("span",{children:getTranslation(r,"labels","signInWithMicrosoft")})]})}function oe({className:t,...e}){return jsx(ee,{className:u("fui-provider__icon",t),...e})}var kn=t=>jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 30 30",...t,children:jsx("path",{d:"m26.37 26-8.795-12.822.015.012L25.52 4h-2.65l-6.46 7.48L11.28 4H4.33l8.211 11.971-.001-.001L3.88 26h2.65l7.182-8.322L19.42 26zM10.23 6l12.34 18h-2.1L8.12 6z"})}),ie=kn;function Ln({provider:t,themed:e}){let r=s();return jsxs(A,{provider:t||new TwitterAuthProvider,themed:e,children:[jsx(se,{}),jsx("span",{children:getTranslation(r,"labels","signInWithTwitter")})]})}function se({className:t,...e}){return jsx(ie,{className:u("fui-provider__icon",t),...e})}function Qn(){let t=s();return useCallback(async({phoneNumber:e,recaptchaVerifier:r})=>{let o=multiFactor(t.auth.currentUser);return await verifyPhoneNumber(t,e,r,o)},[t])}function Jn({recaptchaVerifier:t,onSuccess:e,formatPhoneNumber:r}){let o=Qn(),n=it();return m.useAppForm({defaultValues:{displayName:"",phoneNumber:""},validators:{onBlur:n,onSubmit:n,onSubmitAsync:async({value:i})=>{try{let a=r?r(i.phoneNumber):i.phoneNumber,N=await o({phoneNumber:a,recaptchaVerifier:t});return e(N,i.displayName)}catch(a){return a instanceof FirebaseUIError?a.message:String(a)}}}})}function Yn(t){let e=s(),r=useRef(null),o=O(r),n=useRef(null),i=Jn({recaptchaVerifier:o,onSuccess:t.onSubmit,formatPhoneNumber:a=>formatPhoneNumber(a,n.current.getCountry())});return jsx("form",{className:"fui-form",onSubmit:async a=>{a.preventDefault(),a.stopPropagation(),await i.handleSubmit();},children:jsxs(i.AppForm,{children:[jsx("fieldset",{children:jsx(i.AppField,{name:"displayName",children:a=>jsx(a.Input,{label:getTranslation(e,"labels","displayName"),type:"text"})})}),jsx("fieldset",{children:jsx(i.AppField,{name:"phoneNumber",children:a=>jsx(a.Input,{label:getTranslation(e,"labels","phoneNumber"),type:"tel",before:jsx(W,{ref:n})})})}),jsx("fieldset",{children:jsx("div",{className:"fui-recaptcha-container",ref:r})}),jsxs("fieldset",{children:[jsx(i.SubmitButton,{children:getTranslation(e,"labels","sendCode")}),jsx(i.ErrorMessage,{})]})]})})}function Kn(){let t=s();return useCallback(async({verificationId:e,verificationCode:r,displayName:o})=>{let n=PhoneAuthProvider.credential(e,r),i=PhoneMultiFactorGenerator.assertion(n);return await enrollWithMultiFactorAssertion(t,i,o)},[t])}function Xn({verificationId:t,displayName:e,onSuccess:r}){let o=st(),n=Kn();return m.useAppForm({defaultValues:{verificationId:t,verificationCode:""},validators:{onSubmit:o,onBlur:o,onSubmitAsync:async({value:i})=>{try{return await n({...i,displayName:e}),r()}catch(a){return a instanceof FirebaseUIError?a.message:String(a)}}}})}function Zn(t){let e=s(),r=Xn({...t,onSuccess:t.onSuccess});return jsx("form",{className:"fui-form",onSubmit:async o=>{o.preventDefault(),o.stopPropagation(),await r.handleSubmit();},children:jsxs(r.AppForm,{children:[jsx("fieldset",{children:jsx(r.AppField,{name:"verificationCode",children:o=>jsx(o.Input,{label:getTranslation(e,"labels","verificationCode"),type:"text"})})}),jsxs("fieldset",{children:[jsx(r.SubmitButton,{children:getTranslation(e,"labels","verifyCode")}),jsx(r.ErrorMessage,{})]})]})})}function ce(t){let e=s(),[r,o]=useState(null);if(!e.auth.currentUser)throw new Error("User must be authenticated to enroll with multi-factor authentication");return r?jsx(Zn,{...r,onSuccess:()=>{t.onSuccess?.();}}):jsx(Yn,{onSubmit:(n,i)=>o({verificationId:n,displayName:i})})}function ni(){let t=s();return useCallback(async()=>await generateTotpSecret(t),[t])}function ii({onSuccess:t}){let e=ni(),r=or();return m.useAppForm({defaultValues:{displayName:""},validators:{onBlur:r,onSubmit:r,onSubmitAsync:async({value:o})=>{try{let n=await e();return t(n,o.displayName)}catch(n){return n instanceof FirebaseUIError?n.message:String(n)}}}})}function si(t){let e=s(),r=ii({onSuccess:t.onSubmit});return jsx("form",{className:"fui-form",onSubmit:async o=>{o.preventDefault(),o.stopPropagation(),await r.handleSubmit();},children:jsxs(r.AppForm,{children:[jsx("fieldset",{children:jsx(r.AppField,{name:"displayName",children:o=>jsx(o.Input,{label:getTranslation(e,"labels","displayName"),type:"text"})})}),jsxs("fieldset",{children:[jsx(r.SubmitButton,{children:getTranslation(e,"labels","generateQrCode")}),jsx(r.ErrorMessage,{})]})]})})}function ai(){let t=s();return useCallback(async({secret:e,verificationCode:r})=>{let o=TotpMultiFactorGenerator.assertionForEnrollment(e,r);return await enrollWithMultiFactorAssertion(t,o,r)},[t])}function ui({secret:t,displayName:e,onSuccess:r}){let o=at(),n=ai();return m.useAppForm({defaultValues:{verificationCode:""},validators:{onSubmit:o,onBlur:o,onSubmitAsync:async({value:i})=>{try{return await n({secret:t,verificationCode:i.verificationCode,displayName:e}),r()}catch(a){return a instanceof FirebaseUIError?a.message:String(a)}}}})}function mi(t){let e=s(),r=ui({...t,onSuccess:t.onSuccess}),o=generateTotpQrCode(e,t.secret,t.displayName);return jsxs("form",{className:"fui-form",onSubmit:async n=>{n.preventDefault(),n.stopPropagation(),await r.handleSubmit();},children:[jsxs("div",{className:"fui-qr-code-container",children:[jsx("img",{src:o,alt:"TOTP QR Code"}),jsx("p",{children:"TODO: Scan this QR code with your authenticator app"})]}),jsxs(r.AppForm,{children:[jsx("fieldset",{children:jsx(r.AppField,{name:"verificationCode",children:n=>jsx(n.Input,{label:getTranslation(e,"labels","verificationCode"),type:"text"})})}),jsxs("fieldset",{children:[jsx(r.SubmitButton,{children:getTranslation(e,"labels","verifyCode")}),jsx(r.ErrorMessage,{})]})]})]})}function fe(t){let e=s(),[r,o]=useState(null);if(!e.auth.currentUser)throw new Error("User must be authenticated to enroll with multi-factor authentication");return r?jsx(mi,{...r,onSuccess:()=>{t.onSuccess?.();}}):jsx(si,{onSubmit:(n,i)=>o({secret:n,displayName:i})})}var li=[FactorId.TOTP,FactorId.PHONE];function $t(t){let e=t.hints??li;if(e.length===0)throw new Error("MultiFactorAuthEnrollmentForm must have at least one hint");let[r,o]=useState(e.length===1?e[0]:void 0);if(r){if(r===FactorId.TOTP)return jsx(fe,{onSuccess:t.onEnrollment});if(r===FactorId.PHONE)return jsx(ce,{onSuccess:t.onEnrollment});throw new Error(`Unknown multi-factor enrollment type: ${r}`)}return jsx("div",{className:"fui-content",children:e.map(n=>n===FactorId.TOTP?jsx(pi,{onClick:()=>o(n)},n):n===FactorId.PHONE?jsx(fi,{onClick:()=>o(n)},n):null)})}function pi(t){let e=s(),r=getTranslation(e,"labels","mfaTotpVerification");return jsx(I,{...t,children:r})}function fi(t){let e=s(),r=getTranslation(e,"labels","mfaSmsVerification");return jsx(I,{...t,children:r})}function di(t){let e=s(),r=getTranslation(e,"labels","multiFactorEnrollment"),o=getTranslation(e,"prompts","mfaEnrollmentPrompt");return jsx("div",{className:"fui-screen",children:jsxs(f,{children:[jsxs(d,{children:[jsx(h,{children:r}),jsx(F,{children:o})]}),jsx(S,{children:jsx($t,{...t})})]})})}import.meta.env.PROD&&registerFramework("react",Qt.version);
2
+ export{Qr as AppleLogo,ln as AppleSignInButton,I as Button,f as Card,S as CardContent,d as CardHeader,F as CardSubtitle,h as CardTitle,W as CountrySelector,M as Divider,Ct as EmailLinkAuthForm,No as EmailLinkAuthScreen,Kr as FacebookLogo,Fn as FacebookSignInButton,be as FirebaseUIProvider,It as ForgotPasswordAuthForm,Mo as ForgotPasswordAuthScreen,jr as GitHubLogo,vn as GitHubSignInButton,re as GoogleLogo,wn as GoogleSignInButton,oe as MicrosoftLogo,Un as MicrosoftSignInButton,$t as MultiFactorAuthEnrollmentForm,di as MultiFactorAuthEnrollmentScreen,A as OAuthButton,Ko as OAuthScreen,wt as PhoneAuthForm,Zo as PhoneAuthScreen,b as Policies,At as PolicyContext,Et as SignInAuthForm,jo as SignInAuthScreen,Vt as SignUpAuthForm,tn as SignUpAuthScreen,kt as SmsMultiFactorAssertionForm,Bt as TotpMultiFactorAssertionForm,se as TwitterLogo,Ln as TwitterSignInButton,m as form,dr as useCountries,hr as useDefaultCountry,ur as useEmailLinkAuthForm,ar as useEmailLinkAuthFormAction,mr as useEmailLinkAuthFormCompleteSignIn,tr as useEmailLinkAuthFormSchema,pr as useForgotPasswordAuthForm,lr as useForgotPasswordAuthFormAction,jt as useForgotPasswordAuthFormSchema,it as useMultiFactorPhoneAuthNumberFormSchema,st as useMultiFactorPhoneAuthVerifyFormSchema,or as useMultiFactorTotpAuthNumberFormSchema,at as useMultiFactorTotpAuthVerifyFormSchema,rr as usePhoneAuthNumberFormSchema,er as usePhoneAuthVerifyFormSchema,br as usePhoneNumberForm,yr as usePhoneNumberFormAction,O as useRecaptchaVerifier,Kt as useRedirectError,Tt as useRequireDisplayName,Cr as useSignInAuthForm,Pr as useSignInAuthFormAction,Xt as useSignInAuthFormSchema,qr as useSignInWithProvider,xr as useSignUpAuthForm,Ir as useSignUpAuthFormAction,Zt as useSignUpAuthFormSchema,Br as useSmsMultiFactorAssertionPhoneFormAction,kr as useSmsMultiFactorAssertionVerifyFormAction,Tr as useTotpMultiFactorAssertionFormAction,s as useUI,Ar as useVerifyPhoneNumberForm,vr as useVerifyPhoneNumberFormAction};//# sourceMappingURL=index.js.map
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../package.json","../src/context.tsx","../src/hooks.ts","../src/components/policies.tsx","../src/utils/cn.ts","../src/components/button.tsx","../src/components/form.tsx","../src/auth/forms/email-link-auth-form.tsx","../src/auth/forms/forgot-password-auth-form.tsx","../src/components/country-selector.tsx","../src/auth/forms/phone-auth-form.tsx","../src/auth/forms/sign-in-auth-form.tsx","../src/auth/forms/sign-up-auth-form.tsx","../src/components/divider.tsx","../src/components/card.tsx","../src/components/redirect-error.tsx","../src/auth/screens/email-link-auth-screen.tsx","../src/auth/screens/forgot-password-auth-screen.tsx","../src/auth/forms/mfa/totp-multi-factor-assertion-form.tsx","../src/auth/forms/mfa/sms-multi-factor-assertion-form.tsx","../src/auth/forms/multi-factor-auth-assertion-form.tsx","../src/auth/screens/oauth-screen.tsx","../src/auth/screens/phone-auth-screen.tsx","../src/auth/screens/sign-in-auth-screen.tsx","../src/auth/screens/sign-up-auth-screen.tsx","../src/auth/oauth/oauth-button.tsx","../src/components/logos/apple/Logo.tsx","../src/auth/oauth/apple-sign-in-button.tsx","../src/components/logos/facebook/Logo.tsx","../src/auth/oauth/facebook-sign-in-button.tsx","../src/components/logos/github/Logo.tsx","../src/auth/oauth/github-sign-in-button.tsx","../src/components/logos/google/Logo.tsx","../src/auth/oauth/google-sign-in-button.tsx","../src/components/logos/microsoft/Logo.tsx","../src/auth/oauth/microsoft-sign-in-button.tsx","../src/components/logos/twitter/Logo.tsx","../src/auth/oauth/twitter-sign-in-button.tsx","../src/auth/forms/mfa/sms-multi-factor-enrollment-form.tsx","../src/auth/forms/mfa/totp-multi-factor-enrollment-form.tsx","../src/auth/forms/multi-factor-auth-enrollment-form.tsx","../src/auth/screens/multi-factor-auth-enrollment-screen.tsx","../src/index.ts"],"names":["package_default","FirebaseUIContext","createContext","FirebaseUIProvider","children","ui","policies","value","useStore","jsx","PolicyProvider","useUI","useContext","useRedirectError","useMemo","useSignInAuthFormSchema","createSignInAuthFormSchema","useSignUpAuthFormSchema","createSignUpAuthFormSchema","useForgotPasswordAuthFormSchema","createForgotPasswordAuthFormSchema","useEmailLinkAuthFormSchema","createEmailLinkAuthFormSchema","usePhoneAuthNumberFormSchema","createPhoneAuthNumberFormSchema","usePhoneAuthVerifyFormSchema","createPhoneAuthVerifyFormSchema","useMultiFactorPhoneAuthNumberFormSchema","createMultiFactorPhoneAuthNumberFormSchema","useMultiFactorPhoneAuthVerifyFormSchema","createMultiFactorPhoneAuthVerifyFormSchema","useMultiFactorTotpAuthNumberFormSchema","createMultiFactorTotpAuthNumberFormSchema","useMultiFactorTotpAuthVerifyFormSchema","createMultiFactorTotpAuthVerifyFormSchema","useRecaptchaVerifier","ref","verifierRef","useRef","uiRef","prevElementRef","useEffect","currentElement","currentUI","getBehavior","PolicyContext","Policies","termsOfServiceUrl","privacyPolicyUrl","onNavigate","parts","getTranslation","Handler","part","index","cloneElement","cn","inputs","twMerge","clsx","Button","className","variant","asChild","props","Slot","buttonVariant","fieldContext","useFieldContext","formContext","useFormContext","createFormHookContexts","FieldMetadata","error","Input","before","label","action","field","jsxs","e","Fragment","Action","SubmitButton","form","state","isSubmitting","ErrorMessage","errorMap","createFormHook","useEmailLinkAuthFormAction","useCallback","email","sendSignInLinkToEmail","FirebaseUIError","useEmailLinkAuthForm","onSuccess","schema","useEmailLinkAuthFormCompleteSignIn","onSignIn","credential","completeEmailLinkSignIn","EmailLinkAuthForm","onEmailSent","emailSent","setEmailSent","useState","useForgotPasswordAuthFormAction","sendPasswordResetEmail","useForgotPasswordAuthForm","ForgotPasswordAuthForm","onBackToSignInClick","onPasswordSent","useCountries","useDefaultCountry","CountrySelector","forwardRef","countries","defaultCountry","selected","setSelected","setCountry","code","foundCountry","country","useImperativeHandle","usePhoneNumberFormAction","phoneNumber","recaptchaVerifier","verifyPhoneNumber","usePhoneNumberForm","formatPhoneNumber","formatted","confirmationResult","PhoneNumberForm","recaptchaContainerRef","countrySelector","useVerifyPhoneNumberFormAction","verificationId","verificationCode","confirmPhoneNumber","useVerifyPhoneNumberForm","VerifyPhoneNumberForm","PhoneAuthForm","setVerificationId","useSignInAuthFormAction","password","signInWithEmailAndPassword","useSignInAuthForm","SignInAuthForm","onForgotPasswordClick","onSignUpClick","useRequireDisplayName","hasBehavior","useSignUpAuthFormAction","displayName","createUserWithEmailAndPassword","useSignUpAuthForm","requireDisplayName","SignUpAuthForm","onSignUp","Divider","Card","CardHeader","CardTitle","CardSubtitle","CardContent","RedirectError","EmailLinkAuthScreen","titleText","subtitleText","ForgotPasswordAuthScreen","useTotpMultiFactorAssertionFormAction","hint","assertion","TotpMultiFactorGenerator","signInWithMultiFactorAssertion","useTotpMultiFactorAssertionForm","TotpMultiFactorAssertionForm","useSmsMultiFactorAssertionPhoneFormAction","useSmsMultiFactorAssertionPhoneForm","SmsMultiFactorAssertionPhoneForm","useSmsMultiFactorAssertionVerifyFormAction","PhoneAuthProvider","PhoneMultiFactorGenerator","useSmsMultiFactorAssertionVerifyForm","SmsMultiFactorAssertionVerifyForm","SmsMultiFactorAssertionForm","verification","setVerification","MultiFactorAuthAssertionForm","resolver","setHint","TotpButton","SmsButton","labelText","OAuthScreen","mfaResolver","PhoneAuthScreen","SignInAuthScreen","SignUpAuthScreen","useSignInWithProvider","provider","setError","callback","signInWithProvider","OAuthButton","themed","SvgLogo","Logo_default","AppleSignInButton","OAuthProvider","AppleLogo","FacebookSignInButton","FacebookAuthProvider","FacebookLogo","GitHubSignInButton","GithubAuthProvider","GitHubLogo","GoogleSignInButton","GoogleAuthProvider","GoogleLogo","MicrosoftSignInButton","MicrosoftLogo","TwitterSignInButton","TwitterAuthProvider","TwitterLogo","useSmsMultiFactorEnrollmentPhoneAuthFormAction","mfaUser","multiFactor","useSmsMultiFactorEnrollmentPhoneNumberForm","MultiFactorEnrollmentPhoneNumberForm","useMultiFactorEnrollmentVerifyPhoneNumberFormAction","enrollWithMultiFactorAssertion","useMultiFactorEnrollmentVerifyPhoneNumberForm","MultiFactorEnrollmentVerifyPhoneNumberForm","SmsMultiFactorEnrollmentForm","useTotpMultiFactorSecretGenerationFormAction","generateTotpSecret","useTotpMultiFactorSecretGenerationForm","secret","TotpMultiFactorSecretGenerationForm","useMultiFactorEnrollmentVerifyTotpFormAction","useMultiFactorEnrollmentVerifyTotpForm","MultiFactorEnrollmentVerifyTotpForm","qrCodeDataUrl","generateTotpQrCode","TotpMultiFactorEnrollmentForm","enrollment","setEnrollment","DEFAULT_HINTS","FactorId","MultiFactorAuthEnrollmentForm","hints","MultiFactorAuthEnrollmentScreen","registerFramework"],"mappings":"k5CAAA,IAAAA,GAAA,CAEE,OAAA,CAAW,OAqEb,CAAA,CClDO,IAAMC,GAAoBC,a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AC3F,IAAM3D,CAAAA,CAAKM,CAAAA,EAAM,CAEX8J,EAAYtH,cAAAA,CAAe9C,CAAAA,CAAI,QAAA,CAAU,uBAAuB,CAAA,CAChEqK,CAAAA,CAAevH,eAAe9C,CAAAA,CAAI,SAAA,CAAW,qBAAqB,CAAA,CAExE,OACEI,IAAC,KAAA,CAAA,CAAI,SAAA,CAAU,YAAA,CACb,QAAA,CAAAsE,IAAAA,CAACmF,CAAAA,CAAA,CACC,QAAA,CAAA,CAAAnF,IAAAA,CAACoF,CAAAA,CAAA,CACC,QAAA,CAAA,CAAA1J,GAAAA,CAAC2J,EAAA,CAAW,QAAA,CAAAK,CAAAA,CAAU,CAAA,CACtBhK,GAAAA,CAAC4J,CAAAA,CAAA,CAAc,QAAA,CAAAK,CAAAA,CAAa,GAC9B,CAAA,CACAjK,GAAAA,CAAC6J,EAAA,CACC,QAAA,CAAA7J,GAAAA,CAACmP,EAAAA,CAAA,CAA+B,GAAG5L,EAAO,CAAA,CAC5C,CAAA,CAAA,CACF,CAAA,CACF,CAEJ,CCHI,MAAA,CAAA,IAAA,CAAY,IAAI,IAAA,EAClB+L,iBAAAA,CAAkB,OAAA,CAAS/P,EAAAA,CAAQ,OAAO,CAAA","file":"index.js","sourcesContent":["{\n \"name\": \"@firebase-oss/ui-react\",\n \"version\": \"0.0.1\",\n \"type\": \"module\",\n \"main\": \"./dist/index.cjs\",\n \"module\": \"./dist/index.js\",\n \"types\": \"./dist/index.d.ts\",\n \"exports\": {\n \".\": {\n \"types\": \"./dist/index.d.ts\",\n \"import\": \"./dist/index.js\",\n \"require\": \"./dist/index.cjs\"\n }\n },\n \"files\": [\n \"dist\"\n ],\n \"scripts\": {\n \"prepare\": \"pnpm run build\",\n \"build\": \"tsup && pnpm run build:logos\",\n \"build:local\": \"pnpm run build && pnpm pack\",\n \"build:logos\": \"pnpm dlx @svgr/cli --icon --typescript --no-index --jsx-runtime automatic --out-dir src/components/logos ../core/brands\",\n \"dev\": \"tsup --watch\",\n \"lint\": \"eslint . --ext .ts,.tsx\",\n \"lint:fix\": \"eslint . --ext .ts,.tsx --fix\",\n \"format\": \"prettier --write \\\"src/**/*.{ts,tsx}\\\"\",\n \"format:check\": \"prettier --check \\\"src/**/*.{ts,tsx}\\\"\",\n \"clean\": \"rimraf dist\",\n \"test\": \"vitest run\",\n \"test:unit\": \"vitest run tests/unit\",\n \"test:unit:watch\": \"vitest tests/unit\",\n \"test:integration\": \"vitest run tests/integration\",\n \"test:integration:watch\": \"vitest tests/integration\",\n \"publish:tags\": \"sh -c 'TAG=\\\"${npm_package_name}@${npm_package_version}\\\"; git tag --list \\\"$TAG\\\" | grep . || git tag \\\"$TAG\\\"; git push origin \\\"$TAG\\\"'\",\n \"release\": \"pnpm run build && pnpm pack --pack-destination --pack-destination ../../releases/\"\n },\n \"peerDependencies\": {\n \"firebase\": \"catalog:peerDependencies\",\n \"react\": \"catalog:peerDependencies\",\n \"react-dom\": \"catalog:peerDependencies\"\n },\n \"dependencies\": {\n \"@firebase-oss/ui-core\": \"workspace:*\",\n \"@firebase-oss/ui-styles\": \"workspace:*\",\n \"@nanostores/react\": \"^1.0.0\",\n \"@radix-ui/react-slot\": \"^1.2.3\",\n \"@tanstack/react-form\": \"1.20.0\",\n \"clsx\": \"^2.1.1\",\n \"tailwind-merge\": \"^3.0.1\",\n \"zod\": \"catalog:\"\n },\n \"devDependencies\": {\n \"@firebase-oss/ui-translations\": \"workspace:*\",\n \"@testing-library/jest-dom\": \"catalog:\",\n \"@testing-library/react\": \"catalog:\",\n \"@types/jsdom\": \"catalog:\",\n \"@types/node\": \"catalog:\",\n \"@types/react\": \"catalog:\",\n \"@types/react-dom\": \"catalog:\",\n \"@vitejs/plugin-react\": \"catalog:\",\n \"firebase\": \"catalog:\",\n \"jsdom\": \"catalog:\",\n \"nanostores\": \"catalog:\",\n \"react\": \"catalog:\",\n \"react-dom\": \"catalog:\",\n \"tsup\": \"catalog:\",\n \"typescript\": \"catalog:\",\n \"vite\": \"catalog:\",\n \"vite-plugin-svgr\": \"^4.5.0\",\n \"vitest\": \"catalog:\"\n }\n}\n","/**\n * Copyright 2025 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { type FirebaseUIStore, type FirebaseUI } from \"@firebase-oss/ui-core\";\nimport { useStore } from \"@nanostores/react\";\nimport { type PolicyProps, PolicyProvider } from \"~/components/policies\";\nimport { createContext } from \"react\";\n\nexport const FirebaseUIContext = createContext<FirebaseUI>({} as FirebaseUI);\n\nexport type FirebaseUIProviderProps = {\n children: React.ReactNode;\n ui: FirebaseUIStore;\n policies?: PolicyProps;\n};\n\nexport function FirebaseUIProvider({ children, ui, policies }: FirebaseUIProviderProps) {\n const value = useStore(ui);\n return (\n <FirebaseUIContext.Provider value={value}>\n <PolicyProvider policies={policies}>{children}</PolicyProvider>\n </FirebaseUIContext.Provider>\n );\n}\n","/**\n * Copyright 2025 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useContext, useMemo, useEffect, useRef } from \"react\";\nimport type { RecaptchaVerifier } from \"firebase/auth\";\nimport {\n createEmailLinkAuthFormSchema,\n createForgotPasswordAuthFormSchema,\n createMultiFactorPhoneAuthNumberFormSchema,\n createMultiFactorPhoneAuthVerifyFormSchema,\n createMultiFactorTotpAuthNumberFormSchema,\n createMultiFactorTotpAuthVerifyFormSchema,\n createPhoneAuthNumberFormSchema,\n createPhoneAuthVerifyFormSchema,\n createSignInAuthFormSchema,\n createSignUpAuthFormSchema,\n getBehavior,\n} from \"@firebase-oss/ui-core\";\nimport { FirebaseUIContext } from \"./context\";\n\n/**\n * Get the UI configuration from the context.\n */\nexport function useUI() {\n const ui = useContext(FirebaseUIContext);\n\n if (!ui) {\n throw new Error(\n \"No FirebaseUI context found. Your application must be wrapped in a <FirebaseUIProvider> component.\"\n );\n }\n\n return ui;\n}\n\nexport function useRedirectError() {\n const ui = useUI();\n return useMemo(() => {\n if (!ui.redirectError) {\n return;\n }\n\n return ui.redirectError instanceof Error ? ui.redirectError.message : String(ui.redirectError);\n }, [ui.redirectError]);\n}\n\nexport function useSignInAuthFormSchema() {\n const ui = useUI();\n return useMemo(() => createSignInAuthFormSchema(ui), [ui]);\n}\n\nexport function useSignUpAuthFormSchema() {\n const ui = useUI();\n return useMemo(() => createSignUpAuthFormSchema(ui), [ui]);\n}\n\nexport function useForgotPasswordAuthFormSchema() {\n const ui = useUI();\n return useMemo(() => createForgotPasswordAuthFormSchema(ui), [ui]);\n}\n\nexport function useEmailLinkAuthFormSchema() {\n const ui = useUI();\n return useMemo(() => createEmailLinkAuthFormSchema(ui), [ui]);\n}\n\nexport function usePhoneAuthNumberFormSchema() {\n const ui = useUI();\n return useMemo(() => createPhoneAuthNumberFormSchema(ui), [ui]);\n}\n\nexport function usePhoneAuthVerifyFormSchema() {\n const ui = useUI();\n return useMemo(() => createPhoneAuthVerifyFormSchema(ui), [ui]);\n}\n\nexport function useMultiFactorPhoneAuthNumberFormSchema() {\n const ui = useUI();\n return useMemo(() => createMultiFactorPhoneAuthNumberFormSchema(ui), [ui]);\n}\n\nexport function useMultiFactorPhoneAuthVerifyFormSchema() {\n const ui = useUI();\n return useMemo(() => createMultiFactorPhoneAuthVerifyFormSchema(ui), [ui]);\n}\n\nexport function useMultiFactorTotpAuthNumberFormSchema() {\n const ui = useUI();\n return useMemo(() => createMultiFactorTotpAuthNumberFormSchema(ui), [ui]);\n}\n\nexport function useMultiFactorTotpAuthVerifyFormSchema() {\n const ui = useUI();\n return useMemo(() => createMultiFactorTotpAuthVerifyFormSchema(ui), [ui]);\n}\n\nexport function useRecaptchaVerifier(ref: React.RefObject<HTMLDivElement | null>) {\n const ui = useUI();\n const verifierRef = useRef<RecaptchaVerifier | null>(null);\n const uiRef = useRef(ui);\n const prevElementRef = useRef<HTMLDivElement | null>(null);\n\n uiRef.current = ui;\n\n useEffect(() => {\n const currentElement = ref.current;\n const currentUI = uiRef.current;\n\n if (currentElement !== prevElementRef.current) {\n prevElementRef.current = currentElement;\n if (currentElement) {\n verifierRef.current = getBehavior(currentUI, \"recaptchaVerification\")(currentUI, currentElement);\n verifierRef.current.render();\n } else {\n verifierRef.current = null;\n }\n }\n }, [ref]);\n\n return verifierRef.current;\n}\n","/**\n * Copyright 2025 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { getTranslation } from \"@firebase-oss/ui-core\";\nimport { cloneElement, createContext, useContext } from \"react\";\nimport { useUI } from \"~/hooks\";\n\nexport type PolicyURL = string | URL;\n\nexport interface PolicyProps {\n termsOfServiceUrl: PolicyURL;\n privacyPolicyUrl: PolicyURL;\n onNavigate?: (url: PolicyURL) => void;\n}\n\nexport const PolicyContext = createContext<PolicyProps | undefined>(undefined);\n\nexport function PolicyProvider({ children, policies }: { children: React.ReactNode; policies?: PolicyProps }) {\n return <PolicyContext.Provider value={policies}>{children}</PolicyContext.Provider>;\n}\n\nexport function Policies() {\n const ui = useUI();\n const policies = useContext(PolicyContext);\n\n if (!policies) {\n return null;\n }\n\n const { termsOfServiceUrl, privacyPolicyUrl, onNavigate } = policies;\n const termsAndPrivacyText = getTranslation(ui, \"messages\", \"termsAndPrivacy\");\n const parts = termsAndPrivacyText.split(/(\\{tos\\}|\\{privacy\\})/);\n\n const Handler = onNavigate ? <button /> : <a target=\"_blank\" rel=\"noopener noreferrer\" />;\n\n return (\n <div className=\"fui-policies\">\n {parts.map((part: string, index: number) => {\n if (part === \"{tos}\") {\n return cloneElement(Handler, {\n key: index,\n onClick: onNavigate ? () => onNavigate(termsOfServiceUrl) : undefined,\n href: onNavigate ? undefined : termsOfServiceUrl,\n children: getTranslation(ui, \"labels\", \"termsOfService\"),\n });\n }\n\n if (part === \"{privacy}\") {\n return cloneElement(Handler, {\n key: index,\n onClick: onNavigate ? () => onNavigate(privacyPolicyUrl) : undefined,\n href: onNavigate ? undefined : privacyPolicyUrl,\n children: getTranslation(ui, \"labels\", \"privacyPolicy\"),\n });\n }\n\n return <span key={index}>{part}</span>;\n })}\n </div>\n );\n}\n","/**\n * Copyright 2025 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { twMerge } from \"tailwind-merge\";\nimport { clsx } from \"clsx\";\n\nexport function cn(...inputs: Parameters<typeof clsx>) {\n return twMerge(clsx(...inputs));\n}\n","/**\n * Copyright 2025 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { type ComponentProps } from \"react\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport { buttonVariant, type ButtonVariant } from \"@firebase-oss/ui-styles\";\nimport { cn } from \"~/utils/cn\";\n\nexport type ButtonProps = ComponentProps<\"button\"> & {\n variant?: ButtonVariant;\n asChild?: boolean;\n};\n\nexport function Button({ className, variant = \"primary\", asChild, ...props }: ButtonProps) {\n const Comp = asChild ? Slot : \"button\";\n return <Comp className={cn(buttonVariant({ variant }), className)} {...props} />;\n}\n","import { type ComponentProps, type PropsWithChildren, type ReactNode } from \"react\";\nimport { type AnyFieldApi, createFormHook, createFormHookContexts } from \"@tanstack/react-form\";\nimport { Button } from \"./button\";\nimport { cn } from \"~/utils/cn\";\n\nconst { fieldContext, useFieldContext, formContext, useFormContext } = createFormHookContexts();\n\nfunction FieldMetadata({ className, ...props }: ComponentProps<\"div\"> & { field: AnyFieldApi }) {\n if (!props.field.state.meta.isTouched || !props.field.state.meta.errors.length) {\n return null;\n }\n\n return (\n <div>\n <div role=\"alert\" aria-live=\"polite\" className={cn(\"fui-form__error\", className)} {...props}>\n {props.field.state.meta.errors.map((error) => error.message).join(\", \")}\n </div>\n </div>\n );\n}\n\nfunction Input({\n children,\n before,\n label,\n action,\n ...props\n}: PropsWithChildren<ComponentProps<\"input\"> & { label: string; before?: ReactNode; action?: ReactNode }>) {\n const field = useFieldContext<string>();\n\n return (\n <label htmlFor={field.name}>\n <div data-input-label>\n <div>{label}</div>\n {action ? <div>{action}</div> : null}\n </div>\n <div data-input-group>\n {before}\n <input\n {...props}\n aria-invalid={field.state.meta.isTouched && field.state.meta.errors.length > 0}\n id={field.name}\n name={field.name}\n value={field.state.value}\n onBlur={() => {\n field.handleBlur();\n }}\n onChange={(e) => {\n field.handleChange(e.target.value);\n }}\n />\n </div>\n {children ? <>{children}</> : null}\n <FieldMetadata field={field} />\n </label>\n );\n}\n\nfunction Action({ className, ...props }: ComponentProps<\"button\">) {\n return <button type=\"button\" {...props} className={cn(\"fui-form__action\", className)} />;\n}\n\nfunction SubmitButton(props: ComponentProps<\"button\">) {\n const form = useFormContext();\n\n return (\n <form.Subscribe selector={(state) => state.isSubmitting}>\n {(isSubmitting) => <Button {...props} type=\"submit\" disabled={isSubmitting} />}\n </form.Subscribe>\n );\n}\n\nfunction ErrorMessage() {\n const form = useFormContext();\n\n return (\n <form.Subscribe selector={(state) => [state.errorMap]}>\n {([errorMap]) => {\n // We only care about errors thrown from the form submission, rather than validation errors\n if (errorMap?.onSubmit && typeof errorMap.onSubmit === \"string\") {\n return <div className=\"fui-form__error\">{errorMap.onSubmit}</div>;\n }\n\n return null;\n }}\n </form.Subscribe>\n );\n}\n\nexport const form = createFormHook({\n fieldComponents: {\n Input,\n },\n formComponents: {\n SubmitButton,\n ErrorMessage,\n Action,\n },\n fieldContext,\n formContext,\n});\n","/**\n * Copyright 2025 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\"use client\";\n\nimport { FirebaseUIError, completeEmailLinkSignIn, getTranslation, sendSignInLinkToEmail } from \"@firebase-oss/ui-core\";\nimport type { UserCredential } from \"firebase/auth\";\nimport { useEmailLinkAuthFormSchema, useUI } from \"~/hooks\";\nimport { form } from \"~/components/form\";\nimport { Policies } from \"~/components/policies\";\nimport { useCallback, useEffect, useState } from \"react\";\n\nexport type EmailLinkAuthFormProps = {\n onEmailSent?: () => void;\n onSignIn?: (credential: UserCredential) => void;\n};\n\nexport function useEmailLinkAuthFormAction() {\n const ui = useUI();\n\n return useCallback(\n async ({ email }: { email: string }) => {\n try {\n return await sendSignInLinkToEmail(ui, email);\n } catch (error) {\n if (error instanceof FirebaseUIError) {\n throw new Error(error.message);\n }\n\n console.error(error);\n throw new Error(getTranslation(ui, \"errors\", \"unknownError\"));\n }\n },\n [ui]\n );\n}\n\nexport function useEmailLinkAuthForm(onSuccess?: EmailLinkAuthFormProps[\"onEmailSent\"]) {\n const schema = useEmailLinkAuthFormSchema();\n const action = useEmailLinkAuthFormAction();\n\n return form.useAppForm({\n defaultValues: {\n email: \"\",\n },\n validators: {\n onBlur: schema,\n onSubmit: schema,\n onSubmitAsync: async ({ value }) => {\n try {\n await action(value);\n return onSuccess?.();\n } catch (error) {\n return error instanceof Error ? error.message : String(error);\n }\n },\n },\n });\n}\n\nexport function useEmailLinkAuthFormCompleteSignIn(onSignIn?: EmailLinkAuthFormProps[\"onSignIn\"]) {\n const ui = useUI();\n\n useEffect(() => {\n const completeSignIn = async () => {\n const credential = await completeEmailLinkSignIn(ui, window.location.href);\n\n if (credential) {\n onSignIn?.(credential);\n }\n };\n\n void completeSignIn();\n }, [ui, onSignIn]);\n}\n\nexport function EmailLinkAuthForm({ onEmailSent, onSignIn }: EmailLinkAuthFormProps) {\n const ui = useUI();\n const [emailSent, setEmailSent] = useState(false);\n\n const form = useEmailLinkAuthForm(() => {\n setEmailSent(true);\n onEmailSent?.();\n });\n\n useEmailLinkAuthFormCompleteSignIn(onSignIn);\n\n if (emailSent) {\n return <div className=\"fui-success\">{getTranslation(ui, \"messages\", \"signInLinkSent\")}</div>;\n }\n\n return (\n <form\n className=\"fui-form\"\n onSubmit={async (e) => {\n e.preventDefault();\n e.stopPropagation();\n await form.handleSubmit();\n }}\n >\n <form.AppForm>\n <fieldset>\n <form.AppField name=\"email\">\n {(field) => <field.Input label={getTranslation(ui, \"labels\", \"emailAddress\")} type=\"email\" />}\n </form.AppField>\n </fieldset>\n <Policies />\n <fieldset>\n <form.SubmitButton>{getTranslation(ui, \"labels\", \"sendSignInLink\")}</form.SubmitButton>\n <form.ErrorMessage />\n </fieldset>\n </form.AppForm>\n </form>\n );\n}\n","/**\n * Copyright 2025 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\"use client\";\n\nimport { FirebaseUIError, getTranslation, sendPasswordResetEmail } from \"@firebase-oss/ui-core\";\nimport { useForgotPasswordAuthFormSchema, useUI } from \"~/hooks\";\nimport { form } from \"~/components/form\";\nimport { Policies } from \"~/components/policies\";\nimport { useCallback, useState } from \"react\";\n\nexport type ForgotPasswordAuthFormProps = {\n onPasswordSent?: () => void;\n onBackToSignInClick?: () => void;\n};\n\nexport function useForgotPasswordAuthFormAction() {\n const ui = useUI();\n\n return useCallback(\n async ({ email }: { email: string }) => {\n try {\n return await sendPasswordResetEmail(ui, email);\n } catch (error) {\n if (error instanceof FirebaseUIError) {\n throw new Error(error.message);\n }\n\n console.error(error);\n throw new Error(getTranslation(ui, \"errors\", \"unknownError\"));\n }\n },\n [ui]\n );\n}\n\nexport function useForgotPasswordAuthForm(onSuccess?: ForgotPasswordAuthFormProps[\"onPasswordSent\"]) {\n const schema = useForgotPasswordAuthFormSchema();\n const action = useForgotPasswordAuthFormAction();\n\n return form.useAppForm({\n defaultValues: {\n email: \"\",\n },\n validators: {\n onBlur: schema,\n onSubmit: schema,\n onSubmitAsync: async ({ value }) => {\n try {\n await action(value);\n return onSuccess?.();\n } catch (error) {\n return error instanceof Error ? error.message : String(error);\n }\n },\n },\n });\n}\n\nexport function ForgotPasswordAuthForm({ onBackToSignInClick, onPasswordSent }: ForgotPasswordAuthFormProps) {\n const ui = useUI();\n const [emailSent, setEmailSent] = useState(false);\n const form = useForgotPasswordAuthForm(() => {\n setEmailSent(true);\n onPasswordSent?.();\n });\n\n if (emailSent) {\n return <div className=\"fui-success\">{getTranslation(ui, \"messages\", \"checkEmailForReset\")}</div>;\n }\n\n return (\n <form\n className=\"fui-form\"\n onSubmit={async (e) => {\n e.preventDefault();\n e.stopPropagation();\n await form.handleSubmit();\n }}\n >\n <form.AppForm>\n <fieldset>\n <form.AppField name=\"email\">\n {(field) => <field.Input label={getTranslation(ui, \"labels\", \"emailAddress\")} type=\"email\" />}\n </form.AppField>\n </fieldset>\n <Policies />\n <fieldset>\n <form.SubmitButton>{getTranslation(ui, \"labels\", \"resetPassword\")}</form.SubmitButton>\n <form.ErrorMessage />\n </fieldset>\n {onBackToSignInClick ? (\n <form.Action onClick={onBackToSignInClick}>{getTranslation(ui, \"labels\", \"backToSignIn\")}</form.Action>\n ) : null}\n </form.AppForm>\n </form>\n );\n}\n","/**\n * Copyright 2025 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\"use client\";\n\nimport { type CountryCode, type CountryData, getBehavior } from \"@firebase-oss/ui-core\";\nimport { type ComponentProps, forwardRef, useImperativeHandle, useState, useCallback } from \"react\";\nimport { useUI } from \"~/hooks\";\nimport { cn } from \"~/utils/cn\";\n\nexport interface CountrySelectorRef {\n getCountry: () => CountryData;\n setCountry: (code: CountryCode) => void;\n}\n\nexport type CountrySelectorProps = ComponentProps<\"div\">;\n\nexport function useCountries() {\n const ui = useUI();\n return getBehavior(ui, \"countryCodes\")().allowedCountries;\n}\n\nexport function useDefaultCountry() {\n const ui = useUI();\n return getBehavior(ui, \"countryCodes\")().defaultCountry;\n}\n\nexport const CountrySelector = forwardRef<CountrySelectorRef, CountrySelectorProps>(({ className, ...props }, ref) => {\n const countries = useCountries();\n const defaultCountry = useDefaultCountry();\n const [selected, setSelected] = useState<CountryData>(defaultCountry);\n\n const setCountry = useCallback(\n (code: CountryCode) => {\n const foundCountry = countries.find((country) => country.code === code);\n setSelected(foundCountry!);\n },\n [countries]\n );\n\n useImperativeHandle(\n ref,\n () => ({\n getCountry: () => selected,\n setCountry,\n }),\n [selected, setCountry]\n );\n\n return (\n <div className={cn(\"fui-country-selector\", className)} {...props}>\n <div className=\"fui-country-selector__wrapper\">\n <span className=\"fui-country-selector__flag\">{selected.emoji}</span>\n <div className=\"fui-country-selector__select-wrapper\">\n <span className=\"fui-country-selector__dial-code\">{selected.dialCode}</span>\n <select\n className=\"fui-country-selector__select\"\n value={selected.code}\n onChange={(e) => {\n const country = countries.find((country) => country.code === e.target.value);\n\n if (country) {\n setSelected(country);\n }\n }}\n >\n {countries.map((country) => (\n <option key={`${country.code}-${country.dialCode}`} value={country.code}>\n {country.dialCode} ({country.name})\n </option>\n ))}\n </select>\n </div>\n </div>\n </div>\n );\n});\n\nCountrySelector.displayName = \"CountrySelector\";\n","/**\n * Copyright 2025 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\"use client\";\n\nimport {\n FirebaseUIError,\n formatPhoneNumber,\n getTranslation,\n verifyPhoneNumber,\n confirmPhoneNumber,\n} from \"@firebase-oss/ui-core\";\nimport { type RecaptchaVerifier, type UserCredential } from \"firebase/auth\";\nimport { useCallback, useRef, useState } from \"react\";\nimport { usePhoneAuthNumberFormSchema, usePhoneAuthVerifyFormSchema, useRecaptchaVerifier, useUI } from \"~/hooks\";\nimport { form } from \"~/components/form\";\nimport { Policies } from \"~/components/policies\";\nimport { CountrySelector, type CountrySelectorRef } from \"~/components/country-selector\";\n\nexport function usePhoneNumberFormAction() {\n const ui = useUI();\n\n return useCallback(\n async ({ phoneNumber, recaptchaVerifier }: { phoneNumber: string; recaptchaVerifier: RecaptchaVerifier }) => {\n return await verifyPhoneNumber(ui, phoneNumber, recaptchaVerifier);\n },\n [ui]\n );\n}\n\ntype UsePhoneNumberForm = {\n recaptchaVerifier: RecaptchaVerifier;\n onSuccess: (verificationId: string) => void;\n formatPhoneNumber?: (phoneNumber: string) => string;\n};\n\nexport function usePhoneNumberForm({ recaptchaVerifier, onSuccess, formatPhoneNumber }: UsePhoneNumberForm) {\n const action = usePhoneNumberFormAction();\n const schema = usePhoneAuthNumberFormSchema();\n\n return form.useAppForm({\n defaultValues: {\n phoneNumber: \"\",\n },\n validators: {\n onBlur: schema,\n onSubmit: schema,\n onSubmitAsync: async ({ value }) => {\n try {\n const formatted = formatPhoneNumber ? formatPhoneNumber(value.phoneNumber) : value.phoneNumber;\n const confirmationResult = await action({ phoneNumber: formatted, recaptchaVerifier });\n return onSuccess(confirmationResult);\n } catch (error) {\n return error instanceof FirebaseUIError ? error.message : String(error);\n }\n },\n },\n });\n}\n\ntype PhoneNumberFormProps = {\n onSubmit: (verificationId: string) => void;\n};\n\nexport function PhoneNumberForm(props: PhoneNumberFormProps) {\n const ui = useUI();\n const recaptchaContainerRef = useRef<HTMLDivElement>(null);\n const recaptchaVerifier = useRecaptchaVerifier(recaptchaContainerRef);\n const countrySelector = useRef<CountrySelectorRef>(null);\n const form = usePhoneNumberForm({\n recaptchaVerifier: recaptchaVerifier!,\n onSuccess: props.onSubmit,\n formatPhoneNumber: (phoneNumber) => formatPhoneNumber(phoneNumber, countrySelector.current!.getCountry()),\n });\n\n return (\n <form\n className=\"fui-form\"\n onSubmit={async (e) => {\n e.preventDefault();\n e.stopPropagation();\n await form.handleSubmit();\n }}\n >\n <form.AppForm>\n <fieldset>\n <form.AppField name=\"phoneNumber\">\n {(field) => (\n <field.Input\n label={getTranslation(ui, \"labels\", \"phoneNumber\")}\n type=\"tel\"\n before={<CountrySelector ref={countrySelector} />}\n />\n )}\n </form.AppField>\n </fieldset>\n <fieldset>\n <div className=\"fui-recaptcha-container\" ref={recaptchaContainerRef} />\n </fieldset>\n <Policies />\n <fieldset>\n <form.SubmitButton>{getTranslation(ui, \"labels\", \"sendCode\")}</form.SubmitButton>\n <form.ErrorMessage />\n </fieldset>\n </form.AppForm>\n </form>\n );\n}\n\nexport function useVerifyPhoneNumberFormAction() {\n const ui = useUI();\n\n return useCallback(\n async ({ verificationId, verificationCode }: { verificationId: string; verificationCode: string }) => {\n return await confirmPhoneNumber(ui, verificationId, verificationCode);\n },\n [ui]\n );\n}\n\ntype UseVerifyPhoneNumberForm = {\n verificationId: string;\n onSuccess: (credential: UserCredential) => void;\n};\n\nexport function useVerifyPhoneNumberForm({ verificationId, onSuccess }: UseVerifyPhoneNumberForm) {\n const schema = usePhoneAuthVerifyFormSchema();\n const action = useVerifyPhoneNumberFormAction();\n\n return form.useAppForm({\n defaultValues: {\n verificationId,\n verificationCode: \"\",\n },\n validators: {\n onSubmit: schema,\n onBlur: schema,\n onSubmitAsync: async ({ value }) => {\n try {\n const credential = await action(value);\n return onSuccess(credential);\n } catch (error) {\n return error instanceof FirebaseUIError ? error.message : String(error);\n }\n },\n },\n });\n}\n\ntype VerifyPhoneNumberFormProps = {\n onSuccess: (credential: UserCredential) => void;\n verificationId: string;\n};\n\nfunction VerifyPhoneNumberForm(props: VerifyPhoneNumberFormProps) {\n const ui = useUI();\n const form = useVerifyPhoneNumberForm({ verificationId: props.verificationId, onSuccess: props.onSuccess });\n\n return (\n <form\n className=\"fui-form\"\n onSubmit={async (e) => {\n e.preventDefault();\n e.stopPropagation();\n await form.handleSubmit();\n }}\n >\n <form.AppForm>\n <fieldset>\n <form.AppField name=\"verificationCode\">\n {(field) => <field.Input label={getTranslation(ui, \"labels\", \"verificationCode\")} type=\"text\" />}\n </form.AppField>\n </fieldset>\n <fieldset>\n <form.SubmitButton>{getTranslation(ui, \"labels\", \"verifyCode\")}</form.SubmitButton>\n <form.ErrorMessage />\n </fieldset>\n </form.AppForm>\n </form>\n );\n}\n\nexport type PhoneAuthFormProps = {\n onSignIn?: (credential: UserCredential) => void;\n};\n\nexport function PhoneAuthForm(props: PhoneAuthFormProps) {\n const [verificationId, setVerificationId] = useState<string | null>(null);\n\n if (!verificationId) {\n return <PhoneNumberForm onSubmit={setVerificationId} />;\n }\n\n return (\n <VerifyPhoneNumberForm\n verificationId={verificationId}\n onSuccess={(credential) => {\n props.onSignIn?.(credential);\n }}\n />\n );\n}\n","/**\n * Copyright 2025 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\"use client\";\n\nimport { FirebaseUIError, getTranslation, signInWithEmailAndPassword } from \"@firebase-oss/ui-core\";\nimport type { UserCredential } from \"firebase/auth\";\nimport { useSignInAuthFormSchema, useUI } from \"~/hooks\";\nimport { form } from \"~/components/form\";\nimport { Policies } from \"~/components/policies\";\nimport { useCallback } from \"react\";\n\nexport type SignInAuthFormProps = {\n onSignIn?: (credential: UserCredential) => void;\n onForgotPasswordClick?: () => void;\n onSignUpClick?: () => void;\n};\n\nexport function useSignInAuthFormAction() {\n const ui = useUI();\n\n return useCallback(\n async ({ email, password }: { email: string; password: string }) => {\n try {\n return await signInWithEmailAndPassword(ui, email, password);\n } catch (error) {\n if (error instanceof FirebaseUIError) {\n throw new Error(error.message);\n }\n\n console.error(error);\n throw new Error(getTranslation(ui, \"errors\", \"unknownError\"));\n }\n },\n [ui]\n );\n}\n\nexport function useSignInAuthForm(onSuccess?: SignInAuthFormProps[\"onSignIn\"]) {\n const schema = useSignInAuthFormSchema();\n const action = useSignInAuthFormAction();\n\n return form.useAppForm({\n defaultValues: {\n email: \"\",\n password: \"\",\n },\n validators: {\n onBlur: schema,\n onSubmit: schema,\n onSubmitAsync: async ({ value }) => {\n try {\n const credential = await action(value);\n return onSuccess?.(credential);\n } catch (error) {\n return error instanceof Error ? error.message : String(error);\n }\n },\n },\n });\n}\n\nexport function SignInAuthForm({ onSignIn, onForgotPasswordClick, onSignUpClick }: SignInAuthFormProps) {\n const ui = useUI();\n const form = useSignInAuthForm(onSignIn);\n\n return (\n <form\n className=\"fui-form\"\n onSubmit={async (e) => {\n e.preventDefault();\n e.stopPropagation();\n await form.handleSubmit();\n }}\n >\n <form.AppForm>\n <fieldset>\n <form.AppField name=\"email\">\n {(field) => <field.Input label={getTranslation(ui, \"labels\", \"emailAddress\")} type=\"email\" />}\n </form.AppField>\n </fieldset>\n <fieldset>\n <form.AppField name=\"password\">\n {(field) => (\n <field.Input\n label={getTranslation(ui, \"labels\", \"password\")}\n type=\"password\"\n action={\n onForgotPasswordClick ? (\n <form.Action onClick={onForgotPasswordClick}>\n {getTranslation(ui, \"labels\", \"forgotPassword\")}\n </form.Action>\n ) : null\n }\n />\n )}\n </form.AppField>\n </fieldset>\n <Policies />\n <fieldset>\n <form.SubmitButton>{getTranslation(ui, \"labels\", \"signIn\")}</form.SubmitButton>\n <form.ErrorMessage />\n </fieldset>\n {onSignUpClick ? (\n <form.Action onClick={onSignUpClick}>\n {getTranslation(ui, \"prompts\", \"noAccount\")} {getTranslation(ui, \"labels\", \"signUp\")}\n </form.Action>\n ) : null}\n </form.AppForm>\n </form>\n );\n}\n","/**\n * Copyright 2025 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\"use client\";\n\nimport { FirebaseUIError, getTranslation, createUserWithEmailAndPassword, hasBehavior } from \"@firebase-oss/ui-core\";\nimport type { UserCredential } from \"firebase/auth\";\nimport { useSignUpAuthFormSchema, useUI } from \"~/hooks\";\nimport { form } from \"~/components/form\";\nimport { Policies } from \"~/components/policies\";\nimport { useCallback } from \"react\";\nimport { type z } from \"zod\";\n\nexport function useRequireDisplayName() {\n const ui = useUI();\n return hasBehavior(ui, \"requireDisplayName\");\n}\n\nexport type SignUpAuthFormProps = {\n onSignUp?: (credential: UserCredential) => void;\n onBackToSignInClick?: () => void;\n};\n\nexport function useSignUpAuthFormAction() {\n const ui = useUI();\n\n return useCallback(\n async ({ email, password, displayName }: { email: string; password: string; displayName?: string }) => {\n try {\n return await createUserWithEmailAndPassword(ui, email, password, displayName);\n } catch (error) {\n if (error instanceof FirebaseUIError) {\n throw new Error(error.message);\n }\n\n console.error(error);\n throw new Error(getTranslation(ui, \"errors\", \"unknownError\"));\n }\n },\n [ui]\n );\n}\n\nexport function useSignUpAuthForm(onSuccess?: SignUpAuthFormProps[\"onSignUp\"]) {\n const schema = useSignUpAuthFormSchema();\n const action = useSignUpAuthFormAction();\n const requireDisplayName = useRequireDisplayName();\n\n return form.useAppForm({\n defaultValues: {\n email: \"\",\n password: \"\",\n displayName: requireDisplayName ? \"\" : undefined,\n } as z.infer<typeof schema>,\n validators: {\n onBlur: schema,\n onSubmit: schema,\n onSubmitAsync: async ({ value }) => {\n try {\n const credential = await action(value);\n return onSuccess?.(credential);\n } catch (error) {\n return error instanceof Error ? error.message : String(error);\n }\n },\n },\n });\n}\n\nexport function SignUpAuthForm({ onBackToSignInClick, onSignUp }: SignUpAuthFormProps) {\n const ui = useUI();\n const form = useSignUpAuthForm(onSignUp);\n const requireDisplayName = useRequireDisplayName();\n\n return (\n <form\n className=\"fui-form\"\n onSubmit={async (e) => {\n e.preventDefault();\n e.stopPropagation();\n await form.handleSubmit();\n }}\n >\n <form.AppForm>\n {requireDisplayName ? (\n <fieldset>\n <form.AppField name=\"displayName\">\n {(field) => <field.Input label={getTranslation(ui, \"labels\", \"displayName\")} />}\n </form.AppField>\n </fieldset>\n ) : null}\n <fieldset>\n <form.AppField name=\"email\">\n {(field) => <field.Input label={getTranslation(ui, \"labels\", \"emailAddress\")} type=\"email\" />}\n </form.AppField>\n </fieldset>\n <fieldset>\n <form.AppField name=\"password\">\n {(field) => <field.Input label={getTranslation(ui, \"labels\", \"password\")} type=\"password\" />}\n </form.AppField>\n </fieldset>\n <Policies />\n <fieldset>\n <form.SubmitButton>{getTranslation(ui, \"labels\", \"createAccount\")}</form.SubmitButton>\n <form.ErrorMessage />\n </fieldset>\n {onBackToSignInClick ? (\n <form.Action onClick={onBackToSignInClick}>\n {getTranslation(ui, \"prompts\", \"haveAccount\")} {getTranslation(ui, \"labels\", \"signIn\")}\n </form.Action>\n ) : null}\n </form.AppForm>\n </form>\n );\n}\n","/**\n * Copyright 2025 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { type ComponentProps, type PropsWithChildren } from \"react\";\nimport { cn } from \"~/utils/cn\";\n\nexport type DividerProps = PropsWithChildren<ComponentProps<\"div\">>;\n\nexport function Divider({ className, children, ...props }: DividerProps) {\n if (!children) {\n return (\n <div className={cn(\"fui-divider\", className)} {...props}>\n <div className=\"fui-divider__line\" />\n </div>\n );\n }\n\n return (\n <div className={cn(\"fui-divider\", className)} {...props}>\n <div className=\"fui-divider__line\" />\n <div className=\"fui-divider__text\">{children}</div>\n <div className=\"fui-divider__line\" />\n </div>\n );\n}\n","/**\n * Copyright 2025 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { ComponentProps, PropsWithChildren } from \"react\";\nimport { cn } from \"~/utils/cn\";\n\nexport type CardProps = PropsWithChildren<ComponentProps<\"div\">>;\n\nexport function Card({ children, className, ...props }: CardProps) {\n return (\n <div className={cn(\"fui-card\", className)} {...props}>\n {children}\n </div>\n );\n}\n\nexport function CardHeader({ children, className, ...props }: CardProps) {\n return (\n <div className={cn(\"fui-card__header\", className)} {...props}>\n {children}\n </div>\n );\n}\n\nexport function CardTitle({ children, className, ...props }: ComponentProps<\"h2\">) {\n return (\n <h2 className={cn(\"fui-card__title\", className)} {...props}>\n {children}\n </h2>\n );\n}\n\nexport function CardSubtitle({ children, className, ...props }: ComponentProps<\"p\">) {\n return (\n <p className={cn(\"fui-card__subtitle\", className)} {...props}>\n {children}\n </p>\n );\n}\n\nexport function CardContent({ children, className, ...props }: ComponentProps<\"div\">) {\n return (\n <div className={cn(\"fui-card__content\", className)} {...props}>\n {children}\n </div>\n );\n}\n","import { useRedirectError } from \"~/hooks\";\n\nexport function RedirectError() {\n const error = useRedirectError();\n\n if (!error) {\n return null;\n }\n\n return <div className=\"fui-form__error\">{error}</div>;\n}\n","/**\n * Copyright 2025 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { PropsWithChildren } from \"react\";\nimport { getTranslation } from \"@firebase-oss/ui-core\";\nimport { Divider } from \"~/components/divider\";\nimport { useUI } from \"~/hooks\";\nimport { Card, CardContent, CardHeader, CardSubtitle, CardTitle } from \"~/components/card\";\nimport { EmailLinkAuthForm, type EmailLinkAuthFormProps } from \"../forms/email-link-auth-form\";\nimport { RedirectError } from \"~/components/redirect-error\";\n\nexport type EmailLinkAuthScreenProps = PropsWithChildren<EmailLinkAuthFormProps>;\n\nexport function EmailLinkAuthScreen({ children, onEmailSent }: EmailLinkAuthScreenProps) {\n const ui = useUI();\n\n const titleText = getTranslation(ui, \"labels\", \"signIn\");\n const subtitleText = getTranslation(ui, \"prompts\", \"signInToAccount\");\n\n return (\n <div className=\"fui-screen\">\n <Card>\n <CardHeader>\n <CardTitle>{titleText}</CardTitle>\n <CardSubtitle>{subtitleText}</CardSubtitle>\n </CardHeader>\n <CardContent>\n <EmailLinkAuthForm onEmailSent={onEmailSent} />\n {children ? (\n <>\n <Divider>{getTranslation(ui, \"messages\", \"dividerOr\")}</Divider>\n <div className=\"fui-screen__children\">\n {children}\n <RedirectError />\n </div>\n </>\n ) : null}\n </CardContent>\n </Card>\n </div>\n );\n}\n","/**\n * Copyright 2025 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { getTranslation } from \"@firebase-oss/ui-core\";\nimport { useUI } from \"~/hooks\";\nimport { Card, CardContent, CardHeader, CardSubtitle, CardTitle } from \"../../components/card\";\nimport { ForgotPasswordAuthForm, type ForgotPasswordAuthFormProps } from \"../forms/forgot-password-auth-form\";\n\nexport type ForgotPasswordAuthScreenProps = ForgotPasswordAuthFormProps;\n\nexport function ForgotPasswordAuthScreen(props: ForgotPasswordAuthScreenProps) {\n const ui = useUI();\n\n const titleText = getTranslation(ui, \"labels\", \"resetPassword\");\n const subtitleText = getTranslation(ui, \"prompts\", \"enterEmailToReset\");\n\n return (\n <div className=\"fui-screen\">\n <Card>\n <CardHeader>\n <CardTitle>{titleText}</CardTitle>\n <CardSubtitle>{subtitleText}</CardSubtitle>\n </CardHeader>\n <CardContent>\n <ForgotPasswordAuthForm {...props} />\n </CardContent>\n </Card>\n </div>\n );\n}\n","import { useCallback } from \"react\";\nimport { TotpMultiFactorGenerator, type MultiFactorInfo } from \"firebase/auth\";\nimport { signInWithMultiFactorAssertion, FirebaseUIError, getTranslation } from \"@firebase-oss/ui-core\";\nimport { form } from \"~/components/form\";\nimport { useMultiFactorTotpAuthVerifyFormSchema, useUI } from \"~/hooks\";\n\nexport function useTotpMultiFactorAssertionFormAction() {\n const ui = useUI();\n\n return useCallback(\n async ({ verificationCode, hint }: { verificationCode: string; hint: MultiFactorInfo }) => {\n const assertion = TotpMultiFactorGenerator.assertionForSignIn(hint.uid, verificationCode);\n return await signInWithMultiFactorAssertion(ui, assertion);\n },\n [ui]\n );\n}\n\ntype UseTotpMultiFactorAssertionForm = {\n hint: MultiFactorInfo;\n onSuccess: () => void;\n};\n\nexport function useTotpMultiFactorAssertionForm({ hint, onSuccess }: UseTotpMultiFactorAssertionForm) {\n const action = useTotpMultiFactorAssertionFormAction();\n const schema = useMultiFactorTotpAuthVerifyFormSchema();\n\n return form.useAppForm({\n defaultValues: {\n verificationCode: \"\",\n },\n validators: {\n onSubmit: schema,\n onBlur: schema,\n onSubmitAsync: async ({ value }) => {\n try {\n await action({ verificationCode: value.verificationCode, hint });\n return onSuccess();\n } catch (error) {\n return error instanceof FirebaseUIError ? error.message : String(error);\n }\n },\n },\n });\n}\n\ntype TotpMultiFactorAssertionFormProps = {\n hint: MultiFactorInfo;\n onSuccess?: () => void;\n};\n\nexport function TotpMultiFactorAssertionForm(props: TotpMultiFactorAssertionFormProps) {\n const ui = useUI();\n const form = useTotpMultiFactorAssertionForm({\n hint: props.hint,\n onSuccess: () => {\n props.onSuccess?.();\n },\n });\n\n return (\n <form\n className=\"fui-form\"\n onSubmit={async (e) => {\n e.preventDefault();\n e.stopPropagation();\n await form.handleSubmit();\n }}\n >\n <form.AppForm>\n <fieldset>\n <form.AppField name=\"verificationCode\">\n {(field) => (\n <field.Input\n label={getTranslation(ui, \"labels\", \"verificationCode\")}\n type=\"text\"\n placeholder=\"123456\"\n maxLength={6}\n />\n )}\n </form.AppField>\n </fieldset>\n <fieldset>\n <form.SubmitButton>{getTranslation(ui, \"labels\", \"verifyCode\")}</form.SubmitButton>\n <form.ErrorMessage />\n </fieldset>\n </form.AppForm>\n </form>\n );\n}\n","import { useCallback, useRef, useState } from \"react\";\nimport {\n PhoneAuthProvider,\n PhoneMultiFactorGenerator,\n type MultiFactorInfo,\n type RecaptchaVerifier,\n} from \"firebase/auth\";\n\nimport { signInWithMultiFactorAssertion, FirebaseUIError, getTranslation, verifyPhoneNumber } from \"@firebase-oss/ui-core\";\nimport { form } from \"~/components/form\";\nimport {\n useMultiFactorPhoneAuthNumberFormSchema,\n useMultiFactorPhoneAuthVerifyFormSchema,\n useRecaptchaVerifier,\n useUI,\n} from \"~/hooks\";\n\ntype PhoneMultiFactorInfo = MultiFactorInfo & {\n phoneNumber?: string;\n};\n\nexport function useSmsMultiFactorAssertionPhoneFormAction() {\n const ui = useUI();\n\n return useCallback(\n async ({ hint, recaptchaVerifier }: { hint: MultiFactorInfo; recaptchaVerifier: RecaptchaVerifier }) => {\n return await verifyPhoneNumber(ui, \"\", recaptchaVerifier, undefined, hint);\n },\n [ui]\n );\n}\n\ntype UseSmsMultiFactorAssertionPhoneForm = {\n hint: MultiFactorInfo;\n recaptchaVerifier: RecaptchaVerifier;\n onSuccess: (verificationId: string) => void;\n};\n\nexport function useSmsMultiFactorAssertionPhoneForm({\n hint,\n recaptchaVerifier,\n onSuccess,\n}: UseSmsMultiFactorAssertionPhoneForm) {\n const action = useSmsMultiFactorAssertionPhoneFormAction();\n const schema = useMultiFactorPhoneAuthNumberFormSchema();\n\n return form.useAppForm({\n defaultValues: {\n phoneNumber: (hint as PhoneMultiFactorInfo).phoneNumber || \"\",\n },\n validators: {\n onBlur: schema,\n onSubmit: schema,\n onSubmitAsync: async () => {\n try {\n const verificationId = await action({ hint, recaptchaVerifier });\n return onSuccess(verificationId);\n } catch (error) {\n return error instanceof FirebaseUIError ? error.message : String(error);\n }\n },\n },\n });\n}\n\ntype SmsMultiFactorAssertionPhoneFormProps = {\n hint: MultiFactorInfo;\n onSubmit: (verificationId: string) => void;\n};\n\nfunction SmsMultiFactorAssertionPhoneForm(props: SmsMultiFactorAssertionPhoneFormProps) {\n const ui = useUI();\n const recaptchaContainerRef = useRef<HTMLDivElement>(null);\n const recaptchaVerifier = useRecaptchaVerifier(recaptchaContainerRef);\n const form = useSmsMultiFactorAssertionPhoneForm({\n hint: props.hint,\n recaptchaVerifier: recaptchaVerifier!,\n onSuccess: props.onSubmit,\n });\n\n return (\n <form\n className=\"fui-form\"\n onSubmit={async (e) => {\n e.preventDefault();\n e.stopPropagation();\n await form.handleSubmit();\n }}\n >\n <form.AppForm>\n <fieldset>\n <form.AppField name=\"phoneNumber\">\n {(field) => (\n <field.Input\n label={getTranslation(ui, \"labels\", \"phoneNumber\")}\n type=\"tel\"\n disabled\n value={(props.hint as PhoneMultiFactorInfo).phoneNumber || \"\"}\n />\n )}\n </form.AppField>\n </fieldset>\n <fieldset>\n <div className=\"fui-recaptcha-container\" ref={recaptchaContainerRef} />\n </fieldset>\n <fieldset>\n <form.SubmitButton>{getTranslation(ui, \"labels\", \"sendCode\")}</form.SubmitButton>\n <form.ErrorMessage />\n </fieldset>\n </form.AppForm>\n </form>\n );\n}\n\nexport function useSmsMultiFactorAssertionVerifyFormAction() {\n const ui = useUI();\n\n return useCallback(\n async ({ verificationId, verificationCode }: { verificationId: string; verificationCode: string }) => {\n const credential = PhoneAuthProvider.credential(verificationId, verificationCode);\n const assertion = PhoneMultiFactorGenerator.assertion(credential);\n return await signInWithMultiFactorAssertion(ui, assertion);\n },\n [ui]\n );\n}\n\ntype UseSmsMultiFactorAssertionVerifyForm = {\n verificationId: string;\n onSuccess: () => void;\n};\n\nexport function useSmsMultiFactorAssertionVerifyForm({\n verificationId,\n onSuccess,\n}: UseSmsMultiFactorAssertionVerifyForm) {\n const action = useSmsMultiFactorAssertionVerifyFormAction();\n const schema = useMultiFactorPhoneAuthVerifyFormSchema();\n\n return form.useAppForm({\n defaultValues: {\n verificationId,\n verificationCode: \"\",\n },\n validators: {\n onSubmit: schema,\n onBlur: schema,\n onSubmitAsync: async ({ value }) => {\n try {\n await action(value);\n return onSuccess();\n } catch (error) {\n return error instanceof FirebaseUIError ? error.message : String(error);\n }\n },\n },\n });\n}\n\ntype SmsMultiFactorAssertionVerifyFormProps = {\n verificationId: string;\n onSuccess: () => void;\n};\n\nfunction SmsMultiFactorAssertionVerifyForm(props: SmsMultiFactorAssertionVerifyFormProps) {\n const ui = useUI();\n const form = useSmsMultiFactorAssertionVerifyForm({\n verificationId: props.verificationId,\n onSuccess: props.onSuccess,\n });\n\n return (\n <form\n className=\"fui-form\"\n onSubmit={async (e) => {\n e.preventDefault();\n e.stopPropagation();\n await form.handleSubmit();\n }}\n >\n <form.AppForm>\n <fieldset>\n <form.AppField name=\"verificationCode\">\n {(field) => <field.Input label={getTranslation(ui, \"labels\", \"verificationCode\")} type=\"text\" />}\n </form.AppField>\n </fieldset>\n <fieldset>\n <form.SubmitButton>{getTranslation(ui, \"labels\", \"verifyCode\")}</form.SubmitButton>\n <form.ErrorMessage />\n </fieldset>\n </form.AppForm>\n </form>\n );\n}\n\nexport type SmsMultiFactorAssertionFormProps = {\n hint: MultiFactorInfo;\n onSuccess?: () => void;\n};\n\nexport function SmsMultiFactorAssertionForm(props: SmsMultiFactorAssertionFormProps) {\n const [verification, setVerification] = useState<{\n verificationId: string;\n } | null>(null);\n\n if (!verification) {\n return (\n <SmsMultiFactorAssertionPhoneForm\n hint={props.hint}\n onSubmit={(verificationId) => setVerification({ verificationId })}\n />\n );\n }\n\n return (\n <SmsMultiFactorAssertionVerifyForm\n verificationId={verification.verificationId}\n onSuccess={() => {\n props.onSuccess?.();\n }}\n />\n );\n}\n","import { PhoneMultiFactorGenerator, TotpMultiFactorGenerator, type MultiFactorInfo } from \"firebase/auth\";\nimport { type ComponentProps, useState } from \"react\";\nimport { useUI } from \"~/hooks\";\nimport { TotpMultiFactorAssertionForm } from \"../forms/mfa/totp-multi-factor-assertion-form\";\nimport { SmsMultiFactorAssertionForm } from \"../forms/mfa/sms-multi-factor-assertion-form\";\nimport { Button } from \"~/components/button\";\nimport { getTranslation } from \"@firebase-oss/ui-core\";\n\nexport function MultiFactorAuthAssertionForm() {\n const ui = useUI();\n const resolver = ui.multiFactorResolver;\n\n if (!resolver) {\n throw new Error(\"MultiFactorAuthAssertionForm requires a multi-factor resolver\");\n }\n\n // If only a single hint is provided, select it by default to improve UX.\n const [hint, setHint] = useState<MultiFactorInfo | undefined>(\n resolver.hints.length === 1 ? resolver.hints[0] : undefined\n );\n\n if (hint) {\n if (hint.factorId === PhoneMultiFactorGenerator.FACTOR_ID) {\n return <SmsMultiFactorAssertionForm hint={hint} />;\n }\n\n if (hint.factorId === TotpMultiFactorGenerator.FACTOR_ID) {\n return <TotpMultiFactorAssertionForm hint={hint} />;\n }\n }\n\n return (\n <div className=\"fui-content\">\n <p>TODO: Select a multi-factor authentication method</p>\n {resolver.hints.map((hint) => {\n if (hint.factorId === TotpMultiFactorGenerator.FACTOR_ID) {\n return <TotpButton key={hint.factorId} onClick={() => setHint(hint)} />;\n }\n\n if (hint.factorId === PhoneMultiFactorGenerator.FACTOR_ID) {\n return <SmsButton key={hint.factorId} onClick={() => setHint(hint)} />;\n }\n\n return null;\n })}\n </div>\n );\n}\n\nfunction TotpButton(props: ComponentProps<typeof Button>) {\n const ui = useUI();\n const labelText = getTranslation(ui, \"labels\", \"mfaTotpVerification\");\n return <Button {...props}>{labelText}</Button>;\n}\n\nfunction SmsButton(props: ComponentProps<typeof Button>) {\n const ui = useUI();\n const labelText = getTranslation(ui, \"labels\", \"mfaSmsVerification\");\n return <Button {...props}>{labelText}</Button>;\n}\n","/**\n * Copyright 2025 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { getTranslation } from \"@firebase-oss/ui-core\";\nimport { type PropsWithChildren } from \"react\";\nimport { useUI } from \"~/hooks\";\nimport { Card, CardContent, CardHeader, CardSubtitle, CardTitle } from \"~/components/card\";\nimport { Policies } from \"~/components/policies\";\nimport { MultiFactorAuthAssertionForm } from \"../forms/multi-factor-auth-assertion-form\";\nimport { RedirectError } from \"~/components/redirect-error\";\n\nexport type OAuthScreenProps = PropsWithChildren;\n\nexport function OAuthScreen({ children }: OAuthScreenProps) {\n const ui = useUI();\n\n const titleText = getTranslation(ui, \"labels\", \"signIn\");\n const subtitleText = getTranslation(ui, \"prompts\", \"signInToAccount\");\n const mfaResolver = ui.multiFactorResolver;\n\n return (\n <div className=\"fui-screen\">\n <Card>\n <CardHeader>\n <CardTitle>{titleText}</CardTitle>\n <CardSubtitle>{subtitleText}</CardSubtitle>\n </CardHeader>\n <CardContent className=\"fui-screen__children\">\n {mfaResolver ? (\n <MultiFactorAuthAssertionForm />\n ) : (\n <>\n {children}\n <RedirectError />\n <Policies />\n </>\n )}\n </CardContent>\n </Card>\n </div>\n );\n}\n","/**\n * Copyright 2025 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { PropsWithChildren } from \"react\";\nimport { getTranslation } from \"@firebase-oss/ui-core\";\nimport { Divider } from \"~/components/divider\";\nimport { useUI } from \"~/hooks\";\nimport { Card, CardContent, CardHeader, CardSubtitle, CardTitle } from \"~/components/card\";\nimport { PhoneAuthForm, type PhoneAuthFormProps } from \"../forms/phone-auth-form\";\nimport { MultiFactorAuthAssertionForm } from \"../forms/multi-factor-auth-assertion-form\";\nimport { RedirectError } from \"~/components/redirect-error\";\n\nexport type PhoneAuthScreenProps = PropsWithChildren<PhoneAuthFormProps>;\n\nexport function PhoneAuthScreen({ children, ...props }: PhoneAuthScreenProps) {\n const ui = useUI();\n\n const titleText = getTranslation(ui, \"labels\", \"signIn\");\n const subtitleText = getTranslation(ui, \"prompts\", \"signInToAccount\");\n const mfaResolver = ui.multiFactorResolver;\n\n return (\n <div className=\"fui-screen\">\n <Card>\n <CardHeader>\n <CardTitle>{titleText}</CardTitle>\n <CardSubtitle>{subtitleText}</CardSubtitle>\n </CardHeader>\n <CardContent>\n {mfaResolver ? (\n <MultiFactorAuthAssertionForm />\n ) : (\n <>\n <PhoneAuthForm {...props} />\n {children ? (\n <>\n <Divider>{getTranslation(ui, \"messages\", \"dividerOr\")}</Divider>\n <div className=\"fui-screen__children\">\n {children}\n <RedirectError />\n </div>\n </>\n ) : null}\n </>\n )}\n </CardContent>\n </Card>\n </div>\n );\n}\n","/**\n * Copyright 2025 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { PropsWithChildren } from \"react\";\nimport { getTranslation } from \"@firebase-oss/ui-core\";\nimport { Divider } from \"~/components/divider\";\nimport { useUI } from \"~/hooks\";\nimport { Card, CardContent, CardHeader, CardSubtitle, CardTitle } from \"../../components/card\";\nimport { SignInAuthForm, type SignInAuthFormProps } from \"../forms/sign-in-auth-form\";\nimport { MultiFactorAuthAssertionForm } from \"../forms/multi-factor-auth-assertion-form\";\nimport { RedirectError } from \"~/components/redirect-error\";\n\nexport type SignInAuthScreenProps = PropsWithChildren<SignInAuthFormProps>;\n\nexport function SignInAuthScreen({ children, ...props }: SignInAuthScreenProps) {\n const ui = useUI();\n\n const titleText = getTranslation(ui, \"labels\", \"signIn\");\n const subtitleText = getTranslation(ui, \"prompts\", \"signInToAccount\");\n\n const mfaResolver = ui.multiFactorResolver;\n\n return (\n <div className=\"fui-screen\">\n <Card>\n <CardHeader>\n <CardTitle>{titleText}</CardTitle>\n <CardSubtitle>{subtitleText}</CardSubtitle>\n </CardHeader>\n <CardContent>\n {mfaResolver ? (\n <MultiFactorAuthAssertionForm />\n ) : (\n <>\n <SignInAuthForm {...props} />\n {children ? (\n <>\n <Divider>{getTranslation(ui, \"messages\", \"dividerOr\")}</Divider>\n <div className=\"fui-screen__children\">\n {children}\n <RedirectError />\n </div>\n </>\n ) : null}\n </>\n )}\n </CardContent>\n </Card>\n </div>\n );\n}\n","/**\n * Copyright 2025 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { type PropsWithChildren } from \"react\";\nimport { Divider } from \"~/components/divider\";\nimport { useUI } from \"~/hooks\";\nimport { Card, CardContent, CardHeader, CardSubtitle, CardTitle } from \"../../components/card\";\nimport { SignUpAuthForm, type SignUpAuthFormProps } from \"../forms/sign-up-auth-form\";\nimport { getTranslation } from \"@firebase-oss/ui-core\";\nimport { RedirectError } from \"~/components/redirect-error\";\nimport { MultiFactorAuthAssertionForm } from \"../forms/multi-factor-auth-assertion-form\";\n\nexport type SignUpAuthScreenProps = PropsWithChildren<SignUpAuthFormProps>;\n\nexport function SignUpAuthScreen({ children, ...props }: SignUpAuthScreenProps) {\n const ui = useUI();\n\n const titleText = getTranslation(ui, \"labels\", \"signUp\");\n const subtitleText = getTranslation(ui, \"prompts\", \"enterDetailsToCreate\");\n\n const mfaResolver = ui.multiFactorResolver;\n\n return (\n <div className=\"fui-screen\">\n <Card>\n <CardHeader>\n <CardTitle>{titleText}</CardTitle>\n <CardSubtitle>{subtitleText}</CardSubtitle>\n </CardHeader>\n <CardContent>\n {mfaResolver ? (\n <MultiFactorAuthAssertionForm />\n ) : (\n <>\n <SignUpAuthForm {...props} />\n {children ? (\n <>\n <Divider>{getTranslation(ui, \"messages\", \"dividerOr\")}</Divider>\n <div className=\"fui-screen__children\">\n {children}\n <RedirectError />\n </div>\n </>\n ) : null}\n </>\n )}\n </CardContent>\n </Card>\n </div>\n );\n}\n","/**\n * Copyright 2025 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\"use client\";\n\nimport { FirebaseUIError, getTranslation, signInWithProvider } from \"@firebase-oss/ui-core\";\nimport type { AuthProvider } from \"firebase/auth\";\nimport type { PropsWithChildren } from \"react\";\nimport { useCallback, useState } from \"react\";\nimport { Button } from \"~/components/button\";\nimport { useUI } from \"~/hooks\";\n\nexport type OAuthButtonProps = PropsWithChildren<{\n provider: AuthProvider;\n themed?: boolean | string;\n}>;\n\nexport function useSignInWithProvider(provider: AuthProvider) {\n const ui = useUI();\n const [error, setError] = useState<string | null>(null);\n\n const callback = useCallback(async () => {\n setError(null);\n try {\n await signInWithProvider(ui, provider);\n } catch (error) {\n if (error instanceof FirebaseUIError) {\n setError(error.message);\n return;\n }\n console.error(error);\n setError(getTranslation(ui, \"errors\", \"unknownError\"));\n }\n }, [ui, provider, setError]);\n\n return { error, callback };\n}\n\nexport function OAuthButton({ provider, children, themed }: OAuthButtonProps) {\n const ui = useUI();\n\n const { error, callback } = useSignInWithProvider(provider);\n\n return (\n <div>\n <Button\n type=\"button\"\n data-themed={themed}\n data-provider={provider.providerId}\n disabled={ui.state !== \"idle\"}\n onClick={callback}\n className=\"fui-provider__button\"\n >\n {children}\n </Button>\n {error && <div className=\"fui-form__error\">{error}</div>}\n </div>\n );\n}\n","import type { SVGProps } from \"react\";\nconst SvgLogo = (props: SVGProps<SVGSVGElement>) => (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"1em\" height=\"1em\" viewBox=\"0 0 50 50\" {...props}>\n <path\n fill=\"currentColor\"\n d=\"M44.527 34.75c-1.078 2.395-1.597 3.465-2.984 5.578-1.941 2.953-4.68 6.64-8.063 6.664-3.011.028-3.789-1.965-7.878-1.93-4.086.02-4.938 1.97-7.954 1.938-3.386-.031-5.976-3.352-7.918-6.3-5.43-8.27-6.003-17.966-2.648-23.122 2.375-3.656 6.129-5.805 9.656-5.805 3.594 0 5.852 1.973 8.82 1.973 2.883 0 4.637-1.976 8.794-1.976 3.14 0 6.46 1.71 8.836 4.664-7.766 4.257-6.504 15.347 1.34 18.316M31.195 8.469c1.512-1.942 2.66-4.68 2.242-7.469-2.464.168-5.347 1.742-7.03 3.781-1.528 1.86-2.794 4.617-2.302 7.285 2.692.086 5.477-1.52 7.09-3.597\"\n />\n </svg>\n);\nexport default SvgLogo;\n","/**\n * Copyright 2025 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\"use client\";\n\nimport { getTranslation } from \"@firebase-oss/ui-core\";\nimport { OAuthProvider } from \"firebase/auth\";\nimport { useUI } from \"~/hooks\";\nimport { OAuthButton } from \"./oauth-button\";\nimport AppleSvgLogo from \"~/components/logos/apple/Logo\";\nimport { cn } from \"~/utils/cn\";\n\nexport type AppleSignInButtonProps = {\n provider?: OAuthProvider;\n themed?: boolean;\n};\n\nexport function AppleSignInButton({ provider, themed }: AppleSignInButtonProps) {\n const ui = useUI();\n\n return (\n <OAuthButton provider={provider || new OAuthProvider(\"apple.com\")} themed={themed}>\n <AppleLogo />\n <span>{getTranslation(ui, \"labels\", \"signInWithApple\")}</span>\n </OAuthButton>\n );\n}\n\nexport function AppleLogo({ className, ...props }: React.SVGProps<SVGSVGElement>) {\n return <AppleSvgLogo className={cn(\"fui-provider__icon\", className)} {...props} />;\n}\n","import type { SVGProps } from \"react\";\nconst SvgLogo = (props: SVGProps<SVGSVGElement>) => (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"1em\" height=\"1em\" viewBox=\"0 0 50 50\" {...props}>\n <path\n fill=\"currentColor\"\n d=\"M25 3C12.85 3 3 12.85 3 25c0 11.03 8.125 20.137 18.712 21.728V30.831h-5.443v-5.783h5.443V21.2c0-6.371 3.104-9.168 8.399-9.168 2.536 0 3.877.188 4.512.274v5.048h-3.612c-2.248 0-3.033 2.131-3.033 4.533v3.161h6.588l-.894 5.783h-5.694v15.944C38.716 45.318 47 36.137 47 25c0-12.15-9.85-22-22-22\"\n />\n </svg>\n);\nexport default SvgLogo;\n","/**\n * Copyright 2025 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\"use client\";\n\nimport { getTranslation } from \"@firebase-oss/ui-core\";\nimport { FacebookAuthProvider } from \"firebase/auth\";\nimport { useUI } from \"~/hooks\";\nimport { OAuthButton } from \"./oauth-button\";\nimport FacebookSvgLogo from \"~/components/logos/facebook/Logo\";\nimport { cn } from \"~/utils/cn\";\n\nexport type FacebookSignInButtonProps = {\n provider?: FacebookAuthProvider;\n themed?: boolean;\n};\n\nexport function FacebookSignInButton({ provider, themed }: FacebookSignInButtonProps) {\n const ui = useUI();\n\n return (\n <OAuthButton provider={provider || new FacebookAuthProvider()} themed={themed}>\n <FacebookLogo />\n <span>{getTranslation(ui, \"labels\", \"signInWithFacebook\")}</span>\n </OAuthButton>\n );\n}\n\nexport function FacebookLogo({ className, ...props }: React.SVGProps<SVGSVGElement>) {\n return <FacebookSvgLogo className={cn(\"fui-provider__icon\", className)} {...props} />;\n}\n","import type { SVGProps } from \"react\";\nconst SvgLogo = (props: SVGProps<SVGSVGElement>) => (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"1em\" height=\"1em\" fill=\"currentColor\" viewBox=\"0 0 30 30\" {...props}>\n <path d=\"M15 3C8.373 3 3 8.373 3 15c0 5.623 3.872 10.328 9.092 11.63a1.8 1.8 0 0 1-.092-.583v-2.051h-1.508c-.821 0-1.551-.353-1.905-1.009-.393-.729-.461-1.844-1.435-2.526-.289-.227-.069-.486.264-.451.615.174 1.125.596 1.605 1.222.478.627.703.769 1.596.769.433 0 1.081-.025 1.691-.121.328-.833.895-1.6 1.588-1.962-3.996-.411-5.903-2.399-5.903-5.098 0-1.162.495-2.286 1.336-3.233-.276-.94-.623-2.857.106-3.587 1.798 0 2.885 1.166 3.146 1.481A9 9 0 0 1 15.495 9c1.036 0 2.024.174 2.922.483C18.675 9.17 19.763 8 21.565 8c.732.731.381 2.656.102 3.594.836.945 1.328 2.066 1.328 3.226 0 2.697-1.904 4.684-5.894 5.097C18.199 20.49 19 22.1 19 23.313v2.734c0 .104-.023.179-.035.268C23.641 24.676 27 20.236 27 15c0-6.627-5.373-12-12-12\" />\n </svg>\n);\nexport default SvgLogo;\n","/**\n * Copyright 2025 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\"use client\";\n\nimport { getTranslation } from \"@firebase-oss/ui-core\";\nimport { GithubAuthProvider } from \"firebase/auth\";\nimport { useUI } from \"~/hooks\";\nimport { OAuthButton } from \"./oauth-button\";\nimport GitHubSvgLogo from \"~/components/logos/github/Logo\";\nimport { cn } from \"~/utils/cn\";\n\nexport type GitHubSignInButtonProps = {\n provider?: GithubAuthProvider;\n themed?: boolean;\n};\n\nexport function GitHubSignInButton({ provider, themed }: GitHubSignInButtonProps) {\n const ui = useUI();\n\n return (\n <OAuthButton provider={provider || new GithubAuthProvider()} themed={themed}>\n <GitHubLogo />\n <span>{getTranslation(ui, \"labels\", \"signInWithGitHub\")}</span>\n </OAuthButton>\n );\n}\n\nexport function GitHubLogo({ className, ...props }: React.SVGProps<SVGSVGElement>) {\n return <GitHubSvgLogo className={cn(\"fui-provider__icon\", className)} {...props} />;\n}\n","import type { SVGProps } from \"react\";\nconst SvgLogo = (props: SVGProps<SVGSVGElement>) => (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"1em\" height=\"1em\" viewBox=\"0 0 48 48\" {...props}>\n <path\n fill=\"#FFC107\"\n d=\"M43.611 20.083H42V20H24v8h11.303c-1.649 4.657-6.08 8-11.303 8-6.627 0-12-5.373-12-12s5.373-12 12-12c3.059 0 5.842 1.154 7.961 3.039l5.657-5.657C34.046 6.053 29.268 4 24 4 12.955 4 4 12.955 4 24s8.955 20 20 20 20-8.955 20-20c0-1.341-.138-2.65-.389-3.917\"\n />\n <path\n fill=\"#FF3D00\"\n d=\"m6.306 14.691 6.571 4.819C14.655 15.108 18.961 12 24 12c3.059 0 5.842 1.154 7.961 3.039l5.657-5.657C34.046 6.053 29.268 4 24 4 16.318 4 9.656 8.337 6.306 14.691\"\n />\n <path\n fill=\"#4CAF50\"\n d=\"M24 44c5.166 0 9.86-1.977 13.409-5.192l-6.19-5.238A11.9 11.9 0 0 1 24 36c-5.202 0-9.619-3.317-11.283-7.946l-6.522 5.025C9.505 39.556 16.227 44 24 44\"\n />\n <path\n fill=\"#1976D2\"\n d=\"M43.611 20.083H42V20H24v8h11.303a12.04 12.04 0 0 1-4.087 5.571l.003-.002 6.19 5.238C36.971 39.205 44 34 44 24c0-1.341-.138-2.65-.389-3.917\"\n />\n </svg>\n);\nexport default SvgLogo;\n","/**\n * Copyright 2025 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\"use client\";\n\nimport { getTranslation } from \"@firebase-oss/ui-core\";\nimport { GoogleAuthProvider } from \"firebase/auth\";\nimport { useUI } from \"~/hooks\";\nimport { OAuthButton } from \"./oauth-button\";\nimport GoogleSvgLogo from \"~/components/logos/google/Logo\";\nimport { cn } from \"~/utils/cn\";\n\nexport type GoogleSignInButtonProps = {\n provider?: GoogleAuthProvider;\n themed?: boolean | \"neutral\";\n};\n\nexport function GoogleSignInButton({ provider, themed }: GoogleSignInButtonProps) {\n const ui = useUI();\n\n return (\n <OAuthButton provider={provider || new GoogleAuthProvider()} themed={themed}>\n <GoogleLogo />\n <span>{getTranslation(ui, \"labels\", \"signInWithGoogle\")}</span>\n </OAuthButton>\n );\n}\n\nexport function GoogleLogo({ className, ...props }: React.SVGProps<SVGSVGElement>) {\n return <GoogleSvgLogo className={cn(\"fui-provider__icon\", className)} {...props} />;\n}\n","import type { SVGProps } from \"react\";\nconst SvgLogo = (props: SVGProps<SVGSVGElement>) => (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"1em\" height=\"1em\" viewBox=\"0 0 48 48\" {...props}>\n <path fill=\"#ff5722\" d=\"M22 22H6V6h16z\" />\n <path fill=\"#4caf50\" d=\"M42 22H26V6h16z\" />\n <path fill=\"#ffc107\" d=\"M42 42H26V26h16z\" />\n <path fill=\"#03a9f4\" d=\"M22 42H6V26h16z\" />\n </svg>\n);\nexport default SvgLogo;\n","/**\n * Copyright 2025 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\"use client\";\n\nimport { getTranslation } from \"@firebase-oss/ui-core\";\nimport { OAuthProvider } from \"firebase/auth\";\nimport { useUI } from \"~/hooks\";\nimport { OAuthButton } from \"./oauth-button\";\nimport MicrosoftSvgLogo from \"~/components/logos/microsoft/Logo\";\nimport { cn } from \"~/utils/cn\";\n\nexport type MicrosoftSignInButtonProps = {\n provider?: OAuthProvider;\n themed?: boolean;\n};\n\nexport function MicrosoftSignInButton({ provider, themed }: MicrosoftSignInButtonProps) {\n const ui = useUI();\n\n return (\n <OAuthButton provider={provider || new OAuthProvider(\"microsoft.com\")} themed={themed}>\n <MicrosoftLogo />\n <span>{getTranslation(ui, \"labels\", \"signInWithMicrosoft\")}</span>\n </OAuthButton>\n );\n}\n\nexport function MicrosoftLogo({ className, ...props }: React.SVGProps<SVGSVGElement>) {\n return <MicrosoftSvgLogo className={cn(\"fui-provider__icon\", className)} {...props} />;\n}\n","import type { SVGProps } from \"react\";\nconst SvgLogo = (props: SVGProps<SVGSVGElement>) => (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"1em\" height=\"1em\" fill=\"currentColor\" viewBox=\"0 0 30 30\" {...props}>\n <path d=\"m26.37 26-8.795-12.822.015.012L25.52 4h-2.65l-6.46 7.48L11.28 4H4.33l8.211 11.971-.001-.001L3.88 26h2.65l7.182-8.322L19.42 26zM10.23 6l12.34 18h-2.1L8.12 6z\" />\n </svg>\n);\nexport default SvgLogo;\n","/**\n * Copyright 2025 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\"use client\";\n\nimport { getTranslation } from \"@firebase-oss/ui-core\";\nimport { TwitterAuthProvider } from \"firebase/auth\";\nimport { useUI } from \"~/hooks\";\nimport { OAuthButton } from \"./oauth-button\";\nimport TwitterSvgLogo from \"~/components/logos/twitter/Logo\";\nimport { cn } from \"~/utils/cn\";\n\nexport type TwitterSignInButtonProps = {\n provider?: TwitterAuthProvider;\n themed?: boolean;\n};\n\nexport function TwitterSignInButton({ provider, themed }: TwitterSignInButtonProps) {\n const ui = useUI();\n\n return (\n <OAuthButton provider={provider || new TwitterAuthProvider()} themed={themed}>\n <TwitterLogo />\n <span>{getTranslation(ui, \"labels\", \"signInWithTwitter\")}</span>\n </OAuthButton>\n );\n}\n\nexport function TwitterLogo({ className, ...props }: React.SVGProps<SVGSVGElement>) {\n return <TwitterSvgLogo className={cn(\"fui-provider__icon\", className)} {...props} />;\n}\n","import { useCallback, useRef, useState } from \"react\";\nimport { multiFactor, PhoneAuthProvider, PhoneMultiFactorGenerator, type RecaptchaVerifier } from \"firebase/auth\";\nimport {\n enrollWithMultiFactorAssertion,\n FirebaseUIError,\n formatPhoneNumber,\n getTranslation,\n verifyPhoneNumber,\n} from \"@firebase-oss/ui-core\";\nimport { CountrySelector, type CountrySelectorRef } from \"~/components/country-selector\";\nimport { form } from \"~/components/form\";\nimport {\n useMultiFactorPhoneAuthNumberFormSchema,\n useMultiFactorPhoneAuthVerifyFormSchema,\n useRecaptchaVerifier,\n useUI,\n} from \"~/hooks\";\n\nexport function useSmsMultiFactorEnrollmentPhoneAuthFormAction() {\n const ui = useUI();\n\n return useCallback(\n async ({ phoneNumber, recaptchaVerifier }: { phoneNumber: string; recaptchaVerifier: RecaptchaVerifier }) => {\n const mfaUser = multiFactor(ui.auth.currentUser!);\n return await verifyPhoneNumber(ui, phoneNumber, recaptchaVerifier, mfaUser);\n },\n [ui]\n );\n}\n\ntype UseSmsMultiFactorEnrollmentPhoneNumberForm = {\n recaptchaVerifier: RecaptchaVerifier;\n onSuccess: (verificationId: string, displayName?: string) => void;\n formatPhoneNumber?: (phoneNumber: string) => string;\n};\n\nexport function useSmsMultiFactorEnrollmentPhoneNumberForm({\n recaptchaVerifier,\n onSuccess,\n formatPhoneNumber,\n}: UseSmsMultiFactorEnrollmentPhoneNumberForm) {\n const action = useSmsMultiFactorEnrollmentPhoneAuthFormAction();\n const schema = useMultiFactorPhoneAuthNumberFormSchema();\n\n return form.useAppForm({\n defaultValues: {\n displayName: \"\",\n phoneNumber: \"\",\n },\n validators: {\n onBlur: schema,\n onSubmit: schema,\n onSubmitAsync: async ({ value }) => {\n try {\n const formatted = formatPhoneNumber ? formatPhoneNumber(value.phoneNumber) : value.phoneNumber;\n const confirmationResult = await action({ phoneNumber: formatted, recaptchaVerifier });\n return onSuccess(confirmationResult, value.displayName);\n } catch (error) {\n return error instanceof FirebaseUIError ? error.message : String(error);\n }\n },\n },\n });\n}\n\ntype MultiFactorEnrollmentPhoneNumberFormProps = {\n onSubmit: (verificationId: string, displayName?: string) => void;\n};\n\nfunction MultiFactorEnrollmentPhoneNumberForm(props: MultiFactorEnrollmentPhoneNumberFormProps) {\n const ui = useUI();\n const recaptchaContainerRef = useRef<HTMLDivElement>(null);\n const recaptchaVerifier = useRecaptchaVerifier(recaptchaContainerRef);\n const countrySelector = useRef<CountrySelectorRef>(null);\n const form = useSmsMultiFactorEnrollmentPhoneNumberForm({\n recaptchaVerifier: recaptchaVerifier!,\n onSuccess: props.onSubmit,\n formatPhoneNumber: (phoneNumber) => formatPhoneNumber(phoneNumber, countrySelector.current!.getCountry()),\n });\n\n return (\n <form\n className=\"fui-form\"\n onSubmit={async (e) => {\n e.preventDefault();\n e.stopPropagation();\n await form.handleSubmit();\n }}\n >\n <form.AppForm>\n <fieldset>\n <form.AppField name=\"displayName\">\n {(field) => <field.Input label={getTranslation(ui, \"labels\", \"displayName\")} type=\"text\" />}\n </form.AppField>\n </fieldset>\n <fieldset>\n <form.AppField name=\"phoneNumber\">\n {(field) => (\n <field.Input\n label={getTranslation(ui, \"labels\", \"phoneNumber\")}\n type=\"tel\"\n before={<CountrySelector ref={countrySelector} />}\n />\n )}\n </form.AppField>\n </fieldset>\n <fieldset>\n <div className=\"fui-recaptcha-container\" ref={recaptchaContainerRef} />\n </fieldset>\n <fieldset>\n <form.SubmitButton>{getTranslation(ui, \"labels\", \"sendCode\")}</form.SubmitButton>\n <form.ErrorMessage />\n </fieldset>\n </form.AppForm>\n </form>\n );\n}\n\nexport function useMultiFactorEnrollmentVerifyPhoneNumberFormAction() {\n const ui = useUI();\n return useCallback(\n async ({\n verificationId,\n verificationCode,\n displayName,\n }: {\n verificationId: string;\n verificationCode: string;\n displayName?: string;\n }) => {\n const credential = PhoneAuthProvider.credential(verificationId, verificationCode);\n const assertion = PhoneMultiFactorGenerator.assertion(credential);\n return await enrollWithMultiFactorAssertion(ui, assertion, displayName);\n },\n [ui]\n );\n}\n\ntype UseMultiFactorEnrollmentVerifyPhoneNumberForm = {\n verificationId: string;\n displayName?: string;\n onSuccess: () => void;\n};\n\nexport function useMultiFactorEnrollmentVerifyPhoneNumberForm({\n verificationId,\n displayName,\n onSuccess,\n}: UseMultiFactorEnrollmentVerifyPhoneNumberForm) {\n const schema = useMultiFactorPhoneAuthVerifyFormSchema();\n const action = useMultiFactorEnrollmentVerifyPhoneNumberFormAction();\n\n return form.useAppForm({\n defaultValues: {\n verificationId,\n verificationCode: \"\",\n },\n validators: {\n onSubmit: schema,\n onBlur: schema,\n onSubmitAsync: async ({ value }) => {\n try {\n await action({ ...value, displayName });\n return onSuccess();\n } catch (error) {\n return error instanceof FirebaseUIError ? error.message : String(error);\n }\n },\n },\n });\n}\n\ntype MultiFactorEnrollmentVerifyPhoneNumberFormProps = {\n verificationId: string;\n displayName?: string;\n onSuccess: () => void;\n};\n\nexport function MultiFactorEnrollmentVerifyPhoneNumberForm(props: MultiFactorEnrollmentVerifyPhoneNumberFormProps) {\n const ui = useUI();\n const form = useMultiFactorEnrollmentVerifyPhoneNumberForm({\n ...props,\n onSuccess: props.onSuccess,\n });\n\n return (\n <form\n className=\"fui-form\"\n onSubmit={async (e) => {\n e.preventDefault();\n e.stopPropagation();\n await form.handleSubmit();\n }}\n >\n <form.AppForm>\n <fieldset>\n <form.AppField name=\"verificationCode\">\n {(field) => <field.Input label={getTranslation(ui, \"labels\", \"verificationCode\")} type=\"text\" />}\n </form.AppField>\n </fieldset>\n <fieldset>\n <form.SubmitButton>{getTranslation(ui, \"labels\", \"verifyCode\")}</form.SubmitButton>\n <form.ErrorMessage />\n </fieldset>\n </form.AppForm>\n </form>\n );\n}\n\nexport type SmsMultiFactorEnrollmentFormProps = {\n onSuccess?: () => void;\n};\n\nexport function SmsMultiFactorEnrollmentForm(props: SmsMultiFactorEnrollmentFormProps) {\n const ui = useUI();\n\n const [verification, setVerification] = useState<{\n verificationId: string;\n displayName?: string;\n } | null>(null);\n\n if (!ui.auth.currentUser) {\n throw new Error(\"User must be authenticated to enroll with multi-factor authentication\");\n }\n\n if (!verification) {\n return (\n <MultiFactorEnrollmentPhoneNumberForm\n onSubmit={(verificationId, displayName) => setVerification({ verificationId, displayName })}\n />\n );\n }\n\n return (\n <MultiFactorEnrollmentVerifyPhoneNumberForm\n {...verification}\n onSuccess={() => {\n props.onSuccess?.();\n }}\n />\n );\n}\n","import { useCallback, useState } from \"react\";\nimport { TotpMultiFactorGenerator, type TotpSecret } from \"firebase/auth\";\nimport {\n enrollWithMultiFactorAssertion,\n FirebaseUIError,\n generateTotpQrCode,\n generateTotpSecret,\n getTranslation,\n} from \"@firebase-oss/ui-core\";\nimport { form } from \"~/components/form\";\nimport { useMultiFactorTotpAuthNumberFormSchema, useMultiFactorTotpAuthVerifyFormSchema, useUI } from \"~/hooks\";\n\nexport function useTotpMultiFactorSecretGenerationFormAction() {\n const ui = useUI();\n\n return useCallback(async () => {\n return await generateTotpSecret(ui);\n }, [ui]);\n}\n\ntype UseTotpMultiFactorEnrollmentForm = {\n onSuccess: (secret: TotpSecret, displayName: string) => void;\n};\n\nexport function useTotpMultiFactorSecretGenerationForm({ onSuccess }: UseTotpMultiFactorEnrollmentForm) {\n const action = useTotpMultiFactorSecretGenerationFormAction();\n const schema = useMultiFactorTotpAuthNumberFormSchema();\n\n return form.useAppForm({\n defaultValues: {\n displayName: \"\",\n },\n validators: {\n onBlur: schema,\n onSubmit: schema,\n onSubmitAsync: async ({ value }) => {\n try {\n const secret = await action();\n return onSuccess(secret, value.displayName);\n } catch (error) {\n return error instanceof FirebaseUIError ? error.message : String(error);\n }\n },\n },\n });\n}\n\ntype TotpMultiFactorSecretGenerationFormProps = {\n onSubmit: (secret: TotpSecret, displayName: string) => void;\n};\n\nfunction TotpMultiFactorSecretGenerationForm(props: TotpMultiFactorSecretGenerationFormProps) {\n const ui = useUI();\n const form = useTotpMultiFactorSecretGenerationForm({\n onSuccess: props.onSubmit,\n });\n\n return (\n <form\n className=\"fui-form\"\n onSubmit={async (e) => {\n e.preventDefault();\n e.stopPropagation();\n await form.handleSubmit();\n }}\n >\n <form.AppForm>\n <fieldset>\n <form.AppField name=\"displayName\">\n {(field) => <field.Input label={getTranslation(ui, \"labels\", \"displayName\")} type=\"text\" />}\n </form.AppField>\n </fieldset>\n <fieldset>\n <form.SubmitButton>{getTranslation(ui, \"labels\", \"generateQrCode\")}</form.SubmitButton>\n <form.ErrorMessage />\n </fieldset>\n </form.AppForm>\n </form>\n );\n}\n\nexport function useMultiFactorEnrollmentVerifyTotpFormAction() {\n const ui = useUI();\n return useCallback(\n async ({ secret, verificationCode }: { secret: TotpSecret; verificationCode: string; displayName: string }) => {\n const assertion = TotpMultiFactorGenerator.assertionForEnrollment(secret, verificationCode);\n return await enrollWithMultiFactorAssertion(ui, assertion, verificationCode);\n },\n [ui]\n );\n}\n\ntype UseMultiFactorEnrollmentVerifyTotpForm = {\n secret: TotpSecret;\n displayName: string;\n onSuccess: () => void;\n};\n\nexport function useMultiFactorEnrollmentVerifyTotpForm({\n secret,\n displayName,\n onSuccess,\n}: UseMultiFactorEnrollmentVerifyTotpForm) {\n const schema = useMultiFactorTotpAuthVerifyFormSchema();\n const action = useMultiFactorEnrollmentVerifyTotpFormAction();\n\n return form.useAppForm({\n defaultValues: {\n verificationCode: \"\",\n },\n validators: {\n onSubmit: schema,\n onBlur: schema,\n onSubmitAsync: async ({ value }) => {\n try {\n await action({ secret, verificationCode: value.verificationCode, displayName });\n return onSuccess();\n } catch (error) {\n return error instanceof FirebaseUIError ? error.message : String(error);\n }\n },\n },\n });\n}\n\ntype MultiFactorEnrollmentVerifyTotpFormProps = {\n secret: TotpSecret;\n displayName: string;\n onSuccess: () => void;\n};\n\nexport function MultiFactorEnrollmentVerifyTotpForm(props: MultiFactorEnrollmentVerifyTotpFormProps) {\n const ui = useUI();\n const form = useMultiFactorEnrollmentVerifyTotpForm({\n ...props,\n onSuccess: props.onSuccess,\n });\n\n const qrCodeDataUrl = generateTotpQrCode(ui, props.secret, props.displayName);\n\n return (\n <form\n className=\"fui-form\"\n onSubmit={async (e) => {\n e.preventDefault();\n e.stopPropagation();\n await form.handleSubmit();\n }}\n >\n <div className=\"fui-qr-code-container\">\n <img src={qrCodeDataUrl} alt=\"TOTP QR Code\" />\n <p>TODO: Scan this QR code with your authenticator app</p>\n </div>\n <form.AppForm>\n <fieldset>\n <form.AppField name=\"verificationCode\">\n {(field) => <field.Input label={getTranslation(ui, \"labels\", \"verificationCode\")} type=\"text\" />}\n </form.AppField>\n </fieldset>\n <fieldset>\n <form.SubmitButton>{getTranslation(ui, \"labels\", \"verifyCode\")}</form.SubmitButton>\n <form.ErrorMessage />\n </fieldset>\n </form.AppForm>\n </form>\n );\n}\n\nexport type TotpMultiFactorEnrollmentFormProps = {\n onSuccess?: () => void;\n};\n\nexport function TotpMultiFactorEnrollmentForm(props: TotpMultiFactorEnrollmentFormProps) {\n const ui = useUI();\n\n const [enrollment, setEnrollment] = useState<{\n secret: TotpSecret;\n displayName: string;\n } | null>(null);\n\n if (!ui.auth.currentUser) {\n throw new Error(\"User must be authenticated to enroll with multi-factor authentication\");\n }\n\n if (!enrollment) {\n return (\n <TotpMultiFactorSecretGenerationForm onSubmit={(secret, displayName) => setEnrollment({ secret, displayName })} />\n );\n }\n\n return (\n <MultiFactorEnrollmentVerifyTotpForm\n {...enrollment}\n onSuccess={() => {\n props.onSuccess?.();\n }}\n />\n );\n}\n","import { FactorId } from \"firebase/auth\";\nimport { getTranslation } from \"@firebase-oss/ui-core\";\nimport { type ComponentProps, useState } from \"react\";\n\nimport { SmsMultiFactorEnrollmentForm } from \"./mfa/sms-multi-factor-enrollment-form\";\nimport { TotpMultiFactorEnrollmentForm } from \"./mfa/totp-multi-factor-enrollment-form\";\nimport { Button } from \"~/components/button\";\nimport { useUI } from \"~/hooks\";\n\ntype Hint = (typeof FactorId)[keyof typeof FactorId];\n\nexport type MultiFactorAuthEnrollmentFormProps = {\n onEnrollment?: () => void;\n hints?: Hint[];\n};\n\nconst DEFAULT_HINTS = [FactorId.TOTP, FactorId.PHONE] as const;\n\nexport function MultiFactorAuthEnrollmentForm(props: MultiFactorAuthEnrollmentFormProps) {\n const hints = props.hints ?? DEFAULT_HINTS;\n\n if (hints.length === 0) {\n throw new Error(\"MultiFactorAuthEnrollmentForm must have at least one hint\");\n }\n\n // If only a single hint is provided, select it by default to improve UX.\n const [hint, setHint] = useState<Hint | undefined>(hints.length === 1 ? hints[0] : undefined);\n\n if (hint) {\n if (hint === FactorId.TOTP) {\n return <TotpMultiFactorEnrollmentForm onSuccess={props.onEnrollment} />;\n }\n\n if (hint === FactorId.PHONE) {\n return <SmsMultiFactorEnrollmentForm onSuccess={props.onEnrollment} />;\n }\n\n throw new Error(`Unknown multi-factor enrollment type: ${hint}`);\n }\n\n return (\n <div className=\"fui-content\">\n {hints.map((hint) => {\n if (hint === FactorId.TOTP) {\n return <TotpButton key={hint} onClick={() => setHint(hint)} />;\n }\n\n if (hint === FactorId.PHONE) {\n return <SmsButton key={hint} onClick={() => setHint(hint)} />;\n }\n\n return null;\n })}\n </div>\n );\n}\n\nfunction TotpButton(props: ComponentProps<typeof Button>) {\n const ui = useUI();\n const labelText = getTranslation(ui, \"labels\", \"mfaTotpVerification\");\n return <Button {...props}>{labelText}</Button>;\n}\n\nfunction SmsButton(props: ComponentProps<typeof Button>) {\n const ui = useUI();\n const labelText = getTranslation(ui, \"labels\", \"mfaSmsVerification\");\n return <Button {...props}>{labelText}</Button>;\n}\n","import { getTranslation } from \"@firebase-oss/ui-core\";\nimport { Card, CardContent, CardHeader, CardSubtitle, CardTitle } from \"~/components/card\";\nimport { useUI } from \"~/hooks\";\nimport {\n MultiFactorAuthEnrollmentForm,\n type MultiFactorAuthEnrollmentFormProps,\n} from \"../forms/multi-factor-auth-enrollment-form\";\n\nexport type MultiFactorAuthEnrollmentScreenProps = MultiFactorAuthEnrollmentFormProps;\n\nexport function MultiFactorAuthEnrollmentScreen(props: MultiFactorAuthEnrollmentScreenProps) {\n const ui = useUI();\n\n const titleText = getTranslation(ui, \"labels\", \"multiFactorEnrollment\");\n const subtitleText = getTranslation(ui, \"prompts\", \"mfaEnrollmentPrompt\");\n\n return (\n <div className=\"fui-screen\">\n <Card>\n <CardHeader>\n <CardTitle>{titleText}</CardTitle>\n <CardSubtitle>{subtitleText}</CardSubtitle>\n </CardHeader>\n <CardContent>\n <MultiFactorAuthEnrollmentForm {...props} />\n </CardContent>\n </Card>\n </div>\n );\n}\n","/// <reference types=\"vite/client\" />\n/**\n * Copyright 2025 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { registerFramework } from \"@firebase-oss/ui-core\";\nimport pkgJson from \"../package.json\";\n\nexport { PolicyContext } from \"./components/policies\";\nexport * from \"./auth\";\nexport * from \"./hooks\";\nexport * from \"./components\";\nexport { FirebaseUIProvider, type FirebaseUIProviderProps } from \"./context\";\n\nif (import.meta.env.PROD) {\n registerFramework(\"react\", pkgJson.version);\n}\n"]}
package/package.json ADDED
@@ -0,0 +1,72 @@
1
+ {
2
+ "name": "@firebase-oss/ui-react",
3
+ "version": "0.0.1",
4
+ "type": "module",
5
+ "main": "./dist/index.cjs",
6
+ "module": "./dist/index.js",
7
+ "types": "./dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "import": "./dist/index.js",
12
+ "require": "./dist/index.cjs"
13
+ }
14
+ },
15
+ "files": [
16
+ "dist"
17
+ ],
18
+ "scripts": {
19
+ "prepare": "pnpm run build",
20
+ "build": "tsup && pnpm run build:logos",
21
+ "build:local": "pnpm run build && pnpm pack",
22
+ "build:logos": "pnpm dlx @svgr/cli --icon --typescript --no-index --jsx-runtime automatic --out-dir src/components/logos ../core/brands",
23
+ "dev": "tsup --watch",
24
+ "lint": "eslint . --ext .ts,.tsx",
25
+ "lint:fix": "eslint . --ext .ts,.tsx --fix",
26
+ "format": "prettier --write \"src/**/*.{ts,tsx}\"",
27
+ "format:check": "prettier --check \"src/**/*.{ts,tsx}\"",
28
+ "clean": "rimraf dist",
29
+ "test": "vitest run",
30
+ "test:unit": "vitest run tests/unit",
31
+ "test:unit:watch": "vitest tests/unit",
32
+ "test:integration": "vitest run tests/integration",
33
+ "test:integration:watch": "vitest tests/integration",
34
+ "publish:tags": "sh -c 'TAG=\"${npm_package_name}@${npm_package_version}\"; git tag --list \"$TAG\" | grep . || git tag \"$TAG\"; git push origin \"$TAG\"'",
35
+ "release": "pnpm run build && pnpm pack --pack-destination --pack-destination ../../releases/"
36
+ },
37
+ "peerDependencies": {
38
+ "firebase": "catalog:peerDependencies",
39
+ "react": "catalog:peerDependencies",
40
+ "react-dom": "catalog:peerDependencies"
41
+ },
42
+ "dependencies": {
43
+ "@firebase-oss/ui-core": "workspace:*",
44
+ "@firebase-oss/ui-styles": "workspace:*",
45
+ "@nanostores/react": "^1.0.0",
46
+ "@radix-ui/react-slot": "^1.2.3",
47
+ "@tanstack/react-form": "1.20.0",
48
+ "clsx": "^2.1.1",
49
+ "tailwind-merge": "^3.0.1",
50
+ "zod": "catalog:"
51
+ },
52
+ "devDependencies": {
53
+ "@firebase-oss/ui-translations": "workspace:*",
54
+ "@testing-library/jest-dom": "catalog:",
55
+ "@testing-library/react": "catalog:",
56
+ "@types/jsdom": "catalog:",
57
+ "@types/node": "catalog:",
58
+ "@types/react": "catalog:",
59
+ "@types/react-dom": "catalog:",
60
+ "@vitejs/plugin-react": "catalog:",
61
+ "firebase": "catalog:",
62
+ "jsdom": "catalog:",
63
+ "nanostores": "catalog:",
64
+ "react": "catalog:",
65
+ "react-dom": "catalog:",
66
+ "tsup": "catalog:",
67
+ "typescript": "catalog:",
68
+ "vite": "catalog:",
69
+ "vite-plugin-svgr": "^4.5.0",
70
+ "vitest": "catalog:"
71
+ }
72
+ }