import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { useMemo } from "react";
import { cn } from "../../../../lib/utils";
import { InitialThinkingSplash } from "./InitialThinkingSplash";
import { selectLatestSummaryAssistantGroup } from "../agentSessionSelectors";
import { AgentRunStatusBanners } from "./AgentRunStatusBanners";
import { AgentSummaryErrorNotice } from "./AgentSummaryErrorNotice";
import { AgentSummaryAssistantResponse, } from "./AgentSummaryAssistantResponse";
import { AgentSummaryPlaceholder } from "./AgentSummaryPlaceholder";
import { AgentPromptComposer, } from "./AgentPromptComposer";
import { AgentSummaryPromptActions } from "./AgentSummaryPromptActions";
export function AgentTerminalSummaryLayout({ className, readOnlyAccessNotice, error, agent, agentStub, lastRunStatusReason, messagesContainerRef, onScroll, messages, hideSummaryMessages, showInitialThinkingSplash, activeProfile, inlineDialog, isExecuting, isStopGuardActive = false, operations, defaultCollapseJson, allPendingApprovals, onSwitchToAutonomous, readOnly, onQuickAction, compact, hideSummaryWaitingPlaceholder, summaryPlaceholderActions, shouldShowThinkingDots, summaryPlaceholderMessage, messagesEndRef, showSummaryInput, activeInlineDialog, promptComposerProps, simpleMode, onStop, onSubmit, }) {
    const latestSummaryAssistantGroup = useMemo(() => {
        return selectLatestSummaryAssistantGroup(messages, !!hideSummaryMessages);
    }, [messages, hideSummaryMessages]);
    return (_jsxs("div", { "data-agent-terminal-root": "true", className: cn("mx-auto flex h-full min-h-0 w-full max-w-[750px] flex-col", className), children: [readOnlyAccessNotice, _jsx(AgentSummaryErrorNotice, { error: error, status: (agent || agentStub).status }), _jsx(AgentRunStatusBanners, { agent: agent, agentStub: agentStub, error: error, lastRunStatusReason: lastRunStatusReason }), _jsxs("div", { ref: messagesContainerRef, className: "flex-1 overflow-y-auto", onScroll: onScroll, children: [showInitialThinkingSplash ? _jsx(InitialThinkingSplash, {}) : null, inlineDialog ? (inlineDialog) : latestSummaryAssistantGroup ? (_jsx(AgentSummaryAssistantResponse, { summaryGroup: latestSummaryAssistantGroup, isExecuting: isExecuting, operations: operations, defaultCollapseJson: defaultCollapseJson, profile: activeProfile, agentId: agent?.id || agentStub.id, allPendingApprovals: allPendingApprovals, onSwitchToAutonomous: onSwitchToAutonomous, readOnly: readOnly, onQuickAction: onQuickAction })) : (_jsx(AgentSummaryPlaceholder, { compact: compact, hideWaitingPlaceholder: hideSummaryWaitingPlaceholder, actions: summaryPlaceholderActions, isWorking: shouldShowThinkingDots || isExecuting, statusMessage: agent?.statusMessage, placeholderMessage: summaryPlaceholderMessage })), _jsx("div", { ref: messagesEndRef })] }), showSummaryInput && !activeInlineDialog ? (_jsx(AgentPromptComposer, { ...promptComposerProps, className: simpleMode ? "pb-10" : undefined, children: _jsx(AgentSummaryPromptActions, { prompt: promptComposerProps.prompt, hasActivePlaceholderInput: !!promptComposerProps.activePlaceholderInput, hideBottomControls: promptComposerProps.hideBottomControls, simpleMode: simpleMode, isExecuting: isExecuting, isStopGuardActive: isStopGuardActive, isSubmitting: promptComposerProps.isSubmitting, readOnly: readOnly, onStop: onStop, onSubmit: onSubmit }) })) : null] }));
}
//# sourceMappingURL=AgentTerminalSummaryLayout.js.map