import type { InternalProvider, SignInPageErrorParam, Theme, } from "../../types.js" import { webauthnScript } from "../utils/webauthn-client.js" const signinErrors: Record = { default: "Unable to sign in.", Signin: "Try signing in with a different account.", OAuthSignin: "Try signing in with a different account.", OAuthCallbackError: "Try signing in with a different account.", OAuthCreateAccount: "Try signing in with a different account.", EmailCreateAccount: "Try signing in with a different account.", Callback: "Try signing in with a different account.", OAuthAccountNotLinked: "To confirm your identity, sign in with the same account you used originally.", EmailSignin: "The e-mail could not be sent.", CredentialsSignin: "Sign in failed. Check the details you provided are correct.", SessionRequired: "Please sign in to access this page.", } function ConditionalUIScript(providerID: string) { const startConditionalUIScript = ` const currentURL = window.location.href; const authURL = currentURL.substring(0, currentURL.lastIndexOf('/')); (${webauthnScript})(authURL, "${providerID}"); ` return ( <>