import { normalizeInterval as n } from "./_lib/normalizeInterval.js";
import { addQuarters as s } from "./addQuarters.js";
import { constructFrom as v } from "./constructFrom.js";
import { startOfQuarter as f } from "./startOfQuarter.js";
function O(l, r) {
  const { start: a, end: u } = n(r == null ? void 0 : r.in, l);
  let e = +a > +u;
  const c = e ? +f(a) : +f(u);
  let m = e ? f(u) : f(a), t = (r == null ? void 0 : r.step) ?? 1;
  if (!t)
    return [];
  t < 0 && (t = -t, e = !e);
  const d = [];
  for (; +m <= c; )
    d.push(v(a, m)), m = s(m, t);
  return e ? d.reverse() : d;
}
export {
  O as default,
  O as eachQuarterOfInterval
};
