"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const code_demo_1 = require("./markdown-it/code-demo");
const vuepress_utils_1 = require("@mr-hope/vuepress-utils");
const pluginConfig = (markdownOption, themeConfig) => {
    /** i18n config */
    const { container } = vuepress_utils_1.i18n;
    const baseLang = markdownOption.baseLang || themeConfig.baseLang || "en-US";
    const baseLangPath = vuepress_utils_1.lang2path(baseLang);
    const resolveConfig = (titleConfig) => {
        titleConfig["/"] = titleConfig[baseLangPath];
        return titleConfig;
    };
    const config = [
        [
            "container",
            { type: "info", defaultTitle: resolveConfig(container.info) },
        ],
        ["container", { type: "tip", defaultTitle: resolveConfig(container.tip) }],
        [
            "container",
            { type: "warning", defaultTitle: resolveConfig(container.warning) },
        ],
        [
            "container",
            { type: "danger", defaultTitle: resolveConfig(container.danger) },
        ],
        [
            "container",
            {
                type: "details",
                before: (info) => `<details class="custom-block details"><summary>${info || "Details"}</summary>\n`,
                after: () => "</details>\n",
            },
        ],
    ];
    if (markdownOption.align || markdownOption.enableAll)
        config.push(["container", { type: "left", defaultTitle: "" }], ["container", { type: "center", defaultTitle: "" }], ["container", { type: "right", defaultTitle: "" }], ["container", { type: "justify", defaultTitle: "" }]);
    if (markdownOption.codeDemo || markdownOption.enableAll)
        config.push(["container", { type: "demo", render: code_demo_1.codeDemoRender }]);
    return config;
};
exports.default = pluginConfig;
