"use strict";
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
const _Stack = require("./_Stack3.cjs");
const _equalArrays = require("./_equalArrays3.cjs");
const _equalByTag = require("./_equalByTag3.cjs");
const _equalObjects = require("./_equalObjects3.cjs");
const _getTag = require("./_getTag3.cjs");
const isArray = require("./isArray3.cjs");
const isBuffer = require("./isBuffer3.cjs");
const isTypedArray = require("./isTypedArray3.cjs");
var COMPARE_PARTIAL_FLAG = 1;
var argsTag = "[object Arguments]", arrayTag = "[object Array]", objectTag = "[object Object]";
var objectProto = Object.prototype;
var hasOwnProperty = objectProto.hasOwnProperty;
function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
  var objIsArr = isArray.default(object), othIsArr = isArray.default(other), objTag = objIsArr ? arrayTag : _getTag.default(object), othTag = othIsArr ? arrayTag : _getTag.default(other);
  objTag = objTag == argsTag ? objectTag : objTag;
  othTag = othTag == argsTag ? objectTag : othTag;
  var objIsObj = objTag == objectTag, othIsObj = othTag == objectTag, isSameTag = objTag == othTag;
  if (isSameTag && isBuffer.default(object)) {
    if (!isBuffer.default(other)) {
      return false;
    }
    objIsArr = true;
    objIsObj = false;
  }
  if (isSameTag && !objIsObj) {
    stack || (stack = new _Stack.default());
    return objIsArr || isTypedArray.default(object) ? _equalArrays.default(object, other, bitmask, customizer, equalFunc, stack) : _equalByTag.default(object, other, objTag, bitmask, customizer, equalFunc, stack);
  }
  if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
    var objIsWrapped = objIsObj && hasOwnProperty.call(object, "__wrapped__"), othIsWrapped = othIsObj && hasOwnProperty.call(other, "__wrapped__");
    if (objIsWrapped || othIsWrapped) {
      var objUnwrapped = objIsWrapped ? object.value() : object, othUnwrapped = othIsWrapped ? other.value() : other;
      stack || (stack = new _Stack.default());
      return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
    }
  }
  if (!isSameTag) {
    return false;
  }
  stack || (stack = new _Stack.default());
  return _equalObjects.default(object, other, bitmask, customizer, equalFunc, stack);
}
exports.default = baseIsEqualDeep;
//# sourceMappingURL=_baseIsEqualDeep3.cjs.map
