var i = Object.defineProperty;
var n = (e, r) => i(e, "name", { value: r, configurable: !0 });
import { length as s, hasProperty as l } from "./object.js";
const u = /* @__PURE__ */ n((e, r) => e === r, "equalityStrict"), f = /* @__PURE__ */ n((e, r) => {
  if (e == null || r == null)
    return u(e, r);
  if (e.constructor !== r.constructor)
    return !1;
  if (e === r)
    return !0;
  switch (e.constructor) {
    case ArrayBuffer:
      e = new Uint8Array(e), r = new Uint8Array(r);
    case Uint8Array: {
      if (e.byteLength !== r.byteLength)
        return !1;
      for (let t = 0; t < e.length; t++)
        if (e[t] !== r[t])
          return !1;
      break;
    }
    case Set: {
      if (e.size !== r.size)
        return !1;
      for (const t of e)
        if (!r.has(t))
          return !1;
      break;
    }
    case Map: {
      if (e.size !== r.size)
        return !1;
      for (const t of e.keys())
        if (!r.has(t) || !f(e.get(t), r.get(t)))
          return !1;
      break;
    }
    case Object:
      if (s(e) !== s(r))
        return !1;
      for (const t in e)
        if (!l(e, t) || !f(e[t], r[t]))
          return !1;
      break;
    case Array:
      if (e.length !== r.length)
        return !1;
      for (let t = 0; t < e.length; t++)
        if (!f(e[t], r[t]))
          return !1;
      break;
    default:
      return !1;
  }
  return !0;
}, "equalityDeep");
export {
  f as equalityDeep,
  u as equalityStrict
};
