import arrayMap from "./_arrayMap.mjs";
import baseClone from "./_baseClone.mjs";
import baseUnset from "./_baseUnset.mjs";
import castPath from "./_castPath.mjs";
import copyObject from "./_copyObject.mjs";
import customOmitClone from "./_customOmitClone.mjs";
import flatRest from "./_flatRest.mjs";
import getAllKeysIn from "./_getAllKeysIn.mjs";
var CLONE_DEEP_FLAG = 1, CLONE_FLAT_FLAG = 2, CLONE_SYMBOLS_FLAG = 4;
var omit = flatRest(function(object, paths) {
  var result = {};
  if (object == null) {
    return result;
  }
  var isDeep = false;
  paths = arrayMap(paths, function(path) {
    path = castPath(path, object);
    isDeep || (isDeep = path.length > 1);
    return path;
  });
  copyObject(object, getAllKeysIn(object), result);
  if (isDeep) {
    result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);
  }
  var length = paths.length;
  while (length--) {
    baseUnset(result, paths[length]);
  }
  return result;
});
export {
  omit as default
};
