/**
 * Panel setup: IframePanelComponent, CSS injection, and group actions.
 */
import type { PanelGroup, PanelManager, FloatingOverlay } from "./panel-manager.js";
/**
 * Params passed to an iframe panel.
 */
export interface IframePanelParams {
    url?: string;
    token?: string | undefined;
}
/**
 * Callback interface for the client to receive component lifecycle events.
 */
export interface IframePanelHost {
    onComponentCreated(panelId: string, component: IframePanelComponent): void;
    onComponentDisposed(panelId: string): void;
    getDarkMode(): boolean;
    getClassNames(): {
        iframe?: string;
    } | undefined;
}
/**
 * Manages an iframe inside a panel.
 */
export declare class IframePanelComponent {
    readonly element: HTMLElement;
    private iframe;
    private panelId;
    private host;
    private currentUrl;
    private currentToken;
    resizeCapable: boolean;
    constructor(host: IframePanelHost);
    get contentWindow(): Window | null;
    init(panelId: string, params: IframePanelParams): void;
    update(params: IframePanelParams): void;
    dispose(): void;
    /**
     * Send a postMessage to the iframe (origin-checked).
     */
    postMessage(message: unknown, targetOrigin: string): void;
    /**
     * Get the origin of the current iframe URL.
     */
    getOrigin(): string | null;
    /**
     * Show the iframe with fade-in effect.
     */
    show(): void;
    /**
     * Hide the iframe.
     */
    hide(): void;
    private createIframe;
    private setIframeSrc;
    /**
     * Replace the iframe element to force a fresh load (needed when only hash changes).
     */
    private replaceIframe;
}
export declare const SVG_POPOUT = "<svg viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M9.5 2h4.5v4.5\"/><path d=\"M14 2L8.5 7.5\"/><path d=\"M12 9v4.5a1.5 1.5 0 01-1.5 1.5h-8A1.5 1.5 0 011 13.5v-8A1.5 1.5 0 012.5 4H7\"/></svg>";
export declare const SVG_WINDOW = "<svg viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><rect x=\"1.5\" y=\"2.5\" width=\"13\" height=\"11\" rx=\"1.5\"/><line x1=\"1.5\" y1=\"6\" x2=\"14.5\" y2=\"6\"/><circle cx=\"4\" cy=\"4.25\" r=\"0.75\" fill=\"currentColor\" stroke=\"none\"/><circle cx=\"6.5\" cy=\"4.25\" r=\"0.75\" fill=\"currentColor\" stroke=\"none\"/></svg>";
/**
 * Manages minimized floating groups as tabs in an overlay bar.
 *
 * When a group is minimized its floating overlay is hidden and a tab
 * appears in the minimized-tabs bar. The bar is absolutely positioned
 * on the root element so it does NOT affect layout height (critical
 * for auto-resize mode where the iframe must get the full content height).
 */
export interface MinimizedEntry {
    tab: HTMLElement;
    overlay: FloatingOverlay | null;
    group: PanelGroup;
    mode: "floating" | "docked";
    /** Saved split position/size for docked groups to restore into. */
    savedPosition?: {
        direction: import("./panel-manager.js").DockPosition;
        siblingGroupId?: string;
        initialSize?: number | undefined;
    };
}
export declare class MinimizeManager {
    private tabsContainer;
    private panelManager;
    private entries;
    private _onBarVisibilityChanged;
    private _allowDocking;
    /** Set whether dock buttons should be shown on minimized floating tabs. */
    setAllowDocking(allow: boolean): void;
    /** Called when the minimized bar appears or disappears. */
    onBarVisibilityChanged(cb: () => void): void;
    /**
     * Wire the manager to the minimized-tabs container and the panel manager.
     */
    init(tabsContainer: HTMLElement, panelManager: PanelManager): void;
    /**
     * Minimize a floating group (hide its overlay, show tab in bar).
     */
    minimize(groupId: string, overlay: FloatingOverlay, group: PanelGroup): void;
    /**
     * Minimize a docked group — remove it from the split layout so the main
     * panel fills the space, then show a tab in the minimized bar at the top.
     */
    minimizeDocked(groupId: string, group: PanelGroup, panelManager: PanelManager): void;
    restore(groupId: string): void;
    /** Close all panels in a minimized group. */
    closeGroup(groupId: string): void;
    isMinimized(groupId: string): boolean;
    /** Return the IDs of all currently minimized groups. */
    getMinimizedGroupIds(): string[];
    /** Return the full minimized entry for a group (for serialization). */
    getEntry(groupId: string): MinimizedEntry | undefined;
    /** Clean up tab when a group is disposed. */
    removeGroup(groupId: string): void;
    dispose(): void;
    private showBar;
    private hideBarIfEmpty;
    /**
     * Merge all panels from sourceGroupId into targetGroupId.
     * The source group is then removed from the minimized bar.
     */
    private mergeMinimized;
    /** Dock a minimized group to the grid (regardless of original mode). */
    private dockMinimized;
    private createTab;
    private dragState;
    private onTabDragStart;
    private createDragGhost;
    private findDropTarget;
}
/**
 * Toolbar buttons for a floating overlay.
 * Produces a compact actions element: [minimize] [maximize] [dock] [close]
 * that gets injected into the owner group's header actions area.
 *
 * Created once per overlay, not per group.
 */
export declare class FloatingToolbar {
    readonly element: HTMLElement;
    private overlay;
    private panelManager;
    private minimizeManager;
    private isMaximized;
    private maxRestoreBtn;
    private minimizeBtn;
    private dockBtn;
    private _beforeClose;
    constructor(overlay: FloatingOverlay, panelManager: PanelManager, minimizeManager: MinimizeManager, constraints?: {
        allowDocking?: boolean;
        allowMinimize?: boolean;
        allowMaximize?: boolean;
    });
    /** Update the allowDocking constraint at runtime. */
    setAllowDocking(allow: boolean): void;
    /** Update the allowMinimize constraint at runtime. */
    setAllowMinimize(allow: boolean): void;
    /** Update the allowMaximize constraint at runtime. */
    setAllowMaximize(allow: boolean): void;
    /** Set a gate called before closing all panels. Return false to cancel. */
    setBeforeClose(cb: (() => boolean | Promise<boolean>) | null): void;
    /** Sync the toolbar's maximize/restore button with the overlay's actual state. */
    syncMaximizedState(): void;
    private createButton;
    private clearMaximize;
    private onMinimize;
    private onMaxRestore;
    private onDock;
    private onClose;
}
/**
 * Header actions for fork (non-main) groups.
 *
 * Button visibility per state:
 * - Floating:  ALL hidden (toolbar handles everything)
 * - Docked:    [float ↗] [minimize ─] [close ✕]
 */
export declare class ForkGroupActions {
    readonly element: HTMLElement;
    private group;
    private panelManager;
    private minimizeManager;
    private floatDockBtn;
    private maximizeBtn;
    private minimizeBtn;
    private closeBtn;
    private _isMaximized;
    private _autoMaximizedByResize;
    private _beforeClose;
    private _onMaximizeChanged;
    private _allowFloating;
    private _allowMinimize;
    private _allowMaximize;
    constructor(group: PanelGroup, minimizeManager: MinimizeManager, panelManager: PanelManager, onLocationChange?: () => void, constraints?: {
        allowFloating?: boolean;
        allowMinimize?: boolean;
        allowMaximize?: boolean;
    });
    dispose(): void;
    /** Update the allowFloating constraint at runtime. */
    setAllowFloating(allow: boolean): void;
    /** Update the allowMinimize constraint at runtime. */
    setAllowMinimize(allow: boolean): void;
    /** Update the allowMaximize constraint at runtime. */
    setAllowMaximize(allow: boolean): void;
    /** Mark whether this group was auto-maximized by the responsive resize logic. */
    setAutoMaximizedByResize(auto: boolean): void;
    /** Set a gate called before closing all panels in this group. Return false to cancel. */
    setBeforeClose(cb: (() => boolean | Promise<boolean>) | null): void;
    /** Set a callback fired when the maximize state changes (manual or programmatic). */
    onMaximizeChanged(cb: ((maximized: boolean) => void) | null): void;
    updateVisibility(): void;
    private createButton;
    private onFloatDock;
    /** Whether this docked group is currently maximized. */
    get isMaximized(): boolean;
    /** Programmatically restore this docked group if maximized. */
    clearMaximized(): void;
    /** Programmatically maximize this docked group. */
    setMaximized(): void;
    private onMaximize;
    private restoreMaximized;
    private onMinimize;
    private onCloseGroup;
}
/**
 * Inject our panel manager CSS into the document head.
 * Injected before user styles so they can be overridden.
 */
export declare function injectPanelManagerStyles(): void;
