@clerk/clerk-react
Version:
Clerk React library
1 lines • 28 kB
Source Map (JSON)
{"version":3,"sources":["../src/errors/errorThrower.ts","../src/hooks/useAuth.ts","../src/contexts/AuthContext.ts","../src/contexts/IsomorphicClerkContext.tsx","../src/errors/messages.ts","../src/hooks/useAssertWrappedByClerkProvider.ts","../src/hooks/utils.ts","../src/hooks/useEmailLink.ts","../src/hooks/useSignIn.ts","../src/hooks/useSignUp.ts","../src/hooks/index.ts","../src/components/withClerk.tsx"],"sourcesContent":["import type { ErrorThrowerOptions } from '@clerk/shared/error';\nimport { buildErrorThrower } from '@clerk/shared/error';\n\nconst errorThrower = buildErrorThrower({ packageName: '@clerk/clerk-react' });\n\nexport { errorThrower };\n\n/**\n * Overrides options of the internal errorThrower (eg setting packageName prefix).\n *\n * @internal\n */\nexport function setErrorThrowerOptions(options: ErrorThrowerOptions) {\n errorThrower.setMessages(options).setPackageName(options);\n}\n","import { createCheckAuthorization, resolveAuthState } from '@clerk/shared/authorization';\nimport { eventMethodCalled } from '@clerk/shared/telemetry';\nimport type {\n CheckAuthorizationWithCustomPermissions,\n GetToken,\n JwtPayload,\n PendingSessionOptions,\n SignOut,\n UseAuthReturn,\n} from '@clerk/shared/types';\nimport { useCallback } from 'react';\n\nimport { useAuthContext } from '../contexts/AuthContext';\nimport { useIsomorphicClerkContext } from '../contexts/IsomorphicClerkContext';\nimport { errorThrower } from '../errors/errorThrower';\nimport { invalidStateError } from '../errors/messages';\nimport { useAssertWrappedByClerkProvider } from './useAssertWrappedByClerkProvider';\nimport { createGetToken, createSignOut } from './utils';\n\n/**\n * @inline\n */\ntype UseAuthOptions = Record<string, any> | PendingSessionOptions | undefined | null;\n\n/**\n * The `useAuth()` hook provides access to the current user's authentication state and methods to manage the active session.\n *\n * > [!NOTE]\n * > To access auth data server-side, see the [`Auth` object reference doc](https://clerk.com/docs/reference/backend/types/auth-object).\n *\n * <If sdk=\"nextjs\">\n * By default, Next.js opts all routes into static rendering. If you need to opt a route or routes into dynamic rendering because you need to access the authentication data at request time, you can create a boundary by passing the `dynamic` prop to `<ClerkProvider>`. See the [guide on rendering modes](https://clerk.com/docs/guides/development/rendering-modes) for more information, including code examples.\n * </If>\n *\n * @unionReturnHeadings\n * [\"Initialization\", \"Signed out\", \"Signed in (no active organization)\", \"Signed in (with active organization)\"]\n *\n * @param [initialAuthStateOrOptions] - An object containing the initial authentication state or options for the `useAuth()` hook. If not provided, the hook will attempt to derive the state from the context. `treatPendingAsSignedOut` is a boolean that indicates whether pending sessions are considered as signed out or not. Defaults to `true`.\n *\n * @function\n *\n * @example\n *\n * The following example demonstrates how to use the `useAuth()` hook to access the current auth state, like whether the user is signed in or not. It also includes a basic example for using the `getToken()` method to retrieve a session token for fetching data from an external resource.\n *\n * <Tabs items='React,Next.js'>\n * <Tab>\n *\n * ```tsx {{ filename: 'src/pages/ExternalDataPage.tsx' }}\n * import { useAuth } from '@clerk/clerk-react'\n *\n * export default function ExternalDataPage() {\n * const { userId, sessionId, getToken, isLoaded, isSignedIn } = useAuth()\n *\n * const fetchExternalData = async () => {\n * const token = await getToken()\n *\n * // Fetch data from an external API\n * const response = await fetch('https://api.example.com/data', {\n * headers: {\n * Authorization: `Bearer ${token}`,\n * },\n * })\n *\n * return response.json()\n * }\n *\n * if (!isLoaded) {\n * return <div>Loading...</div>\n * }\n *\n * if (!isSignedIn) {\n * return <div>Sign in to view this page</div>\n * }\n *\n * return (\n * <div>\n * <p>\n * Hello, {userId}! Your current active session is {sessionId}.\n * </p>\n * <button onClick={fetchExternalData}>Fetch Data</button>\n * </div>\n * )\n * }\n * ```\n *\n * </Tab>\n * <Tab>\n *\n * {@include ../../docs/use-auth.md#nextjs-01}\n *\n * </Tab>\n * </Tabs>\n */\nexport const useAuth = (initialAuthStateOrOptions: UseAuthOptions = {}): UseAuthReturn => {\n useAssertWrappedByClerkProvider('useAuth');\n\n const { treatPendingAsSignedOut, ...rest } = initialAuthStateOrOptions ?? {};\n const initialAuthState = rest as any;\n\n const authContextFromHook = useAuthContext();\n let authContext = authContextFromHook;\n\n if (authContext.sessionId === undefined && authContext.userId === undefined) {\n authContext = initialAuthState != null ? initialAuthState : {};\n }\n\n const isomorphicClerk = useIsomorphicClerkContext();\n const getToken: GetToken = useCallback(createGetToken(isomorphicClerk), [isomorphicClerk]);\n const signOut: SignOut = useCallback(createSignOut(isomorphicClerk), [isomorphicClerk]);\n\n isomorphicClerk.telemetry?.record(eventMethodCalled('useAuth', { treatPendingAsSignedOut }));\n\n return useDerivedAuth(\n {\n ...authContext,\n getToken,\n signOut,\n },\n {\n treatPendingAsSignedOut,\n },\n );\n};\n\n/**\n * A hook that derives and returns authentication state and utility functions based on the provided auth object.\n *\n * @param authObject - An object containing authentication-related properties and functions.\n *\n * @returns A derived authentication state with helper methods. If the authentication state is invalid, an error is thrown.\n *\n * @remarks\n * This hook inspects session, user, and organization information to determine the current authentication state.\n * It returns an object that includes various properties such as whether the state is loaded, if a user is signed in,\n * session and user identifiers, organization roles, and a `has` function for authorization checks.\n * Additionally, it provides `signOut` and `getToken` functions if applicable.\n *\n * @example\n * ```tsx\n * const {\n * isLoaded,\n * isSignedIn,\n * userId,\n * orgId,\n * has,\n * signOut,\n * getToken\n * } = useDerivedAuth(authObject);\n * ```\n */\nexport function useDerivedAuth(\n authObject: any,\n { treatPendingAsSignedOut = true }: PendingSessionOptions = {},\n): UseAuthReturn {\n const { userId, orgId, orgRole, has, signOut, getToken, orgPermissions, factorVerificationAge, sessionClaims } =\n authObject ?? {};\n\n const derivedHas = useCallback(\n (params: Parameters<CheckAuthorizationWithCustomPermissions>[0]) => {\n if (has) {\n return has(params);\n }\n return createCheckAuthorization({\n userId,\n orgId,\n orgRole,\n orgPermissions,\n factorVerificationAge,\n features: ((sessionClaims as JwtPayload | undefined)?.fea as string) || '',\n plans: ((sessionClaims as JwtPayload | undefined)?.pla as string) || '',\n })(params);\n },\n [has, userId, orgId, orgRole, orgPermissions, factorVerificationAge, sessionClaims],\n );\n\n const payload = resolveAuthState({\n authObject: {\n ...authObject,\n getToken,\n signOut,\n has: derivedHas,\n },\n options: {\n treatPendingAsSignedOut,\n },\n });\n\n if (!payload) {\n return errorThrower.throw(invalidStateError);\n }\n\n return payload;\n}\n","import { createContextAndHook } from '@clerk/shared/react';\nimport type {\n ActClaim,\n JwtPayload,\n OrganizationCustomPermissionKey,\n OrganizationCustomRoleKey,\n SessionStatusClaim,\n} from '@clerk/shared/types';\n\nexport type AuthContextValue = {\n userId: string | null | undefined;\n sessionId: string | null | undefined;\n sessionStatus: SessionStatusClaim | null | undefined;\n sessionClaims: JwtPayload | null | undefined;\n actor: ActClaim | null | undefined;\n orgId: string | null | undefined;\n orgRole: OrganizationCustomRoleKey | null | undefined;\n orgSlug: string | null | undefined;\n orgPermissions: OrganizationCustomPermissionKey[] | null | undefined;\n factorVerificationAge: [number, number] | null;\n};\n\nexport const [AuthContext, useAuthContext] = createContextAndHook<AuthContextValue>('AuthContext');\n","import { ClerkInstanceContext, useClerkInstanceContext } from '@clerk/shared/react';\n\nimport type { IsomorphicClerk } from '../isomorphicClerk';\n\nexport const IsomorphicClerkContext = ClerkInstanceContext;\nexport const useIsomorphicClerkContext = useClerkInstanceContext as unknown as () => IsomorphicClerk;\n","export const noClerkProviderError = 'You must wrap your application in a <ClerkProvider> component.';\n\nexport const multipleClerkProvidersError =\n \"You've added multiple <ClerkProvider> components in your React component tree. Wrap your components in a single <ClerkProvider>.\";\n\nexport const multipleChildrenInButtonComponent = (name: string) =>\n `You've passed multiple children components to <${name}/>. You can only pass a single child component or text.`;\n\nexport const invalidStateError =\n 'Invalid state. Feel free to submit a bug or reach out to support here: https://clerk.com/support';\n\nexport const unsupportedNonBrowserDomainOrProxyUrlFunction =\n 'Unsupported usage of isSatellite, domain or proxyUrl. The usage of isSatellite, domain or proxyUrl as function is not supported in non-browser environments.';\n\nexport const userProfilePageRenderedError =\n '<UserProfile.Page /> component needs to be a direct child of `<UserProfile />` or `<UserButton />`.';\nexport const userProfileLinkRenderedError =\n '<UserProfile.Link /> component needs to be a direct child of `<UserProfile />` or `<UserButton />`.';\n\nexport const organizationProfilePageRenderedError =\n '<OrganizationProfile.Page /> component needs to be a direct child of `<OrganizationProfile />` or `<OrganizationSwitcher />`.';\nexport const organizationProfileLinkRenderedError =\n '<OrganizationProfile.Link /> component needs to be a direct child of `<OrganizationProfile />` or `<OrganizationSwitcher />`.';\n\nexport const customPagesIgnoredComponent = (componentName: string) =>\n `<${componentName} /> can only accept <${componentName}.Page /> and <${componentName}.Link /> as its children. Any other provided component will be ignored. Additionally, please ensure that the component is rendered in a client component.`;\n\nexport const customPageWrongProps = (componentName: string) =>\n `Missing props. <${componentName}.Page /> component requires the following props: url, label, labelIcon, alongside with children to be rendered inside the page.`;\n\nexport const customLinkWrongProps = (componentName: string) =>\n `Missing props. <${componentName}.Link /> component requires the following props: url, label and labelIcon.`;\n\nexport const useAuthHasRequiresRoleOrPermission =\n 'Missing parameters. `has` from `useAuth` requires a permission or role key to be passed. Example usage: `has({permission: \"org:posts:edit\"`';\n\nexport const noPathProvidedError = (componentName: string) =>\n `The <${componentName}/> component uses path-based routing by default unless a different routing strategy is provided using the \\`routing\\` prop. When path-based routing is used, you need to provide the path where the component is mounted on by using the \\`path\\` prop. Example: <${componentName} path={'/my-path'} />`;\n\nexport const incompatibleRoutingWithPathProvidedError = (componentName: string) =>\n `The \\`path\\` prop will only be respected when the Clerk component uses path-based routing. To resolve this error, pass \\`routing='path'\\` to the <${componentName}/> component, or drop the \\`path\\` prop to switch to hash-based routing. For more details please refer to our docs: https://clerk.com/docs`;\n\nexport const userButtonIgnoredComponent = `<UserButton /> can only accept <UserButton.UserProfilePage />, <UserButton.UserProfileLink /> and <UserButton.MenuItems /> as its children. Any other provided component will be ignored. Additionally, please ensure that the component is rendered in a client component.`;\n\nexport const customMenuItemsIgnoredComponent =\n '<UserButton.MenuItems /> component can only accept <UserButton.Action /> and <UserButton.Link /> as its children. Any other provided component will be ignored. Additionally, please ensure that the component is rendered in a client component.';\n\nexport const userButtonMenuItemsRenderedError =\n '<UserButton.MenuItems /> component needs to be a direct child of `<UserButton />`.';\n\nexport const userButtonMenuActionRenderedError =\n '<UserButton.Action /> component needs to be a direct child of `<UserButton.MenuItems />`.';\n\nexport const userButtonMenuLinkRenderedError =\n '<UserButton.Link /> component needs to be a direct child of `<UserButton.MenuItems />`.';\n\nexport const userButtonMenuItemLinkWrongProps =\n 'Missing props. <UserButton.Link /> component requires the following props: href, label and labelIcon.';\n\nexport const userButtonMenuItemsActionWrongsProps =\n 'Missing props. <UserButton.Action /> component requires the following props: label.';\n","import { useAssertWrappedByClerkProvider as useSharedAssertWrappedByClerkProvider } from '@clerk/shared/react';\n\nimport { errorThrower } from '../errors/errorThrower';\n\nexport const useAssertWrappedByClerkProvider = (source: string): void => {\n useSharedAssertWrappedByClerkProvider(() => {\n errorThrower.throwMissingClerkProviderError({ source });\n });\n};\n","import type { IsomorphicClerk } from '../isomorphicClerk';\n\n/**\n * @internal\n */\nconst clerkLoaded = (isomorphicClerk: IsomorphicClerk) => {\n return new Promise<void>(resolve => {\n const handler = (status: string) => {\n if (['ready', 'degraded'].includes(status)) {\n resolve();\n isomorphicClerk.off('status', handler);\n }\n };\n\n // Register the event listener\n isomorphicClerk.on('status', handler, { notify: true });\n });\n};\n\n/**\n * @internal\n */\nexport const createGetToken = (isomorphicClerk: IsomorphicClerk) => {\n return async (options: any) => {\n await clerkLoaded(isomorphicClerk);\n if (!isomorphicClerk.session) {\n return null;\n }\n return isomorphicClerk.session.getToken(options);\n };\n};\n\n/**\n * @internal\n */\nexport const createSignOut = (isomorphicClerk: IsomorphicClerk) => {\n return async (...args: any) => {\n await clerkLoaded(isomorphicClerk);\n return isomorphicClerk.signOut(...args);\n };\n};\n","import type {\n CreateEmailLinkFlowReturn,\n EmailAddressResource,\n SignInResource,\n SignInStartEmailLinkFlowParams,\n SignUpResource,\n StartEmailLinkFlowParams,\n} from '@clerk/shared/types';\nimport React from 'react';\n\ntype EmailLinkable = SignUpResource | EmailAddressResource | SignInResource;\ntype UseEmailLinkSignInReturn = CreateEmailLinkFlowReturn<SignInStartEmailLinkFlowParams, SignInResource>;\ntype UseEmailLinkSignUpReturn = CreateEmailLinkFlowReturn<StartEmailLinkFlowParams, SignUpResource>;\ntype UseEmailLinkEmailAddressReturn = CreateEmailLinkFlowReturn<StartEmailLinkFlowParams, EmailAddressResource>;\n\nfunction useEmailLink(resource: SignInResource): UseEmailLinkSignInReturn;\nfunction useEmailLink(resource: SignUpResource): UseEmailLinkSignUpReturn;\nfunction useEmailLink(resource: EmailAddressResource): UseEmailLinkEmailAddressReturn;\nfunction useEmailLink(\n resource: EmailLinkable,\n): UseEmailLinkSignInReturn | UseEmailLinkSignUpReturn | UseEmailLinkEmailAddressReturn {\n const { startEmailLinkFlow, cancelEmailLinkFlow } = React.useMemo(() => resource.createEmailLinkFlow(), [resource]);\n\n React.useEffect(() => {\n return cancelEmailLinkFlow;\n }, []);\n\n return {\n startEmailLinkFlow,\n cancelEmailLinkFlow,\n } as UseEmailLinkSignInReturn | UseEmailLinkSignUpReturn | UseEmailLinkEmailAddressReturn;\n}\n\nexport { useEmailLink };\n","import { useClientContext } from '@clerk/shared/react';\nimport { eventMethodCalled } from '@clerk/shared/telemetry';\nimport type { UseSignInReturn } from '@clerk/shared/types';\n\nimport { useIsomorphicClerkContext } from '../contexts/IsomorphicClerkContext';\nimport { useAssertWrappedByClerkProvider } from './useAssertWrappedByClerkProvider';\n\n/**\n * The `useSignIn()` hook provides access to the [`SignIn`](https://clerk.com/docs/reference/javascript/sign-in) object, which allows you to check the current state of a sign-in attempt and manage the sign-in flow. You can use this to create a [custom sign-in flow](https://clerk.com/docs/guides/development/custom-flows/overview#sign-in-flow).\n *\n * @unionReturnHeadings\n * [\"Initialization\", \"Loaded\"]\n *\n * @example\n * ### Check the current state of a sign-in\n *\n * The following example uses the `useSignIn()` hook to access the [`SignIn`](https://clerk.com/docs/reference/javascript/sign-in) object, which contains the current sign-in attempt status and methods to create a new sign-in attempt. The `isLoaded` property is used to handle the loading state.\n *\n * <Tabs items='React,Next.js'>\n * <Tab>\n *\n * ```tsx {{ filename: 'src/pages/SignInPage.tsx' }}\n * import { useSignIn } from '@clerk/clerk-react'\n *\n * export default function SignInPage() {\n * const { isLoaded, signIn } = useSignIn()\n *\n * if (!isLoaded) {\n * // Handle loading state\n * return null\n * }\n *\n * return <div>The current sign-in attempt status is {signIn?.status}.</div>\n * }\n * ```\n *\n * </Tab>\n * <Tab>\n *\n * {@include ../../docs/use-sign-in.md#nextjs-01}\n *\n * </Tab>\n * </Tabs>\n *\n * @example\n * ### Create a custom sign-in flow with `useSignIn()`\n *\n * The `useSignIn()` hook can also be used to build fully custom sign-in flows, if Clerk's prebuilt components don't meet your specific needs or if you require more control over the authentication flow. Different sign-in flows include email and password, email and phone codes, email links, and multifactor (MFA). To learn more about using the `useSignIn()` hook to create custom flows, see the [custom flow guides](https://clerk.com/docs/guides/development/custom-flows/overview).\n *\n * ```empty```\n */\nexport const useSignIn = (): UseSignInReturn => {\n useAssertWrappedByClerkProvider('useSignIn');\n\n const isomorphicClerk = useIsomorphicClerkContext();\n const client = useClientContext();\n\n isomorphicClerk.telemetry?.record(eventMethodCalled('useSignIn'));\n\n if (!client) {\n return { isLoaded: false, signIn: undefined, setActive: undefined };\n }\n\n return {\n isLoaded: true,\n signIn: client.signIn,\n setActive: isomorphicClerk.setActive,\n };\n};\n","import { useClientContext } from '@clerk/shared/react';\nimport { eventMethodCalled } from '@clerk/shared/telemetry';\nimport type { UseSignUpReturn } from '@clerk/shared/types';\n\nimport { useIsomorphicClerkContext } from '../contexts/IsomorphicClerkContext';\nimport { useAssertWrappedByClerkProvider } from './useAssertWrappedByClerkProvider';\n\n/**\n * The `useSignUp()` hook provides access to the [`SignUp`](https://clerk.com/docs/reference/javascript/sign-up) object, which allows you to check the current state of a sign-up attempt and manage the sign-up flow. You can use this to create a [custom sign-up flow](https://clerk.com/docs/guides/development/custom-flows/overview#sign-up-flow).\n *\n * @unionReturnHeadings\n * [\"Initialization\", \"Loaded\"]\n *\n * @example\n * ### Check the current state of a sign-up\n *\n * The following example uses the `useSignUp()` hook to access the [`SignUp`](https://clerk.com/docs/reference/javascript/sign-up) object, which contains the current sign-up attempt status and methods to create a new sign-up attempt. The `isLoaded` property is used to handle the loading state.\n *\n * <Tabs items='React,Next.js'>\n * <Tab>\n *\n * ```tsx {{ filename: 'src/pages/SignUpPage.tsx' }}\n * import { useSignUp } from '@clerk/clerk-react'\n *\n * export default function SignUpPage() {\n * const { isLoaded, signUp } = useSignUp()\n *\n * if (!isLoaded) {\n * // Handle loading state\n * return null\n * }\n *\n * return <div>The current sign-up attempt status is {signUp?.status}.</div>\n * }\n * ```\n *\n * </Tab>\n * <Tab>\n *\n * {@include ../../docs/use-sign-up.md#nextjs-01}\n *\n * </Tab>\n * </Tabs>\n *\n * @example\n * ### Create a custom sign-up flow with `useSignUp()`\n *\n * The `useSignUp()` hook can also be used to build fully custom sign-up flows, if Clerk's prebuilt components don't meet your specific needs or if you require more control over the authentication flow. Different sign-up flows include email and password, email and phone codes, email links, and multifactor (MFA). To learn more about using the `useSignUp()` hook to create custom flows, see the [custom flow guides](https://clerk.com/docs/guides/development/custom-flows/overview).\n *\n * ```empty```\n */\nexport const useSignUp = (): UseSignUpReturn => {\n useAssertWrappedByClerkProvider('useSignUp');\n\n const isomorphicClerk = useIsomorphicClerkContext();\n const client = useClientContext();\n\n isomorphicClerk.telemetry?.record(eventMethodCalled('useSignUp'));\n\n if (!client) {\n return { isLoaded: false, signUp: undefined, setActive: undefined };\n }\n\n return {\n isLoaded: true,\n signUp: client.signUp,\n setActive: isomorphicClerk.setActive,\n };\n};\n","export { useAuth } from './useAuth';\nexport { useEmailLink } from './useEmailLink';\nexport { useSignIn } from './useSignIn';\nexport { useSignUp } from './useSignUp';\nexport {\n useClerk,\n useOrganization,\n useOrganizationList,\n useSessionList,\n useUser,\n useSession,\n useReverification,\n __experimental_useCheckout,\n __experimental_CheckoutProvider,\n __experimental_usePaymentElement,\n __experimental_PaymentElementProvider,\n __experimental_PaymentElement,\n} from '@clerk/shared/react';\n","import type { LoadedClerk, Without } from '@clerk/shared/types';\nimport React from 'react';\n\nimport { useIsomorphicClerkContext } from '../contexts/IsomorphicClerkContext';\nimport { useAssertWrappedByClerkProvider } from '../hooks/useAssertWrappedByClerkProvider';\n\nexport const withClerk = <P extends { clerk: LoadedClerk; component?: string }>(\n Component: React.ComponentType<P>,\n displayNameOrOptions?: string | { component: string; renderWhileLoading?: boolean },\n) => {\n const passedDisplayedName =\n typeof displayNameOrOptions === 'string' ? displayNameOrOptions : displayNameOrOptions?.component;\n const displayName = passedDisplayedName || Component.displayName || Component.name || 'Component';\n Component.displayName = displayName;\n\n const options = typeof displayNameOrOptions === 'string' ? undefined : displayNameOrOptions;\n\n const HOC = (props: Without<P, 'clerk'>) => {\n useAssertWrappedByClerkProvider(displayName || 'withClerk');\n\n const clerk = useIsomorphicClerkContext();\n\n if (!clerk.loaded && !options?.renderWhileLoading) {\n return null;\n }\n\n return (\n <Component\n {...(props as P)}\n component={displayName}\n clerk={clerk}\n />\n );\n };\n HOC.displayName = `withClerk(${displayName})`;\n return HOC;\n};\n"],"mappings":";AACA,SAAS,yBAAyB;AAElC,IAAM,eAAe,kBAAkB,EAAE,aAAa,qBAAqB,CAAC;AASrE,SAAS,uBAAuB,SAA8B;AACnE,eAAa,YAAY,OAAO,EAAE,eAAe,OAAO;AAC1D;;;ACdA,SAAS,0BAA0B,wBAAwB;AAC3D,SAAS,yBAAyB;AASlC,SAAS,mBAAmB;;;ACV5B,SAAS,4BAA4B;AAsB9B,IAAM,CAAC,aAAa,cAAc,IAAI,qBAAuC,aAAa;;;ACtBjG,SAAS,sBAAsB,+BAA+B;AAIvD,IAAM,yBAAyB;AAC/B,IAAM,4BAA4B;;;ACHlC,IAAM,8BACX;AAEK,IAAM,oCAAoC,CAAC,SAChD,kDAAkD,IAAI;AAEjD,IAAM,oBACX;AAEK,IAAM,gDACX;AAEK,IAA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AAO;AAAA,IACL,UAAU;AAAA,IACV,QAAQ,OAAO;AAAA,IACf,WAAW,gBAAgB;AAAA,EAC7B;AACF;;;AChEA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;;;AChBP,OAAOC,YAAW;AAKX,IAAM,YAAY,CACvB,WACA,yBACG;AACH,QAAM,sBACJ,OAAO,yBAAyB,WAAW,uBAAuB,6DAAsB;AAC1F,QAAM,cAAc,uBAAuB,UAAU,eAAe,UAAU,QAAQ;AACtF,YAAU,cAAc;AAExB,QAAM,UAAU,OAAO,yBAAyB,WAAW,SAAY;AAEvE,QAAM,MAAM,CAAC,UAA+B;AAC1C,oCAAgC,eAAe,WAAW;AAE1D,UAAM,QAAQ,0BAA0B;AAExC,QAAI,CAAC,MAAM,UAAU,EAAC,mCAAS,qBAAoB;AACjD,aAAO;AAAA,IACT;AAEA,WACE,gBAAAC,OAAA;AAAA,MAAC;AAAA;AAAA,QACE,GAAI;AAAA,QACL,WAAW;AAAA,QACX;AAAA;AAAA,IACF;AAAA,EAEJ;AACA,MAAI,cAAc,aAAa,WAAW;AAC1C,SAAO;AACT;","names":["eventMethodCalled","eventMethodCalled","useClientContext","eventMethodCalled","useClientContext","eventMethodCalled","React","React"]}