import { i as ActorRefFrom } from "./spawn-D9jgw9pW.js"; import { t as Manager } from "./Manager-CQQ99QOI.js"; import "./Actor-iTq7YY48.js"; import { n as RedirectToMobileServices, t as RedirectToMobileConfig } from "./types-DPIDuhut.js"; //#region src/modules/redirect-to-mobile/redirectToMobileStateMachine.d.ts declare const redirectToMobileMachine: any; type RedirectToMobileMachine = typeof redirectToMobileMachine; //#endregion //#region src/modules/redirect-to-mobile/redirectToMobileActor.d.ts type CreateRedirectToMobileActorOptions = { config: RedirectToMobileConfig; services?: Partial; }; type RedirectToMobileActor = ActorRefFrom; //#endregion //#region src/modules/redirect-to-mobile/redirectToMobileManager.d.ts type RedirectToMobileIdleState = { status: 'idle'; }; type RedirectToMobileLoadingState = { status: 'loading'; }; type RedirectToMobileRedirectingState = { status: 'redirecting'; redirectUrl: string; phonePrefix: string; smsSent: boolean; smsFailed: boolean; smsResendTimer: number; canResendSms: boolean; error: string | undefined; }; type RedirectToMobileFinishedState = { status: 'finished'; }; /** * User pressed "Continue on Desktop" — the desktop flow should advance past * this module rather than terminate. Distinct from `closed` (which follows * the SDK-wide "user dismissed" convention) so hosts can wire this to a * separate `onContinue` callback without conflating it with an error. */ type RedirectToMobileContinueState = { status: 'continue'; }; type RedirectToMobileClosedState = { status: 'closed'; }; type RedirectToMobileErrorState = { status: 'error'; error: string; }; type RedirectToMobileState = RedirectToMobileIdleState | RedirectToMobileLoadingState | RedirectToMobileRedirectingState | RedirectToMobileFinishedState | RedirectToMobileContinueState | RedirectToMobileClosedState | RedirectToMobileErrorState; /** * Creates a redirect-to-mobile manager for cross-device onboarding flows. * * On desktop, displays a QR code (and optional SMS input) so the user can * continue on their mobile device. Polls the backend until the mobile * session completes, then transitions to `finished`. * * @param options - Configuration for the redirect module * @returns A manager instance with state subscription and API methods * * @example * ```ts * const manager = createRedirectToMobileManager({ * config: { disableSmsOption: false, addContinueToDesktop: true }, * }); * * manager.subscribe((state) => { * if (state.status === 'redirecting') { * renderQrCode(state.redirectUrl); * } * if (state.status === 'finished') { * console.log('Mobile onboarding complete'); * } * }); * * manager.load(); * ``` */ declare function createRedirectToMobileManager(options: CreateRedirectToMobileActorOptions): Manager & { /** * Starts the redirect-to-mobile flow by fetching the redirect URL. */ load(): void; /** * Sends an SMS with the redirect link to the given phone number. * @param phone - Full phone number with country code */ sendSms(phone: string): void; /** * Skips the redirect and allows the user to continue on desktop. */ continueOnDesktop(): void; /** * Resets the SMS state so the user can re-enter their phone number. */ resetSms(): void; /** * Closes/dismisses the redirect screen. */ close(): void; /** * Retries generating the redirect URL after an error. */ retry(): void; }; /** * Creates a redirect-to-mobile manager from a pre-built actor. * Use this when overriding the machine via `.provide()` for custom backends * or for story-isolation testing. */ declare function createRedirectToMobileManagerFromActor(actor: RedirectToMobileActor): Manager & { /** * Starts the redirect-to-mobile flow by fetching the redirect URL. */ load(): void; /** * Sends an SMS with the redirect link to the given phone number. * @param phone - Full phone number with country code */ sendSms(phone: string): void; /** * Skips the redirect and allows the user to continue on desktop. */ continueOnDesktop(): void; /** * Resets the SMS state so the user can re-enter their phone number. */ resetSms(): void; /** * Closes/dismisses the redirect screen. */ close(): void; /** * Retries generating the redirect URL after an error. */ retry(): void; }; type RedirectToMobileManager = ReturnType; //#endregion export { RedirectToMobileActor as a, createRedirectToMobileManagerFromActor as i, RedirectToMobileState as n, redirectToMobileMachine as o, createRedirectToMobileManager as r, RedirectToMobileManager as t };