"use strict";
var __assign = (this && this.__assign) || function () {
    __assign = Object.assign || function(t) {
        for (var s, i = 1, n = arguments.length; i < n; i++) {
            s = arguments[i];
            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
                t[p] = s[p];
        }
        return t;
    };
    return __assign.apply(this, arguments);
};
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var jsx_runtime_1 = require("react/jsx-runtime");
var antd_1 = require("antd");
var loading_1 = __importDefault(require("components/share/loading"));
var register_1 = __importDefault(require("../register"));
var edit_table_1 = __importDefault(require("lib/hooks/edit-table"));
var theme_data_1 = require("@cocalc/frontend/frame-editors/terminal-editor/theme-data");
var desc = {
    font_size: "New terminals will use this font size by default. You can change this\nfor a particular terminal at any time.",
    color_scheme: "The color scheme used for terminals.",
    font: "The CoCalc terminal uses your browser's fixed-width font, which you can change in your browser's preferences.",
};
(0, register_1.default)({
    path: "editor/terminal",
    title: "Terminals",
    icon: "terminal",
    desc: "Terminal default font size, color theme, etc.",
    search: desc,
    Component: function () {
        var _a = (0, edit_table_1.default)({
            accounts: { terminal: null },
        }), edited = _a.edited, original = _a.original, Save = _a.Save, EditNumber = _a.EditNumber, EditSelect = _a.EditSelect;
        if (original == null || edited == null) {
            return (0, jsx_runtime_1.jsx)(loading_1.default, {});
        }
        return ((0, jsx_runtime_1.jsx)(antd_1.Space, __assign({ direction: "vertical", style: { width: "100%" } }, { children: (0, jsx_runtime_1.jsxs)(antd_1.Row, { children: [(0, jsx_runtime_1.jsxs)(antd_1.Col, __assign({ md: 14, sm: 24, style: { paddingRight: '15px' } }, { children: [(0, jsx_runtime_1.jsx)(Save, {}), (0, jsx_runtime_1.jsx)(EditNumber, { path: "terminal.font_size", title: "Terminal Font Size", icon: "text-height", desc: desc.font_size, min: 5, max: 32, units: "px" }), (0, jsx_runtime_1.jsx)(EditSelect, { path: "terminal.color_scheme", icon: "colors", desc: desc.color_scheme, options: theme_data_1.theme_desc, style: { width: "30ex" } }), (0, jsx_runtime_1.jsx)("h3", __assign({ style: { marginTop: "15px" } }, { children: "Font" })), desc.font] })), (0, jsx_runtime_1.jsxs)(antd_1.Col, __assign({ md: 10, sm: 24 }, { children: [(0, jsx_runtime_1.jsx)("h3", __assign({ style: { marginTop: "10px" } }, { children: "Preview" })), (0, jsx_runtime_1.jsx)("div", { style: {
                                    fontSize: "".concat(edited.terminal.font_size, "px"),
                                    overflow: "hidden",
                                }, dangerouslySetInnerHTML: {
                                    __html: (0, theme_data_1.example)(edited.terminal.color_scheme),
                                } })] }))] }) })));
    },
});
//# sourceMappingURL=terminal.js.map