import D from "./_SetCache.js";
import G from "./_arraySome.js";
import M from "./_cacheHas.js";
var x = 1, F = 2;
function U(n, e, A, d, p, f) {
  var E = A & x, R = n.length, P = e.length;
  if (R != P && !(E && P > R))
    return !1;
  var S = f.get(n), _ = f.get(e);
  if (S && _)
    return S == e && _ == n;
  var v = -1, g = !0, l = A & F ? new D() : void 0;
  for (f.set(n, e), f.set(e, n); ++v < R; ) {
    var i = n[v], L = e[v];
    if (d)
      var C = E ? d(L, i, v, e, n, f) : d(i, L, v, n, e, f);
    if (C !== void 0) {
      if (C)
        continue;
      g = !1;
      break;
    }
    if (l) {
      if (!G(e, function(O, w) {
        if (!M(l, w) && (i === O || p(i, O, A, d, f)))
          return l.push(w);
      })) {
        g = !1;
        break;
      }
    } else if (!(i === L || p(i, L, A, d, f))) {
      g = !1;
      break;
    }
  }
  return f.delete(n), f.delete(e), g;
}
export {
  U as default
};
//# sourceMappingURL=_equalArrays.js.map
