import { z } from "zod"; /** * Ancillary offers — things quoted live from a third party at purchase time. * * This is deliberately *not* `addonOfferV1`. An add-on is something the operator * has in its own catalog, priced ahead of time and sellable at any point. An * ancillary is quoted when the traveller is already in checkout, because its * price is not knowable until trip dates and traveller ages are, and the offer * is only good for a bounded window afterwards. Travel insurance is the first * of these; nothing here names it. * * The shapes are provider-neutral on purpose. Neither this file nor anything in * `commerce` may learn what an insurer is. */ export declare const ANCILLARY_ELIGIBILITY_STATUSES: readonly ["eligible", "ineligible", "referral"]; export declare const ancillaryEligibilityV1: z.ZodObject<{ status: z.ZodEnum<{ eligible: "eligible"; ineligible: "ineligible"; referral: "referral"; }>; reasons: z.ZodDefault>>; }, z.core.$strict>; export type AncillaryEligibilityV1 = z.infer; /** * A document the traveller must be able to reach before buying, pinned to the * revision that is in force right now. */ export declare const ancillaryDisclosureV1: z.ZodObject<{ kind: z.ZodString; label: z.ZodString; versionId: z.ZodString; url: z.ZodOptional; required: z.ZodBoolean; }, z.core.$strict>; export type AncillaryDisclosureV1 = z.infer; /** * A field the provider needs about each traveller before it will commit. * * `sensitive` fields are collected only after the traveller has accepted an * offer, kept minimal on screen, and never logged. */ export declare const ancillaryTravelerFieldV1: z.ZodObject<{ key: z.ZodString; label: z.ZodString; type: z.ZodString; required: z.ZodBoolean; sensitive: z.ZodDefault; options: z.ZodOptional>>; helpText: z.ZodOptional; }, z.core.$strict>; export type AncillaryTravelerFieldV1 = z.infer; /** * One priced offer from one provider. * * There is deliberately no `selected`, `recommended` or `default` field. * Nothing here may arrive pre-ticked, so the shape gives a provider nowhere to * express a default and gives a renderer nothing to honour. */ export declare const ancillaryOfferV1: z.ZodObject<{ offerId: z.ZodString; sourceId: z.ZodString; providerId: z.ZodString; providerLabel: z.ZodString; kind: z.ZodString; title: z.ZodString; summary: z.ZodOptional>; planLabel: z.ZodOptional>; price: z.ZodObject<{ amountMinor: z.ZodNumber; currency: z.ZodString; }, z.core.$strict>; pricedPerPerson: z.ZodDefault; highlights: z.ZodDefault; }, z.core.$strict>>>; eligibility: z.ZodObject<{ status: z.ZodEnum<{ eligible: "eligible"; ineligible: "ineligible"; referral: "referral"; }>; reasons: z.ZodDefault>>; }, z.core.$strict>; disclosures: z.ZodDefault; required: z.ZodBoolean; }, z.core.$strict>>>; requiredTravelerFields: z.ZodDefault; options: z.ZodOptional>>; helpText: z.ZodOptional; }, z.core.$strict>>>; validUntil: z.ZodString; quoteRef: z.ZodString; metadata: z.ZodOptional>; }, z.core.$strict>; export type AncillaryOfferV1 = z.infer; export declare const ANCILLARY_SOURCE_STATUSES: readonly ["ok", "timeout", "error", "unavailable"]; /** * What happened at each source that was asked. * * Partial failure is normal: a slow or failing provider degrades the list * rather than blocking checkout, and this is where that shows up. A caller that * wants to explain a short list reads these; a caller that does not, ignores them. */ export declare const ancillarySourceDiagnosticV1: z.ZodObject<{ sourceId: z.ZodString; providerId: z.ZodOptional; status: z.ZodEnum<{ timeout: "timeout"; ok: "ok"; unavailable: "unavailable"; error: "error"; }>; message: z.ZodOptional; latencyMs: z.ZodOptional; }, z.core.$strict>; export type AncillarySourceDiagnosticV1 = z.infer; /** * Every offer of one kind, from every connected provider. * * Always a list, whatever the count. An operator may have zero, one or several * providers connected; one provider is a list whose entries happen to share a * provider. Only presentation branches on the count — the domain model and the * port never do, because building the fan-out later, after single-provider * assumptions have spread, is the expensive path. */ export declare const ancillaryOfferGroupV1: z.ZodObject<{ kind: z.ZodString; label: z.ZodString; offers: z.ZodDefault>; planLabel: z.ZodOptional>; price: z.ZodObject<{ amountMinor: z.ZodNumber; currency: z.ZodString; }, z.core.$strict>; pricedPerPerson: z.ZodDefault; highlights: z.ZodDefault; }, z.core.$strict>>>; eligibility: z.ZodObject<{ status: z.ZodEnum<{ eligible: "eligible"; ineligible: "ineligible"; referral: "referral"; }>; reasons: z.ZodDefault>>; }, z.core.$strict>; disclosures: z.ZodDefault; required: z.ZodBoolean; }, z.core.$strict>>>; requiredTravelerFields: z.ZodDefault; options: z.ZodOptional>>; helpText: z.ZodOptional; }, z.core.$strict>>>; validUntil: z.ZodString; quoteRef: z.ZodString; metadata: z.ZodOptional>; }, z.core.$strict>>>; diagnostics: z.ZodDefault; status: z.ZodEnum<{ timeout: "timeout"; ok: "ok"; unavailable: "unavailable"; error: "error"; }>; message: z.ZodOptional; latencyMs: z.ZodOptional; }, z.core.$strict>>>; }, z.core.$strict>; export type AncillaryOfferGroupV1 = z.infer; /** * What the traveller decided. * * Declining is a first-class decision, not the absence of one: the step cannot * be advanced by ignoring it, and a caller can tell "declined" apart from "not * asked yet". */ export declare const ancillarySelectionV1: z.ZodObject<{ kind: z.ZodString; decision: z.ZodEnum<{ accepted: "accepted"; declined: "declined"; }>; offerId: z.ZodOptional; sourceId: z.ZodOptional; providerId: z.ZodOptional; quoteRef: z.ZodOptional; acceptedPriceMinor: z.ZodOptional; acceptedCurrency: z.ZodOptional; travelers: z.ZodDefault>; }, z.core.$strict>>>; selectedOptionIds: z.ZodDefault>; acceptedDisclosures: z.ZodDefault>>; }, z.core.$strict>; export type AncillarySelectionV1 = z.infer; /** * The neutral default order: purchasable first, then cheapest, then a stable * tie-break on provider name and offer id. * * Never sorted by what earns the operator the most. There is no commission or * margin field on an offer for such a sort to reach, and there must not be one. * `planLabel` is not consulted. */ export declare function orderAncillaryOffers(offers: readonly AncillaryOfferV1[]): AncillaryOfferV1[]; /** True when a traveller could actually buy this offer. */ export declare function isAncillaryOfferSelectable(offer: AncillaryOfferV1): boolean; /** * The identity of an offer across the whole fan-out. * * `offerId` alone is not one. It is whatever the provider called its own quote, * and two insurers asked the same question at the same moment can both answer * `"Q-1"`. Keying a control, a lookup or a validation on `offerId` by itself * therefore resolves to whichever offer happens to be first, and the traveller * who picked the second provider gets the first provider's `sourceId`, * `providerId` and `quoteRef` stored against their selection — a policy bought * from an insurer they did not choose. * * So identity is the triple, and every consumer uses this one function for it. */ export declare function ancillaryOfferKey(offer: Pick): string; /** * The same identity, read off a stored selection. * * Returns `null` for a selection that carries no offer — a decline, or one not * yet made — so a caller cannot accidentally match it against a real offer. */ export declare function ancillarySelectionKey(selection: Pick): string | null; /** * Whether the offer group needs comparison affordances. * * One connected provider is not a comparison, and presenting it as one invents * a contest that does not exist. Comparison chrome appears only when offers * actually come from more than one provider. */ export declare function hasMultipleAncillaryProviders(offers: readonly AncillaryOfferV1[]): boolean;