import { A as StateMachine, C as StateValue, D as PromiseActorLogic, a as ActorRefFromLogic, b as RequiredActorOptions, c as AnyEventObject, g as IsNotNever, h as InputFrom, i as ActorRefFrom, k as MachineSnapshot, m as GetConcreteByKey, o as AnyActorLogic, p as EventObject, r as ActorRef, s as AnyActorRef, u as ConditionalRequired, v as MetaObject, w as Values, x as RequiredLogicInput, y as NonReducibleUnknown } from "./spawn-D9jgw9pW.js"; import "./StateMachine-EDpYWy0i.js"; import { t as Manager } from "./Manager-CQQ99QOI.js"; import "./Actor-iTq7YY48.js"; import { n as MandatoryConsent, r as MandatoryConsentConfig, t as FetchMandatoryConsentResponse } from "./types-BX_XkMsQ2.js"; //#region src/modules/mandatory-consent/mandatoryConsentStateMachine.d.ts type MandatoryConsentContext = { config: MandatoryConsentConfig; consent: MandatoryConsent | undefined; isSigned: boolean; error: string | undefined; }; type MandatoryConsentInput = { config: MandatoryConsentConfig; }; declare const mandatoryConsentMachine: StateMachine> | ActorRefFromLogic> | undefined; }, Values<{ fetchConsent: { src: "fetchConsent"; logic: PromiseActorLogic; id: string | undefined; }; submitConsent: { src: "submitConsent"; logic: PromiseActorLogic; id: string | undefined; }; }>, Values<{ setConsent: { type: "setConsent"; params: NonReducibleUnknown; }; setError: { type: "setError"; params: NonReducibleUnknown; }; clearError: { type: "clearError"; params: NonReducibleUnknown; }; resetContext: { type: "resetContext"; params: NonReducibleUnknown; }; toggleSigned: { type: "toggleSigned"; params: NonReducibleUnknown; }; }>, { type: "canSubmit"; params: unknown; }, never, "error" | "idle" | "closed" | "finished" | "submitting" | "loading" | "display", string, MandatoryConsentInput, NonReducibleUnknown, EventObject, MetaObject, { readonly id: "mandatoryConsent"; readonly initial: "idle"; readonly context: ({ input }: { spawn: { (logic: TSrc, ...[options]: ({ src: "fetchConsent"; logic: PromiseActorLogic; id: string | undefined; } extends (infer T) ? T extends { src: "fetchConsent"; logic: PromiseActorLogic; id: string | undefined; } ? T extends { src: TSrc; } ? ConditionalRequired<[options?: ({ id?: T["id"] | undefined; systemId?: string; input?: InputFrom | undefined; syncSnapshot?: boolean; } & { [K in RequiredActorOptions]: unknown; }) | undefined], IsNotNever>> : never : never : never) | ({ src: "submitConsent"; logic: PromiseActorLogic; id: string | undefined; } extends (infer T_1) ? T_1 extends { src: "submitConsent"; logic: PromiseActorLogic; id: string | undefined; } ? T_1 extends { src: TSrc; } ? ConditionalRequired<[options?: ({ id?: T_1["id"] | undefined; systemId?: string; input?: InputFrom | undefined; syncSnapshot?: boolean; } & { [K_1 in RequiredActorOptions]: unknown; }) | undefined], IsNotNever>> : never : never : never)): ActorRefFromLogic; id: string | undefined; }; submitConsent: { src: "submitConsent"; logic: PromiseActorLogic; id: string | undefined; }; }>, "src", TSrc>["logic"]>; (src: TLogic, ...[options]: ConditionalRequired<[options?: ({ id?: never; systemId?: string; input?: InputFrom | undefined; syncSnapshot?: boolean; } & { [K in RequiredLogicInput]: unknown; }) | undefined], IsNotNever>>): ActorRefFromLogic; }; input: MandatoryConsentInput; self: ActorRef, StateValue, string, unknown, any, any>, { type: "LOAD"; } | { type: "TOGGLE"; } | { type: "SUBMIT"; } | { type: "CANCEL"; } | { type: "RETRY"; } | { type: "RESET"; }, AnyEventObject>; }) => { config: MandatoryConsentConfig; consent: undefined; isSigned: false; error: undefined; }; readonly states: { readonly idle: { readonly on: { readonly LOAD: { readonly target: "loading"; readonly actions: "clearError"; }; }; }; readonly loading: { readonly invoke: { readonly id: "fetchConsent"; readonly src: "fetchConsent"; readonly input: ({ context }: { context: MandatoryConsentContext; event: { type: "LOAD"; } | { type: "TOGGLE"; } | { type: "SUBMIT"; } | { type: "CANCEL"; } | { type: "RETRY"; } | { type: "RESET"; }; self: ActorRef, StateValue, string, unknown, any, any>, { type: "LOAD"; } | { type: "TOGGLE"; } | { type: "SUBMIT"; } | { type: "CANCEL"; } | { type: "RETRY"; } | { type: "RESET"; }, AnyEventObject>; }) => { config: MandatoryConsentConfig; }; readonly onDone: { readonly target: "display"; readonly actions: "setConsent"; }; readonly onError: { readonly target: "error"; readonly actions: "setError"; }; }; }; readonly display: { readonly on: { readonly TOGGLE: { readonly actions: "toggleSigned"; }; readonly SUBMIT: { readonly target: "submitting"; readonly guard: "canSubmit"; }; readonly CANCEL: { readonly target: "closed"; }; readonly RETRY: { readonly target: "loading"; readonly actions: "clearError"; }; }; }; readonly submitting: { readonly invoke: { readonly id: "submitConsent"; readonly src: "submitConsent"; readonly input: ({ context }: { context: MandatoryConsentContext; event: { type: "LOAD"; } | { type: "TOGGLE"; } | { type: "SUBMIT"; } | { type: "CANCEL"; } | { type: "RETRY"; } | { type: "RESET"; }; self: ActorRef, StateValue, string, unknown, any, any>, { type: "LOAD"; } | { type: "TOGGLE"; } | { type: "SUBMIT"; } | { type: "CANCEL"; } | { type: "RETRY"; } | { type: "RESET"; }, AnyEventObject>; }) => { consentId: string; isSigned: boolean; }; readonly onDone: { readonly target: "finished"; }; readonly onError: { readonly target: "display"; readonly actions: "setError"; }; }; }; readonly error: { readonly on: { readonly RETRY: { readonly target: "loading"; readonly actions: "clearError"; }; readonly CANCEL: { readonly target: "closed"; }; readonly RESET: { readonly target: "idle"; readonly actions: "resetContext"; }; }; }; readonly finished: { readonly type: "final"; }; readonly closed: { readonly type: "final"; }; }; }>; type MandatoryConsentMachine = typeof mandatoryConsentMachine; //#endregion //#region src/modules/mandatory-consent/mandatoryConsentActor.d.ts type CreateMandatoryConsentActorOptions = { config: MandatoryConsentConfig; }; type MandatoryConsentActor = ActorRefFrom; //#endregion //#region src/modules/mandatory-consent/mandatoryConsentManager.d.ts type MandatoryConsentIdleState = { status: 'idle'; }; type MandatoryConsentLoadingState = { status: 'loading'; }; type MandatoryConsentDisplayState = { status: 'display'; title: string; text: string; isSigned: boolean; canSubmit: boolean; error?: string; }; type MandatoryConsentSubmittingState = { status: 'submitting'; title: string; text: string; isSigned: boolean; canSubmit: false; }; type MandatoryConsentFinishedState = { status: 'finished'; }; type MandatoryConsentClosedState = { status: 'closed'; }; type MandatoryConsentErrorState = { status: 'error'; error: string; }; type MandatoryConsentState = MandatoryConsentIdleState | MandatoryConsentLoadingState | MandatoryConsentDisplayState | MandatoryConsentSubmittingState | MandatoryConsentFinishedState | MandatoryConsentClosedState | MandatoryConsentErrorState; declare function createMandatoryConsentManager(options: CreateMandatoryConsentActorOptions): Manager & { load(): void; toggle(): void; submit(): void; cancel(): void; retry(): void; reset(): void; }; /** * Creates a mandatory-consent manager from a pre-built actor. * Use this when overriding the machine via `.provide()` for custom backends * or for story-isolation testing. */ declare function createMandatoryConsentManagerFromActor(actor: MandatoryConsentActor): Manager & { load(): void; toggle(): void; submit(): void; cancel(): void; retry(): void; reset(): void; }; type MandatoryConsentManager = ReturnType; //#endregion export { MandatoryConsentActor as a, createMandatoryConsentManagerFromActor as i, MandatoryConsentState as n, mandatoryConsentMachine as o, createMandatoryConsentManager as r, MandatoryConsentManager as t };