import 'rollup-plugin-inject-process-env'; import { FormWidgetEnv, PartnerFormFraming } from "@xapp/stentor-form-widget-channel"; export interface FormWidgetConfig extends Pick { readonly api: StentorApiConfig; /** * Partner chrome to draw around the form, from a resolved style preset. * * Only ever set by the stand-alone page: an embedded form never resolves a * preset, so this stays undefined there and the form renders exactly as it * always has -- see resolveFormStyle. */ readonly framing?: PartnerFormFraming; /** * NOT USED */ readonly suggestionsUrl?: string; /** * NOT USED */ readonly isVoiceEnabled?: boolean; } export interface StentorApiConfig { readonly url: string; readonly key?: string; readonly prefetchQuery?: string; /** * The intentId of the handler this widget instance is bound to. * * Sent as `overrideKey` on channel action requests so that when multiple * form widgets are hosted on the same origin, a submit is always routed * to this widget's own handler instead of whichever handler the shared * browser userId last touched. * * Mirrors FormWidgetConfig.intentId (which Form/FormWidget pass down into this * config); the two are expected to stay in sync. */ readonly intentId?: string; /** * Renders and behaves exactly like production, but cannot create anything: * no submission, no lead record, no notification, no tracking event — not * even the unload beacon, whose payload is the values actually typed. * * It is not "makes no requests". The form's step structure arrives on the * INTENT_REQUEST response, so reads that fetch the form definition are * deliberately allowed; without them there would be no form to preview. * Writes — the channel actions carrying FORM_SUBMIT — are what get blocked. * * For previews of a business's own booking page — get.xapp.ai shows a * prospect their generated page and lets them click through it, and none of * that may create a real lead. * * The guarantee is enforced inside {@link StentorApi} rather than at the * call sites, so a host that forgets a check somewhere still cannot produce * a real submission from a preview. */ readonly demoMode?: boolean; }