import { ref as r, onMounted as E, resolveComponent as T, openBlock as n, createElementBlock as l, normalizeClass as z, createBlock as s, withCtx as o, createElementVNode as w, toDisplayString as i, createVNode as u, Fragment as L, renderList as D, createTextVNode as _, createCommentVNode as N } from "vue"; import { n as B, de as V, cG as $, cH as G, B as P } from "./index2.js"; const b = "data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20t='1732167226097'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='9067'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='200'%20height='200'%3e%3cpath%20d='M554.666667%20849.066667c-12.8%200-29.866667%204.266667-42.666667%204.266666-187.733333%200-341.333333-153.6-341.333333-341.333333%200-64%2017.066667-123.733333%2051.2-179.2l8.533333-12.8c25.6-42.666667%2059.733333-76.8%20102.4-102.4%2042.666667-25.6%2089.6-42.666667%20140.8-46.933333h38.4c187.733333%200%20341.333333%20153.6%20341.333333%20341.333333%200%2076.8-25.6%20145.066667-64%20200.533333l-4.266666%204.266667c-25.6%2034.133333-59.733333%2064-98.133334%2089.6-42.666667%2025.6-89.6%2038.4-132.266666%2042.666667zM507.733333%20768v-85.333333l-64-93.866667%20106.666667-106.666667%2064%2076.8h102.4l34.133333%2034.133334c8.533333-25.6%2012.8-51.2%2012.8-81.066667%200-140.8-115.2-256-256-256-12.8%200-25.6%200-38.4%204.266667l-29.866666%2029.866666L494.933333%20341.333333l17.066667%20115.2-85.333333%2085.333334-145.066667-140.8C264.533333%20435.2%20256%20469.333333%20256%20512c0%20140.8%20110.933333%20256%20251.733333%20256z'%20fill='%23444444'%20p-id='9068'%3e%3c/path%3e%3c/svg%3e", S = "data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20t='1732167226097'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='9067'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='200'%20height='200'%3e%3cpath%20d='M554.666667%20849.066667c-12.8%200-29.866667%204.266667-42.666667%204.266666-187.733333%200-341.333333-153.6-341.333333-341.333333%200-64%2017.066667-123.733333%2051.2-179.2l8.533333-12.8c25.6-42.666667%2059.733333-76.8%20102.4-102.4%2042.666667-25.6%2089.6-42.666667%20140.8-46.933333h38.4c187.733333%200%20341.333333%20153.6%20341.333333%20341.333333%200%2076.8-25.6%20145.066667-64%20200.533333l-4.266666%204.266667c-25.6%2034.133333-59.733333%2064-98.133334%2089.6-42.666667%2025.6-89.6%2038.4-132.266666%2042.666667zM507.733333%20768v-85.333333l-64-93.866667%20106.666667-106.666667%2064%2076.8h102.4l34.133333%2034.133334c8.533333-25.6%2012.8-51.2%2012.8-81.066667%200-140.8-115.2-256-256-256-12.8%200-25.6%200-38.4%204.266667l-29.866666%2029.866666L494.933333%20341.333333l17.066667%20115.2-85.333333%2085.333334-145.066667-140.8C264.533333%20435.2%20256%20469.333333%20256%20512c0%20140.8%20110.933333%20256%20251.733333%20256z'%20fill='%231677FF'%20p-id='9068'%3e%3c/path%3e%3c/svg%3e", A = { class: "locale-select" }, O = { class: "label" }, I = { key: 0, src: b, class: "icon" }, M = { key: 1, src: S, class: "icon" }, F = /* @__PURE__ */ Object.assign({ name: "SToggleLanguage" }, { __name: "SToggleLanguage", props: { // 展示形态:button 按钮 / dropdown 下拉 / 其它为块状 blockType: { type: String, default: "button" } }, setup(g) { const t = r(""), a = r(!1), p = [ { key: "zh", name: window.$l("中文") }, { key: "en", name: "English" } ]; function h(e) { a.value = e; } function v(e) { t.value = e.key, window.$utils.ls.set("lang", e.key), window.location.reload(); } function m() { t.value === "zh" ? (t.value = "en", window.$utils.ls.set("lang", "en")) : (t.value = "zh", window.$utils.ls.set("lang", "zh")), window.location.reload(); } function k() { const e = window.$utils.ls.get("lang"); (!e || e === "undefined") && window.$utils.ls.set("lang", window.$utils.env.VITE_APP_LANG), t.value = window.$utils.env.VITE_APP_LANG_ENABLE ? window.$utils.ls.get("lang") : "zh"; } return E(() => { k(); }), (e, U) => { const d = T("s-icon"), f = G, x = $, y = V, C = P; return e.$utils.env.VITE_APP_LANG_ENABLE ? (n(), l("div", { key: 0, class: z(["s-toggle-language", g.blockType === "button" ? "flex-right" : ""]) }, [ g.blockType === "dropdown" ? (n(), s(y, { key: 0, trigger: ["click"], onOpenChange: h }, { overlay: o(() => [ u(x, null, { default: o(() => [ (n(), l(L, null, D(p, (c) => u(f, { key: c.key, onClick: (W) => v(c) }, { default: o(() => [ _(i(c.name), 1) ]), _: 2 }, 1032, ["onClick"])), 64)) ]), _: 1 }) ]), default: o(() => [ w("div", A, [ w("div", O, i(t.value === "zh" ? "中文" : "English"), 1), a.value ? (n(), l("img", M)) : (n(), l("img", I)), a.value ? (n(), s(d, { key: 3, name: "CaretUpOutlined", class: "s-theme-color", style: { "font-size": "12px" } })) : (n(), s(d, { key: 2, name: "CaretDownOutlined", style: { color: "var(--s-text-color)", "font-size": "12px" } })) ]) ]), _: 1 })) : (n(), s(C, { key: 1, class: "custom-btn", onClick: m }, { default: o(() => [ _(i(t.value === "zh" ? "中" : "EN"), 1) ]), _: 1 })) ], 2)) : N("", !0); }; } }), H = /* @__PURE__ */ B(F, [["__scopeId", "data-v-8e47e553"]]); export { H as default };