import { defineAsyncComponent as b, defineComponent as g, shallowRef as m, ref as d, createVNode as o, resolveComponent as a, isVNode as k } from "vue";
import { ElTabs as x, ElTabPane as h, ElButton as N } from "element-plus";
import { useResolveVnode as R } from "@klweb/compose-app-engine";
import { k as v, A as u } from "./main-Blxobku2.js";
const _ = b({
  loader: () => import("./BasicsCompRep-DjZWvE8v.js"),
  loadingComponent: v
}), T = b({
  loader: () => import("./BusinessCompRep-yS4xhIf7.js"),
  loadingComponent: v
}), i = {
  "comp-rep-container": "_comp-rep-container_yvnth_1",
  "comp-rep__content": "_comp-rep__content_yvnth_7",
  "comp-grid-container": "_comp-grid-container_yvnth_14",
  "filter-text": "_filter-text_yvnth_65"
};
function j(l) {
  return typeof l == "function" || Object.prototype.toString.call(l) === "[object Object]" && !k(l);
}
const E = /* @__PURE__ */ g({
  name: "KlCompRepository",
  components: {
    ElTabs: x,
    ElTabPane: h,
    ElButton: N
  },
  emits: ["close"],
  setup(l, {
    emit: p
  }) {
    const c = m(_), s = d("basics"), r = m([{
      label: "基础组件",
      name: "basics",
      component: _
    }, {
      label: "业务组件",
      name: "business",
      component: T
    }]), t = d(null), f = (n) => {
      const {
        paneName: e,
        index: y
      } = n;
      s.value = e, c.value = r.value[y].component, t.value = null;
    }, C = () => {
      var n;
      (n = t.value) == null || delete n.imgUrl, p("close", t.value);
    };
    return () => {
      let n;
      return o("div", {
        class: "dialog-component"
      }, [o("section", {
        class: "dialog-component__body"
      }, [o("section", {
        class: i["comp-rep-container"]
      }, [o(a("el-tabs"), {
        class: i["kl-editor-setter-tabs"],
        modelValue: s.value,
        "onUpdate:modelValue": (e) => s.value = e,
        type: "card",
        onTabClick: (e) => f(e)
      }, j(n = r.value.map((e) => o(a("el-tab-pane"), {
        label: e.label,
        name: e.name
      }, null))) ? n : {
        default: () => [n]
      }), o("section", {
        class: i["comp-rep__content"]
      }, [c.value && R(c.value, {
        onHandleNodeClick: (e) => {
          t.value = e;
        }
      })])])]), o("section", {
        class: "dialog-component__footer"
      }, [o(a("el-button"), {
        onClick: () => p("close")
      }, {
        default: () => [u.CANCEL]
      }), o(a("el-button"), {
        type: "primary",
        disabled: !t.value,
        onClick: C
      }, {
        default: () => [u.COMFIRM]
      })])]);
    };
  }
}), S = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  default: E
}, Symbol.toStringTag, { value: "Module" }));
export {
  i as C,
  S as i
};
