import { defineComponent as v, ref as c, openBlock as o, createElementBlock as u, normalizeClass as r, unref as n, createVNode as m, withCtx as f, createBlock as k, createCommentVNode as i } from "vue";
import y from "vuedraggable";
import "../../../../config-provider/index.mjs";
import "./item.vue.mjs";
import { useNamespace as V } from "../../../../config-provider/hooks/use-namespace.mjs";
import d from "./item.vue2.mjs";
const U = /* @__PURE__ */ v({
  __name: "index",
  props: {
    value: {},
    "onUpdate:value": { type: Function }
  },
  setup(l) {
    const { b: s, is: p } = V("ap-column-setting-sortable-item"), a = c(!1);
    return (g, t) => (o(), u("div", {
      class: r(n(s)())
    }, [
      m(d, {
        open: a.value,
        "onUpdate:open": t[0] || (t[0] = (e) => a.value = e),
        value: l.value
      }, null, 8, ["open", "value"]),
      l.value.children?.length ? (o(), u("div", {
        key: 0,
        class: r(n(p)("hidden", a.value))
      }, [
        m(n(y), {
          modelValue: l.value.children,
          "onUpdate:modelValue": t[1] || (t[1] = (e) => l.value.children = e),
          "item-key": "key"
        }, {
          item: f(({ element: e }) => [
            e.show ? (o(), k(d, {
              key: 0,
              value: e,
              level: 2
            }, null, 8, ["value"])) : i("", !0)
          ]),
          _: 1
        }, 8, ["modelValue"])
      ], 2)) : i("", !0)
    ], 2));
  }
});
export {
  U as default
};
