import { useSlots as f, ref as x, computed as I, watch as y } from "vue";
const A = (t) => {
  const d = f(), s = x([]), u = I(() => {
    if (t.columns) {
      const r = t.columns.filter((n) => !n.hideInTable), e = [];
      return r.forEach((n) => {
        const c = Array.isArray(n.dataIndex) ? n.dataIndex.join("") : n.dataIndex;
        if (s.value.includes(c)) {
          const a = { ...n };
          a.isRender && (a.isRender = !1, a.render = ({ row: l, $index: i }) => {
            const o = Array.isArray(n.dataIndex) ? n.dataIndex.join() : n.dataIndex;
            return d[o] && d[o]({ row: l, $index: i });
          }), e.push(a);
        }
      }), e;
    } else
      return [];
  });
  return y(() => t.columns, (r) => {
    r && (s.value = r.map((e) => Array.isArray(e.dataIndex) ? e.dataIndex.join("") : e.dataIndex));
  }, {
    immediate: !0,
    deep: !0
  }), {
    columnsControl: s,
    columns: u
  };
};
export {
  A as default
};
