import _SetCache_default from "./_SetCache.js";
import _arraySome_default from "./_arraySome.js";
import _cacheHas_default from "./_cacheHas.js";
var COMPARE_PARTIAL_FLAG = 1, COMPARE_UNORDERED_FLAG = 2;
function equalArrays(a, o, s, c, l, u) {
	var d = s & COMPARE_PARTIAL_FLAG, f = a.length, p = o.length;
	if (f != p && !(d && p > f)) return !1;
	var m = u.get(a), h = u.get(o);
	if (m && h) return m == o && h == a;
	var g = -1, _ = !0, v = s & COMPARE_UNORDERED_FLAG ? new _SetCache_default() : void 0;
	for (u.set(a, o), u.set(o, a); ++g < f;) {
		var y = a[g], b = o[g];
		if (c) var x = d ? c(b, y, g, o, a, u) : c(y, b, g, a, o, u);
		if (x !== void 0) {
			if (x) continue;
			_ = !1;
			break;
		}
		if (v) {
			if (!_arraySome_default(o, function(e, i) {
				if (!_cacheHas_default(v, i) && (y === e || l(y, e, s, c, u))) return v.push(i);
			})) {
				_ = !1;
				break;
			}
		} else if (!(y === b || l(y, b, s, c, u))) {
			_ = !1;
			break;
		}
	}
	return u.delete(a), u.delete(o), _;
}
var _equalArrays_default = equalArrays;
export { _equalArrays_default as default };
