"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const _arrayPush = require("./_arrayPush.js");
const _isFlattenable = require("./_isFlattenable.js");
var arrayPush = _arrayPush._arrayPush, isFlattenable = _isFlattenable._isFlattenable;
function baseFlatten(array, depth, predicate, isStrict, result) {
  var index = -1, length = array.length;
  predicate || (predicate = isFlattenable);
  result || (result = []);
  while (++index < length) {
    var value = array[index];
    if (depth > 0 && predicate(value)) {
      if (depth > 1) {
        baseFlatten(value, depth - 1, predicate, isStrict, result);
      } else {
        arrayPush(result, value);
      }
    } else if (!isStrict) {
      result[result.length] = value;
    }
  }
  return result;
}
var _baseFlatten = baseFlatten;
exports._baseFlatten = _baseFlatten;
