import { Fragment, jsx, jsxs } from "react/jsx-runtime";
import { styled } from "@mui/material/styles";
import apollo_core from "@uipath/apollo-core";
import { CHAT_DRAWER_WIDTH_FULL_SCREEN, CHAT_WIDTH_FULL_SCREEN_MAX_WIDTH } from "../../service/index.js";
import { AutopilotChatHeader } from "../header/header.js";
import { AutopilotChatHistory } from "../history/chat-history.js";
import { AutopilotChatInput } from "../input/chat-input.js";
import { ChatScrollContainer } from "../message/chat-scroll-container.js";
import chat_settings from "../settings/chat-settings.js";
const MainContainer = styled('div')(({ historyOpen })=>({
        flex: 1,
        display: 'flex',
        flexDirection: 'column',
        height: '100%',
        maxHeight: '100%',
        minWidth: '0',
        margin: `0 ${apollo_core.Spacing.SpacingL}`,
        ...historyOpen && {
            width: `calc(100% - ${CHAT_DRAWER_WIDTH_FULL_SCREEN}px)`
        }
    }));
const HeaderContainer = styled('div')(({ padding })=>({
        flexShrink: 0,
        padding
    }));
const InputBackground = styled('div')(()=>({
        flexShrink: 0,
        paddingBottom: apollo_core.Spacing.SpacingXs
    }));
const InputContainer = styled('div')(()=>({
        maxWidth: CHAT_WIDTH_FULL_SCREEN_MAX_WIDTH,
        margin: '0 auto',
        width: '100%'
    }));
const StandardLayout = ({ historyOpen, settingsOpen, historyDisabled, settingsDisabled, mode, headerDisabled, headerSeparatorDisabled, readOnly })=>/*#__PURE__*/ jsxs(Fragment, {
        children: [
            /*#__PURE__*/ jsxs(MainContainer, {
                historyOpen: historyOpen,
                children: [
                    !headerDisabled && /*#__PURE__*/ jsx(HeaderContainer, {
                        padding: headerSeparatorDisabled ? `${apollo_core.Spacing.SpacingBase} 0` : `${apollo_core.Spacing.SpacingXs} 0 ${apollo_core.Spacing.SpacingBase}`,
                        children: /*#__PURE__*/ jsx(AutopilotChatHeader, {})
                    }),
                    /*#__PURE__*/ jsx(ChatScrollContainer, {
                        mode: mode
                    }),
                    !readOnly && /*#__PURE__*/ jsx(InputBackground, {
                        children: /*#__PURE__*/ jsx(InputContainer, {
                            children: /*#__PURE__*/ jsx(AutopilotChatInput, {})
                        })
                    })
                ]
            }),
            !historyDisabled && /*#__PURE__*/ jsx(AutopilotChatHistory, {
                open: historyOpen,
                isFullScreen: false
            }),
            !settingsDisabled && /*#__PURE__*/ jsx(chat_settings, {
                open: settingsOpen,
                isFullScreen: false
            })
        ]
    });
export { StandardLayout };
