import { effectScope as g, shallowRef as E, defineComponent as i, renderSlot as p, computed as C, openBlock as c, createElementBlock as m, Fragment as _, renderList as I, createVNode as o, withCtx as u, unref as a, createBlock as w, resolveDynamicComponent as y, createTextVNode as b, toDisplayString as k, ref as $, readonly as D, normalizeStyle as F } from "vue";
import { ElMenuItem as R, ElIcon as S, ElSubMenu as B, ElAside as M, ElMenu as O } from "element-plus";
import { useRoute as T } from "vue-router";
function z(n) {
  let t = !1, e;
  const l = g(!0);
  return (...s) => (t || (e = l.run(() => n(...s)), t = !0), e);
}
function A(n, t) {
  if (typeof Symbol < "u") {
    const e = { ...n };
    return Object.defineProperty(e, Symbol.iterator, {
      enumerable: !1,
      value() {
        let l = 0;
        return {
          next: () => ({
            value: t[l++],
            done: l > t.length
          })
        };
      }
    }), e;
  } else
    return Object.assign([...t], n);
}
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
function G(n) {
  const t = /* @__PURE__ */ Object.create(null);
  return (e) => t[e] || (t[e] = n(e));
}
const N = /-(\w)/g, V = G((n) => n.replace(N, (t, e) => e ? e.toUpperCase() : ""));
function H(n = {}) {
  const {
    inheritAttrs: t = !0
  } = n, e = E(), l = /* @__PURE__ */ i({
    setup(f, { slots: r }) {
      return () => {
        e.value = r.default;
      };
    }
  }), s = /* @__PURE__ */ i({
    inheritAttrs: t,
    setup(f, { attrs: r, slots: x }) {
      return () => {
        var v;
        if (!e.value && process.env.NODE_ENV !== "production")
          throw new Error("[VueUse] Failed to find the definition of reusable template");
        const d = (v = e.value) == null ? void 0 : v.call(e, { ...K(r), $slots: x });
        return t && (d == null ? void 0 : d.length) === 1 ? d[0] : d;
      };
    }
  });
  return A(
    { define: l, reuse: s },
    [l, s]
  );
}
function K(n) {
  const t = {};
  for (const e in n)
    t[V(e)] = n[e];
  return t;
}
const h = /* @__PURE__ */ i({
  name: "If",
  __name: "If",
  props: {
    when: {}
  },
  setup(n) {
    const t = (e) => e;
    return (e, l) => e.when ? p(e.$slots, "default", {
      key: 0,
      value: t(e.when)
    }) : p(e.$slots, "fallback", { key: 1 });
  }
}), j = /* @__PURE__ */ i({
  name: "For",
  inheritAttrs: !1,
  __name: "For",
  props: {
    echo: {},
    rowKey: {}
  },
  setup(n) {
    const t = n, e = C(() => t.echo);
    return (l, s) => (c(), m(
      _,
      null,
      [
        (c(!0), m(
          _,
          null,
          I(l.echo, (f, r) => p(l.$slots, "default", {
            key: l.rowKey,
            item: f,
            index: r
          })),
          128
          /* KEYED_FRAGMENT */
        )),
        o(h, {
          when: !e.value || !e.value.length || e.value.length === 0
        }, {
          default: u(() => [
            p(l.$slots, "fallback")
          ]),
          _: 3
          /* FORWARDED */
        }, 8, ["when"])
      ],
      64
      /* STABLE_FRAGMENT */
    ));
  }
}), U = /* @__PURE__ */ i({
  name: "FsSideBarItem",
  __name: "Item",
  props: {
    items: {}
  },
  setup(n) {
    const [t, e] = H();
    return (l, s) => (c(), m(_, null, [
      o(a(t), null, {
        default: u(({ list: f }) => [
          o(a(j), {
            echo: f,
            "row-key": "path"
          }, {
            default: u(({ item: r }) => [
              o(a(h), {
                when: r.children && r.children.length
              }, {
                fallback: u(() => [
                  o(a(R), {
                    class: "fast-start-menu-item",
                    index: r.path
                  }, {
                    default: u(() => [
                      o(a(h), {
                        when: r.icon
                      }, {
                        default: u(() => [
                          o(a(S), null, {
                            default: u(() => [
                              (c(), w(y(r.icon)))
                            ]),
                            _: 2
                          }, 1024)
                        ]),
                        _: 2
                      }, 1032, ["when"]),
                      b(" " + k(r.name), 1)
                    ]),
                    _: 2
                  }, 1032, ["index"])
                ]),
                default: u(() => [
                  o(a(B), {
                    class: "fast-start-menu-item-title",
                    index: r.path
                  }, {
                    title: u(() => [
                      o(a(h), {
                        when: r.icon
                      }, {
                        default: u(() => [
                          o(a(S), null, {
                            default: u(() => [
                              (c(), w(y(r.icon)))
                            ]),
                            _: 2
                          }, 1024)
                        ]),
                        _: 2
                      }, 1032, ["when"]),
                      b(" " + k(r.name), 1)
                    ]),
                    default: u(() => [
                      o(a(e), {
                        list: r.children || []
                      }, null, 8, ["list"])
                    ]),
                    _: 2
                  }, 1032, ["index"])
                ]),
                _: 2
              }, 1032, ["when"])
            ]),
            _: 2
          }, 1032, ["echo"])
        ]),
        _: 1
      }),
      o(a(e), { list: l.items }, null, 8, ["list"])
    ], 64));
  }
}), W = 60, L = z(() => {
  const n = $({
    menu: []
  });
  function t(e) {
    n.value.menu = e;
  }
  return {
    state: D(n),
    setMenu: t
  };
}), Q = /* @__PURE__ */ i({
  __name: "SideBar",
  setup(n) {
    const { state: t } = L(), e = T();
    return (l, s) => (c(), w(a(M), {
      class: "fast-start-aside",
      width: "230px",
      style: F({ height: `calc(100vh - ${a(W)}px)` })
    }, {
      default: u(() => [
        o(a(O), {
          "default-active": a(e).path,
          router: "",
          class: "fast-start-menu"
        }, {
          default: u(() => [
            o(U, {
              items: a(t).menu
            }, null, 8, ["items"])
          ]),
          _: 1
        }, 8, ["default-active"])
      ]),
      _: 1
    }, 8, ["style"]));
  }
});
export {
  Q as default
};
//# sourceMappingURL=SideBar.mjs.map
