/**
 * Panels domain state — tracks the panel-first operator UX surfaces:
 * which panels are open, their layout, and focus state.
 */
/**
 * Returns the default initial state for the panels domain.
 */
export function createInitialPanelsState() {
    const defaultPanel = (id, open, position) => ({
        id,
        open,
        position,
        sizeWeight: 50,
        focused: id === 'main_conversation',
        lastActivatedAt: undefined,
        scrollOffset: 0,
        collapsed: false,
    });
    const panels = new Map([
        ['main_conversation', defaultPanel('main_conversation', true, 'primary')],
        ['agent_monitor', defaultPanel('agent_monitor', false, 'secondary')],
        ['task_list', defaultPanel('task_list', false, 'secondary')],
        ['tool_trace', defaultPanel('tool_trace', false, 'footer')],
        ['diff_viewer', defaultPanel('diff_viewer', false, 'secondary')],
        ['file_explorer', defaultPanel('file_explorer', false, 'sidebar')],
        ['git_status', defaultPanel('git_status', false, 'sidebar')],
        ['mcp_inspector', defaultPanel('mcp_inspector', false, 'secondary')],
        ['plugin_manager', defaultPanel('plugin_manager', false, 'secondary')],
        ['telemetry_dashboard', defaultPanel('telemetry_dashboard', false, 'secondary')],
        ['session_list', defaultPanel('session_list', false, 'sidebar')],
    ]);
    return {
        revision: 0,
        lastUpdatedAt: 0,
        source: 'init',
        panels,
        focusedPanelId: 'main_conversation',
        previousFocusedPanelId: undefined,
        sidebarVisible: false,
        footerVisible: false,
        terminalColumns: 80,
        terminalRows: 24,
    };
}
