import { cloneDeepWith as f, isArray as l, omit as c, isEqualWith as a } from "lodash-unified";
import { isVNode as u } from "vue";
import { getTableTitle as s } from "../../utils.mjs";
function d(e, n) {
  const r = [];
  for (const t of n) {
    const i = e.find((o) => o.key === t.key);
    if (t.children?.length) {
      const o = d(
        i.children,
        t.children
      );
      o.length && r.push({
        ...i,
        fixed: t.fixed,
        children: o
      });
    } else {
      if (!t.show)
        continue;
      r.push({ ...i, fixed: t.fixed });
    }
  }
  return r;
}
function p(e) {
  return f(e, (n, r) => {
    if (r === "label")
      return n;
  });
}
function b(e, n) {
  const r = e.title, t = l(r) ? r[0] : r;
  return u(t) ? t : s(
    e,
    n?.className || "",
    void 0,
    n?.color
  );
}
function y(e) {
  return u(e) ? e : l(e) ? e[0] : e;
}
function C(e) {
  function n(r) {
    const t = {};
    return r.forEach((i, o) => {
      t[i.key] = {
        ...c(i, ["label", "key", "children"]),
        order: o,
        children: i.children?.length ? n(i.children) : void 0
      };
    }), t;
  }
  return n(e);
}
function S(e, n) {
  return a(e, n, (r, t, i) => {
    if (i === "label")
      return !0;
  });
}
export {
  p as customCloneColumnStates,
  d as default,
  C as getColumnStateString,
  b as getLabelNode,
  y as getLabelRenderNode,
  S as isEqualColumnStateIgnoreLabel
};
