import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { Box, Text } from "ink";
import { isChineseUi } from "../services/ui/languageService.js";
import { SelectList } from "./design/SelectList.js";
export const startupShellChoices = ["enable", "ask"];
export function StartupShellPromptPanel(props) {
    const zh = isChineseUi(props.language);
    const width = Math.max(48, Math.min(104, props.width - 4));
    const options = zh
        ? [
            {
                id: "enable",
                label: "开启本会话 shell",
                detail: "Enter / Y",
                description: "允许 DeepSeekCode 在当前项目目录中运行构建、测试和验证命令。",
                tone: "success",
            },
            {
                id: "ask",
                label: "保持关闭",
                detail: "N / Esc",
                description: "文件工具照常可用；需要 shell 时再弹出权限选择。",
                tone: "muted",
            },
        ]
        : [
            {
                id: "enable",
                label: "Enable shell for this session",
                detail: "Enter / Y",
                description: "Allow DeepSeekCode to run build, test, and validation commands in this project.",
                tone: "success",
            },
            {
                id: "ask",
                label: "Keep shell off",
                detail: "N / Esc",
                description: "File tools remain available; command execution will ask later when needed.",
                tone: "muted",
            },
        ];
    return (_jsx(Box, { flexDirection: "column", paddingX: 1, marginTop: 1, children: _jsx(Box, { borderStyle: "round", borderColor: "yellow", paddingX: 1, paddingY: 1, width: width, children: _jsxs(Box, { flexDirection: "column", children: [_jsxs(Box, { justifyContent: "space-between", children: [_jsx(Text, { color: "cyan", bold: true, children: zh ? "启动权限确认" : "Startup Permission" }), _jsx(Text, { color: "yellow", children: "shell" })] }), _jsxs(Box, { marginTop: 1, flexDirection: "column", children: [_jsx(Text, { color: "gray", children: zh
                                    ? "是否为本次 TUI 会话开启 shell 执行权限？"
                                    : "Enable shell execution for this TUI session?" }), _jsx(Text, { color: "gray", children: zh ? `项目 ${props.projectPath}` : `Project ${props.projectPath}` })] }), _jsx(Box, { marginTop: 1, children: _jsx(SelectList, { selectedIndex: props.selectedIndex, visibleCount: 2, width: Math.max(40, width - 6), options: options }) }), _jsx(Box, { marginTop: 1, children: _jsx(Text, { color: "gray", children: zh
                                ? "方向键选择，Enter 确认。这个选择只影响当前会话，不写入全局配置。"
                                : "Use Up/Down and Enter. This choice affects this session only." }) })] }) }) }));
}
