import { constructFrom as M } from "./constructFrom.js";
import { getDaysInMonth as f } from "./getDaysInMonth.js";
import { toDate as h } from "./toDate.js";
function y(a, n, t) {
  const e = h(a, t == null ? void 0 : t.in), c = e.getFullYear(), m = e.getDate(), r = M((t == null ? void 0 : t.in) || a, 0);
  r.setFullYear(c, n, 15), r.setHours(0, 0, 0, 0);
  const u = f(r);
  return e.setMonth(n, Math.min(m, u)), e;
}
export {
  y as default,
  y as setMonth
};
