import d from "../../../@babel/runtime/helpers/esm/objectSpread2.mjs";
import { useMemo as m } from "react";
var h = {
  width: 0,
  height: 0,
  left: 0,
  top: 0
};
function w(r, f, i) {
  return m(function() {
    for (var e, v = /* @__PURE__ */ new Map(), g = f.get((e = r[0]) === null || e === void 0 ? void 0 : e.key) || h, p = g.left + g.width, o = 0; o < r.length; o += 1) {
      var n = r[o].key, u = f.get(n);
      if (!u) {
        var l;
        u = f.get((l = r[o - 1]) === null || l === void 0 ? void 0 : l.key) || h;
      }
      var t = v.get(n) || d({}, u);
      t.right = p - t.left - t.width, v.set(n, t);
    }
    return v;
  }, [r.map(function(e) {
    return e.key;
  }).join("_"), f, i]);
}
export {
  w as default
};
