import { CSS_VARS as i } from "../constants.js";
import { getOwnerDomContext as u, getCssVar as a } from "./helpers.js";
function d(r) {
  const { ownerDoc: o } = u(r), n = a(i.GRID_GUTTER, o), e = isNaN(parseFloat(n)) ? 0 : parseFloat(n), t = r == null ? void 0 : r.getBoundingClientRect();
  if (t)
    return Math.round(t.left) < e ? {
      value: e - Math.round(t.left),
      side: "left"
    } : Math.round(t.right) > o.documentElement.clientWidth - e ? {
      value: Math.round(t.right) - (o.documentElement.clientWidth - e),
      side: "right"
    } : {
      side: "",
      value: 0
    };
}
export {
  d as default
};
//# sourceMappingURL=calculateElementOverflow.js.map
