import { noop as c, identity as m } from "../../common.js";
import { sameValue as f } from "../../value/compare.js";
import { isFunction as s } from "../../value/is.js";
const y = (() => {
  const n = /* @__PURE__ */ new Set(), i = (a, t, o, r) => {
    let e = r?.[o];
    return e = s(e) ? e : m, !f(e(a[o]), e(t[o]));
  };
  return Object.defineProperty(((a) => (t, o) => {
    try {
      for (const r in t)
        if (n.add(r), i(t, o, r, a)) return !1;
      for (const r in o)
        if (!n.has(r) && (n.add(r), i(t, o, r, a)))
          return !1;
      return !0;
    } finally {
      n.clear();
    }
  }), "exclude", { value: c });
})();
export {
  y as memoComparator
};
