import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
import { useLang } from '@rspress/core/runtime';
import virtual from 'doom-@global-virtual';
import { useMemo } from 'react';
import { handleCJKWhitespaces } from '../utils.js';
import { Directive } from './Directive.js';
import { ExternalSiteLink } from './ExternalSiteLink.js';
const SiteNotes = {
    en({ name, displayName }) {
        return (_jsxs(_Fragment, { children: ["Because ", displayName, " releases on a different cadence from Alauda Container Platform, the ", displayName, " documentation is now available as a separate documentation set at", ' ', _jsx(ExternalSiteLink, { name: name, children: displayName }), "."] }));
    },
    zh({ name, displayName }) {
        const displayName_ = handleCJKWhitespaces(displayName);
        return (_jsxs(_Fragment, { children: ["\u56E0\u4E3A", displayName_, "\u7684\u53D1\u7248\u5468\u671F\u4E0E\u7075\u96C0\u4E91\u5BB9\u5668\u5E73\u53F0\u4E0D\u540C\uFF0C\u6240\u4EE5", displayName_, "\u7684\u6587\u6863\u73B0\u5728\u4F5C\u4E3A\u72EC\u7ACB\u7684\u6587\u6863\u7AD9\u70B9\u6258\u7BA1\u5728", displayName_.startsWith(' ') ? ' ' : '', _jsx(ExternalSiteLink, { name: name, children: displayName }), "\u3002"] }));
    },
    ru({ name, displayName }) {
        return (_jsxs(_Fragment, { children: ["\u041F\u043E\u0441\u043A\u043E\u043B\u044C\u043A\u0443 \u0432\u044B\u043F\u0443\u0441\u043A\u0438 ", displayName, " \u043E\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043B\u044F\u044E\u0442\u0441\u044F \u0432 \u0438\u043D\u043E\u043C \u0440\u0435\u0436\u0438\u043C\u0435, \u0447\u0435\u043C \u0443 Alauda Container Platform, \u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430\u0446\u0438\u044F ", displayName, " \u0442\u0435\u043F\u0435\u0440\u044C \u0434\u043E\u0441\u0442\u0443\u043F\u043D\u0430 \u0432 \u0432\u0438\u0434\u0435 \u043E\u0442\u0434\u0435\u043B\u044C\u043D\u043E\u0433\u043E \u043D\u0430\u0431\u043E\u0440\u0430 \u043F\u043E \u0430\u0434\u0440\u0435\u0441\u0443", ' ', _jsx(ExternalSiteLink, { name: name, children: displayName }), "\u3002"] }));
    },
};
const ApisOverviewNotes = {
    en({ name, displayName }) {
        return (_jsxs(_Fragment, { children: ["For the introduction to the usage methods of ", displayName, " APIs, please refer to", ' ', _jsxs(ExternalSiteLink, { name: name, href: "apis/overview/", children: [displayName, " APIs Guide"] }), "."] }));
    },
    zh({ name, displayName }) {
        const displayName_ = handleCJKWhitespaces(displayName);
        return (_jsxs(_Fragment, { children: ["\u5173\u4E8E", displayName_, " APIs \u7684\u4F7F\u7528\u65B9\u6CD5\u4ECB\u7ECD\u8BF7\u53C2\u8003", displayName_.startsWith(' ') ? ' ' : '', _jsxs(ExternalSiteLink, { name: name, href: "apis/overview/", children: [displayName, " APIs \u6307\u5357"] }), "\u3002"] }));
    },
    ru({ name, displayName }) {
        return (_jsxs(_Fragment, { children: ["\u0414\u043B\u044F \u043E\u0437\u043D\u0430\u043A\u043E\u043C\u043B\u0435\u043D\u0438\u044F \u0441 \u043C\u0435\u0442\u043E\u0434\u0430\u043C\u0438 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u0438\u044F API ", displayName, ", \u043E\u0431\u0440\u0430\u0442\u0438\u0442\u0435\u0441\u044C \u043A \u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430\u0446\u0438\u0438", ' ', _jsxs(ExternalSiteLink, { name: name, href: "apis/overview/", children: [displayName, " APIs Guide"] }), "."] }));
    },
};
export const ExternalSiteBase = ({ name, template }) => {
    const site = useMemo(() => virtual.sites?.find((s) => s.name === name), [name]);
    const lang = useLang();
    const displayName = useMemo(() => site?.displayName?.[lang] || site?.displayName?.en || name.toUpperCase(), [lang, name, site?.displayName]);
    if (!site) {
        return (_jsxs(Directive, { type: "danger", children: ["No site with name `", name, "` found, please ensure it's already defined at `sites.yaml`"] }));
    }
    const Notes = template === 'apisOverview' ? ApisOverviewNotes : SiteNotes;
    const Note = Notes[lang] || Notes.en;
    return (_jsx(Directive, { title: "Note", children: _jsx(Note, { name: name, displayName: displayName }) }));
};
