import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
/**
 * @license
 * Copyright 2026 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */
import { Box, Text } from 'ink';
import { UserIdentity } from './UserIdentity.js';
import { Tips } from './Tips.js';
import { useSettings } from '../contexts/SettingsContext.js';
import { useConfig } from '../contexts/ConfigContext.js';
import { useUIState } from '../contexts/UIStateContext.js';
import { Banner } from './Banner.js';
import { useBanner } from '../hooks/useBanner.js';
import { useTips } from '../hooks/useTips.js';
import { theme } from '../semantic-colors.js';
import { ThemedGradient } from './ThemedGradient.js';
import { CliSpinner } from './CliSpinner.js';
const ICON = `▝▜▄  
  ▝▜▄
 ▗▟▀ 
▝▀    `;
export const AppHeader = ({ version, showDetails = true }) => {
    const settings = useSettings();
    const config = useConfig();
    const { terminalWidth, bannerData, bannerVisible, updateInfo } = useUIState();
    const { bannerText } = useBanner(bannerData);
    const { showTips } = useTips();
    const showHeader = !(settings.merged.ui.hideBanner || config.getScreenReader());
    if (!showDetails) {
        return (_jsx(Box, { flexDirection: "column", children: showHeader && (_jsxs(Box, { flexDirection: "row", marginTop: 1, marginBottom: 1, paddingLeft: 2, children: [_jsx(Box, { flexShrink: 0, children: _jsx(ThemedGradient, { children: ICON }) }), _jsx(Box, { marginLeft: 2, flexDirection: "column", children: _jsxs(Box, { children: [_jsx(Text, { bold: true, color: theme.text.primary, children: "Gemini CLI" }), _jsxs(Text, { color: theme.text.secondary, children: [" v", version] })] }) })] })) }));
    }
    return (_jsxs(Box, { flexDirection: "column", children: [showHeader && (_jsxs(Box, { flexDirection: "row", marginTop: 1, marginBottom: 1, paddingLeft: 2, children: [_jsx(Box, { flexShrink: 0, children: _jsx(ThemedGradient, { children: ICON }) }), _jsxs(Box, { marginLeft: 2, flexDirection: "column", children: [_jsxs(Box, { children: [_jsx(Text, { bold: true, color: theme.text.primary, children: "Gemini CLI" }), _jsxs(Text, { color: theme.text.secondary, children: [" v", version] }), updateInfo && (_jsx(Box, { marginLeft: 2, children: _jsxs(Text, { color: theme.text.secondary, children: [_jsx(CliSpinner, {}), " Updating"] }) }))] }), _jsx(Box, { height: 1 }), settings.merged.ui.showUserIdentity !== false && (_jsx(UserIdentity, { config: config }))] })] })), bannerVisible && bannerText && (_jsx(Banner, { width: terminalWidth, bannerText: bannerText, isWarning: bannerData.warningText !== '' })), !(settings.merged.ui.hideTips || config.getScreenReader()) &&
                showTips && _jsx(Tips, { config: config })] }));
};
//# sourceMappingURL=AppHeader.js.map