import type { BookingChangeModalCourt, BookingChangeModalCustomer, BookingChangeModalDraft, BookingChangeModalItem, BookingChangeModalSubmitPayload, BookingChangeModalSubmitResource } from './types';
export declare type UnknownRecord = Record<string, unknown>;
export interface NormalizedResourceNode {
    form_id: string | number;
    relation_type: string;
    relation_id: string | number;
    capacity: number;
    like_status: string;
    metadata: UnknownRecord;
    children: NormalizedResourceNode[];
}
export interface NormalizedCourt {
    id: string;
    name: string;
    form_id: string | number;
    relation_id: string | number;
    relation_type: string;
    resource_id: string | number;
    capacity: number;
    like_status: string;
    metadata: UnknownRecord;
    raw?: UnknownRecord;
}
export interface BookingOrderDetail {
    customer_name?: string;
    phone?: string;
    email?: string;
    bookings?: {
        list?: Array<{
            id?: string | number;
            schedule_id?: string | number;
        }>;
    };
    customer?: {
        display_name?: string;
        first_name?: string;
        last_name?: string;
        nickname?: string;
        phone?: string;
        email?: string;
        member_id?: string;
    };
    customer_with_extra?: {
        display_name?: string;
        first_name?: string;
        last_name?: string;
        nickname?: string;
        phone?: string;
        email?: string;
        member_id?: string;
    };
    contacts_info?: {
        first_name?: string;
        last_name?: string;
        email?: string;
        phone?: {
            phone?: string;
            country_calling_code?: string;
        };
    };
}
export declare function asRecord(value: unknown): UnknownRecord | undefined;
export declare function asRecordList(value: unknown): UnknownRecord[];
export declare function asString(value: unknown): string | undefined;
export declare function asNumber(value: unknown, fallback?: number): number;
export declare function defaultFormatHourLabel(hour: number): string;
export declare function getHourStep(hourSlots: number[]): number;
export declare function getFallbackHourSlots(): number[];
export declare function nearestHourInSlots(hour: number, slots: number[]): number;
export declare function alignBookingDraftToSlots(targetHour: number, durationHours: number, slots: number[]): number;
export declare function getNormalizedDateTime(dateKey: string, hour: number): {
    date: string;
    time: string;
};
export declare function getItemRaw(item: BookingChangeModalItem): UnknownRecord;
export declare function getOrderId(item: BookingChangeModalItem): string | number | null;
export declare function getItemResourceRecords(item: BookingChangeModalItem): NormalizedResourceNode[];
export declare function normalizeCourt(court: BookingChangeModalCourt): NormalizedCourt;
export declare function getScheduleResourceList(response: unknown): UnknownRecord[];
export declare function buildScheduleResourceCourt(resource: UnknownRecord, formName: string): BookingChangeModalCourt | null;
export declare function mergeCourts(lists: BookingChangeModalCourt[][]): BookingChangeModalCourt[];
/**
 * Build the resources array for submit from the authoritative event_resources list
 * (sourced from orderDetail) and the per-resource court selections made in the UI.
 * When a resource's selected court differs from its original relation_id the resource
 * is replaced via buildChangedResource; otherwise it is emitted as-is.
 */
export declare function buildSubmitResourcesFromEventResources(eventResources: UnknownRecord[], resourceCourtIds: string[], resourceCourtMap: Map<string, NormalizedCourt>): BookingChangeModalSubmitResource[];
export declare function buildSubmitPayload(args: {
    item: BookingChangeModalItem;
    draft: BookingChangeModalDraft;
    duration: number;
    nextEndHour: number;
    /** Authoritative resource list from orderDetail.bookings.list[n].event_resources */
    currentEventResources: UnknownRecord[];
    /** Per-resource selected courtIds, indexed to match currentEventResources */
    resourceCourtIds: string[];
    resourceCourtMap: Map<string, NormalizedCourt>;
    orderDetail?: BookingOrderDetail;
}): BookingChangeModalSubmitPayload;
export declare function buildCustomer(args: {
    orderDetail?: BookingOrderDetail;
    selectedCustomer: BookingChangeModalCustomer | null;
    fallbackCustomerText: string;
}): BookingChangeModalCustomer;
