import { top as u, right as v, bottom as g, left as b } from "../enums.js";
import o from "../utils/detectOverflow.js";
function s(r, e, t) {
  return t === void 0 && (t = {
    x: 0,
    y: 0
  }), {
    top: r.top - e.height - t.y,
    right: r.right - e.width + t.x,
    bottom: r.bottom - e.height + t.y,
    left: r.left - e.width - t.x
  };
}
function f(r) {
  return [u, v, g, b].some(function(e) {
    return r[e] >= 0;
  });
}
function O(r) {
  var e = r.state, t = r.name, c = e.rects.reference, d = e.rects.popper, h = e.modifiersData.preventOverflow, l = o(e, {
    elementContext: "reference"
  }), m = o(e, {
    altBoundary: !0
  }), p = s(l, c), i = s(m, d, h), a = f(p), n = f(i);
  e.modifiersData[t] = {
    referenceClippingOffsets: p,
    popperEscapeOffsets: i,
    isReferenceHidden: a,
    hasPopperEscaped: n
  }, e.attributes.popper = Object.assign({}, e.attributes.popper, {
    "data-popper-reference-hidden": a,
    "data-popper-escaped": n
  });
}
const E = {
  name: "hide",
  enabled: !0,
  phase: "main",
  requiresIfExists: ["preventOverflow"],
  fn: O
};
export {
  E as default
};
//# sourceMappingURL=hide.js.map
