{"version":3,"file":"index.cjs","names":["react","reactDom","reactDomClient","jsxRuntime","withClerk","normalizeWithDefaultValue","assertSingleChild","safeExecute","React","withClerk","normalizeWithDefaultValue","assertSingleChild","safeExecute","React","withClerk","normalizeWithDefaultValue","assertSingleChild","safeExecute","React","withClerk","normalizeWithDefaultValue","assertSingleChild","safeExecute","React","useSignIn","useSignUp","setErrorThrowerOptions"],"sources":["../src/polyfills.ts","../../ui/register/index.mjs","../src/components/SignInButton.tsx","../src/components/SignInWithMetamaskButton.tsx","../src/components/SignOutButton.tsx","../src/components/SignUpButton.tsx","../src/components/HandleSSOCallback.tsx","../src/index.ts"],"sourcesContent":["/**\n * Vite does not define `global` by default\n * One workaround is to use the `define` config prop\n * https://vitejs.dev/config/#define\n * We are solving this in the SDK level to reduce setup steps.\n */\nif (typeof window !== 'undefined' && !window.global) {\n  window.global = typeof global === 'undefined' ? window : global;\n}\n\nexport {};\n","/**\n * Register React dependencies for sharing with @clerk/ui's shared variant.\n *\n * Import this module BEFORE loading the ui.shared.browser.js bundle:\n *\n * ```js\n * import '@clerk/ui/register';\n * // Now load clerk-js which will load ui.shared.browser.js\n * ```\n *\n * This enables @clerk/ui to use the host app's React instead of bundling its own,\n * reducing the overall bundle size.\n */\n\nimport * as react from 'react';\nimport * as reactDom from 'react-dom';\nimport * as reactDomClient from 'react-dom/client';\nimport * as jsxRuntime from 'react/jsx-runtime';\n\n// Only register if not already registered to avoid overwriting with potentially\n// different React versions in complex module resolution scenarios.\nif (globalThis.__clerkSharedModules) {\n  // Warn if the already-registered React version differs from this import.\n  // This could indicate multiple React versions in the bundle, which may cause issues.\n  const existingVersion = globalThis.__clerkSharedModules.react?.version;\n  if (existingVersion && existingVersion !== react.version) {\n    console.warn(\n      `[@clerk/ui/register] React version mismatch detected. ` +\n        `Already registered: ${existingVersion}, current import: ${react.version}. ` +\n        `This may cause issues with the shared @clerk/ui variant.`,\n    );\n  }\n} else {\n  globalThis.__clerkSharedModules = {\n    react,\n    'react-dom': reactDom,\n    'react-dom/client': reactDomClient,\n    'react/jsx-runtime': jsxRuntime,\n  };\n}\n","import type { SignInButtonProps, SignInProps } from '@clerk/shared/types';\nimport React from 'react';\n\nimport type { WithClerkProp } from '../types';\nimport { assertSingleChild, normalizeWithDefaultValue, safeExecute } from '../utils';\nimport { withClerk } from './withClerk';\n\nexport const SignInButton = withClerk(\n  ({ clerk, children, ...props }: WithClerkProp<React.PropsWithChildren<SignInButtonProps>>) => {\n    const {\n      // @ts-expect-error - appearance is a valid prop for SignInProps & SignInButtonPropsModal\n      appearance,\n      getContainer,\n      component,\n      signUpFallbackRedirectUrl,\n      forceRedirectUrl,\n      fallbackRedirectUrl,\n      signUpForceRedirectUrl,\n      mode,\n      initialValues,\n      withSignUp,\n      oauthFlow,\n      ...rest\n    } = props;\n    children = normalizeWithDefaultValue(children, 'Sign in');\n    const child = assertSingleChild(children)('SignInButton');\n\n    const clickHandler = () => {\n      const opts: SignInProps = {\n        forceRedirectUrl,\n        fallbackRedirectUrl,\n        signUpFallbackRedirectUrl,\n        signUpForceRedirectUrl,\n        initialValues,\n        withSignUp,\n        oauthFlow,\n      };\n\n      if (mode === 'modal') {\n        return clerk.openSignIn({ ...opts, appearance, getContainer });\n      }\n      return clerk.redirectToSignIn({\n        ...opts,\n        signInFallbackRedirectUrl: fallbackRedirectUrl,\n        signInForceRedirectUrl: forceRedirectUrl,\n      });\n    };\n\n    const wrappedChildClickHandler: React.MouseEventHandler = async e => {\n      if (child && typeof child === 'object' && 'props' in child) {\n        await safeExecute(child.props.onClick)(e);\n      }\n      return clickHandler();\n    };\n\n    const childProps = { ...rest, onClick: wrappedChildClickHandler };\n    return React.cloneElement(child as React.ReactElement<unknown>, childProps);\n  },\n  { component: 'SignInButton', renderWhileLoading: true },\n);\n","import React from 'react';\n\nimport type { SignInWithMetamaskButtonProps, WithClerkProp } from '../types';\nimport { assertSingleChild, normalizeWithDefaultValue, safeExecute } from '../utils';\nimport { withClerk } from './withClerk';\n\nexport const SignInWithMetamaskButton = withClerk(\n  ({ clerk, children, ...props }: WithClerkProp<SignInWithMetamaskButtonProps>) => {\n    const { redirectUrl, getContainer, component, ...rest } = props;\n\n    children = normalizeWithDefaultValue(children, 'Sign in with Metamask');\n    const child = assertSingleChild(children)('SignInWithMetamaskButton');\n\n    // TODO: Properly fix this code\n    // eslint-disable-next-line @typescript-eslint/require-await\n    const clickHandler = async () => {\n      async function authenticate() {\n        await clerk.authenticateWithMetamask({ redirectUrl: redirectUrl || undefined });\n      }\n      void authenticate();\n    };\n\n    const wrappedChildClickHandler: React.MouseEventHandler = async e => {\n      await safeExecute((child as any).props.onClick)(e);\n      return clickHandler();\n    };\n\n    const childProps = { ...rest, onClick: wrappedChildClickHandler };\n    return React.cloneElement(child as React.ReactElement<unknown>, childProps);\n  },\n  { component: 'SignInWithMetamask', renderWhileLoading: true },\n);\n","import { deprecated } from '@clerk/shared/deprecated';\nimport type { SignOutOptions } from '@clerk/shared/types';\nimport React from 'react';\n\nimport type { WithClerkProp } from '../types';\nimport { assertSingleChild, normalizeWithDefaultValue, safeExecute } from '../utils';\nimport { withClerk } from './withClerk';\n\nexport type SignOutButtonProps = {\n  redirectUrl?: string;\n  sessionId?: string;\n  /**\n   * @deprecated Use the `redirectUrl` and `sessionId` props directly instead.\n   */\n  signOutOptions?: SignOutOptions;\n  children?: React.ReactNode;\n};\n\nexport const SignOutButton = withClerk(\n  ({ clerk, children, ...props }: React.PropsWithChildren<WithClerkProp<SignOutButtonProps>>) => {\n    const { redirectUrl = '/', sessionId, signOutOptions, getContainer, component, ...rest } = props;\n\n    if (signOutOptions) {\n      deprecated('SignOutButton `signOutOptions`', 'Use the `redirectUrl` and `sessionId` props directly instead.');\n    }\n\n    children = normalizeWithDefaultValue(children, 'Sign out');\n    const child = assertSingleChild(children)('SignOutButton');\n\n    const clickHandler = () =>\n      clerk.signOut({\n        redirectUrl,\n        ...(sessionId !== undefined && { sessionId }),\n        ...signOutOptions,\n      });\n    const wrappedChildClickHandler: React.MouseEventHandler = async e => {\n      await safeExecute((child as any).props.onClick)(e);\n      return clickHandler();\n    };\n\n    const childProps = { ...rest, onClick: wrappedChildClickHandler };\n    return React.cloneElement(child as React.ReactElement<unknown>, childProps);\n  },\n  { component: 'SignOutButton', renderWhileLoading: true },\n);\n","import type { SignUpButtonProps, SignUpProps } from '@clerk/shared/types';\nimport React from 'react';\n\nimport type { WithClerkProp } from '../types';\nimport { assertSingleChild, normalizeWithDefaultValue, safeExecute } from '../utils';\nimport { withClerk } from './withClerk';\n\nexport const SignUpButton = withClerk(\n  ({ clerk, children, ...props }: WithClerkProp<React.PropsWithChildren<SignUpButtonProps>>) => {\n    const {\n      // @ts-expect-error - appearance is a valid prop for SignUpProps & SignUpButtonPropsModal\n      appearance,\n      // @ts-expect-error - unsafeMetadata is a valid prop for SignUpProps & SignUpButtonPropsModal\n      unsafeMetadata,\n      getContainer,\n      component,\n      fallbackRedirectUrl,\n      forceRedirectUrl,\n      signInFallbackRedirectUrl,\n      signInForceRedirectUrl,\n      mode,\n      initialValues,\n      oauthFlow,\n      ...rest\n    } = props;\n\n    children = normalizeWithDefaultValue(children, 'Sign up');\n    const child = assertSingleChild(children)('SignUpButton');\n\n    const clickHandler = () => {\n      const opts: SignUpProps = {\n        fallbackRedirectUrl,\n        forceRedirectUrl,\n        signInFallbackRedirectUrl,\n        signInForceRedirectUrl,\n        initialValues,\n        oauthFlow,\n      };\n\n      if (mode === 'modal') {\n        return clerk.openSignUp({\n          ...opts,\n          appearance,\n          unsafeMetadata,\n          getContainer,\n        });\n      }\n\n      return clerk.redirectToSignUp({\n        ...opts,\n        signUpFallbackRedirectUrl: fallbackRedirectUrl,\n        signUpForceRedirectUrl: forceRedirectUrl,\n      });\n    };\n\n    const wrappedChildClickHandler: React.MouseEventHandler = async e => {\n      if (child && typeof child === 'object' && 'props' in child) {\n        await safeExecute(child.props.onClick)(e);\n      }\n      return clickHandler();\n    };\n\n    const childProps = { ...rest, onClick: wrappedChildClickHandler };\n    return React.cloneElement(child as React.ReactElement<unknown>, childProps);\n  },\n  { component: 'SignUpButton', renderWhileLoading: true },\n);\n","import type { SetActiveNavigate } from '@clerk/shared/types';\nimport React, { type ReactNode, useEffect, useRef } from 'react';\n\nimport { useClerk, useSignIn, useSignUp } from '../hooks';\n\nexport interface HandleSSOCallbackProps {\n  /**\n   * Called when the SSO callback is complete and a session has been created.\n   */\n  navigateToApp: (...params: Parameters<SetActiveNavigate>) => void;\n  /**\n   * Called when a sign-in requires additional verification, or a sign-up is transfered to a sign-in that requires\n   * additional verification.\n   */\n  navigateToSignIn: () => void;\n  /**\n   * Called when a sign-in is transfered to a sign-up that requires additional verification.\n   */\n  navigateToSignUp: () => void;\n}\n\n/**\n * Use this component when building custom UI to handle the SSO callback and navigate to the appropriate page based on\n * the status of the sign-in or sign-up. By default, this component might render a captcha element to handle captchas\n * when required by the Clerk API.\n *\n * @example\n * ```tsx\n * import { HandleSSOCallback } from '@clerk/react';\n * import { useNavigate } from 'react-router';\n *\n * export default function Page() {\n *   const navigate = useNavigate();\n *\n *   return (\n *     <HandleSSOCallback\n *       navigateToApp={({ session, decorateUrl }) => {\n *         if (session?.currentTask) {\n *           const destination = decorateUrl(`/onboarding/${session?.currentTask.key}`);\n *           if (destination.startsWith('http')) {\n *             window.location.href = destination;\n *             return;\n *           }\n *           navigate(destination);\n *           return;\n *         }\n *\n *         const destination = decorateUrl('/dashboard');\n *         if (destination.startsWith('http')) {\n *           window.location.href = destination;\n *           return;\n *         }\n *         navigate(destination);\n *       }}\n *       navigateToSignIn={() => {\n *         navigate('/sign-in');\n *       }}\n *       navigateToSignUp={() => {\n *         navigate('/sign-up');\n *       }}\n *     />\n *   );\n * }\n * ```\n */\nexport function HandleSSOCallback(props: HandleSSOCallbackProps): ReactNode {\n  const { navigateToApp, navigateToSignIn, navigateToSignUp } = props;\n  const clerk = useClerk();\n  const { signIn } = useSignIn();\n  const { signUp } = useSignUp();\n  const hasRun = useRef(false);\n\n  useEffect(() => {\n    (async () => {\n      if (!clerk.loaded || hasRun.current) {\n        return;\n      }\n      // Prevent re-running this effect if the page is re-rendered during session activation (such as on Next.js).\n      hasRun.current = true;\n\n      // If this was a sign-in, and it's complete, there's nothing else to do.\n      // Note: We perform a cast here to prevent TypeScript from narrowing the type of signIn.status. TypeScript\n      // doesn't understand that the status can be mutated during the execution of this function.\n      if ((signIn.status as string) === 'complete') {\n        await signIn.finalize({\n          navigate: async (...params) => {\n            navigateToApp(...params);\n          },\n        });\n        return;\n      }\n\n      // If the sign-up used an existing account, transfer it to a sign-in.\n      if (signUp.isTransferable) {\n        await signIn.create({ transfer: true });\n        if (signIn.status === 'complete') {\n          await signIn.finalize({\n            navigate: async (...params) => {\n              navigateToApp(...params);\n            },\n          });\n          return;\n        }\n        // The sign-in requires additional verification, so we need to navigate to the sign-in page.\n        return navigateToSignIn();\n      }\n\n      if (\n        signIn.status === 'needs_first_factor' &&\n        !signIn.supportedFirstFactors?.every(f => f.strategy === 'enterprise_sso')\n      ) {\n        // The sign-in requires the use of a configured first factor, so navigate to the sign-in page.\n        return navigateToSignIn();\n      }\n\n      // If the sign-in used an external account not associated with an existing user, create a sign-up.\n      if (signIn.isTransferable) {\n        await signUp.create({ transfer: true });\n        if (signUp.status === 'complete') {\n          await signUp.finalize({\n            navigate: async (...params) => {\n              navigateToApp(...params);\n            },\n          });\n          return;\n        }\n        return navigateToSignUp();\n      }\n\n      if (signUp.status === 'complete') {\n        await signUp.finalize({\n          navigate: async (...params) => {\n            navigateToApp(...params);\n          },\n        });\n        return;\n      }\n\n      if (signIn.status === 'needs_second_factor' || signIn.status === 'needs_new_password') {\n        // The sign-in requires a MFA token or a new password, so navigate to the sign-in page.\n        return navigateToSignIn();\n      }\n\n      // The external account used to sign-in or sign-up was already associated with an existing user and active\n      // session on this client, so activate the session and navigate to the application.\n      if (signIn.existingSession || signUp.existingSession) {\n        const sessionId = signIn.existingSession?.sessionId || signUp.existingSession?.sessionId;\n        if (sessionId) {\n          // Because we're activating a session that's not the result of a sign-in or sign-up, we need to use the\n          // Clerk `setActive` API instead of the `finalize` API.\n          await clerk.setActive({\n            session: sessionId,\n            navigate: async (...params) => {\n              return navigateToApp(...params);\n            },\n          });\n          return;\n        }\n      }\n    })();\n  }, [clerk, clerk.loaded, signIn, signUp]);\n\n  return (\n    <div>\n      {/* Because a sign-in transferred to a sign-up might require captcha verification, make sure to render the\n  captcha element. */}\n      <div id='clerk-captcha' />\n    </div>\n  );\n}\n","import './polyfills';\nimport './types/appearance';\n// Register React on the global shared modules registry.\n// This enables @clerk/ui's shared variant to use the host app's React\n// instead of bundling its own copy, reducing overall bundle size.\nimport '@clerk/ui/register';\n\nimport { setClerkJSLoadingErrorPackageName } from '@clerk/shared/loadClerkJsScript';\n\nimport { setErrorThrowerOptions } from './errors/errorThrower';\n\nexport * from './components';\nexport * from './contexts';\n\nexport * from './hooks';\nexport { getToken } from '@clerk/shared/getToken';\nexport type {\n  BrowserClerk,\n  BrowserClerkConstructor,\n  ClerkProp,\n  HeadlessBrowserClerk,\n  HeadlessBrowserClerkConstructor,\n  IsomorphicClerkOptions,\n} from '@clerk/shared/types';\nexport type { ClerkProviderProps } from './types';\n\nsetErrorThrowerOptions({ packageName: PACKAGE_NAME });\nsetClerkJSLoadingErrorPackageName(PACKAGE_NAME);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAMA,IAAI,OAAO,WAAW,eAAe,CAAC,OAAO,QAC3C,OAAO,SAAS,OAAO,WAAW,cAAc,SAAS;;;;;;;;;;;;;;;;;ACc3D,IAAI,WAAW,sBAAsB;CAGnC,MAAM,kBAAkB,WAAW,qBAAqB,OAAO;CAC/D,IAAI,mBAAmB,oBAAoBA,QAAM,SAC/C,QAAQ,KACN,6EACyB,gBAAgB,oBAAoBA,QAAM,QAAQ,2DAE7E;AAEJ,OACE,WAAW,uBAAuB;CAChC;CACA,aAAaC;CACb,oBAAoBC;CACpB,qBAAqBC;AACvB;;;;AC/BF,MAAa,eAAeC,yBACzB,EAAE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