import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { AgentTerminalFullLayout, } from "./AgentTerminalFullLayout";
import { AgentTerminalFullPromptControls, } from "./AgentTerminalFullPromptControls";
import { AgentTerminalFullUpperContent, } from "./AgentTerminalFullUpperContent";
import { AgentTerminalSummaryLayout, } from "./AgentTerminalSummaryLayout";
import { AgentPromptTrayPopovers } from "./AgentPromptTrayPopovers";
import { AgentActivityOverviewPanel } from "./AgentActivityOverviewPanel";
import { AgentSuggestionBanner } from "./AgentSuggestionBanner";
import { AgentDocumentList } from "./AgentDocumentList";
import { AgentProjectProgress } from "./AgentProjectProgress";
export function AgentTerminalView({ loadingContent, displayMode, summaryLayoutProps, fullLayoutProps, fullUpperContentProps, fullPromptControlsProps, inlineDialogContent, isQuestionnaireDialogOpen, isProfileResolved, viewedContext, }) {
    if (loadingContent) {
        return loadingContent;
    }
    if (displayMode === "summary") {
        return (_jsx(AgentTerminalSummaryLayout, { ...summaryLayoutProps, showSummaryInput: isProfileResolved && summaryLayoutProps.showSummaryInput }));
    }
    const showTrayPopovers = !fullUpperContentProps.simpleMode &&
        !fullUpperContentProps.hideContext &&
        !fullUpperContentProps.isMobile;
    const trayOverlay = showTrayPopovers ? (_jsx(AgentPromptTrayPopovers, { contextChrome: fullUpperContentProps.contextChrome, agent: fullUpperContentProps.agent, activeProfile: fullUpperContentProps.activeProfile, documentListRef: fullUpperContentProps.documentListRef, hasTodoContent: fullUpperContentProps.hasTodoContent, hasSpawnedAgents: fullUpperContentProps.hasSpawnedAgents, messages: fullUpperContentProps.messages, agentMetadata: fullUpperContentProps.agentMetadata, setAgentMetadata: fullUpperContentProps.setAgentMetadata, setAgent: fullUpperContentProps.setAgent, viewedContext: viewedContext })) : null;
    const composerAttachmentsContent = fullUpperContentProps.agent?.id && fullUpperContentProps.activeProfile ? (_jsx(AgentDocumentList, { ref: fullUpperContentProps.documentListRef, agentId: fullUpperContentProps.agent.id, maxFileSizeMB: fullUpperContentProps.activeProfile.maxDocumentSizeMB ?? 10, enabled: fullUpperContentProps.activeProfile.enableDocumentUpload ?? false, profileId: fullUpperContentProps.activeProfile.id, headerless: true, composerInline: true }, `composer-${fullUpperContentProps.agent.id}-${fullUpperContentProps.agent.updatedDate || ""}-${fullUpperContentProps.activeProfile.id}`)) : null;
    const footerStatusContent = (fullLayoutProps.showStatusBar ?? !fullLayoutProps.hideBottomControls) &&
        !fullLayoutProps.simpleMode &&
        !fullLayoutProps.isMobile
        ? fullLayoutProps.statusBarContent
        : null;
    // Questionnaires render inline in the conversation flow; other dialog
    // types keep the stacked panel between the conversation and the composer.
    const conversationInlineDialog = isQuestionnaireDialogOpen
        ? inlineDialogContent
        : null;
    const panelInlineDialog = isQuestionnaireDialogOpen
        ? null
        : inlineDialogContent;
    return (_jsx(AgentTerminalFullLayout, { ...fullLayoutProps, showPromptComposer: isProfileResolved, upperContent: _jsx(AgentTerminalFullUpperContent, { ...fullUpperContentProps, conversationInlineDialog: conversationInlineDialog }), inlineDialog: panelInlineDialog, aboveComposer: _jsxs(_Fragment, { children: [_jsx(AgentSuggestionBanner, { suggestion: fullUpperContentProps.agentSuggestion, agent: fullUpperContentProps.agent, activeProfile: fullUpperContentProps.activeProfile, onDismiss: () => fullUpperContentProps.onDismissSuggestion?.(), onSwitchProfile: (targetProfileId) => fullUpperContentProps.onSwitchProfileFromSuggestion?.(targetProfileId) }), _jsx(AgentProjectProgress, { agent: fullUpperContentProps.agent, agentMetadata: fullUpperContentProps.agentMetadata, messages: fullUpperContentProps.messages }), showTrayPopovers ? (_jsx(AgentActivityOverviewPanel, { operations: fullUpperContentProps.operations, messages: fullUpperContentProps.messages })) : null] }), promptControls: _jsx(AgentTerminalFullPromptControls, { ...fullPromptControlsProps, footerStatusContent: footerStatusContent, leadingControls: trayOverlay }), attachmentsContent: composerAttachmentsContent }));
}
//# sourceMappingURL=AgentTerminalView.js.map