import KDBush from 'kdbush';
import { Machine, Service } from 'robot3';

/**
 * Base interface for seat properties.
 */
interface IBaseSeat {
    /**
     * The unique identifier of the seat.
     */
    id: number;
    /**
     * The ID of the row this seat belongs to.
     */
    rowId: number;
    /**
     * The ID of the sector this seat belongs to.
     */
    sectorId: number;
    /**
     * The X coordinate of the seat within its section.
     */
    x: number;
    /**
     * The Y coordinate of the seat within its section.
     */
    y: number;
    /**
     * The name or number of the seat.
     */
    name: string;
    /**
     * Whether the seat is accessible for people with disabilities.
     */
    isAccessible?: boolean;
    /**
     * Whether the seat is marked with a special status.
     */
    isMarked?: boolean;
}
/**
 * Base interface for sector properties.
 */
interface IBaseSector {
    /**
     * The unique identifier of the sector.
     */
    id: number;
    /**
     * The globally unique identifier for the sector.
     */
    guid?: string;
    /**
     * Whether this is a general admission (GA) sector.
     */
    isGa: boolean;
    /**
     * The name of the sector.
     */
    name: string;
    /**
     * The rotation angle of the sector in degrees.
     */
    angle?: number | null;
    /**
     * The type of the sector.
     */
    type?: string | null;
    /**
     * Whether the sector is disabled and cannot be interacted with.
     */
    disabled?: boolean;
    /**
     * Whether the sector is filtered out by current filter criteria.
     */
    filtered?: boolean;
    /**
     * Whether the sector is currently selected.
     */
    selected?: boolean;
    /**
     * Shape metadata for the sector (GA section shapes with text, color, etc.)
     */
    shapes?: ReadonlyArray<IShapeMetadata>;
    /** Label anchor X offset from section center (SEAT-624) */
    labelOffsetX?: number;
    /** Label anchor Y offset from section center (SEAT-624) */
    labelOffsetY?: number;
    /** Label style overrides (SEAT-624) */
    labelStyle?: ILabelStyle;
    /** Whether the section name label should render (SEAT-895) */
    labelVisible?: boolean;
}
/**
 * Label style overrides for GA section labels (SEAT-624).
 */
interface ILabelStyle {
    fontScale?: number;
    color?: string;
    opacity?: number;
    fontWeight?: 'normal' | 'bold';
    background?: string;
    visible?: boolean;
    showPrice?: boolean;
}
/**
 * Shape metadata from the API response.
 */
interface IShapeMetadata {
    id?: string;
    text?: string;
    textColor?: string;
    textPosition?: string;
    fill?: string;
    width?: number;
    height?: number;
    top?: number;
    left?: number;
    angle?: number;
    order?: number;
    fontScale?: number;
}
/**
 * Interface representing the schema data transfer object from the API.
 * @hidden
 */
interface ISchemaDTO {
    plainSeats?: IPlainSeatsDTO;
    seats: ISeatDTO[];
    rows: IRowDTO[];
    sectors: ISectorDTO[];
    background: ISVGBackgroundDTO;
    requestTime?: number;
    responseSize?: number;
    configuration?: IConfigurationDTO;
    instanceId?: string;
    componentVersion?: string;
}
/**
 * Interface representing the venue data transfer object from the API.
 * @hidden
 */
interface IVenueDTO {
    guid: string;
    name: string;
    gaCapacity?: number;
    seatsCapacity?: number;
    seatmap: ISchemaDTO;
    schema: ISchemaDTO;
}
/**
 * Interface representing the plain seats data transfer object from the API.
 * @hidden
 */
interface IPlainSeatsDTO {
    ids: number[];
    x: number[];
    y: number[];
    rowIds: [];
    sectorIds: [];
    names: string[];
}
/**
 * Interface representing the base seat data transfer object from the API.
 * Contains the core properties of a seat as received from the backend.
 * @hidden
 */
type ISeatDTO = IBaseSeat;
/**
 * Interface representing a row in the venue.
 * @hidden
 */
interface IRowDTO {
    id: number;
    rowNumber: number;
    sectorId: number;
    name: string;
    seatName: string;
}
/**
 * Interface representing the base sector data transfer object from the API.
 * Contains the core properties of a sector as received from the backend.
 * @hidden
 */
type ISectorDTO = IBaseSector;
/**
 * Interface representing the SVG background data transfer object from the API.
 * @hidden
 */
interface ISVGBackgroundDTO {
    svg?: Nullable<string>;
    viewBox: {
        x: number;
        y: number;
        width: number;
        height: number;
    };
    svgLink?: string;
    images?: IPngBackgroundDTO;
    outlineSvg?: Nullable<string>;
}
/**
 * Interface representing the configuration data transfer object from the API.
 * @hidden
 */
interface IConfigurationDTO {
    accessible: number[];
    marked: number[];
    eventName?: string;
}
/**
 * Interface representing a special price option for seats, sections, or sectors.
 * Contains information about a named price point with its identifier.
 */
interface ISpecialPrice {
    /**
     * The name or label of the special price option.
     */
    name: string;
    /**
     * The unique identifier for this price option.
     */
    priceId: number;
}
/**
 * Interface representing special state information for seats, sections, or sectors.
 * Contains additional properties that affect rendering or behavior.
 */
interface ISpecialState {
    /**
     * Special state flag 1, used for custom state indicators.
     */
    s1?: number;
    /**
     * Array of special prices associated with this item.
     */
    prices?: ISpecialPrice[];
    /**
     * Category identifier for grouping items with similar special states.
     */
    category?: number;
}
/**
 * Interface representing a price list data transfer object from the API.
 * @hidden
 */
interface IPriceListDTO {
    seats: [number, IPriceId, ISpecialState?][];
    groupOfSeats: [number, number, number, ISpecialState?][];
    prices: IPriceDTO[];
    requestTime?: number;
    responseSize?: number;
}
/**
 * Interface representing a price data transfer object from the API.
 * @hidden
 */
interface IPriceDTO {
    id: IPriceId;
    name: string;
}
/**
 * Type representing blurred image data.
 * @hidden
 */
type IBlurred = {
    data: string;
    shrink_factor: number;
    size: number;
    status: string;
};
/**
 * Type representing a PNG image loaded from a URL.
 * @hidden
 */
type IPngFromUrl = {
    height: number;
    size: number;
    width: number;
    path: string;
    status: string;
};
/**
 * Interface representing PNG background images in different resolutions.
 * @hidden
 */
interface IPngBackgroundDTO {
    blurred: IBlurred;
    preview: IPngFromUrl;
    full: IPngFromUrl;
}

/**
 * Settings for the BookingApiClient.
 * @hidden
 */
interface IBookingApiClientSettings {
    baseUrl: string;
    publicKey: string;
    debug?: boolean;
    forceSvg?: boolean;
}
/**
 * Metrics for API requests.
 * @hidden
 */
interface RequestMetrics {
    data?: string;
    requestTime: number;
    responseSize: number;
}
/**
 * Error thrown when the booking API returns a non-2xx response.
 * Preserves the HTTP status and the backend error code (e.g. EVENT_ARCHIVED, EVENT_NOT_PUBLISHED).
 */
declare class ApiError extends Error {
    readonly status: number;
    readonly errorCode: string | undefined;
    constructor(status: number, statusText: string, errorCode?: string);
}
/**
 * API client for fetching schema and price data from the booking API.
 * @hidden
 */
declare class BookingApiClient {
    private settings;
    constructor(settings: IBookingApiClientSettings);
    /**
     * Returns schema data
     * @param schemaId Schema ID
     */
    fetchSchema(schemaId: number): Promise<ISchemaDTO>;
    /**
     * Returns schema data
     * @param venueId Venue GUID
     */
    fetchSchemaForVenue(venueId: string): Promise<Omit<IVenueDTO, 'seatmap'>>;
    /**
     * Returns schema data
     * @param eventId Event GUID
     */
    fetchSchemaForEvent(eventId: string): Promise<ISchemaDTO>;
    private unpackSchemaDTO;
    /**
     * Return prices information
     * @param eventId Event GUID
     */
    fetchPricesForEvent(eventId: string): Promise<IPriceListDTO>;
    /**
     * Return rows SVG information
     * @param eventId Event GUID
     */
    fetchRowsSvgForEvent(eventId: string): Promise<RequestMetrics>;
    /**
     * Makes request to booking API
     * @param url Relative API endpoint URL, e.g. 'event/prices/?id=XXX'
     */
    request<T>(url: string): Promise<T>;
    /**
     * Makes request to booking API
     * @param url Relative API endpoint URL, e.g. 'event/prices/?id=XXX'
     */
    requestPlain<T extends RequestMetrics>(url: string): Promise<T>;
    private restoreSeats;
    private restoreIds;
}

interface IPoint {
    readonly x: number;
    readonly y: number;
}

type ById$1<T> = {
    [id: number]: T;
};
interface IPrice {
    id: IPriceId;
    name: string;
}
interface IColoredPrice extends IPrice {
    color: string;
}
/**
 * @hidden
 */
type ColorSequenceSettings = string[][];
/**
 * @hidden
 */
declare const sortPrices: <T extends IPrice>(prices: T[]) => T[];
/**
 * @hidden
 */
declare const convertPricesToColored: (prices: IPrice[], colorSettings: ColorSequenceSettings) => IColoredPrice[];
/**
 * @hidden
 */
declare const convertPricesToColoredById: (prices: IPrice[], colorSettings: ColorSequenceSettings) => ById$1<IColoredPrice>;

interface IVisibilityStatus {
    selectable: boolean;
    visible: boolean;
}
interface IVisibilityStatuses {
    outline: IVisibilityStatus;
    seat: IVisibilityStatus;
    marker: IVisibilityStatus;
}

/**
 * @hidden
 */
interface IRendererMachineContext {
    mode?: string;
    scale: number;
    isEagleView: boolean;
    events: DestEvent[];
    hovered?: {
        targetType: RendererTargetType;
        id: number;
    };
    visibility?: IVisibilityStatuses;
    enable3DView?: boolean;
    rotationZ?: number;
    perspectiveZ?: number;
    tiltX?: number;
    getWidth?: () => number;
    getHeight?: () => number;
    /** Zoom strategy configuration for eagle eye view interactions */
    interactionZoomStrategy?: InteractionZoomStrategy;
}
/**
 * @hidden
 */
type RendererMachineReducer<T> = (ctx: IRendererMachineContext, src: T) => IRendererMachineContext;
/**
 * @hidden
 */
type RendererMachine = Machine<any, IRendererMachineContext, any>;
/**
 * @hidden
 */
type RendererMachineService = Service<RendererMachine>;
/**
 * @hidden
 */
declare enum RendererTargetType {
    SEAT = "seat",
    SECTION = "section"
}
/**
 * @hidden
 */
declare enum RendererSelectMode {
    REPLACE = "replace",
    ADD = "add",
    SUBTRACT = "subtract"
}
/**
 * Source events
 */
/**
 * @hidden
 */
declare enum SrcEventType {
    DRAG_START = "srcDragStart",
    DRAG_MOVE = "srcDragMove",
    DRAG_END = "srcDragEnd",
    CLICK = "srcClick",
    MOUSE_MOVE = "srcMouseMove"
}
/**
 * @hidden
 */
type SrcEvent = IDragStartSrcEvent | IDragMoveSrcEvent | IDragEndSrcEvent | IClickSrcEvent | IMouseMoveSrcEvent;
/**
 * @hidden
 */
interface IDragSrcEvent<T> {
    type: T;
    origin: {
        x: number;
        y: number;
    };
    delta: {
        x: number;
        y: number;
    };
    shiftKey?: boolean;
    altKey?: boolean;
    metaKey?: boolean;
}
/**
 * @hidden
 */
type IDragStartSrcEvent = IDragSrcEvent<SrcEventType.DRAG_START>;
/**
 * @hidden
 */
type IDragMoveSrcEvent = IDragSrcEvent<SrcEventType.DRAG_MOVE>;
/**
 * @hidden
 */
type IDragEndSrcEvent = IDragSrcEvent<SrcEventType.DRAG_END>;
/**
 * @hidden
 */
interface IClickSrcEvent {
    type: SrcEventType.CLICK;
    target: HTMLElement;
    point: {
        x: number;
        y: number;
    };
    section?: ISection;
    seat?: ISeat;
    shiftKey?: boolean;
    altKey?: boolean;
    metaKey?: boolean;
}
/**
 * @hidden
 */
interface IMouseMoveSrcEvent {
    type: SrcEventType.MOUSE_MOVE;
    target: HTMLElement;
    section?: ISection;
    seat?: ISeat;
}
/**
 * Output events
 */
/**
 * @hidden
 */
declare enum DestEventType {
    PAN = "destPan",
    RECT_SELECT = "destRectSelect",
    DESELECT = "destDeselect",
    PAN_ZOOM = "destPanZoom",
    SEAT_SELECT = "destSeatSelect",
    SEAT_CART_SWITCH = "destSeatCartSwitch",
    SECTION_CLICK = "destSectionClick",
    SEAT_MOUSE_ENTER = "destSeatMouseEnter",
    SECTION_MOUSE_ENTER = "destSectionMouseEnter",
    SEAT_MOUSE_LEAVE = "destSeatMouseLeave",
    SECTION_MOUSE_LEAVE = "destSectionMouseLeave"
}
/**
 * @hidden
 */
type DestEvent = IPanDestEvent | IRectSelectDestEvent | IPanZoomDestEvent | IDeselectDestEvent | ISeatSelectDestEvent | ISeatCartSwitchDestEvent | ISectionClickDestEvent | ISeatMouseEnterDestEvent | ISectionMouseEnterDestEvent | ISeatMouseLeaveDestEvent | ISectionMouseLeaveDestEvent;
/**
 * @hidden
 */
interface IPanDestEvent {
    type: DestEventType.PAN;
    isStart?: boolean;
    isFinish?: boolean;
    delta: {
        x: number;
        y: number;
    };
}
/**
 * @hidden
 */
interface IRectSelectDestEvent {
    type: DestEventType.RECT_SELECT;
    selectMode: RendererSelectMode;
    isStart?: boolean;
    isFinish?: boolean;
    isRowsMode?: boolean;
    isSectionsMode?: boolean;
    rect: {
        x: number;
        y: number;
        width: number;
        height: number;
    };
}
/**
 * Pan-zoom destination event.
 * Triggered when clicking in eagle eye view to zoom into the venue.
 * @hidden
 */
interface IPanZoomDestEvent {
    type: DestEventType.PAN_ZOOM;
    /** Target zoom scale */
    scale: number;
    /** Origin point in viewport coordinates */
    origin?: {
        x: number;
        y: number;
    };
    /** Section at the clicked point, if any */
    section?: ISection;
    /** Zoom strategy to apply */
    strategy?: InteractionZoomStrategy;
}
/**
 * @hidden
 */
interface ISeatMouseEnterDestEvent {
    type: DestEventType.SEAT_MOUSE_ENTER;
    isRowsMode?: boolean;
    seat: ISeat;
}
/**
 * @hidden
 */
interface ISectionMouseEnterDestEvent {
    type: DestEventType.SECTION_MOUSE_ENTER;
    section: ISection;
}
/**
 * @hidden
 */
interface ISeatMouseLeaveDestEvent {
    type: DestEventType.SEAT_MOUSE_LEAVE;
}
/**
 * @hidden
 */
interface ISectionMouseLeaveDestEvent {
    type: DestEventType.SECTION_MOUSE_LEAVE;
}
/**
 * @hidden
 */
interface IDeselectDestEvent {
    type: DestEventType.DESELECT;
}
/**
 * @hidden
 */
interface ISeatSelectDestEvent {
    type: DestEventType.SEAT_SELECT;
    selectMode: RendererSelectMode;
    point: {
        x: number;
        y: number;
    };
    seat: ISeat;
    isRowsMode?: boolean;
}
/**
 * @hidden
 */
interface ISeatCartSwitchDestEvent {
    type: DestEventType.SEAT_CART_SWITCH;
    point: {
        x: number;
        y: number;
    };
    seat: ISeat;
}
/**
 * @hidden
 */
interface ISectionClickDestEvent {
    type: DestEventType.SECTION_CLICK;
    point: {
        x: number;
        y: number;
    };
    section: ISection;
    isSectionsMode?: boolean;
}

type GpuTier = 'high' | 'constrained';
interface GpuProbeResult {
    renderer: string;
    maxTextureSize: number;
    deviceMemory: number | undefined;
    /** Texture upload throughput benchmark score (ms). Lower = faster GPU. -1 if benchmark failed. */
    benchmarkMs: number;
}
interface DeviceCapabilities {
    tier: GpuTier;
    maxCanvasDimension: number;
    gpu: GpuProbeResult | null;
}

/**
 * Label positioning and style data for a section outline (GA, seated, or background-bound).
 * @hidden
 */
interface ISectionLabelInfo {
    id: number;
    name: string;
    transform: TransformArray;
    isTable?: boolean;
    textColor?: string;
    /** Relative offset from section center for label positioning (SEAT-624) */
    labelOffset?: {
        x: number;
        y: number;
    };
    /** Style overrides for the label (SEAT-624) */
    labelStyle?: {
        fontScale?: number;
        color?: string;
        opacity?: number;
        fontWeight?: 'normal' | 'bold';
        background?: string;
        visible?: boolean;
        showPrice?: boolean;
    };
    /** When true, label is centered on shape centroid (no vertical shift above seats) */
    centroid?: boolean;
    hideText?: boolean;
    hasPrice?: boolean;
    fontScale?: number;
}
/**
 * @hidden
 */
declare class Context {
    private redrawHandler;
    element: HTMLElement;
    settings: IRendererSettings;
    seatImages: {
        [id: string]: HTMLImageElement;
    };
    cart: ICart;
    gaCategories: {
        [id: number]: number;
    };
    categoriesColor: {
        [id: number]: string | undefined;
    };
    scale: number;
    translate: IPoint;
    isEagleView: boolean;
    visibility: IVisibilityStatuses;
    width: number;
    height: number;
    physicalWidth: number;
    physicalHeight: number;
    capabilities: DeviceCapabilities;
    enable3DView: boolean;
    rotationZ: number;
    perspectiveZ: number;
    tiltX: number;
    private _seats;
    seatsIndex: KDBush;
    seatsById: ById<ISeat>;
    seatsByRowId: {
        [rowId: number]: ISeat[];
    };
    rowsById: ById<IRowDTO>;
    sectionsById: ById<ISector>;
    pricesById: ById<IColoredPrice>;
    seatsKeysMissedOnPriceSet: string[];
    seatsIdsMissedOnPriceSet: number[];
    rowsPolylines?: Array<{
        points: {
            x: number;
            y: number;
        }[];
        widthPx?: number;
        color?: string;
    }>;
    rowsPolylinesVersion: number;
    /**
     * @hidden
     */
    private _pricesDTO;
    private _selectedSeatIds;
    private _selectedGaId?;
    underlay: {
        svgString?: Nullable<string>;
        viewBox: {
            x: number;
            y: number;
            width: number;
            height: number;
        };
        svgUrl?: string;
        outlineSvg?: Nullable<string>;
        pngBackground?: IPngBackgroundDTO;
    };
    hoveredSeat?: ISeat;
    hoveredRow?: IRowDTO;
    sectionLabelInfo: ISectionLabelInfo[];
    _selectedAt: {
        [seatId: number]: number;
    };
    _deselectedAt: {
        [seatId: number]: number;
    };
    constructor(element: HTMLElement, settings: IRendererSettings, redrawHandler: () => void);
    set selectedSeatIds(value: number[]);
    get selectedSeatIds(): number[];
    set selectedGaId(value: number | undefined);
    get selectedGaId(): number | undefined;
    destroy(): void;
    /**
     * @hidden
     */
    setPricesDTO(value: IPriceListDTO): void;
    /**
     * @hidden
     */
    getPricesDTO(): IPriceListDTO;
    setHovered(seat: ISeat | undefined, isRowsMode?: boolean): void;
    private createSeatImages;
    initCart(cart: ICart): void;
    get seats(): ISeat[];
    set seats(value: ISeat[]);
    getPositionByOffset: (offset: IPoint) => IPoint;
    getOffsetByPosition: (position: IPoint) => IPoint;
    addGaToCart(ga: ICartGa): void;
    removeGaFromCart(removedGa: IRemovedCartGa): void;
    /**
     * Clears the cart and records deselection timestamps for all seats.
     */
    clearCart(): void;
    /**
     * Removes seats from the cart by internal seat IDs and records deselection times.
     */
    removeSeatsFromCartByIds(ids: number[]): void;
    /**
     * Triggers a selection pulse animation for a seat and clears any pending deselection.
     */
    triggerSeatSelectionPulse(seatId: number): void;
    addSeatsToCart(seats: ICartSeat[]): void;
    rectSelectSeats(rect: {
        x: number;
        y: number;
        width: number;
        height: number;
    }, mode: RendererSelectMode): void;
    selectSeats(seats: number[], mode: RendererSelectMode): void;
    rectSelectRows(rect: {
        x: number;
        y: number;
        width: number;
        height: number;
    }, mode: RendererSelectMode): void;
    repairSeat: (s: ICartSeat) => ICartSeat | undefined;
    afterCartUpdate: () => void;
    repairGa: (ga: ICartGa) => ICartGa | undefined;
    findSeatByKey(key: string): ISeat | undefined;
    getCart(): ICart;
    isSeatInCart(seatId: number): boolean;
    isSectionSelected(sectorId: number): boolean;
    addSeatToCart(seatId: number): void;
    removeSeatFromCart(seatId: number): void;
    getCartSeats(): ISeat[];
    getSeatSelection(): ISeat[];
    setSectionSelection(sections?: number[] | string[]): (number | undefined)[] | null;
    getSvgSectionBySelection(): ISectorDTO[];
    getGaSectors(): ISector[];
    seatToCartSeat: (seat: ISeat, origCartSeat?: ICartSeat) => ICartSeat;
    seatToExtendedSeat: (seat: ISeat) => IExtendedSeat;
    calculateAbsolutePoint(point: IPoint): IPoint;
    getSeatByOffset: (offset: IPoint) => ISeat | undefined;
    /**
     * Hit-test a seat using a viewport-relative point (CSS px) while accounting for 3D view.
     * When 3D is enabled, the point is unprojected back to the stage before querying KDBush.
     */
    getSeatByViewportPoint: (viewportPoint: IPoint, viewportSize: {
        width: number;
        height: number;
    }) => ISeat | undefined;
}

type Nullable<T> = T | null | undefined;
type DeepPartial<T> = T extends object ? {
    [P in keyof T]?: DeepPartial<T[P]>;
} : T;
/**
 * Type for mapping objects by their ID.
 */
type ById<T> = {
    [id: number]: T;
};
type ColorById<T> = {
    [id: number | string]: T;
};
/**
 * Type representing a price identifier, which can be either a number or a string.
 * Used to uniquely identify price points in the system.
 */
type IPriceId = number | string;
/**
 * Type representing a transformation matrix as a 6-element array.
 */
type TransformArray = [number, number, number, number, number, number];
/**
 * Interface representing a seat in the venue with extended properties.
 * Contains all the base seat properties plus additional properties for rendering and interaction.
 */
interface ISeat extends IBaseSeat {
    /**
     * The price ID associated with this seat.
     */
    priceId?: IPriceId;
    /**
     * Whether the seat is locked and cannot be selected.
     */
    locked?: boolean;
    /**
     * Whether the seat is filtered out by current filter criteria.
     */
    filtered?: boolean;
    /**
     * Special state information for the seat.
     */
    special?: ISpecialState;
    /**
     * The state of the seat.
     */
    state?: SeatInteractionState;
}
/**
 * Interface representing a sector in the venue with extended properties.
 * Contains all the base sector properties plus additional properties for rendering and interaction.
 */
interface ISector extends IBaseSector {
    /**
     * The price ID associated with this sector.
     */
    priceId?: IPriceId;
    /**
     * Special state information for the sector.
     */
    special?: ISpecialState;
}
/**
 * Interface representing a section in the venue.
 * A section is a logical grouping of seats or a general admission area.
 */
interface ISection {
    /**
     * The unique ID of the section.
     */
    id?: number;
    /**
     * The name of the section.
     */
    name: string;
    /**
     * Whether this is a general admission section.
     */
    ga: boolean;
    /**
     * The rectangular bounds of the section.
     */
    rect: ISectionRect;
    /**
     * The price for the section.
     */
    price?: number;
    /**
     * Special state information for the section.
     */
    special?: ISpecialState;
    /**
     * The type of the section.
     */
    type?: string | null;
    /**
     * The total number of seats in the section.
     */
    seatCount?: number;
    /**
     * Text color for the section label (e.g., GA section name).
     */
    textColor?: string;
}
/**
 * Visual and interaction states that can be applied to entities
 */
interface IEntityStates {
    highlighted: boolean;
    selected: boolean;
    unavailable: boolean;
    filtered: boolean;
}
/**
 * Metadata for a section including visual states, bounds, and rendering info
 */
interface ISectionMetadata {
    id: number;
    name: string;
    guid?: string;
    type?: string;
    elementCount: number;
    seatCount?: number;
    priceId?: number | string;
    isGa?: boolean;
    disabled?: boolean;
    filtered?: boolean;
    bounds?: DOMRect | null;
    center?: {
        x: number;
        y: number;
    } | null;
    centerOutsideViewBox?: boolean;
    outlineSource?: 'svg' | 'shape' | 'auto' | 'fallback';
    states: IEntityStates;
}
/**
 * Metadata for a seat including visual states, position, and availability
 */
interface ISeatMetadata {
    id: number;
    key: string;
    sectionId: number;
    sectionName?: string;
    row?: string;
    seat?: string;
    x: number;
    y: number;
    priceId?: number | string;
    available: boolean;
    locked?: boolean;
    filtered?: boolean;
    inCart: boolean;
    states: IEntityStates;
}
/**
 * Interface representing a section with additional coordinate information.
 * Extends ISection with absolute x and y coordinates.
 */
interface ISectionWithCoords {
    /**
     * The X coordinate of the section.
     */
    x: number;
    /**
     * The Y coordinate of the section.
     */
    y: number;
    /**
     * The unique ID of the section.
     */
    id?: number | undefined;
    /**
     * The name of the section.
     */
    name: string;
    /**
     * Whether this is a general admission section.
     */
    ga: boolean;
    /**
     * The rectangular bounds of the section.
     */
    rect: ISectionRect;
    /**
     * The price for the section.
     */
    price?: number | undefined;
    /**
     * Special state information for the section.
     */
    special?: ISpecialState | undefined;
    /**
     * The type of the section.
     */
    type?: string | undefined | null;
}
/**
 * Interface representing the rectangular bounds of a section.
 */
interface ISectionRect {
    /**
     * The left coordinate of the rectangle.
     */
    left: number;
    /**
     * The top coordinate of the rectangle.
     */
    top: number;
    /**
     * The width of the rectangle.
     */
    width: number;
    /**
     * The height of the rectangle.
     */
    height: number;
}
/**
 * Interface representing a seat in the shopping cart.
 */
interface ICartSeat {
    /**
     * The unique identifier of the seat.
     */
    id?: number;
    /**
     * The unique key for the seat, typically combining section, row, and seat information.
     */
    key: string;
    /**
     * The price of the seat.
     */
    price?: number;
    /**
     * Special state information for the seat.
     */
    special?: ISpecialState;
}
/**
 * Extended interface for a seat with additional coordinate and descriptive information.
 * Extends ICartSeat with position and section details.
 */
interface IExtendedSeat extends ICartSeat {
    /**
     * The X coordinate of the seat.
     */
    x: number;
    /**
     * The Y coordinate of the seat.
     */
    y: number;
    /**
     * The absolute X coordinate of the seat.
     */
    ax: number;
    /**
     * The absolute Y coordinate of the seat.
     */
    ay: number;
    /**
     * The ID of the section containing this seat.
     */
    sectionId: number;
    /**
     * The ID of the sector containing this seat.
     */
    sectorId: number;
    /**
     * The name or number of the seat.
     */
    seatName: string;
    /**
     * The row number of the seat.
     */
    rowNumber: number;
    /**
     * The name of the section containing this seat.
     */
    sectionName: string;
    /**
     * Whether the seat is accessible for people with disabilities.
     */
    isAccessible?: boolean;
}
/**
 * Interface representing a general admission (GA) item in the shopping cart.
 */
interface ICartGa {
    /**
     * The ID of the sector for this GA item.
     */
    sectorId?: number;
    /**
     * The unique key for the GA item.
     */
    key: string;
    /**
     * The number of GA tickets in this item.
     */
    count: number;
    /**
     * The price per GA ticket.
     */
    price?: number;
}
/**
 * Interface representing a removed general admission (GA) item from the cart.
 */
interface IRemovedCartGa {
    /**
     * The ID of the sector for the removed GA item.
     */
    sectorId: number;
    /**
     * The price of the removed GA item.
     */
    price?: number;
}
/**
 * Interface representing the shopping cart containing selected seats and GA items.
 */
interface ICart {
    /**
     * Array of selected seats in the cart.
     */
    seats: ICartSeat[];
    /**
     * Array of general admission items in the cart.
     */
    ga: ICartGa[];
}
/**
 * Type definition for a function that filters seats based on custom criteria.
 * @param seat - The seat to evaluate against the filter criteria
 * @returns A boolean indicating whether the seat passes the filter (true) or not (false)
 */
type SeatFilter = (seat: ISeat) => boolean;
/**
 * Type definition for a seat price scheme, which associates a price with a specific seat.
 */
type ISeatPriceScheme = {
    /**
     * Optional unique identifier for the price scheme.
     */
    id?: number;
    /**
     * The unique key of the seat this price applies to.
     */
    seatKey: string;
    /**
     * The price value for the seat.
     */
    price: number;
    /**
     * The price ID reference for the seat.
     */
    priceId: IPriceId;
};
interface IZoomSettings {
    presets: number[];
    maxZoomToFitScale: number;
    minPinchZoom: number;
    maxPinchZoom: number;
}
interface IRange {
    from?: number;
    to?: number;
}
interface IVisibleSetting {
    visible?: IRange;
    selectable?: IRange;
}
/**
 * Visibility settings for different elements based on zoom level.
 */
interface IVisibilitySettings {
    /**
     * Visibility configuration for seats.
     */
    seats?: IVisibleSetting;
    /**
     * Visibility configuration for section outlines.
     */
    outlines?: IVisibleSetting;
    /**
     * Visibility configuration for custom markers.
     * Controls when markers are visible and interactive based on zoom level.
     */
    markers?: IVisibleSetting;
}
/**
 * Minimap position options.
 */
type MinimapPosition = 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
/**
 * Minimap configuration settings.
 */
interface IMinimapSettings {
    /**
     * Whether the minimap is enabled.
     */
    enabled: boolean;
    /**
     * Position of the minimap on the screen.
     * @default 'bottom-right'
     */
    position?: MinimapPosition;
    /**
     * Width of the minimap in pixels. Height is calculated automatically based on aspect ratio.
     * @default 200
     */
    width?: number;
    /**
     * Maximum minimap height as a percentage (0..100) of the seatmap container height.
     * When set and the computed minimap height exceeds this limit, minimap width is reduced proportionally
     * to preserve the venue aspect ratio.
     */
    maxHeightPercent?: number;
    /**
     * Opacity of the minimap.
     * @default 0.8
     */
    opacity?: number;
    /**
     * Background color of the minimap.
     */
    backgroundColor?: string;
    /**
     * Border color of the minimap.
     */
    borderColor?: string;
    /**
     * Color of the viewport indicator rectangle.
     * @default '#FF5722'
     */
    viewportColor?: string;
    /**
     * Border width in pixels.
     * @default 2
     */
    borderWidth?: number;
    /**
     * Margin from the edge of the screen in pixels.
     * @default 16
     */
    margin?: number;
    /**
     * Color of the dim overlay outside the viewport on the minimap.
     * @default '#000000'
     */
    offscreenColor?: string;
    /**
     * Opacity of the dim overlay outside the viewport on the minimap (0..1).
     * @default 0.4
     */
    offscreenOpacity?: number;
    /**
     * Show cart pins on the minimap.
     * @default true
     */
    showCartPins?: boolean;
    /**
     * Show custom markers on the minimap.
     * @default true
     */
    showMarkers?: boolean;
}
type MarkerTarget = {
    type: 'seat';
    seatId: number;
} | {
    type: 'section';
    sectionId: number;
} | {
    type: 'point';
    x: number;
    y: number;
};
type MarkerAppearance = {
    type: 'pin';
    color?: string;
} | {
    type: 'circle';
    radius?: number;
    color?: string;
    label?: string;
} | {
    type: 'custom';
    svg: string;
    width?: number;
    height?: number;
};
interface IMarker {
    id: string;
    target: MarkerTarget;
    appearance?: MarkerAppearance;
    showOnCanvas?: boolean;
    showOnMinimap?: boolean;
    interactive?: boolean;
    data?: Record<string, unknown>;
}
/**
 * Individual zoom strategy option for eagle eye view interactions.
 *
 * @public
 */
type InteractionZoomStrategyType = 'default' | 'section' | 'next-scale';
/**
 * Zoom strategy configuration for eagle eye view interactions.
 * Can be a single strategy or an array of strategies for fallback behavior.
 *
 * When an array is provided, strategies are tried in order until one succeeds.
 * If all strategies fail, falls back to default zoom behavior (scale 1).
 *
 * The `'section'` strategy only works in eagle eye view. When already zoomed to a section,
 * it will fall through to the next strategy, enabling progressive zoom behavior.
 *
 * @example
 * ```typescript
 * // Single strategy
 * interactionZoomStrategy: 'section'
 *
 * // Progressive zoom with fallback
 * interactionZoomStrategy: ['section', 'next-scale']
 * // First click (eagle view): zooms to section
 * // Second click (at section): zooms to next scale step
 * ```
 *
 * @public
 */
type InteractionZoomStrategy = InteractionZoomStrategyType | InteractionZoomStrategyType[];
/**
 * Default settings for markers.
 */
interface IMarkerSettings {
    /**
     * Default appearance for markers when not specified per-marker.
     * @default { type: 'pin' }
     */
    defaultAppearance?: MarkerAppearance;
    /**
     * Whether markers are shown on the main canvas by default.
     * @default true
     */
    defaultShowOnCanvas?: boolean;
    /**
     * Whether markers are shown on the minimap by default.
     * @default true
     */
    defaultShowOnMinimap?: boolean;
    /**
     * Whether markers are interactive (clickable/hoverable) by default.
     * @default false
     */
    defaultInteractive?: boolean;
}
interface IResolvedMarker {
    marker: IMarker;
    x: number;
    y: number;
}
/**
 * Loading phase identifiers for progress tracking.
 */
type LoadingPhase = 'schema' | 'prices' | 'rows' | 'background-blurred' | 'background-preview' | 'background-full' | 'processing';
/**
 * Progress event data passed to onLoadProgress callback.
 */
interface ILoadProgressEvent {
    phase: LoadingPhase;
    progress: number;
    isIndeterminate: boolean;
    message: string;
}
/**
 * Background image loaded event data.
 * @hidden
 */
interface IBackgroundImageLoadedEvent {
    type: 'blurred' | 'preview' | 'full' | 'detail-crop';
    loadTimeMs: number;
    sizeBytes?: number;
    /** Native image width in pixels */
    width?: number;
    /** Native image height in pixels */
    height?: number;
    /** Estimated uncompressed GPU VRAM usage in bytes (width * height * 4 for RGBA) */
    gpuBytes?: number;
}
/**
 * Loader display style.
 */
type LoaderStyle = 'overlay' | 'top-bar';
/**
 * Loader theme configuration.
 */
interface ILoaderTheme {
    overlayColor?: string;
    overlayOpacity?: number;
    progressBarColor?: string;
    progressBarBackgroundColor?: string;
    progressBarHeight?: number;
    textColor?: string;
    fontSize?: number;
}
/**
 * Loader configuration settings.
 */
/**
 * Customizable error message with title and optional subtitle.
 */
interface IErrorMessage {
    title: string;
    subtitle?: string;
}
interface ILoaderSettings {
    enabled: boolean;
    style?: LoaderStyle;
    theme?: ILoaderTheme;
    showText?: boolean;
    texts?: {
        schema?: string;
        prices?: string;
        rows?: string;
        backgroundBlurred?: string;
        backgroundPreview?: string;
        backgroundFull?: string;
        processing?: string;
    };
    /**
     * Customizable error messages shown when event loading fails.
     * Each key corresponds to a backend error code.
     */
    errorTexts?: {
        /** Shown when the event has been archived (HTTP 410). */
        eventArchived?: IErrorMessage;
        /** Shown when the event is not published (HTTP 422). */
        eventNotPublished?: IErrorMessage;
        /** Shown when the event does not exist (HTTP 404). */
        eventNotFound?: IErrorMessage;
        /** Shown for any other API error. */
        genericError?: IErrorMessage;
    };
}
/**
 * Configuration settings for the renderer.
 * Defines various options that control the behavior and appearance of the renderer.
 */
interface IRendererSettings {
    /**
     * Debug mode for the renderer.
     * @hidden
     */
    debug?: boolean;
    /**
     * Environment setting that determines which API endpoint to use.
     * Can be 'local', 'stage', or 'production' (default).
     */
    env?: string;
    /**
     * Base URL prefix for background images.
     * Used to resolve relative image paths to absolute URLs.
     * Absolute URLs (starting with http://, https://, or data:) are used as-is.
     */
    backgroundImageBaseUrl?: string;
    /**
     * External price information for seats.
     */
    seatsPrices?: ISeatPriceScheme[];
    /**
     * Theme settings for the renderer.
     */
    theme?: IRendererTheme;
    markers?: IMarkerSettings;
    /**
     * Delay in milliseconds for debounced events.
     */
    debounceDelay?: number;
    /**
     * Number of seats to select as a group.
     */
    groupSize?: number;
    /**
     * Fixed height for the renderer in pixels.
     */
    height?: number;
    /**
     * Fixed width for the renderer in pixels.
     * If not provided, the renderer will use the container element's width.
     */
    width?: number;
    /**
     * Initial padding around the venue when first loaded.
     */
    initialPadding?: number;
    /**
     * Padding around the venue during normal operation.
     */
    padding?: number;
    /**
     * Minimum zoom level required to enable seat selection.
     *
     * @deprecated
     * Use visibilitySettings instead
     */
    seatSelectionMinZoom?: number;
    /**
     * Maximum number of seats that can be selected.
     */
    selectionLimit?: number;
    /**
     * Duration of transform animations in milliseconds.
     */
    transformAnimationDuration?: number;
    /**
     * Duration of zoom animations in milliseconds.
     */
    zoomAnimationDuration?: number;
    /**
     * Zoom mode for zoomToSection method.
     * 'fit' - Adaptively fit section to screen with padding
     * 'scale' - Zoom to a specific scale value
     * @default 'fit'
     */
    zoomToSectionMode?: 'fit' | 'scale';
    /**
     * Default scale value when zoomToSectionMode is 'scale' and no custom scale provided.
     * @default 1.0
     */
    zoomToSectionDefaultScale?: number;
    /**
     * Padding percentage around section when fitting to screen (0.0 to 1.0).
     * 0.1 means 10% padding on all sides.
     * @default 0.1
     */
    zoomToSectionFitPadding?: number;
    /**
     * Threshold dimensions for adaptive zoom behavior.
     * Small sections get capped zoom, large sections get minimum zoom.
     * @default { small: 200, large: 1000 }
     */
    zoomToSectionAdaptiveThreshold?: {
        small: number;
        large: number;
    };
    /**
     * If true, disables zoom when clicking on empty space.
     */
    disableZoomToEmptySpace?: boolean;
    /**
     * If true, disables cart changed when clicking on sections.
     */
    disableCartInteractions?: boolean;
    /**
     *
     */
    disableOutlinesInHelicopterView?: boolean;
    /**
     * If true, hides all seats from view.
     */
    hideSeats?: boolean;
    /**
     * If true, shows the outline layer during animations.
     */
    showOutlineLayerOnAnimation?: boolean;
    /**
     * If true, shows row labels.
     */
    showRows?: boolean;
    /**
     * If true, shows outlines for unavailable seats.
     */
    showUnavailableOutlines?: boolean;
    /**
     * If true, uses WebGL for rendering instead of Canvas.
     */
    switchToWebGL?: boolean;
    /**
     * Force the GPU capability tier instead of auto-detecting from device hardware.
     * Since SEAT-990 the two-layer texture system (detail crop on zoom) runs on every
     * WebGL device regardless of tier; the flag now only caps physical canvas dimensions
     * to 2048px on 'constrained'.
     * Also settable via URL parameter `?gpuTier=constrained`.
     * @hidden
     */
    gpuTier?: 'high' | 'constrained';
    /**
     * If true, the renderer skips preview and full PNG background loads and uses
     * the SVG background instead. The blurred PNG (inline base64) is still loaded
     * as an instant low-quality placeholder until SVG rasterization completes.
     * Useful when the PNG storage is not CORS-configured.
     * Also settable via URL parameter `?forceSvg=true` and propagated to the
     * booking-service `/event/` request as `forceSvg=true`.
     */
    forceSvg?: boolean;
    /**
     * If true, shows the debug overlay layer (diagnostic lines from sections to venue center).
     */
    showDebugLayer?: boolean;
    /**
     * If true, enables 3D view mode for enhanced visualization.
     */
    enable3DView?: boolean;
    /**
     * If true, highlights all section outlines with a border.
     */
    highlightAllOutlines?: boolean;
    /**
     * Minimap configuration settings.
     */
    minimap?: IMinimapSettings;
    /**
     * Loader configuration settings.
     * Controls the loading overlay with progress bar during event loading.
     */
    loader?: ILoaderSettings;
    /**
     * Option to configure zoom settings
     */
    zoomSettings?: IZoomSettings;
    /**
     * Option to configure visibility settings
     */
    visibilitySettings?: IVisibilitySettings;
    /**
     * Zoom strategy when clicking on the canvas in eagle eye view.
     * Can be a single strategy or an array of strategies for fallback behavior.
     *
     * Available strategies:
     * - `'default'`: Zoom to scale 1.0 (current behavior)
     * - `'section'`: Zoom to the clicked section using adaptive fit (only works in eagle eye view)
     * - `'next-scale'`: Zoom to the next scale step in zoom presets
     *
     * When multiple strategies are provided, they are tried in order.
     * The first strategy that can be applied is executed.
     * If all strategies fail, falls back to default zoom behavior.
     *
     * **Note:** The `'section'` strategy only works when in eagle eye view (zoomed out).
     * If already zoomed to a section, clicking again will fall through to the next strategy,
     * allowing progressive zoom (e.g., section → next-scale → deeper zoom).
     *
     * @example Single strategy
     * ```typescript
     * interactionZoomStrategy: 'section'
     * ```
     *
     * @example Multiple strategies with progressive zoom
     * ```typescript
     * interactionZoomStrategy: ['section', 'next-scale']
     * // First click: zooms to section (from eagle view)
     * // Second click: zooms to next scale (already at section, falls through)
     * ```
     *
     * @example Explicit fallback to default
     * ```typescript
     * interactionZoomStrategy: ['section', 'default']
     * // Tries to zoom to section first, if no section clicked or not in eagle view, zooms to scale 1
     * ```
     *
     * @default 'default'
     */
    interactionZoomStrategy?: InteractionZoomStrategy;
    /**
     * Rises when the mouse pointer moves above a seat.
     *
     * @remarks
     *
     * Seat is passed as a param to the handler (see IExtendedSeat).
     */
    onSeatMouseEnter?: (seat: IExtendedSeat) => void;
    /**
     * Same as `onSeatMouseEnter` but with debounce.
     *
     * @remarks
     *
     * Seat is passed as a param to the handler (see IExtendedSeat).
     */
    onSeatDebouncedEnter?: (seat: IExtendedSeat) => void;
    /**
     * Fires when the mouse pointer leaves a seat.
     */
    onSeatMouseLeave?: () => void;
    /**
     * Fires when the user marks a seat as selected.
     *
     * @remarks
     *
     * Seat is passed as a param to the handler (see IExtendedSeat).
     *
     * To cancel seat selection you can return `false` or Promise resolving to `false`.
     */
    onSeatSelect?: (seat: IExtendedSeat) => void | boolean | Promise<void | boolean>;
    /**
     * Fires when the user deselects a seat.
     *
     * @remarks
     *
     * Seat is passed as a param to the handler (see IExtendedSeat).
     *
     * To cancel seat deselection you can return `false` or Promise resolving to `false`.
     */
    onSeatDeselect?: (seat: IExtendedSeat) => void | boolean | Promise<void | boolean>;
    /**
     * Fires when the user marks a seat or seats as selected.
     *
     * @remarks
     *
     * Seats are passed as a param to the handler (see ISeat).
     *
     */
    onSeatsSelect?: (seats: ISeat[]) => void;
    /**
     * Fires when the user deselects a seat or seats.
     *
     * @remarks
     *
     * Seats are passed as a param to the handler (see ISeat).
     *
     */
    onSeatsDeselect?: (seats: ISeat[]) => void;
    /**
     * Fires when the cart was modified.
     *
     * @remarks
     *
     * Cart state is passed as a param to the handler (see ICart).
     */
    onCartChange?: (cart: ICart, prevCart?: ICart) => void;
    onMarkerClick?: (marker: IMarker, event: MouseEvent) => void;
    onMarkerMouseEnter?: (marker: IMarker) => void;
    onMarkerMouseLeave?: (marker: IMarker) => void;
    /**
     * Fires when the mouse pointer moves above a section.
     *
     * @remarks
     *
     * Section is passed as a param to the handler (see ISection).
     */
    onSectorMouseEnter?: (section: ISection) => void;
    /**
     * Fires when the mouse pointer leaves a section.
     */
    onSectorMouseLeave?: () => void;
    /**
     * Fires when the user clicks on a section.
     *
     * @deprecated
     * Use onSectionClick instead
     */
    onSectorClick?: (section: ISection) => void;
    /**
     * Fires when the user clicks on a section.
     *
     * @remarks
     *
     * Section is passed as a param to the handler (see ISection).
     */
    onSectionClick?: (section: ISection) => void;
    /**
     * Fires after section selection was updated in selectSections mode.
     *
     * @remarks
     *
     * Called with the full array of currently selected sections after any
     * selection change (single click toggle or rect drag selection).
     */
    onSectionsSelectionChange?: (sections: ISection[]) => void;
    /**
     * Fires before the zoom animation started.
     */
    onZoomStart?: (newZoom: number, oldZoom: number) => void;
    /**
     * Fires after the zoom animation ended.
     */
    onZoomEnd?: (newZoom: number, oldZoom?: number) => void;
    /**
     * Fires when component full redrawing starts.
     */
    onRedrawStart?: () => void;
    /**
     * Fires when component full redrawing ends.
     */
    onRedrawEnd?: () => void;
    /**
     * Fires when schema data has been successfully loaded and processed.
     *
     * @remarks
     *
     * This event is triggered after the schema data is fully loaded and all internal
     * processing is complete. It can be used to perform actions that depend on the
     * schema being fully initialized.
     */
    onSchemaDataLoaded?: () => void;
    /**
     * Fires during loading to report progress.
     *
     * @remarks
     *
     * Progress event contains phase, progress percentage (0-100),
     * whether the phase is indeterminate, and a status message.
     */
    onLoadProgress?: (event: ILoadProgressEvent) => void;
    /**
     * Fires when a background image has been loaded.
     *
     * @remarks
     *
     * Provides the image type (blurred, preview, full), load time in ms, and size in bytes.
     * @hidden
     */
    onBackgroundImageLoaded?: (event: IBackgroundImageLoadedEvent) => void;
    /**
     * Fires when the WebGL context is lost (e.g., GPU memory pressure on mobile).
     * Host apps can use this to show fallback UI.
     * @hidden
     */
    onWebGLContextLost?: () => void;
    /**
     * Fires when the WebGL context is restored after a loss event.
     * @hidden
     */
    onWebGLContextRestored?: () => void;
    /**
     * Fires while panning.
     */
    onPan?: (delta: IPoint, isFinish?: boolean) => void;
    /**
     * Fires after seat selection was updated.
     */
    onSeatSelectionChange?: () => void;
    /**
     * Fires after seats selection was updated.
     */
    onSeatsSelectionChange?: (seats: ISeat[]) => void;
    /**
     * You can control seats' styling by returning custom style for each seat
     */
    onBeforeSeatDraw?: (event: IBeforeSeatDrawEvent) => ISeatStyle;
    lockedSeatsFilter?: (seat: ISeat) => boolean;
    /**
     * Suppress console warnings for deprecated API methods.
     * Useful for gradual migration in production environments.
     * @default false
     */
    suppressDeprecationWarnings?: boolean;
    /**
     * Control visibility of outline types based on source.
     * Each source can be set to 'always', 'eagle-only', or 'hidden'.
     *
     * Source meanings:
     * - svg: bound to the background svg
     * - fallback: fallback outline generated from seats
     * - shape: editor-made basic shapes
     * - auto: editor-generated outline
     */
    outlineVisibility?: {
        auto?: 'always' | 'eagle-only' | 'hidden';
        fallback?: 'always' | 'eagle-only' | 'hidden';
        svg?: 'always' | 'eagle-only' | 'hidden';
        shape?: 'always' | 'eagle-only' | 'hidden';
    };
}
/**
 * Represents the possible interaction states of a seat.
 * Used to determine how a seat should be rendered based on user interaction.
 */
type SeatInteractionState = 'default' | 'hovered' | 'selected' | 'unavailable' | 'loading' | 'error';
/**
 * Interface for the event data passed to the onBeforeSeatDraw callback.
 * Contains information about the seat being drawn and its current state.
 */
interface IBeforeSeatDrawEvent {
    /**
     * The seat being drawn.
     */
    seat: ISeat;
    /**
     * The current interaction state of the seat.
     */
    state: SeatInteractionState;
    /**
     * The default style that will be applied to the seat.
     */
    style: ISeatStyle;
    /**
     * The rendering context.
     */
    context: Context;
}
interface IRendererSeatStyleSettings {
    default?: ISeatStyle;
    unavailable?: ISeatStyle;
    filtered?: ISeatStyle;
    hovered?: ISeatStyle;
    selected?: ISeatStyle;
    loading?: ISeatStyle;
    error?: ISeatStyle;
}
interface IBasicSeatStyle {
    size: number;
    color: string;
    seatName?: {
        font: string;
        color: string;
    };
    stroke?: {
        width: number;
        color: string;
        align: 'center' | 'inside' | 'outside';
    };
    imageId?: string;
    shadow?: {
        blur: number;
        color: string;
        x?: number;
        y?: number;
    };
}
interface ISeatStyle extends IBasicSeatStyle {
    accessible?: IBasicSeatStyle;
}
interface IRendererSvgSectionStylesSetting {
    default?: Pick<ISvgSectionStyle, 'sectionName' | 'stroke' | 'cursor' | 'bgColor'>;
    unavailable?: ISvgSectionStyle;
    filtered?: ISvgSectionStyle;
    hovered?: ISvgSectionStyle;
    selected?: ISvgSectionStyle;
}
interface ISvgSectionStyle {
    sectionName?: {
        color?: string;
    };
    bgColor?: string;
    stroke?: {
        color?: string;
        opacity?: number;
        width?: string;
    };
    cursor?: string;
    opacity?: number;
}
interface IRendererTheme {
    gridStep?: number;
    bgColor?: string;
    priceColors?: string[][];
    colorCategories?: string[];
    images?: {
        [id: string]: string;
    };
    seatStyles?: IRendererSeatStyleSettings;
    svgSectionStyles?: IRendererSvgSectionStylesSetting;
}

/**
 * Outline source meaning:
 * - svg: bound to the background svg
 * - fallback: fallback outline generated from seats
 * - shape: editor-made basic shapes
 * - auto: editor-generated outline
 */
type OutlineSource = 'svg' | 'shape' | 'auto' | 'fallback';
interface OutlineStates {
    highlighted?: boolean;
    selected?: boolean;
    unavailable?: boolean;
    filtered?: boolean;
}

/**
 * @hidden
 */
declare class OutlineLayer {
    svgElement: SVGSVGElement;
    private outlineRect;
    private context;
    private originalSvg;
    private backgroundSVG;
    private hasBackgroundOutline;
    private underlayBindedPathAttr;
    private outlineElementCache;
    private stateManager;
    private outlineRenderer;
    private transformManager;
    private rowsManager;
    getSvgRoot(): SVGSVGElement;
    setStateChangeCallback(callback: (sectionId: number) => void): void;
    private initializeHoverHandlers;
    constructor(context: Context);
    destroy(): void;
    applyOutlineAttributes(element: Element, source: OutlineSource, section: ISector): void;
    /**
     * Apply per-section textColor from shape metadata to text path elements.
     * Inline style overrides the generic CSS theme color.
     */
    private applyShapeTextColor;
    setOutlineStates(id: number | undefined, states: OutlineStates | null): void;
    getOutlineStates(id: number): IEntityStates | undefined;
    highlightSection(id?: number, clear?: boolean): void;
    selectSection(id?: number): void;
    unselectSection(id?: number): void;
    disableSection(id?: number): void;
    enableSection(id?: number): void;
    clearSectionHighlight(id?: number): void;
    filterSection(id?: number): void;
    unfilterSection(id?: number): void;
    private warnDeprecated;
    /** @deprecated Use selectSection() instead */
    setSectionSelection(id?: number): void;
    /** @deprecated Use highlightSection() instead */
    highlightGa(id?: number): void;
    /** @deprecated Use highlightSection() instead */
    focusSection(id?: number): void;
    /** @deprecated Use clearSectionHighlight() instead */
    clearSectionFocus(): void;
    /** @deprecated Use highlightSection() for programmatic hover or rely on native :hover */
    highlightAllSections(): void;
    getSectionRect(id: Nullable<number>): Nullable<DOMRect>;
    private checkCenterInViewBox;
    private getElementScreenRectInSvg;
    getSectionElement(id: number | undefined): Element | null;
    getSectionElements(id: number | undefined): Element[];
    getSectionCenter(id: Nullable<number>): Nullable<IPoint>;
    /** Extract data-font-scale attributes from SVG outline groups. */
    getFontScales(): Record<string, number>;
    get width(): number;
    get height(): number;
    updateSize(): void;
    checkBackgroundOutlines(): boolean | undefined;
    initializeBackgroundOutline(): void;
    /**
     *
     * refactoring plan:
     * * decompose this method into smaller ones
     *   - prepare SVG background outlines
     *     - GA outlines
     *     - sections outlines
     *   - prepare shapes outlines
     *     - GA only
     *   - prepare auto-generated outlines
     *     - Reserved seats
     *     - Tables
     *   - append outlines to the main svg element
     */
    setBackgroundAsOutline(): void;
    private createBackgroundSectionLabelInfo;
    private createTableSectionLabelInfo;
    private extractSVGBackgroundOutlines;
    cleanSvgInlineStyles(stylesToRemove?: string[]): void;
    updateOutlines(): void;
    private appendFallbackAndUnderlayOutlines;
    private getExcludedSectionIds;
    private createOrGetOutlineShapes;
    private appendFallbackOutlines;
    private appendShapeOutlines;
    private getOutlineRects;
    createFallbackOutlineRect(section: ISector): SVGRectElement;
    private getRenderContext;
    handleChangeEagleView(isEagleView?: boolean): void;
    /** @deprecated Use disableSection() instead */
    disableSvgSectionById: (id: number) => void;
    /** @deprecated Use enableSection() instead */
    enableSvgSectionById: (id: number) => void;
    /** @deprecated Use filterSection() instead */
    filterSvgSectionById: (id: number) => void;
    /** @deprecated Use unfilterSection() instead */
    removeFilterSvgSectionById: (id: number) => void;
    update(): void;
    updateAnimationStep(scale: number, translate: IPoint): void;
    hide(): void;
    show(): void;
    private getContextSvg;
    forceUpdate(): void;
    private apply3DTransforms;
    appendRowsOverlay(rowsFragment: string, css?: string): void;
}

interface IRendererZoomControls {
    zoomToFit: () => void;
    getSectionsWithCoords: () => ISectionWithCoords[];
}
interface ISectionTransform {
    rotationAngle: number;
    center: IPoint;
    top: IPoint;
    section: IPoint;
    skewAngle: number;
}

interface IStageLayer {
    destroy: () => void;
    backgroundElement: HTMLImageElement;
    /** Full-resolution background image retained in JS heap for on-demand detail cropping (all WebGL devices). */
    fullBackgroundImage: HTMLImageElement | null;
    redraw: () => void;
    drawOffscreenCanvas: () => void;
    drawOnscreenCanvas: (scale: number, translate: IPoint) => void;
    getVisibleSeats: () => ISeat[];
    updateSize: (physicalWidth?: number, physicalHeight?: number) => void;
    sectionViewActive: boolean;
    getAnimationState: () => {
        inProgress: boolean;
        rotationAngle: number;
        skewAngle: number;
        duration: number;
    };
    applySectionViewAnimation: (section: ISectionWithCoords, options: IRendererZoomControls) => Promise<boolean>;
    getAnimationPoint: () => IPoint;
    sectionViewTransform: ISectionTransform;
    /**
     * Captures a snapshot of the full seatmap (background-sized) for use in minimap.
     * Should resolve after the first full render finishes.
     */
    captureSeatmap: () => Promise<HTMLImageElement | null>;
    /** Notify that viewport has settled after animation -- triggers detail crop update on WebGL devices */
    onViewportSettled?: () => void;
    /** Dispose detail texture immediately -- called when animation starts to prevent stale crop flash */
    disposeDetailTexture?: () => void;
}

/**
 * Interface for the base Renderer functionality.
 * Defines the core methods and properties that all renderer implementations must provide.
 */
interface IRenderer {
    /**
     * Initializes the cart with the provided cart data.
     *
     * @param cart - The cart data to initialize
     */
    initCart: (cart: ICart) => void;
    /**
     * Gets the current cart state.
     *
     * @returns The current cart
     */
    getCart: () => ICart;
    /**
     * Clears all items from the cart.
     */
    clearCart: () => void;
    /**
     * Adds a general admission ticket to the cart.
     *
     * @param ga - The general admission ticket to add
     */
    addGaToCart: (ga: ICartGa) => void;
    /**
     * Removes a general admission ticket from the cart.
     *
     * @param removedGa - Information about the GA ticket to remove
     */
    removeGaFromCart: (removedGa: IRemovedCartGa) => void;
    /**
     * Adds seats to the cart.
     *
     * @param seats - The seats to add to the cart
     */
    addSeatsToCart: (seats: ICartSeat[]) => void;
    /**
     * Removes seats from the cart by their IDs.
     *
     * @param seatIds - The IDs of the seats to remove
     */
    removeSeatsFromCartByIds: (seatIds: number[]) => void;
    /**
     * Disables seats by their IDs, making them unavailable for selection.
     *
     * @param seatIds - The IDs of the seats to disable
     */
    disableSeatsByIds: (seatIds: number[]) => void;
    /**
     * Disables seats by their keys, making them unavailable for selection.
     *
     * @param keys - The keys of the seats to disable
     */
    disableSeatsByKeys: (keys: string[]) => void;
    /**
     * Updates the lock status of seats based on the provided filter.
     *
     * @param filter - The filter function to determine which seats to lock
     */
    updateSeatLocks: (filter: SeatFilter) => void;
    /**
     * Converts seat keys to seat IDs.
     *
     * @param keys - The seat keys to convert
     * @returns The corresponding seat IDs
     */
    seatKeysToIds: (keys: string[]) => number[];
    /**
     * Sets the group size for group selection.
     *
     * @param groupSize - The size of the group
     */
    setGroupSize: (groupSize: number) => void;
    /**
     * Gets the IDs of all marked seats.
     *
     * @returns The IDs of marked seats
     */
    getMarkedSeatsIds: () => number[];
    /**
     * Gets all available prices.
     *
     * @returns The available prices with color information
     */
    getPrices: () => IColoredPrice[];
    /**
     * Gets all seats in the venue.
     *
     * @returns All seats in the venue
     */
    getSeats: () => ISeatDTO[];
    /**
     * Gets the current zoom level.
     *
     * @returns The current zoom level
     */
    getZoom: () => number;
    /**
     * Gets the maximum allowed zoom level.
     *
     * @returns The maximum zoom level
     */
    getMaxZoom: () => number;
    /**
     * Gets the minimum allowed zoom level.
     *
     * @returns The minimum zoom level
     */
    getMinZoom: () => number;
    /**
     * Increases the zoom level by one step.
     */
    zoomIn: () => void;
    /**
     * Decreases the zoom level by one step.
     */
    zoomOut: () => void;
    /**
     * Adjusts the zoom level to fit the entire venue in the viewport.
     */
    zoomToFit: () => void;
    /**
     * Sets external price information for seats.
     *
     * @param seatsPrices - Optional external price information for seats
     */
    setExternalPrices: (seatsPrices?: ISeatPriceScheme[]) => void;
    /**
     * Destroys the renderer instance, cleaning up all resources.
     */
    destroy: () => void;
    /**
     * Gets the renderer version.
     *
     * @returns The version string
     */
    getVersion: () => string;
    /**
     * Disables SVG sections by their IDs.
     *
     * @param sectionIds - The IDs of the sections to disable
     * @param options - Optional configuration
     * @param options.resetAll - Whether to reset all sections before disabling
     */
    disableSvgSectionsByIds: (sectionIds: number[], options?: {
        resetAll?: boolean;
    }) => void;
    /**
     * Enables SVG sections by their IDs.
     *
     * @param sectionIds - The IDs of the sections to enable
     */
    enableSvgSectionsByIds: (sectionIds: number[]) => void;
    /**
     * Disables SVG sections by their names.
     *
     * @param sectionNames - The names of the sections to disable
     * @param options - Optional configuration
     * @param options.resetAll - Whether to reset all sections before disabling
     */
    disableSvgSectionsByNames: (sectionNames: string[], options?: {
        resetAll?: boolean;
    }) => void;
    /**
     * Enables SVG sections by their names.
     *
     * @param sectionNames - The names of the sections to enable
     */
    enableSvgSectionsByNames: (sectionNames: string[]) => void;
    /**
     * Gets SVG sections by the current selection.
     *
     * @returns The selected SVG sections
     */
    getSvgSectionBySelection: () => ISectorDTO[];
    /**
     * Sets whether all section outlines should be highlighted.
     *
     * @param highlight - If true, all section outlines will be highlighted with a border
     */
    setHighlightAllOutlines: (highlight: boolean) => void;
    /**
     * Gets whether all section outlines are currently highlighted.
     *
     * @returns True if all outlines are highlighted, false otherwise
     */
    getHighlightAllOutlines: () => boolean;
    /**
     * Shows the minimap.
     */
    showMinimap?: () => void;
    /**
     * Hides the minimap.
     */
    hideMinimap?: () => void;
    /**
     * Toggles the minimap visibility.
     */
    toggleMinimap?: () => void;
    /**
     * Sets the minimap position.
     *
     * @param position - The position to set ('top-left', 'top-right', 'bottom-left', 'bottom-right')
     */
    setMinimapPosition?: (position: 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right') => void;
    addMarker: (marker: IMarker) => void;
    removeMarker: (markerId: string) => void;
    clearMarkers: () => void;
    getMarkers: () => IMarker[];
    getResolvedMarkers: () => IResolvedMarker[];
    /**
     * Runs a sequence of composite animations. Each step can include zoom, pan (via destination), and rotation.
     */
    animateSequence: (steps: IRendererSequenceStep[]) => Promise<void>;
    /**
     * Convenience method to zoom with optional destination center point.
     * If destination is provided, it focuses the view so that destination becomes the viewport center.
     */
    zoomTo: (newScale: number, options?: {
        destination?: IPoint;
        durationMs?: number;
    }) => void;
}
/**
 * @hidden
 */
interface IRendererAnimation {
    /**
     * Optional animation type hint to allow branching behavior in the renderer
     * - "transform": default zoom/pan animations using scale/translate
     * - "pan": dedicated pan animation using translate only
     * - "rotation": continuous 3D rotation animation
     */
    type?: 'transform' | 'pan' | 'rotation';
    startTime?: number;
    duration: number;
    fromScale: number;
    toScale: number;
    fromTranslate?: IPoint;
    translate?: IPoint;
    toTranslate: IPoint;
    relativeTranslate?: IPoint;
    frame: number;
    inProgress: boolean;
    /**
     * Custom per-frame handler used for non-transform animations (e.g., rotation)
     * Receives high-resolution time and elapsed milliseconds since start
     */
    onFrame?: (now: number, elapsedMs: number) => void;
    /**
     * When true, the animation never auto-finishes and must be explicitly stopped
     */
    isContinuous?: boolean;
    /**
     * Rotation-specific fields used when type === 'rotation'
     */
    angle?: number;
    lastRotationZ?: number;
    /**
     * 3D transform interpolation fields for combined animations
     */
    fromRotationZ?: number;
    toRotationZ?: number;
    fromTiltX?: number;
    toTiltX?: number;
    fromPerspectiveZ?: number;
    toPerspectiveZ?: number;
    /** Called once when the animation finishes */
    onComplete?: () => void;
}
interface IRendererSequenceStep {
    zoomTo?: number;
    destination?: IPoint;
    rotateTo?: number;
    tiltTo?: number;
    perspectiveTo?: number;
    durationMs?: number;
}

type DataManagerEvent = 'sectionsChanged' | 'seatsChanged' | 'dataInvalidated' | 'dataLoaded';
type DataManagerEventCallback = (entityId?: number) => void;
/**
 * Data Manager - Read-only access to cached entity metadata
 * Aggregates data from various renderer layers without DOM access
 */
declare class DataManager {
    private context;
    private outlineLayer;
    private sectionMetadataCache;
    private seatMetadataCache;
    private dirtySections;
    private dirtySeats;
    private allSectionsDirty;
    private allSeatsDirty;
    private eventCallbacks;
    constructor(context: Context);
    setOutlineLayer(outlineLayer: OutlineLayer): void;
    on(event: DataManagerEvent, callback: DataManagerEventCallback): void;
    off(event: DataManagerEvent, callback: DataManagerEventCallback): void;
    private emit;
    getSectionMetadata(sectionId: number): ISectionMetadata | null;
    getAllSectionMetadata(): ISectionMetadata[];
    getSectionOutlineElements(sectionId: number): Element[];
    private rebuildSection;
    private rebuildAllSections;
    getSeatMetadata(seatId: number): ISeatMetadata | null;
    getAllSeatMetadata(sectionId?: number): ISeatMetadata[];
    private rebuildSeat;
    private rebuildAllSeats;
    invalidateSection(sectionId: number): void;
    invalidateSections(): void;
    invalidateSeat(seatId: number): void;
    invalidateSeats(): void;
    invalidateAll(): void;
    notifyDataLoaded(): void;
    refresh(): void;
    destroy(): void;
}

type StateManagerEvent = 'sectionStateChanged' | 'seatStateChanged';
type StateManagerEventCallback = (entityId: number) => void;
/**
 * State Manager - Handles mutations of visual/interaction states
 * Manages state changes and emits events
 */
declare class StateManager {
    private outlineLayer;
    private eventCallbacks;
    constructor();
    setOutlineLayer(outlineLayer: OutlineLayer): void;
    notifySectionStateChanged(sectionId: number): void;
    on(event: StateManagerEvent, callback: StateManagerEventCallback): void;
    off(event: StateManagerEvent, callback: StateManagerEventCallback): void;
    private emit;
    updateSectionState(sectionId: number, states: Partial<IEntityStates>): void;
    toggleSectionState(sectionId: number, stateType: keyof IEntityStates): boolean;
    getSectionStates(sectionId: number): IEntityStates | null;
    clearSectionStates(sectionId: number): void;
    clearAllHighlights(): void;
    destroy(): void;
}

/**
 * Base Renderer class that implements the IRenderer interface.
 * Provides core functionality for rendering and interacting with a venue map.
 */
declare class Renderer implements IRenderer {
    private inputHandler;
    private eventDispatcher;
    private visibilityManager;
    private height;
    private width;
    private padding;
    protected readonly context: Context;
    protected stageLayer: IStageLayer;
    private selectionLayer;
    protected outlineLayer: OutlineLayer;
    private outlineLayerForMarkers?;
    private minimapLayer?;
    private loaderLayer?;
    private markerLayer;
    private markerManager;
    private markerUnsubscribe?;
    private dataManager;
    private stateManager;
    private service;
    private zoomToFitScale;
    protected isRunning: boolean;
    private disableZoomToEmptySpace;
    private switchToWebGL;
    private viewportSettleTimer;
    private transformAnimator;
    private threeDController;
    private viewportController;
    private seatOps;
    private sectionHelper;
    private refreshMinimap;
    private setMinimapFromSnapshot;
    /**
     * Show the minimap and capture a snapshot of the current render.
     * Called once background + seats + prices are all ready.
     */
    protected revealMinimap(): Promise<void>;
    /**
     * Creates a new instance of the Renderer.
     *
     * @param element - The DOM element where the renderer will be mounted
     * @param machine - The state machine that controls the renderer behavior
     * @param settings - Configuration settings for the renderer
     */
    constructor(element: HTMLElement, machine: RendererMachine, settings: IRendererSettings);
    /**
     * Destroys the renderer instance, cleaning up all resources.
     * This includes removing event listeners, canceling animations, and destroying canvas layers.
     */
    destroy(): void;
    private syncMarkers;
    /** Push section label info to the WebGL stage layer (no-op in Canvas2D mode). */
    private updateSectionLabelData;
    /**
     * Gets the width of the renderer.
     *
     * @returns The width in pixels
     */
    getWidth(): number;
    /**
     * Gets the height of the renderer.
     *
     * @returns The height in pixels
     */
    getHeight(): number;
    /**
     * Gets the renderer version.
     *
     * @returns The version string
     */
    getVersion(): string;
    /**
     * Get the data manager for read-only access to entity metadata
     * Use this to query section/seat data without DOM access
     *
     * @example
     * ```typescript
     * // Get all sections (after data is loaded)
     * const sections = renderer.getDataManager().getAllSectionMetadata();
     *
     * // Wait for data to be loaded
     * renderer.getDataManager().on('dataLoaded', () => {
     *   const sections = renderer.getDataManager().getAllSectionMetadata();
     *   console.log('Data loaded:', sections);
     * });
     *
     * // Subscribe to data changes
     * renderer.getDataManager().on('sectionsChanged', () => {
     *   console.log('Sections data updated');
     * });
     * ```
     */
    getDataManager(): DataManager;
    /**
     * Get the state manager for manipulating visual states
     * Use this to change highlight/selection/availability states
     *
     * @example
     * ```typescript
     * // Toggle section highlight
     * renderer.getStateManager().toggleSectionState(sectionId, 'highlighted');
     *
     * // Subscribe to state changes
     * renderer.getStateManager().on('sectionStateChanged', (sectionId) => {
     *   console.log('Section state changed:', sectionId);
     * });
     * ```
     */
    getStateManager(): StateManager;
    protected showLoader(): void;
    protected updateLoaderProgress(phase: LoadingPhase, phaseProgress?: number): void;
    protected completeLoader(): void;
    protected showLoaderError(title: string, subtitle?: string): void;
    /**
     * Sets the interaction mode for the renderer.
     *
     * @param mode - The mode to set
     * @returns Whether the mode was set successfully
     */
    setMode(mode: string): boolean;
    getMode(): string | undefined;
    setHeight(height: number): void;
    setGroupSize(groupSize: number): void;
    getSeatIds(seats: ISeat[] | number[] | string[]): number[];
    getMarkedSeatsIds(): number[];
    setSeatsCategory(seats: ISeat[] | number[] | string[], category: number, color?: string): void;
    setGaCategory(sectionId: number, category: number | undefined): void;
    resetCategories(): void;
    getCategoryColor(category: number): string | undefined;
    private changeMachineContext;
    private setContextScale;
    /**
     * Retrieves the available prices.
     *
     * @example
     *
     * Example of return value:
     *
     * ```js
     * [
     *   { id: 63, name: '100', color: '#9C27B0' },
     *   { id: 64, name: '200', color: '#2196F3' }
     * ];
     * ```
     *
     * @returns Array of available prices
     */
    getPrices(): IColoredPrice[];
    /**
     * Initializes the internal cart state.
     *
     * @remarks
     *
     * In a case of page reload you should initialize
     * the saved state with this method.
     *
     * Cart initialization is available right after
     * component initialization.
     *
     * Sales page must save the cart state in the given format
     * to support the page reload feature.
     *
     * @example
     *
     * ```js
     * var cart = {
     *   seats: [
     *     {
     *       id: 1389563,
     *       key: 'Section 1;;5;;14',
     *       price: 100
     *     },
     *     { key: 'Table 3;;1;;1', price: 500 },
     *     { key: 'Section 2;;5;;1', price: 200 }
     *   ],
     *   ga: [
     *     {
     *       id: 100500,
     *       key: 'Table 2',
     *       price: 200,
     *       count: 1
     *     },
     *     { key: 'Section 5', price: 100, count: 2 }
     *   ]
     * };
     *
     * renderer.initCart(cart);
     * ```
     *
     * @param cart Cart state
     */
    initCart(cart: ICart): void;
    /**
     * Clears the internal cart state.
     */
    clearCart(): void;
    /**
     * Retrieves the internal cart state.
     *
     * @remarks
     *
     * Seatmap.pro doesn't support any session mechanisms.
     * Cart is always should be stored on the ticketing system side.
     * For the state management reasons, the Renderer has internal
     * selected seat representation.
     *
     * @example
     *
     * Example of cart object:
     *
     * ```js
     * var cart = {
     *   seats: [
     *     { id: 1389563, key: 'Section 1;;5;;14', price: 100 },
     *     { key: 'Table 3;;1;;1', price: 500 },
     *     { key: 'Section 2;;5;;1', price: 200 }
     *   ],
     *   ga: [
     *     {
     *       id: 100500,
     *       key: 'Table 2',
     *       price: 200,
     *       count: 1
     *     },
     *     { key: 'Section 5', price: 100, count: 2 }
     *   ]
     * };
     * ```
     *
     * @returns Returns selected seats and GA ticket count
     */
    getCart(): ICart;
    addMarker(marker: IMarker): void;
    removeMarker(markerId: string): void;
    clearMarkers(): void;
    getMarkers(): IMarker[];
    getResolvedMarkers(): IResolvedMarker[];
    private addHandlers;
    private initializeResizeObserver;
    protected setSchemaData(schema: ISchemaDTO): Promise<void>;
    /**
     * Sets external prices to seats
     *
     * * @remarks
     *
     * In case you need to use prices from external resources
     * you should execute this method.
     * External prices can be passed as an argument or as
     * a `seatsPrices` property within the settings.
     */
    setExternalPrices(seatsPrices?: ISeatPriceScheme[]): void;
    protected setPricesData(priceList: IPriceListDTO): void;
    /**
     * Adds GA seats to cart programmatically.
     *
     * @remarks
     *
     * This method can be used when `onSectorClick` was fired
     * and developer wants to handle custom add GA seats control.
     * You can add desired quantity of GA tickets to the cart.
     *
     * @example
     *
     * ```js
     * renderer.addGaToCart({
     *   sectorId: 100500,
     *   key: 'Table 2',
     *   price: 200,
     *   // quantity of GA tickets
     *   count: 3
     * });
     * ```
     *
     * @param ga GA cart item
     */
    addGaToCart(ga: ICartGa): void;
    /**
     * Removes GA seats from cart programmatically.
     *
     * @remarks
     *
     * This method can be used when `onSectorClick` was fired
     * and developer wants to handle custom remove GA seats control.
     * You can remove GA from cart.
     *
     * @example
     *
     * ```js
     * renderer.removeGaFromCart({
     *   sectorId: 100500,
     *   price: 200
     * });
     * ```
     *
     * @param removedGa removed GA cart item
     */
    removeGaFromCart(removedGa: IRemovedCartGa): void;
    /**
     * Adds seats to cart programmatically.
     *
     * @remarks
     *
     * This method is optional.
     * In a common scenario the user adds available seats
     * by clicking on them.
     *
     * @example
     *
     * ```js
     * renderer.addSeatsToCart([
     *   {
     *     id: 803,
     *     key: 'Section 3;;3;;1',
     *     price: 500
     *   }
     * ]);
     * ```
     *
     * @param seats Array of seats to add
     */
    addSeatsToCart(seats: ICartSeat[]): void;
    /**
     * Removes seats from internal cart.
     *
     * @param ids Array of internal seat IDs
     */
    removeSeatsFromCartByIds(ids: number[]): void;
    /**
     * Removes seats from internal cart.
     *
     * @param keys Array of composite seat keys
     */
    removeSeatsFromCartByKeys(keys: string[]): void;
    disableSeatsByIds(ids: number[], options?: {
        resetAll?: boolean;
    }): void;
    enableSeatsByIds(ids: number[]): void;
    disableSeatsByKeys(keys: string[]): void;
    filterSeatsByIds(ids: number[]): void;
    filterSeatsByKeys(keys: string[]): void;
    removeFilter(ids?: number[]): void;
    seatKeysToIds(keys: string[]): number[];
    updateSeatLocks(filter: SeatFilter): void;
    getSeatSelection(): IExtendedSeat[];
    setSectionSelection(sections?: number[] | string[]): void;
    getSvgSectionBySelection(): IBaseSector[];
    /** @deprecated Use {@link disableSections} instead. */
    disableSvgSectionsByIds(ids: number[], options?: {
        resetAll?: boolean;
    }): void;
    /** @deprecated Use {@link enableSections} instead. */
    enableSvgSectionsByIds(ids: number[]): void;
    /** @deprecated Use {@link disableSectionsByNames} instead. */
    disableSvgSectionsByNames(names: string[], options?: {
        resetAll?: boolean;
    }): void;
    /** @deprecated Use {@link enableSectionsByNames} instead. */
    enableSvgSectionsByNames(names: string[]): void;
    disableSectionsByIds(ids: number[]): void;
    enableSectionsByIds(): void;
    /** @deprecated Use {@link filterSections} instead. */
    filterSvgSectionsByIds(ids: number[], options?: {
        resetAll?: boolean;
    }): void;
    /** @deprecated Use {@link removeFilterSections} instead. */
    removeFilterSvgSectionsByIds(ids?: number[]): void;
    /** Disable sections by IDs, hiding them from interaction. Source-agnostic: works with any outline type. */
    disableSections(ids: number[], options?: {
        resetAll?: boolean;
    }): void;
    /** Enable sections by IDs, making them interactive again. Source-agnostic: works with any outline type. */
    enableSections(ids: number[]): void;
    /** Filter sections by IDs, showing only the specified sections. Source-agnostic: works with any outline type. */
    filterSections(ids: number[], options?: {
        resetAll?: boolean;
    }): void;
    /** Remove section filter, restoring all sections to visible. Source-agnostic: works with any outline type. */
    removeFilterSections(ids?: number[]): void;
    /** Disable sections by name. Source-agnostic: works with any outline type. */
    disableSectionsByNames(names: string[], options?: {
        resetAll?: boolean;
    }): void;
    /** Enable sections by name. Source-agnostic: works with any outline type. */
    enableSectionsByNames(names: string[]): void;
    setSeatSelection(seats: number[] | string[] | ISeat[]): void;
    setSelectedGa(ga?: number | string): void;
    getSelectedGa(): ISector | undefined;
    getSections(): IBaseSector[];
    getSectionsKeys(): (string | number)[];
    getRows(): IRowDTO[];
    getSeats(): ISeatDTO[];
    getRowById(id: number): IRowDTO | undefined;
    getVisibleSeats(): ISeat[];
    getSectionsWithCoords(): ISectionWithCoords[];
    private getGaSectionByOutline;
    private getSectionByOutline;
    private buildSectionFromId;
    private updateSize;
    getZoom(): number;
    zoomIn(): void;
    zoomOut(): void;
    zoomTo(newScaleCss: number, options?: {
        destination?: IPoint;
        durationMs?: number;
    }): void;
    zoomToFit(): void;
    clearSectorHighlight(): void;
    highlightSector(id: number | undefined): void;
    zoomToSection(section: string | number, options?: {
        focus?: boolean;
        mode?: 'fit' | 'scale';
        scale?: number;
    }): void;
    zoomToDestination(newScale: number, destination: IPoint, duration?: number): void;
    animateSequence(steps: IRendererSequenceStep[]): Promise<void>;
    getMinZoom(): number;
    getMaxZoom(): number;
    /** Debounced notification to stageLayer that viewport has settled (SEAT-831 detail crop) */
    private scheduleViewportSettle;
    private redraw;
    private startAnimation;
    private doTranslate;
    private cachedDraw;
    private getNextScale;
    private calculateAbsoluteScaledTranslate;
    private calculateRelativeScaledTranslate;
    private getInitialScaleAndTranslate;
    seatToExtendedSeat: (seat: ISeat) => IExtendedSeat;
    viewSection(section: ISection): void;
    private getStageLayer;
    update3DView(options: {
        rotationZ?: number;
        perspectiveZ?: number;
        tiltX?: number;
    }): void;
    get3DViewParams(): {
        enable3DView: boolean;
        rotationZ: number;
        perspectiveZ: number;
        tiltX: number;
    };
    animateTo3DParams(target: {
        rotationZ?: number;
        perspectiveZ?: number;
        tiltX?: number;
    }, durationMs?: number): Promise<void>;
    animateRotation(angle: number): number | null;
    stopRotationAnimation(): void;
    isRotationAnimationRunning(): boolean;
    getRotationAnimationId(): number | null;
    /**
     * Sets whether all section outlines should be highlighted.
     *
     * @param highlight - If true, all section outlines will be highlighted with a border
     */
    setHighlightAllOutlines(highlight: boolean): void;
    /**
     * Gets whether all section outlines are currently highlighted.
     *
     * @returns True if all outlines are highlighted, false otherwise
     */
    getHighlightAllOutlines(): boolean;
    /**
     * Shows the minimap.
     */
    showMinimap(): void;
    /**
     * Hides the minimap.
     */
    hideMinimap(): void;
    /**
     * Toggles the minimap visibility.
     */
    toggleMinimap(): void;
    /**
     * Enables or disables cart pins on the minimap at runtime.
     */
    setMinimapPinsEnabled(enabled: boolean): void;
    /**
     * Sets the minimap position.
     *
     * @param position - The position to set ('top-left', 'top-right', 'bottom-left', 'bottom-right')
     */
    setMinimapPosition(position: 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right'): void;
}

interface IAdminRendererSettings extends IRendererSettings {
    /**
     * Custom API base URL that overrides the environment-based URL.
     */
    baseUrl?: string;
    /**
     * Public API key for authentication.
     */
    publicKey?: string;
    /**
     * Environment setting that determines which API endpoint to use.
     * Can be 'local', 'stage', or 'production' (default).
     */
    env?: string;
}
/**
 * Admin Renderer class for seatmap administration.
 * Extends the base Renderer with admin-specific functionality.
 */
declare class SeatmapAdminRenderer extends Renderer {
    static readonly VERSION: string;
    protected apiClient: BookingApiClient;
    /**
     * Creates a new instance of the AdminRenderer.
     *
     * Initializes the renderer by setting up the base configuration and API client.
     * The API endpoint URL is determined based on the environment setting.
     *
     * @param element - The HTML element where the renderer will be mounted
     * @param settings - Optional configuration settings for the renderer
     * @param settings.env - Environment setting ('local', 'stage', or 'production'(default))
     *   that determines which API endpoint to use
     * @param settings.baseUrl - Optional custom API base URL that overrides the environment-based URL
     * @param settings.publicKey - Required API public key for authentication
     *
     * @throws {Error} Throws an error if the public key is undefined
     *
     * @example
     * ```typescript
     * // Create with default production settings
     * const renderer = new AdminRenderer(document.getElementById('container'), {
     *   publicKey: 'your-public-key'
     * });
     *
     * // Create with staging environment
     * const stageRenderer = new AdminRenderer(document.getElementById('container'), {
     *   env: 'stage',
     *   publicKey: 'your-stage-key'
     * });
     *
     * // Create with custom base URL
     * const customRenderer = new AdminRenderer(document.getElementById('container'), {
     *   baseUrl: 'https://your-custom-api.example.com/v1/',
     *   publicKey: 'your-public-key'
     * });
     * ```
     */
    constructor(element: HTMLElement, settings?: IAdminRendererSettings);
    /**
     * Sets the interaction mode for the component and updates visibility of the outline layer.
     *
     * @param mode - The interaction mode to set:
     *   - 'pan': Pan/zoom navigation, outline layer hidden
     *   - 'select': Seat selection (click/drag), GA section click supported
     *   - 'selectRows': Row-based seat selection
     *   - 'selectSections': Section-level click (fires onSectionClick for all section types)
     *
     * When set to 'pan', the outline layer is hidden. For any other mode, the outline layer is shown.
     *
     * @returns A boolean indicating whether the mode change was successful.
     * Returns true if the outline layer exists and the mode was set.
     * Returns false if the outline layer doesn't exist.
     *
     * @example
     * ```typescript
     * // Set mode to 'pan' - will hide outline layer
     * component.setMode('pan');
     *
     * // Set mode to 'select' - will show outline layer, seat-level interactions
     * component.setMode('select');
     *
     * // Set mode to 'selectSections' - section clicks fire onSectionClick for all sections
     * component.setMode('selectSections');
     * ```
     */
    setMode(mode: string): boolean;
    /**
     * Loads event's schema
     *
     * @example
     * ```js
     * var eventId = 'a4a75361-7823-4847-bf22-336843022e80';
     * renderer.loadEvent(eventId).then(function() {
     *   renderer.initCart(cart);
     * });
     *
     * // Or with the onSchemaDataLoaded event
     * var renderer = new SeatmapAdminRenderer(element, {
     *   publicKey: 'your-public-key',
     *   onSchemaDataLoaded: function() {
     *     console.log('Schema data loaded successfully');
     *     // Perform actions after schema is fully loaded
     *   }
     * });
     * renderer.loadEvent(eventId);
     * ```
     *
     * @param eventId - Event ID
     * @returns A promise that resolves when the data fetching is completed
     */
    loadEvent(eventId: string): Promise<void>;
    /**
     * Loads schema by id
     *
     * @example
     * ```js
     * var schemaId = 100500;
     * renderer.loadSchema(schemaId).then(function() { ... });
     *
     * // Or with the onSchemaDataLoaded event
     * var renderer = new SeatmapAdminRenderer(element, {
     *   publicKey: 'your-public-key',
     *   onSchemaDataLoaded: function() {
     *     console.log('Schema data loaded successfully');
     *     // Perform actions after schema is fully loaded
     *   }
     * });
     * renderer.loadSchema(schemaId);
     * ```
     *
     * @param schemaId - Schema ID
     * @returns A promise that resolves when the data fetching is completed
     */
    loadSchema(schemaId: number): Promise<void>;
}

interface IBookingRendererSettings extends IRendererSettings {
    /**
     * Custom API base URL that overrides the environment-based URL.
     *
     */
    baseUrl?: string;
    /**
     * Public API key for authentication.
     */
    publicKey?: string;
    /**
     * Environment setting that determines which API endpoint to use.
     * Can be 'local', 'stage', or 'production' (default).
     */
    env?: 'local' | 'stage' | 'production';
    /**
     * If set to `true`, zoom is disabled when clicking into empty space.
     *
     * @defaultValue `false`
     */
    disableZoomToEmptySpace?: boolean;
    /**
     * If set to true, renderer will switch to WebGL.
     *
     * @defaultValue `false`
     */
    switchToWebGL?: boolean;
    /**
     * If set to true, renderer will be in debug mode.
     *
     * @defaultValue `false`
     * @hidden
     */
    debug?: boolean;
}
/**
 * Booking Renderer class for seatmap booking.
 * Extends the base Renderer with booking-specific functionality.
 */
declare class SeatmapBookingRenderer extends Renderer {
    static readonly VERSION: string;
    private apiClient;
    private stats;
    private tags?;
    private lastSentViewBox?;
    private debugOverlay?;
    /**
     * Creates a new instance of the SeatmapBookingRenderer.
     *
     * Initializes the renderer by setting up the base configuration, API client, and analytics.
     * The API endpoint URL is determined based on the environment setting.
     *
     * @param element - DOM element that will be a host element for the Renderer
     * @param settings - Optional configuration settings for the renderer
     * @param settings.env - Environment setting ('local', 'stage', or 'production'(default))
     *   that determines which API endpoint to use
     * @param settings.baseUrl - Optional custom API base URL that overrides the environment-based URL
     * @param settings.publicKey - Required API public key for authentication
     * @param tags - Optional tags for analytics tracking
     *
     * @throws {Error} Throws an error if the public key is undefined
     */
    constructor(element: HTMLElement, settings?: IBookingRendererSettings, tags?: Record<string, string | number | boolean>);
    /**
     * Gets the current view box properties.
     *
     * @returns The current view box with width, height, scale, and translation information
     * @private
     */
    private getViewBox;
    private hasViewBoxChanged;
    /**
     * Loads event's schema and prices.
     *
     * Fetches the schema, prices, and row SVG data for the specified event.
     * Uses progressive loading: renders schema immediately with disabled interactions,
     * then enables interactions when prices arrive.
     *
     * @example
     * ```js
     * var eventId = 'a4a75361-7823-4847-bf22-336843022e80';
     * renderer.loadEvent(eventId).then(function() {
     *   renderer.initCart(cart);
     * });
     *
     * // Or with the onSchemaDataLoaded event
     * var renderer = new SeatmapBookingRenderer(element, {
     *   publicKey: 'your-public-key',
     *   onSchemaDataLoaded: function() {
     *     console.log('Schema data loaded successfully');
     *     renderer.initCart(cart);
     *   }
     * });
     * renderer.loadEvent(eventId);
     * ```
     *
     * @param eventId - Event GUID to load
     * @param sectorId - Optional sector ID to show only a specific sector
     * @returns A promise that resolves when the schema is loaded and rendered
     */
    loadEvent(eventId: string, sectorId?: number): Promise<void>;
    /** @hidden */
    static getErrorMessage(error: ApiError, errorTexts?: ILoaderSettings['errorTexts']): {
        title: string;
        subtitle: string;
    };
    private handlePricesLoaded;
    private logGpuDebugInfo;
    private setupEventHandlers;
    /**
     * Creates a statistics data object for seat selection/deselection events.
     *
     * @param seat - The seat that was selected or deselected
     * @param isSuccess - Whether the selection/deselection was successful
     * @returns Statistics data for the seat event
     * @private
     */
    private createStatsSeatRequest;
    /**
     * Filters the schema and prices to only include data for a specific sector.
     *
     * @param sectorId - The ID of the sector to keep
     * @param schema - The complete schema data
     * @param prices - The complete price list data
     * @returns A tuple containing the filtered schema and prices
     * @private
     */
    private leaveSectionOnly;
}

/**
 * Package version information
 * This file is automatically updated during the build process
 */
declare const VERSION: string;

declare const defaultZoomSettings: IZoomSettings;
declare const mergeSettings: (defaults: IRendererSettings, settings?: Partial<IRendererSettings>) => IRendererSettings & Partial<IRendererSettings>;

/**
 * Rotation Animation Manager
 * Handles continuous rotation animations for 3D view
 */
interface IRotationAnimation {
    startTime: number;
    animationId: number | null;
    lastRotationZ: number;
    angle: number;
    isRunning: boolean;
}
declare class RotationAnimation {
    private animation;
    /**
     * Starts a continuous rotation animation
     * @param angle - Rotation speed in radians per second (positive for clockwise, negative for counter-clockwise)
     * @param onUpdate - Callback function to update the rotation value
     * @returns Animation ID that can be used to stop the animation
     */
    start(angle: number, onUpdate: (rotationZ: number) => void): number | null;
    /**
     * Stops the current rotation animation
     */
    stop(): void;
    /**
     * Checks if an animation is currently running
     */
    isRunning(): boolean;
    /**
     * Gets the current animation ID
     */
    getAnimationId(): number | null;
    /**
     * Gets the current animation state
     */
    getAnimation(): IRotationAnimation | null;
}

export { ApiError, BookingApiClient, type ById, type ColorById, type ColorSequenceSettings, DataManager, type DataManagerEvent, type DataManagerEventCallback, type DeepPartial, type DestEvent, DestEventType, type IAdminRendererSettings, type IBackgroundImageLoadedEvent, type IBaseSeat, type IBaseSector, type IBasicSeatStyle, type IBeforeSeatDrawEvent, type IBookingRendererSettings, type ICart, type ICartGa, type ICartSeat, type IClickSrcEvent, type IColoredPrice, type IConfigurationDTO, type IDeselectDestEvent, type IDragEndSrcEvent, type IDragMoveSrcEvent, type IDragStartSrcEvent, type IEntityStates, type IErrorMessage, type IExtendedSeat, type ILabelStyle, type ILoadProgressEvent, type ILoaderSettings, type ILoaderTheme, type IMarker, type IMarkerSettings, type IMinimapSettings, type IMouseMoveSrcEvent, type IPanDestEvent, type IPanZoomDestEvent, type IPlainSeatsDTO, type IPngBackgroundDTO, type IPoint, type IPrice, type IPriceDTO, type IPriceId, type IPriceListDTO, type IRectSelectDestEvent, type IRemovedCartGa, type IRenderer, type IRendererAnimation, type IRendererMachineContext, type IRendererSeatStyleSettings, type IRendererSettings, type IRendererSvgSectionStylesSetting, type IRendererTheme, type IResolvedMarker, type IRowDTO, type ISVGBackgroundDTO, type ISchemaDTO, type ISeat, type ISeatCartSwitchDestEvent, type ISeatDTO, type ISeatMetadata, type ISeatMouseEnterDestEvent, type ISeatMouseLeaveDestEvent, type ISeatPriceScheme, type ISeatSelectDestEvent, type ISeatStyle, type ISection, type ISectionClickDestEvent, type ISectionMetadata, type ISectionMouseEnterDestEvent, type ISectionMouseLeaveDestEvent, type ISectionRect, type ISectionWithCoords, type ISector, type ISectorDTO, type IShapeMetadata, type ISpecialPrice, type ISpecialState, type ISvgSectionStyle, type IVenueDTO, type IVisibilitySettings, type IZoomSettings, type InteractionZoomStrategy, type InteractionZoomStrategyType, type LoaderStyle, type LoadingPhase, type MarkerAppearance, type MarkerTarget, type MinimapPosition, type Nullable, Renderer, type RendererMachine, type RendererMachineReducer, type RendererMachineService, RendererSelectMode, RendererTargetType, type RequestMetrics, RotationAnimation, type SeatFilter, type SeatInteractionState, SeatmapAdminRenderer, SeatmapBookingRenderer, type SrcEvent, SrcEventType, StateManager, type StateManagerEvent, type StateManagerEventCallback, type TransformArray, VERSION, convertPricesToColored, convertPricesToColoredById, defaultZoomSettings, mergeSettings, sortPrices };
