import * as React from "react"; /** * Contract preview dialog. Renders a contract template with the * draft variables prefilled and gates the journey on two * checkboxes — terms acceptance and an optional marketing opt-in. * * The dialog is template-driven: the storefront wires a * `templateSlug` plus a `resolveVariables(draft)` function that maps * the booking draft to the template's variable schema. The dialog * fetches the rendered HTML from * `POST /v1/public/legal/contracts/templates/by-slug/:slug/preview` * and renders it in an iframe (sandboxed — same-origin removed) so * inline styles in the contract HTML don't leak into the page. */ export interface ContractPreviewDialogProps { open: boolean; onOpenChange: (open: boolean) => void; /** Variables to interpolate into the template body. */ variables: Record; /** * URL of the public render endpoint. The storefront wraps the * journey and supplies an absolute URL so the dialog stays * agnostic about where the API base lives. */ previewUrl: string; /** Optional Accept-Language header for locale resolution. */ acceptLanguage?: string; /** Fired when the user clicks Accept after ticking the gates. */ onAccept: (acceptance: ContractAcceptance) => void; /** Optional marketing-opt-in label. When omitted, marketing * consent isn't required to accept. */ marketingLabel?: string; termsLabel?: React.ReactNode; } export interface ContractAcceptance { templateId: string; templateSlug: string; templateName: string; acceptedTerms: true; acceptedMarketing: boolean; acceptedAt: string; /** The exact rendered HTML the user accepted — captured for the * audit trail so we can reproduce what they saw. */ renderedHtml: string; } export declare function ContractPreviewDialog({ open, onOpenChange, variables, previewUrl, acceptLanguage, onAccept, marketingLabel, termsLabel, }: ContractPreviewDialogProps): React.ReactElement;