import _baseUnary_default from "./_baseUnary.js";
import _arrayMap_default from "./_arrayMap.js";
import _arrayIncludes_default from "./_arrayIncludes.js";
import _SetCache_default from "./_SetCache.js";
import _cacheHas_default from "./_cacheHas.js";
import _arrayIncludesWith_default from "./_arrayIncludesWith.js";
var LARGE_ARRAY_SIZE = 200;
function baseDifference(s, c, l, u) {
	var d = -1, f = _arrayIncludes_default, p = !0, m = s.length, h = [], g = c.length;
	if (!m) return h;
	l && (c = _arrayMap_default(c, _baseUnary_default(l))), u ? (f = _arrayIncludesWith_default, p = !1) : c.length >= LARGE_ARRAY_SIZE && (f = _cacheHas_default, p = !1, c = new _SetCache_default(c));
	outer: for (; ++d < m;) {
		var _ = s[d], v = l == null ? _ : l(_);
		if (_ = u || _ !== 0 ? _ : 0, p && v === v) {
			for (var y = g; y--;) if (c[y] === v) continue outer;
			h.push(_);
		} else f(c, v, u) || h.push(_);
	}
	return h;
}
var _baseDifference_default = baseDifference;
export { _baseDifference_default as default };
