"use client";
import { defaultDateLib as A } from "../classes/DateLib.js";
import { rangeIncludesDate as p } from "./rangeIncludesDate.js";
import { isDatesArray as a, isDateRange as I, isDayOfWeekType as g, isDateInterval as k, isDateAfterType as O, isDateBeforeType as W } from "./typeguards.js";
function T(f, n, r = A) {
  const u = Array.isArray(n) ? n : [n], { isSameDay: y, differenceInCalendarDays: i, isAfter: t } = r;
  return u.some((e) => {
    if (typeof e == "boolean")
      return e;
    if (r.isDate(e))
      return y(f, e);
    if (a(e, r))
      return e.includes(f);
    if (I(e))
      return p(e, f, !1, r);
    if (g(e))
      return Array.isArray(e.dayOfWeek) ? e.dayOfWeek.includes(f.getDay()) : e.dayOfWeek === f.getDay();
    if (k(e)) {
      const l = i(e.before, f), D = i(e.after, f), s = l > 0, o = D < 0;
      return t(e.before, e.after) ? o && s : s || o;
    }
    return O(e) ? i(f, e.after) > 0 : W(e) ? i(e.before, f) > 0 : typeof e == "function" ? e(f) : !1;
  });
}
export {
  T as dateMatchModifiers
};
