import { C as WidgetError, D as WidgetPreferences, E as WidgetFieldError, O as AnyWidgetPosition, T as WidgetEvent, _ as SheetSide, a as BuiltInActionId, b as TicketResult, c as DisplayModeConfig, d as MenuAction, f as MenuActionInput, g as ResolvedDisplayMode, i as AuthMode, k as WidgetPosition, l as EventCallback, m as PublicReply, n as ActionIcon, o as CustomerConfig, p as OidcAuthConfig, r as ActionTrigger, s as DisplayMode, t as ActionContext, u as LocalizedString, v as SubmitTicketData, w as WidgetErrorCode, x as TrackedTicketResult, y as ThemeConfig } from "./types-C92DcfjU.cjs"; import * as react_jsx_runtime0 from "react/jsx-runtime"; import { ReactNode } from "react"; import "@tanstack/react-query"; //#region ../core/dist/index-C2ZClicD.d.ts interface TicketResult$1 { id: string; ticketNumber: string; trackingToken?: string; status: string; } interface WidgetError$1 { code: string; message: string; } //#endregion //#region src/react/types.d.ts type ReactActionIcon = ActionIcon | ReactNode; interface ReactMenuActionInput extends Omit { icon?: ReactActionIcon; } interface ReqdeskProviderProps { apiKey: string; apiUrl?: string; auth?: OidcAuthConfig; theme?: ThemeConfig; language?: string; customer?: CustomerConfig; translations?: Record; authMode?: AuthMode | AuthMode[]; display?: DisplayModeConfig; actions?: ReactMenuActionInput[]; initialPreferences?: WidgetPreferences; userPreferences?: WidgetPreferences; onPreferencesChange?: (next: WidgetPreferences) => void; menuCloseOnAction?: boolean; hideFab?: boolean; hideDisplayModePicker?: boolean; /** * Glyph shown inside the floating action button. Accepts one of the built-in presets * (`'chat'`, `'help'` — default), a raw SVG path `d` string (24×24 viewBox), or any React * node for a fully custom trigger interior. Mirrors `ReqdeskWidgetConfig.fabIcon` but widens * the type to accept `ReactNode` for React-first hosts. */ fabIcon?: 'chat' | 'help' | string | ReactNode; children: ReactNode; } interface TicketFormProps { mode?: 'floating' | 'inline'; position?: AnyWidgetPosition; defaultCategory?: string; onTicketCreated?: (ticket: TicketResult) => void; onError?: (error: WidgetError) => void; className?: string; style?: React.CSSProperties; } interface SupportPortalProps { pollingInterval?: number; onTicketSelected?: (ticketId: string) => void; className?: string; style?: React.CSSProperties; } type WidgetView = 'home' | 'select-project' | 'new-ticket' | 'my-tickets' | 'ticket-detail' | 'track' | 'kb' | 'preferences' | { kind: 'custom-action'; id: string; }; interface UseReqdeskReturn { submitTicket(data: SubmitTicketData): Promise; trackTicket(token: string): Promise; submitTrackingReply(token: string, body: string): Promise; isLoading: boolean; error: WidgetError | null; isOpen: boolean; currentView: WidgetView; currentDisplayMode: ResolvedDisplayMode; preferences: WidgetPreferences; open(): void; close(): void; toggle(): void; openMenu(): void; openAction(id: string, input?: unknown): void; setDisplayMode(mode: DisplayMode, side?: SheetSide): void; setPreferences(next: Partial): void; addAction(action: ReactMenuActionInput): () => void; removeAction(id: string): void; on(event: WidgetEvent, cb: EventCallback): () => void; } interface UseReqdeskTriggerOptions { target?: 'menu' | { actionId: string; }; display?: DisplayMode | DisplayModeConfig; } interface UseReqdeskTriggerReturn { onClick: (e?: React.MouseEvent) => void; isOpen: boolean; ariaProps: { 'aria-haspopup': 'menu' | 'dialog'; 'aria-expanded': boolean; 'aria-controls': string; }; } interface TriggerRenderProps { onClick: (e?: React.MouseEvent) => void; isOpen: boolean; ariaProps: UseReqdeskTriggerReturn['ariaProps']; } interface ReqdeskTriggerProps extends UseReqdeskTriggerOptions { variant?: 'pill' | 'ghost' | 'icon'; icon?: ReactActionIcon | null; className?: string; style?: React.CSSProperties; children?: ReactNode; render?: (props: TriggerRenderProps) => ReactNode; } type NotificationKind = 'error' | 'warning' | 'info' | 'success'; interface WidgetNotification { id: string; kind: NotificationKind; title: string; /** Optional secondary lines (e.g. JSON:API per-field errors the view chose not to inline). */ detail?: string[]; /** Auto-dismiss after this many milliseconds. Null keeps the notification until manually dismissed. */ autoDismissMs?: number | null; } interface UseNotifyReturn { push(notification: Omit & Partial>): string; dismiss(id: string): void; clear(): void; } /** Semantic tag for a form-bound mutation. Widget views set this so the global 422 handler can * skip the top-level toast and let the per-field inline error UI in the view take over. */ type WidgetMutationFormTag = 'ticket-submit' | 'reply-send' | 'category-create' | 'email-prompt' | 'resolve-ticket'; interface WidgetMutationMeta { /** When set, the global `MutationCache.onError` handler will not toast 422 responses — the * view wraps the form in `` and renders per-field errors inline. Non-422 * errors (network, 5xx) still toast so the user isn't left silently wondering. */ form?: WidgetMutationFormTag; /** When true, the global handler suppresses toasts for this mutation regardless of status. */ silent?: boolean; } interface WidgetQueryMeta { /** 404 is an expected outcome (e.g. widget-user probe on a first-time user). */ allow404?: boolean; /** Suppress the global toast for this query's errors entirely. */ silent?: boolean; } sideEffect(); //#endregion //#region src/react/ReqdeskProvider.d.ts declare function ReqdeskProvider({ apiKey, apiUrl, auth, theme, language, customer, translations, authMode, display, actions, initialPreferences, userPreferences, onPreferencesChange, menuCloseOnAction, hideFab, hideDisplayModePicker, fabIcon, children }: ReqdeskProviderProps): react_jsx_runtime0.JSX.Element; //# sourceMappingURL=ReqdeskProvider.d.ts.map //#endregion //#region src/react/TicketForm.d.ts declare function TicketForm({ mode, onTicketCreated, onError, className, style }: TicketFormProps): react_jsx_runtime0.JSX.Element; //# sourceMappingURL=TicketForm.d.ts.map //#endregion //#region src/react/SupportPortal.d.ts declare function SupportPortal({ className }: SupportPortalProps): react_jsx_runtime0.JSX.Element; //# sourceMappingURL=SupportPortal.d.ts.map //#endregion //#region src/react/FloatingWidget.d.ts interface FloatingWidgetProps { position?: AnyWidgetPosition; contained?: boolean; /** Width of the widget when expanded. Accepts any CSS length (e.g. "60vw", "800px", "70%"). Defaults to 60vw. */ expandedWidth?: string; /** When true, skip rendering the floating action button. Host drives opens via ReqdeskTrigger / mountTrigger / useReqdesk. */ hideFab?: boolean; onTicketCreated?: (ticket: TicketResult) => void; onError?: (error: WidgetError) => void; } declare function FloatingWidget({ position: propPosition, contained, expandedWidth, hideFab: hideFabProp, onTicketCreated, onError }: FloatingWidgetProps): react_jsx_runtime0.JSX.Element; //#endregion //#region src/react/useReqdesk.d.ts declare function useReqdesk(): UseReqdeskReturn; //# sourceMappingURL=useReqdesk.d.ts.map //#endregion //#region src/react/Trigger.d.ts declare function ReqdeskTrigger({ variant, icon, className, style, children, render, target, display }: ReqdeskTriggerProps): react_jsx_runtime0.JSX.Element; //# sourceMappingURL=Trigger.d.ts.map //#endregion //#region src/react/useReqdeskTrigger.d.ts declare function useReqdeskTrigger(opts?: UseReqdeskTriggerOptions): UseReqdeskTriggerReturn; //# sourceMappingURL=useReqdeskTrigger.d.ts.map //#endregion //#region src/registry.d.ts type WidgetView$1 = 'home' | 'select-project' | 'new-ticket' | 'my-tickets' | 'ticket-detail' | 'track' | 'kb' | 'preferences' | { kind: 'custom-action'; id: string; }; interface WidgetRegistrySnapshot { isOpen: boolean; currentView: WidgetView$1; currentDisplayMode: ResolvedDisplayMode; actions: MenuAction[]; preferences: WidgetPreferences; activeActionId: string | null; previousDisplayMode: ResolvedDisplayMode | null; user: { email?: string; name?: string; } | null; projectId: string; locale: string; } interface RegistryContextSeed { user?: { email?: string; name?: string; } | null; projectId?: string; locale?: string; } declare class WidgetRegistry { private snapshot; private listeners; private eventListeners; private activatingElementRef; private menuCloseOnAction; private hostOnPreferencesChange; private initialPreferences; private configDisplay; constructor(); getSnapshot(): WidgetRegistrySnapshot; subscribe(listener: (snapshot: WidgetRegistrySnapshot) => void): () => void; private updateSnapshot; private emitChange; on(event: WidgetEvent, cb: EventCallback): () => void; off(event: WidgetEvent, cb: EventCallback): void; private emit; emitEvent(event: WidgetEvent, data?: unknown): void; private emitError; setContext(ctx: RegistryContextSeed): void; setMenuCloseOnAction(value: boolean): void; setHostPreferencesCallback(cb: ((next: WidgetPreferences) => void) | undefined): void; setApiKeyForStorage(_apiKey: string | null): void; setInitialPreferences(initial: WidgetPreferences): void; setConfigDisplay(cfg: DisplayModeConfig | undefined): void; initPreferencesSnapshot(preferences: WidgetPreferences): void; hasInitialPreferences(): boolean; getInitialPreferences(): WidgetPreferences; private normalizeAction; addAction(input: MenuActionInput): () => void; removeAction(id: string): void; private orderActions; resolveRenderOrder(builtInIds: readonly string[]): Array<{ kind: 'built-in' | 'custom'; id: string; }>; getActionById(id: string): MenuAction | undefined; setBadge(actionId: string, value: string | number | null): void; open(): void; close(): void; toggle(): void; openMenu(): void; openAction(id: string, input?: unknown): void; private invokeHandler; private applyCloseBehavior; private dispatchTrigger; private resolveCustomEvent; private resolveCallGlobal; private resolveUrl; setDisplayMode(mode: DisplayMode, side?: SheetSide): void; private resolveEffectiveDisplayMode; getPreferences(): WidgetPreferences; setPreferences(partial: Partial): void; resetToInitialPreferences(): void; setView(view: WidgetView$1): void; recordActivator(el: Element | null | undefined): void; restoreFocus(): void; destroy(): void; } //#endregion //#region src/react/registry-context.d.ts interface RegistryProviderProps { registry?: WidgetRegistry; children: ReactNode; } declare function RegistryProvider({ registry, children }: RegistryProviderProps): react_jsx_runtime0.JSX.Element; declare function useRegistry(): WidgetRegistry; declare function useRegistrySnapshot(selector: (snapshot: WidgetRegistrySnapshot) => T): T; //# sourceMappingURL=registry-context.d.ts.map //#endregion //#region src/react/shadow-root.d.ts interface ShadowRootProps { children: ReactNode; } declare function ShadowRoot({ children }: ShadowRootProps): react_jsx_runtime0.JSX.Element; //#endregion //#region src/storage.d.ts interface WidgetConfigPersist { position?: WidgetPosition; language?: string; theme?: { primaryColor?: string; mode?: 'light' | 'dark' | 'auto'; }; widget?: 'ticket-form' | 'support-portal'; } declare function loadWidgetConfig(apiKey: string): WidgetConfigPersist | null; //#endregion //#region src/react/form-errors.d.ts /** * Structural shape the provider reads off the `useMutation` return. Mirroring these fields * instead of importing the full `UseMutationResult<…>` generic lets callers pass any mutation * regardless of its `TData` / `TVariables` / `TContext` generic parameters — zero casting. */ interface FormErrorMutationSource { error: unknown; status?: string; submittedAt?: number; } interface FormErrorProviderProps { /** * The useMutation result whose thrown `WidgetError.errors` feed per-field server errors. * Accepts the raw `useMutation` return; the provider reads `.error`, `.status`, and `.submittedAt` * so stale errors auto-clear when the mutation transitions to `pending` or `success`. */ mutation?: FormErrorMutationSource; /** * Optional client-side validation errors. Take precedence over server errors for the same field * so client-detected issues (e.g. "title must be ≥ 5 chars") surface immediately without a round- * trip. Caller owns population / clearing. */ clientErrors?: Record; children: ReactNode; } declare function FormErrorProvider({ mutation, clientErrors, children }: FormErrorProviderProps): react_jsx_runtime0.JSX.Element; interface UseFieldErrorReturn { error: string | null; invalid: boolean; inputProps: { 'aria-invalid'?: 'true'; 'aria-describedby'?: string; className?: string; }; /** Stable id for the error-message element. Use it to wire `aria-describedby` manually if you * aren't spreading `inputProps` onto a native input. */ errorId: string; } /** * Reads the current error for a named field. Returns the detail + pre-computed a11y props so the * caller can spread them onto any native input/select/textarea with zero branching. */ declare function useFieldError(name: string): UseFieldErrorReturn; interface FieldErrorProps { name: string; as?: 'div' | 'span' | 'p'; className?: string; } /** * Renders the per-field error message under an input. Uses `role="alert"` so screen readers * announce it when it appears (e.g. after a failed submission). Renders nothing when there's no * error — safe to leave in the markup unconditionally. */ declare function FieldError({ name, as, className }: FieldErrorProps): react_jsx_runtime0.JSX.Element | null; interface FormFieldGroupProps { /** Field name — must match the `name` attribute on the wrapped input. */ name: string; label?: ReactNode; hint?: ReactNode; className?: string; children: ReactNode; } /** * Common label + input + `` layout for a form field inside a ``. * The child input MUST carry a `name` attribute matching `props.name`; the group injects the * `aria-invalid` / `aria-describedby` / error-class props by cloning the child. * * For layouts that don't fit this shape (e.g. file drop zones, category tree, diagnostic checkbox * blocks), skip this component and call `useFieldError(name)` directly. */ declare function FormFieldGroup({ name, label, hint, className, children }: FormFieldGroupProps): react_jsx_runtime0.JSX.Element; //# sourceMappingURL=form-errors.d.ts.map //#endregion //#region src/react/notifications.d.ts interface NotificationProviderProps { children: ReactNode; } declare function NotificationProvider({ children }: NotificationProviderProps): react_jsx_runtime0.JSX.Element; /** * Push / dismiss / clear notifications. Usable from any component inside `` — * hosts can reuse the same stack for their own in-widget messages via `useReqdesk().` wrappers. */ declare function useNotify(): UseNotifyReturn; interface NotificationStackProps { /** Override the dismiss-button accessible name (defaults to "Dismiss"). */ dismissLabel?: string; } /** * Render the notification queue at the top of the widget panel. Accessible: * - `aria-live="polite"` so screen readers announce new items without interrupting. * - Per-item `role="alert"` on errors (critical), `role="status"` on others. * - Keyboard-dismissible via the ✕ button. * * Place inside the widget's shadow DOM — no host-page leakage. */ declare function NotificationStack({ dismissLabel }: NotificationStackProps): react_jsx_runtime0.JSX.Element | null; //# sourceMappingURL=notifications.d.ts.map //#endregion //#region src/ofetch-client.d.ts /** * Proper Error subclass so devtools stack traces are useful and `instanceof Error` checks work. * Carries the normalized `WidgetError` surface (`code`, `message`, `status`, `errors`) as own * properties — callers that previously caught `WidgetError` keep working unchanged because the * shape is a strict superset. */ declare class WidgetFetchError extends Error implements WidgetError { readonly code: string; readonly status?: number; readonly errors?: WidgetFieldError[]; constructor(init: WidgetError); } //#endregion //#region ../react/dist/index-B9ztcf4k.d.ts //# sourceMappingURL=ReqdeskProvider.d.ts.map //#endregion //#region src/views/SubmitTicketView.d.ts interface SubmitTicketViewProps { onSuccess?: (result: TicketResult$1) => void; onError?: (error: WidgetError$1) => void; isAuthenticated?: boolean; userEmail?: string; } declare function SubmitTicketView({ onSuccess, onError, isAuthenticated, userEmail }: SubmitTicketViewProps): react_jsx_runtime0.JSX.Element; //#endregion //#region src/views/MyTicketsView.d.ts interface MyTicketsViewProps { onSelectTicket: (ticketId: string) => void; isAuthenticated?: boolean; userEmail?: string; } declare function MyTicketsView({ onSelectTicket, isAuthenticated, userEmail }: MyTicketsViewProps): react_jsx_runtime0.JSX.Element; //#endregion //#region src/views/TicketDetailView.d.ts interface TicketDetailViewProps { ticketId: string; onBack: () => void; } declare function TicketDetailView({ ticketId, onBack }: TicketDetailViewProps): react_jsx_runtime0.JSX.Element; //#endregion //#region src/views/TrackTicketView.d.ts interface TrackTicketViewProps { onTrackSuccess: (ticketId: string) => void; } declare function TrackTicketView({ onTrackSuccess }: TrackTicketViewProps): react_jsx_runtime0.JSX.Element; //#endregion //#region src/hooks/useReqdesk.d.ts //#endregion export { type ActionContext, type ActionIcon, type ActionTrigger, type BuiltInActionId, type CustomerConfig, type DisplayMode, type DisplayModeConfig, type EventCallback, FieldError, type FieldErrorProps, FloatingWidget, FormErrorProvider, type FormErrorProviderProps, FormFieldGroup, type FormFieldGroupProps, type LocalizedString, type MenuAction, type MenuActionInput, MyTicketsView, type NotificationKind, NotificationProvider, type NotificationProviderProps, NotificationStack, type NotificationStackProps, type PublicReply, type ReactActionIcon, type ReactMenuActionInput, RegistryProvider, ReqdeskProvider, type ReqdeskProviderProps, ReqdeskTrigger, type ReqdeskTriggerProps, type ResolvedDisplayMode, ShadowRoot, type SheetSide, type SubmitTicketData, SubmitTicketView, SupportPortal, type SupportPortalProps, type ThemeConfig, TicketDetailView, TicketForm, type TicketFormProps, type TicketResult, TrackTicketView, type TrackedTicketResult, type TriggerRenderProps, type UseFieldErrorReturn, type UseNotifyReturn, type UseReqdeskReturn, type UseReqdeskTriggerOptions, type UseReqdeskTriggerReturn, type WidgetConfigPersist, type WidgetError, type WidgetErrorCode, type WidgetEvent, WidgetFetchError, type WidgetFieldError, type WidgetMutationFormTag, type WidgetMutationMeta, type WidgetNotification, type WidgetPreferences, type WidgetQueryMeta, type WidgetView, loadWidgetConfig as getWidgetDefaults, useFieldError, useNotify, useRegistry, useRegistrySnapshot, useReqdesk, useReqdeskTrigger }; //# sourceMappingURL=react-BZww977J.d.cts.map