"use strict";
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
const _SetCache = require("./_SetCache.js");
const _arrayIncludes = require("./_arrayIncludes.js");
const _cacheHas = require("./_cacheHas.js");
const _createSet = require("./_createSet.js");
const _setToArray = require("./_setToArray.js");
var LARGE_ARRAY_SIZE = 200;
function baseUniq(array, iteratee, comparator) {
  var index = -1, includes = _arrayIncludes.default, length = array.length, isCommon = true, result = [], seen = result;
  if (length >= LARGE_ARRAY_SIZE) {
    var set = _createSet.default(array);
    if (set) {
      return _setToArray.default(set);
    }
    isCommon = false;
    includes = _cacheHas.default;
    seen = new _SetCache.default();
  } else {
    seen = result;
  }
  outer:
    while (++index < length) {
      var value = array[index], computed = value;
      value = value !== 0 ? value : 0;
      if (isCommon && computed === computed) {
        var seenIndex = seen.length;
        while (seenIndex--) {
          if (seen[seenIndex] === computed) {
            continue outer;
          }
        }
        result.push(value);
      } else if (!includes(seen, computed, comparator)) {
        if (seen !== result) {
          seen.push(computed);
        }
        result.push(value);
      }
    }
  return result;
}
exports.default = baseUniq;
