import m from "../../../../tiny-invariant@1.3.3/node_modules/tiny-invariant/dist/esm/tiny-invariant.js";
var f = function(t) {
  var o = t.top, r = t.right, i = t.bottom, e = t.left, a = r - e, g = i - o, p = {
    top: o,
    right: r,
    bottom: i,
    left: e,
    width: a,
    height: g,
    x: e,
    y: o,
    center: {
      x: (r + e) / 2,
      y: (i + o) / 2
    }
  };
  return p;
}, l = function(t, o) {
  return {
    top: t.top - o.top,
    left: t.left - o.left,
    bottom: t.bottom + o.bottom,
    right: t.right + o.right
  };
}, u = function(t, o) {
  return {
    top: t.top + o.top,
    left: t.left + o.left,
    bottom: t.bottom - o.bottom,
    right: t.right - o.right
  };
}, B = function(t, o) {
  return {
    top: t.top + o.y,
    left: t.left + o.x,
    bottom: t.bottom + o.y,
    right: t.right + o.x
  };
}, v = {
  top: 0,
  right: 0,
  bottom: 0,
  left: 0
}, c = function(t) {
  var o = t.borderBox, r = t.margin, i = r === void 0 ? v : r, e = t.border, a = e === void 0 ? v : e, g = t.padding, p = g === void 0 ? v : g, h = f(l(o, i)), b = f(u(o, a)), x = f(u(b, p));
  return {
    marginBox: h,
    borderBox: f(o),
    paddingBox: b,
    contentBox: x,
    margin: i,
    border: a,
    padding: p
  };
}, n = function(t) {
  var o = t.slice(0, -2), r = t.slice(-2);
  if (r !== "px")
    return 0;
  var i = Number(o);
  return isNaN(i) && (process.env.NODE_ENV !== "production" ? m(!1, "Could not parse value [raw: " + t + ", without suffix: " + o + "]") : m()), i;
}, w = function() {
  return {
    x: window.pageXOffset,
    y: window.pageYOffset
  };
}, R = function(t, o) {
  var r = t.borderBox, i = t.border, e = t.margin, a = t.padding, g = B(r, o);
  return c({
    borderBox: g,
    border: i,
    margin: e,
    padding: a
  });
}, N = function(t, o) {
  return o === void 0 && (o = w()), R(t, o);
}, S = function(t, o) {
  var r = {
    top: n(o.marginTop),
    right: n(o.marginRight),
    bottom: n(o.marginBottom),
    left: n(o.marginLeft)
  }, i = {
    top: n(o.paddingTop),
    right: n(o.paddingRight),
    bottom: n(o.paddingBottom),
    left: n(o.paddingLeft)
  }, e = {
    top: n(o.borderTopWidth),
    right: n(o.borderRightWidth),
    bottom: n(o.borderBottomWidth),
    left: n(o.borderLeftWidth)
  };
  return c({
    borderBox: t,
    margin: r,
    padding: i,
    border: e
  });
}, C = function(t) {
  var o = t.getBoundingClientRect(), r = window.getComputedStyle(t);
  return S(o, r);
};
export {
  S as calculateBox,
  c as createBox,
  l as expand,
  C as getBox,
  f as getRect,
  R as offset,
  u as shrink,
  N as withScroll
};
//# sourceMappingURL=css-box-model.esm.js.map
