import type { ReactNode } from 'react';
import type { FilterState } from './stores/filter-store/types';
import type { SelectionZone } from './types/SelectionZone';
import type { UserWithGroups } from './utils/checkIsUserAdmin';
export type PickerSegment = 'drilling' | 'intervention';
/**
 * NOTE: onChange is called with an extended version of OffsetSettings
 * Here only used properties are listed
 */
export type OffsetSettingsInput = {
    filterExpanded?: boolean;
    mapHidden?: boolean;
    filters?: FilterState;
    wellSection?: string;
    selectedWellIds: number[];
    isSynced?: boolean;
    metricsKeys?: string[];
    lastSelectionZone?: SelectionZone;
    isLoadAllWells?: boolean;
    /** Last-saved IDAS-classified wells (intersection of selectedWellIds with the IDAS bucket). */
    idasWellIds?: number[];
    /** Last-saved Offset Well Selection app wells (intersection of selectedWellIds with the OWS bucket). */
    owsWellIds?: number[];
    /** Last-saved Wellhub wells. */
    wellhubWellIds?: number[];
    /** Last-saved hand-picked wells (user added beyond any auto source). */
    handpickedWellIds?: number[];
    /** @deprecated Use handpickedWellIds. Retained for backwards compatibility with older consumers. */
    manualWellIds?: number[];
};
/**
 * An extended version of OffsetSettings provided to onSave callback.
 *
 * Source partition: when the picker emits `onSave`, `idasWellIds`, `owsWellIds`,
 * `wellhubWellIds`, and `handpickedWellIds` form a disjoint partition of
 * `selectedWellIds` (subject excluded). Precedence on overlap is
 * IDAS > OWS > Wellhub > hand-picked.
 */
export type OffsetSettingsOutput = OffsetSettingsInput & {
    subjectWellId?: number;
    /**
     * @deprecated Use `handpickedWellIds`. Retained as an alias of `handpickedWellIds`
     * for the duration of one release while in-tree consumers (BICOffsetPickerDialog,
     * useGlobalOffsetWellsSync) migrate.
     */
    manualWellIds?: number[];
    /** Wells the user added beyond any auto source. */
    handpickedWellIds?: number[];
    /** IDAS-classified wells (intersection of `selectedWellIds` with the IDAS bucket). */
    idasWellIds?: number[];
    /** Offset Well Selection app wells (intersection of `selectedWellIds` with the OWS bucket). */
    owsWellIds?: number[];
    /** Wellhub wells (intersection of `selectedWellIds` with the Wellhub bucket). */
    wellhubWellIds?: number[];
    companyId?: number;
    hintPopupClosed?: boolean;
};
/**
 * NOTE: The most of properties are optional except "id" and "name"
 */
export type OffsetWell = {
    id: number;
    name: string;
    rigId?: number | string;
    rigName?: string;
    formation?: string;
    stringDesign?: unknown;
    programName?: string;
    basin?: string;
    county?: string;
    area?: string;
    visibility?: string;
    topHole?: {
        coordinates: [number, number];
        raw: string;
    };
    rigReleaseDate?: number;
    totalDepth?: number;
    is_usable?: boolean;
    weight_to_weight_average?: number;
};
export type OffsetWellPickerFilterControl = {
    key: string;
    content: ReactNode;
};
export type OffsetWellPickerV5Props = {
    /** Controls modal visibility; while false, internal data fetching and effects are gated off. */
    open?: boolean;
    /** When true, disables all selection edits and renders a read-only indicator. */
    isViewOnly?: boolean;
    /**
     * Defines the operational segment context for the picker.
     * Controls which filters, table columns, and data enrichment are used.
     * Defaults to 'drilling'.
     */
    segment?: PickerSegment;
    /**
     * Selects the source collection for offset wells.
     * - `true`: Best-In-Class wells from `data.offset-wells.bic` (Offset Well Selection app).
     * - `false` / unset: hand-picked wells from `data.offset_wells` (Wellhub).
     * Consumers typically derive this from the `canViewSaveOffsetWells` permission.
     */
    isWDUser?: boolean;
    /** Subject well anchor. `asset_id` is the subject; `companyId` is used by company-scoped lookups. */
    defaultSubjectWell?: {
        asset_id: number;
        companyId: number;
    };
    /** Initial / persisted picker state (filters, selected well ids, sync flag, view toggles). */
    offsetSettings?: OffsetSettingsInput;
    /**
     * Acting user. `company_id` is the fallback when `defaultSubjectWell` is not provided.
     * `role` / `group` / `groups` are consumed by `useIsAdmin` when the picker is rendered
     * outside of `AppCommonsProvider`.
     */
    currentUser?: Partial<UserWithGroups>;
    /** Optional async mapper that enriches offset wells (e.g. with `is_usable`) before rendering. */
    addWellsUsabilityInfo?: (wells: OffsetWell[]) => PromiseLike<OffsetWell[]> | OffsetWell[];
    /**
     * Called when the selected offset wells change.
     * NOTE: also called during initial initialization when **syncAutoEnabled** set to true.
     * WARNING: also called when the "Cancel" button is clicked — invoked with the previous
     * `offsetSettings` plus current `mapHidden` / `filterExpanded`, and without `selectedWells`.
     * NOTE: `selectedWells` shape varies. The first invocation only contains the bare minimum
     * (`id`, `name`); do not rely on additional fields from it.
     */
    onSave: (offsetSettings: OffsetSettingsOutput, selectedWells?: OffsetWell[]) => void;
    /**
     * Called when the modal is closed by any means (button, backdrop, escape).
     * NOTE: called **before** `onSave`.
     */
    onClose: () => void;
    /** Hard ceiling on selectable offset wells (the picker enforces `min(maxOffsetSize, localMaxOffsetSize)`). Defaults to 50. */
    maxOffsetSize?: number;
    /** Per-consumer cap used by auto-sync when slicing BiC recommendations. Defaults to 50. */
    localMaxOffsetSize?: number;
    /**
     * When true, on first load auto-syncs the selected offsets from BiC recommendations and
     * immediately fires `onSave` with the result. Defaults to false.
     */
    syncAutoEnabled?: boolean;
    /**
     * When true (and `isWDUser` is true), parses `manual_wells` / `ta_scores` from the BiC record —
     * surfacing IDAS-contributed wells, the TA% column, and (for XTO companies) the
     * "Re-Sync with IDAS" button. Defaults to false.
     */
    isManualWellsEnabled?: boolean;
    /**
     * Enables global offset-well-selector mode: drops the per-app offset cap from the header stats
     * and forces the "load all wells" path. Defaults to false.
     */
    isGlobalMode?: boolean;
    /** When true, loads all wells up-front instead of fetching viewport-based map tiles. Defaults to false. */
    loadAllWellsByDefault?: boolean;
    /** App-owned controls rendered at the end of the filter panel, before "To Defaults". */
    additionalFilterControls?: OffsetWellPickerFilterControl[];
};
//# sourceMappingURL=OffsetWellPickerV5.types.d.ts.map