import { isArray as p, forEach as o } from "../../../min-dash/dist/index.esm.mjs";
function g(i, d) {
  d = !!d, p(i) || (i = [i]);
  var n, r, t, a;
  return o(i, function(h) {
    var f = h;
    h.waypoints && !d && (f = g(h.waypoints, true));
    var o2 = f.x, u = f.y, x = f.height || 0, y = f.width || 0;
    (o2 < n || n === void 0) && (n = o2), (u < r || r === void 0) && (r = u), (o2 + y > t || t === void 0) && (t = o2 + y), (u + x > a || a === void 0) && (a = u + x);
  }), {
    x: n,
    y: r,
    height: a - r,
    width: t - n
  };
}
function e(i) {
  return "waypoints" in i ? "connection" : "x" in i ? "shape" : "root";
}
function v(i) {
  return !!(i && i.isFrame);
}
export {
  g as getBBox,
  e as getType,
  v as isFrameElement
};
