import { f as PublicGetSurveyOutput, i as ConfettiState, s as Finishable, t as Answer, u as Question$1 } from "./types-C-q5VrLk.js"; import { PropsWithChildren } from "react"; //#region src/core/ConfettiController.d.ts interface ConfettiControllerProps extends Finishable { children: (props: ConfettiState) => React.ReactElement; /** * Control the current question index that is being displayed. * If not provided, the component will manage it internally. */ current?: number; shouldAutoSubmit?: boolean; /** * Invoked synchronously when the user submits and the Thank-You view is * shown. Fires before the submission network call settles, unlike * `onFinished` which fires after it. */ onSubmitted?: () => void; } declare const ConfettiController: ({ current: currentProp, shouldAutoSubmit, onSubmitted, onFinished, children }: ConfettiControllerProps) => import("react").JSX.Element; //#endregion //#region src/contracts/state.d.ts interface ConfettiRespondentState { lastRespondedAt: Date | null; lastDismissedAt: Date | null; } //#endregion //#region src/core/logic/is-visible.d.ts type IsSurveyVisible = boolean | ((s: ConfettiRespondentState) => boolean) | undefined; //#endregion //#region src/core/SurveyProvider.d.ts interface SurveyContextValue { surveyId: string; metadata: Record; submit: ({ answers }: { answers: Record; }) => Promise; dismiss: () => Promise | void; survey: PublicGetSurveyOutput | undefined; } /** * Carries the fetched survey and the submit and dismiss actions. Provide a * value directly to render building blocks against a preloaded survey. A * SurveyProvider mounted beneath an existing value reuses it instead of * fetching. */ declare const SurveyContext: import("react").Context; interface SurveyProviderProps extends PropsWithChildren { /** Identifier of the published survey to load. */ surveyId: string; /** Publishable API key that authorises read access to the survey. */ publishableKey: string; /** * Identifies who the survey is shown to and tracked against. The widget * tracks a respondent's response and dismissal history, which * `isSurveyVisible` receives, so the value chosen sets how narrowly the * survey is targeted. Pass a stable user identifier to target a person, * an event identifier on its own to target an event, or a composite such * as `{User ID}-{Event ID}` to target a person for a specific event. */ respondent: string; /** * Arbitrary key value pairs stored alongside the response. Use it to attach * application, environment, or user context. */ metadata?: Record; apiBaseUrl?: string; } /** * Fetches the survey, records the view event, and provides SurveyContext to * the building blocks beneath it. */ declare const SurveyProvider: (props: SurveyProviderProps) => import("react").JSX.Element; /** * Returns the current survey context value. Must be used beneath a * SurveyProvider or a directly provided SurveyContext. */ declare const useSurvey: () => SurveyContextValue; //#endregion //#region src/core/RespondentVisibilityProvider.d.ts type WithVisibilityControl

= Omit & { /** * Identifies who the survey is shown to and tracked against. The widget * tracks a respondent's response and dismissal history, which * `isSurveyVisible` receives, so the value chosen sets how narrowly the * survey is targeted. Pass a stable user identifier to target a person, * an event identifier on its own to target an event, or a composite such * as `{User ID}-{Event ID}` to target a person for a specific event. * When omitted, the widget generates and persists an identifier * so the same visitor is recognised across visits to this survey. */ respondent?: string; /** * Gates whether the survey renders for this respondent. Pass `false` to hide * it, or a predicate that receives the respondent state and returns whether * to show it. When omitted, the survey shows whenever it is available for the * respondent. */ isSurveyVisible?: IsSurveyVisible; }; interface RespondentVisibilityContextValue { respondent: string; } /** * Providing this context makes a nested RespondentVisibilityProvider (and the * components composed from it, such as ConfettiTrigger) reuse the given * respondent instead of resolving one and fetching availability and * respondent state. Pair it with SurveyContext to render building blocks * against a preloaded survey. */ declare const RespondentVisibilityContext: import("react").Context; interface RespondentVisibilityProviderProps extends PropsWithChildren> { /** * Identifies who the survey is shown to and tracked against. The widget * tracks a respondent's response and dismissal history, which * `isSurveyVisible` receives, so the value chosen sets how narrowly the * survey is targeted. Pass a stable user identifier to target a person, * an event identifier on its own to target an event, or a composite such * as `{User ID}-{Event ID}` to target a person for a specific event. * When omitted, the widget generates and persists an identifier * so the same visitor is recognised across visits to this survey. */ respondent?: string; /** * Gates whether the survey renders for this respondent. Pass `false` to hide * it, or a predicate that receives the respondent state and returns whether * to show it. When omitted, the survey shows whenever it is available for the * respondent. */ isSurveyVisible?: IsSurveyVisible; } /** * Resolves the respondent, probes survey availability, and renders children * only once the survey is confirmed visible for that respondent. */ declare function RespondentVisibilityProvider(props: RespondentVisibilityProviderProps): import("react").JSX.Element; /** * Returns the respondent resolved by the nearest RespondentVisibilityProvider. */ declare function useRespondentVisibility(): RespondentVisibilityContextValue; //#endregion //#region src/core/ConfettiProvider.d.ts type ConfettiProviderProps = WithVisibilityControl; declare const ConfettiProvider: ({ children, ...rest }: ConfettiProviderProps) => import("react").JSX.Element; //#endregion //#region src/components/questions/types.d.ts type Question = PublicGetSurveyOutput['questions'][number]; interface BaseFieldProps { id: string; title: string | null | undefined; description?: string | null | undefined; required?: boolean; onChange: (answer: Answer) => void; error?: string; } //#endregion //#region src/components/questions/BugReport/BugReport.d.ts interface BugReportOptions { /** * Masks the text of every input in the screenshot and the session recording * captured by the bug-report question, keeping sensitive values out of the * submitted report. */ maskAllInputs?: boolean; } //#endregion //#region src/components/Confetti.d.ts /** * Survey configuration shared by every Confetti surface: the `Confetti` * build-your-own component, the hosted shells, the static shells, and the * content templates. It excludes the controller-level knobs (`children` and * `shouldAutoSubmit`) that only apply when you drive `ConfettiController` * yourself, so the fixed-layout shells and templates extend this rather than * `ConfettiProps`. */ interface BaseConfettiProps extends Omit, Finishable { /** Optional feature configuration for the survey surface. */ options?: { /** Configures the built-in bug-report question type. */bugReport?: BugReportOptions; }; } /** * The full set of props accepted by the `Confetti` component: the shared survey * config plus the controller knobs it forwards to `ConfettiController`. */ interface ConfettiProps extends BaseConfettiProps, Pick {} declare const Confetti: ({ children, onFinished, shouldAutoSubmit, ...props }: ConfettiProps) => import("react").JSX.Element; //#endregion export { useSurvey as _, BaseFieldProps as a, ConfettiProviderProps as c, RespondentVisibilityProviderProps as d, WithVisibilityControl as f, SurveyProviderProps as g, SurveyProvider as h, BugReportOptions as i, RespondentVisibilityContext as l, SurveyContext as m, Confetti as n, Question as o, useRespondentVisibility as p, ConfettiProps as r, ConfettiProvider as s, BaseConfettiProps as t, RespondentVisibilityProvider as u, ConfettiController as v, ConfettiControllerProps as y };