import { defineComponent as x, inject as s, computed as h, resolveComponent as i, openBlock as k, createBlock as C, withCtx as D, createElementVNode as p, createVNode as b, toDisplayString as w } from "vue";
import { g as T } from "./index-a857af7d.mjs";
const v = { style: { "margin-left": "16px" } }, V = /* @__PURE__ */ x({
  __name: "index",
  setup(M) {
    const u = s("globalContext"), c = s("context"), g = h(() => T(c.codeManager.getCode(), u.componentRepository));
    function m(e) {
      c.choosedManager.set(e.data);
    }
    const _ = (e, t, o, n) => {
      c.componentManager.move(e.key, t.key, o);
    }, f = (e, t, o) => {
      var n, a, l, r, d;
      return o == "inner" ? t.data.nodeType == "component" ? !!((d = (r = (l = (a = (n = t.data) == null ? void 0 : n.data) == null ? void 0 : a.config) == null ? void 0 : l.basic) == null ? void 0 : r._slot) != null && d.default) : !0 : t.data.nodeType == "component" || t.data.nodeType == "slot";
    }, y = (e) => e.data.nodeType == "component";
    return (e, t) => {
      const o = i("lc-icon"), n = i("el-tree");
      return k(), C(n, {
        data: g.value,
        "highlight-current": !0,
        draggable: "",
        "node-key": "key",
        "default-expanded-keys": ["_root"],
        onNodeClick: m,
        onNodeDrop: _,
        "allow-drop": f,
        "allow-drag": y
      }, {
        default: D(({ node: a, data: l }) => [
          p("span", null, [
            b(o, {
              icon: a.data.icon
            }, null, 8, ["icon"]),
            p("span", v, w(a.label), 1)
          ])
        ]),
        _: 1
      }, 8, ["data"]);
    };
  }
});
export {
  V as default
};
