{"version":3,"file":"ui.mjs","sources":["../../../../../../../core/src/public/ui.ts"],"sourcesContent":["import type { Values } from '../utils';\nimport {\n  B2BDiscoveryIntermediateSessionsExchangeResponse,\n  B2BDiscoveryOrganizationsCreateResponse,\n  B2BDiscoveryOTPEmailAuthenticateResponse,\n  B2BDiscoveryOTPEmailSendResponse,\n  B2BImpersonationAuthenticateResponse,\n  B2BMagicLinkLoginOrSignupResponse,\n  B2BMagicLinksAuthenticateResponse,\n  B2BMagicLinksDiscoveryAuthenticateResponse,\n  B2BMagicLinksEmailDiscoverySendResponse,\n  B2BOAuthAuthenticateResponse,\n  B2BOAuthDiscoveryAuthenticateResponse,\n  B2BOrganizationsGetBySlugResponse,\n  B2BOTPsEmailAuthenticateResponse,\n  B2BOTPsEmailLoginOrSignupResponse,\n  B2BPasswordAuthenticateResponse,\n  B2BPasswordDiscoveryAuthenticateResponse,\n  B2BPasswordDiscoveryResetByEmailResponse,\n  B2BPasswordDiscoveryResetByEmailStartResponse,\n  B2BPasswordResetByEmailResponse,\n  B2BPasswordResetByEmailStartResponse,\n  B2BPasswordResetBySessionResponse,\n  B2BSMSAuthenticateResponse,\n  B2BSMSSendResponse,\n  B2BSSODiscoverConnectionsResponse,\n  B2BTOTPAuthenticateResponse,\n  B2BTOTPCreateResponse,\n  RecoveryCodeRecoverResponse,\n  SSOAuthenticateResponse,\n} from './b2b';\nimport { CryptoWalletAuthenticateResponse, CryptoWalletAuthenticateStartResponse } from './cryptoWallets';\nimport { MagicLinksLoginOrCreateResponse } from './magicLinks';\nimport { OTPsAuthenticateResponse, OTPsLoginOrCreateResponse } from './otps';\nimport {\n  PasswordAuthenticateResponse,\n  PasswordCreateResponse,\n  PasswordResetByEmailResponse,\n  PasswordResetByEmailStartResponse,\n} from './passwords';\nimport { StytchSDKUIError } from './SDKErrors';\nimport { StytchProjectConfigurationInput } from './typeConfig';\nimport { WebAuthnAuthenticateResponse, WebAuthnRegisterResponse } from './webauthn';\n\ntype DeepPartial<K> = {\n  [attr in keyof K]?: K[attr] extends object ? DeepPartial<K[attr]> : K[attr];\n};\n\n/**\n * The options for email magic links. This is used if you've enabled the `emailMagicLinks` product\n * in your configuration.\n */\n\nexport type EmailMagicLinksOptions = {\n  loginRedirectURL?: string;\n  loginExpirationMinutes?: number;\n  signupRedirectURL?: string;\n  signupExpirationMinutes?: number;\n  loginTemplateId?: string;\n  signupTemplateId?: string;\n  createUserAsPending?: boolean;\n  /**\n   * @param domainHint - An optional hint indicating what domain the email will be sent from.\n   * This field is only required if your project uses more than one custom domain to send emails.\n   */\n  domainHint?: string;\n  locale?: string;\n};\n\n/**\n * The OAuth providers we support in our OAuth product.\n * Currently we support `Amazon`, `Apple`, `Bitbucket`, `Discord`, `Facebook`, `Figma`, `Google`, `GitLab`,\n * `LinkedIn`, `Microsoft`, `Salesforce`, `Slack`, `Snapchat`, `TikTok`, `Twitch`, `Twitter`, and `Yahoo`.\n */\n\nexport const OAuthProviders = {\n  Google: 'google',\n  Microsoft: 'microsoft',\n  Apple: 'apple',\n  Github: 'github',\n  GitLab: 'gitlab',\n  Facebook: 'facebook',\n  Discord: 'discord',\n  Salesforce: 'salesforce',\n  Slack: 'slack',\n  Amazon: 'amazon',\n  Bitbucket: 'bitbucket',\n  LinkedIn: 'linkedin',\n  Coinbase: 'coinbase',\n  Twitch: 'twitch',\n  Twitter: 'twitter',\n  TikTok: 'tiktok',\n  Snapchat: 'snapchat',\n  Figma: 'figma',\n  Yahoo: 'yahoo',\n} as const;\n\nexport type OAuthProviders = Values<typeof OAuthProviders>;\n\n/**\n * The Crypto Wallets we support in our crypto product.\n * Currently we support all ethereum and solana wallets.\n * We additionally detect and show popular wallets as distinct options.\n * The list of poular wallets include `Binance`, `Coinbase`, `Metamask`, and `Phantom`\n */\n\nexport const Wallets = {\n  Phantom: 'Phantom',\n  Metamask: 'Metamask',\n  Coinbase: 'Coinbase',\n  Binance: 'Binance',\n  GenericEthereumWallet: 'GenericEthereumWallet',\n  GenericSolanaWallet: 'GenericSolanaWallet',\n} as const;\n\nexport type Wallets = Values<typeof Wallets>;\n\n/**\n * Supported behaviors for positioning Google One Tap. The actual behavior\n * depends on browser support and Google's One Tap implementation.\n */\n\nexport const OneTapPositions = {\n  /**\n   * Display Google One Tap using a native browser prompt if available, or\n   * embedded in the existing SDK login form otherwise.\n   * @deprecated This option has been renamed to `floatingOrEmbedded`\n   */\n  embedded: 'embedded',\n  /**\n   * Display the One Tap prompt using a native browser prompt if available, or\n   * in the top right corner otherwise. This is the default option.\n   */\n  floating: 'floating',\n  /**\n   * Display the One Tap prompt embedded in the existing SDK login form if a\n   * native browser prompt is not available, or not at all otherwise. This\n   * option is not recommended for new applications.\n   */\n  embeddedOnly: 'embeddedOnly',\n  /**\n   * Display the One Tap prompt using a native browser prompt if available, or\n   * embedded in the existing SDK login form otherwise.\n   */\n  floatingOrEmbedded: 'floatingOrEmbedded',\n  /**\n   * Attempt to display the One Tap prompt embedded in the existing SDK login\n   * form, even if a native browser prompt is supported. This option is not\n   * recommended. It disables native browser FedCM support even where it is\n   * available, and will stop being honored by Google in the future.\n   */\n  forceLegacyEmbedded: 'forceLegacyEmbedded',\n} as const;\n\nexport type OneTapPositions = Values<typeof OneTapPositions>;\n\nexport type ProviderOptions = {\n  type: OAuthProviders;\n  one_tap?: boolean;\n  position?: OneTapPositions;\n  /**\n   * Whether to cancel the One Tap prompt when the user taps outside of it.\n   * This is only applicable if one_tap is true.\n   */\n  cancel_on_tap_outside?: boolean;\n  custom_scopes?: string[];\n  provider_params?: Record<string, string>;\n};\n\n/**\n * An array of OAuth providers you wish to use. Each Provider is an object with a type key that\n * determines the type of provider. Each Provider accepts an optional custom_scopes array of\n * scopes that Stytch will request for your application in addition to the base set of scopes\n * required for login. The order of the providers in the array determines the order of the\n * rendered buttons.\n */\nexport type ProvidersOptions = ProviderOptions[];\n\n/**\n * The options for oAuth. This is required if you've enabled the `oauth` product\n * in your configuration.\n */\n\nexport type OAuthOptions = {\n  loginRedirectURL?: string;\n  signupRedirectURL?: string;\n  providers: ProvidersOptions;\n};\n\n/**\n * The methods array allows you to specify the authentication methods that you would like to expose\n * to your users. The order of the products that you include here will also be the order in which\n * they appear in the login form, with the first product specified appearing at the top of the login\n * form. We currently support passcodes on `email`, `sms` and `whatsapp`\n */\n\nexport const OTPMethods = {\n  SMS: 'sms',\n  WhatsApp: 'whatsapp',\n  Email: 'email',\n} as const;\n\nexport type OTPMethods = Values<typeof OTPMethods>;\n\n/**\n * The options for One Time Passcodes. This is required if you've enabled the `otp` product\n * in your configuration.\n */\n\nexport type OtpOptions = {\n  methods: OTPMethods[];\n  expirationMinutes: number;\n  loginTemplateId?: string;\n  signupTemplateId?: string;\n  locale?: string;\n};\n\n/**\n * The options for passwords. This is used if you've enabled the `passwords` product\n * in your configuration.\n */\n\nexport type PasswordOptions = {\n  loginRedirectURL?: string;\n  loginExpirationMinutes?: number;\n  resetPasswordRedirectURL?: string;\n  resetPasswordExpirationMinutes?: number;\n  resetPasswordTemplateId?: string;\n  locale?: string;\n};\n\n/**\n * The options for Session Management. If you are using the UI components,\n * we also create a session for users when they log in.\n */\n\nexport type SessionOptions = {\n  sessionDurationMinutes: number;\n};\n\nexport type PasskeyOptions = {\n  /**\n   * Sets the domain option for both webauthn registration and authentication.\n   * @default window.location.hostname\n   */\n  domain?: string;\n};\n\nexport type StringsOptions = {\n  /**\n   * Specify custom strings to be used in the prebuilt UI. Consult the message\n   * catalog (`messages/en.po` or `messages/b2b/en.po`) for the list of\n   * available strings. Each value should be specified using ICU MessageFormat.\n   *\n   * Strings that are not defined will use the default English value as a\n   * fallback.\n   */\n  strings?: Record<string, string>;\n};\n\n/**\n * The style configuration allows you to customize the look of the SDK. You can specify some of\n * them or none at all.\n */\nexport type StyleConfig = DeepPartial<{\n  /**\n   * The configuration object for the Stytch UI container.\n   */\n  container: {\n    /**\n     * The background color of the SDK container.\n     */\n    backgroundColor: string;\n    /**\n     * The border color of the SDK container.\n     */\n    borderColor: string;\n    /**\n     * The border radius of the SDK container.\n     */\n    borderRadius: string;\n    /**\n     * The width of the SDK container.\n     */\n    width: string;\n  };\n\n  /**\n   * The configuration object for colors used in the Stytch UI.\n   */\n  colors: {\n    /**\n     * Your primary brand color. This will be applied to most of the text in the SDK.\n     */\n    primary: string;\n    /**\n     * Your secondary brand color. This will be applied to text disclaimers and other visual elements.\n     */\n    secondary: string;\n    /**\n     * Your accent brand color. This will be applied to backgrounds of messages to draw user's attention.\n     * This should have strong contrast with the primary text color for accessibility.\n     */\n    accent: string;\n    /**\n     * A success color to be used in visual elements.\n     */\n    success: string;\n    /**\n     * A warning color to be used in visual elements.\n     */\n    warning: string;\n    /**\n     * An error color to be used in visual elements.\n     */\n    error: string;\n  };\n\n  /**\n   * The configuration object for buttons in the Stytch UI components.\n   */\n  buttons: {\n    /**\n     * The configuration object for primary buttons. These buttons are used in primary actions\n     * including magic links, one-time passcodes and passwords products.\n     */\n    primary: {\n      /**\n       * The background color of the primary button.\n       */\n      backgroundColor: string;\n      /**\n       * The text color of the primary button.\n       */\n      textColor: string;\n      /**\n       * The border color of the primary button.\n       */\n      borderColor: string;\n      /**\n       * The border radius of the primary button.\n       */\n      borderRadius: string;\n    };\n\n    /**\n     * The configuration object for secondary buttons.\n     */\n    secondary: {\n      /**\n       * The background color of the secondary button. These buttons are used in secondary actions\n       * including but not limited OAuth and crypto wallets.\n       */\n      backgroundColor: string;\n      /**\n       * The text color of the secondary button.\n       */\n      textColor: string;\n      /**\n       * The border color of the secondary button.\n       */\n      borderColor: string;\n      /**\n       * The border radius of the secondary button.\n       */\n      borderRadius: string;\n    };\n\n    /**\n     * The configuration object for disabled buttons.\n     */\n    disabled: {\n      /**\n       * The background color of the disabled button.\n       */\n      backgroundColor: string;\n      /**\n       * The text color of the disabled button.\n       */\n      textColor: string;\n      /**\n       * The border color of the disabled button.\n       */\n      borderColor: string;\n      /**\n       * The border radius of the disabled button.\n       */\n      borderRadius: string;\n    };\n  };\n\n  /**\n   * The configuration object for text inputs in the Stytch UI components.\n   */\n  inputs: {\n    /**\n     * The background color of the text inputs.\n     */\n    backgroundColor: string;\n    /**\n     * The text color of the text inputs.\n     */\n    textColor: string;\n    /**\n     * The color of the placeholder text in the text inputs.\n     */\n    placeholderColor: string;\n    /**\n     * The border color of the text inputs.\n     */\n    borderColor: string;\n    /**\n     * The border radius of the text inputs.\n     */\n    borderRadius: string;\n  };\n\n  /**\n   * The font family that will apply to all text in the SDK.\n   */\n  fontFamily: string;\n\n  /**\n   * When this value is false, the title and description text will not show in the SDK.\n   */\n  hideHeaderText: boolean;\n\n  /**\n   * The configuration object for your custom logo.\n   */\n  logo: {\n    /**\n     * The URL of your custom logo.\n     */\n    logoImageUrl: string;\n  };\n}>;\n\nexport type IDPConsentItem =\n  | string\n  | {\n      /**\n       * A one liner description of access being requested\n       * @example\n       *  'View content and info about you'\n       */\n      text: string;\n      /**\n       * A detailed list of access being requested for a line item\n       * Each item in the array will be displayed as a separate bullet point\n       * @example\n       *  [\n       *   'View content you have added to the platform, including videos and comments',\n       *   'View information shared on the platform, including your name, and email'\n       * ]\n       */\n      details?: string[];\n    };\n\nexport type IDPConsentSection = {\n  /**\n   * A top-level header for a section of the consent screen\n   * @example\n   *   '$Application is requesting to edit'\n   */\n  header: string;\n  /**\n   * A collection of {@link IDPConsentItem} rows to render with the supplied header\n   */\n  items: IDPConsentItem[];\n};\n\n/**\n * An IDP Consent Screen Manifest defines the text to be shown to the end user during\n * a consent flow. Manifests can be used to customize grouping of access controls.\n * For example, an application can choose to group access controls by action being performed,\n * by resource being accessed, or by something else entirely.\n * @example\n * // A simple list will be rendered as a list of bullet points\n * [\n *   { text: 'Content and info about you' },\n *   { text: 'Content and info about your workspace' },\n *   { text: 'Create and delete new items in your workspace' },\n * ]\n * @example\n * // Items can have nested details\n * [\n *   {\n *     text: 'Content and info about you'\n *     details: [\n *       'View content you have added to the platform, including videos and comments',\n *       'View information shared on the platform, including your name, and email'\n *     ]\n *   }\n * ]\n * @example\n * // Items can be grouped with headers\n *  [\n *    {\n *      header: '$Application is requesting to view:',\n *      items: [\n *        { text: 'Content and info about you' },\n *        { text: 'Content and info about your workspace' },\n *      ]\n *    },\n *    {\n *      header: '$Application is requesting to edit:',\n *      items: [\n *        { text: 'Your workspace items' }\n *      ]\n *    }\n *  ]\n */\nexport type IDPConsentScreenManifest = IDPConsentSection[] | IDPConsentItem[];\n\nexport enum StytchEventType {\n  MagicLinkLoginOrCreateEvent = 'MAGIC_LINK_LOGIN_OR_CREATE',\n  OTPsLoginOrCreateEvent = 'OTP_LOGIN_OR_CREATE',\n  OTPsAuthenticate = 'OTP_AUTHENTICATE',\n  CryptoWalletAuthenticateStart = 'CRYPTO_WALLET_AUTHENTICATE_START',\n  CryptoWalletAuthenticate = 'CRYPTO_WALLET_AUTHENTICATE',\n  PasswordCreate = 'PASSWORD_CREATE',\n  PasswordAuthenticate = 'PASSWORD_AUTHENTICATE',\n  PasswordResetByEmailStart = 'PASSWORD_RESET_BY_EMAIL_START',\n  PasswordResetByEmail = 'PASSWORD_RESET_BY_EMAIL',\n  PasskeyRegister = 'PASSKEY_REGISTER',\n  PasskeyAuthenticate = 'PASSKEY_AUTHENTICATE',\n  PasskeySkip = 'PASSKEY_SKIP',\n  PasskeyDone = 'PASSKEY_DONE',\n  /**\n   * The authentication UI flow has completed successfully, including any steps\n   * that take place after obtaining a valid session (such as saving recovery\n   * codes).\n   */\n  AuthenticateFlowComplete = 'AUTHENTICATE_FLOW_COMPLETE',\n  /**\n   * An OAuth Authorization flow has been initiated by a Connected Application.\n   * The end-user may be prompted for consent to continue depending on the application\n   * that is requesting access.\n   */\n  OAuthAuthorizeFlowStart = 'OAUTH_AUTHORIZE_FLOW_START',\n  /**\n   * The end-user has completed the Authorization flow and is about to be redirected\n   * back to the Connected Application\n   */\n  OAuthAuthorizeFlowComplete = 'OAUTH_AUTHORIZE_FLOW_COMPLETE',\n  /**\n   * The end-user has denied the Authorization flow and is about to be redirected\n   * back to the Connected Application with an error message\n   */\n  OAuthAuthorizeFlowConsentDenied = 'OAUTH_AUTHORIZE_FLOW_CONSENT_DENIED',\n  // More Events will go here ...\n  // B2B Events\n  B2BMagicLinkEmailLoginOrSignup = 'B2B_MAGIC_LINK_EMAIL_LOGIN_OR_SIGNUP',\n  B2BMagicLinkAuthenticate = 'B2B_MAGIC_LINK_AUTHENTICATE',\n  B2BMagicLinkEmailDiscoverySend = 'B2B_MAGIC_LINK_EMAIL_DISCOVERY_SEND',\n  B2BMagicLinkDiscoveryAuthenticate = 'B2B_MAGIC_LINK_DISCOVERY_AUTHENTICATE',\n  B2BSSOStart = 'B2B_SSO_START',\n  B2BSSOAuthenticate = 'B2B_SSO_AUTHENTICATE',\n  B2BSSODiscoverConnections = 'B2B_SSO_DISCOVER_CONNECTIONS',\n  B2BOAuthAuthenticate = 'B2B_OAUTH_AUTHENTICATE',\n  B2BOAuthDiscoveryAuthenticate = 'B2B_OAUTH_DISCOVERY_AUTHENTICATE',\n  B2BDiscoveryOrganizationsCreate = 'B2B_DISCOVERY_ORGANIZATIONS_CREATE',\n  B2BDiscoveryIntermediateSessionExchange = 'B2B_DISCOVERY_INTERMEDIATE_SESSION_EXCHANGE',\n  B2BPasswordAuthenticate = 'B2B_PASSWORD_AUTHENTICATE',\n  B2BPasswordDiscoveryAuthenticate = 'B2B_PASSWORD_DISCOVERY_AUTHENTICATE',\n  B2BPasswordResetByEmailStart = 'B2B_PASSWORD_RESET_BY_EMAIL_START',\n  B2BPasswordResetByEmail = 'B2B_PASSWORD_RESET_BY_EMAIL',\n  B2BPasswordResetBySession = 'B2B_PASSWORD_RESET_BY_SESSION',\n  B2BSMSOTPSend = 'B2B_SMS_OTP_SEND',\n  B2BSMSOTPAuthenticate = 'B2B_SMS_OTP_AUTHENTICATE',\n  B2BTOTPCreate = 'B2B_TOTP_CREATE',\n  B2BTOTPAuthenticate = 'B2B_TOTP_AUTHENTICATE',\n  B2BRecoveryCodesRecover = 'B2B_RECOVERY_CODES_RECOVER',\n  B2BPasswordDiscoveryResetStart = 'B2B_PASSWORD_DISCOVERY_RESET_BY_EMAIL_START',\n  B2BDiscoveryPasswordReset = 'B2B_PASSWORD_DISCOVERY_RESET_BY_EMAIL',\n  B2BImpersonationAuthenticate = 'B2B_IMPERSONATION_AUTHENTICATE',\n  B2BOTPsEmailAuthenticate = 'B2B_OTPS_EMAIL_AUTHENTICATE',\n  B2BOTPsEmailDiscoveryAuthenticate = 'B2B_OTPS_EMAIL_DISCOVERY_AUTHENTICATE',\n  B2BOTPsEmailDiscoverySend = 'B2B_OTPS_EMAIL_DISCOVERY_SEND',\n  B2BOTPsEmailLoginOrSignup = 'B2B_OTPS_EMAIL_LOGIN_OR_SIGNUP',\n  B2BOrganizationsGetBySlug = 'B2B_ORGANIZATIONS_GET_BY_SLUG',\n}\n\ntype StytchEventMap<TProjectConfiguration extends StytchProjectConfigurationInput> = {\n  [StytchEventType.MagicLinkLoginOrCreateEvent]: MagicLinksLoginOrCreateResponse & { email: string };\n  [StytchEventType.OTPsLoginOrCreateEvent]: OTPsLoginOrCreateResponse;\n  [StytchEventType.OTPsAuthenticate]: OTPsAuthenticateResponse<TProjectConfiguration>;\n  [StytchEventType.CryptoWalletAuthenticateStart]: CryptoWalletAuthenticateStartResponse;\n  [StytchEventType.CryptoWalletAuthenticate]: CryptoWalletAuthenticateResponse<TProjectConfiguration>;\n  [StytchEventType.PasswordCreate]: PasswordCreateResponse<TProjectConfiguration>;\n  [StytchEventType.PasswordAuthenticate]: PasswordAuthenticateResponse<TProjectConfiguration>;\n  [StytchEventType.B2BPasswordDiscoveryAuthenticate]: B2BPasswordDiscoveryAuthenticateResponse<TProjectConfiguration>;\n  [StytchEventType.PasswordResetByEmailStart]: PasswordResetByEmailStartResponse;\n  [StytchEventType.PasswordResetByEmail]: PasswordResetByEmailResponse<TProjectConfiguration>;\n  [StytchEventType.AuthenticateFlowComplete]: Record<string, never>;\n  [StytchEventType.B2BMagicLinkEmailLoginOrSignup]: B2BMagicLinkLoginOrSignupResponse & { email: string };\n  [StytchEventType.B2BMagicLinkAuthenticate]: B2BMagicLinksAuthenticateResponse<TProjectConfiguration>;\n  [StytchEventType.B2BMagicLinkEmailDiscoverySend]: B2BMagicLinksEmailDiscoverySendResponse;\n  [StytchEventType.B2BMagicLinkDiscoveryAuthenticate]: B2BMagicLinksDiscoveryAuthenticateResponse<TProjectConfiguration>;\n  [StytchEventType.B2BSSOStart]: Record<string, never>;\n  [StytchEventType.B2BSSOAuthenticate]: SSOAuthenticateResponse<TProjectConfiguration>;\n  [StytchEventType.B2BSSODiscoverConnections]: B2BSSODiscoverConnectionsResponse;\n  [StytchEventType.B2BDiscoveryOrganizationsCreate]: B2BDiscoveryOrganizationsCreateResponse<TProjectConfiguration>;\n  [StytchEventType.B2BPasswordAuthenticate]: B2BPasswordAuthenticateResponse<TProjectConfiguration>;\n  [StytchEventType.B2BPasswordResetByEmailStart]: B2BPasswordResetByEmailStartResponse;\n  [StytchEventType.B2BPasswordResetByEmail]: B2BPasswordResetByEmailResponse<TProjectConfiguration>;\n  [StytchEventType.B2BPasswordResetBySession]: B2BPasswordResetBySessionResponse<TProjectConfiguration>;\n  [StytchEventType.B2BDiscoveryIntermediateSessionExchange]: B2BDiscoveryIntermediateSessionsExchangeResponse<TProjectConfiguration>;\n  [StytchEventType.B2BOAuthAuthenticate]: B2BOAuthAuthenticateResponse<TProjectConfiguration>;\n  [StytchEventType.B2BOAuthDiscoveryAuthenticate]: B2BOAuthDiscoveryAuthenticateResponse<TProjectConfiguration>;\n  [StytchEventType.PasskeySkip]: Record<string, never>;\n  [StytchEventType.PasskeyDone]: Record<string, never>;\n  [StytchEventType.PasskeyRegister]: WebAuthnRegisterResponse<TProjectConfiguration>;\n  [StytchEventType.PasskeyAuthenticate]: WebAuthnAuthenticateResponse<TProjectConfiguration>;\n  [StytchEventType.B2BSMSOTPSend]: B2BSMSSendResponse;\n  [StytchEventType.B2BSMSOTPAuthenticate]: B2BSMSAuthenticateResponse<TProjectConfiguration>;\n  [StytchEventType.B2BTOTPCreate]: B2BTOTPCreateResponse;\n  [StytchEventType.B2BTOTPAuthenticate]: B2BTOTPAuthenticateResponse<TProjectConfiguration>;\n  [StytchEventType.B2BRecoveryCodesRecover]: RecoveryCodeRecoverResponse<TProjectConfiguration>;\n  [StytchEventType.B2BDiscoveryPasswordReset]: B2BPasswordDiscoveryResetByEmailResponse<TProjectConfiguration>;\n  [StytchEventType.B2BPasswordDiscoveryResetStart]: B2BPasswordDiscoveryResetByEmailStartResponse;\n  [StytchEventType.B2BImpersonationAuthenticate]: B2BImpersonationAuthenticateResponse<TProjectConfiguration>;\n  [StytchEventType.B2BOTPsEmailDiscoverySend]: B2BDiscoveryOTPEmailSendResponse;\n  [StytchEventType.B2BOTPsEmailAuthenticate]: B2BOTPsEmailAuthenticateResponse<TProjectConfiguration>;\n  [StytchEventType.B2BOTPsEmailDiscoveryAuthenticate]: B2BDiscoveryOTPEmailAuthenticateResponse<TProjectConfiguration>;\n  [StytchEventType.B2BOTPsEmailLoginOrSignup]: B2BOTPsEmailLoginOrSignupResponse;\n  [StytchEventType.B2BOrganizationsGetBySlug]: B2BOrganizationsGetBySlugResponse;\n  [StytchEventType.OAuthAuthorizeFlowStart]: { client_id: string; redirect_uri: string; scope: string };\n  [StytchEventType.OAuthAuthorizeFlowComplete]: Record<string, never>;\n  [StytchEventType.OAuthAuthorizeFlowConsentDenied]: Record<string, never>;\n  // More Events will go here ...\n};\n\nexport type StytchEvent<\n  TProjectConfiguration extends StytchProjectConfigurationInput = Stytch.DefaultProjectConfiguration,\n> = {\n  [K in StytchEventType]: { type: K; data: StytchEventMap<TProjectConfiguration>[K] };\n}[keyof StytchEventMap<TProjectConfiguration>];\n\n/**\n * Optional callbacks that are triggered by various events in the SDK. See more details about the callbacks\n * {@link https://stytch.com/docs/sdks/javascript-sdk#resources_ui-callbacks here}.\n */\nexport type Callbacks<\n  TProjectConfiguration extends StytchProjectConfigurationInput = Stytch.DefaultProjectConfiguration,\n> = {\n  /**\n   * A callback function that responds to errors in the SDK. It is useful for debugging during development\n   * and error handling in production.\n   *\n   * @param error - the error from the SDK with an additional error message\n   */\n  onError?(error: StytchSDKUIError): void;\n  /**\n   * A callback function that responds to events sent from the SDK. For the full list of events see the\n   * {@link StytchEvent StytchEvent}\n   *\n   * @param event - the event fired by the SDK\n   */\n  onEvent?(event: StytchEvent<TProjectConfiguration>): void;\n};\n\nexport type OneTapStyleConfig = {\n  position?: OneTapPositions;\n};\n\nexport enum RNUIProducts {\n  emailMagicLinks,\n  oauth,\n  otp,\n  passwords,\n}\n\nexport type RNUIEmailMagicLinksOptions = {\n  loginExpirationMinutes?: number;\n  signupExpirationMinutes?: number;\n  loginTemplateId?: string;\n  signupTemplateId?: string;\n  locale?: string;\n};\n\nexport type RNUIOAuthOptions = {\n  providers: OAuthProviders[] | ProvidersOptions;\n  /** @deprecated Use custom_scopes in ProvidersOptions instead */\n  customScopes?: string[];\n  /** @deprecated Use provider_params in ProvidersOptions instead */\n  providerParams?: Record<string, string>;\n};\n\nexport type RNUIOTPOptions = {\n  methods: OTPMethods[];\n  expirationMinutes: number;\n  loginTemplateId?: string;\n  signupTemplateId?: string;\n  locale?: string;\n};\n\nexport type RNUIPasswordOptions = {\n  loginExpirationMinutes?: number;\n  resetPasswordExpirationMinutes?: number;\n  resetPasswordTemplateId?: string;\n  locale?: string;\n};\n\nexport type RNUIProductConfig = {\n  products: RNUIProducts[];\n  emailMagicLinksOptions: RNUIEmailMagicLinksOptions;\n  oAuthOptions: RNUIOAuthOptions;\n  otpOptions: RNUIOTPOptions;\n  sessionOptions: SessionOptions;\n  passwordOptions: RNUIPasswordOptions;\n};\n"],"names":["OAuthProviders","Google","Microsoft","Apple","Github","GitLab","Facebook","Discord","Salesforce","Slack","Amazon","Bitbucket","LinkedIn","Coinbase","Twitch","Twitter","TikTok","Snapchat","Figma","Yahoo","Wallets","Phantom","Metamask","Binance","GenericEthereumWallet","GenericSolanaWallet","OneTapPositions","embedded","floating","embeddedOnly","floatingOrEmbedded","forceLegacyEmbedded","OTPMethods","SMS","WhatsApp","Email","StytchEventType","RNUIProducts"],"mappings":"AAqEA;;;;UAMaA,cAAAA,GAAiB;IAC5BC,MAAAA,EAAQ,QAAA;IACRC,SAAAA,EAAW,WAAA;IACXC,KAAAA,EAAO,OAAA;IACPC,MAAAA,EAAQ,QAAA;IACRC,MAAAA,EAAQ,QAAA;IACRC,QAAAA,EAAU,UAAA;IACVC,OAAAA,EAAS,SAAA;IACTC,UAAAA,EAAY,YAAA;IACZC,KAAAA,EAAO,OAAA;IACPC,MAAAA,EAAQ,QAAA;IACRC,SAAAA,EAAW,WAAA;IACXC,QAAAA,EAAU,UAAA;IACVC,QAAAA,EAAU,UAAA;IACVC,MAAAA,EAAQ,QAAA;IACRC,OAAAA,EAAS,SAAA;IACTC,MAAAA,EAAQ,QAAA;IACRC,QAAAA,EAAU,UAAA;IACVC,KAAAA,EAAO,OAAA;IACPC,KAAAA,EAAO;AACT;AAIA;;;;;UAOaC,OAAAA,GAAU;IACrBC,OAAAA,EAAS,SAAA;IACTC,QAAAA,EAAU,UAAA;IACVT,QAAAA,EAAU,UAAA;IACVU,OAAAA,EAAS,SAAA;IACTC,qBAAAA,EAAuB,uBAAA;IACvBC,mBAAAA,EAAqB;AACvB;AAIA;;;UAKaC,eAAAA,GAAkB;AAC7B;;;;AAIC,MACDC,QAAAA,EAAU,UAAA;AACV;;;AAGC,MACDC,QAAAA,EAAU,UAAA;AACV;;;;AAIC,MACDC,YAAAA,EAAc,cAAA;AACd;;;AAGC,MACDC,kBAAAA,EAAoB,oBAAA;AACpB;;;;;AAKC,MACDC,mBAAAA,EAAqB;AACvB;AAqCA;;;;;UAOaC,UAAAA,GAAa;IACxBC,GAAAA,EAAK,KAAA;IACLC,QAAAA,EAAU,UAAA;IACVC,KAAAA,EAAO;AACT;AA2TO,IAAA,eAAKC,iBAAAA,SAAAA,eAAAA,EAAAA;;;;;;;;;;;;;;AAcV;;;;AAIC,MAAA,eAAA,CAAA,0BAAA,CAAA,GAAA,4BAAA;AAED;;;;AAIC,MAAA,eAAA,CAAA,yBAAA,CAAA,GAAA,4BAAA;AAED;;;AAGC,MAAA,eAAA,CAAA,4BAAA,CAAA,GAAA,+BAAA;AAED;;;AAGC,MAAA,eAAA,CAAA,iCAAA,CAAA,GAAA,qCAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAlCSA,IAAAA,OAAAA,eAAAA;AAmEX,CAAA,CAAA,EAAA;AAqFM,IAAA,YAAKC,iBAAAA,SAAAA,YAAAA,EAAAA;;;;;AAAAA,IAAAA,OAAAA,YAAAA;AAKX,CAAA,CAAA,EAAA;;;;"}