@auth0/auth0-acul-react 1.0.0-alpha.0 → 1.0.0-alpha.2

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.
Files changed (42) hide show
  1. package/README.md +220 -19
  2. package/dist/export/getting-started.d.ts +9 -63
  3. package/dist/export/hooks.d.ts +1 -1
  4. package/dist/hooks/common/errors.d.ts +11 -11
  5. package/dist/hooks/common/errors.js +1 -1
  6. package/dist/hooks/common/errors.js.map +1 -1
  7. package/dist/hooks/index.d.ts +1 -0
  8. package/dist/hooks/utility/passkey-autofill.d.ts +86 -0
  9. package/dist/hooks/utility/passkey-autofill.js +2 -0
  10. package/dist/hooks/utility/passkey-autofill.js.map +1 -0
  11. package/dist/hooks/utility/polling-manager.d.ts +1 -0
  12. package/dist/hooks/utility/polling-manager.js.map +1 -1
  13. package/dist/hooks/utility/validate-password.js +1 -1
  14. package/dist/hooks/utility/validate-password.js.map +1 -1
  15. package/dist/hooks/utility/validate-username.js +1 -1
  16. package/dist/hooks/utility/validate-username.js.map +1 -1
  17. package/dist/screens/login-id.d.ts +1 -0
  18. package/dist/screens/login-id.js +1 -1
  19. package/dist/screens/login-id.js.map +1 -1
  20. package/dist/screens/login-password.d.ts +2 -1
  21. package/dist/screens/login-password.js +1 -1
  22. package/dist/screens/login-password.js.map +1 -1
  23. package/dist/screens/mfa-email-challenge.d.ts +2 -1
  24. package/dist/screens/mfa-email-challenge.js +1 -1
  25. package/dist/screens/mfa-email-challenge.js.map +1 -1
  26. package/dist/screens/mfa-login-options.d.ts +2 -1
  27. package/dist/screens/mfa-login-options.js +1 -1
  28. package/dist/screens/mfa-login-options.js.map +1 -1
  29. package/dist/screens/mfa-push-enrollment-qr.d.ts +1 -0
  30. package/dist/screens/mfa-push-enrollment-qr.js +1 -1
  31. package/dist/screens/mfa-push-enrollment-qr.js.map +1 -1
  32. package/dist/screens/phone-identifier-challenge.d.ts +2 -0
  33. package/dist/screens/phone-identifier-challenge.js +1 -1
  34. package/dist/screens/phone-identifier-challenge.js.map +1 -1
  35. package/dist/screens/signup-password.d.ts +2 -1
  36. package/dist/screens/signup-password.js +1 -1
  37. package/dist/screens/signup-password.js.map +1 -1
  38. package/dist/state/error-store.d.ts +4 -4
  39. package/dist/state/error-store.js +1 -1
  40. package/dist/state/error-store.js.map +1 -1
  41. package/dist/telemetry.js +1 -1
  42. package/package.json +9 -6
@@ -0,0 +1,86 @@
1
+ /**
2
+ * Result object returned by {@link usePasskeyAutofill}.
3
+ *
4
+ * Provides a ref that can be attached to the username `<input>` element
5
+ * to automatically enable browser Conditional UI (passkey autofill).
6
+ *
7
+ * @see {@link usePasskeyAutofill}
8
+ * @category Passkeys
9
+ * @public
10
+ */
11
+ export interface UsePasskeyAutofillResult {
12
+ /**
13
+ * A React ref that can be bound to the username `<input>` element.
14
+ *
15
+ * When attached, the SDK ensures the input’s `autocomplete`
16
+ * attribute is correctly set to `"username webauthn"`.
17
+ *
18
+ * If the developer already declared this attribute in markup,
19
+ * the ref is optional, the hook will still register Conditional
20
+ * Mediation correctly even without it.
21
+ */
22
+ inputRef: React.RefObject<HTMLInputElement>;
23
+ }
24
+ /**
25
+ * React hook that enables browser **Conditional UI** (passkey autofill)
26
+ * for the login identifier field on the `login-id` screen.
27
+ *
28
+ * ---
29
+ * ### Behavior
30
+ * - The hook automatically initializes the browser’s Conditional Mediation
31
+ * API (`navigator.credentials.get({ mediation: "conditional" })`),
32
+ * allowing passkeys stored on the user’s device to appear directly in
33
+ * the username field’s autocomplete dropdown.
34
+ * - It **fails silently** on unsupported browsers and **never blocks** user input.
35
+ * - The registration is performed once per page lifecycle.
36
+ *
37
+ * ---
38
+ * ### Using the returned `ref`
39
+ * The returned `inputRef` is **optional**.
40
+ * - If you bind it to your `<input>` element, the SDK will ensure the element’s
41
+ * `autocomplete` attribute is correctly set to `"username webauthn"`.
42
+ * - If your input element **already has**
43
+ * `autocomplete="username webauthn"` declared in markup,
44
+ * you can skip binding the `ref` entirely, the hook will still register
45
+ * Conditional Mediation correctly. See {@link UsePasskeyAutofillResult}
46
+ *
47
+ * ---
48
+ * ### Example
49
+ * ```tsx
50
+ * import { usePasskeyAutofill } from '@auth0/auth0-acul-react/login-id';
51
+ *
52
+ * export function LoginForm() {
53
+ * // Option 1: bind the ref for automatic attribute handling
54
+ * const { inputRef } = usePasskeyAutofill();
55
+ *
56
+ * return (
57
+ * <input
58
+ * ref={inputRef}
59
+ * id="username"
60
+ * placeholder="Username"
61
+ * autoComplete="username webauthn"
62
+ * />
63
+ * );
64
+ * }
65
+ *
66
+ * // Option 2: works equally well without using the ref
67
+ * export function LoginFormWithoutRef() {
68
+ * usePasskeyAutofill(); // just call the hook once
69
+ *
70
+ * return (
71
+ * <input
72
+ * id="username"
73
+ * placeholder="Username"
74
+ * autoComplete="username webauthn"
75
+ * />
76
+ * );
77
+ * }
78
+ * ```
79
+ *
80
+ * ---
81
+ * @supportedScreens
82
+ * - `login-id`
83
+ *
84
+ * @category Passkeys
85
+ */
86
+ export declare function usePasskeyAutofill(): UsePasskeyAutofillResult;
@@ -0,0 +1,2 @@
1
+ import{useRef as t,useLayoutEffect as e}from"react";import{getScreen as r}from"../../state/instance-store.js";const o="username webauthn";function n(){const n=r(),s=t(null),i=t(!1);return e(()=>{if(!i.current){i.current=!0;try{if(!n||"function"!=typeof n.registerPasskeyAutofill)return void console.warn("Passkey autofill unavailable: missing instance method");const t=s.current,e=t?.id;if(n.registerPasskeyAutofill(e),t){(t.getAttribute("autocomplete")??"").trim().toLowerCase()!==o&&t.setAttribute("autocomplete",o)}}catch(t){console.warn("usePasskeyAutofill failed:",t)}}},[n]),{inputRef:s}}export{n as usePasskeyAutofill};
2
+ //# sourceMappingURL=passkey-autofill.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"passkey-autofill.js","sources":["../../../src/hooks/utility/passkey-autofill.ts"],"sourcesContent":["import { useLayoutEffect, useRef } from 'react';\n\nimport { getScreen } from '../../state/instance-store';\n\nimport type { LoginIdMembers } from '@auth0/auth0-acul-js/login-id';\n\nconst REQUIRED_TOKENS = 'username webauthn';\n\n/**\n * Result object returned by {@link usePasskeyAutofill}.\n *\n * Provides a ref that can be attached to the username `<input>` element\n * to automatically enable browser Conditional UI (passkey autofill).\n *\n * @see {@link usePasskeyAutofill}\n * @category Passkeys\n * @public\n */\nexport interface UsePasskeyAutofillResult {\n /**\n * A React ref that can be bound to the username `<input>` element.\n *\n * When attached, the SDK ensures the input’s `autocomplete`\n * attribute is correctly set to `\"username webauthn\"`.\n *\n * If the developer already declared this attribute in markup,\n * the ref is optional, the hook will still register Conditional\n * Mediation correctly even without it.\n */\n inputRef: React.RefObject<HTMLInputElement>;\n}\n\n/**\n * React hook that enables browser **Conditional UI** (passkey autofill)\n * for the login identifier field on the `login-id` screen.\n *\n * ---\n * ### Behavior\n * - The hook automatically initializes the browser’s Conditional Mediation\n * API (`navigator.credentials.get({ mediation: \"conditional\" })`),\n * allowing passkeys stored on the user’s device to appear directly in\n * the username field’s autocomplete dropdown.\n * - It **fails silently** on unsupported browsers and **never blocks** user input.\n * - The registration is performed once per page lifecycle.\n *\n * ---\n * ### Using the returned `ref`\n * The returned `inputRef` is **optional**.\n * - If you bind it to your `<input>` element, the SDK will ensure the element’s\n * `autocomplete` attribute is correctly set to `\"username webauthn\"`.\n * - If your input element **already has**\n * `autocomplete=\"username webauthn\"` declared in markup,\n * you can skip binding the `ref` entirely, the hook will still register\n * Conditional Mediation correctly. See {@link UsePasskeyAutofillResult}\n *\n * ---\n * ### Example\n * ```tsx\n * import { usePasskeyAutofill } from '@auth0/auth0-acul-react/login-id';\n *\n * export function LoginForm() {\n * // Option 1: bind the ref for automatic attribute handling\n * const { inputRef } = usePasskeyAutofill();\n *\n * return (\n * <input\n * ref={inputRef}\n * id=\"username\"\n * placeholder=\"Username\"\n * autoComplete=\"username webauthn\"\n * />\n * );\n * }\n *\n * // Option 2: works equally well without using the ref\n * export function LoginFormWithoutRef() {\n * usePasskeyAutofill(); // just call the hook once\n *\n * return (\n * <input\n * id=\"username\"\n * placeholder=\"Username\"\n * autoComplete=\"username webauthn\"\n * />\n * );\n * }\n * ```\n *\n * ---\n * @supportedScreens\n * - `login-id`\n *\n * @category Passkeys\n */\nexport function usePasskeyAutofill(): UsePasskeyAutofillResult {\n const instance = getScreen<LoginIdMembers>();\n const inputRef = useRef<HTMLInputElement>(null);\n const initializedRef = useRef(false);\n\n useLayoutEffect(() => {\n if (initializedRef.current) return;\n initializedRef.current = true;\n\n try {\n if (!instance || typeof instance.registerPasskeyAutofill !== 'function') {\n console.warn('Passkey autofill unavailable: missing instance method');\n return;\n }\n\n const el = inputRef.current;\n const inputId = el?.id;\n\n // Fire-and-forget registration (fails silently)\n void instance.registerPasskeyAutofill(inputId);\n\n // Optionally correct the autocomplete attribute if the ref was used\n if (el) {\n const current = (el.getAttribute('autocomplete') ?? '').trim().toLowerCase();\n if (current !== REQUIRED_TOKENS) {\n el.setAttribute('autocomplete', REQUIRED_TOKENS);\n }\n }\n } catch (err) {\n console.warn('usePasskeyAutofill failed:', err);\n }\n }, [instance]);\n\n return { inputRef };\n}\n"],"names":["REQUIRED_TOKENS","usePasskeyAutofill","instance","getScreen","inputRef","useRef","initializedRef","useLayoutEffect","current","registerPasskeyAutofill","console","warn","el","inputId","id","getAttribute","trim","toLowerCase","setAttribute","err"],"mappings":"8GAMA,MAAMA,EAAkB,6BAwFRC,IACd,MAAMC,EAAWC,IACXC,EAAWC,EAAyB,MACpCC,EAAiBD,GAAO,GA8B9B,OA5BAE,EAAgB,KACd,IAAID,EAAeE,QAAnB,CACAF,EAAeE,SAAU,EAEzB,IACE,IAAKN,GAAwD,mBAArCA,EAASO,wBAE/B,YADAC,QAAQC,KAAK,yDAIf,MAAMC,EAAKR,EAASI,QACdK,EAAUD,GAAIE,GAMpB,GAHKZ,EAASO,wBAAwBI,GAGlCD,EAAI,EACWA,EAAGG,aAAa,iBAAmB,IAAIC,OAAOC,gBAC/CjB,GACdY,EAAGM,aAAa,eAAgBlB,EAEpC,CACF,CAAE,MAAOmB,GACPT,QAAQC,KAAK,6BAA8BQ,EAC7C,CAxB4B,GAyB3B,CAACjB,IAEG,CAAEE,WACX"}
@@ -52,6 +52,7 @@ export interface MfaPollingResult {
52
52
  *@supportedScreens
53
53
  * - `mfa-push-challenge-push`
54
54
  * - `reset-password-mfa-push-challenge-push`
55
+ * - `mfa-push-enrollment-qr`
55
56
  *
56
57
  * @returns object {@link MfaPollingResult} containing:
57
58
  * - `isRunning` — `true` while polling is active.
@@ -1 +1 @@
1
- {"version":3,"file":"polling-manager.js","sources":["../../../src/hooks/utility/polling-manager.ts"],"sourcesContent":["import { useCallback, useEffect, useMemo, useRef, useState } from 'react';\n\nimport { getScreen } from '../../state/instance-store';\nimport { errorManager } from '../common/errors';\n\nimport type {\n MfaPollingOptions,\n MfaPushPollingControl,\n Error as ULError,\n} from '@auth0/auth0-acul-js';\n\n/**\n * Result object returned by {@link useMfaPolling}.\n *\n * @public\n */\nexport interface MfaPollingResult {\n /**\n * Indicates whether the MFA push polling process is currently active.\n *\n * - `true` — Polling is running and awaiting completion.\n * - `false` — Polling has stopped, either due to completion,\n * manual cancellation, or component unmount.\n */\n isRunning: boolean;\n\n /**\n * Starts or resumes the polling process.\n *\n * - If polling is already active, this call has no effect.\n * - If previously stopped, calling this restarts the polling loop.\n */\n startPolling: () => void;\n\n /**\n * Stops the polling process immediately.\n *\n * - Cancels any scheduled timers or in-flight requests.\n * - Safe to call multiple times; subsequent calls have no effect.\n */\n stopPolling: () => void;\n}\n\n/**\n * React hook to manage MFA push polling (e.g., waiting for a push notification approval)\n * on an Auth0 Advanced Customization of Universal Login (ACUL) screen.\n *\n * This hook sets up and controls a long-running polling loop that repeatedly checks\n * the MFA push challenge endpoint until one of the following occurs:\n *\n * - The challenge is **approved or denied** by the user, triggering `options.onCompleted`.\n * - An **error** occurs (network error, non-200/429 response), triggering `options.onError`.\n * - The **component unmounts** or `stopPolling()` is called, which cancels polling.\n *\n * ### Key Features\n * - `isRunning` is **reactive** — it updates automatically if the polling loop\n * stops internally or is canceled.\n * - Uses a **stable single polling instance** (`useRef`) to prevent\n * duplicate network calls and unintended restarts during React re-renders.\n * - **Automatic cleanup** on unmount: no orphan timers or leaked XHR requests.\n *\n * @param options - {@link MfaPollingOptions} specifying the polling interval,\n * success callback (`onCompleted`), and optional error handler (`onError`).\n *\n *@supportedScreens\n * - `mfa-push-challenge-push`\n * - `reset-password-mfa-push-challenge-push`\n *\n * @returns object {@link MfaPollingResult} containing:\n * - `isRunning` — `true` while polling is active.\n * - `startPolling()` — starts or resumes polling.\n * - `stopPolling()` — stops polling immediately.\n *\n * @example\n * ```tsx\n * import { useMfaPolling } from '@auth0/auth0-acul-react/mfa-push-challenge-push';\n *\n * export function MfaPushStatus() {\n * const { isRunning, startPolling, stopPolling } = useMfaPolling({\n * intervalMs: 5000,\n * onCompleted: () => console.log('Push approved!/denied'),\n * onError: (error) => console.error('Polling error:', error)\n * });\n *\n * return (\n * <div>\n * <button onClick={startPolling} disabled={isRunning}>\n * {isRunning ? 'Waiting for approval…' : 'Start MFA Polling'}\n * </button>\n * {isRunning && <button onClick={stopPolling}>Cancel</button>}\n * </div>\n * );\n * }\n * ```\n *\n * @remarks\n * - The `onError` callback receives an {@link ULError} object\n * with `status` and `responseText` describing the server response.\n * - Internal rate-limit responses (`429`) are automatically handled:\n * polling waits for the reset window before retrying.\n * - Calling `startPolling()` repeatedly while running is safe and idempotent.\n *\n * @public\n */\nexport function useMfaPolling(options?: MfaPollingOptions): MfaPollingResult {\n const [isRunning, setIsRunning] = useState(false);\n\n // Wrap callbacks safely to immediately update `isRunning` on completion/error.\n const wrappedOptions: MfaPollingOptions = useMemo(() => {\n const safe = options ?? {};\n return {\n ...safe,\n onCompleted: () => {\n setIsRunning(false);\n safe.onCompleted?.();\n },\n onError: (error: ULError) => {\n setIsRunning(false);\n errorManager.pushServerErrors([error]);\n safe.onError?.(error);\n },\n };\n }, [options]);\n\n // Stable screen instance\n const screen = useMemo(\n () => getScreen<{ pollingManager: (o: MfaPollingOptions) => MfaPushPollingControl }>(),\n []\n );\n\n // Single polling control instance per component\n const pollingControlRef = useRef<MfaPushPollingControl | null>(null);\n if (pollingControlRef.current === null) {\n pollingControlRef.current = screen.pollingManager(wrappedOptions);\n }\n const pollingControl = pollingControlRef.current;\n\n const startPolling = useCallback(() => {\n pollingControl.startPolling();\n setIsRunning(true);\n }, [pollingControl]);\n\n const stopPolling = useCallback(() => {\n pollingControl.stopPolling();\n setIsRunning(false);\n }, [pollingControl]);\n\n // One effect handles cleanup and state sync\n useEffect(() => {\n let mounted = true;\n\n const tick = () => {\n if (!mounted) {\n return;\n }\n const running = pollingControl.isRunning();\n setIsRunning(running);\n if (running) {\n requestAnimationFrame(tick);\n }\n };\n tick();\n\n return () => {\n mounted = false;\n pollingControl.stopPolling();\n };\n }, [pollingControl]);\n\n return { isRunning, startPolling, stopPolling };\n}\n\nexport type { MfaPollingOptions, ULError };\n"],"names":["useMfaPolling","options","isRunning","setIsRunning","useState","wrappedOptions","useMemo","safe","onCompleted","onError","error","errorManager","pushServerErrors","screen","getScreen","pollingControlRef","useRef","current","pollingManager","pollingControl","startPolling","useCallback","stopPolling","useEffect","mounted","tick","running","requestAnimationFrame"],"mappings":"uMAwGM,SAAUA,EAAcC,GAC5B,MAAOC,EAAWC,GAAgBC,GAAS,GAGrCC,EAAoCC,EAAQ,KAChD,MAAMC,EAAON,GAAW,CAAA,EACxB,MAAO,IACFM,EACHC,YAAa,KACXL,GAAa,GACbI,EAAKC,iBAEPC,QAAUC,IACRP,GAAa,GACbQ,EAAaC,iBAAiB,CAACF,IAC/BH,EAAKE,UAAUC,MAGlB,CAACT,IAGEY,EAASP,EACb,IAAMQ,IACN,IAIIC,EAAoBC,EAAqC,MAC7B,OAA9BD,EAAkBE,UACpBF,EAAkBE,QAAUJ,EAAOK,eAAeb,IAEpD,MAAMc,EAAiBJ,EAAkBE,QAEnCG,EAAeC,EAAY,KAC/BF,EAAeC,eACfjB,GAAa,IACZ,CAACgB,IAEEG,EAAcD,EAAY,KAC9BF,EAAeG,cACfnB,GAAa,IACZ,CAACgB,IAwBJ,OArBAI,EAAU,KACR,IAAIC,GAAU,EAEd,MAAMC,EAAO,KACX,IAAKD,EACH,OAEF,MAAME,EAAUP,EAAejB,YAC/BC,EAAauB,GACTA,GACFC,sBAAsBF,IAK1B,OAFAA,IAEO,KACLD,GAAU,EACVL,EAAeG,gBAEhB,CAACH,IAEG,CAAEjB,YAAWkB,eAAcE,cACpC"}
1
+ {"version":3,"file":"polling-manager.js","sources":["../../../src/hooks/utility/polling-manager.ts"],"sourcesContent":["import { useCallback, useEffect, useMemo, useRef, useState } from 'react';\n\nimport { getScreen } from '../../state/instance-store';\nimport { errorManager } from '../common/errors';\n\nimport type {\n MfaPollingOptions,\n MfaPushPollingControl,\n Error as ULError,\n} from '@auth0/auth0-acul-js';\n\n/**\n * Result object returned by {@link useMfaPolling}.\n *\n * @public\n */\nexport interface MfaPollingResult {\n /**\n * Indicates whether the MFA push polling process is currently active.\n *\n * - `true` — Polling is running and awaiting completion.\n * - `false` — Polling has stopped, either due to completion,\n * manual cancellation, or component unmount.\n */\n isRunning: boolean;\n\n /**\n * Starts or resumes the polling process.\n *\n * - If polling is already active, this call has no effect.\n * - If previously stopped, calling this restarts the polling loop.\n */\n startPolling: () => void;\n\n /**\n * Stops the polling process immediately.\n *\n * - Cancels any scheduled timers or in-flight requests.\n * - Safe to call multiple times; subsequent calls have no effect.\n */\n stopPolling: () => void;\n}\n\n/**\n * React hook to manage MFA push polling (e.g., waiting for a push notification approval)\n * on an Auth0 Advanced Customization of Universal Login (ACUL) screen.\n *\n * This hook sets up and controls a long-running polling loop that repeatedly checks\n * the MFA push challenge endpoint until one of the following occurs:\n *\n * - The challenge is **approved or denied** by the user, triggering `options.onCompleted`.\n * - An **error** occurs (network error, non-200/429 response), triggering `options.onError`.\n * - The **component unmounts** or `stopPolling()` is called, which cancels polling.\n *\n * ### Key Features\n * - `isRunning` is **reactive** — it updates automatically if the polling loop\n * stops internally or is canceled.\n * - Uses a **stable single polling instance** (`useRef`) to prevent\n * duplicate network calls and unintended restarts during React re-renders.\n * - **Automatic cleanup** on unmount: no orphan timers or leaked XHR requests.\n *\n * @param options - {@link MfaPollingOptions} specifying the polling interval,\n * success callback (`onCompleted`), and optional error handler (`onError`).\n *\n *@supportedScreens\n * - `mfa-push-challenge-push`\n * - `reset-password-mfa-push-challenge-push`\n * - `mfa-push-enrollment-qr`\n *\n * @returns object {@link MfaPollingResult} containing:\n * - `isRunning` — `true` while polling is active.\n * - `startPolling()` — starts or resumes polling.\n * - `stopPolling()` — stops polling immediately.\n *\n * @example\n * ```tsx\n * import { useMfaPolling } from '@auth0/auth0-acul-react/mfa-push-challenge-push';\n *\n * export function MfaPushStatus() {\n * const { isRunning, startPolling, stopPolling } = useMfaPolling({\n * intervalMs: 5000,\n * onCompleted: () => console.log('Push approved!/denied'),\n * onError: (error) => console.error('Polling error:', error)\n * });\n *\n * return (\n * <div>\n * <button onClick={startPolling} disabled={isRunning}>\n * {isRunning ? 'Waiting for approval…' : 'Start MFA Polling'}\n * </button>\n * {isRunning && <button onClick={stopPolling}>Cancel</button>}\n * </div>\n * );\n * }\n * ```\n *\n * @remarks\n * - The `onError` callback receives an {@link ULError} object\n * with `status` and `responseText` describing the server response.\n * - Internal rate-limit responses (`429`) are automatically handled:\n * polling waits for the reset window before retrying.\n * - Calling `startPolling()` repeatedly while running is safe and idempotent.\n *\n * @public\n */\nexport function useMfaPolling(options?: MfaPollingOptions): MfaPollingResult {\n const [isRunning, setIsRunning] = useState(false);\n\n // Wrap callbacks safely to immediately update `isRunning` on completion/error.\n const wrappedOptions: MfaPollingOptions = useMemo(() => {\n const safe = options ?? {};\n return {\n ...safe,\n onCompleted: () => {\n setIsRunning(false);\n safe.onCompleted?.();\n },\n onError: (error: ULError) => {\n setIsRunning(false);\n errorManager.pushServerErrors([error]);\n safe.onError?.(error);\n },\n };\n }, [options]);\n\n // Stable screen instance\n const screen = useMemo(\n () => getScreen<{ pollingManager: (o: MfaPollingOptions) => MfaPushPollingControl }>(),\n []\n );\n\n // Single polling control instance per component\n const pollingControlRef = useRef<MfaPushPollingControl | null>(null);\n if (pollingControlRef.current === null) {\n pollingControlRef.current = screen.pollingManager(wrappedOptions);\n }\n const pollingControl = pollingControlRef.current;\n\n const startPolling = useCallback(() => {\n pollingControl.startPolling();\n setIsRunning(true);\n }, [pollingControl]);\n\n const stopPolling = useCallback(() => {\n pollingControl.stopPolling();\n setIsRunning(false);\n }, [pollingControl]);\n\n // One effect handles cleanup and state sync\n useEffect(() => {\n let mounted = true;\n\n const tick = () => {\n if (!mounted) {\n return;\n }\n const running = pollingControl.isRunning();\n setIsRunning(running);\n if (running) {\n requestAnimationFrame(tick);\n }\n };\n tick();\n\n return () => {\n mounted = false;\n pollingControl.stopPolling();\n };\n }, [pollingControl]);\n\n return { isRunning, startPolling, stopPolling };\n}\n\nexport type { MfaPollingOptions, ULError };\n"],"names":["useMfaPolling","options","isRunning","setIsRunning","useState","wrappedOptions","useMemo","safe","onCompleted","onError","error","errorManager","pushServerErrors","screen","getScreen","pollingControlRef","useRef","current","pollingManager","pollingControl","startPolling","useCallback","stopPolling","useEffect","mounted","tick","running","requestAnimationFrame"],"mappings":"uMAyGM,SAAUA,EAAcC,GAC5B,MAAOC,EAAWC,GAAgBC,GAAS,GAGrCC,EAAoCC,EAAQ,KAChD,MAAMC,EAAON,GAAW,CAAA,EACxB,MAAO,IACFM,EACHC,YAAa,KACXL,GAAa,GACbI,EAAKC,iBAEPC,QAAUC,IACRP,GAAa,GACbQ,EAAaC,iBAAiB,CAACF,IAC/BH,EAAKE,UAAUC,MAGlB,CAACT,IAGEY,EAASP,EACb,IAAMQ,IACN,IAIIC,EAAoBC,EAAqC,MAC7B,OAA9BD,EAAkBE,UACpBF,EAAkBE,QAAUJ,EAAOK,eAAeb,IAEpD,MAAMc,EAAiBJ,EAAkBE,QAEnCG,EAAeC,EAAY,KAC/BF,EAAeC,eACfjB,GAAa,IACZ,CAACgB,IAEEG,EAAcD,EAAY,KAC9BF,EAAeG,cACfnB,GAAa,IACZ,CAACgB,IAwBJ,OArBAI,EAAU,KACR,IAAIC,GAAU,EAEd,MAAMC,EAAO,KACX,IAAKD,EACH,OAEF,MAAME,EAAUP,EAAejB,YAC/BC,EAAauB,GACTA,GACFC,sBAAsBF,IAK1B,OAFAA,IAEO,KACLD,GAAU,EACVL,EAAeG,gBAEhB,CAACH,IAEG,CAAEjB,YAAWkB,eAAcE,cACpC"}
@@ -1,2 +1,2 @@
1
- import{useMemo as r}from"react";import{getScreen as e}from"../../state/instance-store.js";import{errorManager as s}from"../common/errors.js";function o(o,t){return r(()=>{const r=e().validatePassword(o);return t?.includeInErrors&&s.replaceClientErrors(r.isValid?[]:[{code:"password-policy-error",field:"password",message:"The password does not meet the required criteria.",rules:r.results}],{byField:"password"}),r},[o,t?.includeInErrors])}export{o as usePasswordValidation};
1
+ import{useMemo as r}from"react";import{getScreen as e}from"../../state/instance-store.js";import{errorManager as o}from"../common/errors.js";function s(s,t){return r(()=>{const r=e().validatePassword(s);return t?.includeInErrors&&o.replaceValidationErrors(r.isValid?[]:[{code:"password-policy-error",field:"password",message:"The password does not meet the required criteria.",rules:r.results}],{byField:"password"}),r},[s,t?.includeInErrors])}export{s as usePasswordValidation};
2
2
  //# sourceMappingURL=validate-password.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"validate-password.js","sources":["../../../src/hooks/utility/validate-password.ts"],"sourcesContent":["import { useMemo } from 'react';\n\nimport { getScreen } from '../../state/instance-store';\nimport { errorManager } from '../common/errors';\n\nimport type { PasswordValidationResult } from '@auth0/auth0-acul-js';\n\ninterface WithValidatePassword {\n validatePassword: (password: string) => PasswordValidationResult;\n}\n\n/**\n * This React hook validates a password against the current Auth0 password policy\n * and returns a structured result describing whether the password satisfies each rule.\n *\n * Optionally, it can send the validation results to the global error manager so that\n * form error components can update automatically.\n *\n * @supportedScreens\n * - `signup`\n * - `signup-password`\n * - `reset-password`\n *\n * @param password\n * - The password to validate.\n * @param options.includeInErrors\n * - If `true`, validation errors are stored in the global error manager under the `password` field. Defaults to `false`.\n *\n * @returns A {@link PasswordValidationResult} object containing:\n * - `isValid` — `true` if the password satisfies all configured rules.\n * - `results` — an array of per-rule results with `code`, `label`, `status`, and `isValid`.\n *\n * @example This example shows how to use the hook in a functional component on \"signup\" screen.\n * ```tsx\n * import { usePasswordValidation } from '@auth0/auth0-acul-react/signup';\n * const { isValid, results} = usePasswordValidation(password, { includeInErrors: true });\n *\n * if (!isValid) {\n * console.log(results);\n * }\n * ```\n */\nexport function usePasswordValidation(\n password: string,\n options?: { includeInErrors?: boolean }\n): PasswordValidationResult {\n return useMemo(() => {\n const instance = getScreen<WithValidatePassword>();\n const validation = instance.validatePassword(password);\n\n if (options?.includeInErrors) {\n errorManager.replaceClientErrors(\n validation.isValid\n ? []\n : [\n {\n code: 'password-policy-error',\n field: 'password',\n message: 'The password does not meet the required criteria.',\n rules: validation.results,\n },\n ],\n { byField: 'password' }\n );\n }\n\n return validation;\n }, [password, options?.includeInErrors]);\n}\n\nexport { PasswordValidationResult, PasswordComplexityRule } from '@auth0/auth0-acul-js';\n"],"names":["usePasswordValidation","password","options","useMemo","validation","getScreen","validatePassword","includeInErrors","errorManager","replaceClientErrors","isValid","code","field","message","rules","results","byField"],"mappings":"6IA0CM,SAAUA,EACdC,EACAC,GAEA,OAAOC,EAAQ,KACb,MACMC,EADWC,IACWC,iBAAiBL,GAkB7C,OAhBIC,GAASK,iBACXC,EAAaC,oBACXL,EAAWM,QACP,GACA,CACE,CACEC,KAAM,wBACNC,MAAO,WACPC,QAAS,oDACTC,MAAOV,EAAWW,UAG1B,CAAEC,QAAS,aAIRZ,GACN,CAACH,EAAUC,GAASK,iBACzB"}
1
+ {"version":3,"file":"validate-password.js","sources":["../../../src/hooks/utility/validate-password.ts"],"sourcesContent":["import { useMemo } from 'react';\n\nimport { getScreen } from '../../state/instance-store';\nimport { errorManager } from '../common/errors';\n\nimport type { PasswordValidationResult } from '@auth0/auth0-acul-js';\n\ninterface WithValidatePassword {\n validatePassword: (password: string) => PasswordValidationResult;\n}\n\n/**\n * This React hook validates a password against the current Auth0 password policy\n * and returns a structured result describing whether the password satisfies each rule.\n *\n * Optionally, it can send the validation results to the global error manager so that\n * form error components can update automatically.\n *\n * @supportedScreens\n * - `signup`\n * - `signup-password`\n * - `reset-password`\n *\n * @param password\n * - The password to validate.\n * @param options.includeInErrors\n * - If `true`, validation errors are stored in the global error manager under the `password` field. Defaults to `false`.\n *\n * @returns A {@link PasswordValidationResult} object containing:\n * - `isValid` — `true` if the password satisfies all configured rules.\n * - `results` — an array of per-rule results with `code`, `label`, `status`, and `isValid`.\n *\n * @example This example shows how to use the hook in a functional component on \"signup\" screen.\n * ```tsx\n * import { usePasswordValidation } from '@auth0/auth0-acul-react/signup';\n * const { isValid, results} = usePasswordValidation(password, { includeInErrors: true });\n *\n * if (!isValid) {\n * console.log(results);\n * }\n * ```\n */\nexport function usePasswordValidation(\n password: string,\n options?: { includeInErrors?: boolean }\n): PasswordValidationResult {\n return useMemo(() => {\n const instance = getScreen<WithValidatePassword>();\n const validation = instance.validatePassword(password);\n\n if (options?.includeInErrors) {\n errorManager.replaceValidationErrors(\n validation.isValid\n ? []\n : [\n {\n code: 'password-policy-error',\n field: 'password',\n message: 'The password does not meet the required criteria.',\n rules: validation.results,\n },\n ],\n { byField: 'password' }\n );\n }\n\n return validation;\n }, [password, options?.includeInErrors]);\n}\n\nexport { PasswordValidationResult, PasswordComplexityRule } from '@auth0/auth0-acul-js';\n"],"names":["usePasswordValidation","password","options","useMemo","validation","getScreen","validatePassword","includeInErrors","errorManager","replaceValidationErrors","isValid","code","field","message","rules","results","byField"],"mappings":"6IA0CM,SAAUA,EACdC,EACAC,GAEA,OAAOC,EAAQ,KACb,MACMC,EADWC,IACWC,iBAAiBL,GAkB7C,OAhBIC,GAASK,iBACXC,EAAaC,wBACXL,EAAWM,QACP,GACA,CACE,CACEC,KAAM,wBACNC,MAAO,WACPC,QAAS,oDACTC,MAAOV,EAAWW,UAG1B,CAAEC,QAAS,aAIRZ,GACN,CAACH,EAAUC,GAASK,iBACzB"}
@@ -1,2 +1,2 @@
1
- import{useMemo as r}from"react";import{getScreen as e}from"../../state/instance-store.js";import{errorManager as o}from"../common/errors.js";function s(s,n){return r(()=>{const r=e().validateUsername(s);return n?.includeInErrors&&o.replaceClientErrors(r.errors,{byField:"username"}),{isValid:r.isValid,errors:r.errors}},[s,n?.includeInErrors])}export{s as useUsernameValidation};
1
+ import{useMemo as r}from"react";import{getScreen as e}from"../../state/instance-store.js";import{errorManager as o}from"../common/errors.js";function s(s,i){return r(()=>{const r=e().validateUsername(s);return i?.includeInErrors&&o.replaceValidationErrors(r.errors,{byField:"username"}),{isValid:r.isValid,errors:r.errors}},[s,i?.includeInErrors])}export{s as useUsernameValidation};
2
2
  //# sourceMappingURL=validate-username.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"validate-username.js","sources":["../../../src/hooks/utility/validate-username.ts"],"sourcesContent":["import { useMemo } from 'react';\n\nimport { getScreen } from '../../state/instance-store';\nimport { errorManager } from '../common/errors';\n\nimport type { UsernameValidationResult } from '@auth0/auth0-acul-js';\n\ninterface WithValidateUsername {\n validateUsername: (username: string) => UsernameValidationResult;\n}\n\n/**\n * React hook for validating a username against the current Auth0 username policy.\n *\n * This hook checks the provided username against all configured validation rules\n * and returns a structured result describing whether it passes.\n * Optionally, it can send validation errors to the global error manager so that\n * UI components observing the `username` field can automatically display or react\n * to these errors.\n *\n * @supportedScreens\n * - `signup`\n * - `signup-id`\n *\n * @param username - The username string to validate.\n * @param options.includeInErrors - When `true`, validation errors are stored in the\n * global error manager under the `username` field. Defaults to `false`.\n *\n * @returns A {@link UsernameValidationResult} object with:\n * - `isValid` — `true` if the username satisfies all configured rules.\n * - `errors` — an array of per-rule validation errors with `code`, `message`, and `isValid`.\n *\n * @example\n * ```tsx\n * import { useUsernameValidation } from \"@auth0/auth0-acul-react/signup\";\n *\n * export function UsernameField() {\n * const { isValid, errors } = useUsernameValidation(username, { includeInErrors: true });\n *\n * return (\n * <div>\n * <input\n * value={username}\n * onChange={e => setUsername(e.target.value)}\n * aria-invalid={!isValid}\n * />\n *\n * {!isValid && (\n * <ul>\n * {errors.map(err => (\n * <li key={err.code}>{err.message}</li>\n * ))}\n * </ul>\n * )}\n * </div>\n * );\n * }\n * ```\n *\n * @remarks\n * - When `includeInErrors` is enabled, the hook automatically updates the errors to the error-store\n * which can be consumed by `useErrors` hook.\n * - The hook only recomputes when `username` or `options.includeInErrors` change.\n */\nexport function useUsernameValidation(\n username: string,\n options?: { includeInErrors?: boolean }\n): UsernameValidationResult {\n return useMemo(() => {\n const instance = getScreen<WithValidateUsername>();\n const result = instance.validateUsername(username);\n\n if (options?.includeInErrors) {\n errorManager.replaceClientErrors(result.errors, { byField: 'username' });\n }\n\n return { isValid: result.isValid, errors: result.errors };\n }, [username, options?.includeInErrors]);\n}\n\nexport type { UsernameValidationResult, UsernameValidationError } from '@auth0/auth0-acul-js';\n"],"names":["useUsernameValidation","username","options","useMemo","result","getScreen","validateUsername","includeInErrors","errorManager","replaceClientErrors","errors","byField","isValid"],"mappings":"6IAgEM,SAAUA,EACdC,EACAC,GAEA,OAAOC,EAAQ,KACb,MACMC,EADWC,IACOC,iBAAiBL,GAMzC,OAJIC,GAASK,iBACXC,EAAaC,oBAAoBL,EAAOM,OAAQ,CAAEC,QAAS,aAGtD,CAAEC,QAASR,EAAOQ,QAASF,OAAQN,EAAOM,SAChD,CAACT,EAAUC,GAASK,iBACzB"}
1
+ {"version":3,"file":"validate-username.js","sources":["../../../src/hooks/utility/validate-username.ts"],"sourcesContent":["import { useMemo } from 'react';\n\nimport { getScreen } from '../../state/instance-store';\nimport { errorManager } from '../common/errors';\n\nimport type { UsernameValidationResult } from '@auth0/auth0-acul-js';\n\ninterface WithValidateUsername {\n validateUsername: (username: string) => UsernameValidationResult;\n}\n\n/**\n * React hook for validating a username against the current Auth0 username policy.\n *\n * This hook checks the provided username against all configured validation rules\n * and returns a structured result describing whether it passes.\n * Optionally, it can send validation errors to the global error manager so that\n * UI components observing the `username` field can automatically display or react\n * to these errors.\n *\n * @supportedScreens\n * - `signup`\n * - `signup-id`\n *\n * @param username - The username string to validate.\n * @param options.includeInErrors - When `true`, validation errors are stored in the\n * global error manager under the `username` field. Defaults to `false`.\n *\n * @returns A {@link UsernameValidationResult} object with:\n * - `isValid` — `true` if the username satisfies all configured rules.\n * - `errors` — an array of per-rule validation errors with `code`, `message`, and `isValid`.\n *\n * @example\n * ```tsx\n * import { useUsernameValidation } from \"@auth0/auth0-acul-react/signup\";\n *\n * export function UsernameField() {\n * const { isValid, errors } = useUsernameValidation(username, { includeInErrors: true });\n *\n * return (\n * <div>\n * <input\n * value={username}\n * onChange={e => setUsername(e.target.value)}\n * aria-invalid={!isValid}\n * />\n *\n * {!isValid && (\n * <ul>\n * {errors.map(err => (\n * <li key={err.code}>{err.message}</li>\n * ))}\n * </ul>\n * )}\n * </div>\n * );\n * }\n * ```\n *\n * @remarks\n * - When `includeInErrors` is enabled, the hook automatically updates the errors to the error-store\n * which can be consumed by `useErrors` hook.\n * - The hook only recomputes when `username` or `options.includeInErrors` change.\n */\nexport function useUsernameValidation(\n username: string,\n options?: { includeInErrors?: boolean }\n): UsernameValidationResult {\n return useMemo(() => {\n const instance = getScreen<WithValidateUsername>();\n const result = instance.validateUsername(username);\n\n if (options?.includeInErrors) {\n errorManager.replaceValidationErrors(result.errors, { byField: 'username' });\n }\n\n return { isValid: result.isValid, errors: result.errors };\n }, [username, options?.includeInErrors]);\n}\n\nexport type { UsernameValidationResult, UsernameValidationError } from '@auth0/auth0-acul-js';\n"],"names":["useUsernameValidation","username","options","useMemo","result","getScreen","validateUsername","includeInErrors","errorManager","replaceValidationErrors","errors","byField","isValid"],"mappings":"6IAgEM,SAAUA,EACdC,EACAC,GAEA,OAAOC,EAAQ,KACb,MACMC,EADWC,IACOC,iBAAiBL,GAMzC,OAJIC,GAASK,iBACXC,EAAaC,wBAAwBL,EAAOM,OAAQ,CAAEC,QAAS,aAG1D,CAAEC,QAASR,EAAOQ,QAASF,OAAQN,EAAOM,SAChD,CAACT,EAAUC,GAASK,iBACzB"}
@@ -5,5 +5,6 @@ export declare const federatedLogin: (payload: FederatedLoginOptions) => void |
5
5
  export declare const passkeyLogin: (payload?: CustomOptions) => void | Promise<void>;
6
6
  export declare const pickCountryCode: (payload?: CustomOptions) => void | Promise<void>;
7
7
  export { useLoginIdentifiers } from '../hooks/utility/login-identifiers';
8
+ export { usePasskeyAutofill } from '../hooks/utility/passkey-autofill';
8
9
  export { useCurrentScreen, useErrors, useAuth0Themes, type UseErrorOptions, type UseErrorsResult, type ErrorsResult, type ErrorKind, } from '../hooks';
9
10
  export declare const useLoginId: () => LoginIdMembers;
@@ -1,2 +1,2 @@
1
- import o from"@auth0/auth0-acul-js/login-id";import{useMemo as e}from"react";export{useAuth0Themes}from"../hooks/common/auth0-themes.js";export{useCurrentScreen}from"../hooks/common/current-screen.js";import{errorManager as r}from"../hooks/common/errors.js";export{useErrors}from"../hooks/common/errors.js";import{ContextHooks as s}from"../hooks/context/index.js";export{useLoginIdentifiers}from"../hooks/utility/login-identifiers.js";import{registerScreen as t}from"../state/instance-store.js";const n=t(o),{withError:i}=r,m=new s(n),{useUser:u,useTenant:a,useBranding:c,useClient:h,useOrganization:p,usePrompt:f,useScreen:d,useTransaction:g,useUntrustedData:j}=m,k=o=>i(n.login(o)),x=o=>i(n.federatedLogin(o)),l=o=>i(n.passkeyLogin(o)),C=o=>i(n.pickCountryCode(o)),y=()=>e(()=>n,[]);export{x as federatedLogin,k as login,l as passkeyLogin,C as pickCountryCode,c as useBranding,h as useClient,y as useLoginId,p as useOrganization,f as usePrompt,d as useScreen,a as useTenant,g as useTransaction,j as useUntrustedData,u as useUser};
1
+ import o from"@auth0/auth0-acul-js/login-id";import{useMemo as e}from"react";export{useAuth0Themes}from"../hooks/common/auth0-themes.js";export{useCurrentScreen}from"../hooks/common/current-screen.js";import{errorManager as r}from"../hooks/common/errors.js";export{useErrors}from"../hooks/common/errors.js";import{ContextHooks as s}from"../hooks/context/index.js";export{useLoginIdentifiers}from"../hooks/utility/login-identifiers.js";import{registerScreen as t}from"../state/instance-store.js";export{usePasskeyAutofill}from"../hooks/utility/passkey-autofill.js";const n=t(o),{withError:i}=r,u=new s(n),{useUser:m,useTenant:a,useBranding:c,useClient:f,useOrganization:p,usePrompt:h,useScreen:k,useTransaction:l,useUntrustedData:d}=u,j=o=>i(n.login(o)),g=o=>i(n.federatedLogin(o)),x=o=>i(n.passkeyLogin(o)),y=o=>i(n.pickCountryCode(o)),C=()=>e(()=>n,[]);export{g as federatedLogin,j as login,x as passkeyLogin,y as pickCountryCode,c as useBranding,f as useClient,C as useLoginId,p as useOrganization,h as usePrompt,k as useScreen,a as useTenant,l as useTransaction,d as useUntrustedData,m as useUser};
2
2
  //# sourceMappingURL=login-id.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"login-id.js","sources":["../../src/screens/login-id.tsx"],"sourcesContent":["import LoginId from '@auth0/auth0-acul-js/login-id';\nimport { useMemo } from 'react';\n\nimport { ContextHooks } from '../hooks';\nimport { errorManager } from '../hooks';\nimport { registerScreen } from '../state/instance-store';\n\nimport type {\n LoginIdMembers,\n LoginOptions,\n FederatedLoginOptions,\n CustomOptions,\n} from '@auth0/auth0-acul-js/login-id';\n\n// Register the singleton instance of LoginId\nconst instance = registerScreen<LoginIdMembers>(LoginId)!;\n\n// Error wrapper\nconst { withError } = errorManager;\n\n// Context hooks\nconst factory = new ContextHooks<LoginIdMembers>(instance);\nexport const {\n useUser,\n useTenant,\n useBranding,\n useClient,\n useOrganization,\n usePrompt,\n useScreen,\n useTransaction,\n useUntrustedData,\n} = factory;\n\n// Submit functions\nexport const login = (payload: LoginOptions) => withError(instance.login(payload));\nexport const federatedLogin = (payload: FederatedLoginOptions) =>\n withError(instance.federatedLogin(payload));\nexport const passkeyLogin = (payload?: CustomOptions) => withError(instance.passkeyLogin(payload));\nexport const pickCountryCode = (payload?: CustomOptions) =>\n withError(instance.pickCountryCode(payload));\n\n// Utility Hooks\nexport { useLoginIdentifiers } from '../hooks/utility/login-identifiers';\n\n// Common hooks\nexport {\n useCurrentScreen,\n useErrors,\n useAuth0Themes,\n type UseErrorOptions,\n type UseErrorsResult,\n type ErrorsResult,\n type ErrorKind,\n} from '../hooks';\n\n// Main instance hook. Returns singleton instance of LoginId\nexport const useLoginId = (): LoginIdMembers => useMemo(() => instance, []);\n\n// Export all types from the core SDK for this screen\n"],"names":["instance","registerScreen","LoginId","withError","errorManager","factory","ContextHooks","useUser","useTenant","useBranding","useClient","useOrganization","usePrompt","useScreen","useTransaction","useUntrustedData","login","payload","federatedLogin","passkeyLogin","pickCountryCode","useLoginId","useMemo"],"mappings":"+eAeA,MAAMA,EAAWC,EAA+BC,IAG1CC,UAAEA,GAAcC,EAGhBC,EAAU,IAAIC,EAA6BN,IACpCO,QACXA,EAAOC,UACPA,EAASC,YACTA,EAAWC,UACXA,EAASC,gBACTA,EAAeC,UACfA,EAASC,UACTA,EAASC,eACTA,EAAcC,iBACdA,GACEV,EAGSW,EAASC,GAA0Bd,EAAUH,EAASgB,MAAMC,IAC5DC,EAAkBD,GAC7Bd,EAAUH,EAASkB,eAAeD,IACvBE,EAAgBF,GAA4Bd,EAAUH,EAASmB,aAAaF,IAC5EG,EAAmBH,GAC9Bd,EAAUH,EAASoB,gBAAgBH,IAiBxBI,EAAa,IAAsBC,EAAQ,IAAMtB,EAAU"}
1
+ {"version":3,"file":"login-id.js","sources":["../../src/screens/login-id.tsx"],"sourcesContent":["import LoginId from '@auth0/auth0-acul-js/login-id';\nimport { useMemo } from 'react';\n\nimport { ContextHooks } from '../hooks';\nimport { errorManager } from '../hooks';\nimport { registerScreen } from '../state/instance-store';\n\nimport type {\n LoginIdMembers,\n LoginOptions,\n FederatedLoginOptions,\n CustomOptions,\n} from '@auth0/auth0-acul-js/login-id';\n\n// Register the singleton instance of LoginId\nconst instance = registerScreen<LoginIdMembers>(LoginId)!;\n\n// Error wrapper\nconst { withError } = errorManager;\n\n// Context hooks\nconst factory = new ContextHooks<LoginIdMembers>(instance);\nexport const {\n useUser,\n useTenant,\n useBranding,\n useClient,\n useOrganization,\n usePrompt,\n useScreen,\n useTransaction,\n useUntrustedData,\n} = factory;\n\n// Submit functions\nexport const login = (payload: LoginOptions) => withError(instance.login(payload));\nexport const federatedLogin = (payload: FederatedLoginOptions) =>\n withError(instance.federatedLogin(payload));\nexport const passkeyLogin = (payload?: CustomOptions) => withError(instance.passkeyLogin(payload));\nexport const pickCountryCode = (payload?: CustomOptions) =>\n withError(instance.pickCountryCode(payload));\n\n// Utility Hooks\nexport { useLoginIdentifiers } from '../hooks/utility/login-identifiers';\n\n// Utility Hooks\nexport { usePasskeyAutofill } from '../hooks/utility/passkey-autofill';\n\n// Common hooks\nexport {\n useCurrentScreen,\n useErrors,\n useAuth0Themes,\n type UseErrorOptions,\n type UseErrorsResult,\n type ErrorsResult,\n type ErrorKind,\n} from '../hooks';\n\n// Main instance hook. Returns singleton instance of LoginId\nexport const useLoginId = (): LoginIdMembers => useMemo(() => instance, []);\n\n// Export all types from the core SDK for this screen\n"],"names":["instance","registerScreen","LoginId","withError","errorManager","factory","ContextHooks","useUser","useTenant","useBranding","useClient","useOrganization","usePrompt","useScreen","useTransaction","useUntrustedData","login","payload","federatedLogin","passkeyLogin","pickCountryCode","useLoginId","useMemo"],"mappings":"ojBAeA,MAAMA,EAAWC,EAA+BC,IAG1CC,UAAEA,GAAcC,EAGhBC,EAAU,IAAIC,EAA6BN,IACpCO,QACXA,EAAOC,UACPA,EAASC,YACTA,EAAWC,UACXA,EAASC,gBACTA,EAAeC,UACfA,EAASC,UACTA,EAASC,eACTA,EAAcC,iBACdA,GACEV,EAGSW,EAASC,GAA0Bd,EAAUH,EAASgB,MAAMC,IAC5DC,EAAkBD,GAC7Bd,EAAUH,EAASkB,eAAeD,IACvBE,EAAgBF,GAA4Bd,EAAUH,EAASmB,aAAaF,IAC5EG,EAAmBH,GAC9Bd,EAAUH,EAASoB,gBAAgBH,IAoBxBI,EAAa,IAAsBC,EAAQ,IAAMtB,EAAU"}
@@ -1,6 +1,7 @@
1
- import type { LoginPasswordMembers, LoginPasswordOptions, FederatedLoginOptions } from '@auth0/auth0-acul-js/login-password';
1
+ import type { LoginPasswordMembers, LoginPasswordOptions, FederatedLoginOptions, SwitchConnectionOptions } from '@auth0/auth0-acul-js/login-password';
2
2
  export declare const useUser: () => import("@auth0/auth0-acul-js").UserMembers, useTenant: () => import("@auth0/auth0-acul-js").TenantMembers, useBranding: () => import("@auth0/auth0-acul-js").BrandingMembers, useClient: () => import("@auth0/auth0-acul-js").ClientMembers, useOrganization: () => import("@auth0/auth0-acul-js").OrganizationMembers, usePrompt: () => import("@auth0/auth0-acul-js").PromptMembers, useScreen: () => import("@auth0/auth0-acul-js").ScreenMembersOnLoginPassword, useTransaction: () => import("@auth0/auth0-acul-js").TransactionMembersOnLoginPassword, useUntrustedData: () => import("@auth0/auth0-acul-js").UntrustedDataMembers;
3
3
  export declare const login: (payload: LoginPasswordOptions) => void | Promise<void>;
4
4
  export declare const federatedLogin: (payload: FederatedLoginOptions) => void | Promise<void>;
5
+ export declare const switchConnection: (payload: SwitchConnectionOptions) => void | Promise<void>;
5
6
  export { useCurrentScreen, useErrors, useAuth0Themes, type UseErrorOptions, type UseErrorsResult, type ErrorsResult, type ErrorKind, } from '../hooks';
6
7
  export declare const useLoginPassword: () => LoginPasswordMembers;
@@ -1,2 +1,2 @@
1
- import o from"@auth0/auth0-acul-js/login-password";import{useMemo as r}from"react";export{useAuth0Themes}from"../hooks/common/auth0-themes.js";export{useCurrentScreen}from"../hooks/common/current-screen.js";import{errorManager as e}from"../hooks/common/errors.js";export{useErrors}from"../hooks/common/errors.js";import{ContextHooks as s}from"../hooks/context/index.js";import{registerScreen as t}from"../state/instance-store.js";const n=t(o),{withError:m}=e,u=new s(n),{useUser:a,useTenant:i,useBranding:c,useClient:h,useOrganization:p,usePrompt:f,useScreen:j,useTransaction:d,useUntrustedData:x}=u,g=o=>m(n.login(o)),k=o=>m(n.federatedLogin(o)),l=()=>r(()=>n,[]);export{k as federatedLogin,g as login,c as useBranding,h as useClient,l as useLoginPassword,p as useOrganization,f as usePrompt,j as useScreen,i as useTenant,d as useTransaction,x as useUntrustedData,a as useUser};
1
+ import o from"@auth0/auth0-acul-js/login-password";import{useMemo as r}from"react";export{useAuth0Themes}from"../hooks/common/auth0-themes.js";export{useCurrentScreen}from"../hooks/common/current-screen.js";import{errorManager as e}from"../hooks/common/errors.js";export{useErrors}from"../hooks/common/errors.js";import{ContextHooks as s}from"../hooks/context/index.js";import{registerScreen as t}from"../state/instance-store.js";const n=t(o),{withError:m}=e,u=new s(n),{useUser:i,useTenant:a,useBranding:c,useClient:h,useOrganization:p,usePrompt:f,useScreen:j,useTransaction:d,useUntrustedData:x}=u,g=o=>m(n.login(o)),k=o=>m(n.federatedLogin(o)),l=o=>m(n.switchConnection(o)),w=()=>r(()=>n,[]);export{k as federatedLogin,g as login,l as switchConnection,c as useBranding,h as useClient,w as useLoginPassword,p as useOrganization,f as usePrompt,j as useScreen,a as useTenant,d as useTransaction,x as useUntrustedData,i as useUser};
2
2
  //# sourceMappingURL=login-password.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"login-password.js","sources":["../../src/screens/login-password.tsx"],"sourcesContent":["import LoginPassword from '@auth0/auth0-acul-js/login-password';\nimport { useMemo } from 'react';\n\nimport { ContextHooks } from '../hooks';\nimport { errorManager } from '../hooks';\nimport { registerScreen } from '../state/instance-store';\n\nimport type {\n LoginPasswordMembers,\n LoginPasswordOptions,\n FederatedLoginOptions,\n} from '@auth0/auth0-acul-js/login-password';\n\n// Register the singleton instance of LoginPassword\nconst instance = registerScreen<LoginPasswordMembers>(LoginPassword)!;\n\n// Error wrapper\nconst { withError } = errorManager;\n\n// Context hooks\nconst factory = new ContextHooks<LoginPasswordMembers>(instance);\nexport const {\n useUser,\n useTenant,\n useBranding,\n useClient,\n useOrganization,\n usePrompt,\n useScreen,\n useTransaction,\n useUntrustedData,\n} = factory;\n\n// Submit functions\nexport const login = (payload: LoginPasswordOptions) => withError(instance.login(payload));\nexport const federatedLogin = (payload: FederatedLoginOptions) =>\n withError(instance.federatedLogin(payload));\n\n// Common hooks\nexport {\n useCurrentScreen,\n useErrors,\n useAuth0Themes,\n type UseErrorOptions,\n type UseErrorsResult,\n type ErrorsResult,\n type ErrorKind,\n} from '../hooks';\n\n// Main instance hook. Returns singleton instance of LoginPassword\nexport const useLoginPassword = (): LoginPasswordMembers => useMemo(() => instance, []);\n\n// Export all types from the core SDK for this screen\n"],"names":["instance","registerScreen","LoginPassword","withError","errorManager","factory","ContextHooks","useUser","useTenant","useBranding","useClient","useOrganization","usePrompt","useScreen","useTransaction","useUntrustedData","login","payload","federatedLogin","useLoginPassword","useMemo"],"mappings":"8aAcA,MAAMA,EAAWC,EAAqCC,IAGhDC,UAAEA,GAAcC,EAGhBC,EAAU,IAAIC,EAAmCN,IAC1CO,QACXA,EAAOC,UACPA,EAASC,YACTA,EAAWC,UACXA,EAASC,gBACTA,EAAeC,UACfA,EAASC,UACTA,EAASC,eACTA,EAAcC,iBACdA,GACEV,EAGSW,EAASC,GAAkCd,EAAUH,EAASgB,MAAMC,IACpEC,EAAkBD,GAC7Bd,EAAUH,EAASkB,eAAeD,IAcvBE,EAAmB,IAA4BC,EAAQ,IAAMpB,EAAU"}
1
+ {"version":3,"file":"login-password.js","sources":["../../src/screens/login-password.tsx"],"sourcesContent":["import LoginPassword from '@auth0/auth0-acul-js/login-password';\nimport { useMemo } from 'react';\n\nimport { ContextHooks } from '../hooks';\nimport { errorManager } from '../hooks';\nimport { registerScreen } from '../state/instance-store';\n\nimport type {\n LoginPasswordMembers,\n LoginPasswordOptions,\n FederatedLoginOptions,\n SwitchConnectionOptions,\n} from '@auth0/auth0-acul-js/login-password';\n\n// Register the singleton instance of LoginPassword\nconst instance = registerScreen<LoginPasswordMembers>(LoginPassword)!;\n\n// Error wrapper\nconst { withError } = errorManager;\n\n// Context hooks\nconst factory = new ContextHooks<LoginPasswordMembers>(instance);\nexport const {\n useUser,\n useTenant,\n useBranding,\n useClient,\n useOrganization,\n usePrompt,\n useScreen,\n useTransaction,\n useUntrustedData,\n} = factory;\n\n// Submit functions\nexport const login = (payload: LoginPasswordOptions) => withError(instance.login(payload));\nexport const federatedLogin = (payload: FederatedLoginOptions) =>\n withError(instance.federatedLogin(payload));\nexport const switchConnection = (payload: SwitchConnectionOptions) =>\n withError(instance.switchConnection(payload));\n\n// Common hooks\nexport {\n useCurrentScreen,\n useErrors,\n useAuth0Themes,\n type UseErrorOptions,\n type UseErrorsResult,\n type ErrorsResult,\n type ErrorKind,\n} from '../hooks';\n\n// Main instance hook. Returns singleton instance of LoginPassword\nexport const useLoginPassword = (): LoginPasswordMembers => useMemo(() => instance, []);\n\n// Export all types from the core SDK for this screen\n"],"names":["instance","registerScreen","LoginPassword","withError","errorManager","factory","ContextHooks","useUser","useTenant","useBranding","useClient","useOrganization","usePrompt","useScreen","useTransaction","useUntrustedData","login","payload","federatedLogin","switchConnection","useLoginPassword","useMemo"],"mappings":"8aAeA,MAAMA,EAAWC,EAAqCC,IAGhDC,UAAEA,GAAcC,EAGhBC,EAAU,IAAIC,EAAmCN,IAC1CO,QACXA,EAAOC,UACPA,EAASC,YACTA,EAAWC,UACXA,EAASC,gBACTA,EAAeC,UACfA,EAASC,UACTA,EAASC,eACTA,EAAcC,iBACdA,GACEV,EAGSW,EAASC,GAAkCd,EAAUH,EAASgB,MAAMC,IACpEC,EAAkBD,GAC7Bd,EAAUH,EAASkB,eAAeD,IACvBE,EAAoBF,GAC/Bd,EAAUH,EAASmB,iBAAiBF,IAczBG,EAAmB,IAA4BC,EAAQ,IAAMrB,EAAU"}
@@ -1,8 +1,9 @@
1
- import type { MfaEmailChallengeMembers, ContinueOptions, ResendCodeOptions, TryAnotherMethodOptions } from '@auth0/auth0-acul-js/mfa-email-challenge';
1
+ import type { MfaEmailChallengeMembers, ContinueOptions, ResendCodeOptions, TryAnotherMethodOptions, CustomOptions } from '@auth0/auth0-acul-js/mfa-email-challenge';
2
2
  export declare const useUser: () => import("@auth0/auth0-acul-js").UserMembers, useTenant: () => import("@auth0/auth0-acul-js").TenantMembers, useBranding: () => import("@auth0/auth0-acul-js").BrandingMembers, useClient: () => import("@auth0/auth0-acul-js").ClientMembers, useOrganization: () => import("@auth0/auth0-acul-js").OrganizationMembers, usePrompt: () => import("@auth0/auth0-acul-js").PromptMembers, useScreen: () => import("@auth0/auth0-acul-js").ScreenMembersOnMfaEmailChallenge, useTransaction: () => import("@auth0/auth0-acul-js").TransactionMembers, useUntrustedData: () => import("@auth0/auth0-acul-js").UntrustedDataMembersOnMfaEmailChallenge;
3
3
  export declare const continueMethod: (payload: ContinueOptions) => void | Promise<void>;
4
4
  export declare const resendCode: (payload?: ResendCodeOptions) => void | Promise<void>;
5
5
  export declare const tryAnotherMethod: (payload?: TryAnotherMethodOptions) => void | Promise<void>;
6
+ export declare const pickEmail: (payload?: CustomOptions) => void | Promise<void>;
6
7
  export { useResend } from '../hooks/utility/resend-manager';
7
8
  export { useCurrentScreen, useErrors, useAuth0Themes, type UseErrorOptions, type UseErrorsResult, type ErrorsResult, type ErrorKind, } from '../hooks';
8
9
  export declare const useMfaEmailChallenge: () => MfaEmailChallengeMembers;
@@ -1,2 +1,2 @@
1
- import e from"@auth0/auth0-acul-js/mfa-email-challenge";import{useMemo as o}from"react";export{useAuth0Themes}from"../hooks/common/auth0-themes.js";export{useCurrentScreen}from"../hooks/common/current-screen.js";import{errorManager as r}from"../hooks/common/errors.js";export{useErrors}from"../hooks/common/errors.js";import{ContextHooks as s}from"../hooks/context/index.js";import{registerScreen as t}from"../state/instance-store.js";export{useResend}from"../hooks/utility/resend-manager.js";const n=t(e),{withError:m}=r,u=new s(n),{useUser:a,useTenant:i,useBranding:c,useClient:h,useOrganization:p,usePrompt:f,useScreen:d,useTransaction:j,useUntrustedData:x}=u,k=e=>m(n.continue(e)),l=e=>m(n.resendCode(e)),g=e=>m(n.tryAnotherMethod(e)),C=()=>o(()=>n,[]);export{k as continueMethod,l as resendCode,g as tryAnotherMethod,c as useBranding,h as useClient,C as useMfaEmailChallenge,p as useOrganization,f as usePrompt,d as useScreen,i as useTenant,j as useTransaction,x as useUntrustedData,a as useUser};
1
+ import e from"@auth0/auth0-acul-js/mfa-email-challenge";import{useMemo as o}from"react";export{useAuth0Themes}from"../hooks/common/auth0-themes.js";export{useCurrentScreen}from"../hooks/common/current-screen.js";import{errorManager as r}from"../hooks/common/errors.js";export{useErrors}from"../hooks/common/errors.js";import{ContextHooks as s}from"../hooks/context/index.js";import{registerScreen as t}from"../state/instance-store.js";export{useResend}from"../hooks/utility/resend-manager.js";const n=t(e),{withError:m}=r,u=new s(n),{useUser:a,useTenant:i,useBranding:c,useClient:h,useOrganization:p,usePrompt:f,useScreen:d,useTransaction:j,useUntrustedData:k}=u,l=e=>m(n.continue(e)),x=e=>m(n.resendCode(e)),g=e=>m(n.tryAnotherMethod(e)),C=e=>m(n.pickEmail(e)),E=()=>o(()=>n,[]);export{l as continueMethod,C as pickEmail,x as resendCode,g as tryAnotherMethod,c as useBranding,h as useClient,E as useMfaEmailChallenge,p as useOrganization,f as usePrompt,d as useScreen,i as useTenant,j as useTransaction,k as useUntrustedData,a as useUser};
2
2
  //# sourceMappingURL=mfa-email-challenge.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"mfa-email-challenge.js","sources":["../../src/screens/mfa-email-challenge.tsx"],"sourcesContent":["import MfaEmailChallenge from '@auth0/auth0-acul-js/mfa-email-challenge';\nimport { useMemo } from 'react';\n\nimport { ContextHooks } from '../hooks';\nimport { errorManager } from '../hooks';\nimport { registerScreen } from '../state/instance-store';\n\nimport type {\n MfaEmailChallengeMembers,\n ContinueOptions,\n ResendCodeOptions,\n TryAnotherMethodOptions,\n} from '@auth0/auth0-acul-js/mfa-email-challenge';\n\n// Register the singleton instance of MfaEmailChallenge\nconst instance = registerScreen<MfaEmailChallengeMembers>(MfaEmailChallenge)!;\n\n// Error wrapper\nconst { withError } = errorManager;\n\n// Context hooks\nconst factory = new ContextHooks<MfaEmailChallengeMembers>(instance);\nexport const {\n useUser,\n useTenant,\n useBranding,\n useClient,\n useOrganization,\n usePrompt,\n useScreen,\n useTransaction,\n useUntrustedData,\n} = factory;\n\n// Submit functions\nexport const continueMethod = (payload: ContinueOptions) => withError(instance.continue(payload));\nexport const resendCode = (payload?: ResendCodeOptions) => withError(instance.resendCode(payload));\nexport const tryAnotherMethod = (payload?: TryAnotherMethodOptions) =>\n withError(instance.tryAnotherMethod(payload));\n\n// Utility Hooks\nexport { useResend } from '../hooks/utility/resend-manager';\n\n// Common hooks\nexport {\n useCurrentScreen,\n useErrors,\n useAuth0Themes,\n type UseErrorOptions,\n type UseErrorsResult,\n type ErrorsResult,\n type ErrorKind,\n} from '../hooks';\n\n// Main instance hook. Returns singleton instance of MfaEmailChallenge\nexport const useMfaEmailChallenge = (): MfaEmailChallengeMembers => useMemo(() => instance, []);\n\n// Export all types from the core SDK for this screen\n"],"names":["instance","registerScreen","MfaEmailChallenge","withError","errorManager","factory","ContextHooks","useUser","useTenant","useBranding","useClient","useOrganization","usePrompt","useScreen","useTransaction","useUntrustedData","continueMethod","payload","continue","resendCode","tryAnotherMethod","useMfaEmailChallenge","useMemo"],"mappings":"6eAeA,MAAMA,EAAWC,EAAyCC,IAGpDC,UAAEA,GAAcC,EAGhBC,EAAU,IAAIC,EAAuCN,IAC9CO,QACXA,EAAOC,UACPA,EAASC,YACTA,EAAWC,UACXA,EAASC,gBACTA,EAAeC,UACfA,EAASC,UACTA,EAASC,eACTA,EAAcC,iBACdA,GACEV,EAGSW,EAAkBC,GAA6Bd,EAAUH,EAASkB,SAASD,IAC3EE,EAAcF,GAAgCd,EAAUH,EAASmB,WAAWF,IAC5EG,EAAoBH,GAC/Bd,EAAUH,EAASoB,iBAAiBH,IAiBzBI,EAAuB,IAAgCC,EAAQ,IAAMtB,EAAU"}
1
+ {"version":3,"file":"mfa-email-challenge.js","sources":["../../src/screens/mfa-email-challenge.tsx"],"sourcesContent":["import MfaEmailChallenge from '@auth0/auth0-acul-js/mfa-email-challenge';\nimport { useMemo } from 'react';\n\nimport { ContextHooks } from '../hooks';\nimport { errorManager } from '../hooks';\nimport { registerScreen } from '../state/instance-store';\n\nimport type {\n MfaEmailChallengeMembers,\n ContinueOptions,\n ResendCodeOptions,\n TryAnotherMethodOptions,\n CustomOptions,\n} from '@auth0/auth0-acul-js/mfa-email-challenge';\n\n// Register the singleton instance of MfaEmailChallenge\nconst instance = registerScreen<MfaEmailChallengeMembers>(MfaEmailChallenge)!;\n\n// Error wrapper\nconst { withError } = errorManager;\n\n// Context hooks\nconst factory = new ContextHooks<MfaEmailChallengeMembers>(instance);\nexport const {\n useUser,\n useTenant,\n useBranding,\n useClient,\n useOrganization,\n usePrompt,\n useScreen,\n useTransaction,\n useUntrustedData,\n} = factory;\n\n// Submit functions\nexport const continueMethod = (payload: ContinueOptions) => withError(instance.continue(payload));\nexport const resendCode = (payload?: ResendCodeOptions) => withError(instance.resendCode(payload));\nexport const tryAnotherMethod = (payload?: TryAnotherMethodOptions) =>\n withError(instance.tryAnotherMethod(payload));\nexport const pickEmail = (payload?: CustomOptions) => withError(instance.pickEmail(payload));\n\n// Utility Hooks\nexport { useResend } from '../hooks/utility/resend-manager';\n\n// Common hooks\nexport {\n useCurrentScreen,\n useErrors,\n useAuth0Themes,\n type UseErrorOptions,\n type UseErrorsResult,\n type ErrorsResult,\n type ErrorKind,\n} from '../hooks';\n\n// Main instance hook. Returns singleton instance of MfaEmailChallenge\nexport const useMfaEmailChallenge = (): MfaEmailChallengeMembers => useMemo(() => instance, []);\n\n// Export all types from the core SDK for this screen\n"],"names":["instance","registerScreen","MfaEmailChallenge","withError","errorManager","factory","ContextHooks","useUser","useTenant","useBranding","useClient","useOrganization","usePrompt","useScreen","useTransaction","useUntrustedData","continueMethod","payload","continue","resendCode","tryAnotherMethod","pickEmail","useMfaEmailChallenge","useMemo"],"mappings":"6eAgBA,MAAMA,EAAWC,EAAyCC,IAGpDC,UAAEA,GAAcC,EAGhBC,EAAU,IAAIC,EAAuCN,IAC9CO,QACXA,EAAOC,UACPA,EAASC,YACTA,EAAWC,UACXA,EAASC,gBACTA,EAAeC,UACfA,EAASC,UACTA,EAASC,eACTA,EAAcC,iBACdA,GACEV,EAGSW,EAAkBC,GAA6Bd,EAAUH,EAASkB,SAASD,IAC3EE,EAAcF,GAAgCd,EAAUH,EAASmB,WAAWF,IAC5EG,EAAoBH,GAC/Bd,EAAUH,EAASoB,iBAAiBH,IACzBI,EAAaJ,GAA4Bd,EAAUH,EAASqB,UAAUJ,IAiBtEK,EAAuB,IAAgCC,EAAQ,IAAMvB,EAAU"}
@@ -1,5 +1,6 @@
1
- import type { MfaLoginOptionsMembers, LoginEnrollOptions } from '@auth0/auth0-acul-js/mfa-login-options';
1
+ import type { MfaLoginOptionsMembers, LoginEnrollOptions, CustomOptions } from '@auth0/auth0-acul-js/mfa-login-options';
2
2
  export declare const useUser: () => import("@auth0/auth0-acul-js").UserMembers, useTenant: () => import("@auth0/auth0-acul-js").TenantMembers, useBranding: () => import("@auth0/auth0-acul-js").BrandingMembers, useClient: () => import("@auth0/auth0-acul-js").ClientMembers, useOrganization: () => import("@auth0/auth0-acul-js").OrganizationMembers, usePrompt: () => import("@auth0/auth0-acul-js").PromptMembers, useScreen: () => import("@auth0/auth0-acul-js").ScreenMembersOnMfaLoginOptions, useTransaction: () => import("@auth0/auth0-acul-js").TransactionMembers, useUntrustedData: () => import("@auth0/auth0-acul-js").UntrustedDataMembers;
3
3
  export declare const enroll: (payload: LoginEnrollOptions) => void | Promise<void>;
4
+ export declare const returnToPrevious: (payload?: CustomOptions) => void | Promise<void>;
4
5
  export { useCurrentScreen, useErrors, useAuth0Themes, type UseErrorOptions, type UseErrorsResult, type ErrorsResult, type ErrorKind, } from '../hooks';
5
6
  export declare const useMfaLoginOptions: () => MfaLoginOptionsMembers;
@@ -1,2 +1,2 @@
1
- import o from"@auth0/auth0-acul-js/mfa-login-options";import{useMemo as r}from"react";export{useAuth0Themes}from"../hooks/common/auth0-themes.js";export{useCurrentScreen}from"../hooks/common/current-screen.js";import{errorManager as e}from"../hooks/common/errors.js";export{useErrors}from"../hooks/common/errors.js";import{ContextHooks as s}from"../hooks/context/index.js";import{registerScreen as t}from"../state/instance-store.js";const n=t(o),{withError:m}=e,u=new s(n),{useUser:a,useTenant:i,useBranding:c,useClient:h,useOrganization:p,usePrompt:f,useScreen:j,useTransaction:x,useUntrustedData:k}=u,l=o=>m(n.enroll(o)),d=()=>r(()=>n,[]);export{l as enroll,c as useBranding,h as useClient,d as useMfaLoginOptions,p as useOrganization,f as usePrompt,j as useScreen,i as useTenant,x as useTransaction,k as useUntrustedData,a as useUser};
1
+ import o from"@auth0/auth0-acul-js/mfa-login-options";import{useMemo as r}from"react";export{useAuth0Themes}from"../hooks/common/auth0-themes.js";export{useCurrentScreen}from"../hooks/common/current-screen.js";import{errorManager as e}from"../hooks/common/errors.js";export{useErrors}from"../hooks/common/errors.js";import{ContextHooks as s}from"../hooks/context/index.js";import{registerScreen as t}from"../state/instance-store.js";const n=t(o),{withError:m}=e,u=new s(n),{useUser:a,useTenant:i,useBranding:c,useClient:h,useOrganization:p,usePrompt:f,useScreen:j,useTransaction:x,useUntrustedData:k}=u,l=o=>m(n.enroll(o)),T=o=>m(n.returnToPrevious(o)),d=()=>r(()=>n,[]);export{l as enroll,T as returnToPrevious,c as useBranding,h as useClient,d as useMfaLoginOptions,p as useOrganization,f as usePrompt,j as useScreen,i as useTenant,x as useTransaction,k as useUntrustedData,a as useUser};
2
2
  //# sourceMappingURL=mfa-login-options.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"mfa-login-options.js","sources":["../../src/screens/mfa-login-options.tsx"],"sourcesContent":["import MfaLoginOptions from '@auth0/auth0-acul-js/mfa-login-options';\nimport { useMemo } from 'react';\n\nimport { ContextHooks } from '../hooks';\nimport { errorManager } from '../hooks';\nimport { registerScreen } from '../state/instance-store';\n\nimport type {\n MfaLoginOptionsMembers,\n LoginEnrollOptions,\n} from '@auth0/auth0-acul-js/mfa-login-options';\n\n// Register the singleton instance of MfaLoginOptions\nconst instance = registerScreen<MfaLoginOptionsMembers>(MfaLoginOptions)!;\n\n// Error wrapper\nconst { withError } = errorManager;\n\n// Context hooks\nconst factory = new ContextHooks<MfaLoginOptionsMembers>(instance);\nexport const {\n useUser,\n useTenant,\n useBranding,\n useClient,\n useOrganization,\n usePrompt,\n useScreen,\n useTransaction,\n useUntrustedData,\n} = factory;\n\n// Submit functions\nexport const enroll = (payload: LoginEnrollOptions) => withError(instance.enroll(payload));\n\n// Common hooks\nexport {\n useCurrentScreen,\n useErrors,\n useAuth0Themes,\n type UseErrorOptions,\n type UseErrorsResult,\n type ErrorsResult,\n type ErrorKind,\n} from '../hooks';\n\n// Main instance hook. Returns singleton instance of MfaLoginOptions\nexport const useMfaLoginOptions = (): MfaLoginOptionsMembers => useMemo(() => instance, []);\n\n// Export all types from the core SDK for this screen\n"],"names":["instance","registerScreen","MfaLoginOptions","withError","errorManager","factory","ContextHooks","useUser","useTenant","useBranding","useClient","useOrganization","usePrompt","useScreen","useTransaction","useUntrustedData","enroll","payload","useMfaLoginOptions","useMemo"],"mappings":"ibAaA,MAAMA,EAAWC,EAAuCC,IAGlDC,UAAEA,GAAcC,EAGhBC,EAAU,IAAIC,EAAqCN,IAC5CO,QACXA,EAAOC,UACPA,EAASC,YACTA,EAAWC,UACXA,EAASC,gBACTA,EAAeC,UACfA,EAASC,UACTA,EAASC,eACTA,EAAcC,iBACdA,GACEV,EAGSW,EAAUC,GAAgCd,EAAUH,EAASgB,OAAOC,IAcpEC,EAAqB,IAA8BC,EAAQ,IAAMnB,EAAU"}
1
+ {"version":3,"file":"mfa-login-options.js","sources":["../../src/screens/mfa-login-options.tsx"],"sourcesContent":["import MfaLoginOptions from '@auth0/auth0-acul-js/mfa-login-options';\nimport { useMemo } from 'react';\n\nimport { ContextHooks } from '../hooks';\nimport { errorManager } from '../hooks';\nimport { registerScreen } from '../state/instance-store';\n\nimport type {\n MfaLoginOptionsMembers,\n LoginEnrollOptions,\n CustomOptions,\n} from '@auth0/auth0-acul-js/mfa-login-options';\n\n// Register the singleton instance of MfaLoginOptions\nconst instance = registerScreen<MfaLoginOptionsMembers>(MfaLoginOptions)!;\n\n// Error wrapper\nconst { withError } = errorManager;\n\n// Context hooks\nconst factory = new ContextHooks<MfaLoginOptionsMembers>(instance);\nexport const {\n useUser,\n useTenant,\n useBranding,\n useClient,\n useOrganization,\n usePrompt,\n useScreen,\n useTransaction,\n useUntrustedData,\n} = factory;\n\n// Submit functions\nexport const enroll = (payload: LoginEnrollOptions) => withError(instance.enroll(payload));\nexport const returnToPrevious = (payload?: CustomOptions) =>\n withError(instance.returnToPrevious(payload));\n\n// Common hooks\nexport {\n useCurrentScreen,\n useErrors,\n useAuth0Themes,\n type UseErrorOptions,\n type UseErrorsResult,\n type ErrorsResult,\n type ErrorKind,\n} from '../hooks';\n\n// Main instance hook. Returns singleton instance of MfaLoginOptions\nexport const useMfaLoginOptions = (): MfaLoginOptionsMembers => useMemo(() => instance, []);\n\n// Export all types from the core SDK for this screen\n"],"names":["instance","registerScreen","MfaLoginOptions","withError","errorManager","factory","ContextHooks","useUser","useTenant","useBranding","useClient","useOrganization","usePrompt","useScreen","useTransaction","useUntrustedData","enroll","payload","returnToPrevious","useMfaLoginOptions","useMemo"],"mappings":"ibAcA,MAAMA,EAAWC,EAAuCC,IAGlDC,UAAEA,GAAcC,EAGhBC,EAAU,IAAIC,EAAqCN,IAC5CO,QACXA,EAAOC,UACPA,EAASC,YACTA,EAAWC,UACXA,EAASC,gBACTA,EAAeC,UACfA,EAASC,UACTA,EAASC,eACTA,EAAcC,iBACdA,GACEV,EAGSW,EAAUC,GAAgCd,EAAUH,EAASgB,OAAOC,IACpEC,EAAoBD,GAC/Bd,EAAUH,EAASkB,iBAAiBD,IAczBE,EAAqB,IAA8BC,EAAQ,IAAMpB,EAAU"}
@@ -1,5 +1,6 @@
1
1
  import type { MfaPushEnrollmentQrMembers, CustomOptions } from '@auth0/auth0-acul-js/mfa-push-enrollment-qr';
2
2
  export declare const useUser: () => import("@auth0/auth0-acul-js").UserMembers, useTenant: () => import("@auth0/auth0-acul-js").TenantMembers, useBranding: () => import("@auth0/auth0-acul-js").BrandingMembers, useClient: () => import("@auth0/auth0-acul-js").ClientMembers, useOrganization: () => import("@auth0/auth0-acul-js").OrganizationMembers, usePrompt: () => import("@auth0/auth0-acul-js").PromptMembers, useScreen: () => import("@auth0/auth0-acul-js").ScreenMembersOnMfaPushEnrollmentQr, useTransaction: () => import("@auth0/auth0-acul-js").TransactionMembers, useUntrustedData: () => import("@auth0/auth0-acul-js").UntrustedDataMembers;
3
3
  export declare const pickAuthenticator: (payload?: CustomOptions) => void | Promise<void>;
4
+ export { useMfaPolling } from '../hooks/utility/polling-manager';
4
5
  export { useCurrentScreen, useErrors, useAuth0Themes, type UseErrorOptions, type UseErrorsResult, type ErrorsResult, type ErrorKind, } from '../hooks';
5
6
  export declare const useMfaPushEnrollmentQr: () => MfaPushEnrollmentQrMembers;
@@ -1,2 +1,2 @@
1
- import o from"@auth0/auth0-acul-js/mfa-push-enrollment-qr";import{useMemo as r}from"react";export{useAuth0Themes}from"../hooks/common/auth0-themes.js";export{useCurrentScreen}from"../hooks/common/current-screen.js";import{errorManager as e}from"../hooks/common/errors.js";export{useErrors}from"../hooks/common/errors.js";import{ContextHooks as s}from"../hooks/context/index.js";import{registerScreen as t}from"../state/instance-store.js";const n=t(o),{withError:m}=e,u=new s(n),{useUser:a,useTenant:c,useBranding:i,useClient:h,useOrganization:p,usePrompt:f,useScreen:j,useTransaction:k,useUntrustedData:x}=u,l=o=>m(n.pickAuthenticator(o)),d=()=>r(()=>n,[]);export{l as pickAuthenticator,i as useBranding,h as useClient,d as useMfaPushEnrollmentQr,p as useOrganization,f as usePrompt,j as useScreen,c as useTenant,k as useTransaction,x as useUntrustedData,a as useUser};
1
+ import o from"@auth0/auth0-acul-js/mfa-push-enrollment-qr";import{useMemo as r}from"react";export{useAuth0Themes}from"../hooks/common/auth0-themes.js";export{useCurrentScreen}from"../hooks/common/current-screen.js";import{errorManager as e}from"../hooks/common/errors.js";export{useErrors}from"../hooks/common/errors.js";import{ContextHooks as s}from"../hooks/context/index.js";import{registerScreen as t}from"../state/instance-store.js";export{useMfaPolling}from"../hooks/utility/polling-manager.js";const n=t(o),{withError:m}=e,u=new s(n),{useUser:a,useTenant:i,useBranding:c,useClient:h,useOrganization:p,usePrompt:f,useScreen:l,useTransaction:j,useUntrustedData:k}=u,x=o=>m(n.pickAuthenticator(o)),g=()=>r(()=>n,[]);export{x as pickAuthenticator,c as useBranding,h as useClient,g as useMfaPushEnrollmentQr,p as useOrganization,f as usePrompt,l as useScreen,i as useTenant,j as useTransaction,k as useUntrustedData,a as useUser};
2
2
  //# sourceMappingURL=mfa-push-enrollment-qr.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"mfa-push-enrollment-qr.js","sources":["../../src/screens/mfa-push-enrollment-qr.tsx"],"sourcesContent":["import MfaPushEnrollmentQr from '@auth0/auth0-acul-js/mfa-push-enrollment-qr';\nimport { useMemo } from 'react';\n\nimport { ContextHooks } from '../hooks';\nimport { errorManager } from '../hooks';\nimport { registerScreen } from '../state/instance-store';\n\nimport type {\n MfaPushEnrollmentQrMembers,\n CustomOptions,\n} from '@auth0/auth0-acul-js/mfa-push-enrollment-qr';\n\n// Register the singleton instance of MfaPushEnrollmentQr\nconst instance = registerScreen<MfaPushEnrollmentQrMembers>(MfaPushEnrollmentQr)!;\n\n// Error wrapper\nconst { withError } = errorManager;\n\n// Context hooks\nconst factory = new ContextHooks<MfaPushEnrollmentQrMembers>(instance);\nexport const {\n useUser,\n useTenant,\n useBranding,\n useClient,\n useOrganization,\n usePrompt,\n useScreen,\n useTransaction,\n useUntrustedData,\n} = factory;\n\n// Submit functions\nexport const pickAuthenticator = (payload?: CustomOptions) =>\n withError(instance.pickAuthenticator(payload));\n\n// Common hooks\nexport {\n useCurrentScreen,\n useErrors,\n useAuth0Themes,\n type UseErrorOptions,\n type UseErrorsResult,\n type ErrorsResult,\n type ErrorKind,\n} from '../hooks';\n\n// Main instance hook. Returns singleton instance of MfaPushEnrollmentQr\nexport const useMfaPushEnrollmentQr = (): MfaPushEnrollmentQrMembers => useMemo(() => instance, []);\n\n// Export all types from the core SDK for this screen\n"],"names":["instance","registerScreen","MfaPushEnrollmentQr","withError","errorManager","factory","ContextHooks","useUser","useTenant","useBranding","useClient","useOrganization","usePrompt","useScreen","useTransaction","useUntrustedData","pickAuthenticator","payload","useMfaPushEnrollmentQr","useMemo"],"mappings":"sbAaA,MAAMA,EAAWC,EAA2CC,IAGtDC,UAAEA,GAAcC,EAGhBC,EAAU,IAAIC,EAAyCN,IAChDO,QACXA,EAAOC,UACPA,EAASC,YACTA,EAAWC,UACXA,EAASC,gBACTA,EAAeC,UACfA,EAASC,UACTA,EAASC,eACTA,EAAcC,iBACdA,GACEV,EAGSW,EAAqBC,GAChCd,EAAUH,EAASgB,kBAAkBC,IAc1BC,EAAyB,IAAkCC,EAAQ,IAAMnB,EAAU"}
1
+ {"version":3,"file":"mfa-push-enrollment-qr.js","sources":["../../src/screens/mfa-push-enrollment-qr.tsx"],"sourcesContent":["import MfaPushEnrollmentQr from '@auth0/auth0-acul-js/mfa-push-enrollment-qr';\nimport { useMemo } from 'react';\n\nimport { ContextHooks } from '../hooks';\nimport { errorManager } from '../hooks';\nimport { registerScreen } from '../state/instance-store';\n\nimport type {\n MfaPushEnrollmentQrMembers,\n CustomOptions,\n} from '@auth0/auth0-acul-js/mfa-push-enrollment-qr';\n\n// Register the singleton instance of MfaPushEnrollmentQr\nconst instance = registerScreen<MfaPushEnrollmentQrMembers>(MfaPushEnrollmentQr)!;\n\n// Error wrapper\nconst { withError } = errorManager;\n\n// Context hooks\nconst factory = new ContextHooks<MfaPushEnrollmentQrMembers>(instance);\nexport const {\n useUser,\n useTenant,\n useBranding,\n useClient,\n useOrganization,\n usePrompt,\n useScreen,\n useTransaction,\n useUntrustedData,\n} = factory;\n\n// Submit functions\nexport const pickAuthenticator = (payload?: CustomOptions) =>\n withError(instance.pickAuthenticator(payload));\n\n// Utility Hooks\nexport { useMfaPolling } from '../hooks/utility/polling-manager';\n\n// Common hooks\nexport {\n useCurrentScreen,\n useErrors,\n useAuth0Themes,\n type UseErrorOptions,\n type UseErrorsResult,\n type ErrorsResult,\n type ErrorKind,\n} from '../hooks';\n\n// Main instance hook. Returns singleton instance of MfaPushEnrollmentQr\nexport const useMfaPushEnrollmentQr = (): MfaPushEnrollmentQrMembers => useMemo(() => instance, []);\n\n// Export all types from the core SDK for this screen\n"],"names":["instance","registerScreen","MfaPushEnrollmentQr","withError","errorManager","factory","ContextHooks","useUser","useTenant","useBranding","useClient","useOrganization","usePrompt","useScreen","useTransaction","useUntrustedData","pickAuthenticator","payload","useMfaPushEnrollmentQr","useMemo"],"mappings":"qfAaA,MAAMA,EAAWC,EAA2CC,IAGtDC,UAAEA,GAAcC,EAGhBC,EAAU,IAAIC,EAAyCN,IAChDO,QACXA,EAAOC,UACPA,EAASC,YACTA,EAAWC,UACXA,EAASC,gBACTA,EAAeC,UACfA,EAASC,UACTA,EAASC,eACTA,EAAcC,iBACdA,GACEV,EAGSW,EAAqBC,GAChCd,EAAUH,EAASgB,kBAAkBC,IAiB1BC,EAAyB,IAAkCC,EAAQ,IAAMnB,EAAU"}
@@ -3,6 +3,8 @@ export declare const useUser: () => import("@auth0/auth0-acul-js").UserMembers,
3
3
  export declare const submitPhoneChallenge: (payload: PhoneChallengeOptions) => void | Promise<void>;
4
4
  export declare const resendCode: (payload?: CustomOptions) => void | Promise<void>;
5
5
  export declare const returnToPrevious: (payload?: CustomOptions) => void | Promise<void>;
6
+ export declare const switchToVoice: (payload?: CustomOptions) => void | Promise<void>;
7
+ export declare const switchToText: (payload?: CustomOptions) => void | Promise<void>;
6
8
  export { useResend } from '../hooks/utility/resend-manager';
7
9
  export { useCurrentScreen, useErrors, useAuth0Themes, type UseErrorOptions, type UseErrorsResult, type ErrorsResult, type ErrorKind, } from '../hooks';
8
10
  export declare const usePhoneIdentifierChallenge: () => PhoneIdentifierChallengeMembers;
@@ -1,2 +1,2 @@
1
- import e from"@auth0/auth0-acul-js/phone-identifier-challenge";import{useMemo as o}from"react";export{useAuth0Themes}from"../hooks/common/auth0-themes.js";export{useCurrentScreen}from"../hooks/common/current-screen.js";import{errorManager as r}from"../hooks/common/errors.js";export{useErrors}from"../hooks/common/errors.js";import{ContextHooks as s}from"../hooks/context/index.js";import{registerScreen as t}from"../state/instance-store.js";export{useResend}from"../hooks/utility/resend-manager.js";const n=t(e),{withError:m}=r,u=new s(n),{useUser:i,useTenant:a,useBranding:h,useClient:c,useOrganization:p,usePrompt:f,useScreen:d,useTransaction:j,useUntrustedData:l}=u,x=e=>m(n.submitPhoneChallenge(e)),k=e=>m(n.resendCode(e)),g=e=>m(n.returnToPrevious(e)),C=()=>o(()=>n,[]);export{k as resendCode,g as returnToPrevious,x as submitPhoneChallenge,h as useBranding,c as useClient,p as useOrganization,C as usePhoneIdentifierChallenge,f as usePrompt,d as useScreen,a as useTenant,j as useTransaction,l as useUntrustedData,i as useUser};
1
+ import e from"@auth0/auth0-acul-js/phone-identifier-challenge";import{useMemo as o}from"react";export{useAuth0Themes}from"../hooks/common/auth0-themes.js";export{useCurrentScreen}from"../hooks/common/current-screen.js";import{errorManager as r}from"../hooks/common/errors.js";export{useErrors}from"../hooks/common/errors.js";import{ContextHooks as s}from"../hooks/context/index.js";import{registerScreen as t}from"../state/instance-store.js";export{useResend}from"../hooks/utility/resend-manager.js";const n=t(e),{withError:m}=r,u=new s(n),{useUser:i,useTenant:a,useBranding:h,useClient:c,useOrganization:p,usePrompt:f,useScreen:d,useTransaction:j,useUntrustedData:x}=u,l=e=>m(n.submitPhoneChallenge(e)),T=e=>m(n.resendCode(e)),k=e=>m(n.returnToPrevious(e)),g=e=>m(n.switchToVoice(e)),w=e=>m(n.switchToText(e)),C=()=>o(()=>n,[]);export{T as resendCode,k as returnToPrevious,l as submitPhoneChallenge,w as switchToText,g as switchToVoice,h as useBranding,c as useClient,p as useOrganization,C as usePhoneIdentifierChallenge,f as usePrompt,d as useScreen,a as useTenant,j as useTransaction,x as useUntrustedData,i as useUser};
2
2
  //# sourceMappingURL=phone-identifier-challenge.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"phone-identifier-challenge.js","sources":["../../src/screens/phone-identifier-challenge.tsx"],"sourcesContent":["import PhoneIdentifierChallenge from '@auth0/auth0-acul-js/phone-identifier-challenge';\nimport { useMemo } from 'react';\n\nimport { ContextHooks } from '../hooks';\nimport { errorManager } from '../hooks';\nimport { registerScreen } from '../state/instance-store';\n\nimport type {\n PhoneIdentifierChallengeMembers,\n PhoneChallengeOptions,\n CustomOptions,\n} from '@auth0/auth0-acul-js/phone-identifier-challenge';\n\n// Register the singleton instance of PhoneIdentifierChallenge\nconst instance = registerScreen<PhoneIdentifierChallengeMembers>(PhoneIdentifierChallenge)!;\n\n// Error wrapper\nconst { withError } = errorManager;\n\n// Context hooks\nconst factory = new ContextHooks<PhoneIdentifierChallengeMembers>(instance);\nexport const {\n useUser,\n useTenant,\n useBranding,\n useClient,\n useOrganization,\n usePrompt,\n useScreen,\n useTransaction,\n useUntrustedData,\n} = factory;\n\n// Submit functions\nexport const submitPhoneChallenge = (payload: PhoneChallengeOptions) =>\n withError(instance.submitPhoneChallenge(payload));\nexport const resendCode = (payload?: CustomOptions) => withError(instance.resendCode(payload));\nexport const returnToPrevious = (payload?: CustomOptions) =>\n withError(instance.returnToPrevious(payload));\n\n// Utility Hooks\nexport { useResend } from '../hooks/utility/resend-manager';\n\n// Common hooks\nexport {\n useCurrentScreen,\n useErrors,\n useAuth0Themes,\n type UseErrorOptions,\n type UseErrorsResult,\n type ErrorsResult,\n type ErrorKind,\n} from '../hooks';\n\n// Main instance hook. Returns singleton instance of PhoneIdentifierChallenge\nexport const usePhoneIdentifierChallenge = (): PhoneIdentifierChallengeMembers =>\n useMemo(() => instance, []);\n\n// Export all types from the core SDK for this screen\n"],"names":["instance","registerScreen","PhoneIdentifierChallenge","withError","errorManager","factory","ContextHooks","useUser","useTenant","useBranding","useClient","useOrganization","usePrompt","useScreen","useTransaction","useUntrustedData","submitPhoneChallenge","payload","resendCode","returnToPrevious","usePhoneIdentifierChallenge","useMemo"],"mappings":"ofAcA,MAAMA,EAAWC,EAAgDC,IAG3DC,UAAEA,GAAcC,EAGhBC,EAAU,IAAIC,EAA8CN,IACrDO,QACXA,EAAOC,UACPA,EAASC,YACTA,EAAWC,UACXA,EAASC,gBACTA,EAAeC,UACfA,EAASC,UACTA,EAASC,eACTA,EAAcC,iBACdA,GACEV,EAGSW,EAAwBC,GACnCd,EAAUH,EAASgB,qBAAqBC,IAC7BC,EAAcD,GAA4Bd,EAAUH,EAASkB,WAAWD,IACxEE,EAAoBF,GAC/Bd,EAAUH,EAASmB,iBAAiBF,IAiBzBG,EAA8B,IACzCC,EAAQ,IAAMrB,EAAU"}
1
+ {"version":3,"file":"phone-identifier-challenge.js","sources":["../../src/screens/phone-identifier-challenge.tsx"],"sourcesContent":["import PhoneIdentifierChallenge from '@auth0/auth0-acul-js/phone-identifier-challenge';\nimport { useMemo } from 'react';\n\nimport { ContextHooks } from '../hooks';\nimport { errorManager } from '../hooks';\nimport { registerScreen } from '../state/instance-store';\n\nimport type {\n PhoneIdentifierChallengeMembers,\n PhoneChallengeOptions,\n CustomOptions,\n} from '@auth0/auth0-acul-js/phone-identifier-challenge';\n\n// Register the singleton instance of PhoneIdentifierChallenge\nconst instance = registerScreen<PhoneIdentifierChallengeMembers>(PhoneIdentifierChallenge)!;\n\n// Error wrapper\nconst { withError } = errorManager;\n\n// Context hooks\nconst factory = new ContextHooks<PhoneIdentifierChallengeMembers>(instance);\nexport const {\n useUser,\n useTenant,\n useBranding,\n useClient,\n useOrganization,\n usePrompt,\n useScreen,\n useTransaction,\n useUntrustedData,\n} = factory;\n\n// Submit functions\nexport const submitPhoneChallenge = (payload: PhoneChallengeOptions) =>\n withError(instance.submitPhoneChallenge(payload));\nexport const resendCode = (payload?: CustomOptions) => withError(instance.resendCode(payload));\nexport const returnToPrevious = (payload?: CustomOptions) =>\n withError(instance.returnToPrevious(payload));\nexport const switchToVoice = (payload?: CustomOptions) =>\n withError(instance.switchToVoice(payload));\nexport const switchToText = (payload?: CustomOptions) => withError(instance.switchToText(payload));\n\n// Utility Hooks\nexport { useResend } from '../hooks/utility/resend-manager';\n\n// Common hooks\nexport {\n useCurrentScreen,\n useErrors,\n useAuth0Themes,\n type UseErrorOptions,\n type UseErrorsResult,\n type ErrorsResult,\n type ErrorKind,\n} from '../hooks';\n\n// Main instance hook. Returns singleton instance of PhoneIdentifierChallenge\nexport const usePhoneIdentifierChallenge = (): PhoneIdentifierChallengeMembers =>\n useMemo(() => instance, []);\n\n// Export all types from the core SDK for this screen\n"],"names":["instance","registerScreen","PhoneIdentifierChallenge","withError","errorManager","factory","ContextHooks","useUser","useTenant","useBranding","useClient","useOrganization","usePrompt","useScreen","useTransaction","useUntrustedData","submitPhoneChallenge","payload","resendCode","returnToPrevious","switchToVoice","switchToText","usePhoneIdentifierChallenge","useMemo"],"mappings":"ofAcA,MAAMA,EAAWC,EAAgDC,IAG3DC,UAAEA,GAAcC,EAGhBC,EAAU,IAAIC,EAA8CN,IACrDO,QACXA,EAAOC,UACPA,EAASC,YACTA,EAAWC,UACXA,EAASC,gBACTA,EAAeC,UACfA,EAASC,UACTA,EAASC,eACTA,EAAcC,iBACdA,GACEV,EAGSW,EAAwBC,GACnCd,EAAUH,EAASgB,qBAAqBC,IAC7BC,EAAcD,GAA4Bd,EAAUH,EAASkB,WAAWD,IACxEE,EAAoBF,GAC/Bd,EAAUH,EAASmB,iBAAiBF,IACzBG,EAAiBH,GAC5Bd,EAAUH,EAASoB,cAAcH,IACtBI,EAAgBJ,GAA4Bd,EAAUH,EAASqB,aAAaJ,IAiB5EK,EAA8B,IACzCC,EAAQ,IAAMvB,EAAU"}
@@ -1,7 +1,8 @@
1
- import type { SignupPasswordMembers, SignupPasswordOptions, FederatedSignupOptions } from '@auth0/auth0-acul-js/signup-password';
1
+ import type { SignupPasswordMembers, SignupPasswordOptions, FederatedSignupOptions, SwitchConnectionOptions } from '@auth0/auth0-acul-js/signup-password';
2
2
  export declare const useUser: () => import("@auth0/auth0-acul-js").UserMembers, useTenant: () => import("@auth0/auth0-acul-js").TenantMembers, useBranding: () => import("@auth0/auth0-acul-js").BrandingMembers, useClient: () => import("@auth0/auth0-acul-js").ClientMembers, useOrganization: () => import("@auth0/auth0-acul-js").OrganizationMembers, usePrompt: () => import("@auth0/auth0-acul-js").PromptMembers, useScreen: () => import("@auth0/auth0-acul-js").ScreenMembersOnSignupPassword, useTransaction: () => import("@auth0/auth0-acul-js").TransactionMembersOnSignupPassword, useUntrustedData: () => import("@auth0/auth0-acul-js").UntrustedDataMembers;
3
3
  export declare const signup: (payload: SignupPasswordOptions) => void | Promise<void>;
4
4
  export declare const federatedSignup: (payload: FederatedSignupOptions) => void | Promise<void>;
5
+ export declare const switchConnection: (payload: SwitchConnectionOptions) => void | Promise<void>;
5
6
  export { usePasswordValidation } from '../hooks/utility/validate-password';
6
7
  export { useCurrentScreen, useErrors, useAuth0Themes, type UseErrorOptions, type UseErrorsResult, type ErrorsResult, type ErrorKind, } from '../hooks';
7
8
  export declare const useSignupPassword: () => SignupPasswordMembers;
@@ -1,2 +1,2 @@
1
- import o from"@auth0/auth0-acul-js/signup-password";import{useMemo as r}from"react";export{useAuth0Themes}from"../hooks/common/auth0-themes.js";export{useCurrentScreen}from"../hooks/common/current-screen.js";import{errorManager as s}from"../hooks/common/errors.js";export{useErrors}from"../hooks/common/errors.js";import{ContextHooks as e}from"../hooks/context/index.js";import{registerScreen as t}from"../state/instance-store.js";export{usePasswordValidation}from"../hooks/utility/validate-password.js";const n=t(o),{withError:m}=s,u=new e(n),{useUser:a,useTenant:i,useBranding:p,useClient:c,useOrganization:h,usePrompt:d,useScreen:f,useTransaction:j,useUntrustedData:x}=u,k=o=>m(n.signup(o)),g=o=>m(n.federatedSignup(o)),l=()=>r(()=>n,[]);export{g as federatedSignup,k as signup,p as useBranding,c as useClient,h as useOrganization,d as usePrompt,f as useScreen,l as useSignupPassword,i as useTenant,j as useTransaction,x as useUntrustedData,a as useUser};
1
+ import o from"@auth0/auth0-acul-js/signup-password";import{useMemo as r}from"react";export{useAuth0Themes}from"../hooks/common/auth0-themes.js";export{useCurrentScreen}from"../hooks/common/current-screen.js";import{errorManager as s}from"../hooks/common/errors.js";export{useErrors}from"../hooks/common/errors.js";import{ContextHooks as e}from"../hooks/context/index.js";import{registerScreen as t}from"../state/instance-store.js";export{usePasswordValidation}from"../hooks/utility/validate-password.js";const n=t(o),{withError:m}=s,u=new e(n),{useUser:a,useTenant:i,useBranding:c,useClient:p,useOrganization:h,usePrompt:d,useScreen:f,useTransaction:j,useUntrustedData:x}=u,k=o=>m(n.signup(o)),w=o=>m(n.federatedSignup(o)),g=o=>m(n.switchConnection(o)),l=()=>r(()=>n,[]);export{w as federatedSignup,k as signup,g as switchConnection,c as useBranding,p as useClient,h as useOrganization,d as usePrompt,f as useScreen,l as useSignupPassword,i as useTenant,j as useTransaction,x as useUntrustedData,a as useUser};
2
2
  //# sourceMappingURL=signup-password.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"signup-password.js","sources":["../../src/screens/signup-password.tsx"],"sourcesContent":["import SignupPassword from '@auth0/auth0-acul-js/signup-password';\nimport { useMemo } from 'react';\n\nimport { ContextHooks } from '../hooks';\nimport { errorManager } from '../hooks';\nimport { registerScreen } from '../state/instance-store';\n\nimport type {\n SignupPasswordMembers,\n SignupPasswordOptions,\n FederatedSignupOptions,\n} from '@auth0/auth0-acul-js/signup-password';\n\n// Register the singleton instance of SignupPassword\nconst instance = registerScreen<SignupPasswordMembers>(SignupPassword)!;\n\n// Error wrapper\nconst { withError } = errorManager;\n\n// Context hooks\nconst factory = new ContextHooks<SignupPasswordMembers>(instance);\nexport const {\n useUser,\n useTenant,\n useBranding,\n useClient,\n useOrganization,\n usePrompt,\n useScreen,\n useTransaction,\n useUntrustedData,\n} = factory;\n\n// Submit functions\nexport const signup = (payload: SignupPasswordOptions) => withError(instance.signup(payload));\nexport const federatedSignup = (payload: FederatedSignupOptions) =>\n withError(instance.federatedSignup(payload));\n\n// Utility Hooks\nexport { usePasswordValidation } from '../hooks/utility/validate-password';\n\n// Common hooks\nexport {\n useCurrentScreen,\n useErrors,\n useAuth0Themes,\n type UseErrorOptions,\n type UseErrorsResult,\n type ErrorsResult,\n type ErrorKind,\n} from '../hooks';\n\n// Main instance hook. Returns singleton instance of SignupPassword\nexport const useSignupPassword = (): SignupPasswordMembers => useMemo(() => instance, []);\n\n// Export all types from the core SDK for this screen\n"],"names":["instance","registerScreen","SignupPassword","withError","errorManager","factory","ContextHooks","useUser","useTenant","useBranding","useClient","useOrganization","usePrompt","useScreen","useTransaction","useUntrustedData","signup","payload","federatedSignup","useSignupPassword","useMemo"],"mappings":"wfAcA,MAAMA,EAAWC,EAAsCC,IAGjDC,UAAEA,GAAcC,EAGhBC,EAAU,IAAIC,EAAoCN,IAC3CO,QACXA,EAAOC,UACPA,EAASC,YACTA,EAAWC,UACXA,EAASC,gBACTA,EAAeC,UACfA,EAASC,UACTA,EAASC,eACTA,EAAcC,iBACdA,GACEV,EAGSW,EAAUC,GAAmCd,EAAUH,EAASgB,OAAOC,IACvEC,EAAmBD,GAC9Bd,EAAUH,EAASkB,gBAAgBD,IAiBxBE,EAAoB,IAA6BC,EAAQ,IAAMpB,EAAU"}
1
+ {"version":3,"file":"signup-password.js","sources":["../../src/screens/signup-password.tsx"],"sourcesContent":["import SignupPassword from '@auth0/auth0-acul-js/signup-password';\nimport { useMemo } from 'react';\n\nimport { ContextHooks } from '../hooks';\nimport { errorManager } from '../hooks';\nimport { registerScreen } from '../state/instance-store';\n\nimport type {\n SignupPasswordMembers,\n SignupPasswordOptions,\n FederatedSignupOptions,\n SwitchConnectionOptions,\n} from '@auth0/auth0-acul-js/signup-password';\n\n// Register the singleton instance of SignupPassword\nconst instance = registerScreen<SignupPasswordMembers>(SignupPassword)!;\n\n// Error wrapper\nconst { withError } = errorManager;\n\n// Context hooks\nconst factory = new ContextHooks<SignupPasswordMembers>(instance);\nexport const {\n useUser,\n useTenant,\n useBranding,\n useClient,\n useOrganization,\n usePrompt,\n useScreen,\n useTransaction,\n useUntrustedData,\n} = factory;\n\n// Submit functions\nexport const signup = (payload: SignupPasswordOptions) => withError(instance.signup(payload));\nexport const federatedSignup = (payload: FederatedSignupOptions) =>\n withError(instance.federatedSignup(payload));\nexport const switchConnection = (payload: SwitchConnectionOptions) =>\n withError(instance.switchConnection(payload));\n\n// Utility Hooks\nexport { usePasswordValidation } from '../hooks/utility/validate-password';\n\n// Common hooks\nexport {\n useCurrentScreen,\n useErrors,\n useAuth0Themes,\n type UseErrorOptions,\n type UseErrorsResult,\n type ErrorsResult,\n type ErrorKind,\n} from '../hooks';\n\n// Main instance hook. Returns singleton instance of SignupPassword\nexport const useSignupPassword = (): SignupPasswordMembers => useMemo(() => instance, []);\n\n// Export all types from the core SDK for this screen\n"],"names":["instance","registerScreen","SignupPassword","withError","errorManager","factory","ContextHooks","useUser","useTenant","useBranding","useClient","useOrganization","usePrompt","useScreen","useTransaction","useUntrustedData","signup","payload","federatedSignup","switchConnection","useSignupPassword","useMemo"],"mappings":"wfAeA,MAAMA,EAAWC,EAAsCC,IAGjDC,UAAEA,GAAcC,EAGhBC,EAAU,IAAIC,EAAoCN,IAC3CO,QACXA,EAAOC,UACPA,EAASC,YACTA,EAAWC,UACXA,EAASC,gBACTA,EAAeC,UACfA,EAASC,UACTA,EAASC,eACTA,EAAcC,iBACdA,GACEV,EAGSW,EAAUC,GAAmCd,EAAUH,EAASgB,OAAOC,IACvEC,EAAmBD,GAC9Bd,EAAUH,EAASkB,gBAAgBD,IACxBE,EAAoBF,GAC/Bd,EAAUH,EAASmB,iBAAiBF,IAiBzBG,EAAoB,IAA6BC,EAAQ,IAAMrB,EAAU"}
@@ -4,12 +4,12 @@ export interface ErrorItem extends Auth0Error {
4
4
  label?: string;
5
5
  kind?: ErrorKind;
6
6
  }
7
- export type ErrorKind = 'server' | 'client' | 'developer';
7
+ export type ErrorKind = 'auth0' | 'validation' | 'configuration';
8
8
  export declare const ERROR_KINDS: ErrorKind[];
9
9
  type Bucket = {
10
- server: ReadonlyArray<ErrorItem>;
11
- client: ReadonlyArray<ErrorItem>;
12
- developer: ReadonlyArray<ErrorItem>;
10
+ auth0: ReadonlyArray<ErrorItem>;
11
+ validation: ReadonlyArray<ErrorItem>;
12
+ configuration: ReadonlyArray<ErrorItem>;
13
13
  };
14
14
  type Listener = () => void;
15
15
  /**
@@ -1,2 +1,2 @@
1
- const e=["server","client","developer"];function t(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r].id!==t[r].id)return!1;return!0}const r=Object.freeze({server:Object.freeze([]),client:Object.freeze([]),developer:Object.freeze([])});let s=0;const i=new class{constructor(){this.bucket=r,this.listeners=new Set}subscribe(e){return this.listeners.add(e),()=>this.listeners.delete(e)}snapshot(){return this.bucket}normalize(e){return Object.freeze(e.map(e=>Object.freeze({...e,id:e.id??`${Date.now()}-${s++}`})))}replace(e,r){const s=this.normalize(r);t(this.bucket[e],s)||(this.bucket=Object.freeze({...this.bucket,[e]:s}),this.notify())}replacePartial(e,r,s){const i=this.normalize(r),c=this.bucket[e].filter(e=>e.field!==s),n=Object.freeze([...c,...i]);t(this.bucket[e],n)||(this.bucket=Object.freeze({...this.bucket,[e]:n}),this.notify())}push(e,t){const r=Array.isArray(t)?t:[t];if(0===r.length)return;const s=Object.freeze([...this.bucket[e],...this.normalize(r)]);this.bucket=Object.freeze({...this.bucket,[e]:s}),this.notify()}clear(t=e){let r=!1;const s={...this.bucket};for(const e of t)this.bucket[e].length>0&&(s[e]=Object.freeze([]),r=!0);r&&(this.bucket=Object.freeze(s),this.notify())}remove(t=e,r){const s="string"==typeof r?e=>e.id===r:r;let i=!1;const c={...this.bucket};for(const e of t){const t=this.bucket[e].filter(e=>!s(e));t.length!==this.bucket[e].length&&(c[e]=Object.freeze(t),i=!0)}i&&(this.bucket=Object.freeze(c),this.notify())}notify(){for(const e of this.listeners)e()}};export{e as ERROR_KINDS,i as errorStore};
1
+ const e=["auth0","validation","configuration"];function t(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let i=0;i<e.length;i++)if(e[i].id!==t[i].id)return!1;return!0}const i=Object.freeze({auth0:Object.freeze([]),validation:Object.freeze([]),configuration:Object.freeze([])});let s=0;const r=new class{constructor(){this.bucket=i,this.listeners=new Set}subscribe(e){return this.listeners.add(e),()=>this.listeners.delete(e)}snapshot(){return this.bucket}normalize(e){return Object.freeze(e.map(e=>Object.freeze({...e,id:e.id??`${Date.now()}-${s++}`})))}replace(e,i){const s=this.normalize(i);t(this.bucket[e],s)||(this.bucket=Object.freeze({...this.bucket,[e]:s}),this.notify())}replacePartial(e,i,s){const r=this.normalize(i),c=this.bucket[e].filter(e=>e.field!==s),n=Object.freeze([...c,...r]);t(this.bucket[e],n)||(this.bucket=Object.freeze({...this.bucket,[e]:n}),this.notify())}push(e,t){const i=Array.isArray(t)?t:[t];if(0===i.length)return;const s=Object.freeze([...this.bucket[e],...this.normalize(i)]);this.bucket=Object.freeze({...this.bucket,[e]:s}),this.notify()}clear(t=e){let i=!1;const s={...this.bucket};for(const e of t)this.bucket[e].length>0&&(s[e]=Object.freeze([]),i=!0);i&&(this.bucket=Object.freeze(s),this.notify())}remove(t=e,i){const s="string"==typeof i?e=>e.id===i:i;let r=!1;const c={...this.bucket};for(const e of t){const t=this.bucket[e].filter(e=>!s(e));t.length!==this.bucket[e].length&&(c[e]=Object.freeze(t),r=!0)}r&&(this.bucket=Object.freeze(c),this.notify())}notify(){for(const e of this.listeners)e()}};export{e as ERROR_KINDS,r as errorStore};
2
2
  //# sourceMappingURL=error-store.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"error-store.js","sources":["../../src/state/error-store.ts"],"sourcesContent":["import type { Error as Auth0Error } from '@auth0/auth0-acul-js';\n\nexport interface ErrorItem extends Auth0Error {\n id: string;\n label?: string;\n kind?: ErrorKind;\n}\n\nexport type ErrorKind = 'server' | 'client' | 'developer';\n\nexport const ERROR_KINDS: ErrorKind[] = ['server', 'client', 'developer'];\n\ntype Bucket = {\n server: ReadonlyArray<ErrorItem>;\n client: ReadonlyArray<ErrorItem>;\n developer: ReadonlyArray<ErrorItem>;\n};\n\ntype Listener = () => void;\n\n/** Compare two error lists by id only for maximal speed. */\nfunction listsEqual(a: ReadonlyArray<ErrorItem>, b: ReadonlyArray<ErrorItem>) {\n if (a === b) return true;\n if (a.length !== b.length) return false;\n for (let i = 0; i < a.length; i++) {\n if (a[i].id !== b[i].id) return false;\n }\n return true;\n}\n\nconst EMPTY_BUCKET: Bucket = Object.freeze({\n server: Object.freeze([]),\n client: Object.freeze([]),\n developer: Object.freeze([]),\n});\n\nlet nextId = 0;\nconst genId = () => `${Date.now()}-${nextId++}`;\n\n/**\n * Global error store for ACUL (one screen per page).\n * - Holds a single bucket of errors across the current page.\n * - Generates stable ids for every inserted error.\n * - Emits immutable snapshots to subscribers.\n */\nclass ErrorStore {\n private bucket: Bucket = EMPTY_BUCKET;\n private listeners: Set<Listener> = new Set();\n\n subscribe(cb: Listener): () => void {\n this.listeners.add(cb);\n return () => this.listeners.delete(cb);\n }\n\n snapshot(): Readonly<Bucket> {\n return this.bucket;\n }\n\n /** Add ids and freeze an array of ErrorItem-like objects. */\n private normalize(\n list: Array<Omit<ErrorItem, 'id'> & { id?: string }>\n ): ReadonlyArray<ErrorItem> {\n return Object.freeze(\n list.map((e) =>\n Object.freeze({\n ...e,\n id: e.id ?? genId(),\n })\n )\n );\n }\n\n /** Replace an entire kind with a new list (generating ids if needed). */\n replace(kind: ErrorKind, list: Array<Omit<ErrorItem, 'id'> | ErrorItem>) {\n const nextList = this.normalize(list);\n if (listsEqual(this.bucket[kind], nextList)) return;\n\n this.bucket = Object.freeze({\n ...this.bucket,\n [kind]: nextList,\n });\n this.notify();\n }\n\n /**\n * Replace only errors for a specific field within a kind.\n * - Keeps all existing errors for other fields.\n * - Normalizes incoming errors and replaces matching field ones.\n */\n replacePartial(kind: ErrorKind, list: Array<Omit<ErrorItem, 'id'> | ErrorItem>, field: string) {\n const incoming = this.normalize(list);\n const existing = this.bucket[kind].filter((e) => e.field !== field);\n const nextKindList = Object.freeze([...existing, ...incoming]);\n\n if (listsEqual(this.bucket[kind], nextKindList)) return;\n\n this.bucket = Object.freeze({\n ...this.bucket,\n [kind]: nextKindList,\n });\n this.notify();\n }\n\n /** Append one or more items to a kind. */\n push(\n kind: ErrorKind,\n list: Omit<ErrorItem, 'id'> | ErrorItem | Array<Omit<ErrorItem, 'id'> | ErrorItem>\n ) {\n const arr = Array.isArray(list) ? list : [list];\n if (arr.length === 0) return;\n\n const nextKindList = Object.freeze([...this.bucket[kind], ...this.normalize(arr)]);\n this.bucket = Object.freeze({\n ...this.bucket,\n [kind]: nextKindList,\n });\n this.notify();\n }\n\n /** Clear one or more kinds (default: all kinds). */\n clear(kinds: ErrorKind[] = ERROR_KINDS) {\n let changed = false;\n const next: Bucket = { ...this.bucket };\n\n for (const k of kinds) {\n if (this.bucket[k].length > 0) {\n next[k] = Object.freeze([]);\n changed = true;\n }\n }\n\n if (!changed) return;\n this.bucket = Object.freeze(next);\n this.notify();\n }\n\n /**\n * Remove errors that match a given id or predicate from specified kinds.\n */\n remove(kinds: ErrorKind[] = ERROR_KINDS, test: string | ((e: ErrorItem) => boolean)) {\n const isMatch = typeof test === 'string' ? (e: ErrorItem) => e.id === test : test;\n\n let changed = false;\n const next: Bucket = { ...this.bucket };\n\n for (const k of kinds) {\n const filtered = this.bucket[k].filter((e) => !isMatch(e));\n if (filtered.length !== this.bucket[k].length) {\n next[k] = Object.freeze(filtered);\n changed = true;\n }\n }\n\n if (!changed) return;\n this.bucket = Object.freeze(next);\n this.notify();\n }\n\n private notify() {\n for (const cb of this.listeners) cb();\n }\n}\n\nexport const errorStore = new ErrorStore();\n"],"names":["ERROR_KINDS","listsEqual","a","b","length","i","id","EMPTY_BUCKET","Object","freeze","server","client","developer","nextId","errorStore","constructor","this","bucket","listeners","Set","subscribe","cb","add","delete","snapshot","normalize","list","map","e","Date","now","replace","kind","nextList","notify","replacePartial","field","incoming","existing","filter","nextKindList","push","arr","Array","isArray","clear","kinds","changed","next","k","remove","test","isMatch","filtered"],"mappings":"AAUO,MAAMA,EAA2B,CAAC,SAAU,SAAU,aAW7D,SAASC,EAAWC,EAA6BC,GAC/C,GAAID,IAAMC,EAAG,OAAO,EACpB,GAAID,EAAEE,SAAWD,EAAEC,OAAQ,OAAO,EAClC,IAAK,IAAIC,EAAI,EAAGA,EAAIH,EAAEE,OAAQC,IAC5B,GAAIH,EAAEG,GAAGC,KAAOH,EAAEE,GAAGC,GAAI,OAAO,EAElC,OAAO,CACT,CAEA,MAAMC,EAAuBC,OAAOC,OAAO,CACzCC,OAAQF,OAAOC,OAAO,IACtBE,OAAQH,OAAOC,OAAO,IACtBG,UAAWJ,OAAOC,OAAO,MAG3B,IAAII,EAAS,EA+HN,MAAMC,EAAa,IAtH1B,MAAA,WAAAC,GACUC,KAAAC,OAAiBV,EACjBS,KAAAE,UAA2B,IAAIC,GAkHzC,CAhHE,SAAAC,CAAUC,GAER,OADAL,KAAKE,UAAUI,IAAID,GACZ,IAAML,KAAKE,UAAUK,OAAOF,EACrC,CAEA,QAAAG,GACE,OAAOR,KAAKC,MACd,CAGQ,SAAAQ,CACNC,GAEA,OAAOlB,OAAOC,OACZiB,EAAKC,IAAKC,GACRpB,OAAOC,OAAO,IACTmB,EACHtB,GAAIsB,EAAEtB,IA7BI,GAAGuB,KAAKC,SAASjB,SAiCnC,CAGA,OAAAkB,CAAQC,EAAiBN,GACvB,MAAMO,EAAWjB,KAAKS,UAAUC,GAC5BzB,EAAWe,KAAKC,OAAOe,GAAOC,KAElCjB,KAAKC,OAAST,OAAOC,OAAO,IACvBO,KAAKC,OACRe,CAACA,GAAOC,IAEVjB,KAAKkB,SACP,CAOA,cAAAC,CAAeH,EAAiBN,EAAgDU,GAC9E,MAAMC,EAAWrB,KAAKS,UAAUC,GAC1BY,EAAWtB,KAAKC,OAAOe,GAAMO,OAAQX,GAAMA,EAAEQ,QAAUA,GACvDI,EAAehC,OAAOC,OAAO,IAAI6B,KAAaD,IAEhDpC,EAAWe,KAAKC,OAAOe,GAAOQ,KAElCxB,KAAKC,OAAST,OAAOC,OAAO,IACvBO,KAAKC,OACRe,CAACA,GAAOQ,IAEVxB,KAAKkB,SACP,CAGA,IAAAO,CACET,EACAN,GAEA,MAAMgB,EAAMC,MAAMC,QAAQlB,GAAQA,EAAO,CAACA,GAC1C,GAAmB,IAAfgB,EAAItC,OAAc,OAEtB,MAAMoC,EAAehC,OAAOC,OAAO,IAAIO,KAAKC,OAAOe,MAAUhB,KAAKS,UAAUiB,KAC5E1B,KAAKC,OAAST,OAAOC,OAAO,IACvBO,KAAKC,OACRe,CAACA,GAAOQ,IAEVxB,KAAKkB,QACP,CAGA,KAAAW,CAAMC,EAAqB9C,GACzB,IAAI+C,GAAU,EACd,MAAMC,EAAe,IAAKhC,KAAKC,QAE/B,IAAK,MAAMgC,KAAKH,EACV9B,KAAKC,OAAOgC,GAAG7C,OAAS,IAC1B4C,EAAKC,GAAKzC,OAAOC,OAAO,IACxBsC,GAAU,GAITA,IACL/B,KAAKC,OAAST,OAAOC,OAAOuC,GAC5BhC,KAAKkB,SACP,CAKA,MAAAgB,CAAOJ,EAAqB9C,EAAamD,GACvC,MAAMC,EAA0B,iBAATD,EAAqBvB,GAAiBA,EAAEtB,KAAO6C,EAAOA,EAE7E,IAAIJ,GAAU,EACd,MAAMC,EAAe,IAAKhC,KAAKC,QAE/B,IAAK,MAAMgC,KAAKH,EAAO,CACrB,MAAMO,EAAWrC,KAAKC,OAAOgC,GAAGV,OAAQX,IAAOwB,EAAQxB,IACnDyB,EAASjD,SAAWY,KAAKC,OAAOgC,GAAG7C,SACrC4C,EAAKC,GAAKzC,OAAOC,OAAO4C,GACxBN,GAAU,EAEd,CAEKA,IACL/B,KAAKC,OAAST,OAAOC,OAAOuC,GAC5BhC,KAAKkB,SACP,CAEQ,MAAAA,GACN,IAAK,MAAMb,KAAML,KAAKE,UAAWG,GACnC"}
1
+ {"version":3,"file":"error-store.js","sources":["../../src/state/error-store.ts"],"sourcesContent":["import type { Error as Auth0Error } from '@auth0/auth0-acul-js';\n\nexport interface ErrorItem extends Auth0Error {\n id: string;\n label?: string;\n kind?: ErrorKind;\n}\n\nexport type ErrorKind = 'auth0' | 'validation' | 'configuration';\n\nexport const ERROR_KINDS: ErrorKind[] = ['auth0', 'validation', 'configuration'];\n\ntype Bucket = {\n auth0: ReadonlyArray<ErrorItem>;\n validation: ReadonlyArray<ErrorItem>;\n configuration: ReadonlyArray<ErrorItem>;\n};\n\ntype Listener = () => void;\n\n/** Compare two error lists by id only for maximal speed. */\nfunction listsEqual(a: ReadonlyArray<ErrorItem>, b: ReadonlyArray<ErrorItem>) {\n if (a === b) return true;\n if (a.length !== b.length) return false;\n for (let i = 0; i < a.length; i++) {\n if (a[i].id !== b[i].id) return false;\n }\n return true;\n}\n\nconst EMPTY_BUCKET: Bucket = Object.freeze({\n auth0: Object.freeze([]),\n validation: Object.freeze([]),\n configuration: Object.freeze([]),\n});\n\nlet nextId = 0;\nconst genId = () => `${Date.now()}-${nextId++}`;\n\n/**\n * Global error store for ACUL (one screen per page).\n * - Holds a single bucket of errors across the current page.\n * - Generates stable ids for every inserted error.\n * - Emits immutable snapshots to subscribers.\n */\nclass ErrorStore {\n private bucket: Bucket = EMPTY_BUCKET;\n private listeners: Set<Listener> = new Set();\n\n subscribe(cb: Listener): () => void {\n this.listeners.add(cb);\n return () => this.listeners.delete(cb);\n }\n\n snapshot(): Readonly<Bucket> {\n return this.bucket;\n }\n\n /** Add ids and freeze an array of ErrorItem-like objects. */\n private normalize(\n list: Array<Omit<ErrorItem, 'id'> & { id?: string }>\n ): ReadonlyArray<ErrorItem> {\n return Object.freeze(\n list.map((e) =>\n Object.freeze({\n ...e,\n id: e.id ?? genId(),\n })\n )\n );\n }\n\n /** Replace an entire kind with a new list (generating ids if needed). */\n replace(kind: ErrorKind, list: Array<Omit<ErrorItem, 'id'> | ErrorItem>) {\n const nextList = this.normalize(list);\n if (listsEqual(this.bucket[kind], nextList)) return;\n\n this.bucket = Object.freeze({\n ...this.bucket,\n [kind]: nextList,\n });\n this.notify();\n }\n\n /**\n * Replace only errors for a specific field within a kind.\n * - Keeps all existing errors for other fields.\n * - Normalizes incoming errors and replaces matching field ones.\n */\n replacePartial(kind: ErrorKind, list: Array<Omit<ErrorItem, 'id'> | ErrorItem>, field: string) {\n const incoming = this.normalize(list);\n const existing = this.bucket[kind].filter((e) => e.field !== field);\n const nextKindList = Object.freeze([...existing, ...incoming]);\n\n if (listsEqual(this.bucket[kind], nextKindList)) return;\n\n this.bucket = Object.freeze({\n ...this.bucket,\n [kind]: nextKindList,\n });\n this.notify();\n }\n\n /** Append one or more items to a kind. */\n push(\n kind: ErrorKind,\n list: Omit<ErrorItem, 'id'> | ErrorItem | Array<Omit<ErrorItem, 'id'> | ErrorItem>\n ) {\n const arr = Array.isArray(list) ? list : [list];\n if (arr.length === 0) return;\n\n const nextKindList = Object.freeze([...this.bucket[kind], ...this.normalize(arr)]);\n this.bucket = Object.freeze({\n ...this.bucket,\n [kind]: nextKindList,\n });\n this.notify();\n }\n\n /** Clear one or more kinds (default: all kinds). */\n clear(kinds: ErrorKind[] = ERROR_KINDS) {\n let changed = false;\n const next: Bucket = { ...this.bucket };\n\n for (const k of kinds) {\n if (this.bucket[k].length > 0) {\n next[k] = Object.freeze([]);\n changed = true;\n }\n }\n\n if (!changed) return;\n this.bucket = Object.freeze(next);\n this.notify();\n }\n\n /**\n * Remove errors that match a given id or predicate from specified kinds.\n */\n remove(kinds: ErrorKind[] = ERROR_KINDS, test: string | ((e: ErrorItem) => boolean)) {\n const isMatch = typeof test === 'string' ? (e: ErrorItem) => e.id === test : test;\n\n let changed = false;\n const next: Bucket = { ...this.bucket };\n\n for (const k of kinds) {\n const filtered = this.bucket[k].filter((e) => !isMatch(e));\n if (filtered.length !== this.bucket[k].length) {\n next[k] = Object.freeze(filtered);\n changed = true;\n }\n }\n\n if (!changed) return;\n this.bucket = Object.freeze(next);\n this.notify();\n }\n\n private notify() {\n for (const cb of this.listeners) cb();\n }\n}\n\nexport const errorStore = new ErrorStore();\n"],"names":["ERROR_KINDS","listsEqual","a","b","length","i","id","EMPTY_BUCKET","Object","freeze","auth0","validation","configuration","nextId","errorStore","constructor","this","bucket","listeners","Set","subscribe","cb","add","delete","snapshot","normalize","list","map","e","Date","now","replace","kind","nextList","notify","replacePartial","field","incoming","existing","filter","nextKindList","push","arr","Array","isArray","clear","kinds","changed","next","k","remove","test","isMatch","filtered"],"mappings":"AAUO,MAAMA,EAA2B,CAAC,QAAS,aAAc,iBAWhE,SAASC,EAAWC,EAA6BC,GAC/C,GAAID,IAAMC,EAAG,OAAO,EACpB,GAAID,EAAEE,SAAWD,EAAEC,OAAQ,OAAO,EAClC,IAAK,IAAIC,EAAI,EAAGA,EAAIH,EAAEE,OAAQC,IAC5B,GAAIH,EAAEG,GAAGC,KAAOH,EAAEE,GAAGC,GAAI,OAAO,EAElC,OAAO,CACT,CAEA,MAAMC,EAAuBC,OAAOC,OAAO,CACzCC,MAAOF,OAAOC,OAAO,IACrBE,WAAYH,OAAOC,OAAO,IAC1BG,cAAeJ,OAAOC,OAAO,MAG/B,IAAII,EAAS,EA+HN,MAAMC,EAAa,IAtH1B,MAAA,WAAAC,GACUC,KAAAC,OAAiBV,EACjBS,KAAAE,UAA2B,IAAIC,GAkHzC,CAhHE,SAAAC,CAAUC,GAER,OADAL,KAAKE,UAAUI,IAAID,GACZ,IAAML,KAAKE,UAAUK,OAAOF,EACrC,CAEA,QAAAG,GACE,OAAOR,KAAKC,MACd,CAGQ,SAAAQ,CACNC,GAEA,OAAOlB,OAAOC,OACZiB,EAAKC,IAAKC,GACRpB,OAAOC,OAAO,IACTmB,EACHtB,GAAIsB,EAAEtB,IA7BI,GAAGuB,KAAKC,SAASjB,SAiCnC,CAGA,OAAAkB,CAAQC,EAAiBN,GACvB,MAAMO,EAAWjB,KAAKS,UAAUC,GAC5BzB,EAAWe,KAAKC,OAAOe,GAAOC,KAElCjB,KAAKC,OAAST,OAAOC,OAAO,IACvBO,KAAKC,OACRe,CAACA,GAAOC,IAEVjB,KAAKkB,SACP,CAOA,cAAAC,CAAeH,EAAiBN,EAAgDU,GAC9E,MAAMC,EAAWrB,KAAKS,UAAUC,GAC1BY,EAAWtB,KAAKC,OAAOe,GAAMO,OAAQX,GAAMA,EAAEQ,QAAUA,GACvDI,EAAehC,OAAOC,OAAO,IAAI6B,KAAaD,IAEhDpC,EAAWe,KAAKC,OAAOe,GAAOQ,KAElCxB,KAAKC,OAAST,OAAOC,OAAO,IACvBO,KAAKC,OACRe,CAACA,GAAOQ,IAEVxB,KAAKkB,SACP,CAGA,IAAAO,CACET,EACAN,GAEA,MAAMgB,EAAMC,MAAMC,QAAQlB,GAAQA,EAAO,CAACA,GAC1C,GAAmB,IAAfgB,EAAItC,OAAc,OAEtB,MAAMoC,EAAehC,OAAOC,OAAO,IAAIO,KAAKC,OAAOe,MAAUhB,KAAKS,UAAUiB,KAC5E1B,KAAKC,OAAST,OAAOC,OAAO,IACvBO,KAAKC,OACRe,CAACA,GAAOQ,IAEVxB,KAAKkB,QACP,CAGA,KAAAW,CAAMC,EAAqB9C,GACzB,IAAI+C,GAAU,EACd,MAAMC,EAAe,IAAKhC,KAAKC,QAE/B,IAAK,MAAMgC,KAAKH,EACV9B,KAAKC,OAAOgC,GAAG7C,OAAS,IAC1B4C,EAAKC,GAAKzC,OAAOC,OAAO,IACxBsC,GAAU,GAITA,IACL/B,KAAKC,OAAST,OAAOC,OAAOuC,GAC5BhC,KAAKkB,SACP,CAKA,MAAAgB,CAAOJ,EAAqB9C,EAAamD,GACvC,MAAMC,EAA0B,iBAATD,EAAqBvB,GAAiBA,EAAEtB,KAAO6C,EAAOA,EAE7E,IAAIJ,GAAU,EACd,MAAMC,EAAe,IAAKhC,KAAKC,QAE/B,IAAK,MAAMgC,KAAKH,EAAO,CACrB,MAAMO,EAAWrC,KAAKC,OAAOgC,GAAGV,OAAQX,IAAOwB,EAAQxB,IACnDyB,EAASjD,SAAWY,KAAKC,OAAOgC,GAAG7C,SACrC4C,EAAKC,GAAKzC,OAAOC,OAAO4C,GACxBN,GAAU,EAEd,CAEKA,IACL/B,KAAKC,OAAST,OAAOC,OAAOuC,GAC5BhC,KAAKkB,SACP,CAEQ,MAAAA,GACN,IAAK,MAAMb,KAAML,KAAKE,UAAWG,GACnC"}
package/dist/telemetry.js CHANGED
@@ -1,2 +1,2 @@
1
- globalThis.__ACUL_SDK_NAME__="@auth0/auth0-acul-react",globalThis.__ACUL_SDK_VERSION__="1.0.0-alpha.0";
1
+ globalThis.__ACUL_SDK_NAME__="@auth0/auth0-acul-react",globalThis.__ACUL_SDK_VERSION__="1.0.0-alpha.2";
2
2
  //# sourceMappingURL=telemetry.js.map