/**
 * Shared widget page rendering for U2 routes.
 *
 * v3 — Logo inside widget by default + adaptive chip chrome.
 *
 * Changes vs. v2:
 *  - Logo renders INSIDE the widget card by default (Auth0-style). The
 *    widget's own shadow DOM emits the logo from `branding.logo_url`, so
 *    the page doesn't add an outer-container duplicate. Set
 *    `logoPosition="chip"` to render the floating-chip variant instead.
 *  - Chips adapt to dark/light page mode (translucent dark vs. translucent
 *    white). Tokens are CSS variables flipped via a `data-mode` attribute,
 *    so a single ruleset handles both directions.
 *  - When there's no background image, chips drop their pill surface and
 *    render as plain text (matches a clean solid-bg layout).
 *  - Privacy/Terms is now a real chip in the with-image case so it doesn't
 *    float as orphan text.
 *
 *   ┌─────────────────────────────────────┐
 *   │ [logo*]                 [settings]  │   *only when logoPosition=chip
 *   │                                     │
 *   │            ┌──────────┐             │
 *   │            │ [logo]   │             │   <- widget's own header (default)
 *   │            │  widget  │             │
 *   │            └──────────┘             │
 *   │                                     │
 *   │ [trust]                    [legal]  │
 *   └─────────────────────────────────────┘
 *
 * Slot story (forward-looking): the chips carry `data-ah-slot` attrs so a
 * future Liquid template can reposition any element via `{% slot %}` tags.
 * `logoPosition` is the prop-level shortcut for the most common override.
 */
import type { Branding, Theme } from "@authhero/adapter-interfaces";
export type DarkModePreference = "auto" | "light" | "dark";
export type LogoPosition = "widget" | "chip" | "none";
/**
 * Resolve the dark-mode preference for the current request.
 *
 * Priority: per-user `ah-dark-mode` cookie > tenant `branding.dark_mode` > "auto".
 * The cookie lets a user override the tenant default for the rest of their session.
 */
export declare function resolveDarkMode(ctx: any, branding: Branding | null | undefined): DarkModePreference;
export type WidgetPageProps = {
    widgetHtml: string;
    screenId: string;
    branding?: {
        colors?: {
            primary?: string;
            page_background?: string | {
                type?: string;
                start?: string;
                end?: string;
                angle_deg?: number;
            };
        };
        logo_url?: string;
        favicon_url?: string;
        font?: {
            url?: string;
        };
    };
    theme?: any;
    themePageBackground?: {
        background_color?: string;
        background_image_url?: string;
        page_layout?: string;
    };
    clientName: string;
    poweredByLogo?: {
        url: string;
        darkUrl?: string;
        alt: string;
        href?: string;
        height?: number;
    };
    language?: string;
    availableLanguages?: string[];
    termsAndConditionsUrl?: string;
    darkMode?: DarkModePreference;
    /**
     * Where to render the tenant logo on the page.
     * - "widget" (default): inside the widget card, via the widget's own header.
     * - "chip": floating pill in the top-left page corner. The widget's
     *   internal logo should also be suppressed in this mode (callers use
     *   `derivePageLogoPlacement` to clone the theme accordingly before SSR).
     * - "none": no logo on the page or in the widget.
     *
     * If not provided, defaults to `theme.page_background.logo_placement`,
     * falling back to "widget".
     */
    logoPosition?: LogoPosition;
    /** Optional inline script injected at page level (e.g. WebAuthn ceremony) */
    extraScript?: string;
    /**
     * When set, replaces the default body content (widget + chips) with a
     * pre-expanded HTML fragment. Used by the universal-login custom-template
     * path: the tenant's template is run through `applyUniversalLoginTemplate`
     * and the resulting body markup is injected here, while the page shell
     * (html/head, dark-mode runtime, background tint, body styling) is still
     * managed by this component.
     */
    customBodyHtml?: string;
};
export declare function LogoChip({ logoUrl, clientName, }: {
    logoUrl?: string | null;
    clientName: string;
}): import("hono/jsx/jsx-dev-runtime").JSX.Element;
export declare function DarkModeToggle({ darkMode }: {
    darkMode: DarkModePreference;
}): import("hono/jsx/jsx-dev-runtime").JSX.Element;
export declare function LanguagePicker({ language, availableLanguages, }: {
    language?: string;
    availableLanguages: string[];
}): import("hono/jsx/jsx-dev-runtime").JSX.Element | null;
export declare function SettingsChip({ darkMode, language, availableLanguages, }: {
    darkMode: DarkModePreference;
    language?: string;
    availableLanguages?: string[];
}): import("hono/jsx/jsx-dev-runtime").JSX.Element;
export declare function PoweredByChip({ url, href, alt, height, }: {
    url: string;
    href?: string;
    alt?: string;
    height?: number;
}): import("hono/jsx/jsx-dev-runtime").JSX.Element | null;
export declare function LegalChip({ termsAndConditionsUrl, language, }: {
    termsAndConditionsUrl?: string;
    language?: string;
}): import("hono/jsx/jsx-dev-runtime").JSX.Element | null;
export declare function WidgetPage({ widgetHtml, screenId, branding, theme, themePageBackground, clientName, poweredByLogo, language, availableLanguages, termsAndConditionsUrl, darkMode, logoPosition, extraScript, customBodyHtml, }: WidgetPageProps): import("hono/jsx/jsx-dev-runtime").JSX.Element;
/**
 * Reads `theme.page_background.logo_placement` and returns the resolved
 * page-level `logoPosition` plus a theme variant suitable for passing to
 * the widget SSR. When placement is "chip" or "none" we override
 * `theme.widget.logo_position = "none"` so the widget's internal header
 * logo is suppressed — otherwise we'd render a duplicate (chip + widget
 * header) or a logo when the caller asked for none.
 *
 * Callers should pass the returned `theme` to `JSON.stringify` for the
 * widget's `theme` attribute, and forward `logoPosition` to `WidgetPage`.
 */
export declare function derivePageLogoPlacement<T extends {
    page_background?: {
        logo_placement?: LogoPosition;
    };
    widget?: {
        logo_position?: string;
    };
} | null | undefined>(theme: T): {
    logoPosition: LogoPosition;
    theme: T;
};
export declare function renderWidgetSSR(params: {
    screenId: string;
    screenJson: string;
    brandingJson?: string;
    themeJson?: string;
    state: string;
    authParamsJson: string;
}): Promise<string>;
export declare function extractBrandingProps(branding: Branding | null | undefined): WidgetPageProps["branding"];
export declare function renderWidgetPageResponse(ctx: any, opts: {
    screenId: string;
    screenJson: string;
    brandingJson?: string;
    themeJson?: string;
    state: string;
    authParamsJson: string;
    branding: Branding | null | undefined;
    theme: Theme | null | undefined;
    clientName: string;
    poweredByLogo?: WidgetPageProps["poweredByLogo"];
    language?: string;
    availableLanguages?: string[];
    termsAndConditionsUrl?: string;
    darkMode?: DarkModePreference;
    logoPosition?: LogoPosition;
    extraScript?: string;
    /**
     * Optional tenant-uploaded body template. When provided, the body is
     * built via `applyUniversalLoginTemplate(customTemplateBody, ...)`
     * instead of the default chip layout. The shell (html/head, runtime,
     * bg tint) is unchanged.
     */
    customTemplateBody?: string;
}): Promise<Response>;
