import { i as ActorRefFrom } from "./spawn-D9jgw9pW.js"; import { t as Manager } from "./Manager-CQQ99QOI.js"; import "./Actor-iTq7YY48.js"; import { c as AddressSuggestion } from "./types-Bk_6dmDa.js"; import { i as EkybFormValues, o as EkybValidationErrors, r as EkybFieldDef, s as UboEntry, t as EkybConfig } from "./types-BfHiko5D.js"; //#region src/modules/ekyb/ekybStateMachine.d.ts declare const ekybMachine: any; type EkybMachine = typeof ekybMachine; //#endregion //#region src/modules/ekyb/ekybActor.d.ts type EkybActor = ActorRefFrom; type CreateEkybActorOptions = { config: EkybConfig; }; //#endregion //#region src/modules/ekyb/ekybManager.d.ts type EkybLoadingState = { status: 'loading'; }; type EkybFormState = { status: 'form'; country: string; availableCountries: readonly string[]; fields: EkybFieldDef[]; values: EkybFormValues; validationErrors?: EkybValidationErrors; /** * True when no validation errors are currently displayed. * Optimistic semantic: starts true on initial empty form. * Derived as `Object.keys(validationErrors ?? {}).length === 0`. */ isValid: boolean; ubos: UboEntry[]; canAddUbo: boolean; addressSuggestions: AddressSuggestion[]; }; type EkybSubmittingState = { status: 'submitting'; }; type EkybSuccessState = { status: 'success'; }; type EkybErrorState = { status: 'error'; errorMessage: string; }; type EkybFinishedState = { status: 'finished'; }; type EkybClosedState = { status: 'closed'; }; /** * Discriminated union of all possible eKYB manager states. */ type EkybState = EkybLoadingState | EkybFormState | EkybSubmittingState | EkybSuccessState | EkybErrorState | EkybFinishedState | EkybClosedState; declare function createEkybManagerFromActor(actor: EkybActor): Manager & { /** Initializes the eKYB flow — builds form fields from the provided config */ load(): void; /** Sets the country and resets/revalidates fields */ setCountry(country: string): void; /** Sets a form field value and clears its current validation error */ setField(name: string, value: string): void; /** Runs single-field validation (call on blur) */ validateField(name: string): void; /** Adds a new UBO entry (max 8) */ addUbo(): void; /** Removes a UBO entry by index */ removeUbo(index: number): void; /** Sets a UBO field (name or surname) */ setUboField(index: number, field: "name" | "surname", value: string): void; /** Searches for address suggestions (debounced) */ searchAddress(query: string): void; /** Fills address fields from a selected suggestion */ selectAddress(suggestion: AddressSuggestion): void; /** Submits the form (requires isValid to be true) */ submit(): void; /** Retries from failure state, returning to the form */ retry(): void; /** Closes/dismisses the module */ close(): void; }; /** * Creates an eKYB manager for headless or UI-driven usage. */ declare function createEkybManager(options: CreateEkybActorOptions): Manager & { /** Initializes the eKYB flow — builds form fields from the provided config */ load(): void; /** Sets the country and resets/revalidates fields */ setCountry(country: string): void; /** Sets a form field value and clears its current validation error */ setField(name: string, value: string): void; /** Runs single-field validation (call on blur) */ validateField(name: string): void; /** Adds a new UBO entry (max 8) */ addUbo(): void; /** Removes a UBO entry by index */ removeUbo(index: number): void; /** Sets a UBO field (name or surname) */ setUboField(index: number, field: "name" | "surname", value: string): void; /** Searches for address suggestions (debounced) */ searchAddress(query: string): void; /** Fills address fields from a selected suggestion */ selectAddress(suggestion: AddressSuggestion): void; /** Submits the form (requires isValid to be true) */ submit(): void; /** Retries from failure state, returning to the form */ retry(): void; /** Closes/dismisses the module */ close(): void; }; type EkybManager = ReturnType; //#endregion export { EkybActor as a, createEkybManagerFromActor as i, EkybState as n, ekybMachine as o, createEkybManager as r, EkybManager as t };