@firebase-oss/ui-react 7.0.0-beta → 7.0.2-beta
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +9 -9
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../package.json","../src/components/policies.tsx","../src/context.tsx","../src/hooks.ts","../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/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/components/country-selector.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/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/multi-factor-auth-assertion-screen.tsx","../src/auth/screens/email-link-auth-screen.tsx","../src/auth/screens/forgot-password-auth-screen.tsx","../src/auth/screens/multi-factor-auth-enrollment-screen.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/index.ts"],"names":["package_default","PolicyContext","createContext","PolicyProvider","children","policies","jsx","Policies","ui","useUI","useContext","termsOfServiceUrl","privacyPolicyUrl","onNavigate","parts","getTranslation","Handler","part","index","cloneElement","FirebaseUIContext","FirebaseUIProvider","value","useStore","useOnUserAuthenticated","callback","auth","useEffect","user","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","currentElement","currentUI","getBehavior","cn","inputs","twMerge","clsx","Button","className","variant","asChild","props","Slot","buttonVariant","fieldContext","useFieldContext","formContext","useFormContext","createFormHookContexts","FieldMetadata","error","Input","before","label","action","description","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","useTotpMultiFactorAssertionFormAction","verificationCode","hint","assertion","TotpMultiFactorGenerator","signInWithMultiFactorAssertion","useTotpMultiFactorAssertionForm","TotpMultiFactorAssertionForm","useSmsMultiFactorAssertionPhoneFormAction","recaptchaVerifier","verifyPhoneNumber","useSmsMultiFactorAssertionPhoneForm","verificationId","SmsMultiFactorAssertionPhoneForm","recaptchaContainerRef","useSmsMultiFactorAssertionVerifyFormAction","PhoneAuthProvider","PhoneMultiFactorGenerator","useSmsMultiFactorAssertionVerifyForm","SmsMultiFactorAssertionVerifyForm","SmsMultiFactorAssertionForm","verification","setVerification","useMultiFactorAssertionCleanup","MultiFactorAuthAssertionForm","resolver","mfaAssertionFactorPrompt","setHint","TotpButton","SmsButton","labelText","useCountries","useDefaultCountry","CountrySelector","forwardRef","countries","defaultCountry","selected","setSelected","setCountry","code","foundCountry","country","useImperativeHandle","useSmsMultiFactorEnrollmentPhoneAuthFormAction","phoneNumber","mfaUser","multiFactor","useSmsMultiFactorEnrollmentPhoneNumberForm","formatPhoneNumber","formatted","confirmationResult","MultiFactorEnrollmentPhoneNumberForm","countrySelector","useMultiFactorEnrollmentVerifyPhoneNumberFormAction","displayName","enrollWithMultiFactorAssertion","useMultiFactorEnrollmentVerifyPhoneNumberForm","MultiFactorEnrollmentVerifyPhoneNumberForm","SmsMultiFactorEnrollmentForm","useTotpMultiFactorSecretGenerationFormAction","generateTotpSecret","useTotpMultiFactorSecretGenerationForm","secret","TotpMultiFactorSecretGenerationForm","useMultiFactorEnrollmentVerifyTotpFormAction","useMultiFactorEnrollmentVerifyTotpForm","MultiFactorEnrollmentVerifyTotpForm","qrCodeDataUrl","generateTotpQrCode","TotpMultiFactorEnrollmentForm","enrollment","setEnrollment","DEFAULT_HINTS","FactorId","MultiFactorAuthEnrollmentForm","hints","usePhoneNumberFormAction","usePhoneNumberForm","PhoneNumberForm","useVerifyPhoneNumberFormAction","confirmPhoneNumber","useVerifyPhoneNumberForm","VerifyPhoneNumberForm","PhoneAuthForm","setVerificationId","useSignInAuthFormAction","password","signInWithEmailAndPassword","useSignInAuthForm","SignInAuthForm","onForgotPasswordClick","onSignUpClick","useRequireDisplayName","hasBehavior","useSignUpAuthFormAction","createUserWithEmailAndPassword","useSignUpAuthForm","requireDisplayName","SignUpAuthForm","onSignInClick","onSignUp","Divider","Card","CardHeader","CardTitle","CardSubtitle","CardContent","RedirectError","MultiFactorAuthAssertionScreen","titleText","subtitleText","EmailLinkAuthScreen","mfaResolver","ForgotPasswordAuthScreen","MultiFactorAuthEnrollmentScreen","OAuthScreen","PhoneAuthScreen","SignInAuthScreen","SignUpAuthScreen","useSignInWithProvider","provider","setError","signInWithProvider","OAuthButton","themed","SvgLogo","Logo_default","AppleSignInButton","OAuthProvider","AppleLogo","FacebookSignInButton","FacebookAuthProvider","FacebookLogo","GitHubSignInButton","GithubAuthProvider","GitHubLogo","GoogleSignInButton","GoogleAuthProvider","GoogleLogo","MicrosoftSignInButton","MicrosoftLogo","TwitterSignInButton","TwitterAuthProvider","TwitterLogo","registerFramework"],"mappings":"wXAAA,IAAAA,GAAA,CAEE,OAAA,CAAW,YAuEb,ECxCO,IAAMC,GAAgBC,mBAAAA,CAAuC,MAAS,EAOtE,SAASC,EAAAA,CAAe,CAAE,QAAA,CAAAC,CAAAA,CAAU,SAAAC,CAAS,CAAA,CAA0D,CAC5G,OAAOC,cAAAA,CAACL,GAAc,QAAA,CAAd,CAAuB,KAAA,CAAOI,CAAAA,CAAW,QAAA,CAAAD,CAAAA,CAAS,CAC5D,CAYO,SAASG,GAAW,CACzB,IAAMC,EAAKC,CAAAA,EAAM,CACXJ,CAAAA,CAAWK,gBAAAA,CAAWT,EAAa,CAAA,CAEzC,GAAI,CAACI,CAAAA,CACH,OAAO,IAAA,CAGT,GAAM,CAAE,iBAAA,CAAAM,CAAAA,CAAmB,gBAAA,CAAAC,CAAAA,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firebase-oss/ui-react\",\n \"version\": \"7.0.0-beta\",\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 --env.PROD=true && 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 \"version:bump\": \"pnpm version patch\",\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 \"publish:npm\": \"../../publish.sh\",\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 { getTranslation } from \"@firebase-oss/ui-core\";\nimport { cloneElement, createContext, useContext } from \"react\";\nimport { useUI } from \"~/hooks\";\n\n/** A URL for a policy document (terms of service or privacy policy). */\nexport type PolicyURL = string | URL;\n\n/** Configuration for terms of service and privacy policy links. */\nexport interface PolicyProps {\n /** The URL to the terms of service page. */\n termsOfServiceUrl: PolicyURL;\n /** The URL to the privacy policy page. */\n privacyPolicyUrl: PolicyURL;\n /** Optional callback function for handling navigation to policy pages. */\n onNavigate?: (url: PolicyURL) => void;\n}\n\nexport const PolicyContext = createContext<PolicyProps | undefined>(undefined);\n\n/**\n * Provides policy configuration to child components.\n *\n * @returns The policy provider component.\n */\nexport function PolicyProvider({ children, policies }: { children: React.ReactNode; policies?: PolicyProps }) {\n return <PolicyContext.Provider value={policies}>{children}</PolicyContext.Provider>;\n}\n\n/**\n * Displays terms of service and privacy policy links.\n *\n * The links are formatted according to the translated message template which may contain\n * placeholders like {tos} and {privacy}.\n *\n * Returns null if no policy configuration is provided.\n *\n * @returns The policies component, or null if no policies are configured.\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 { 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>(null as unknown as FirebaseUI);\n\n/** Props for the FirebaseUIProvider component. */\nexport type FirebaseUIProviderProps = {\n /** The child components to render. */\n children: React.ReactNode;\n /** The FirebaseUI store instance. */\n ui: FirebaseUIStore;\n /** Optional policy configuration for terms of service and privacy policy links. */\n policies?: PolicyProps;\n};\n\n/**\n * Provides FirebaseUI context to all child components.\n *\n * This provider must wrap your application or the components that use FirebaseUI hooks.\n *\n * @returns The provider component.\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, User } 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 * Gets the FirebaseUI instance from the React context.\n *\n * @returns The FirebaseUI instance from the context.\n * @throws {Error} Throws an error if the hook is used outside of a FirebaseUIProvider.\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:\n\nconst ui = initializeUI(...);\n\n<FirebaseUIProvider ui={ui}>\n <App />\n</FirebaseUIProvider>\n`\n );\n }\n\n return ui;\n}\n\n/**\n * Sets up a callback that is called when a user is authenticated (non-anonymous).\n *\n * @param callback - Optional callback function that receives the authenticated user.\n */\nexport function useOnUserAuthenticated(callback?: (user: User) => void) {\n const ui = useUI();\n const auth = ui.auth;\n\n useEffect(() => {\n return auth.onAuthStateChanged((user) => {\n if (user && !user.isAnonymous) {\n callback?.(user);\n }\n });\n }, [auth, callback]);\n}\n\n/**\n * Gets the redirect error message, if any, from the FirebaseUI instance.\n *\n * @returns The error message as a string, or undefined if there is no redirect error.\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\n/**\n * Gets a memoized Zod schema for sign-in form validation.\n *\n * @returns A Zod schema for sign-in form validation.\n */\nexport function useSignInAuthFormSchema() {\n const ui = useUI();\n return useMemo(() => createSignInAuthFormSchema(ui), [ui]);\n}\n\n/**\n * Gets a memoized Zod schema for sign-up form validation.\n *\n * @returns A Zod schema for sign-up form validation.\n */\nexport function useSignUpAuthFormSchema() {\n const ui = useUI();\n return useMemo(() => createSignUpAuthFormSchema(ui), [ui]);\n}\n\n/**\n * Gets a memoized Zod schema for forgot password form validation.\n *\n * @returns A Zod schema for forgot password form validation.\n */\nexport function useForgotPasswordAuthFormSchema() {\n const ui = useUI();\n return useMemo(() => createForgotPasswordAuthFormSchema(ui), [ui]);\n}\n\n/**\n * Gets a memoized Zod schema for email link authentication form validation.\n *\n * @returns A Zod schema for email link authentication form validation.\n */\nexport function useEmailLinkAuthFormSchema() {\n const ui = useUI();\n return useMemo(() => createEmailLinkAuthFormSchema(ui), [ui]);\n}\n\n/**\n * Gets a memoized Zod schema for phone number form validation.\n *\n * @returns A Zod schema for phone number form validation.\n */\nexport function usePhoneAuthNumberFormSchema() {\n const ui = useUI();\n return useMemo(() => createPhoneAuthNumberFormSchema(ui), [ui]);\n}\n\n/**\n * Gets a memoized Zod schema for phone verification code form validation.\n *\n * @returns A Zod schema for phone verification form validation.\n */\nexport function usePhoneAuthVerifyFormSchema() {\n const ui = useUI();\n return useMemo(() => createPhoneAuthVerifyFormSchema(ui), [ui]);\n}\n\n/**\n * Gets a memoized Zod schema for multi-factor phone authentication number form validation.\n *\n * @returns A Zod schema for multi-factor phone authentication number form validation.\n */\nexport function useMultiFactorPhoneAuthNumberFormSchema() {\n const ui = useUI();\n return useMemo(() => createMultiFactorPhoneAuthNumberFormSchema(ui), [ui]);\n}\n\n/**\n * Gets a memoized Zod schema for multi-factor phone authentication verification form validation.\n *\n * @returns A Zod schema for multi-factor phone authentication verification form validation.\n */\nexport function useMultiFactorPhoneAuthVerifyFormSchema() {\n const ui = useUI();\n return useMemo(() => createMultiFactorPhoneAuthVerifyFormSchema(ui), [ui]);\n}\n\n/**\n * Gets a memoized Zod schema for multi-factor TOTP authentication number form validation.\n *\n * @returns A Zod schema for multi-factor TOTP authentication number form validation.\n */\nexport function useMultiFactorTotpAuthNumberFormSchema() {\n const ui = useUI();\n return useMemo(() => createMultiFactorTotpAuthNumberFormSchema(ui), [ui]);\n}\n\n/**\n * Gets a memoized Zod schema for multi-factor TOTP authentication verification form validation.\n *\n * @returns A Zod schema for multi-factor TOTP authentication verification form validation.\n */\nexport function useMultiFactorTotpAuthVerifyFormSchema() {\n const ui = useUI();\n return useMemo(() => createMultiFactorTotpAuthVerifyFormSchema(ui), [ui]);\n}\n\n/**\n * Creates and manages a reCAPTCHA verifier instance for phone authentication.\n *\n * The verifier is automatically rendered to the provided element and cleaned up when the element changes.\n *\n * @param ref - A React ref to the HTML element where the reCAPTCHA should be rendered.\n * @returns The reCAPTCHA verifier instance, or null if the element is not available.\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 { twMerge } from \"tailwind-merge\";\nimport { clsx } from \"clsx\";\n\n/**\n * Utility function for merging and deduplicating CSS class names.\n *\n * Combines clsx for conditional class names with tailwind-merge to handle Tailwind CSS class conflicts.\n *\n * @param inputs - Variable number of class name arguments (strings, objects, arrays, etc.).\n * @returns A merged and deduplicated string of class names.\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\n/** Props for the Button component. */\nexport type ButtonProps = ComponentProps<\"button\"> & {\n /** The visual variant of the button. */\n variant?: ButtonVariant;\n /** If true, the button will render as a child component using Radix UI's Slot. */\n asChild?: boolean;\n};\n\n/**\n * A customizable button component with multiple variants.\n *\n * @returns The button component.\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","/**\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, 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-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 description,\n ...props\n}: PropsWithChildren<\n ComponentProps<\"input\"> & { label: string; before?: ReactNode; action?: ReactNode; description?: ReactNode }\n>) {\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 {description ? <div data-input-description>{description}</div> : null}\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-error\">{errorMap.onSubmit}</div>;\n }\n\n return null;\n }}\n </form.Subscribe>\n );\n}\n\n/**\n * A form hook factory for creating forms with validation and error handling.\n *\n * Provides field components (Input) and form components (SubmitButton, ErrorMessage, Action)\n * for building accessible forms with TanStack Form.\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\n/** Props for the EmailLinkAuthForm component. */\nexport type EmailLinkAuthFormProps = {\n /** Callback function called when the sign-in link email is sent. */\n onEmailSent?: () => void;\n /** Callback function called when sign-in is completed via the email link. */\n onSignIn?: (credential: UserCredential) => void;\n};\n\n/**\n * Creates a memoized action function for sending a sign-in link to an email address.\n *\n * @returns A callback function that sends a sign-in link to the specified email address.\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\n/**\n * Creates a form hook for email link authentication.\n *\n * @param onSuccess - Optional callback function called when the sign-in link email is sent.\n * @returns A form instance configured for email link authentication.\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 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\n/**\n * Hook that automatically completes the email link sign-in process when the component mounts.\n *\n * Checks if the current URL contains a valid email link sign-in link and completes the authentication.\n *\n * @param onSignIn - Optional callback function called when sign-in is completed.\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 if (credential) {\n onSignIn?.(credential);\n }\n };\n\n void completeSignIn();\n // eslint-disable-next-line react-hooks/exhaustive-deps -- TODO(ehesp): ui triggers re-render\n }, [onSignIn]);\n}\n\n/**\n * A form component for email link authentication.\n *\n * Sends a sign-in link to the user's email address and automatically completes sign-in\n * if the user arrives via an email link.\n *\n * @returns The email link auth form component.\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\n/** Props for the ForgotPasswordAuthForm component. */\nexport type ForgotPasswordAuthFormProps = {\n /** Callback function called when the password reset email is sent. */\n onPasswordSent?: () => void;\n /** Callback function called when the back to sign in link is clicked. */\n onBackToSignInClick?: () => void;\n};\n\n/**\n * Creates a memoized action function for sending a password reset email.\n *\n * @returns A callback function that sends a password reset email to the specified address.\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\n/**\n * Creates a form hook for forgot password authentication.\n *\n * @param onSuccess - Optional callback function called when the password reset email is sent.\n * @returns A form instance configured for forgot password.\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 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\n/**\n * A form component for requesting a password reset email.\n *\n * Displays a success message after the email is sent.\n *\n * @returns The forgot password form component.\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\nimport { useCallback } from \"react\";\nimport { TotpMultiFactorGenerator, type MultiFactorInfo, type UserCredential } from \"firebase/auth\";\nimport { signInWithMultiFactorAssertion, FirebaseUIError, getTranslation } from \"@firebase-oss/ui-core\";\nimport { form } from \"~/components/form\";\nimport { useMultiFactorTotpAuthVerifyFormSchema, useUI } from \"~/hooks\";\n\n/**\n * Creates a memoized action function for verifying a TOTP code during multi-factor assertion.\n *\n * @returns A callback function that verifies the TOTP code and signs in with the multi-factor assertion.\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\n/** Options for the TOTP multi-factor assertion form hook. */\nexport type UseTotpMultiFactorAssertionForm = {\n /** The multi-factor info hint containing TOTP information. */\n hint: MultiFactorInfo;\n /** Callback function called when verification is successful. */\n onSuccess: (credential: UserCredential) => void;\n};\n\n/**\n * Creates a form hook for TOTP multi-factor assertion verification code input.\n *\n * @param options - The TOTP assertion form options.\n * @returns A form instance configured for TOTP verification code input.\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 onBlur: schema,\n onSubmitAsync: async ({ value }) => {\n try {\n const credential = await action({ verificationCode: value.verificationCode, hint });\n return onSuccess(credential);\n } catch (error) {\n return error instanceof FirebaseUIError ? error.message : String(error);\n }\n },\n },\n });\n}\n\n/** Props for the TotpMultiFactorAssertionForm component. */\nexport type TotpMultiFactorAssertionFormProps = {\n /** The multi-factor info hint containing TOTP information. */\n hint: MultiFactorInfo;\n /** Optional callback function called when multi-factor assertion is successful. */\n onSuccess?: (credential: UserCredential) => void;\n};\n\n/**\n * A form component for TOTP multi-factor authentication assertion.\n *\n * Allows users to enter a 6-digit TOTP code from their authenticator app.\n *\n * @returns The TOTP multi-factor assertion form component.\n */\nexport function TotpMultiFactorAssertionForm(props: TotpMultiFactorAssertionFormProps) {\n const ui = useUI();\n const form = useTotpMultiFactorAssertionForm({\n hint: props.hint,\n onSuccess: (credential) => {\n props.onSuccess?.(credential);\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 description={getTranslation(ui, \"prompts\", \"enterVerificationCode\")}\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","/**\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 { useCallback, useRef, useState } from \"react\";\nimport {\n PhoneAuthProvider,\n PhoneMultiFactorGenerator,\n type UserCredential,\n type MultiFactorInfo,\n type RecaptchaVerifier,\n} from \"firebase/auth\";\n\nimport {\n signInWithMultiFactorAssertion,\n FirebaseUIError,\n getTranslation,\n verifyPhoneNumber,\n} from \"@firebase-oss/ui-core\";\nimport { form } from \"~/components/form\";\nimport { useMultiFactorPhoneAuthVerifyFormSchema, useRecaptchaVerifier, useUI } from \"~/hooks\";\n\ntype PhoneMultiFactorInfo = MultiFactorInfo & {\n phoneNumber?: string;\n};\n\n/**\n * Creates a memoized action function for verifying a phone number during SMS multi-factor assertion.\n *\n * @returns A callback function that verifies a phone number using the provided hint and reCAPTCHA verifier.\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\n/** Options for the SMS multi-factor assertion phone form hook. */\ntype UseSmsMultiFactorAssertionPhoneForm = {\n /** The multi-factor info hint containing phone number information. */\n hint: MultiFactorInfo;\n /** The reCAPTCHA verifier instance. */\n recaptchaVerifier: RecaptchaVerifier;\n /** Callback function called when phone verification is successful. */\n onSuccess: (verificationId: string) => void;\n};\n\n/**\n * Creates a form hook for SMS multi-factor assertion phone number verification.\n *\n * @param options - The phone form options.\n * @returns A form instance configured for phone number verification.\n */\nexport function useSmsMultiFactorAssertionPhoneForm({\n hint,\n recaptchaVerifier,\n onSuccess,\n}: UseSmsMultiFactorAssertionPhoneForm) {\n const action = useSmsMultiFactorAssertionPhoneFormAction();\n\n return form.useAppForm({\n validators: {\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 <label>\n <div data-input-description>\n {getTranslation(ui, \"messages\", \"mfaSmsAssertionPrompt\", {\n phoneNumber: (props.hint as PhoneMultiFactorInfo).phoneNumber || \"\",\n })}\n </div>\n </label>\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\n/**\n * Creates a memoized action function for verifying the SMS verification code during multi-factor assertion.\n *\n * @returns A callback function that verifies the code and signs in with the multi-factor assertion.\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\n/** Options for the SMS multi-factor assertion verify form hook. */\ntype UseSmsMultiFactorAssertionVerifyForm = {\n /** The verification ID from the phone verification step. */\n verificationId: string;\n /** Callback function called when verification is successful. */\n onSuccess: (credential: UserCredential) => void;\n};\n\n/**\n * Creates a form hook for SMS multi-factor assertion verification code input.\n *\n * @param options - The verify form options.\n * @returns A form instance configured for verification code input.\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 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 SmsMultiFactorAssertionVerifyFormProps = {\n verificationId: string;\n onSuccess: (credential: UserCredential) => 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) => (\n <field.Input\n label={getTranslation(ui, \"labels\", \"verificationCode\")}\n type=\"text\"\n description={getTranslation(ui, \"prompts\", \"smsVerificationPrompt\")}\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\n/** Props for the SmsMultiFactorAssertionForm component. */\nexport type SmsMultiFactorAssertionFormProps = {\n /** The multi-factor info hint containing phone number information. */\n hint: MultiFactorInfo;\n /** Optional callback function called when multi-factor assertion is successful. */\n onSuccess?: (credential: UserCredential) => void;\n};\n\n/**\n * A form component for SMS multi-factor authentication assertion.\n *\n * Handles the two-step process: first verifying the phone number, then verifying the SMS code.\n *\n * @returns The SMS multi-factor assertion form component.\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={(credential) => {\n props.onSuccess?.(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\nimport {\n PhoneMultiFactorGenerator,\n TotpMultiFactorGenerator,\n type UserCredential,\n type MultiFactorInfo,\n} from \"firebase/auth\";\nimport { type ComponentProps, useEffect, 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\n/** Props for the MultiFactorAuthAssertionForm component. */\nexport type MultiFactorAuthAssertionFormProps = {\n /** Optional callback function called when multi-factor assertion is successful. */\n onSuccess?: (credential: UserCredential) => void;\n};\n\n/**\n * Hook that cleans up the multi-factor resolver when the component unmounts.\n *\n * Ensures the resolver is cleared from the UI state to prevent stale state.\n */\nexport function useMultiFactorAssertionCleanup() {\n const ui = useUI();\n\n useEffect(() => {\n return () => {\n ui.setMultiFactorResolver();\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps -- UI isn't stable enough to be a dependency here. Could we use useEffectEvent here instead once we depend on 19.2?\n }, []);\n}\n\n/**\n * A form component for multi-factor authentication assertion.\n *\n * Displays the appropriate MFA form (SMS or TOTP) based on the available hints.\n * If only one hint is available, it is automatically selected.\n *\n * @returns The multi-factor auth assertion form component.\n * @throws {Error} Throws an error if no multi-factor resolver is available.\n */\nexport function MultiFactorAuthAssertionForm(props: MultiFactorAuthAssertionFormProps) {\n const ui = useUI();\n const resolver = ui.multiFactorResolver;\n const mfaAssertionFactorPrompt = getTranslation(ui, \"prompts\", \"mfaAssertionFactorPrompt\");\n\n useMultiFactorAssertionCleanup();\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 (\n <SmsMultiFactorAssertionForm\n hint={hint}\n onSuccess={(credential) => {\n props.onSuccess?.(credential);\n }}\n />\n );\n }\n\n if (hint.factorId === TotpMultiFactorGenerator.FACTOR_ID) {\n return (\n <TotpMultiFactorAssertionForm\n hint={hint}\n onSuccess={(credential) => {\n props.onSuccess?.(credential);\n }}\n />\n );\n }\n }\n\n return (\n <div className=\"fui-content\">\n <p>{mfaAssertionFactorPrompt}</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\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\n/** Ref methods for the CountrySelector component. */\nexport interface CountrySelectorRef {\n /** Gets the currently selected country. */\n getCountry: () => CountryData;\n /** Sets the selected country by country code. */\n setCountry: (code: CountryCode) => void;\n}\n\n/** Props for the CountrySelector component. */\nexport type CountrySelectorProps = ComponentProps<\"div\">;\n\n/**\n * Gets the list of allowed countries from the country codes behavior.\n *\n * @returns The list of allowed countries.\n */\nexport function useCountries() {\n const ui = useUI();\n return getBehavior(ui, \"countryCodes\")().allowedCountries;\n}\n\n/**\n * Gets the default country from the country codes behavior.\n *\n * @returns The default country data.\n */\nexport function useDefaultCountry() {\n const ui = useUI();\n return getBehavior(ui, \"countryCodes\")().defaultCountry;\n}\n\n/**\n * A country selector component for phone number input.\n *\n * Displays a dropdown with country flags, dial codes, and names for selecting a country.\n *\n * @param ref - A ref to access the country selector methods.\n * @returns The country selector component.\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\nimport { 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\n/**\n * Creates a memoized action function for verifying a phone number during SMS multi-factor enrollment.\n *\n * @returns A callback function that verifies a phone number for MFA enrollment using the provided reCAPTCHA verifier.\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\n/** Options for the SMS multi-factor enrollment phone number form hook. */\nexport type UseSmsMultiFactorEnrollmentPhoneNumberForm = {\n /** The reCAPTCHA verifier instance. */\n recaptchaVerifier: RecaptchaVerifier;\n /** Callback function called when phone verification is successful. */\n onSuccess: (verificationId: string, displayName?: string) => void;\n /** Optional function to format the phone number before verification. */\n formatPhoneNumber?: (phoneNumber: string) => string;\n};\n\n/**\n * Creates a form hook for SMS multi-factor enrollment phone number verification.\n *\n * @param options - The phone number form options.\n * @returns A form instance configured for phone number input and verification for MFA enrollment.\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 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\n/**\n * Creates a memoized action function for verifying the SMS verification code during multi-factor enrollment.\n *\n * @returns A callback function that verifies the code and enrolls the phone number as a multi-factor authentication method.\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\n/** Options for the multi-factor enrollment verify phone number form hook. */\ntype UseMultiFactorEnrollmentVerifyPhoneNumberForm = {\n /** The verification ID from the phone verification step. */\n verificationId: string;\n /** Optional display name for the enrolled MFA method. */\n displayName?: string;\n /** Callback function called when enrollment is successful. */\n onSuccess: () => void;\n};\n\n/**\n * Creates a form hook for SMS multi-factor enrollment verification code input.\n *\n * @param options - The verify phone number form options.\n * @returns A form instance configured for verification code input during MFA enrollment.\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 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\n/** Props for the MultiFactorEnrollmentVerifyPhoneNumberForm component. */\ntype MultiFactorEnrollmentVerifyPhoneNumberFormProps = {\n /** The verification ID from the phone verification step. */\n verificationId: string;\n /** Optional display name for the enrolled MFA method. */\n displayName?: string;\n /** Callback function called when enrollment is successful. */\n onSuccess: () => void;\n};\n\n/**\n * A form component for verifying the SMS code during multi-factor enrollment.\n *\n * @returns The verify phone number form component.\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) => (\n <field.Input\n description={getTranslation(ui, \"prompts\", \"smsVerificationPrompt\")}\n label={getTranslation(ui, \"labels\", \"verificationCode\")}\n type=\"text\"\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\n/** Props for the SmsMultiFactorEnrollmentForm component. */\nexport type SmsMultiFactorEnrollmentFormProps = {\n /** Optional callback function called when enrollment is successful. */\n onSuccess?: () => void;\n};\n\n/**\n * A form component for SMS multi-factor authentication enrollment.\n *\n * Handles the two-step process: first entering the phone number and display name, then verifying the SMS code.\n *\n * @returns The SMS multi-factor enrollment form component.\n * @throws {Error} Throws an error if the user is not authenticated.\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","/**\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 { 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\n/**\n * Creates a memoized action function for generating a TOTP secret for multi-factor enrollment.\n *\n * @returns A callback function that generates a TOTP secret.\n */\nexport function useTotpMultiFactorSecretGenerationFormAction() {\n const ui = useUI();\n\n return useCallback(async () => {\n return await generateTotpSecret(ui);\n }, [ui]);\n}\n\n/** Options for the TOTP multi-factor enrollment form hook. */\nexport type UseTotpMultiFactorEnrollmentForm = {\n /** Callback function called when the TOTP secret is generated. */\n onSuccess: (secret: TotpSecret, displayName: string) => void;\n};\n\n/**\n * Creates a form hook for TOTP multi-factor enrollment secret generation.\n *\n * @param options - The TOTP enrollment form options.\n * @returns A form instance configured for display name input and secret generation.\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 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\n/**\n * Creates a memoized action function for verifying the TOTP code during multi-factor enrollment.\n *\n * @returns A callback function that verifies the TOTP code and enrolls it as a multi-factor authentication method.\n */\nexport function useMultiFactorEnrollmentVerifyTotpFormAction() {\n const ui = useUI();\n return useCallback(\n async ({\n secret,\n verificationCode,\n displayName,\n }: {\n secret: TotpSecret;\n verificationCode: string;\n displayName: string;\n }) => {\n const assertion = TotpMultiFactorGenerator.assertionForEnrollment(secret, verificationCode);\n return await enrollWithMultiFactorAssertion(ui, assertion, displayName);\n },\n [ui]\n );\n}\n\n/** Options for the multi-factor enrollment verify TOTP form hook. */\ntype UseMultiFactorEnrollmentVerifyTotpForm = {\n /** The TOTP secret generated in the previous step. */\n secret: TotpSecret;\n /** The display name for the enrolled MFA method. */\n displayName: string;\n /** Callback function called when enrollment is successful. */\n onSuccess: () => void;\n};\n\n/**\n * Creates a form hook for TOTP multi-factor enrollment verification code input.\n *\n * @param options - The verify TOTP form options.\n * @returns A form instance configured for TOTP verification code input during MFA enrollment.\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 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\n/** Props for the MultiFactorEnrollmentVerifyTotpForm component. */\ntype MultiFactorEnrollmentVerifyTotpFormProps = {\n /** The TOTP secret generated in the previous step. */\n secret: TotpSecret;\n /** The display name for the enrolled MFA method. */\n displayName: string;\n /** Callback function called when enrollment is successful. */\n onSuccess: () => void;\n};\n\n/**\n * A form component for verifying the TOTP code during multi-factor enrollment.\n *\n * Displays a QR code and secret key for the user to scan with their authenticator app,\n * then allows them to verify the enrollment with a TOTP code.\n *\n * @returns The verify TOTP form component.\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 <code>{props.secret.secretKey.toString()}</code>\n <p>{getTranslation(ui, \"prompts\", \"mfaTotpQrCodePrompt\")}</p>\n </div>\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 description={getTranslation(ui, \"prompts\", \"mfaTotpEnrollmentVerificationPrompt\")}\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\n/** Props for the TotpMultiFactorEnrollmentForm component. */\nexport type TotpMultiFactorEnrollmentFormProps = {\n /** Optional callback function called when enrollment is successful. */\n onSuccess?: () => void;\n};\n\n/**\n * A form component for TOTP multi-factor authentication enrollment.\n *\n * Handles the two-step process: first generating a TOTP secret and QR code, then verifying the TOTP code.\n *\n * @returns The TOTP multi-factor enrollment form component.\n * @throws {Error} Throws an error if the user is not authenticated.\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","/**\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 { 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\n/** Props for the MultiFactorAuthEnrollmentForm component. */\nexport type MultiFactorAuthEnrollmentFormProps = {\n /** Optional callback function called when enrollment is successful. */\n onEnrollment?: () => void;\n /** Optional array of factor IDs to allow enrollment for. Defaults to TOTP and PHONE. */\n hints?: Hint[];\n};\n\nconst DEFAULT_HINTS = [FactorId.TOTP, FactorId.PHONE] as const;\n\n/**\n * A form component for multi-factor authentication enrollment.\n *\n * Displays the appropriate MFA enrollment form (SMS or TOTP) based on the provided hints.\n * If only one hint is provided, it is automatically selected.\n *\n * @returns The multi-factor auth enrollment form component.\n * @throws {Error} Throws an error if no hints are provided or if an unknown hint type is encountered.\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 (\n <Button variant=\"secondary\" {...props}>\n {labelText}\n </Button>\n );\n}\n\nfunction SmsButton(props: ComponentProps<typeof Button>) {\n const ui = useUI();\n const labelText = getTranslation(ui, \"labels\", \"mfaSmsVerification\");\n return (\n <Button variant=\"secondary\" {...props}>\n {labelText}\n </Button>\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 {\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\n/**\n * Creates a memoized action function for verifying a phone number.\n *\n * @returns A callback function that verifies a phone number using the provided reCAPTCHA verifier.\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\n/** Options for the phone number form hook. */\ntype UsePhoneNumberForm = {\n /** The reCAPTCHA verifier instance. */\n recaptchaVerifier: RecaptchaVerifier;\n /** Callback function called when phone verification is successful. */\n onSuccess: (verificationId: string) => void;\n /** Optional function to format the phone number before verification. */\n formatPhoneNumber?: (phoneNumber: string) => string;\n};\n\n/**\n * Creates a form hook for phone number verification.\n *\n * @param options - The phone number form options.\n * @returns A form instance configured for phone number input and verification.\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 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\n/** Props for the PhoneNumberForm component. */\ntype PhoneNumberFormProps = {\n /** Callback function called when phone verification is successful. */\n onSubmit: (verificationId: string) => void;\n};\n\n/**\n * A form component for entering and verifying a phone number.\n *\n * Includes a country selector and reCAPTCHA verification.\n *\n * @returns The phone number form component.\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\n/**\n * Creates a memoized action function for verifying a phone verification code.\n *\n * @returns A callback function that confirms the phone number using the verification ID and code.\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\n/** Options for the verify phone number form hook. */\ntype UseVerifyPhoneNumberForm = {\n /** The verification ID from the phone verification step. */\n verificationId: string;\n /** Callback function called when verification is successful. */\n onSuccess: (credential: UserCredential) => void;\n};\n\n/**\n * Creates a form hook for phone verification code input.\n *\n * @param options - The verify phone number form options.\n * @returns A form instance configured for verification code input.\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 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) => (\n <field.Input\n label={getTranslation(ui, \"labels\", \"verificationCode\")}\n description={getTranslation(ui, \"prompts\", \"smsVerificationPrompt\")}\n type=\"text\"\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\n/** Props for the PhoneAuthForm component. */\nexport type PhoneAuthFormProps = {\n /** Optional callback function called when sign-in is successful. */\n onSignIn?: (credential: UserCredential) => void;\n};\n\n/**\n * A form component for phone authentication.\n *\n * Handles the two-step process: first entering the phone number, then verifying the SMS code.\n *\n * @returns The phone auth form component.\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\n/** Props for the SignInAuthForm component. */\nexport type SignInAuthFormProps = {\n /** Callback function called when sign-in is successful. */\n onSignIn?: (credential: UserCredential) => void;\n /** Callback function called when the forgot password link is clicked. */\n onForgotPasswordClick?: () => void;\n /** Callback function called when the sign up link is clicked. */\n onSignUpClick?: () => void;\n};\n\n/**\n * Creates a memoized action function for signing in with email and password.\n *\n * @returns A callback function that signs in a user with email and password.\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\n/**\n * Creates a form hook for sign-in authentication.\n *\n * @param onSuccess - Optional callback function called when sign-in is successful.\n * @returns A form instance configured for sign-in.\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 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\n/**\n * A form component for signing in with email and password.\n *\n * @returns The sign-in form component.\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\n/**\n * Checks if the requireDisplayName behavior is enabled.\n *\n * @returns True if display name is required, false otherwise.\n */\nexport function useRequireDisplayName() {\n const ui = useUI();\n return hasBehavior(ui, \"requireDisplayName\");\n}\n\n/** Props for the SignUpAuthForm component. */\nexport type SignUpAuthFormProps = {\n /** Callback function called when sign-up is successful. */\n onSignUp?: (credential: UserCredential) => void;\n /** Callback function called when the sign in link is clicked. */\n onSignInClick?: () => void;\n};\n\n/**\n * Creates a memoized action function for signing up with email and password.\n *\n * @returns A callback function that creates a new user account with email and password.\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\n/**\n * Creates a form hook for sign-up authentication.\n *\n * @param onSuccess - Optional callback function called when sign-up is successful.\n * @returns A form instance configured for sign-up.\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 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\n/**\n * A form component for signing up with email and password.\n *\n * Optionally includes a display name field if the requireDisplayName behavior is enabled.\n *\n * @returns The sign-up form component.\n */\nexport function SignUpAuthForm({ onSignInClick, 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 {onSignInClick ? (\n <form.Action onClick={onSignInClick}>\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\n/** Props for the Divider component. */\nexport type DividerProps = PropsWithChildren<ComponentProps<\"div\">>;\n\n/**\n * A divider component that can display a line or a line with text in the middle.\n *\n * @returns The divider component.\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\n/** Props for the Card component. */\nexport type CardProps = PropsWithChildren<ComponentProps<\"div\">>;\n\n/**\n * A card container component for grouping related content.\n *\n * @returns The card component.\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\n/**\n * The header section of a card.\n *\n * @returns The card header component.\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\n/**\n * The title of a card.\n *\n * @returns The card title component.\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\n/**\n * The subtitle of a card.\n *\n * @returns The card subtitle component.\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\n/**\n * The content section of a card.\n *\n * @returns The card content component.\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","/**\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 { useRedirectError } from \"~/hooks\";\n\n/**\n * Displays any error that occurred during a redirect-based authentication flow.\n *\n * Returns null if there is no redirect error.\n *\n * @returns The redirect error component, or null if there is no error.\n */\nexport function RedirectError() {\n const error = useRedirectError();\n\n if (!error) {\n return null;\n }\n\n return <div className=\"fui-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 { getTranslation } from \"@firebase-oss/ui-core\";\nimport { Card, CardContent, CardHeader, CardSubtitle, CardTitle } from \"~/components/card\";\nimport { useUI } from \"~/hooks\";\nimport {\n MultiFactorAuthAssertionForm,\n type MultiFactorAuthAssertionFormProps,\n} from \"../forms/multi-factor-auth-assertion-form\";\n\n/** Props for the MultiFactorAuthAssertionScreen component. */\nexport type MultiFactorAuthAssertionScreenProps = MultiFactorAuthAssertionFormProps;\n\n/**\n * A screen component for multi-factor authentication assertion.\n *\n * Displays a card with the multi-factor assertion form.\n *\n * @returns The multi-factor auth assertion screen component.\n */\nexport function MultiFactorAuthAssertionScreen(props: MultiFactorAuthAssertionScreenProps) {\n const ui = useUI();\n\n const titleText = getTranslation(ui, \"labels\", \"multiFactorAssertion\");\n const subtitleText = getTranslation(ui, \"prompts\", \"mfaAssertionPrompt\");\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 <MultiFactorAuthAssertionForm {...props} />\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 type { User } from \"firebase/auth\";\nimport { getTranslation } from \"@firebase-oss/ui-core\";\nimport { Divider } from \"~/components/divider\";\nimport { useOnUserAuthenticated, 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\";\nimport { MultiFactorAuthAssertionScreen } from \"./multi-factor-auth-assertion-screen\";\n\n/** Props for the EmailLinkAuthScreen component. */\nexport type EmailLinkAuthScreenProps = PropsWithChildren<\n Pick<EmailLinkAuthFormProps, \"onEmailSent\"> & {\n /** Callback function called when sign-in is successful. */\n onSignIn?: (user: User) => void;\n }\n>;\n\n/**\n * A screen component for email link authentication.\n *\n * Displays a card with the email link auth form and handles multi-factor authentication if required.\n *\n * @returns The email link auth screen component.\n */\nexport function EmailLinkAuthScreen({ children, onEmailSent, onSignIn }: EmailLinkAuthScreenProps) {\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 useOnUserAuthenticated(onSignIn);\n\n if (mfaResolver) {\n return <MultiFactorAuthAssertionScreen />;\n }\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\n/** Props for the ForgotPasswordAuthScreen component. */\nexport type ForgotPasswordAuthScreenProps = ForgotPasswordAuthFormProps;\n\n/**\n * A screen component for requesting a password reset.\n *\n * Displays a card with the forgot password form.\n *\n * @returns The forgot password screen component.\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","/**\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 { 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\n/** Props for the MultiFactorAuthEnrollmentScreen component. */\nexport type MultiFactorAuthEnrollmentScreenProps = MultiFactorAuthEnrollmentFormProps;\n\n/**\n * A screen component for multi-factor authentication enrollment.\n *\n * Displays a card with the multi-factor enrollment form.\n *\n * @returns The multi-factor auth enrollment screen component.\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","/**\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 User } from \"firebase/auth\";\nimport { type PropsWithChildren } from \"react\";\nimport { useOnUserAuthenticated, useUI } from \"~/hooks\";\nimport { Card, CardContent, CardHeader, CardSubtitle, CardTitle } from \"~/components/card\";\nimport { Policies } from \"~/components/policies\";\nimport { MultiFactorAuthAssertionScreen } from \"./multi-factor-auth-assertion-screen\";\nimport { RedirectError } from \"~/components/redirect-error\";\n\n/** Props for the OAuthScreen component. */\nexport type OAuthScreenProps = PropsWithChildren<{\n /** Callback function called when sign-in is successful. */\n onSignIn?: (user: User) => void;\n}>;\n\n/**\n * A screen component for OAuth provider authentication.\n *\n * Displays a card that should contain OAuth sign-in buttons as children.\n * Handles multi-factor authentication if required.\n *\n * @returns The OAuth screen component.\n */\nexport function OAuthScreen({ children, onSignIn }: 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 useOnUserAuthenticated(onSignIn);\n\n if (mfaResolver) {\n return <MultiFactorAuthAssertionScreen />;\n }\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 {children}\n <RedirectError />\n <Policies />\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 { useOnUserAuthenticated, useUI } from \"~/hooks\";\nimport { Card, CardContent, CardHeader, CardSubtitle, CardTitle } from \"~/components/card\";\nimport { PhoneAuthForm } from \"../forms/phone-auth-form\";\nimport { MultiFactorAuthAssertionScreen } from \"./multi-factor-auth-assertion-screen\";\nimport { RedirectError } from \"~/components/redirect-error\";\nimport type { User } from \"firebase/auth\";\n\n/** Props for the PhoneAuthScreen component. */\nexport type PhoneAuthScreenProps = PropsWithChildren<{\n /** Callback function called when sign-in is successful. */\n onSignIn?: (user: User) => void;\n}>;\n\n/**\n * A screen component for phone authentication.\n *\n * Displays a card with the phone auth form and handles multi-factor authentication if required.\n *\n * @returns The phone auth screen component.\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 useOnUserAuthenticated(props.onSignIn);\n\n if (mfaResolver) {\n return <MultiFactorAuthAssertionScreen />;\n }\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 <PhoneAuthForm />\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 type { PropsWithChildren } from \"react\";\nimport type { User } from \"firebase/auth\";\nimport { getTranslation } from \"@firebase-oss/ui-core\";\nimport { Divider } from \"~/components/divider\";\nimport { useOnUserAuthenticated, useUI } from \"~/hooks\";\nimport { Card, CardContent, CardHeader, CardSubtitle, CardTitle } from \"../../components/card\";\nimport { SignInAuthForm, type SignInAuthFormProps } from \"../forms/sign-in-auth-form\";\nimport { MultiFactorAuthAssertionScreen } from \"./multi-factor-auth-assertion-screen\";\nimport { RedirectError } from \"~/components/redirect-error\";\n\n/** Props for the SignInAuthScreen component. */\nexport type SignInAuthScreenProps = PropsWithChildren<Omit<SignInAuthFormProps, \"onSignIn\">> & {\n /** Callback function called when sign-in is successful. */\n onSignIn?: (user: User) => void;\n};\n\n/**\n * A screen component for signing in with email and password.\n *\n * Displays a card with the sign-in form and handles multi-factor authentication if required.\n *\n * @returns The sign-in screen component.\n */\nexport function SignInAuthScreen({ children, onSignIn, ...props }: SignInAuthScreenProps) {\n const ui = useUI();\n\n const titleText = getTranslation(ui, \"labels\", \"signIn\");\n const subtitleText = getTranslation(ui, \"prompts\", \"signInToAccount\");\n\n useOnUserAuthenticated(onSignIn);\n\n if (ui.multiFactorResolver) {\n return <MultiFactorAuthAssertionScreen />;\n }\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 <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 </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 type { User } from \"firebase/auth\";\nimport { Divider } from \"~/components/divider\";\nimport { useOnUserAuthenticated, 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 { MultiFactorAuthAssertionScreen } from \"./multi-factor-auth-assertion-screen\";\n\n/** Props for the SignUpAuthScreen component. */\nexport type SignUpAuthScreenProps = PropsWithChildren<Omit<SignUpAuthFormProps, \"onSignUp\">> & {\n /** Callback function called when sign-up is successful. */\n onSignUp?: (user: User) => void;\n};\n\n/**\n * A screen component for signing up with email and password.\n *\n * Displays a card with the sign-up form and handles multi-factor authentication if required.\n *\n * @returns The sign-up screen component.\n */\nexport function SignUpAuthScreen({ children, onSignUp, ...props }: SignUpAuthScreenProps) {\n const ui = useUI();\n\n const titleText = getTranslation(ui, \"labels\", \"signUp\");\n const subtitleText = getTranslation(ui, \"prompts\", \"enterDetailsToCreate\");\n\n useOnUserAuthenticated(onSignUp);\n\n if (ui.multiFactorResolver) {\n return <MultiFactorAuthAssertionScreen />;\n }\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 <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 </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, UserCredential } from \"firebase/auth\";\nimport type { PropsWithChildren } from \"react\";\nimport { useCallback, useState } from \"react\";\nimport { Button } from \"~/components/button\";\nimport { useUI } from \"~/hooks\";\n\n/** Props for the OAuthButton component. */\nexport type OAuthButtonProps = PropsWithChildren<{\n /** The authentication provider to sign in with. */\n provider: AuthProvider;\n /** Whether to use themed styling for the button. */\n themed?: boolean | string;\n /** Callback function called when sign-in is successful. */\n onSignIn?: (credential: UserCredential) => void;\n}>;\n\n/**\n * Hook for signing in with an OAuth provider.\n *\n * @param provider - The authentication provider to sign in with.\n * @param onSignIn - Optional callback function called when sign-in is successful.\n * @returns An object containing the error state and a callback function to trigger sign-in.\n */\nexport function useSignInWithProvider(provider: AuthProvider, onSignIn?: (credential: UserCredential) => void) {\n const ui = useUI();\n const [error, setError] = useState<string | null>(null);\n\n const callback = useCallback(async () => {\n setError(null);\n try {\n const credential = await signInWithProvider(ui, provider);\n onSignIn?.(credential);\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, onSignIn]);\n\n return { error, callback };\n}\n\n/**\n * A button component for signing in with an OAuth provider.\n *\n * @returns The OAuth button component.\n */\nexport function OAuthButton({ provider, children, themed, onSignIn }: OAuthButtonProps) {\n const ui = useUI();\n\n const { error, callback } = useSignInWithProvider(provider, onSignIn);\n\n return (\n <div>\n <Button\n type=\"button\"\n variant={themed ? \"primary\" : \"secondary\"}\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-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, type UserCredential } 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\n/** Props for the AppleSignInButton component. */\nexport type AppleSignInButtonProps = {\n /** Optional OAuth provider instance. Defaults to Apple provider. */\n provider?: OAuthProvider;\n /** Whether to apply themed styling. */\n themed?: boolean;\n /** Callback function called when sign-in is successful. */\n onSignIn?: (credential: UserCredential) => void;\n};\n\n/**\n * A button component for signing in with Apple.\n *\n * @returns The Apple sign-in button component.\n */\nexport function AppleSignInButton({ provider, ...props }: AppleSignInButtonProps) {\n const ui = useUI();\n\n return (\n <OAuthButton {...props} provider={provider || new OAuthProvider(\"apple.com\")}>\n <AppleLogo />\n <span>{getTranslation(ui, \"labels\", \"signInWithApple\")}</span>\n </OAuthButton>\n );\n}\n\n/**\n * The Apple logo SVG component.\n *\n * @returns The Apple logo component.\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, type UserCredential } 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\n/** Props for the FacebookSignInButton component. */\nexport type FacebookSignInButtonProps = {\n /** Optional OAuth provider instance. Defaults to Facebook provider. */\n provider?: FacebookAuthProvider;\n /** Whether to apply themed styling. */\n themed?: boolean;\n /** Callback function called when sign-in is successful. */\n onSignIn?: (credential: UserCredential) => void;\n};\n\n/**\n * A button component for signing in with Facebook.\n *\n * @returns The Facebook sign-in button component.\n */\nexport function FacebookSignInButton({ provider, ...props }: FacebookSignInButtonProps) {\n const ui = useUI();\n\n return (\n <OAuthButton {...props} provider={provider || new FacebookAuthProvider()}>\n <FacebookLogo />\n <span>{getTranslation(ui, \"labels\", \"signInWithFacebook\")}</span>\n </OAuthButton>\n );\n}\n\n/**\n * The Facebook logo SVG component.\n *\n * @returns The Facebook logo component.\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, type UserCredential } 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\n/** Props for the GitHubSignInButton component. */\nexport type GitHubSignInButtonProps = {\n /** Optional OAuth provider instance. Defaults to GitHub provider. */\n provider?: GithubAuthProvider;\n /** Whether to apply themed styling. */\n themed?: boolean;\n /** Callback function called when sign-in is successful. */\n onSignIn?: (credential: UserCredential) => void;\n};\n\n/**\n * A button component for signing in with GitHub.\n *\n * @returns The GitHub sign-in button component.\n */\nexport function GitHubSignInButton({ provider, ...props }: GitHubSignInButtonProps) {\n const ui = useUI();\n\n return (\n <OAuthButton {...props} provider={provider || new GithubAuthProvider()}>\n <GitHubLogo />\n <span>{getTranslation(ui, \"labels\", \"signInWithGitHub\")}</span>\n </OAuthButton>\n );\n}\n\n/**\n * The GitHub logo SVG component.\n *\n * @returns The GitHub logo component.\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, type UserCredential } 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\n/** Props for the GoogleSignInButton component. */\nexport type GoogleSignInButtonProps = {\n /** Optional OAuth provider instance. Defaults to Google provider. */\n provider?: GoogleAuthProvider;\n /** Whether to apply themed styling. Can be true, false, or \"neutral\". */\n themed?: boolean | \"neutral\";\n /** Callback function called when sign-in is successful. */\n onSignIn?: (credential: UserCredential) => void;\n};\n\n/**\n * A button component for signing in with Google.\n *\n * @returns The Google sign-in button component.\n */\nexport function GoogleSignInButton({ provider, ...props }: GoogleSignInButtonProps) {\n const ui = useUI();\n\n return (\n <OAuthButton {...props} provider={provider || new GoogleAuthProvider()}>\n <GoogleLogo />\n <span>{getTranslation(ui, \"labels\", \"signInWithGoogle\")}</span>\n </OAuthButton>\n );\n}\n\n/**\n * The Google logo SVG component.\n *\n * @returns The Google logo component.\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, type UserCredential } 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\n/** Props for the MicrosoftSignInButton component. */\nexport type MicrosoftSignInButtonProps = {\n /** Optional OAuth provider instance. Defaults to Microsoft provider. */\n provider?: OAuthProvider;\n /** Whether to apply themed styling. */\n themed?: boolean;\n /** Callback function called when sign-in is successful. */\n onSignIn?: (credential: UserCredential) => void;\n};\n\n/**\n * A button component for signing in with Microsoft.\n *\n * @returns The Microsoft sign-in button component.\n */\nexport function MicrosoftSignInButton({ provider, ...props }: MicrosoftSignInButtonProps) {\n const ui = useUI();\n\n return (\n <OAuthButton {...props} provider={provider || new OAuthProvider(\"microsoft.com\")}>\n <MicrosoftLogo />\n <span>{getTranslation(ui, \"labels\", \"signInWithMicrosoft\")}</span>\n </OAuthButton>\n );\n}\n\n/**\n * The Microsoft logo SVG component.\n *\n * @returns The Microsoft logo component.\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, type UserCredential } 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\n/** Props for the TwitterSignInButton component. */\nexport type TwitterSignInButtonProps = {\n /** Optional OAuth provider instance. Defaults to Twitter provider. */\n provider?: TwitterAuthProvider;\n /** Whether to apply themed styling. */\n themed?: boolean;\n /** Callback function called when sign-in is successful. */\n onSignIn?: (credential: UserCredential) => void;\n};\n\n/**\n * A button component for signing in with Twitter.\n *\n * @returns The Twitter sign-in button component.\n */\nexport function TwitterSignInButton({ provider, ...props }: TwitterSignInButtonProps) {\n const ui = useUI();\n\n return (\n <OAuthButton {...props} provider={provider || new TwitterAuthProvider()}>\n <TwitterLogo />\n <span>{getTranslation(ui, \"labels\", \"signInWithTwitter\")}</span>\n </OAuthButton>\n );\n}\n\n/**\n * The Twitter logo SVG component.\n *\n * @returns The Twitter logo component.\n */\nexport function TwitterLogo({ className, ...props }: React.SVGProps<SVGSVGElement>) {\n return <TwitterSvgLogo className={cn(\"fui-provider__icon\", className)} {...props} />;\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 * from \"./auth\";\nexport * from \"./components\";\nexport { PolicyContext } from \"./components/policies\";\nexport { FirebaseUIProvider, type FirebaseUIProviderProps } from \"./context\";\nexport * from \"./hooks\";\n\nif (import.meta.env?.PROD) {\n registerFramework(\"react\", pkgJson.version);\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../package.json","../src/components/policies.tsx","../src/context.tsx","../src/hooks.ts","../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/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/components/country-selector.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/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/multi-factor-auth-assertion-screen.tsx","../src/auth/screens/email-link-auth-screen.tsx","../src/auth/screens/forgot-password-auth-screen.tsx","../src/auth/screens/multi-factor-auth-enrollment-screen.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/index.ts"],"names":["package_default","PolicyContext","createContext","PolicyProvider","children","policies","jsx","Policies","ui","useUI","useContext","termsOfServiceUrl","privacyPolicyUrl","onNavigate","parts","getTranslation","Handler","part","index","cloneElement","FirebaseUIContext","FirebaseUIProvider","value","useStore","useOnUserAuthenticated","callback","auth","useEffect","user","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","currentElement","currentUI","getBehavior","cn","inputs","twMerge","clsx","Button","className","variant","asChild","props","Slot","buttonVariant","fieldContext","useFieldContext","formContext","useFormContext","createFormHookContexts","FieldMetadata","error","Input","before","label","action","description","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","useTotpMultiFactorAssertionFormAction","verificationCode","hint","assertion","TotpMultiFactorGenerator","signInWithMultiFactorAssertion","useTotpMultiFactorAssertionForm","TotpMultiFactorAssertionForm","useSmsMultiFactorAssertionPhoneFormAction","recaptchaVerifier","verifyPhoneNumber","useSmsMultiFactorAssertionPhoneForm","verificationId","SmsMultiFactorAssertionPhoneForm","recaptchaContainerRef","useSmsMultiFactorAssertionVerifyFormAction","PhoneAuthProvider","PhoneMultiFactorGenerator","useSmsMultiFactorAssertionVerifyForm","SmsMultiFactorAssertionVerifyForm","SmsMultiFactorAssertionForm","verification","setVerification","useMultiFactorAssertionCleanup","MultiFactorAuthAssertionForm","resolver","mfaAssertionFactorPrompt","setHint","TotpButton","SmsButton","labelText","useCountries","useDefaultCountry","CountrySelector","forwardRef","countries","defaultCountry","selected","setSelected","setCountry","code","foundCountry","country","useImperativeHandle","useSmsMultiFactorEnrollmentPhoneAuthFormAction","phoneNumber","mfaUser","multiFactor","useSmsMultiFactorEnrollmentPhoneNumberForm","formatPhoneNumber","formatted","confirmationResult","MultiFactorEnrollmentPhoneNumberForm","countrySelector","useMultiFactorEnrollmentVerifyPhoneNumberFormAction","displayName","enrollWithMultiFactorAssertion","useMultiFactorEnrollmentVerifyPhoneNumberForm","MultiFactorEnrollmentVerifyPhoneNumberForm","SmsMultiFactorEnrollmentForm","useTotpMultiFactorSecretGenerationFormAction","generateTotpSecret","useTotpMultiFactorSecretGenerationForm","secret","TotpMultiFactorSecretGenerationForm","useMultiFactorEnrollmentVerifyTotpFormAction","useMultiFactorEnrollmentVerifyTotpForm","MultiFactorEnrollmentVerifyTotpForm","qrCodeDataUrl","generateTotpQrCode","TotpMultiFactorEnrollmentForm","enrollment","setEnrollment","DEFAULT_HINTS","FactorId","MultiFactorAuthEnrollmentForm","hints","usePhoneNumberFormAction","usePhoneNumberForm","PhoneNumberForm","useVerifyPhoneNumberFormAction","confirmPhoneNumber","useVerifyPhoneNumberForm","VerifyPhoneNumberForm","PhoneAuthForm","setVerificationId","useSignInAuthFormAction","password","signInWithEmailAndPassword","useSignInAuthForm","SignInAuthForm","onForgotPasswordClick","onSignUpClick","useRequireDisplayName","hasBehavior","useSignUpAuthFormAction","createUserWithEmailAndPassword","useSignUpAuthForm","requireDisplayName","SignUpAuthForm","onSignInClick","onSignUp","Divider","Card","CardHeader","CardTitle","CardSubtitle","CardContent","RedirectError","MultiFactorAuthAssertionScreen","titleText","subtitleText","EmailLinkAuthScreen","mfaResolver","ForgotPasswordAuthScreen","MultiFactorAuthEnrollmentScreen","OAuthScreen","PhoneAuthScreen","SignInAuthScreen","SignUpAuthScreen","useSignInWithProvider","provider","setError","signInWithProvider","OAuthButton","themed","SvgLogo","Logo_default","AppleSignInButton","OAuthProvider","AppleLogo","FacebookSignInButton","FacebookAuthProvider","FacebookLogo","GitHubSignInButton","GithubAuthProvider","GitHubLogo","GoogleSignInButton","GoogleAuthProvider","GoogleLogo","MicrosoftSignInButton","MicrosoftLogo","TwitterSignInButton","TwitterAuthProvider","TwitterLogo","registerFramework"],"mappings":"wXAAA,IAAAA,GAAA,CAEE,OAAA,CAAW,YAuEb,ECxCO,IAAMC,GAAgBC,mBAAAA,CAAuC,MAAS,EAOtE,SAASC,EAAAA,CAAe,CAAE,QAAA,CAAAC,CAAAA,CAAU,SAAAC,CAAS,CAAA,CAA0D,CAC5G,OAAOC,cAAAA,CAACL,GAAc,QAAA,CAAd,CAAuB,KAAA,CAAOI,CAAAA,CAAW,QAAA,CAAAD,CAAAA,CAAS,CAC5D,CAYO,SAASG,GAAW,CACzB,IAAMC,EAAKC,CAAAA,EAAM,CACXJ,CAAAA,CAAWK,gBAAAA,CAAWT,EAAa,CAAA,CAEzC,GAAI,CAACI,CAAAA,CACH,OAAO,IAAA,CAGT,GAAM,CAAE,iBAAA,CAAAM,CAAAA,CAAmB,gBAAA,CAAAC,CAAAA,CAAkB,UAAA,CAAAC,CAAW,EAAIR,CAAAA,CAEtDS,CAAAA,CADsBC,sBAAeP,CAAAA,CAAI,UAAA,CAAY,iBAAiB,CAAA,CAC1C,KAAA,CAAM,uBAAuB,CAAA,CAEzDQ,CAAAA,CAAUH,CAAAA,CAAaP,eAAC,QAAA,CAAA,EAAO,CAAA,CAAKA,eAAC,GAAA,CAAA,CAAE,MAAA,CAAO,SAAS,GAAA,CAAI,qBAAA,CAAsB,CAAA,CAEvF,OACEA,cAAAA,CAAC,KAAA,CAAA,CAAI,UAAU,cAAA,CACZ,QAAA,CAAAQ,EAAM,GAAA,CAAI,CAACG,EAAcC,CAAAA,GACpBD,CAAAA,GAAS,OAAA,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AAA9D,cAAAA,CAAC,MAAA,CAAA,CAAK,EAAE,8JAAA,CAA+J,CAAA,CACzK,EAEK+O,EAAAA,CAAQD,EAAAA,CCkCR,SAASgB,GAAoB,CAAE,QAAA,CAAArB,EAAU,GAAG3K,CAAM,EAA6B,CACpF,IAAM5D,CAAAA,CAAKC,CAAAA,EAAM,CAEjB,OACE2E,gBAAC8J,CAAAA,CAAA,CAAa,GAAG9K,CAAAA,CAAO,QAAA,CAAU2K,GAAY,IAAIsB,wBAAAA,CAChD,QAAA,CAAA,CAAA/P,cAAAA,CAACgQ,EAAAA,CAAA,EAAY,EACbhQ,cAAAA,CAAC,MAAA,CAAA,CAAM,SAAAS,qBAAAA,CAAeP,CAAAA,CAAI,SAAU,mBAAmB,CAAA,CAAE,CAAA,CAAA,CAC3D,CAEJ,CAOO,SAAS8P,GAAY,CAAE,SAAA,CAAArM,EAAW,GAAGG,CAAM,EAAkC,CAClF,OAAO9D,cAAAA,CAAC+O,EAAAA,CAAA,CAAe,SAAA,CAAWzL,EAAG,oBAAA,CAAsBK,CAAS,EAAI,GAAGG,CAAAA,CAAO,CACpF,CC/BEmM,wBAAAA,CAAkB,OAAA,CAASvQ,EAAAA,CAAQ,OAAO,CAAA","file":"index.cjs","sourcesContent":["{\n \"name\": \"@firebase-oss/ui-react\",\n \"version\": \"7.0.2-beta\",\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 --env.PROD=true && 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 \"version:bump\": \"pnpm version patch\",\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 \"publish:npm\": \"../../publish.sh\",\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 { getTranslation } from \"@firebase-oss/ui-core\";\nimport { cloneElement, createContext, useContext } from \"react\";\nimport { useUI } from \"~/hooks\";\n\n/** A URL for a policy document (terms of service or privacy policy). */\nexport type PolicyURL = string | URL;\n\n/** Configuration for terms of service and privacy policy links. */\nexport interface PolicyProps {\n /** The URL to the terms of service page. */\n termsOfServiceUrl: PolicyURL;\n /** The URL to the privacy policy page. */\n privacyPolicyUrl: PolicyURL;\n /** Optional callback function for handling navigation to policy pages. */\n onNavigate?: (url: PolicyURL) => void;\n}\n\nexport const PolicyContext = createContext<PolicyProps | undefined>(undefined);\n\n/**\n * Provides policy configuration to child components.\n *\n * @returns The policy provider component.\n */\nexport function PolicyProvider({ children, policies }: { children: React.ReactNode; policies?: PolicyProps }) {\n return <PolicyContext.Provider value={policies}>{children}</PolicyContext.Provider>;\n}\n\n/**\n * Displays terms of service and privacy policy links.\n *\n * The links are formatted according to the translated message template which may contain\n * placeholders like {tos} and {privacy}.\n *\n * Returns null if no policy configuration is provided.\n *\n * @returns The policies component, or null if no policies are configured.\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 { 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>(null as unknown as FirebaseUI);\n\n/** Props for the FirebaseUIProvider component. */\nexport type FirebaseUIProviderProps = {\n /** The child components to render. */\n children: React.ReactNode;\n /** The FirebaseUI store instance. */\n ui: FirebaseUIStore;\n /** Optional policy configuration for terms of service and privacy policy links. */\n policies?: PolicyProps;\n};\n\n/**\n * Provides FirebaseUI context to all child components.\n *\n * This provider must wrap your application or the components that use FirebaseUI hooks.\n *\n * @returns The provider component.\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, User } 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 * Gets the FirebaseUI instance from the React context.\n *\n * @returns The FirebaseUI instance from the context.\n * @throws {Error} Throws an error if the hook is used outside of a FirebaseUIProvider.\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:\n\nconst ui = initializeUI(...);\n\n<FirebaseUIProvider ui={ui}>\n <App />\n</FirebaseUIProvider>\n`\n );\n }\n\n return ui;\n}\n\n/**\n * Sets up a callback that is called when a user is authenticated (non-anonymous).\n *\n * @param callback - Optional callback function that receives the authenticated user.\n */\nexport function useOnUserAuthenticated(callback?: (user: User) => void) {\n const ui = useUI();\n const auth = ui.auth;\n\n useEffect(() => {\n return auth.onAuthStateChanged((user) => {\n if (user && !user.isAnonymous) {\n callback?.(user);\n }\n });\n }, [auth, callback]);\n}\n\n/**\n * Gets the redirect error message, if any, from the FirebaseUI instance.\n *\n * @returns The error message as a string, or undefined if there is no redirect error.\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\n/**\n * Gets a memoized Zod schema for sign-in form validation.\n *\n * @returns A Zod schema for sign-in form validation.\n */\nexport function useSignInAuthFormSchema() {\n const ui = useUI();\n return useMemo(() => createSignInAuthFormSchema(ui), [ui]);\n}\n\n/**\n * Gets a memoized Zod schema for sign-up form validation.\n *\n * @returns A Zod schema for sign-up form validation.\n */\nexport function useSignUpAuthFormSchema() {\n const ui = useUI();\n return useMemo(() => createSignUpAuthFormSchema(ui), [ui]);\n}\n\n/**\n * Gets a memoized Zod schema for forgot password form validation.\n *\n * @returns A Zod schema for forgot password form validation.\n */\nexport function useForgotPasswordAuthFormSchema() {\n const ui = useUI();\n return useMemo(() => createForgotPasswordAuthFormSchema(ui), [ui]);\n}\n\n/**\n * Gets a memoized Zod schema for email link authentication form validation.\n *\n * @returns A Zod schema for email link authentication form validation.\n */\nexport function useEmailLinkAuthFormSchema() {\n const ui = useUI();\n return useMemo(() => createEmailLinkAuthFormSchema(ui), [ui]);\n}\n\n/**\n * Gets a memoized Zod schema for phone number form validation.\n *\n * @returns A Zod schema for phone number form validation.\n */\nexport function usePhoneAuthNumberFormSchema() {\n const ui = useUI();\n return useMemo(() => createPhoneAuthNumberFormSchema(ui), [ui]);\n}\n\n/**\n * Gets a memoized Zod schema for phone verification code form validation.\n *\n * @returns A Zod schema for phone verification form validation.\n */\nexport function usePhoneAuthVerifyFormSchema() {\n const ui = useUI();\n return useMemo(() => createPhoneAuthVerifyFormSchema(ui), [ui]);\n}\n\n/**\n * Gets a memoized Zod schema for multi-factor phone authentication number form validation.\n *\n * @returns A Zod schema for multi-factor phone authentication number form validation.\n */\nexport function useMultiFactorPhoneAuthNumberFormSchema() {\n const ui = useUI();\n return useMemo(() => createMultiFactorPhoneAuthNumberFormSchema(ui), [ui]);\n}\n\n/**\n * Gets a memoized Zod schema for multi-factor phone authentication verification form validation.\n *\n * @returns A Zod schema for multi-factor phone authentication verification form validation.\n */\nexport function useMultiFactorPhoneAuthVerifyFormSchema() {\n const ui = useUI();\n return useMemo(() => createMultiFactorPhoneAuthVerifyFormSchema(ui), [ui]);\n}\n\n/**\n * Gets a memoized Zod schema for multi-factor TOTP authentication number form validation.\n *\n * @returns A Zod schema for multi-factor TOTP authentication number form validation.\n */\nexport function useMultiFactorTotpAuthNumberFormSchema() {\n const ui = useUI();\n return useMemo(() => createMultiFactorTotpAuthNumberFormSchema(ui), [ui]);\n}\n\n/**\n * Gets a memoized Zod schema for multi-factor TOTP authentication verification form validation.\n *\n * @returns A Zod schema for multi-factor TOTP authentication verification form validation.\n */\nexport function useMultiFactorTotpAuthVerifyFormSchema() {\n const ui = useUI();\n return useMemo(() => createMultiFactorTotpAuthVerifyFormSchema(ui), [ui]);\n}\n\n/**\n * Creates and manages a reCAPTCHA verifier instance for phone authentication.\n *\n * The verifier is automatically rendered to the provided element and cleaned up when the element changes.\n *\n * @param ref - A React ref to the HTML element where the reCAPTCHA should be rendered.\n * @returns The reCAPTCHA verifier instance, or null if the element is not available.\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 { twMerge } from \"tailwind-merge\";\nimport { clsx } from \"clsx\";\n\n/**\n * Utility function for merging and deduplicating CSS class names.\n *\n * Combines clsx for conditional class names with tailwind-merge to handle Tailwind CSS class conflicts.\n *\n * @param inputs - Variable number of class name arguments (strings, objects, arrays, etc.).\n * @returns A merged and deduplicated string of class names.\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\n/** Props for the Button component. */\nexport type ButtonProps = ComponentProps<\"button\"> & {\n /** The visual variant of the button. */\n variant?: ButtonVariant;\n /** If true, the button will render as a child component using Radix UI's Slot. */\n asChild?: boolean;\n};\n\n/**\n * A customizable button component with multiple variants.\n *\n * @returns The button component.\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","/**\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, 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-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 description,\n ...props\n}: PropsWithChildren<\n ComponentProps<\"input\"> & { label: string; before?: ReactNode; action?: ReactNode; description?: ReactNode }\n>) {\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 {description ? <div data-input-description>{description}</div> : null}\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-error\">{errorMap.onSubmit}</div>;\n }\n\n return null;\n }}\n </form.Subscribe>\n );\n}\n\n/**\n * A form hook factory for creating forms with validation and error handling.\n *\n * Provides field components (Input) and form components (SubmitButton, ErrorMessage, Action)\n * for building accessible forms with TanStack Form.\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\n/** Props for the EmailLinkAuthForm component. */\nexport type EmailLinkAuthFormProps = {\n /** Callback function called when the sign-in link email is sent. */\n onEmailSent?: () => void;\n /** Callback function called when sign-in is completed via the email link. */\n onSignIn?: (credential: UserCredential) => void;\n};\n\n/**\n * Creates a memoized action function for sending a sign-in link to an email address.\n *\n * @returns A callback function that sends a sign-in link to the specified email address.\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\n/**\n * Creates a form hook for email link authentication.\n *\n * @param onSuccess - Optional callback function called when the sign-in link email is sent.\n * @returns A form instance configured for email link authentication.\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 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\n/**\n * Hook that automatically completes the email link sign-in process when the component mounts.\n *\n * Checks if the current URL contains a valid email link sign-in link and completes the authentication.\n *\n * @param onSignIn - Optional callback function called when sign-in is completed.\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 if (credential) {\n onSignIn?.(credential);\n }\n };\n\n void completeSignIn();\n // eslint-disable-next-line react-hooks/exhaustive-deps -- TODO(ehesp): ui triggers re-render\n }, [onSignIn]);\n}\n\n/**\n * A form component for email link authentication.\n *\n * Sends a sign-in link to the user's email address and automatically completes sign-in\n * if the user arrives via an email link.\n *\n * @returns The email link auth form component.\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\n/** Props for the ForgotPasswordAuthForm component. */\nexport type ForgotPasswordAuthFormProps = {\n /** Callback function called when the password reset email is sent. */\n onPasswordSent?: () => void;\n /** Callback function called when the back to sign in link is clicked. */\n onBackToSignInClick?: () => void;\n};\n\n/**\n * Creates a memoized action function for sending a password reset email.\n *\n * @returns A callback function that sends a password reset email to the specified address.\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\n/**\n * Creates a form hook for forgot password authentication.\n *\n * @param onSuccess - Optional callback function called when the password reset email is sent.\n * @returns A form instance configured for forgot password.\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 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\n/**\n * A form component for requesting a password reset email.\n *\n * Displays a success message after the email is sent.\n *\n * @returns The forgot password form component.\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\nimport { useCallback } from \"react\";\nimport { TotpMultiFactorGenerator, type MultiFactorInfo, type UserCredential } from \"firebase/auth\";\nimport { signInWithMultiFactorAssertion, FirebaseUIError, getTranslation } from \"@firebase-oss/ui-core\";\nimport { form } from \"~/components/form\";\nimport { useMultiFactorTotpAuthVerifyFormSchema, useUI } from \"~/hooks\";\n\n/**\n * Creates a memoized action function for verifying a TOTP code during multi-factor assertion.\n *\n * @returns A callback function that verifies the TOTP code and signs in with the multi-factor assertion.\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\n/** Options for the TOTP multi-factor assertion form hook. */\nexport type UseTotpMultiFactorAssertionForm = {\n /** The multi-factor info hint containing TOTP information. */\n hint: MultiFactorInfo;\n /** Callback function called when verification is successful. */\n onSuccess: (credential: UserCredential) => void;\n};\n\n/**\n * Creates a form hook for TOTP multi-factor assertion verification code input.\n *\n * @param options - The TOTP assertion form options.\n * @returns A form instance configured for TOTP verification code input.\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 onBlur: schema,\n onSubmitAsync: async ({ value }) => {\n try {\n const credential = await action({ verificationCode: value.verificationCode, hint });\n return onSuccess(credential);\n } catch (error) {\n return error instanceof FirebaseUIError ? error.message : String(error);\n }\n },\n },\n });\n}\n\n/** Props for the TotpMultiFactorAssertionForm component. */\nexport type TotpMultiFactorAssertionFormProps = {\n /** The multi-factor info hint containing TOTP information. */\n hint: MultiFactorInfo;\n /** Optional callback function called when multi-factor assertion is successful. */\n onSuccess?: (credential: UserCredential) => void;\n};\n\n/**\n * A form component for TOTP multi-factor authentication assertion.\n *\n * Allows users to enter a 6-digit TOTP code from their authenticator app.\n *\n * @returns The TOTP multi-factor assertion form component.\n */\nexport function TotpMultiFactorAssertionForm(props: TotpMultiFactorAssertionFormProps) {\n const ui = useUI();\n const form = useTotpMultiFactorAssertionForm({\n hint: props.hint,\n onSuccess: (credential) => {\n props.onSuccess?.(credential);\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 description={getTranslation(ui, \"prompts\", \"enterVerificationCode\")}\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","/**\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 { useCallback, useRef, useState } from \"react\";\nimport {\n PhoneAuthProvider,\n PhoneMultiFactorGenerator,\n type UserCredential,\n type MultiFactorInfo,\n type RecaptchaVerifier,\n} from \"firebase/auth\";\n\nimport {\n signInWithMultiFactorAssertion,\n FirebaseUIError,\n getTranslation,\n verifyPhoneNumber,\n} from \"@firebase-oss/ui-core\";\nimport { form } from \"~/components/form\";\nimport { useMultiFactorPhoneAuthVerifyFormSchema, useRecaptchaVerifier, useUI } from \"~/hooks\";\n\ntype PhoneMultiFactorInfo = MultiFactorInfo & {\n phoneNumber?: string;\n};\n\n/**\n * Creates a memoized action function for verifying a phone number during SMS multi-factor assertion.\n *\n * @returns A callback function that verifies a phone number using the provided hint and reCAPTCHA verifier.\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\n/** Options for the SMS multi-factor assertion phone form hook. */\ntype UseSmsMultiFactorAssertionPhoneForm = {\n /** The multi-factor info hint containing phone number information. */\n hint: MultiFactorInfo;\n /** The reCAPTCHA verifier instance. */\n recaptchaVerifier: RecaptchaVerifier;\n /** Callback function called when phone verification is successful. */\n onSuccess: (verificationId: string) => void;\n};\n\n/**\n * Creates a form hook for SMS multi-factor assertion phone number verification.\n *\n * @param options - The phone form options.\n * @returns A form instance configured for phone number verification.\n */\nexport function useSmsMultiFactorAssertionPhoneForm({\n hint,\n recaptchaVerifier,\n onSuccess,\n}: UseSmsMultiFactorAssertionPhoneForm) {\n const action = useSmsMultiFactorAssertionPhoneFormAction();\n\n return form.useAppForm({\n validators: {\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 <label>\n <div data-input-description>\n {getTranslation(ui, \"messages\", \"mfaSmsAssertionPrompt\", {\n phoneNumber: (props.hint as PhoneMultiFactorInfo).phoneNumber || \"\",\n })}\n </div>\n </label>\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\n/**\n * Creates a memoized action function for verifying the SMS verification code during multi-factor assertion.\n *\n * @returns A callback function that verifies the code and signs in with the multi-factor assertion.\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\n/** Options for the SMS multi-factor assertion verify form hook. */\ntype UseSmsMultiFactorAssertionVerifyForm = {\n /** The verification ID from the phone verification step. */\n verificationId: string;\n /** Callback function called when verification is successful. */\n onSuccess: (credential: UserCredential) => void;\n};\n\n/**\n * Creates a form hook for SMS multi-factor assertion verification code input.\n *\n * @param options - The verify form options.\n * @returns A form instance configured for verification code input.\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 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 SmsMultiFactorAssertionVerifyFormProps = {\n verificationId: string;\n onSuccess: (credential: UserCredential) => 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) => (\n <field.Input\n label={getTranslation(ui, \"labels\", \"verificationCode\")}\n type=\"text\"\n description={getTranslation(ui, \"prompts\", \"smsVerificationPrompt\")}\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\n/** Props for the SmsMultiFactorAssertionForm component. */\nexport type SmsMultiFactorAssertionFormProps = {\n /** The multi-factor info hint containing phone number information. */\n hint: MultiFactorInfo;\n /** Optional callback function called when multi-factor assertion is successful. */\n onSuccess?: (credential: UserCredential) => void;\n};\n\n/**\n * A form component for SMS multi-factor authentication assertion.\n *\n * Handles the two-step process: first verifying the phone number, then verifying the SMS code.\n *\n * @returns The SMS multi-factor assertion form component.\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={(credential) => {\n props.onSuccess?.(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\nimport {\n PhoneMultiFactorGenerator,\n TotpMultiFactorGenerator,\n type UserCredential,\n type MultiFactorInfo,\n} from \"firebase/auth\";\nimport { type ComponentProps, useEffect, 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\n/** Props for the MultiFactorAuthAssertionForm component. */\nexport type MultiFactorAuthAssertionFormProps = {\n /** Optional callback function called when multi-factor assertion is successful. */\n onSuccess?: (credential: UserCredential) => void;\n};\n\n/**\n * Hook that cleans up the multi-factor resolver when the component unmounts.\n *\n * Ensures the resolver is cleared from the UI state to prevent stale state.\n */\nexport function useMultiFactorAssertionCleanup() {\n const ui = useUI();\n\n useEffect(() => {\n return () => {\n ui.setMultiFactorResolver();\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps -- UI isn't stable enough to be a dependency here. Could we use useEffectEvent here instead once we depend on 19.2?\n }, []);\n}\n\n/**\n * A form component for multi-factor authentication assertion.\n *\n * Displays the appropriate MFA form (SMS or TOTP) based on the available hints.\n * If only one hint is available, it is automatically selected.\n *\n * @returns The multi-factor auth assertion form component.\n * @throws {Error} Throws an error if no multi-factor resolver is available.\n */\nexport function MultiFactorAuthAssertionForm(props: MultiFactorAuthAssertionFormProps) {\n const ui = useUI();\n const resolver = ui.multiFactorResolver;\n const mfaAssertionFactorPrompt = getTranslation(ui, \"prompts\", \"mfaAssertionFactorPrompt\");\n\n useMultiFactorAssertionCleanup();\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 (\n <SmsMultiFactorAssertionForm\n hint={hint}\n onSuccess={(credential) => {\n props.onSuccess?.(credential);\n }}\n />\n );\n }\n\n if (hint.factorId === TotpMultiFactorGenerator.FACTOR_ID) {\n return (\n <TotpMultiFactorAssertionForm\n hint={hint}\n onSuccess={(credential) => {\n props.onSuccess?.(credential);\n }}\n />\n );\n }\n }\n\n return (\n <div className=\"fui-content\">\n <p>{mfaAssertionFactorPrompt}</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\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\n/** Ref methods for the CountrySelector component. */\nexport interface CountrySelectorRef {\n /** Gets the currently selected country. */\n getCountry: () => CountryData;\n /** Sets the selected country by country code. */\n setCountry: (code: CountryCode) => void;\n}\n\n/** Props for the CountrySelector component. */\nexport type CountrySelectorProps = ComponentProps<\"div\">;\n\n/**\n * Gets the list of allowed countries from the country codes behavior.\n *\n * @returns The list of allowed countries.\n */\nexport function useCountries() {\n const ui = useUI();\n return getBehavior(ui, \"countryCodes\")().allowedCountries;\n}\n\n/**\n * Gets the default country from the country codes behavior.\n *\n * @returns The default country data.\n */\nexport function useDefaultCountry() {\n const ui = useUI();\n return getBehavior(ui, \"countryCodes\")().defaultCountry;\n}\n\n/**\n * A country selector component for phone number input.\n *\n * Displays a dropdown with country flags, dial codes, and names for selecting a country.\n *\n * @param ref - A ref to access the country selector methods.\n * @returns The country selector component.\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\nimport { 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\n/**\n * Creates a memoized action function for verifying a phone number during SMS multi-factor enrollment.\n *\n * @returns A callback function that verifies a phone number for MFA enrollment using the provided reCAPTCHA verifier.\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\n/** Options for the SMS multi-factor enrollment phone number form hook. */\nexport type UseSmsMultiFactorEnrollmentPhoneNumberForm = {\n /** The reCAPTCHA verifier instance. */\n recaptchaVerifier: RecaptchaVerifier;\n /** Callback function called when phone verification is successful. */\n onSuccess: (verificationId: string, displayName?: string) => void;\n /** Optional function to format the phone number before verification. */\n formatPhoneNumber?: (phoneNumber: string) => string;\n};\n\n/**\n * Creates a form hook for SMS multi-factor enrollment phone number verification.\n *\n * @param options - The phone number form options.\n * @returns A form instance configured for phone number input and verification for MFA enrollment.\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 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\n/**\n * Creates a memoized action function for verifying the SMS verification code during multi-factor enrollment.\n *\n * @returns A callback function that verifies the code and enrolls the phone number as a multi-factor authentication method.\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\n/** Options for the multi-factor enrollment verify phone number form hook. */\ntype UseMultiFactorEnrollmentVerifyPhoneNumberForm = {\n /** The verification ID from the phone verification step. */\n verificationId: string;\n /** Optional display name for the enrolled MFA method. */\n displayName?: string;\n /** Callback function called when enrollment is successful. */\n onSuccess: () => void;\n};\n\n/**\n * Creates a form hook for SMS multi-factor enrollment verification code input.\n *\n * @param options - The verify phone number form options.\n * @returns A form instance configured for verification code input during MFA enrollment.\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 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\n/** Props for the MultiFactorEnrollmentVerifyPhoneNumberForm component. */\ntype MultiFactorEnrollmentVerifyPhoneNumberFormProps = {\n /** The verification ID from the phone verification step. */\n verificationId: string;\n /** Optional display name for the enrolled MFA method. */\n displayName?: string;\n /** Callback function called when enrollment is successful. */\n onSuccess: () => void;\n};\n\n/**\n * A form component for verifying the SMS code during multi-factor enrollment.\n *\n * @returns The verify phone number form component.\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) => (\n <field.Input\n description={getTranslation(ui, \"prompts\", \"smsVerificationPrompt\")}\n label={getTranslation(ui, \"labels\", \"verificationCode\")}\n type=\"text\"\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\n/** Props for the SmsMultiFactorEnrollmentForm component. */\nexport type SmsMultiFactorEnrollmentFormProps = {\n /** Optional callback function called when enrollment is successful. */\n onSuccess?: () => void;\n};\n\n/**\n * A form component for SMS multi-factor authentication enrollment.\n *\n * Handles the two-step process: first entering the phone number and display name, then verifying the SMS code.\n *\n * @returns The SMS multi-factor enrollment form component.\n * @throws {Error} Throws an error if the user is not authenticated.\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","/**\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 { 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\n/**\n * Creates a memoized action function for generating a TOTP secret for multi-factor enrollment.\n *\n * @returns A callback function that generates a TOTP secret.\n */\nexport function useTotpMultiFactorSecretGenerationFormAction() {\n const ui = useUI();\n\n return useCallback(async () => {\n return await generateTotpSecret(ui);\n }, [ui]);\n}\n\n/** Options for the TOTP multi-factor enrollment form hook. */\nexport type UseTotpMultiFactorEnrollmentForm = {\n /** Callback function called when the TOTP secret is generated. */\n onSuccess: (secret: TotpSecret, displayName: string) => void;\n};\n\n/**\n * Creates a form hook for TOTP multi-factor enrollment secret generation.\n *\n * @param options - The TOTP enrollment form options.\n * @returns A form instance configured for display name input and secret generation.\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 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\n/**\n * Creates a memoized action function for verifying the TOTP code during multi-factor enrollment.\n *\n * @returns A callback function that verifies the TOTP code and enrolls it as a multi-factor authentication method.\n */\nexport function useMultiFactorEnrollmentVerifyTotpFormAction() {\n const ui = useUI();\n return useCallback(\n async ({\n secret,\n verificationCode,\n displayName,\n }: {\n secret: TotpSecret;\n verificationCode: string;\n displayName: string;\n }) => {\n const assertion = TotpMultiFactorGenerator.assertionForEnrollment(secret, verificationCode);\n return await enrollWithMultiFactorAssertion(ui, assertion, displayName);\n },\n [ui]\n );\n}\n\n/** Options for the multi-factor enrollment verify TOTP form hook. */\ntype UseMultiFactorEnrollmentVerifyTotpForm = {\n /** The TOTP secret generated in the previous step. */\n secret: TotpSecret;\n /** The display name for the enrolled MFA method. */\n displayName: string;\n /** Callback function called when enrollment is successful. */\n onSuccess: () => void;\n};\n\n/**\n * Creates a form hook for TOTP multi-factor enrollment verification code input.\n *\n * @param options - The verify TOTP form options.\n * @returns A form instance configured for TOTP verification code input during MFA enrollment.\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 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\n/** Props for the MultiFactorEnrollmentVerifyTotpForm component. */\ntype MultiFactorEnrollmentVerifyTotpFormProps = {\n /** The TOTP secret generated in the previous step. */\n secret: TotpSecret;\n /** The display name for the enrolled MFA method. */\n displayName: string;\n /** Callback function called when enrollment is successful. */\n onSuccess: () => void;\n};\n\n/**\n * A form component for verifying the TOTP code during multi-factor enrollment.\n *\n * Displays a QR code and secret key for the user to scan with their authenticator app,\n * then allows them to verify the enrollment with a TOTP code.\n *\n * @returns The verify TOTP form component.\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 <code>{props.secret.secretKey.toString()}</code>\n <p>{getTranslation(ui, \"prompts\", \"mfaTotpQrCodePrompt\")}</p>\n </div>\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 description={getTranslation(ui, \"prompts\", \"mfaTotpEnrollmentVerificationPrompt\")}\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\n/** Props for the TotpMultiFactorEnrollmentForm component. */\nexport type TotpMultiFactorEnrollmentFormProps = {\n /** Optional callback function called when enrollment is successful. */\n onSuccess?: () => void;\n};\n\n/**\n * A form component for TOTP multi-factor authentication enrollment.\n *\n * Handles the two-step process: first generating a TOTP secret and QR code, then verifying the TOTP code.\n *\n * @returns The TOTP multi-factor enrollment form component.\n * @throws {Error} Throws an error if the user is not authenticated.\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","/**\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 { 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\n/** Props for the MultiFactorAuthEnrollmentForm component. */\nexport type MultiFactorAuthEnrollmentFormProps = {\n /** Optional callback function called when enrollment is successful. */\n onEnrollment?: () => void;\n /** Optional array of factor IDs to allow enrollment for. Defaults to TOTP and PHONE. */\n hints?: Hint[];\n};\n\nconst DEFAULT_HINTS = [FactorId.TOTP, FactorId.PHONE] as const;\n\n/**\n * A form component for multi-factor authentication enrollment.\n *\n * Displays the appropriate MFA enrollment form (SMS or TOTP) based on the provided hints.\n * If only one hint is provided, it is automatically selected.\n *\n * @returns The multi-factor auth enrollment form component.\n * @throws {Error} Throws an error if no hints are provided or if an unknown hint type is encountered.\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 (\n <Button variant=\"secondary\" {...props}>\n {labelText}\n </Button>\n );\n}\n\nfunction SmsButton(props: ComponentProps<typeof Button>) {\n const ui = useUI();\n const labelText = getTranslation(ui, \"labels\", \"mfaSmsVerification\");\n return (\n <Button variant=\"secondary\" {...props}>\n {labelText}\n </Button>\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 {\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\n/**\n * Creates a memoized action function for verifying a phone number.\n *\n * @returns A callback function that verifies a phone number using the provided reCAPTCHA verifier.\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\n/** Options for the phone number form hook. */\ntype UsePhoneNumberForm = {\n /** The reCAPTCHA verifier instance. */\n recaptchaVerifier: RecaptchaVerifier;\n /** Callback function called when phone verification is successful. */\n onSuccess: (verificationId: string) => void;\n /** Optional function to format the phone number before verification. */\n formatPhoneNumber?: (phoneNumber: string) => string;\n};\n\n/**\n * Creates a form hook for phone number verification.\n *\n * @param options - The phone number form options.\n * @returns A form instance configured for phone number input and verification.\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 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\n/** Props for the PhoneNumberForm component. */\ntype PhoneNumberFormProps = {\n /** Callback function called when phone verification is successful. */\n onSubmit: (verificationId: string) => void;\n};\n\n/**\n * A form component for entering and verifying a phone number.\n *\n * Includes a country selector and reCAPTCHA verification.\n *\n * @returns The phone number form component.\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\n/**\n * Creates a memoized action function for verifying a phone verification code.\n *\n * @returns A callback function that confirms the phone number using the verification ID and code.\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\n/** Options for the verify phone number form hook. */\ntype UseVerifyPhoneNumberForm = {\n /** The verification ID from the phone verification step. */\n verificationId: string;\n /** Callback function called when verification is successful. */\n onSuccess: (credential: UserCredential) => void;\n};\n\n/**\n * Creates a form hook for phone verification code input.\n *\n * @param options - The verify phone number form options.\n * @returns A form instance configured for verification code input.\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 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) => (\n <field.Input\n label={getTranslation(ui, \"labels\", \"verificationCode\")}\n description={getTranslation(ui, \"prompts\", \"smsVerificationPrompt\")}\n type=\"text\"\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\n/** Props for the PhoneAuthForm component. */\nexport type PhoneAuthFormProps = {\n /** Optional callback function called when sign-in is successful. */\n onSignIn?: (credential: UserCredential) => void;\n};\n\n/**\n * A form component for phone authentication.\n *\n * Handles the two-step process: first entering the phone number, then verifying the SMS code.\n *\n * @returns The phone auth form component.\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\n/** Props for the SignInAuthForm component. */\nexport type SignInAuthFormProps = {\n /** Callback function called when sign-in is successful. */\n onSignIn?: (credential: UserCredential) => void;\n /** Callback function called when the forgot password link is clicked. */\n onForgotPasswordClick?: () => void;\n /** Callback function called when the sign up link is clicked. */\n onSignUpClick?: () => void;\n};\n\n/**\n * Creates a memoized action function for signing in with email and password.\n *\n * @returns A callback function that signs in a user with email and password.\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\n/**\n * Creates a form hook for sign-in authentication.\n *\n * @param onSuccess - Optional callback function called when sign-in is successful.\n * @returns A form instance configured for sign-in.\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 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\n/**\n * A form component for signing in with email and password.\n *\n * @returns The sign-in form component.\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\n/**\n * Checks if the requireDisplayName behavior is enabled.\n *\n * @returns True if display name is required, false otherwise.\n */\nexport function useRequireDisplayName() {\n const ui = useUI();\n return hasBehavior(ui, \"requireDisplayName\");\n}\n\n/** Props for the SignUpAuthForm component. */\nexport type SignUpAuthFormProps = {\n /** Callback function called when sign-up is successful. */\n onSignUp?: (credential: UserCredential) => void;\n /** Callback function called when the sign in link is clicked. */\n onSignInClick?: () => void;\n};\n\n/**\n * Creates a memoized action function for signing up with email and password.\n *\n * @returns A callback function that creates a new user account with email and password.\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\n/**\n * Creates a form hook for sign-up authentication.\n *\n * @param onSuccess - Optional callback function called when sign-up is successful.\n * @returns A form instance configured for sign-up.\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 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\n/**\n * A form component for signing up with email and password.\n *\n * Optionally includes a display name field if the requireDisplayName behavior is enabled.\n *\n * @returns The sign-up form component.\n */\nexport function SignUpAuthForm({ onSignInClick, 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 {onSignInClick ? (\n <form.Action onClick={onSignInClick}>\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\n/** Props for the Divider component. */\nexport type DividerProps = PropsWithChildren<ComponentProps<\"div\">>;\n\n/**\n * A divider component that can display a line or a line with text in the middle.\n *\n * @returns The divider component.\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\n/** Props for the Card component. */\nexport type CardProps = PropsWithChildren<ComponentProps<\"div\">>;\n\n/**\n * A card container component for grouping related content.\n *\n * @returns The card component.\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\n/**\n * The header section of a card.\n *\n * @returns The card header component.\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\n/**\n * The title of a card.\n *\n * @returns The card title component.\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\n/**\n * The subtitle of a card.\n *\n * @returns The card subtitle component.\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\n/**\n * The content section of a card.\n *\n * @returns The card content component.\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","/**\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 { useRedirectError } from \"~/hooks\";\n\n/**\n * Displays any error that occurred during a redirect-based authentication flow.\n *\n * Returns null if there is no redirect error.\n *\n * @returns The redirect error component, or null if there is no error.\n */\nexport function RedirectError() {\n const error = useRedirectError();\n\n if (!error) {\n return null;\n }\n\n return <div className=\"fui-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 { getTranslation } from \"@firebase-oss/ui-core\";\nimport { Card, CardContent, CardHeader, CardSubtitle, CardTitle } from \"~/components/card\";\nimport { useUI } from \"~/hooks\";\nimport {\n MultiFactorAuthAssertionForm,\n type MultiFactorAuthAssertionFormProps,\n} from \"../forms/multi-factor-auth-assertion-form\";\n\n/** Props for the MultiFactorAuthAssertionScreen component. */\nexport type MultiFactorAuthAssertionScreenProps = MultiFactorAuthAssertionFormProps;\n\n/**\n * A screen component for multi-factor authentication assertion.\n *\n * Displays a card with the multi-factor assertion form.\n *\n * @returns The multi-factor auth assertion screen component.\n */\nexport function MultiFactorAuthAssertionScreen(props: MultiFactorAuthAssertionScreenProps) {\n const ui = useUI();\n\n const titleText = getTranslation(ui, \"labels\", \"multiFactorAssertion\");\n const subtitleText = getTranslation(ui, \"prompts\", \"mfaAssertionPrompt\");\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 <MultiFactorAuthAssertionForm {...props} />\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 type { User } from \"firebase/auth\";\nimport { getTranslation } from \"@firebase-oss/ui-core\";\nimport { Divider } from \"~/components/divider\";\nimport { useOnUserAuthenticated, 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\";\nimport { MultiFactorAuthAssertionScreen } from \"./multi-factor-auth-assertion-screen\";\n\n/** Props for the EmailLinkAuthScreen component. */\nexport type EmailLinkAuthScreenProps = PropsWithChildren<\n Pick<EmailLinkAuthFormProps, \"onEmailSent\"> & {\n /** Callback function called when sign-in is successful. */\n onSignIn?: (user: User) => void;\n }\n>;\n\n/**\n * A screen component for email link authentication.\n *\n * Displays a card with the email link auth form and handles multi-factor authentication if required.\n *\n * @returns The email link auth screen component.\n */\nexport function EmailLinkAuthScreen({ children, onEmailSent, onSignIn }: EmailLinkAuthScreenProps) {\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 useOnUserAuthenticated(onSignIn);\n\n if (mfaResolver) {\n return <MultiFactorAuthAssertionScreen />;\n }\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\n/** Props for the ForgotPasswordAuthScreen component. */\nexport type ForgotPasswordAuthScreenProps = ForgotPasswordAuthFormProps;\n\n/**\n * A screen component for requesting a password reset.\n *\n * Displays a card with the forgot password form.\n *\n * @returns The forgot password screen component.\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","/**\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 { 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\n/** Props for the MultiFactorAuthEnrollmentScreen component. */\nexport type MultiFactorAuthEnrollmentScreenProps = MultiFactorAuthEnrollmentFormProps;\n\n/**\n * A screen component for multi-factor authentication enrollment.\n *\n * Displays a card with the multi-factor enrollment form.\n *\n * @returns The multi-factor auth enrollment screen component.\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","/**\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 User } from \"firebase/auth\";\nimport { type PropsWithChildren } from \"react\";\nimport { useOnUserAuthenticated, useUI } from \"~/hooks\";\nimport { Card, CardContent, CardHeader, CardSubtitle, CardTitle } from \"~/components/card\";\nimport { Policies } from \"~/components/policies\";\nimport { MultiFactorAuthAssertionScreen } from \"./multi-factor-auth-assertion-screen\";\nimport { RedirectError } from \"~/components/redirect-error\";\n\n/** Props for the OAuthScreen component. */\nexport type OAuthScreenProps = PropsWithChildren<{\n /** Callback function called when sign-in is successful. */\n onSignIn?: (user: User) => void;\n}>;\n\n/**\n * A screen component for OAuth provider authentication.\n *\n * Displays a card that should contain OAuth sign-in buttons as children.\n * Handles multi-factor authentication if required.\n *\n * @returns The OAuth screen component.\n */\nexport function OAuthScreen({ children, onSignIn }: 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 useOnUserAuthenticated(onSignIn);\n\n if (mfaResolver) {\n return <MultiFactorAuthAssertionScreen />;\n }\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 {children}\n <RedirectError />\n <Policies />\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 { useOnUserAuthenticated, useUI } from \"~/hooks\";\nimport { Card, CardContent, CardHeader, CardSubtitle, CardTitle } from \"~/components/card\";\nimport { PhoneAuthForm } from \"../forms/phone-auth-form\";\nimport { MultiFactorAuthAssertionScreen } from \"./multi-factor-auth-assertion-screen\";\nimport { RedirectError } from \"~/components/redirect-error\";\nimport type { User } from \"firebase/auth\";\n\n/** Props for the PhoneAuthScreen component. */\nexport type PhoneAuthScreenProps = PropsWithChildren<{\n /** Callback function called when sign-in is successful. */\n onSignIn?: (user: User) => void;\n}>;\n\n/**\n * A screen component for phone authentication.\n *\n * Displays a card with the phone auth form and handles multi-factor authentication if required.\n *\n * @returns The phone auth screen component.\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 useOnUserAuthenticated(props.onSignIn);\n\n if (mfaResolver) {\n return <MultiFactorAuthAssertionScreen />;\n }\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 <PhoneAuthForm />\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 type { PropsWithChildren } from \"react\";\nimport type { User } from \"firebase/auth\";\nimport { getTranslation } from \"@firebase-oss/ui-core\";\nimport { Divider } from \"~/components/divider\";\nimport { useOnUserAuthenticated, useUI } from \"~/hooks\";\nimport { Card, CardContent, CardHeader, CardSubtitle, CardTitle } from \"../../components/card\";\nimport { SignInAuthForm, type SignInAuthFormProps } from \"../forms/sign-in-auth-form\";\nimport { MultiFactorAuthAssertionScreen } from \"./multi-factor-auth-assertion-screen\";\nimport { RedirectError } from \"~/components/redirect-error\";\n\n/** Props for the SignInAuthScreen component. */\nexport type SignInAuthScreenProps = PropsWithChildren<Omit<SignInAuthFormProps, \"onSignIn\">> & {\n /** Callback function called when sign-in is successful. */\n onSignIn?: (user: User) => void;\n};\n\n/**\n * A screen component for signing in with email and password.\n *\n * Displays a card with the sign-in form and handles multi-factor authentication if required.\n *\n * @returns The sign-in screen component.\n */\nexport function SignInAuthScreen({ children, onSignIn, ...props }: SignInAuthScreenProps) {\n const ui = useUI();\n\n const titleText = getTranslation(ui, \"labels\", \"signIn\");\n const subtitleText = getTranslation(ui, \"prompts\", \"signInToAccount\");\n\n useOnUserAuthenticated(onSignIn);\n\n if (ui.multiFactorResolver) {\n return <MultiFactorAuthAssertionScreen />;\n }\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 <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 </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 type { User } from \"firebase/auth\";\nimport { Divider } from \"~/components/divider\";\nimport { useOnUserAuthenticated, 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 { MultiFactorAuthAssertionScreen } from \"./multi-factor-auth-assertion-screen\";\n\n/** Props for the SignUpAuthScreen component. */\nexport type SignUpAuthScreenProps = PropsWithChildren<Omit<SignUpAuthFormProps, \"onSignUp\">> & {\n /** Callback function called when sign-up is successful. */\n onSignUp?: (user: User) => void;\n};\n\n/**\n * A screen component for signing up with email and password.\n *\n * Displays a card with the sign-up form and handles multi-factor authentication if required.\n *\n * @returns The sign-up screen component.\n */\nexport function SignUpAuthScreen({ children, onSignUp, ...props }: SignUpAuthScreenProps) {\n const ui = useUI();\n\n const titleText = getTranslation(ui, \"labels\", \"signUp\");\n const subtitleText = getTranslation(ui, \"prompts\", \"enterDetailsToCreate\");\n\n useOnUserAuthenticated(onSignUp);\n\n if (ui.multiFactorResolver) {\n return <MultiFactorAuthAssertionScreen />;\n }\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 <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 </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, UserCredential } from \"firebase/auth\";\nimport type { PropsWithChildren } from \"react\";\nimport { useCallback, useState } from \"react\";\nimport { Button } from \"~/components/button\";\nimport { useUI } from \"~/hooks\";\n\n/** Props for the OAuthButton component. */\nexport type OAuthButtonProps = PropsWithChildren<{\n /** The authentication provider to sign in with. */\n provider: AuthProvider;\n /** Whether to use themed styling for the button. */\n themed?: boolean | string;\n /** Callback function called when sign-in is successful. */\n onSignIn?: (credential: UserCredential) => void;\n}>;\n\n/**\n * Hook for signing in with an OAuth provider.\n *\n * @param provider - The authentication provider to sign in with.\n * @param onSignIn - Optional callback function called when sign-in is successful.\n * @returns An object containing the error state and a callback function to trigger sign-in.\n */\nexport function useSignInWithProvider(provider: AuthProvider, onSignIn?: (credential: UserCredential) => void) {\n const ui = useUI();\n const [error, setError] = useState<string | null>(null);\n\n const callback = useCallback(async () => {\n setError(null);\n try {\n const credential = await signInWithProvider(ui, provider);\n onSignIn?.(credential);\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, onSignIn]);\n\n return { error, callback };\n}\n\n/**\n * A button component for signing in with an OAuth provider.\n *\n * @returns The OAuth button component.\n */\nexport function OAuthButton({ provider, children, themed, onSignIn }: OAuthButtonProps) {\n const ui = useUI();\n\n const { error, callback } = useSignInWithProvider(provider, onSignIn);\n\n return (\n <div>\n <Button\n type=\"button\"\n variant={themed ? \"primary\" : \"secondary\"}\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-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, type UserCredential } 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\n/** Props for the AppleSignInButton component. */\nexport type AppleSignInButtonProps = {\n /** Optional OAuth provider instance. Defaults to Apple provider. */\n provider?: OAuthProvider;\n /** Whether to apply themed styling. */\n themed?: boolean;\n /** Callback function called when sign-in is successful. */\n onSignIn?: (credential: UserCredential) => void;\n};\n\n/**\n * A button component for signing in with Apple.\n *\n * @returns The Apple sign-in button component.\n */\nexport function AppleSignInButton({ provider, ...props }: AppleSignInButtonProps) {\n const ui = useUI();\n\n return (\n <OAuthButton {...props} provider={provider || new OAuthProvider(\"apple.com\")}>\n <AppleLogo />\n <span>{getTranslation(ui, \"labels\", \"signInWithApple\")}</span>\n </OAuthButton>\n );\n}\n\n/**\n * The Apple logo SVG component.\n *\n * @returns The Apple logo component.\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, type UserCredential } 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\n/** Props for the FacebookSignInButton component. */\nexport type FacebookSignInButtonProps = {\n /** Optional OAuth provider instance. Defaults to Facebook provider. */\n provider?: FacebookAuthProvider;\n /** Whether to apply themed styling. */\n themed?: boolean;\n /** Callback function called when sign-in is successful. */\n onSignIn?: (credential: UserCredential) => void;\n};\n\n/**\n * A button component for signing in with Facebook.\n *\n * @returns The Facebook sign-in button component.\n */\nexport function FacebookSignInButton({ provider, ...props }: FacebookSignInButtonProps) {\n const ui = useUI();\n\n return (\n <OAuthButton {...props} provider={provider || new FacebookAuthProvider()}>\n <FacebookLogo />\n <span>{getTranslation(ui, \"labels\", \"signInWithFacebook\")}</span>\n </OAuthButton>\n );\n}\n\n/**\n * The Facebook logo SVG component.\n *\n * @returns The Facebook logo component.\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, type UserCredential } 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\n/** Props for the GitHubSignInButton component. */\nexport type GitHubSignInButtonProps = {\n /** Optional OAuth provider instance. Defaults to GitHub provider. */\n provider?: GithubAuthProvider;\n /** Whether to apply themed styling. */\n themed?: boolean;\n /** Callback function called when sign-in is successful. */\n onSignIn?: (credential: UserCredential) => void;\n};\n\n/**\n * A button component for signing in with GitHub.\n *\n * @returns The GitHub sign-in button component.\n */\nexport function GitHubSignInButton({ provider, ...props }: GitHubSignInButtonProps) {\n const ui = useUI();\n\n return (\n <OAuthButton {...props} provider={provider || new GithubAuthProvider()}>\n <GitHubLogo />\n <span>{getTranslation(ui, \"labels\", \"signInWithGitHub\")}</span>\n </OAuthButton>\n );\n}\n\n/**\n * The GitHub logo SVG component.\n *\n * @returns The GitHub logo component.\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, type UserCredential } 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\n/** Props for the GoogleSignInButton component. */\nexport type GoogleSignInButtonProps = {\n /** Optional OAuth provider instance. Defaults to Google provider. */\n provider?: GoogleAuthProvider;\n /** Whether to apply themed styling. Can be true, false, or \"neutral\". */\n themed?: boolean | \"neutral\";\n /** Callback function called when sign-in is successful. */\n onSignIn?: (credential: UserCredential) => void;\n};\n\n/**\n * A button component for signing in with Google.\n *\n * @returns The Google sign-in button component.\n */\nexport function GoogleSignInButton({ provider, ...props }: GoogleSignInButtonProps) {\n const ui = useUI();\n\n return (\n <OAuthButton {...props} provider={provider || new GoogleAuthProvider()}>\n <GoogleLogo />\n <span>{getTranslation(ui, \"labels\", \"signInWithGoogle\")}</span>\n </OAuthButton>\n );\n}\n\n/**\n * The Google logo SVG component.\n *\n * @returns The Google logo component.\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, type UserCredential } 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\n/** Props for the MicrosoftSignInButton component. */\nexport type MicrosoftSignInButtonProps = {\n /** Optional OAuth provider instance. Defaults to Microsoft provider. */\n provider?: OAuthProvider;\n /** Whether to apply themed styling. */\n themed?: boolean;\n /** Callback function called when sign-in is successful. */\n onSignIn?: (credential: UserCredential) => void;\n};\n\n/**\n * A button component for signing in with Microsoft.\n *\n * @returns The Microsoft sign-in button component.\n */\nexport function MicrosoftSignInButton({ provider, ...props }: MicrosoftSignInButtonProps) {\n const ui = useUI();\n\n return (\n <OAuthButton {...props} provider={provider || new OAuthProvider(\"microsoft.com\")}>\n <MicrosoftLogo />\n <span>{getTranslation(ui, \"labels\", \"signInWithMicrosoft\")}</span>\n </OAuthButton>\n );\n}\n\n/**\n * The Microsoft logo SVG component.\n *\n * @returns The Microsoft logo component.\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, type UserCredential } 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\n/** Props for the TwitterSignInButton component. */\nexport type TwitterSignInButtonProps = {\n /** Optional OAuth provider instance. Defaults to Twitter provider. */\n provider?: TwitterAuthProvider;\n /** Whether to apply themed styling. */\n themed?: boolean;\n /** Callback function called when sign-in is successful. */\n onSignIn?: (credential: UserCredential) => void;\n};\n\n/**\n * A button component for signing in with Twitter.\n *\n * @returns The Twitter sign-in button component.\n */\nexport function TwitterSignInButton({ provider, ...props }: TwitterSignInButtonProps) {\n const ui = useUI();\n\n return (\n <OAuthButton {...props} provider={provider || new TwitterAuthProvider()}>\n <TwitterLogo />\n <span>{getTranslation(ui, \"labels\", \"signInWithTwitter\")}</span>\n </OAuthButton>\n );\n}\n\n/**\n * The Twitter logo SVG component.\n *\n * @returns The Twitter logo component.\n */\nexport function TwitterLogo({ className, ...props }: React.SVGProps<SVGSVGElement>) {\n return <TwitterSvgLogo className={cn(\"fui-provider__icon\", className)} {...props} />;\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 * from \"./auth\";\nexport * from \"./components\";\nexport { PolicyContext } from \"./components/policies\";\nexport { FirebaseUIProvider, type FirebaseUIProviderProps } from \"./context\";\nexport * from \"./hooks\";\n\nif (import.meta.env?.PROD) {\n registerFramework(\"react\", pkgJson.version);\n}\n"]}
|