import { addMonths as w, subMonths as Y } from "date-fns";
function f(n, t) {
  if (!n && !t)
    return /* @__PURE__ */ new Date();
  const e = /* @__PURE__ */ new Date(), a = e.getMonth(), h = e.getFullYear(), o = w(e, 1), r = (s) => {
    const u = s.getMonth(), c = s.getFullYear(), i = u === a && c === h, l = u === o.getMonth() && c === o.getFullYear();
    return i || l;
  }, M = n ? r(n) : !0, g = t ? r(t) : !0;
  return M && g ? /* @__PURE__ */ new Date() : Y(t || n || /* @__PURE__ */ new Date(), 1);
}
export {
  f as default
};
//# sourceMappingURL=getDefaultMonth.js.map
