import { computed as c } from "vue";
function d(o, t) {
  var u;
  const e = /* @__PURE__ */ new Map();
  if (!o)
    return {
      grouped: e,
      rest: [],
      ordered: []
    };
  for (const s of o) {
    const r = s[t];
    r !== void 0 && r !== null && (e.has(r) || e.set(r, []), (u = e.get(r)) == null || u.push(s));
  }
  const n = o.filter((s) => {
    const r = s[t];
    return r == null;
  }), f = [...Array.from(e.values()).flat(), ...n];
  return {
    grouped: e,
    rest: n,
    ordered: f
  };
}
function l(o, t) {
  const e = c(() => d(o.value, t)), n = c(() => e.value.ordered), f = c(() => e.value.grouped), u = c(() => e.value.rest);
  return {
    orderedRef: n,
    groupsRef: f,
    restRef: u
  };
}
export {
  l as useGroupBy
};
//# sourceMappingURL=useGroupBy.js.map
