import { ref as m, reactive as S, watch as C, computed as E, onMounted as $, resolveComponent as K, createElementBlock as x, openBlock as r, createElementVNode as h, createVNode as D, normalizeStyle as R, createBlock as _ } from "vue"; import { k as T, ai as U, aj as f, ak as B } from "./index2.js"; const L = { class: "s-menu-slide-common" }, N = { class: "menu-wrap" }, V = { __name: "SSideMenu", emits: ["collapsed"], setup(A, { emit: k }) { const v = U(), w = k, i = m([]), p = m(""), e = S({ collapsed: !1, selectedKeys: [], openKeys: [], preOpenKeys: [] }); C( () => e.openKeys, (t, s) => { e.preOpenKeys = s; } ); const u = (t, s, d = 0) => t.map((n) => { var c; const a = ((c = n.meta) == null ? void 0 : c.title) || n.name || "", l = d === 0 && !n.children, o = { key: n.path, // icon: item.icon ? () => h(item.icon) : null, icon: null, label: s && l ? a.slice(0, 1) : a, title: a, path: n.path }; return n.children && (o.children = u(n.children, s, d + 1)), o; }), b = E(() => u(i.value, e.collapsed)), M = () => { e.collapsed = !e.collapsed, e.openKeys = e.collapsed ? [] : e.preOpenKeys, w("collapsed", e.collapsed); }, g = (t) => { v.push(t.key), e.selectedKeys = [t.key], window.$utils.ls.set("selectedKeys", e.selectedKeys); }, O = (t) => { e.openKeys = t, f().setMenuOpenKeys(e.openKeys); }; return $(() => { var l; p.value = window.$utils.env.VITE_APP_MENU_THEME || "dark"; const t = f(), s = ((l = t.dynamics[0]) == null ? void 0 : l.children) || [], d = (window.$staticRoutes || []).filter( (o) => { var c, y; return o && o.path && ((c = o.meta) == null ? void 0 : c.title) && !((y = o.meta) != null && y.hidden); } ); i.value = [...s, ...d].filter((o) => { var c; return !((c = o.meta) != null && c.hidden); }); const n = location.pathname; window.$utils.ls.set("selectedKeys", [n]), e.selectedKeys = window.$utils.ls.get("selectedKeys") || []; const a = t.openKeys || []; e.openKeys = a; }), (t, s) => { const d = B, n = K("DoubleRightOutlined"), a = K("DoubleLeftOutlined"); return r(), x("div", L, [ h("div", N, [ D(d, { openKeys: e.openKeys, "onUpdate:openKeys": s[0] || (s[0] = (l) => e.openKeys = l), selectedKeys: e.selectedKeys, "onUpdate:selectedKeys": s[1] || (s[1] = (l) => e.selectedKeys = l), mode: "inline", items: b.value, theme: p.value, onSelect: g, onOpenChange: O }, null, 8, ["openKeys", "selectedKeys", "items", "theme"]) ]), h("div", { class: "right-border-btn", style: R({ backgroundColor: p.value === "dark" ? "#001529" : "#fff", color: p.value === "dark" ? "#fff" : "#000000A6", border: `1px solid ${p.value === "dark" ? "#001529" : "#ececec"}` }), onClick: M }, [ e.collapsed ? (r(), _(n, { key: 0 })) : (r(), _(a, { key: 1 })) ], 4) ]); }; } }, j = /* @__PURE__ */ T(V, [["__scopeId", "data-v-67a5e7b7"]]); export { j as default };