{"version":3,"file":"calendar-CGpAU3KL.mjs","sources":["../../node_modules/@date-fns/tz/tzOffset/index.js","../../node_modules/@date-fns/tz/date/mini.js","../../node_modules/@date-fns/tz/date/index.js","../../node_modules/react-day-picker/dist/esm/UI.js","../../node_modules/date-fns/constants.js","../../node_modules/date-fns/constructFrom.js","../../node_modules/date-fns/toDate.js","../../node_modules/date-fns/addDays.js","../../node_modules/date-fns/addMonths.js","../../node_modules/date-fns/_lib/defaultOptions.js","../../node_modules/date-fns/startOfWeek.js","../../node_modules/date-fns/startOfISOWeek.js","../../node_modules/date-fns/getISOWeekYear.js","../../node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.js","../../node_modules/date-fns/_lib/normalizeDates.js","../../node_modules/date-fns/startOfDay.js","../../node_modules/date-fns/differenceInCalendarDays.js","../../node_modules/date-fns/isDate.js","../../node_modules/date-fns/eachMonthOfInterval.js","../../node_modules/date-fns/_lib/normalizeInterval.js","../../node_modules/date-fns/startOfYear.js","../../node_modules/date-fns/endOfWeek.js","../../node_modules/date-fns/locale/en-US/_lib/formatDistance.js","../../node_modules/date-fns/locale/_lib/buildFormatLongFn.js","../../node_modules/date-fns/locale/en-US/_lib/formatLong.js","../../node_modules/date-fns/locale/en-US/_lib/formatRelative.js","../../node_modules/date-fns/locale/_lib/buildLocalizeFn.js","../../node_modules/date-fns/locale/_lib/buildMatchFn.js","../../node_modules/date-fns/locale/_lib/buildMatchPatternFn.js","../../node_modules/date-fns/locale/en-US/_lib/match.js","../../node_modules/date-fns/locale/en-US.js","../../node_modules/date-fns/locale/en-US/_lib/localize.js","../../node_modules/date-fns/getISOWeek.js","../../node_modules/date-fns/startOfISOWeekYear.js","../../node_modules/date-fns/getWeekYear.js","../../node_modules/date-fns/getWeek.js","../../node_modules/date-fns/startOfWeekYear.js","../../node_modules/date-fns/_lib/addLeadingZeros.js","../../node_modules/date-fns/_lib/format/lightFormatters.js","../../node_modules/date-fns/_lib/format/formatters.js","../../node_modules/date-fns/getDayOfYear.js","../../node_modules/date-fns/_lib/format/longFormatters.js","../../node_modules/date-fns/_lib/protectedTokens.js","../../node_modules/date-fns/format.js","../../node_modules/date-fns/isValid.js","../../node_modules/date-fns/setMonth.js","../../node_modules/date-fns/getDaysInMonth.js","../../node_modules/react-day-picker/dist/esm/helpers/startOfBroadcastWeek.js","../../node_modules/react-day-picker/dist/esm/classes/DateLib.js","../../node_modules/date-fns/addWeeks.js","../../node_modules/date-fns/addYears.js","../../node_modules/date-fns/differenceInCalendarMonths.js","../../node_modules/react-day-picker/dist/esm/helpers/endOfBroadcastWeek.js","../../node_modules/react-day-picker/dist/esm/helpers/getBroadcastWeeksInMonth.js","../../node_modules/date-fns/endOfISOWeek.js","../../node_modules/date-fns/endOfMonth.js","../../node_modules/date-fns/endOfYear.js","../../node_modules/date-fns/getMonth.js","../../node_modules/date-fns/getYear.js","../../node_modules/date-fns/isAfter.js","../../node_modules/date-fns/isBefore.js","../../node_modules/date-fns/isSameDay.js","../../node_modules/date-fns/isSameMonth.js","../../node_modules/date-fns/isSameYear.js","../../node_modules/date-fns/max.js","../../node_modules/date-fns/min.js","../../node_modules/date-fns/setYear.js","../../node_modules/date-fns/startOfMonth.js","../../node_modules/react-day-picker/dist/esm/classes/CalendarDay.js","../../node_modules/react-day-picker/dist/esm/classes/CalendarMonth.js","../../node_modules/react-day-picker/dist/esm/classes/CalendarWeek.js","../../node_modules/react-day-picker/dist/esm/utils/rangeIncludesDate.js","../../node_modules/react-day-picker/dist/esm/utils/typeguards.js","../../node_modules/react-day-picker/dist/esm/utils/dateMatchModifiers.js","../../node_modules/react-day-picker/dist/esm/useDayPicker.js","../../node_modules/react-day-picker/dist/esm/components/Button.js","../../node_modules/react-day-picker/dist/esm/components/CaptionLabel.js","../../node_modules/react-day-picker/dist/esm/components/Chevron.js","../../node_modules/react-day-picker/dist/esm/components/Day.js","../../node_modules/react-day-picker/dist/esm/components/DayButton.js","../../node_modules/react-day-picker/dist/esm/components/Dropdown.js","../../node_modules/react-day-picker/dist/esm/components/DropdownNav.js","../../node_modules/react-day-picker/dist/esm/components/Footer.js","../../node_modules/react-day-picker/dist/esm/components/Month.js","../../node_modules/react-day-picker/dist/esm/components/MonthCaption.js","../../node_modules/react-day-picker/dist/esm/components/MonthGrid.js","../../node_modules/react-day-picker/dist/esm/components/Months.js","../../node_modules/react-day-picker/dist/esm/components/MonthsDropdown.js","../../node_modules/react-day-picker/dist/esm/components/Nav.js","../../node_modules/react-day-picker/dist/esm/components/NextMonthButton.js","../../node_modules/react-day-picker/dist/esm/components/Option.js","../../node_modules/react-day-picker/dist/esm/components/PreviousMonthButton.js","../../node_modules/react-day-picker/dist/esm/components/Root.js","../../node_modules/react-day-picker/dist/esm/components/Select.js","../../node_modules/react-day-picker/dist/esm/components/Week.js","../../node_modules/react-day-picker/dist/esm/components/WeekNumber.js","../../node_modules/react-day-picker/dist/esm/components/WeekNumberHeader.js","../../node_modules/react-day-picker/dist/esm/components/Weekday.js","../../node_modules/react-day-picker/dist/esm/components/Weekdays.js","../../node_modules/react-day-picker/dist/esm/components/Weeks.js","../../node_modules/react-day-picker/dist/esm/components/YearsDropdown.js","../../node_modules/react-day-picker/dist/esm/helpers/getComponents.js","../../node_modules/react-day-picker/dist/esm/helpers/getDefaultClassNames.js","../../node_modules/react-day-picker/dist/esm/formatters/formatCaption.js","../../node_modules/react-day-picker/dist/esm/formatters/formatYearDropdown.js","../../node_modules/react-day-picker/dist/esm/formatters/formatDay.js","../../node_modules/react-day-picker/dist/esm/formatters/formatMonthDropdown.js","../../node_modules/react-day-picker/dist/esm/formatters/formatWeekNumber.js","../../node_modules/react-day-picker/dist/esm/formatters/formatWeekNumberHeader.js","../../node_modules/react-day-picker/dist/esm/formatters/formatWeekdayName.js","../../node_modules/react-day-picker/dist/esm/labels/labelGrid.js","../../node_modules/react-day-picker/dist/esm/labels/labelDayButton.js","../../node_modules/react-day-picker/dist/esm/labels/labelGridcell.js","../../node_modules/react-day-picker/dist/esm/labels/labelMonthDropdown.js","../../node_modules/react-day-picker/dist/esm/labels/labelNav.js","../../node_modules/react-day-picker/dist/esm/labels/labelNext.js","../../node_modules/react-day-picker/dist/esm/labels/labelPrevious.js","../../node_modules/react-day-picker/dist/esm/labels/labelWeekNumber.js","../../node_modules/react-day-picker/dist/esm/labels/labelWeekNumberHeader.js","../../node_modules/react-day-picker/dist/esm/labels/labelWeekday.js","../../node_modules/react-day-picker/dist/esm/labels/labelYearDropdown.js","../../node_modules/react-day-picker/dist/esm/useAnimation.js","../../node_modules/react-day-picker/dist/esm/helpers/getInitialMonth.js","../../node_modules/react-day-picker/dist/esm/helpers/useControlledValue.js","../../node_modules/react-day-picker/dist/esm/useCalendar.js","../../node_modules/react-day-picker/dist/esm/helpers/getNavMonth.js","../../node_modules/react-day-picker/dist/esm/helpers/getDisplayMonths.js","../../node_modules/react-day-picker/dist/esm/helpers/getDates.js","../../node_modules/react-day-picker/dist/esm/helpers/getMonths.js","../../node_modules/react-day-picker/dist/esm/helpers/getWeeks.js","../../node_modules/react-day-picker/dist/esm/helpers/getDays.js","../../node_modules/react-day-picker/dist/esm/helpers/getPreviousMonth.js","../../node_modules/react-day-picker/dist/esm/helpers/getNextMonth.js","../../node_modules/react-day-picker/dist/esm/helpers/calculateFocusTarget.js","../../node_modules/react-day-picker/dist/esm/helpers/getNextFocus.js","../../node_modules/react-day-picker/dist/esm/helpers/getFocusableDate.js","../../node_modules/react-day-picker/dist/esm/useFocus.js","../../node_modules/react-day-picker/dist/esm/utils/rangeOverlaps.js","../../node_modules/react-day-picker/dist/esm/utils/rangeContainsModifiers.js","../../node_modules/react-day-picker/dist/esm/utils/rangeContainsDayOfWeek.js","../../node_modules/react-day-picker/dist/esm/selection/useRange.js","../../node_modules/react-day-picker/dist/esm/utils/addToRange.js","../../node_modules/react-day-picker/dist/esm/useSelection.js","../../node_modules/react-day-picker/dist/esm/selection/useSingle.js","../../node_modules/react-day-picker/dist/esm/selection/useMulti.js","../../node_modules/react-day-picker/dist/esm/DayPicker.js","../../node_modules/react-day-picker/dist/esm/helpers/getFormatters.js","../../node_modules/react-day-picker/dist/esm/helpers/createGetModifiers.js","../../node_modules/react-day-picker/dist/esm/helpers/getWeekdays.js","../../node_modules/react-day-picker/dist/esm/helpers/getDataAttributes.js","../../node_modules/react-day-picker/dist/esm/helpers/getMonthOptions.js","../../node_modules/react-day-picker/dist/esm/helpers/getYearOptions.js","../../node_modules/react-day-picker/dist/esm/helpers/getStyleForModifiers.js","../../node_modules/react-day-picker/dist/esm/helpers/getClassNamesForModifiers.js","../../src/components/ui/calendar/calendar.tsx"],"sourcesContent":["const offsetFormatCache = {};\nconst offsetCache = {};\n\n/**\n * The function extracts UTC offset in minutes from the given date in specified\n * time zone.\n *\n * Unlike `Date.prototype.getTimezoneOffset`, this function returns the value\n * mirrored to the sign of the offset in the time zone. For Asia/Singapore\n * (UTC+8), `tzOffset` returns 480, while `getTimezoneOffset` returns -480.\n *\n * @param timeZone - Time zone name (IANA or UTC offset)\n * @param date - Date to check the offset for\n *\n * @returns UTC offset in minutes\n */\nexport function tzOffset(timeZone, date) {\n  try {\n    const format = offsetFormatCache[timeZone] ||= new Intl.DateTimeFormat(\"en-GB\", {\n      timeZone,\n      hour: \"numeric\",\n      timeZoneName: \"longOffset\"\n    }).format;\n    const offsetStr = format(date).split('GMT')[1] || '';\n    if (offsetStr in offsetCache) return offsetCache[offsetStr];\n    return calcOffset(offsetStr, offsetStr.split(\":\"));\n  } catch {\n    // Fallback to manual parsing if the runtime doesn't support ±HH:MM/±HHMM/±HH\n    // See: https://github.com/nodejs/node/issues/53419\n    if (timeZone in offsetCache) return offsetCache[timeZone];\n    const captures = timeZone?.match(offsetRe);\n    if (captures) return calcOffset(timeZone, captures.slice(1));\n    return NaN;\n  }\n}\nconst offsetRe = /([+-]\\d\\d):?(\\d\\d)?/;\nfunction calcOffset(cacheStr, values) {\n  const hours = +values[0];\n  const minutes = +(values[1] || 0);\n  return offsetCache[cacheStr] = hours > 0 ? hours * 60 + minutes : hours * 60 - minutes;\n}","import { tzOffset } from \"../tzOffset/index.js\";\nexport class TZDateMini extends Date {\n  //#region static\n\n  constructor(...args) {\n    super();\n    if (args.length > 1 && typeof args[args.length - 1] === \"string\") {\n      this.timeZone = args.pop();\n    }\n    this.internal = new Date();\n    if (isNaN(tzOffset(this.timeZone, this))) {\n      this.setTime(NaN);\n    } else {\n      if (!args.length) {\n        this.setTime(Date.now());\n      } else if (typeof args[0] === \"number\" && (args.length === 1 || args.length === 2 && typeof args[1] !== \"number\")) {\n        this.setTime(args[0]);\n      } else if (typeof args[0] === \"string\") {\n        this.setTime(+new Date(args[0]));\n      } else if (args[0] instanceof Date) {\n        this.setTime(+args[0]);\n      } else {\n        this.setTime(+new Date(...args));\n        adjustToSystemTZ(this, NaN);\n        syncToInternal(this);\n      }\n    }\n  }\n  static tz(tz, ...args) {\n    return args.length ? new TZDateMini(...args, tz) : new TZDateMini(Date.now(), tz);\n  }\n\n  //#endregion\n\n  //#region time zone\n\n  withTimeZone(timeZone) {\n    return new TZDateMini(+this, timeZone);\n  }\n  getTimezoneOffset() {\n    return -tzOffset(this.timeZone, this);\n  }\n\n  //#endregion\n\n  //#region time\n\n  setTime(time) {\n    Date.prototype.setTime.apply(this, arguments);\n    syncToInternal(this);\n    return +this;\n  }\n\n  //#endregion\n\n  //#region date-fns integration\n\n  [Symbol.for(\"constructDateFrom\")](date) {\n    return new TZDateMini(+new Date(date), this.timeZone);\n  }\n\n  //#endregion\n}\n\n// Assign getters and setters\nconst re = /^(get|set)(?!UTC)/;\nObject.getOwnPropertyNames(Date.prototype).forEach(method => {\n  if (!re.test(method)) return;\n  const utcMethod = method.replace(re, \"$1UTC\");\n  // Filter out methods without UTC counterparts\n  if (!TZDateMini.prototype[utcMethod]) return;\n  if (method.startsWith(\"get\")) {\n    // Delegate to internal date's UTC method\n    TZDateMini.prototype[method] = function () {\n      return this.internal[utcMethod]();\n    };\n  } else {\n    // Assign regular setter\n    TZDateMini.prototype[method] = function () {\n      Date.prototype[utcMethod].apply(this.internal, arguments);\n      syncFromInternal(this);\n      return +this;\n    };\n\n    // Assign UTC setter\n    TZDateMini.prototype[utcMethod] = function () {\n      Date.prototype[utcMethod].apply(this, arguments);\n      syncToInternal(this);\n      return +this;\n    };\n  }\n});\n\n/**\n * Function syncs time to internal date, applying the time zone offset.\n *\n * @param {Date} date - Date to sync\n */\nfunction syncToInternal(date) {\n  date.internal.setTime(+date);\n  date.internal.setUTCMinutes(date.internal.getUTCMinutes() - date.getTimezoneOffset());\n}\n\n/**\n * Function syncs the internal date UTC values to the date. It allows to get\n * accurate timestamp value.\n *\n * @param {Date} date - The date to sync\n */\nfunction syncFromInternal(date) {\n  // First we transpose the internal values\n  Date.prototype.setFullYear.call(date, date.internal.getUTCFullYear(), date.internal.getUTCMonth(), date.internal.getUTCDate());\n  Date.prototype.setHours.call(date, date.internal.getUTCHours(), date.internal.getUTCMinutes(), date.internal.getUTCSeconds(), date.internal.getUTCMilliseconds());\n\n  // Now we have to adjust the date to the system time zone\n  adjustToSystemTZ(date);\n}\n\n/**\n * Function adjusts the date to the system time zone. It uses the time zone\n * differences to calculate the offset and adjust the date.\n *\n * @param {Date} date - Date to adjust\n */\nfunction adjustToSystemTZ(date) {\n  // Save the time zone offset before all the adjustments\n  const offset = tzOffset(date.timeZone, date);\n\n  //#region System DST adjustment\n\n  // The biggest problem with using the system time zone is that when we create\n  // a date from internal values stored in UTC, the system time zone might end\n  // up on the DST hour:\n  //\n  //   $ TZ=America/New_York node\n  //   > new Date(2020, 2, 8, 1).toString()\n  //   'Sun Mar 08 2020 01:00:00 GMT-0500 (Eastern Standard Time)'\n  //   > new Date(2020, 2, 8, 2).toString()\n  //   'Sun Mar 08 2020 03:00:00 GMT-0400 (Eastern Daylight Time)'\n  //   > new Date(2020, 2, 8, 3).toString()\n  //   'Sun Mar 08 2020 03:00:00 GMT-0400 (Eastern Daylight Time)'\n  //   > new Date(2020, 2, 8, 4).toString()\n  //   'Sun Mar 08 2020 04:00:00 GMT-0400 (Eastern Daylight Time)'\n  //\n  // Here we get the same hour for both 2 and 3, because the system time zone\n  // has DST beginning at 8 March 2020, 2 a.m. and jumps to 3 a.m. So we have\n  // to adjust the internal date to reflect that.\n  //\n  // However we want to adjust only if that's the DST hour the change happenes,\n  // not the hour where DST moves to.\n\n  // We calculate the previous hour to see if the time zone offset has changed\n  // and we have landed on the DST hour.\n  const prevHour = new Date(+date);\n  // We use UTC methods here as we don't want to land on the same hour again\n  // in case of DST.\n  prevHour.setUTCHours(prevHour.getUTCHours() - 1);\n\n  // Calculate if we are on the system DST hour.\n  const systemOffset = -new Date(+date).getTimezoneOffset();\n  const prevHourSystemOffset = -new Date(+prevHour).getTimezoneOffset();\n  const systemDSTChange = systemOffset - prevHourSystemOffset;\n  // Detect the DST shift. System DST change will occur both on\n  const dstShift = Date.prototype.getHours.apply(date) !== date.internal.getUTCHours();\n\n  // Move the internal date when we are on the system DST hour.\n  if (systemDSTChange && dstShift) date.internal.setUTCMinutes(date.internal.getUTCMinutes() + systemDSTChange);\n\n  //#endregion\n\n  //#region System diff adjustment\n\n  // Now we need to adjust the date, since we just applied internal values.\n  // We need to calculate the difference between the system and date time zones\n  // and apply it to the date.\n\n  const offsetDiff = systemOffset - offset;\n  if (offsetDiff) Date.prototype.setUTCMinutes.call(date, Date.prototype.getUTCMinutes.call(date) + offsetDiff);\n\n  //#endregion\n\n  //#region Post-adjustment DST fix\n\n  const postOffset = tzOffset(date.timeZone, date);\n  const postSystemOffset = -new Date(+date).getTimezoneOffset();\n  const postOffsetDiff = postSystemOffset - postOffset;\n  const offsetChanged = postOffset !== offset;\n  const postDiff = postOffsetDiff - offsetDiff;\n  if (offsetChanged && postDiff) {\n    Date.prototype.setUTCMinutes.call(date, Date.prototype.getUTCMinutes.call(date) + postDiff);\n\n    // Now we need to check if got offset change during the post-adjustment.\n    // If so, we also need both dates to reflect that.\n\n    const newOffset = tzOffset(date.timeZone, date);\n    const offsetChange = postOffset - newOffset;\n    if (offsetChange) {\n      date.internal.setUTCMinutes(date.internal.getUTCMinutes() + offsetChange);\n      Date.prototype.setUTCMinutes.call(date, Date.prototype.getUTCMinutes.call(date) + offsetChange);\n    }\n  }\n\n  //#endregion\n}","import { TZDateMini } from \"./mini.js\";\n\n/**\n * UTC date class. It maps getters and setters to corresponding UTC methods,\n * forcing all calculations in the UTC time zone.\n *\n * Combined with date-fns, it allows using the class the same way as\n * the original date class.\n *\n * This complete version provides not only getters, setters,\n * and `getTimezoneOffset`, but also the formatter functions, mirroring\n * all original `Date` functionality. Use this version when you need to format\n * a string or in an environment you don't fully control (a library).\n * For a minimal version, see `UTCDateMini`.\n */\nexport class TZDate extends TZDateMini {\n  //#region static\n\n  static tz(tz, ...args) {\n    return args.length ? new TZDate(...args, tz) : new TZDate(Date.now(), tz);\n  }\n\n  //#endregion\n\n  //#region representation\n\n  toISOString() {\n    const [sign, hours, minutes] = this.tzComponents();\n    const tz = `${sign}${hours}:${minutes}`;\n    return this.internal.toISOString().slice(0, -1) + tz;\n  }\n  toString() {\n    // \"Tue Aug 13 2024 07:50:19 GMT+0800 (Singapore Standard Time)\";\n    return `${this.toDateString()} ${this.toTimeString()}`;\n  }\n  toDateString() {\n    // toUTCString returns RFC 7231 (\"Mon, 12 Aug 2024 23:36:08 GMT\")\n    const [day, date, month, year] = this.internal.toUTCString().split(\" \");\n    // \"Tue Aug 13 2024\"\n    return `${day?.slice(0, -1) /* Remove \",\" */} ${month} ${date} ${year}`;\n  }\n  toTimeString() {\n    // toUTCString returns RFC 7231 (\"Mon, 12 Aug 2024 23:36:08 GMT\")\n    const time = this.internal.toUTCString().split(\" \")[4];\n    const [sign, hours, minutes] = this.tzComponents();\n    // \"07:42:23 GMT+0800 (Singapore Standard Time)\"\n    return `${time} GMT${sign}${hours}${minutes} (${tzName(this.timeZone, this)})`;\n  }\n  toLocaleString(locales, options) {\n    return Date.prototype.toLocaleString.call(this, locales, {\n      ...options,\n      timeZone: options?.timeZone || this.timeZone\n    });\n  }\n  toLocaleDateString(locales, options) {\n    return Date.prototype.toLocaleDateString.call(this, locales, {\n      ...options,\n      timeZone: options?.timeZone || this.timeZone\n    });\n  }\n  toLocaleTimeString(locales, options) {\n    return Date.prototype.toLocaleTimeString.call(this, locales, {\n      ...options,\n      timeZone: options?.timeZone || this.timeZone\n    });\n  }\n\n  //#endregion\n\n  //#region private\n\n  tzComponents() {\n    const offset = this.getTimezoneOffset();\n    const sign = offset > 0 ? \"-\" : \"+\";\n    const hours = String(Math.floor(Math.abs(offset) / 60)).padStart(2, \"0\");\n    const minutes = String(Math.abs(offset) % 60).padStart(2, \"0\");\n    return [sign, hours, minutes];\n  }\n\n  //#endregion\n\n  withTimeZone(timeZone) {\n    return new TZDate(+this, timeZone);\n  }\n\n  //#region date-fns integration\n\n  [Symbol.for(\"constructDateFrom\")](date) {\n    return new TZDate(+new Date(date), this.timeZone);\n  }\n\n  //#endregion\n}\nfunction tzName(tz, date) {\n  return new Intl.DateTimeFormat(\"en-GB\", {\n    timeZone: tz,\n    timeZoneName: \"long\"\n  }).format(date).slice(12);\n}","/**\n * Enum representing the UI elements composing DayPicker. These elements are\n * mapped to {@link CustomComponents}, {@link ClassNames}, and {@link Styles}.\n *\n * Some elements are extended by flags and modifiers.\n */\nexport var UI;\n(function (UI) {\n    /** The root component displaying the months and the navigation bar. */\n    UI[\"Root\"] = \"root\";\n    /** The Chevron SVG element used by navigation buttons and dropdowns. */\n    UI[\"Chevron\"] = \"chevron\";\n    /**\n     * The grid cell with the day's date. Extended by {@link DayFlag} and\n     * {@link SelectionState}.\n     */\n    UI[\"Day\"] = \"day\";\n    /** The button containing the formatted day's date, inside the grid cell. */\n    UI[\"DayButton\"] = \"day_button\";\n    /** The caption label of the month (when not showing the dropdown navigation). */\n    UI[\"CaptionLabel\"] = \"caption_label\";\n    /** The container of the dropdown navigation (when enabled). */\n    UI[\"Dropdowns\"] = \"dropdowns\";\n    /** The dropdown element to select for years and months. */\n    UI[\"Dropdown\"] = \"dropdown\";\n    /** The container element of the dropdown. */\n    UI[\"DropdownRoot\"] = \"dropdown_root\";\n    /** The root element of the footer. */\n    UI[\"Footer\"] = \"footer\";\n    /** The month grid. */\n    UI[\"MonthGrid\"] = \"month_grid\";\n    /** Contains the dropdown navigation or the caption label. */\n    UI[\"MonthCaption\"] = \"month_caption\";\n    /** The dropdown with the months. */\n    UI[\"MonthsDropdown\"] = \"months_dropdown\";\n    /** Wrapper of the month grid. */\n    UI[\"Month\"] = \"month\";\n    /** The container of the displayed months. */\n    UI[\"Months\"] = \"months\";\n    /** The navigation bar with the previous and next buttons. */\n    UI[\"Nav\"] = \"nav\";\n    /**\n     * The next month button in the navigation. *\n     *\n     * @since 9.1.0\n     */\n    UI[\"NextMonthButton\"] = \"button_next\";\n    /**\n     * The previous month button in the navigation.\n     *\n     * @since 9.1.0\n     */\n    UI[\"PreviousMonthButton\"] = \"button_previous\";\n    /** The row containing the week. */\n    UI[\"Week\"] = \"week\";\n    /** The group of row weeks in a month (`tbody`). */\n    UI[\"Weeks\"] = \"weeks\";\n    /** The column header with the weekday. */\n    UI[\"Weekday\"] = \"weekday\";\n    /** The row grouping the weekdays in the column headers. */\n    UI[\"Weekdays\"] = \"weekdays\";\n    /** The cell containing the week number. */\n    UI[\"WeekNumber\"] = \"week_number\";\n    /** The cell header of the week numbers column. */\n    UI[\"WeekNumberHeader\"] = \"week_number_header\";\n    /** The dropdown with the years. */\n    UI[\"YearsDropdown\"] = \"years_dropdown\";\n})(UI || (UI = {}));\n/** Enum representing flags for the {@link UI.Day} element. */\nexport var DayFlag;\n(function (DayFlag) {\n    /** The day is disabled. */\n    DayFlag[\"disabled\"] = \"disabled\";\n    /** The day is hidden. */\n    DayFlag[\"hidden\"] = \"hidden\";\n    /** The day is outside the current month. */\n    DayFlag[\"outside\"] = \"outside\";\n    /** The day is focused. */\n    DayFlag[\"focused\"] = \"focused\";\n    /** The day is today. */\n    DayFlag[\"today\"] = \"today\";\n})(DayFlag || (DayFlag = {}));\n/**\n * Enum representing selection states that can be applied to the {@link UI.Day}\n * element in selection mode.\n */\nexport var SelectionState;\n(function (SelectionState) {\n    /** The day is at the end of a selected range. */\n    SelectionState[\"range_end\"] = \"range_end\";\n    /** The day is at the middle of a selected range. */\n    SelectionState[\"range_middle\"] = \"range_middle\";\n    /** The day is at the start of a selected range. */\n    SelectionState[\"range_start\"] = \"range_start\";\n    /** The day is selected. */\n    SelectionState[\"selected\"] = \"selected\";\n})(SelectionState || (SelectionState = {}));\n/**\n * Enum representing different animation states for transitioning between\n * months.\n */\nexport var Animation;\n(function (Animation) {\n    /** The entering weeks when they appear before the exiting month. */\n    Animation[\"weeks_before_enter\"] = \"weeks_before_enter\";\n    /** The exiting weeks when they disappear before the entering month. */\n    Animation[\"weeks_before_exit\"] = \"weeks_before_exit\";\n    /** The entering weeks when they appear after the exiting month. */\n    Animation[\"weeks_after_enter\"] = \"weeks_after_enter\";\n    /** The exiting weeks when they disappear after the entering month. */\n    Animation[\"weeks_after_exit\"] = \"weeks_after_exit\";\n    /** The entering caption when it appears after the exiting month. */\n    Animation[\"caption_after_enter\"] = \"caption_after_enter\";\n    /** The exiting caption when it disappears after the entering month. */\n    Animation[\"caption_after_exit\"] = \"caption_after_exit\";\n    /** The entering caption when it appears before the exiting month. */\n    Animation[\"caption_before_enter\"] = \"caption_before_enter\";\n    /** The exiting caption when it disappears before the entering month. */\n    Animation[\"caption_before_exit\"] = \"caption_before_exit\";\n})(Animation || (Animation = {}));\n//# sourceMappingURL=UI.js.map","/**\n * @module constants\n * @summary Useful constants\n * @description\n * Collection of useful date constants.\n *\n * The constants could be imported from `date-fns/constants`:\n *\n * ```ts\n * import { maxTime, minTime } from \"./constants/date-fns/constants\";\n *\n * function isAllowedTime(time) {\n *   return time <= maxTime && time >= minTime;\n * }\n * ```\n */\n\n/**\n * @constant\n * @name daysInWeek\n * @summary Days in 1 week.\n */\nexport const daysInWeek = 7;\n\n/**\n * @constant\n * @name daysInYear\n * @summary Days in 1 year.\n *\n * @description\n * How many days in a year.\n *\n * One years equals 365.2425 days according to the formula:\n *\n * > Leap year occurs every 4 years, except for years that are divisible by 100 and not divisible by 400.\n * > 1 mean year = (365+1/4-1/100+1/400) days = 365.2425 days\n */\nexport const daysInYear = 365.2425;\n\n/**\n * @constant\n * @name maxTime\n * @summary Maximum allowed time.\n *\n * @example\n * import { maxTime } from \"./constants/date-fns/constants\";\n *\n * const isValid = 8640000000000001 <= maxTime;\n * //=> false\n *\n * new Date(8640000000000001);\n * //=> Invalid Date\n */\nexport const maxTime = Math.pow(10, 8) * 24 * 60 * 60 * 1000;\n\n/**\n * @constant\n * @name minTime\n * @summary Minimum allowed time.\n *\n * @example\n * import { minTime } from \"./constants/date-fns/constants\";\n *\n * const isValid = -8640000000000001 >= minTime;\n * //=> false\n *\n * new Date(-8640000000000001)\n * //=> Invalid Date\n */\nexport const minTime = -maxTime;\n\n/**\n * @constant\n * @name millisecondsInWeek\n * @summary Milliseconds in 1 week.\n */\nexport const millisecondsInWeek = 604800000;\n\n/**\n * @constant\n * @name millisecondsInDay\n * @summary Milliseconds in 1 day.\n */\nexport const millisecondsInDay = 86400000;\n\n/**\n * @constant\n * @name millisecondsInMinute\n * @summary Milliseconds in 1 minute\n */\nexport const millisecondsInMinute = 60000;\n\n/**\n * @constant\n * @name millisecondsInHour\n * @summary Milliseconds in 1 hour\n */\nexport const millisecondsInHour = 3600000;\n\n/**\n * @constant\n * @name millisecondsInSecond\n * @summary Milliseconds in 1 second\n */\nexport const millisecondsInSecond = 1000;\n\n/**\n * @constant\n * @name minutesInYear\n * @summary Minutes in 1 year.\n */\nexport const minutesInYear = 525600;\n\n/**\n * @constant\n * @name minutesInMonth\n * @summary Minutes in 1 month.\n */\nexport const minutesInMonth = 43200;\n\n/**\n * @constant\n * @name minutesInDay\n * @summary Minutes in 1 day.\n */\nexport const minutesInDay = 1440;\n\n/**\n * @constant\n * @name minutesInHour\n * @summary Minutes in 1 hour.\n */\nexport const minutesInHour = 60;\n\n/**\n * @constant\n * @name monthsInQuarter\n * @summary Months in 1 quarter.\n */\nexport const monthsInQuarter = 3;\n\n/**\n * @constant\n * @name monthsInYear\n * @summary Months in 1 year.\n */\nexport const monthsInYear = 12;\n\n/**\n * @constant\n * @name quartersInYear\n * @summary Quarters in 1 year\n */\nexport const quartersInYear = 4;\n\n/**\n * @constant\n * @name secondsInHour\n * @summary Seconds in 1 hour.\n */\nexport const secondsInHour = 3600;\n\n/**\n * @constant\n * @name secondsInMinute\n * @summary Seconds in 1 minute.\n */\nexport const secondsInMinute = 60;\n\n/**\n * @constant\n * @name secondsInDay\n * @summary Seconds in 1 day.\n */\nexport const secondsInDay = secondsInHour * 24;\n\n/**\n * @constant\n * @name secondsInWeek\n * @summary Seconds in 1 week.\n */\nexport const secondsInWeek = secondsInDay * 7;\n\n/**\n * @constant\n * @name secondsInYear\n * @summary Seconds in 1 year.\n */\nexport const secondsInYear = secondsInDay * daysInYear;\n\n/**\n * @constant\n * @name secondsInMonth\n * @summary Seconds in 1 month\n */\nexport const secondsInMonth = secondsInYear / 12;\n\n/**\n * @constant\n * @name secondsInQuarter\n * @summary Seconds in 1 quarter.\n */\nexport const secondsInQuarter = secondsInMonth * 3;\n\n/**\n * @constant\n * @name constructFromSymbol\n * @summary Symbol enabling Date extensions to inherit properties from the reference date.\n *\n * The symbol is used to enable the `constructFrom` function to construct a date\n * using a reference date and a value. It allows to transfer extra properties\n * from the reference date to the new date. It's useful for extensions like\n * [`TZDate`](https://github.com/date-fns/tz) that accept a time zone as\n * a constructor argument.\n */\nexport const constructFromSymbol = Symbol.for(\"constructDateFrom\");\n","import { constructFromSymbol } from \"./constants.js\";\n\n/**\n * @name constructFrom\n * @category Generic Helpers\n * @summary Constructs a date using the reference date and the value\n *\n * @description\n * The function constructs a new date using the constructor from the reference\n * date and the given value. It helps to build generic functions that accept\n * date extensions.\n *\n * It defaults to `Date` if the passed reference date is a number or a string.\n *\n * Starting from v3.7.0, it allows to construct a date using `[Symbol.for(\"constructDateFrom\")]`\n * enabling to transfer extra properties from the reference date to the new date.\n * It's useful for extensions like [`TZDate`](https://github.com/date-fns/tz)\n * that accept a time zone as a constructor argument.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The reference date to take constructor from\n * @param value - The value to create the date\n *\n * @returns Date initialized using the given date and value\n *\n * @example\n * import { constructFrom } from \"./constructFrom/date-fns\";\n *\n * // A function that clones a date preserving the original type\n * function cloneDate<DateType extends Date>(date: DateType): DateType {\n *   return constructFrom(\n *     date, // Use constructor from the given date\n *     date.getTime() // Use the date value to create a new date\n *   );\n * }\n */\nexport function constructFrom(date, value) {\n  if (typeof date === \"function\") return date(value);\n\n  if (date && typeof date === \"object\" && constructFromSymbol in date)\n    return date[constructFromSymbol](value);\n\n  if (date instanceof Date) return new date.constructor(value);\n\n  return new Date(value);\n}\n\n// Fallback for modularized imports:\nexport default constructFrom;\n","import { constructFrom } from \"./constructFrom.js\";\n\n/**\n * @name toDate\n * @category Common Helpers\n * @summary Convert the given argument to an instance of Date.\n *\n * @description\n * Convert the given argument to an instance of Date.\n *\n * If the argument is an instance of Date, the function returns its clone.\n *\n * If the argument is a number, it is treated as a timestamp.\n *\n * If the argument is none of the above, the function returns Invalid Date.\n *\n * Starting from v3.7.0, it clones a date using `[Symbol.for(\"constructDateFrom\")]`\n * enabling to transfer extra properties from the reference date to the new date.\n * It's useful for extensions like [`TZDate`](https://github.com/date-fns/tz)\n * that accept a time zone as a constructor argument.\n *\n * **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param argument - The value to convert\n *\n * @returns The parsed date in the local time zone\n *\n * @example\n * // Clone the date:\n * const result = toDate(new Date(2014, 1, 11, 11, 30, 30))\n * //=> Tue Feb 11 2014 11:30:30\n *\n * @example\n * // Convert the timestamp to date:\n * const result = toDate(1392098430000)\n * //=> Tue Feb 11 2014 11:30:30\n */\nexport function toDate(argument, context) {\n  // [TODO] Get rid of `toDate` or `constructFrom`?\n  return constructFrom(context || argument, argument);\n}\n\n// Fallback for modularized imports:\nexport default toDate;\n","import { constructFrom } from \"./constructFrom.js\";\nimport { toDate } from \"./toDate.js\";\n\n/**\n * The {@link addDays} function options.\n */\n\n/**\n * @name addDays\n * @category Day Helpers\n * @summary Add the specified number of days to the given date.\n *\n * @description\n * Add the specified number of days to the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The date to be changed\n * @param amount - The amount of days to be added.\n * @param options - An object with options\n *\n * @returns The new date with the days added\n *\n * @example\n * // Add 10 days to 1 September 2014:\n * const result = addDays(new Date(2014, 8, 1), 10)\n * //=> Thu Sep 11 2014 00:00:00\n */\nexport function addDays(date, amount, options) {\n  const _date = toDate(date, options?.in);\n  if (isNaN(amount)) return constructFrom(options?.in || date, NaN);\n\n  // If 0 days, no-op to avoid changing times in the hour before end of DST\n  if (!amount) return _date;\n\n  _date.setDate(_date.getDate() + amount);\n  return _date;\n}\n\n// Fallback for modularized imports:\nexport default addDays;\n","import { constructFrom } from \"./constructFrom.js\";\nimport { toDate } from \"./toDate.js\";\n\n/**\n * The {@link addMonths} function options.\n */\n\n/**\n * @name addMonths\n * @category Month Helpers\n * @summary Add the specified number of months to the given date.\n *\n * @description\n * Add the specified number of months to the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The date to be changed\n * @param amount - The amount of months to be added.\n * @param options - The options object\n *\n * @returns The new date with the months added\n *\n * @example\n * // Add 5 months to 1 September 2014:\n * const result = addMonths(new Date(2014, 8, 1), 5)\n * //=> Sun Feb 01 2015 00:00:00\n *\n * // Add one month to 30 January 2023:\n * const result = addMonths(new Date(2023, 0, 30), 1)\n * //=> Tue Feb 28 2023 00:00:00\n */\nexport function addMonths(date, amount, options) {\n  const _date = toDate(date, options?.in);\n  if (isNaN(amount)) return constructFrom(options?.in || date, NaN);\n  if (!amount) {\n    // If 0 months, no-op to avoid changing times in the hour before end of DST\n    return _date;\n  }\n  const dayOfMonth = _date.getDate();\n\n  // The JS Date object supports date math by accepting out-of-bounds values for\n  // month, day, etc. For example, new Date(2020, 0, 0) returns 31 Dec 2019 and\n  // new Date(2020, 13, 1) returns 1 Feb 2021.  This is *almost* the behavior we\n  // want except that dates will wrap around the end of a month, meaning that\n  // new Date(2020, 13, 31) will return 3 Mar 2021 not 28 Feb 2021 as desired. So\n  // we'll default to the end of the desired month by adding 1 to the desired\n  // month and using a date of 0 to back up one day to the end of the desired\n  // month.\n  const endOfDesiredMonth = constructFrom(options?.in || date, _date.getTime());\n  endOfDesiredMonth.setMonth(_date.getMonth() + amount + 1, 0);\n  const daysInMonth = endOfDesiredMonth.getDate();\n  if (dayOfMonth >= daysInMonth) {\n    // If we're already at the end of the month, then this is the correct date\n    // and we're done.\n    return endOfDesiredMonth;\n  } else {\n    // Otherwise, we now know that setting the original day-of-month value won't\n    // cause an overflow, so set the desired day-of-month. Note that we can't\n    // just set the date of `endOfDesiredMonth` because that object may have had\n    // its time changed in the unusual case where where a DST transition was on\n    // the last day of the month and its local time was in the hour skipped or\n    // repeated next to a DST transition.  So we use `date` instead which is\n    // guaranteed to still have the original time.\n    _date.setFullYear(\n      endOfDesiredMonth.getFullYear(),\n      endOfDesiredMonth.getMonth(),\n      dayOfMonth,\n    );\n    return _date;\n  }\n}\n\n// Fallback for modularized imports:\nexport default addMonths;\n","let defaultOptions = {};\n\nexport function getDefaultOptions() {\n  return defaultOptions;\n}\n\nexport function setDefaultOptions(newOptions) {\n  defaultOptions = newOptions;\n}\n","import { getDefaultOptions } from \"./_lib/defaultOptions.js\";\nimport { toDate } from \"./toDate.js\";\n\n/**\n * The {@link startOfWeek} function options.\n */\n\n/**\n * @name startOfWeek\n * @category Week Helpers\n * @summary Return the start of a week for the given date.\n *\n * @description\n * Return the start of a week for the given date.\n * The result will be in the local timezone.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The original date\n * @param options - An object with options\n *\n * @returns The start of a week\n *\n * @example\n * // The start of a week for 2 September 2014 11:55:00:\n * const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Sun Aug 31 2014 00:00:00\n *\n * @example\n * // If the week starts on Monday, the start of the week for 2 September 2014 11:55:00:\n * const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0), { weekStartsOn: 1 })\n * //=> Mon Sep 01 2014 00:00:00\n */\nexport function startOfWeek(date, options) {\n  const defaultOptions = getDefaultOptions();\n  const weekStartsOn =\n    options?.weekStartsOn ??\n    options?.locale?.options?.weekStartsOn ??\n    defaultOptions.weekStartsOn ??\n    defaultOptions.locale?.options?.weekStartsOn ??\n    0;\n\n  const _date = toDate(date, options?.in);\n  const day = _date.getDay();\n  const diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;\n\n  _date.setDate(_date.getDate() - diff);\n  _date.setHours(0, 0, 0, 0);\n  return _date;\n}\n\n// Fallback for modularized imports:\nexport default startOfWeek;\n","import { startOfWeek } from \"./startOfWeek.js\";\n\n/**\n * The {@link startOfISOWeek} function options.\n */\n\n/**\n * @name startOfISOWeek\n * @category ISO Week Helpers\n * @summary Return the start of an ISO week for the given date.\n *\n * @description\n * Return the start of an ISO week for the given date.\n * The result will be in the local timezone.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The original date\n * @param options - An object with options\n *\n * @returns The start of an ISO week\n *\n * @example\n * // The start of an ISO week for 2 September 2014 11:55:00:\n * const result = startOfISOWeek(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Mon Sep 01 2014 00:00:00\n */\nexport function startOfISOWeek(date, options) {\n  return startOfWeek(date, { ...options, weekStartsOn: 1 });\n}\n\n// Fallback for modularized imports:\nexport default startOfISOWeek;\n","import { constructFrom } from \"./constructFrom.js\";\nimport { startOfISOWeek } from \"./startOfISOWeek.js\";\nimport { toDate } from \"./toDate.js\";\n\n/**\n * The {@link getISOWeekYear} function options.\n */\n\n/**\n * @name getISOWeekYear\n * @category ISO Week-Numbering Year Helpers\n * @summary Get the ISO week-numbering year of the given date.\n *\n * @description\n * Get the ISO week-numbering year of the given date,\n * which always starts 3 days before the year's first Thursday.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @param date - The given date\n *\n * @returns The ISO week-numbering year\n *\n * @example\n * // Which ISO-week numbering year is 2 January 2005?\n * const result = getISOWeekYear(new Date(2005, 0, 2))\n * //=> 2004\n */\nexport function getISOWeekYear(date, options) {\n  const _date = toDate(date, options?.in);\n  const year = _date.getFullYear();\n\n  const fourthOfJanuaryOfNextYear = constructFrom(_date, 0);\n  fourthOfJanuaryOfNextYear.setFullYear(year + 1, 0, 4);\n  fourthOfJanuaryOfNextYear.setHours(0, 0, 0, 0);\n  const startOfNextYear = startOfISOWeek(fourthOfJanuaryOfNextYear);\n\n  const fourthOfJanuaryOfThisYear = constructFrom(_date, 0);\n  fourthOfJanuaryOfThisYear.setFullYear(year, 0, 4);\n  fourthOfJanuaryOfThisYear.setHours(0, 0, 0, 0);\n  const startOfThisYear = startOfISOWeek(fourthOfJanuaryOfThisYear);\n\n  if (_date.getTime() >= startOfNextYear.getTime()) {\n    return year + 1;\n  } else if (_date.getTime() >= startOfThisYear.getTime()) {\n    return year;\n  } else {\n    return year - 1;\n  }\n}\n\n// Fallback for modularized imports:\nexport default getISOWeekYear;\n","import { toDate } from \"../toDate.js\";\n\n/**\n * Google Chrome as of 67.0.3396.87 introduced timezones with offset that includes seconds.\n * They usually appear for dates that denote time before the timezones were introduced\n * (e.g. for 'Europe/Prague' timezone the offset is GMT+00:57:44 before 1 October 1891\n * and GMT+01:00:00 after that date)\n *\n * Date#getTimezoneOffset returns the offset in minutes and would return 57 for the example above,\n * which would lead to incorrect calculations.\n *\n * This function returns the timezone offset in milliseconds that takes seconds in account.\n */\nexport function getTimezoneOffsetInMilliseconds(date) {\n  const _date = toDate(date);\n  const utcDate = new Date(\n    Date.UTC(\n      _date.getFullYear(),\n      _date.getMonth(),\n      _date.getDate(),\n      _date.getHours(),\n      _date.getMinutes(),\n      _date.getSeconds(),\n      _date.getMilliseconds(),\n    ),\n  );\n  utcDate.setUTCFullYear(_date.getFullYear());\n  return +date - +utcDate;\n}\n","import { constructFrom } from \"../constructFrom.js\";\n\nexport function normalizeDates(context, ...dates) {\n  const normalize = constructFrom.bind(\n    null,\n    context || dates.find((date) => typeof date === \"object\"),\n  );\n  return dates.map(normalize);\n}\n","import { toDate } from \"./toDate.js\";\n\n/**\n * The {@link startOfDay} function options.\n */\n\n/**\n * @name startOfDay\n * @category Day Helpers\n * @summary Return the start of a day for the given date.\n *\n * @description\n * Return the start of a day for the given date.\n * The result will be in the local timezone.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The original date\n * @param options - The options\n *\n * @returns The start of a day\n *\n * @example\n * // The start of a day for 2 September 2014 11:55:00:\n * const result = startOfDay(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Tue Sep 02 2014 00:00:00\n */\nexport function startOfDay(date, options) {\n  const _date = toDate(date, options?.in);\n  _date.setHours(0, 0, 0, 0);\n  return _date;\n}\n\n// Fallback for modularized imports:\nexport default startOfDay;\n","import { getTimezoneOffsetInMilliseconds } from \"./_lib/getTimezoneOffsetInMilliseconds.js\";\nimport { normalizeDates } from \"./_lib/normalizeDates.js\";\nimport { millisecondsInDay } from \"./constants.js\";\nimport { startOfDay } from \"./startOfDay.js\";\n\n/**\n * The {@link differenceInCalendarDays} function options.\n */\n\n/**\n * @name differenceInCalendarDays\n * @category Day Helpers\n * @summary Get the number of calendar days between the given dates.\n *\n * @description\n * Get the number of calendar days between the given dates. This means that the times are removed\n * from the dates and then the difference in days is calculated.\n *\n * @param laterDate - The later date\n * @param earlierDate - The earlier date\n * @param options - The options object\n *\n * @returns The number of calendar days\n *\n * @example\n * // How many calendar days are between\n * // 2 July 2011 23:00:00 and 2 July 2012 00:00:00?\n * const result = differenceInCalendarDays(\n *   new Date(2012, 6, 2, 0, 0),\n *   new Date(2011, 6, 2, 23, 0)\n * )\n * //=> 366\n * // How many calendar days are between\n * // 2 July 2011 23:59:00 and 3 July 2011 00:01:00?\n * const result = differenceInCalendarDays(\n *   new Date(2011, 6, 3, 0, 1),\n *   new Date(2011, 6, 2, 23, 59)\n * )\n * //=> 1\n */\nexport function differenceInCalendarDays(laterDate, earlierDate, options) {\n  const [laterDate_, earlierDate_] = normalizeDates(\n    options?.in,\n    laterDate,\n    earlierDate,\n  );\n\n  const laterStartOfDay = startOfDay(laterDate_);\n  const earlierStartOfDay = startOfDay(earlierDate_);\n\n  const laterTimestamp =\n    +laterStartOfDay - getTimezoneOffsetInMilliseconds(laterStartOfDay);\n  const earlierTimestamp =\n    +earlierStartOfDay - getTimezoneOffsetInMilliseconds(earlierStartOfDay);\n\n  // Round the number of days to the nearest integer because the number of\n  // milliseconds in a day is not constant (e.g. it's different in the week of\n  // the daylight saving time clock shift).\n  return Math.round((laterTimestamp - earlierTimestamp) / millisecondsInDay);\n}\n\n// Fallback for modularized imports:\nexport default differenceInCalendarDays;\n","/**\n * @name isDate\n * @category Common Helpers\n * @summary Is the given value a date?\n *\n * @description\n * Returns true if the given value is an instance of Date. The function works for dates transferred across iframes.\n *\n * @param value - The value to check\n *\n * @returns True if the given value is a date\n *\n * @example\n * // For a valid date:\n * const result = isDate(new Date())\n * //=> true\n *\n * @example\n * // For an invalid date:\n * const result = isDate(new Date(NaN))\n * //=> true\n *\n * @example\n * // For some value:\n * const result = isDate('2014-02-31')\n * //=> false\n *\n * @example\n * // For an object:\n * const result = isDate({})\n * //=> false\n */\nexport function isDate(value) {\n  return (\n    value instanceof Date ||\n    (typeof value === \"object\" &&\n      Object.prototype.toString.call(value) === \"[object Date]\")\n  );\n}\n\n// Fallback for modularized imports:\nexport default isDate;\n","import { normalizeInterval } from \"./_lib/normalizeInterval.js\";\nimport { constructFrom } from \"./constructFrom.js\";\n\n/**\n * The {@link eachMonthOfInterval} function options.\n */\n\n/**\n * The {@link eachMonthOfInterval} function result type. It resolves the proper data type.\n */\n\n/**\n * @name eachMonthOfInterval\n * @category Interval Helpers\n * @summary Return the array of months within the specified time interval.\n *\n * @description\n * Return the array of months within the specified time interval.\n *\n * @typeParam IntervalType - Interval type.\n * @typeParam Options - Options type.\n *\n * @param interval - The interval.\n * @param options - An object with options.\n *\n * @returns The array with starts of months from the month of the interval start to the month of the interval end\n *\n * @example\n * // Each month between 6 February 2014 and 10 August 2014:\n * const result = eachMonthOfInterval({\n *   start: new Date(2014, 1, 6),\n *   end: new Date(2014, 7, 10)\n * })\n * //=> [\n * //   Sat Feb 01 2014 00:00:00,\n * //   Sat Mar 01 2014 00:00:00,\n * //   Tue Apr 01 2014 00:00:00,\n * //   Thu May 01 2014 00:00:00,\n * //   Sun Jun 01 2014 00:00:00,\n * //   Tue Jul 01 2014 00:00:00,\n * //   Fri Aug 01 2014 00:00:00\n * // ]\n */\nexport function eachMonthOfInterval(interval, options) {\n  const { start, end } = normalizeInterval(options?.in, interval);\n\n  let reversed = +start > +end;\n  const endTime = reversed ? +start : +end;\n  const date = reversed ? end : start;\n  date.setHours(0, 0, 0, 0);\n  date.setDate(1);\n\n  let step = options?.step ?? 1;\n  if (!step) return [];\n  if (step < 0) {\n    step = -step;\n    reversed = !reversed;\n  }\n\n  const dates = [];\n\n  while (+date <= endTime) {\n    dates.push(constructFrom(start, date));\n    date.setMonth(date.getMonth() + step);\n  }\n\n  return reversed ? dates.reverse() : dates;\n}\n\n// Fallback for modularized imports:\nexport default eachMonthOfInterval;\n","import { normalizeDates } from \"./normalizeDates.js\";\n\nexport function normalizeInterval(context, interval) {\n  const [start, end] = normalizeDates(context, interval.start, interval.end);\n  return { start, end };\n}\n","import { toDate } from \"./toDate.js\";\n\n/**\n * The {@link startOfYear} function options.\n */\n\n/**\n * @name startOfYear\n * @category Year Helpers\n * @summary Return the start of a year for the given date.\n *\n * @description\n * Return the start of a year for the given date.\n * The result will be in the local timezone.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The original date\n * @param options - The options\n *\n * @returns The start of a year\n *\n * @example\n * // The start of a year for 2 September 2014 11:55:00:\n * const result = startOfYear(new Date(2014, 8, 2, 11, 55, 00))\n * //=> Wed Jan 01 2014 00:00:00\n */\nexport function startOfYear(date, options) {\n  const date_ = toDate(date, options?.in);\n  date_.setFullYear(date_.getFullYear(), 0, 1);\n  date_.setHours(0, 0, 0, 0);\n  return date_;\n}\n\n// Fallback for modularized imports:\nexport default startOfYear;\n","import { getDefaultOptions } from \"./_lib/defaultOptions.js\";\nimport { toDate } from \"./toDate.js\";\n\n/**\n * The {@link endOfWeek} function options.\n */\n\n/**\n * @name endOfWeek\n * @category Week Helpers\n * @summary Return the end of a week for the given date.\n *\n * @description\n * Return the end of a week for the given date.\n * The result will be in the local timezone.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The original date\n * @param options - An object with options\n *\n * @returns The end of a week\n *\n * @example\n * // The end of a week for 2 September 2014 11:55:00:\n * const result = endOfWeek(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Sat Sep 06 2014 23:59:59.999\n *\n * @example\n * // If the week starts on Monday, the end of the week for 2 September 2014 11:55:00:\n * const result = endOfWeek(new Date(2014, 8, 2, 11, 55, 0), { weekStartsOn: 1 })\n * //=> Sun Sep 07 2014 23:59:59.999\n */\nexport function endOfWeek(date, options) {\n  const defaultOptions = getDefaultOptions();\n  const weekStartsOn =\n    options?.weekStartsOn ??\n    options?.locale?.options?.weekStartsOn ??\n    defaultOptions.weekStartsOn ??\n    defaultOptions.locale?.options?.weekStartsOn ??\n    0;\n\n  const _date = toDate(date, options?.in);\n  const day = _date.getDay();\n  const diff = (day < weekStartsOn ? -7 : 0) + 6 - (day - weekStartsOn);\n\n  _date.setDate(_date.getDate() + diff);\n  _date.setHours(23, 59, 59, 999);\n  return _date;\n}\n\n// Fallback for modularized imports:\nexport default endOfWeek;\n","const formatDistanceLocale = {\n  lessThanXSeconds: {\n    one: \"less than a second\",\n    other: \"less than {{count}} seconds\",\n  },\n\n  xSeconds: {\n    one: \"1 second\",\n    other: \"{{count}} seconds\",\n  },\n\n  halfAMinute: \"half a minute\",\n\n  lessThanXMinutes: {\n    one: \"less than a minute\",\n    other: \"less than {{count}} minutes\",\n  },\n\n  xMinutes: {\n    one: \"1 minute\",\n    other: \"{{count}} minutes\",\n  },\n\n  aboutXHours: {\n    one: \"about 1 hour\",\n    other: \"about {{count}} hours\",\n  },\n\n  xHours: {\n    one: \"1 hour\",\n    other: \"{{count}} hours\",\n  },\n\n  xDays: {\n    one: \"1 day\",\n    other: \"{{count}} days\",\n  },\n\n  aboutXWeeks: {\n    one: \"about 1 week\",\n    other: \"about {{count}} weeks\",\n  },\n\n  xWeeks: {\n    one: \"1 week\",\n    other: \"{{count}} weeks\",\n  },\n\n  aboutXMonths: {\n    one: \"about 1 month\",\n    other: \"about {{count}} months\",\n  },\n\n  xMonths: {\n    one: \"1 month\",\n    other: \"{{count}} months\",\n  },\n\n  aboutXYears: {\n    one: \"about 1 year\",\n    other: \"about {{count}} years\",\n  },\n\n  xYears: {\n    one: \"1 year\",\n    other: \"{{count}} years\",\n  },\n\n  overXYears: {\n    one: \"over 1 year\",\n    other: \"over {{count}} years\",\n  },\n\n  almostXYears: {\n    one: \"almost 1 year\",\n    other: \"almost {{count}} years\",\n  },\n};\n\nexport const formatDistance = (token, count, options) => {\n  let result;\n\n  const tokenValue = formatDistanceLocale[token];\n  if (typeof tokenValue === \"string\") {\n    result = tokenValue;\n  } else if (count === 1) {\n    result = tokenValue.one;\n  } else {\n    result = tokenValue.other.replace(\"{{count}}\", count.toString());\n  }\n\n  if (options?.addSuffix) {\n    if (options.comparison && options.comparison > 0) {\n      return \"in \" + result;\n    } else {\n      return result + \" ago\";\n    }\n  }\n\n  return result;\n};\n","export function buildFormatLongFn(args) {\n  return (options = {}) => {\n    // TODO: Remove String()\n    const width = options.width ? String(options.width) : args.defaultWidth;\n    const format = args.formats[width] || args.formats[args.defaultWidth];\n    return format;\n  };\n}\n","import { buildFormatLongFn } from \"../../_lib/buildFormatLongFn.js\";\n\nconst dateFormats = {\n  full: \"EEEE, MMMM do, y\",\n  long: \"MMMM do, y\",\n  medium: \"MMM d, y\",\n  short: \"MM/dd/yyyy\",\n};\n\nconst timeFormats = {\n  full: \"h:mm:ss a zzzz\",\n  long: \"h:mm:ss a z\",\n  medium: \"h:mm:ss a\",\n  short: \"h:mm a\",\n};\n\nconst dateTimeFormats = {\n  full: \"{{date}} 'at' {{time}}\",\n  long: \"{{date}} 'at' {{time}}\",\n  medium: \"{{date}}, {{time}}\",\n  short: \"{{date}}, {{time}}\",\n};\n\nexport const formatLong = {\n  date: buildFormatLongFn({\n    formats: dateFormats,\n    defaultWidth: \"full\",\n  }),\n\n  time: buildFormatLongFn({\n    formats: timeFormats,\n    defaultWidth: \"full\",\n  }),\n\n  dateTime: buildFormatLongFn({\n    formats: dateTimeFormats,\n    defaultWidth: \"full\",\n  }),\n};\n","const formatRelativeLocale = {\n  lastWeek: \"'last' eeee 'at' p\",\n  yesterday: \"'yesterday at' p\",\n  today: \"'today at' p\",\n  tomorrow: \"'tomorrow at' p\",\n  nextWeek: \"eeee 'at' p\",\n  other: \"P\",\n};\n\nexport const formatRelative = (token, _date, _baseDate, _options) =>\n  formatRelativeLocale[token];\n","/**\n * The localize function argument callback which allows to convert raw value to\n * the actual type.\n *\n * @param value - The value to convert\n *\n * @returns The converted value\n */\n\n/**\n * The map of localized values for each width.\n */\n\n/**\n * The index type of the locale unit value. It types conversion of units of\n * values that don't start at 0 (i.e. quarters).\n */\n\n/**\n * Converts the unit value to the tuple of values.\n */\n\n/**\n * The tuple of localized era values. The first element represents BC,\n * the second element represents AD.\n */\n\n/**\n * The tuple of localized quarter values. The first element represents Q1.\n */\n\n/**\n * The tuple of localized day values. The first element represents Sunday.\n */\n\n/**\n * The tuple of localized month values. The first element represents January.\n */\n\nexport function buildLocalizeFn(args) {\n  return (value, options) => {\n    const context = options?.context ? String(options.context) : \"standalone\";\n\n    let valuesArray;\n    if (context === \"formatting\" && args.formattingValues) {\n      const defaultWidth = args.defaultFormattingWidth || args.defaultWidth;\n      const width = options?.width ? String(options.width) : defaultWidth;\n\n      valuesArray =\n        args.formattingValues[width] || args.formattingValues[defaultWidth];\n    } else {\n      const defaultWidth = args.defaultWidth;\n      const width = options?.width ? String(options.width) : args.defaultWidth;\n\n      valuesArray = args.values[width] || args.values[defaultWidth];\n    }\n    const index = args.argumentCallback ? args.argumentCallback(value) : value;\n\n    // @ts-expect-error - For some reason TypeScript just don't want to match it, no matter how hard we try. I challenge you to try to remove it!\n    return valuesArray[index];\n  };\n}\n","export function buildMatchFn(args) {\n  return (string, options = {}) => {\n    const width = options.width;\n\n    const matchPattern =\n      (width && args.matchPatterns[width]) ||\n      args.matchPatterns[args.defaultMatchWidth];\n    const matchResult = string.match(matchPattern);\n\n    if (!matchResult) {\n      return null;\n    }\n    const matchedString = matchResult[0];\n\n    const parsePatterns =\n      (width && args.parsePatterns[width]) ||\n      args.parsePatterns[args.defaultParseWidth];\n\n    const key = Array.isArray(parsePatterns)\n      ? findIndex(parsePatterns, (pattern) => pattern.test(matchedString))\n      : // [TODO] -- I challenge you to fix the type\n        findKey(parsePatterns, (pattern) => pattern.test(matchedString));\n\n    let value;\n\n    value = args.valueCallback ? args.valueCallback(key) : key;\n    value = options.valueCallback\n      ? // [TODO] -- I challenge you to fix the type\n        options.valueCallback(value)\n      : value;\n\n    const rest = string.slice(matchedString.length);\n\n    return { value, rest };\n  };\n}\n\nfunction findKey(object, predicate) {\n  for (const key in object) {\n    if (\n      Object.prototype.hasOwnProperty.call(object, key) &&\n      predicate(object[key])\n    ) {\n      return key;\n    }\n  }\n  return undefined;\n}\n\nfunction findIndex(array, predicate) {\n  for (let key = 0; key < array.length; key++) {\n    if (predicate(array[key])) {\n      return key;\n    }\n  }\n  return undefined;\n}\n","export function buildMatchPatternFn(args) {\n  return (string, options = {}) => {\n    const matchResult = string.match(args.matchPattern);\n    if (!matchResult) return null;\n    const matchedString = matchResult[0];\n\n    const parseResult = string.match(args.parsePattern);\n    if (!parseResult) return null;\n    let value = args.valueCallback\n      ? args.valueCallback(parseResult[0])\n      : parseResult[0];\n\n    // [TODO] I challenge you to fix the type\n    value = options.valueCallback ? options.valueCallback(value) : value;\n\n    const rest = string.slice(matchedString.length);\n\n    return { value, rest };\n  };\n}\n","import { buildMatchFn } from \"../../_lib/buildMatchFn.js\";\nimport { buildMatchPatternFn } from \"../../_lib/buildMatchPatternFn.js\";\n\nconst matchOrdinalNumberPattern = /^(\\d+)(th|st|nd|rd)?/i;\nconst parseOrdinalNumberPattern = /\\d+/i;\n\nconst matchEraPatterns = {\n  narrow: /^(b|a)/i,\n  abbreviated: /^(b\\.?\\s?c\\.?|b\\.?\\s?c\\.?\\s?e\\.?|a\\.?\\s?d\\.?|c\\.?\\s?e\\.?)/i,\n  wide: /^(before christ|before common era|anno domini|common era)/i,\n};\nconst parseEraPatterns = {\n  any: [/^b/i, /^(a|c)/i],\n};\n\nconst matchQuarterPatterns = {\n  narrow: /^[1234]/i,\n  abbreviated: /^q[1234]/i,\n  wide: /^[1234](th|st|nd|rd)? quarter/i,\n};\nconst parseQuarterPatterns = {\n  any: [/1/i, /2/i, /3/i, /4/i],\n};\n\nconst matchMonthPatterns = {\n  narrow: /^[jfmasond]/i,\n  abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,\n  wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i,\n};\nconst parseMonthPatterns = {\n  narrow: [\n    /^j/i,\n    /^f/i,\n    /^m/i,\n    /^a/i,\n    /^m/i,\n    /^j/i,\n    /^j/i,\n    /^a/i,\n    /^s/i,\n    /^o/i,\n    /^n/i,\n    /^d/i,\n  ],\n\n  any: [\n    /^ja/i,\n    /^f/i,\n    /^mar/i,\n    /^ap/i,\n    /^may/i,\n    /^jun/i,\n    /^jul/i,\n    /^au/i,\n    /^s/i,\n    /^o/i,\n    /^n/i,\n    /^d/i,\n  ],\n};\n\nconst matchDayPatterns = {\n  narrow: /^[smtwf]/i,\n  short: /^(su|mo|tu|we|th|fr|sa)/i,\n  abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,\n  wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i,\n};\nconst parseDayPatterns = {\n  narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],\n  any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i],\n};\n\nconst matchDayPeriodPatterns = {\n  narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,\n  any: /^([ap]\\.?\\s?m\\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i,\n};\nconst parseDayPeriodPatterns = {\n  any: {\n    am: /^a/i,\n    pm: /^p/i,\n    midnight: /^mi/i,\n    noon: /^no/i,\n    morning: /morning/i,\n    afternoon: /afternoon/i,\n    evening: /evening/i,\n    night: /night/i,\n  },\n};\n\nexport const match = {\n  ordinalNumber: buildMatchPatternFn({\n    matchPattern: matchOrdinalNumberPattern,\n    parsePattern: parseOrdinalNumberPattern,\n    valueCallback: (value) => parseInt(value, 10),\n  }),\n\n  era: buildMatchFn({\n    matchPatterns: matchEraPatterns,\n    defaultMatchWidth: \"wide\",\n    parsePatterns: parseEraPatterns,\n    defaultParseWidth: \"any\",\n  }),\n\n  quarter: buildMatchFn({\n    matchPatterns: matchQuarterPatterns,\n    defaultMatchWidth: \"wide\",\n    parsePatterns: parseQuarterPatterns,\n    defaultParseWidth: \"any\",\n    valueCallback: (index) => index + 1,\n  }),\n\n  month: buildMatchFn({\n    matchPatterns: matchMonthPatterns,\n    defaultMatchWidth: \"wide\",\n    parsePatterns: parseMonthPatterns,\n    defaultParseWidth: \"any\",\n  }),\n\n  day: buildMatchFn({\n    matchPatterns: matchDayPatterns,\n    defaultMatchWidth: \"wide\",\n    parsePatterns: parseDayPatterns,\n    defaultParseWidth: \"any\",\n  }),\n\n  dayPeriod: buildMatchFn({\n    matchPatterns: matchDayPeriodPatterns,\n    defaultMatchWidth: \"any\",\n    parsePatterns: parseDayPeriodPatterns,\n    defaultParseWidth: \"any\",\n  }),\n};\n","import { formatDistance } from \"./en-US/_lib/formatDistance.js\";\nimport { formatLong } from \"./en-US/_lib/formatLong.js\";\nimport { formatRelative } from \"./en-US/_lib/formatRelative.js\";\nimport { localize } from \"./en-US/_lib/localize.js\";\nimport { match } from \"./en-US/_lib/match.js\";\n\n/**\n * @category Locales\n * @summary English locale (United States).\n * @language English\n * @iso-639-2 eng\n * @author Sasha Koss [@kossnocorp](https://github.com/kossnocorp)\n * @author Lesha Koss [@leshakoss](https://github.com/leshakoss)\n */\nexport const enUS = {\n  code: \"en-US\",\n  formatDistance: formatDistance,\n  formatLong: formatLong,\n  formatRelative: formatRelative,\n  localize: localize,\n  match: match,\n  options: {\n    weekStartsOn: 0 /* Sunday */,\n    firstWeekContainsDate: 1,\n  },\n};\n\n// Fallback for modularized imports:\nexport default enUS;\n","import { buildLocalizeFn } from \"../../_lib/buildLocalizeFn.js\";\n\nconst eraValues = {\n  narrow: [\"B\", \"A\"],\n  abbreviated: [\"BC\", \"AD\"],\n  wide: [\"Before Christ\", \"Anno Domini\"],\n};\n\nconst quarterValues = {\n  narrow: [\"1\", \"2\", \"3\", \"4\"],\n  abbreviated: [\"Q1\", \"Q2\", \"Q3\", \"Q4\"],\n  wide: [\"1st quarter\", \"2nd quarter\", \"3rd quarter\", \"4th quarter\"],\n};\n\n// Note: in English, the names of days of the week and months are capitalized.\n// If you are making a new locale based on this one, check if the same is true for the language you're working on.\n// Generally, formatted dates should look like they are in the middle of a sentence,\n// e.g. in Spanish language the weekdays and months should be in the lowercase.\nconst monthValues = {\n  narrow: [\"J\", \"F\", \"M\", \"A\", \"M\", \"J\", \"J\", \"A\", \"S\", \"O\", \"N\", \"D\"],\n  abbreviated: [\n    \"Jan\",\n    \"Feb\",\n    \"Mar\",\n    \"Apr\",\n    \"May\",\n    \"Jun\",\n    \"Jul\",\n    \"Aug\",\n    \"Sep\",\n    \"Oct\",\n    \"Nov\",\n    \"Dec\",\n  ],\n\n  wide: [\n    \"January\",\n    \"February\",\n    \"March\",\n    \"April\",\n    \"May\",\n    \"June\",\n    \"July\",\n    \"August\",\n    \"September\",\n    \"October\",\n    \"November\",\n    \"December\",\n  ],\n};\n\nconst dayValues = {\n  narrow: [\"S\", \"M\", \"T\", \"W\", \"T\", \"F\", \"S\"],\n  short: [\"Su\", \"Mo\", \"Tu\", \"We\", \"Th\", \"Fr\", \"Sa\"],\n  abbreviated: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"],\n  wide: [\n    \"Sunday\",\n    \"Monday\",\n    \"Tuesday\",\n    \"Wednesday\",\n    \"Thursday\",\n    \"Friday\",\n    \"Saturday\",\n  ],\n};\n\nconst dayPeriodValues = {\n  narrow: {\n    am: \"a\",\n    pm: \"p\",\n    midnight: \"mi\",\n    noon: \"n\",\n    morning: \"morning\",\n    afternoon: \"afternoon\",\n    evening: \"evening\",\n    night: \"night\",\n  },\n  abbreviated: {\n    am: \"AM\",\n    pm: \"PM\",\n    midnight: \"midnight\",\n    noon: \"noon\",\n    morning: \"morning\",\n    afternoon: \"afternoon\",\n    evening: \"evening\",\n    night: \"night\",\n  },\n  wide: {\n    am: \"a.m.\",\n    pm: \"p.m.\",\n    midnight: \"midnight\",\n    noon: \"noon\",\n    morning: \"morning\",\n    afternoon: \"afternoon\",\n    evening: \"evening\",\n    night: \"night\",\n  },\n};\n\nconst formattingDayPeriodValues = {\n  narrow: {\n    am: \"a\",\n    pm: \"p\",\n    midnight: \"mi\",\n    noon: \"n\",\n    morning: \"in the morning\",\n    afternoon: \"in the afternoon\",\n    evening: \"in the evening\",\n    night: \"at night\",\n  },\n  abbreviated: {\n    am: \"AM\",\n    pm: \"PM\",\n    midnight: \"midnight\",\n    noon: \"noon\",\n    morning: \"in the morning\",\n    afternoon: \"in the afternoon\",\n    evening: \"in the evening\",\n    night: \"at night\",\n  },\n  wide: {\n    am: \"a.m.\",\n    pm: \"p.m.\",\n    midnight: \"midnight\",\n    noon: \"noon\",\n    morning: \"in the morning\",\n    afternoon: \"in the afternoon\",\n    evening: \"in the evening\",\n    night: \"at night\",\n  },\n};\n\nconst ordinalNumber = (dirtyNumber, _options) => {\n  const number = Number(dirtyNumber);\n\n  // If ordinal numbers depend on context, for example,\n  // if they are different for different grammatical genders,\n  // use `options.unit`.\n  //\n  // `unit` can be 'year', 'quarter', 'month', 'week', 'date', 'dayOfYear',\n  // 'day', 'hour', 'minute', 'second'.\n\n  const rem100 = number % 100;\n  if (rem100 > 20 || rem100 < 10) {\n    switch (rem100 % 10) {\n      case 1:\n        return number + \"st\";\n      case 2:\n        return number + \"nd\";\n      case 3:\n        return number + \"rd\";\n    }\n  }\n  return number + \"th\";\n};\n\nexport const localize = {\n  ordinalNumber,\n\n  era: buildLocalizeFn({\n    values: eraValues,\n    defaultWidth: \"wide\",\n  }),\n\n  quarter: buildLocalizeFn({\n    values: quarterValues,\n    defaultWidth: \"wide\",\n    argumentCallback: (quarter) => quarter - 1,\n  }),\n\n  month: buildLocalizeFn({\n    values: monthValues,\n    defaultWidth: \"wide\",\n  }),\n\n  day: buildLocalizeFn({\n    values: dayValues,\n    defaultWidth: \"wide\",\n  }),\n\n  dayPeriod: buildLocalizeFn({\n    values: dayPeriodValues,\n    defaultWidth: \"wide\",\n    formattingValues: formattingDayPeriodValues,\n    defaultFormattingWidth: \"wide\",\n  }),\n};\n","import { millisecondsInWeek } from \"./constants.js\";\nimport { startOfISOWeek } from \"./startOfISOWeek.js\";\nimport { startOfISOWeekYear } from \"./startOfISOWeekYear.js\";\nimport { toDate } from \"./toDate.js\";\n\n/**\n * The {@link getISOWeek} function options.\n */\n\n/**\n * @name getISOWeek\n * @category ISO Week Helpers\n * @summary Get the ISO week of the given date.\n *\n * @description\n * Get the ISO week of the given date.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @param date - The given date\n * @param options - The options\n *\n * @returns The ISO week\n *\n * @example\n * // Which week of the ISO-week numbering year is 2 January 2005?\n * const result = getISOWeek(new Date(2005, 0, 2))\n * //=> 53\n */\nexport function getISOWeek(date, options) {\n  const _date = toDate(date, options?.in);\n  const diff = +startOfISOWeek(_date) - +startOfISOWeekYear(_date);\n\n  // Round the number of weeks to the nearest integer because the number of\n  // milliseconds in a week is not constant (e.g. it's different in the week of\n  // the daylight saving time clock shift).\n  return Math.round(diff / millisecondsInWeek) + 1;\n}\n\n// Fallback for modularized imports:\nexport default getISOWeek;\n","import { constructFrom } from \"./constructFrom.js\";\nimport { getISOWeekYear } from \"./getISOWeekYear.js\";\nimport { startOfISOWeek } from \"./startOfISOWeek.js\";\n\n/**\n * The {@link startOfISOWeekYear} function options.\n */\n\n/**\n * @name startOfISOWeekYear\n * @category ISO Week-Numbering Year Helpers\n * @summary Return the start of an ISO week-numbering year for the given date.\n *\n * @description\n * Return the start of an ISO week-numbering year,\n * which always starts 3 days before the year's first Thursday.\n * The result will be in the local timezone.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The original date\n * @param options - An object with options\n *\n * @returns The start of an ISO week-numbering year\n *\n * @example\n * // The start of an ISO week-numbering year for 2 July 2005:\n * const result = startOfISOWeekYear(new Date(2005, 6, 2))\n * //=> Mon Jan 03 2005 00:00:00\n */\nexport function startOfISOWeekYear(date, options) {\n  const year = getISOWeekYear(date, options);\n  const fourthOfJanuary = constructFrom(options?.in || date, 0);\n  fourthOfJanuary.setFullYear(year, 0, 4);\n  fourthOfJanuary.setHours(0, 0, 0, 0);\n  return startOfISOWeek(fourthOfJanuary);\n}\n\n// Fallback for modularized imports:\nexport default startOfISOWeekYear;\n","import { getDefaultOptions } from \"./_lib/defaultOptions.js\";\nimport { constructFrom } from \"./constructFrom.js\";\nimport { startOfWeek } from \"./startOfWeek.js\";\nimport { toDate } from \"./toDate.js\";\n\n/**\n * The {@link getWeekYear} function options.\n */\n\n/**\n * @name getWeekYear\n * @category Week-Numbering Year Helpers\n * @summary Get the local week-numbering year of the given date.\n *\n * @description\n * Get the local week-numbering year of the given date.\n * The exact calculation depends on the values of\n * `options.weekStartsOn` (which is the index of the first day of the week)\n * and `options.firstWeekContainsDate` (which is the day of January, which is always in\n * the first week of the week-numbering year)\n *\n * Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system\n *\n * @param date - The given date\n * @param options - An object with options.\n *\n * @returns The local week-numbering year\n *\n * @example\n * // Which week numbering year is 26 December 2004 with the default settings?\n * const result = getWeekYear(new Date(2004, 11, 26))\n * //=> 2005\n *\n * @example\n * // Which week numbering year is 26 December 2004 if week starts on Saturday?\n * const result = getWeekYear(new Date(2004, 11, 26), { weekStartsOn: 6 })\n * //=> 2004\n *\n * @example\n * // Which week numbering year is 26 December 2004 if the first week contains 4 January?\n * const result = getWeekYear(new Date(2004, 11, 26), { firstWeekContainsDate: 4 })\n * //=> 2004\n */\nexport function getWeekYear(date, options) {\n  const _date = toDate(date, options?.in);\n  const year = _date.getFullYear();\n\n  const defaultOptions = getDefaultOptions();\n  const firstWeekContainsDate =\n    options?.firstWeekContainsDate ??\n    options?.locale?.options?.firstWeekContainsDate ??\n    defaultOptions.firstWeekContainsDate ??\n    defaultOptions.locale?.options?.firstWeekContainsDate ??\n    1;\n\n  const firstWeekOfNextYear = constructFrom(options?.in || date, 0);\n  firstWeekOfNextYear.setFullYear(year + 1, 0, firstWeekContainsDate);\n  firstWeekOfNextYear.setHours(0, 0, 0, 0);\n  const startOfNextYear = startOfWeek(firstWeekOfNextYear, options);\n\n  const firstWeekOfThisYear = constructFrom(options?.in || date, 0);\n  firstWeekOfThisYear.setFullYear(year, 0, firstWeekContainsDate);\n  firstWeekOfThisYear.setHours(0, 0, 0, 0);\n  const startOfThisYear = startOfWeek(firstWeekOfThisYear, options);\n\n  if (+_date >= +startOfNextYear) {\n    return year + 1;\n  } else if (+_date >= +startOfThisYear) {\n    return year;\n  } else {\n    return year - 1;\n  }\n}\n\n// Fallback for modularized imports:\nexport default getWeekYear;\n","import { millisecondsInWeek } from \"./constants.js\";\nimport { startOfWeek } from \"./startOfWeek.js\";\nimport { startOfWeekYear } from \"./startOfWeekYear.js\";\nimport { toDate } from \"./toDate.js\";\n\n/**\n * The {@link getWeek} function options.\n */\n\n/**\n * @name getWeek\n * @category Week Helpers\n * @summary Get the local week index of the given date.\n *\n * @description\n * Get the local week index of the given date.\n * The exact calculation depends on the values of\n * `options.weekStartsOn` (which is the index of the first day of the week)\n * and `options.firstWeekContainsDate` (which is the day of January, which is always in\n * the first week of the week-numbering year)\n *\n * Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system\n *\n * @param date - The given date\n * @param options - An object with options\n *\n * @returns The week\n *\n * @example\n * // Which week of the local week numbering year is 2 January 2005 with default options?\n * const result = getWeek(new Date(2005, 0, 2))\n * //=> 2\n *\n * @example\n * // Which week of the local week numbering year is 2 January 2005,\n * // if Monday is the first day of the week,\n * // and the first week of the year always contains 4 January?\n * const result = getWeek(new Date(2005, 0, 2), {\n *   weekStartsOn: 1,\n *   firstWeekContainsDate: 4\n * })\n * //=> 53\n */\nexport function getWeek(date, options) {\n  const _date = toDate(date, options?.in);\n  const diff = +startOfWeek(_date, options) - +startOfWeekYear(_date, options);\n\n  // Round the number of weeks to the nearest integer because the number of\n  // milliseconds in a week is not constant (e.g. it's different in the week of\n  // the daylight saving time clock shift).\n  return Math.round(diff / millisecondsInWeek) + 1;\n}\n\n// Fallback for modularized imports:\nexport default getWeek;\n","import { getDefaultOptions } from \"./_lib/defaultOptions.js\";\nimport { constructFrom } from \"./constructFrom.js\";\nimport { getWeekYear } from \"./getWeekYear.js\";\nimport { startOfWeek } from \"./startOfWeek.js\";\n\n/**\n * The {@link startOfWeekYear} function options.\n */\n\n/**\n * @name startOfWeekYear\n * @category Week-Numbering Year Helpers\n * @summary Return the start of a local week-numbering year for the given date.\n *\n * @description\n * Return the start of a local week-numbering year.\n * The exact calculation depends on the values of\n * `options.weekStartsOn` (which is the index of the first day of the week)\n * and `options.firstWeekContainsDate` (which is the day of January, which is always in\n * the first week of the week-numbering year)\n *\n * Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type.\n *\n * @param date - The original date\n * @param options - An object with options\n *\n * @returns The start of a week-numbering year\n *\n * @example\n * // The start of an a week-numbering year for 2 July 2005 with default settings:\n * const result = startOfWeekYear(new Date(2005, 6, 2))\n * //=> Sun Dec 26 2004 00:00:00\n *\n * @example\n * // The start of a week-numbering year for 2 July 2005\n * // if Monday is the first day of week\n * // and 4 January is always in the first week of the year:\n * const result = startOfWeekYear(new Date(2005, 6, 2), {\n *   weekStartsOn: 1,\n *   firstWeekContainsDate: 4\n * })\n * //=> Mon Jan 03 2005 00:00:00\n */\nexport function startOfWeekYear(date, options) {\n  const defaultOptions = getDefaultOptions();\n  const firstWeekContainsDate =\n    options?.firstWeekContainsDate ??\n    options?.locale?.options?.firstWeekContainsDate ??\n    defaultOptions.firstWeekContainsDate ??\n    defaultOptions.locale?.options?.firstWeekContainsDate ??\n    1;\n\n  const year = getWeekYear(date, options);\n  const firstWeek = constructFrom(options?.in || date, 0);\n  firstWeek.setFullYear(year, 0, firstWeekContainsDate);\n  firstWeek.setHours(0, 0, 0, 0);\n  const _date = startOfWeek(firstWeek, options);\n  return _date;\n}\n\n// Fallback for modularized imports:\nexport default startOfWeekYear;\n","export function addLeadingZeros(number, targetLength) {\n  const sign = number < 0 ? \"-\" : \"\";\n  const output = Math.abs(number).toString().padStart(targetLength, \"0\");\n  return sign + output;\n}\n","import { addLeadingZeros } from \"../addLeadingZeros.js\";\n\n/*\n * |     | Unit                           |     | Unit                           |\n * |-----|--------------------------------|-----|--------------------------------|\n * |  a  | AM, PM                         |  A* |                                |\n * |  d  | Day of month                   |  D  |                                |\n * |  h  | Hour [1-12]                    |  H  | Hour [0-23]                    |\n * |  m  | Minute                         |  M  | Month                          |\n * |  s  | Second                         |  S  | Fraction of second             |\n * |  y  | Year (abs)                     |  Y  |                                |\n *\n * Letters marked by * are not implemented but reserved by Unicode standard.\n */\n\nexport const lightFormatters = {\n  // Year\n  y(date, token) {\n    // From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_tokens\n    // | Year     |     y | yy |   yyy |  yyyy | yyyyy |\n    // |----------|-------|----|-------|-------|-------|\n    // | AD 1     |     1 | 01 |   001 |  0001 | 00001 |\n    // | AD 12    |    12 | 12 |   012 |  0012 | 00012 |\n    // | AD 123   |   123 | 23 |   123 |  0123 | 00123 |\n    // | AD 1234  |  1234 | 34 |  1234 |  1234 | 01234 |\n    // | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 |\n\n    const signedYear = date.getFullYear();\n    // Returns 1 for 1 BC (which is year 0 in JavaScript)\n    const year = signedYear > 0 ? signedYear : 1 - signedYear;\n    return addLeadingZeros(token === \"yy\" ? year % 100 : year, token.length);\n  },\n\n  // Month\n  M(date, token) {\n    const month = date.getMonth();\n    return token === \"M\" ? String(month + 1) : addLeadingZeros(month + 1, 2);\n  },\n\n  // Day of the month\n  d(date, token) {\n    return addLeadingZeros(date.getDate(), token.length);\n  },\n\n  // AM or PM\n  a(date, token) {\n    const dayPeriodEnumValue = date.getHours() / 12 >= 1 ? \"pm\" : \"am\";\n\n    switch (token) {\n      case \"a\":\n      case \"aa\":\n        return dayPeriodEnumValue.toUpperCase();\n      case \"aaa\":\n        return dayPeriodEnumValue;\n      case \"aaaaa\":\n        return dayPeriodEnumValue[0];\n      case \"aaaa\":\n      default:\n        return dayPeriodEnumValue === \"am\" ? \"a.m.\" : \"p.m.\";\n    }\n  },\n\n  // Hour [1-12]\n  h(date, token) {\n    return addLeadingZeros(date.getHours() % 12 || 12, token.length);\n  },\n\n  // Hour [0-23]\n  H(date, token) {\n    return addLeadingZeros(date.getHours(), token.length);\n  },\n\n  // Minute\n  m(date, token) {\n    return addLeadingZeros(date.getMinutes(), token.length);\n  },\n\n  // Second\n  s(date, token) {\n    return addLeadingZeros(date.getSeconds(), token.length);\n  },\n\n  // Fraction of second\n  S(date, token) {\n    const numberOfDigits = token.length;\n    const milliseconds = date.getMilliseconds();\n    const fractionalSeconds = Math.trunc(\n      milliseconds * Math.pow(10, numberOfDigits - 3),\n    );\n    return addLeadingZeros(fractionalSeconds, token.length);\n  },\n};\n","import { getDayOfYear } from \"../../getDayOfYear.js\";\nimport { getISOWeek } from \"../../getISOWeek.js\";\nimport { getISOWeekYear } from \"../../getISOWeekYear.js\";\nimport { getWeek } from \"../../getWeek.js\";\nimport { getWeekYear } from \"../../getWeekYear.js\";\n\nimport { addLeadingZeros } from \"../addLeadingZeros.js\";\nimport { lightFormatters } from \"./lightFormatters.js\";\n\nconst dayPeriodEnum = {\n  am: \"am\",\n  pm: \"pm\",\n  midnight: \"midnight\",\n  noon: \"noon\",\n  morning: \"morning\",\n  afternoon: \"afternoon\",\n  evening: \"evening\",\n  night: \"night\",\n};\n\n/*\n * |     | Unit                           |     | Unit                           |\n * |-----|--------------------------------|-----|--------------------------------|\n * |  a  | AM, PM                         |  A* | Milliseconds in day            |\n * |  b  | AM, PM, noon, midnight         |  B  | Flexible day period            |\n * |  c  | Stand-alone local day of week  |  C* | Localized hour w/ day period   |\n * |  d  | Day of month                   |  D  | Day of year                    |\n * |  e  | Local day of week              |  E  | Day of week                    |\n * |  f  |                                |  F* | Day of week in month           |\n * |  g* | Modified Julian day            |  G  | Era                            |\n * |  h  | Hour [1-12]                    |  H  | Hour [0-23]                    |\n * |  i! | ISO day of week                |  I! | ISO week of year               |\n * |  j* | Localized hour w/ day period   |  J* | Localized hour w/o day period  |\n * |  k  | Hour [1-24]                    |  K  | Hour [0-11]                    |\n * |  l* | (deprecated)                   |  L  | Stand-alone month              |\n * |  m  | Minute                         |  M  | Month                          |\n * |  n  |                                |  N  |                                |\n * |  o! | Ordinal number modifier        |  O  | Timezone (GMT)                 |\n * |  p! | Long localized time            |  P! | Long localized date            |\n * |  q  | Stand-alone quarter            |  Q  | Quarter                        |\n * |  r* | Related Gregorian year         |  R! | ISO week-numbering year        |\n * |  s  | Second                         |  S  | Fraction of second             |\n * |  t! | Seconds timestamp              |  T! | Milliseconds timestamp         |\n * |  u  | Extended year                  |  U* | Cyclic year                    |\n * |  v* | Timezone (generic non-locat.)  |  V* | Timezone (location)            |\n * |  w  | Local week of year             |  W* | Week of month                  |\n * |  x  | Timezone (ISO-8601 w/o Z)      |  X  | Timezone (ISO-8601)            |\n * |  y  | Year (abs)                     |  Y  | Local week-numbering year      |\n * |  z  | Timezone (specific non-locat.) |  Z* | Timezone (aliases)             |\n *\n * Letters marked by * are not implemented but reserved by Unicode standard.\n *\n * Letters marked by ! are non-standard, but implemented by date-fns:\n * - `o` modifies the previous token to turn it into an ordinal (see `format` docs)\n * - `i` is ISO day of week. For `i` and `ii` is returns numeric ISO week days,\n *   i.e. 7 for Sunday, 1 for Monday, etc.\n * - `I` is ISO week of year, as opposed to `w` which is local week of year.\n * - `R` is ISO week-numbering year, as opposed to `Y` which is local week-numbering year.\n *   `R` is supposed to be used in conjunction with `I` and `i`\n *   for universal ISO week-numbering date, whereas\n *   `Y` is supposed to be used in conjunction with `w` and `e`\n *   for week-numbering date specific to the locale.\n * - `P` is long localized date format\n * - `p` is long localized time format\n */\n\nexport const formatters = {\n  // Era\n  G: function (date, token, localize) {\n    const era = date.getFullYear() > 0 ? 1 : 0;\n    switch (token) {\n      // AD, BC\n      case \"G\":\n      case \"GG\":\n      case \"GGG\":\n        return localize.era(era, { width: \"abbreviated\" });\n      // A, B\n      case \"GGGGG\":\n        return localize.era(era, { width: \"narrow\" });\n      // Anno Domini, Before Christ\n      case \"GGGG\":\n      default:\n        return localize.era(era, { width: \"wide\" });\n    }\n  },\n\n  // Year\n  y: function (date, token, localize) {\n    // Ordinal number\n    if (token === \"yo\") {\n      const signedYear = date.getFullYear();\n      // Returns 1 for 1 BC (which is year 0 in JavaScript)\n      const year = signedYear > 0 ? signedYear : 1 - signedYear;\n      return localize.ordinalNumber(year, { unit: \"year\" });\n    }\n\n    return lightFormatters.y(date, token);\n  },\n\n  // Local week-numbering year\n  Y: function (date, token, localize, options) {\n    const signedWeekYear = getWeekYear(date, options);\n    // Returns 1 for 1 BC (which is year 0 in JavaScript)\n    const weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear;\n\n    // Two digit year\n    if (token === \"YY\") {\n      const twoDigitYear = weekYear % 100;\n      return addLeadingZeros(twoDigitYear, 2);\n    }\n\n    // Ordinal number\n    if (token === \"Yo\") {\n      return localize.ordinalNumber(weekYear, { unit: \"year\" });\n    }\n\n    // Padding\n    return addLeadingZeros(weekYear, token.length);\n  },\n\n  // ISO week-numbering year\n  R: function (date, token) {\n    const isoWeekYear = getISOWeekYear(date);\n\n    // Padding\n    return addLeadingZeros(isoWeekYear, token.length);\n  },\n\n  // Extended year. This is a single number designating the year of this calendar system.\n  // The main difference between `y` and `u` localizers are B.C. years:\n  // | Year | `y` | `u` |\n  // |------|-----|-----|\n  // | AC 1 |   1 |   1 |\n  // | BC 1 |   1 |   0 |\n  // | BC 2 |   2 |  -1 |\n  // Also `yy` always returns the last two digits of a year,\n  // while `uu` pads single digit years to 2 characters and returns other years unchanged.\n  u: function (date, token) {\n    const year = date.getFullYear();\n    return addLeadingZeros(year, token.length);\n  },\n\n  // Quarter\n  Q: function (date, token, localize) {\n    const quarter = Math.ceil((date.getMonth() + 1) / 3);\n    switch (token) {\n      // 1, 2, 3, 4\n      case \"Q\":\n        return String(quarter);\n      // 01, 02, 03, 04\n      case \"QQ\":\n        return addLeadingZeros(quarter, 2);\n      // 1st, 2nd, 3rd, 4th\n      case \"Qo\":\n        return localize.ordinalNumber(quarter, { unit: \"quarter\" });\n      // Q1, Q2, Q3, Q4\n      case \"QQQ\":\n        return localize.quarter(quarter, {\n          width: \"abbreviated\",\n          context: \"formatting\",\n        });\n      // 1, 2, 3, 4 (narrow quarter; could be not numerical)\n      case \"QQQQQ\":\n        return localize.quarter(quarter, {\n          width: \"narrow\",\n          context: \"formatting\",\n        });\n      // 1st quarter, 2nd quarter, ...\n      case \"QQQQ\":\n      default:\n        return localize.quarter(quarter, {\n          width: \"wide\",\n          context: \"formatting\",\n        });\n    }\n  },\n\n  // Stand-alone quarter\n  q: function (date, token, localize) {\n    const quarter = Math.ceil((date.getMonth() + 1) / 3);\n    switch (token) {\n      // 1, 2, 3, 4\n      case \"q\":\n        return String(quarter);\n      // 01, 02, 03, 04\n      case \"qq\":\n        return addLeadingZeros(quarter, 2);\n      // 1st, 2nd, 3rd, 4th\n      case \"qo\":\n        return localize.ordinalNumber(quarter, { unit: \"quarter\" });\n      // Q1, Q2, Q3, Q4\n      case \"qqq\":\n        return localize.quarter(quarter, {\n          width: \"abbreviated\",\n          context: \"standalone\",\n        });\n      // 1, 2, 3, 4 (narrow quarter; could be not numerical)\n      case \"qqqqq\":\n        return localize.quarter(quarter, {\n          width: \"narrow\",\n          context: \"standalone\",\n        });\n      // 1st quarter, 2nd quarter, ...\n      case \"qqqq\":\n      default:\n        return localize.quarter(quarter, {\n          width: \"wide\",\n          context: \"standalone\",\n        });\n    }\n  },\n\n  // Month\n  M: function (date, token, localize) {\n    const month = date.getMonth();\n    switch (token) {\n      case \"M\":\n      case \"MM\":\n        return lightFormatters.M(date, token);\n      // 1st, 2nd, ..., 12th\n      case \"Mo\":\n        return localize.ordinalNumber(month + 1, { unit: \"month\" });\n      // Jan, Feb, ..., Dec\n      case \"MMM\":\n        return localize.month(month, {\n          width: \"abbreviated\",\n          context: \"formatting\",\n        });\n      // J, F, ..., D\n      case \"MMMMM\":\n        return localize.month(month, {\n          width: \"narrow\",\n          context: \"formatting\",\n        });\n      // January, February, ..., December\n      case \"MMMM\":\n      default:\n        return localize.month(month, { width: \"wide\", context: \"formatting\" });\n    }\n  },\n\n  // Stand-alone month\n  L: function (date, token, localize) {\n    const month = date.getMonth();\n    switch (token) {\n      // 1, 2, ..., 12\n      case \"L\":\n        return String(month + 1);\n      // 01, 02, ..., 12\n      case \"LL\":\n        return addLeadingZeros(month + 1, 2);\n      // 1st, 2nd, ..., 12th\n      case \"Lo\":\n        return localize.ordinalNumber(month + 1, { unit: \"month\" });\n      // Jan, Feb, ..., Dec\n      case \"LLL\":\n        return localize.month(month, {\n          width: \"abbreviated\",\n          context: \"standalone\",\n        });\n      // J, F, ..., D\n      case \"LLLLL\":\n        return localize.month(month, {\n          width: \"narrow\",\n          context: \"standalone\",\n        });\n      // January, February, ..., December\n      case \"LLLL\":\n      default:\n        return localize.month(month, { width: \"wide\", context: \"standalone\" });\n    }\n  },\n\n  // Local week of year\n  w: function (date, token, localize, options) {\n    const week = getWeek(date, options);\n\n    if (token === \"wo\") {\n      return localize.ordinalNumber(week, { unit: \"week\" });\n    }\n\n    return addLeadingZeros(week, token.length);\n  },\n\n  // ISO week of year\n  I: function (date, token, localize) {\n    const isoWeek = getISOWeek(date);\n\n    if (token === \"Io\") {\n      return localize.ordinalNumber(isoWeek, { unit: \"week\" });\n    }\n\n    return addLeadingZeros(isoWeek, token.length);\n  },\n\n  // Day of the month\n  d: function (date, token, localize) {\n    if (token === \"do\") {\n      return localize.ordinalNumber(date.getDate(), { unit: \"date\" });\n    }\n\n    return lightFormatters.d(date, token);\n  },\n\n  // Day of year\n  D: function (date, token, localize) {\n    const dayOfYear = getDayOfYear(date);\n\n    if (token === \"Do\") {\n      return localize.ordinalNumber(dayOfYear, { unit: \"dayOfYear\" });\n    }\n\n    return addLeadingZeros(dayOfYear, token.length);\n  },\n\n  // Day of week\n  E: function (date, token, localize) {\n    const dayOfWeek = date.getDay();\n    switch (token) {\n      // Tue\n      case \"E\":\n      case \"EE\":\n      case \"EEE\":\n        return localize.day(dayOfWeek, {\n          width: \"abbreviated\",\n          context: \"formatting\",\n        });\n      // T\n      case \"EEEEE\":\n        return localize.day(dayOfWeek, {\n          width: \"narrow\",\n          context: \"formatting\",\n        });\n      // Tu\n      case \"EEEEEE\":\n        return localize.day(dayOfWeek, {\n          width: \"short\",\n          context: \"formatting\",\n        });\n      // Tuesday\n      case \"EEEE\":\n      default:\n        return localize.day(dayOfWeek, {\n          width: \"wide\",\n          context: \"formatting\",\n        });\n    }\n  },\n\n  // Local day of week\n  e: function (date, token, localize, options) {\n    const dayOfWeek = date.getDay();\n    const localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;\n    switch (token) {\n      // Numerical value (Nth day of week with current locale or weekStartsOn)\n      case \"e\":\n        return String(localDayOfWeek);\n      // Padded numerical value\n      case \"ee\":\n        return addLeadingZeros(localDayOfWeek, 2);\n      // 1st, 2nd, ..., 7th\n      case \"eo\":\n        return localize.ordinalNumber(localDayOfWeek, { unit: \"day\" });\n      case \"eee\":\n        return localize.day(dayOfWeek, {\n          width: \"abbreviated\",\n          context: \"formatting\",\n        });\n      // T\n      case \"eeeee\":\n        return localize.day(dayOfWeek, {\n          width: \"narrow\",\n          context: \"formatting\",\n        });\n      // Tu\n      case \"eeeeee\":\n        return localize.day(dayOfWeek, {\n          width: \"short\",\n          context: \"formatting\",\n        });\n      // Tuesday\n      case \"eeee\":\n      default:\n        return localize.day(dayOfWeek, {\n          width: \"wide\",\n          context: \"formatting\",\n        });\n    }\n  },\n\n  // Stand-alone local day of week\n  c: function (date, token, localize, options) {\n    const dayOfWeek = date.getDay();\n    const localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;\n    switch (token) {\n      // Numerical value (same as in `e`)\n      case \"c\":\n        return String(localDayOfWeek);\n      // Padded numerical value\n      case \"cc\":\n        return addLeadingZeros(localDayOfWeek, token.length);\n      // 1st, 2nd, ..., 7th\n      case \"co\":\n        return localize.ordinalNumber(localDayOfWeek, { unit: \"day\" });\n      case \"ccc\":\n        return localize.day(dayOfWeek, {\n          width: \"abbreviated\",\n          context: \"standalone\",\n        });\n      // T\n      case \"ccccc\":\n        return localize.day(dayOfWeek, {\n          width: \"narrow\",\n          context: \"standalone\",\n        });\n      // Tu\n      case \"cccccc\":\n        return localize.day(dayOfWeek, {\n          width: \"short\",\n          context: \"standalone\",\n        });\n      // Tuesday\n      case \"cccc\":\n      default:\n        return localize.day(dayOfWeek, {\n          width: \"wide\",\n          context: \"standalone\",\n        });\n    }\n  },\n\n  // ISO day of week\n  i: function (date, token, localize) {\n    const dayOfWeek = date.getDay();\n    const isoDayOfWeek = dayOfWeek === 0 ? 7 : dayOfWeek;\n    switch (token) {\n      // 2\n      case \"i\":\n        return String(isoDayOfWeek);\n      // 02\n      case \"ii\":\n        return addLeadingZeros(isoDayOfWeek, token.length);\n      // 2nd\n      case \"io\":\n        return localize.ordinalNumber(isoDayOfWeek, { unit: \"day\" });\n      // Tue\n      case \"iii\":\n        return localize.day(dayOfWeek, {\n          width: \"abbreviated\",\n          context: \"formatting\",\n        });\n      // T\n      case \"iiiii\":\n        return localize.day(dayOfWeek, {\n          width: \"narrow\",\n          context: \"formatting\",\n        });\n      // Tu\n      case \"iiiiii\":\n        return localize.day(dayOfWeek, {\n          width: \"short\",\n          context: \"formatting\",\n        });\n      // Tuesday\n      case \"iiii\":\n      default:\n        return localize.day(dayOfWeek, {\n          width: \"wide\",\n          context: \"formatting\",\n        });\n    }\n  },\n\n  // AM or PM\n  a: function (date, token, localize) {\n    const hours = date.getHours();\n    const dayPeriodEnumValue = hours / 12 >= 1 ? \"pm\" : \"am\";\n\n    switch (token) {\n      case \"a\":\n      case \"aa\":\n        return localize.dayPeriod(dayPeriodEnumValue, {\n          width: \"abbreviated\",\n          context: \"formatting\",\n        });\n      case \"aaa\":\n        return localize\n          .dayPeriod(dayPeriodEnumValue, {\n            width: \"abbreviated\",\n            context: \"formatting\",\n          })\n          .toLowerCase();\n      case \"aaaaa\":\n        return localize.dayPeriod(dayPeriodEnumValue, {\n          width: \"narrow\",\n          context: \"formatting\",\n        });\n      case \"aaaa\":\n      default:\n        return localize.dayPeriod(dayPeriodEnumValue, {\n          width: \"wide\",\n          context: \"formatting\",\n        });\n    }\n  },\n\n  // AM, PM, midnight, noon\n  b: function (date, token, localize) {\n    const hours = date.getHours();\n    let dayPeriodEnumValue;\n    if (hours === 12) {\n      dayPeriodEnumValue = dayPeriodEnum.noon;\n    } else if (hours === 0) {\n      dayPeriodEnumValue = dayPeriodEnum.midnight;\n    } else {\n      dayPeriodEnumValue = hours / 12 >= 1 ? \"pm\" : \"am\";\n    }\n\n    switch (token) {\n      case \"b\":\n      case \"bb\":\n        return localize.dayPeriod(dayPeriodEnumValue, {\n          width: \"abbreviated\",\n          context: \"formatting\",\n        });\n      case \"bbb\":\n        return localize\n          .dayPeriod(dayPeriodEnumValue, {\n            width: \"abbreviated\",\n            context: \"formatting\",\n          })\n          .toLowerCase();\n      case \"bbbbb\":\n        return localize.dayPeriod(dayPeriodEnumValue, {\n          width: \"narrow\",\n          context: \"formatting\",\n        });\n      case \"bbbb\":\n      default:\n        return localize.dayPeriod(dayPeriodEnumValue, {\n          width: \"wide\",\n          context: \"formatting\",\n        });\n    }\n  },\n\n  // in the morning, in the afternoon, in the evening, at night\n  B: function (date, token, localize) {\n    const hours = date.getHours();\n    let dayPeriodEnumValue;\n    if (hours >= 17) {\n      dayPeriodEnumValue = dayPeriodEnum.evening;\n    } else if (hours >= 12) {\n      dayPeriodEnumValue = dayPeriodEnum.afternoon;\n    } else if (hours >= 4) {\n      dayPeriodEnumValue = dayPeriodEnum.morning;\n    } else {\n      dayPeriodEnumValue = dayPeriodEnum.night;\n    }\n\n    switch (token) {\n      case \"B\":\n      case \"BB\":\n      case \"BBB\":\n        return localize.dayPeriod(dayPeriodEnumValue, {\n          width: \"abbreviated\",\n          context: \"formatting\",\n        });\n      case \"BBBBB\":\n        return localize.dayPeriod(dayPeriodEnumValue, {\n          width: \"narrow\",\n          context: \"formatting\",\n        });\n      case \"BBBB\":\n      default:\n        return localize.dayPeriod(dayPeriodEnumValue, {\n          width: \"wide\",\n          context: \"formatting\",\n        });\n    }\n  },\n\n  // Hour [1-12]\n  h: function (date, token, localize) {\n    if (token === \"ho\") {\n      let hours = date.getHours() % 12;\n      if (hours === 0) hours = 12;\n      return localize.ordinalNumber(hours, { unit: \"hour\" });\n    }\n\n    return lightFormatters.h(date, token);\n  },\n\n  // Hour [0-23]\n  H: function (date, token, localize) {\n    if (token === \"Ho\") {\n      return localize.ordinalNumber(date.getHours(), { unit: \"hour\" });\n    }\n\n    return lightFormatters.H(date, token);\n  },\n\n  // Hour [0-11]\n  K: function (date, token, localize) {\n    const hours = date.getHours() % 12;\n\n    if (token === \"Ko\") {\n      return localize.ordinalNumber(hours, { unit: \"hour\" });\n    }\n\n    return addLeadingZeros(hours, token.length);\n  },\n\n  // Hour [1-24]\n  k: function (date, token, localize) {\n    let hours = date.getHours();\n    if (hours === 0) hours = 24;\n\n    if (token === \"ko\") {\n      return localize.ordinalNumber(hours, { unit: \"hour\" });\n    }\n\n    return addLeadingZeros(hours, token.length);\n  },\n\n  // Minute\n  m: function (date, token, localize) {\n    if (token === \"mo\") {\n      return localize.ordinalNumber(date.getMinutes(), { unit: \"minute\" });\n    }\n\n    return lightFormatters.m(date, token);\n  },\n\n  // Second\n  s: function (date, token, localize) {\n    if (token === \"so\") {\n      return localize.ordinalNumber(date.getSeconds(), { unit: \"second\" });\n    }\n\n    return lightFormatters.s(date, token);\n  },\n\n  // Fraction of second\n  S: function (date, token) {\n    return lightFormatters.S(date, token);\n  },\n\n  // Timezone (ISO-8601. If offset is 0, output is always `'Z'`)\n  X: function (date, token, _localize) {\n    const timezoneOffset = date.getTimezoneOffset();\n\n    if (timezoneOffset === 0) {\n      return \"Z\";\n    }\n\n    switch (token) {\n      // Hours and optional minutes\n      case \"X\":\n        return formatTimezoneWithOptionalMinutes(timezoneOffset);\n\n      // Hours, minutes and optional seconds without `:` delimiter\n      // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n      // so this token always has the same output as `XX`\n      case \"XXXX\":\n      case \"XX\": // Hours and minutes without `:` delimiter\n        return formatTimezone(timezoneOffset);\n\n      // Hours, minutes and optional seconds with `:` delimiter\n      // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n      // so this token always has the same output as `XXX`\n      case \"XXXXX\":\n      case \"XXX\": // Hours and minutes with `:` delimiter\n      default:\n        return formatTimezone(timezoneOffset, \":\");\n    }\n  },\n\n  // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)\n  x: function (date, token, _localize) {\n    const timezoneOffset = date.getTimezoneOffset();\n\n    switch (token) {\n      // Hours and optional minutes\n      case \"x\":\n        return formatTimezoneWithOptionalMinutes(timezoneOffset);\n\n      // Hours, minutes and optional seconds without `:` delimiter\n      // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n      // so this token always has the same output as `xx`\n      case \"xxxx\":\n      case \"xx\": // Hours and minutes without `:` delimiter\n        return formatTimezone(timezoneOffset);\n\n      // Hours, minutes and optional seconds with `:` delimiter\n      // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n      // so this token always has the same output as `xxx`\n      case \"xxxxx\":\n      case \"xxx\": // Hours and minutes with `:` delimiter\n      default:\n        return formatTimezone(timezoneOffset, \":\");\n    }\n  },\n\n  // Timezone (GMT)\n  O: function (date, token, _localize) {\n    const timezoneOffset = date.getTimezoneOffset();\n\n    switch (token) {\n      // Short\n      case \"O\":\n      case \"OO\":\n      case \"OOO\":\n        return \"GMT\" + formatTimezoneShort(timezoneOffset, \":\");\n      // Long\n      case \"OOOO\":\n      default:\n        return \"GMT\" + formatTimezone(timezoneOffset, \":\");\n    }\n  },\n\n  // Timezone (specific non-location)\n  z: function (date, token, _localize) {\n    const timezoneOffset = date.getTimezoneOffset();\n\n    switch (token) {\n      // Short\n      case \"z\":\n      case \"zz\":\n      case \"zzz\":\n        return \"GMT\" + formatTimezoneShort(timezoneOffset, \":\");\n      // Long\n      case \"zzzz\":\n      default:\n        return \"GMT\" + formatTimezone(timezoneOffset, \":\");\n    }\n  },\n\n  // Seconds timestamp\n  t: function (date, token, _localize) {\n    const timestamp = Math.trunc(+date / 1000);\n    return addLeadingZeros(timestamp, token.length);\n  },\n\n  // Milliseconds timestamp\n  T: function (date, token, _localize) {\n    return addLeadingZeros(+date, token.length);\n  },\n};\n\nfunction formatTimezoneShort(offset, delimiter = \"\") {\n  const sign = offset > 0 ? \"-\" : \"+\";\n  const absOffset = Math.abs(offset);\n  const hours = Math.trunc(absOffset / 60);\n  const minutes = absOffset % 60;\n  if (minutes === 0) {\n    return sign + String(hours);\n  }\n  return sign + String(hours) + delimiter + addLeadingZeros(minutes, 2);\n}\n\nfunction formatTimezoneWithOptionalMinutes(offset, delimiter) {\n  if (offset % 60 === 0) {\n    const sign = offset > 0 ? \"-\" : \"+\";\n    return sign + addLeadingZeros(Math.abs(offset) / 60, 2);\n  }\n  return formatTimezone(offset, delimiter);\n}\n\nfunction formatTimezone(offset, delimiter = \"\") {\n  const sign = offset > 0 ? \"-\" : \"+\";\n  const absOffset = Math.abs(offset);\n  const hours = addLeadingZeros(Math.trunc(absOffset / 60), 2);\n  const minutes = addLeadingZeros(absOffset % 60, 2);\n  return sign + hours + delimiter + minutes;\n}\n","import { differenceInCalendarDays } from \"./differenceInCalendarDays.js\";\nimport { startOfYear } from \"./startOfYear.js\";\nimport { toDate } from \"./toDate.js\";\n\n/**\n * The {@link getDayOfYear} function options.\n */\n\n/**\n * @name getDayOfYear\n * @category Day Helpers\n * @summary Get the day of the year of the given date.\n *\n * @description\n * Get the day of the year of the given date.\n *\n * @param date - The given date\n * @param options - The options\n *\n * @returns The day of year\n *\n * @example\n * // Which day of the year is 2 July 2014?\n * const result = getDayOfYear(new Date(2014, 6, 2))\n * //=> 183\n */\nexport function getDayOfYear(date, options) {\n  const _date = toDate(date, options?.in);\n  const diff = differenceInCalendarDays(_date, startOfYear(_date));\n  const dayOfYear = diff + 1;\n  return dayOfYear;\n}\n\n// Fallback for modularized imports:\nexport default getDayOfYear;\n","const dateLongFormatter = (pattern, formatLong) => {\n  switch (pattern) {\n    case \"P\":\n      return formatLong.date({ width: \"short\" });\n    case \"PP\":\n      return formatLong.date({ width: \"medium\" });\n    case \"PPP\":\n      return formatLong.date({ width: \"long\" });\n    case \"PPPP\":\n    default:\n      return formatLong.date({ width: \"full\" });\n  }\n};\n\nconst timeLongFormatter = (pattern, formatLong) => {\n  switch (pattern) {\n    case \"p\":\n      return formatLong.time({ width: \"short\" });\n    case \"pp\":\n      return formatLong.time({ width: \"medium\" });\n    case \"ppp\":\n      return formatLong.time({ width: \"long\" });\n    case \"pppp\":\n    default:\n      return formatLong.time({ width: \"full\" });\n  }\n};\n\nconst dateTimeLongFormatter = (pattern, formatLong) => {\n  const matchResult = pattern.match(/(P+)(p+)?/) || [];\n  const datePattern = matchResult[1];\n  const timePattern = matchResult[2];\n\n  if (!timePattern) {\n    return dateLongFormatter(pattern, formatLong);\n  }\n\n  let dateTimeFormat;\n\n  switch (datePattern) {\n    case \"P\":\n      dateTimeFormat = formatLong.dateTime({ width: \"short\" });\n      break;\n    case \"PP\":\n      dateTimeFormat = formatLong.dateTime({ width: \"medium\" });\n      break;\n    case \"PPP\":\n      dateTimeFormat = formatLong.dateTime({ width: \"long\" });\n      break;\n    case \"PPPP\":\n    default:\n      dateTimeFormat = formatLong.dateTime({ width: \"full\" });\n      break;\n  }\n\n  return dateTimeFormat\n    .replace(\"{{date}}\", dateLongFormatter(datePattern, formatLong))\n    .replace(\"{{time}}\", timeLongFormatter(timePattern, formatLong));\n};\n\nexport const longFormatters = {\n  p: timeLongFormatter,\n  P: dateTimeLongFormatter,\n};\n","const dayOfYearTokenRE = /^D+$/;\nconst weekYearTokenRE = /^Y+$/;\n\nconst throwTokens = [\"D\", \"DD\", \"YY\", \"YYYY\"];\n\nexport function isProtectedDayOfYearToken(token) {\n  return dayOfYearTokenRE.test(token);\n}\n\nexport function isProtectedWeekYearToken(token) {\n  return weekYearTokenRE.test(token);\n}\n\nexport function warnOrThrowProtectedError(token, format, input) {\n  const _message = message(token, format, input);\n  console.warn(_message);\n  if (throwTokens.includes(token)) throw new RangeError(_message);\n}\n\nfunction message(token, format, input) {\n  const subject = token[0] === \"Y\" ? \"years\" : \"days of the month\";\n  return `Use \\`${token.toLowerCase()}\\` instead of \\`${token}\\` (in \\`${format}\\`) for formatting ${subject} to the input \\`${input}\\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`;\n}\n","import { defaultLocale } from \"./_lib/defaultLocale.js\";\nimport { getDefaultOptions } from \"./_lib/defaultOptions.js\";\nimport { formatters } from \"./_lib/format/formatters.js\";\nimport { longFormatters } from \"./_lib/format/longFormatters.js\";\nimport {\n  isProtectedDayOfYearToken,\n  isProtectedWeekYearToken,\n  warnOrThrowProtectedError,\n} from \"./_lib/protectedTokens.js\";\nimport { isValid } from \"./isValid.js\";\nimport { toDate } from \"./toDate.js\";\n\n// Rexports of internal for libraries to use.\n// See: https://github.com/date-fns/date-fns/issues/3638#issuecomment-1877082874\nexport { formatters, longFormatters };\n\n// This RegExp consists of three parts separated by `|`:\n// - [yYQqMLwIdDecihHKkms]o matches any available ordinal number token\n//   (one of the certain letters followed by `o`)\n// - (\\w)\\1* matches any sequences of the same letter\n// - '' matches two quote characters in a row\n// - '(''|[^'])+('|$) matches anything surrounded by two quote characters ('),\n//   except a single quote symbol, which ends the sequence.\n//   Two quote characters do not end the sequence.\n//   If there is no matching single quote\n//   then the sequence will continue until the end of the string.\n// - . matches any single character unmatched by previous parts of the RegExps\nconst formattingTokensRegExp =\n  /[yYQqMLwIdDecihHKkms]o|(\\w)\\1*|''|'(''|[^'])+('|$)|./g;\n\n// This RegExp catches symbols escaped by quotes, and also\n// sequences of symbols P, p, and the combinations like `PPPPPPPppppp`\nconst longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;\n\nconst escapedStringRegExp = /^'([^]*?)'?$/;\nconst doubleQuoteRegExp = /''/g;\nconst unescapedLatinCharacterRegExp = /[a-zA-Z]/;\n\nexport { format as formatDate };\n\n/**\n * The {@link format} function options.\n */\n\n/**\n * @name format\n * @alias formatDate\n * @category Common Helpers\n * @summary Format the date.\n *\n * @description\n * Return the formatted date string in the given format. The result may vary by locale.\n *\n * > ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries.\n * > See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * The characters wrapped between two single quotes characters (') are escaped.\n * Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.\n * (see the last example)\n *\n * Format of the string is based on Unicode Technical Standard #35:\n * https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table\n * with a few additions (see note 7 below the table).\n *\n * Accepted patterns:\n * | Unit                            | Pattern | Result examples                   | Notes |\n * |---------------------------------|---------|-----------------------------------|-------|\n * | Era                             | G..GGG  | AD, BC                            |       |\n * |                                 | GGGG    | Anno Domini, Before Christ        | 2     |\n * |                                 | GGGGG   | A, B                              |       |\n * | Calendar year                   | y       | 44, 1, 1900, 2017                 | 5     |\n * |                                 | yo      | 44th, 1st, 0th, 17th              | 5,7   |\n * |                                 | yy      | 44, 01, 00, 17                    | 5     |\n * |                                 | yyy     | 044, 001, 1900, 2017              | 5     |\n * |                                 | yyyy    | 0044, 0001, 1900, 2017            | 5     |\n * |                                 | yyyyy   | ...                               | 3,5   |\n * | Local week-numbering year       | Y       | 44, 1, 1900, 2017                 | 5     |\n * |                                 | Yo      | 44th, 1st, 1900th, 2017th         | 5,7   |\n * |                                 | YY      | 44, 01, 00, 17                    | 5,8   |\n * |                                 | YYY     | 044, 001, 1900, 2017              | 5     |\n * |                                 | YYYY    | 0044, 0001, 1900, 2017            | 5,8   |\n * |                                 | YYYYY   | ...                               | 3,5   |\n * | ISO week-numbering year         | R       | -43, 0, 1, 1900, 2017             | 5,7   |\n * |                                 | RR      | -43, 00, 01, 1900, 2017           | 5,7   |\n * |                                 | RRR     | -043, 000, 001, 1900, 2017        | 5,7   |\n * |                                 | RRRR    | -0043, 0000, 0001, 1900, 2017     | 5,7   |\n * |                                 | RRRRR   | ...                               | 3,5,7 |\n * | Extended year                   | u       | -43, 0, 1, 1900, 2017             | 5     |\n * |                                 | uu      | -43, 01, 1900, 2017               | 5     |\n * |                                 | uuu     | -043, 001, 1900, 2017             | 5     |\n * |                                 | uuuu    | -0043, 0001, 1900, 2017           | 5     |\n * |                                 | uuuuu   | ...                               | 3,5   |\n * | Quarter (formatting)            | Q       | 1, 2, 3, 4                        |       |\n * |                                 | Qo      | 1st, 2nd, 3rd, 4th                | 7     |\n * |                                 | QQ      | 01, 02, 03, 04                    |       |\n * |                                 | QQQ     | Q1, Q2, Q3, Q4                    |       |\n * |                                 | QQQQ    | 1st quarter, 2nd quarter, ...     | 2     |\n * |                                 | QQQQQ   | 1, 2, 3, 4                        | 4     |\n * | Quarter (stand-alone)           | q       | 1, 2, 3, 4                        |       |\n * |                                 | qo      | 1st, 2nd, 3rd, 4th                | 7     |\n * |                                 | qq      | 01, 02, 03, 04                    |       |\n * |                                 | qqq     | Q1, Q2, Q3, Q4                    |       |\n * |                                 | qqqq    | 1st quarter, 2nd quarter, ...     | 2     |\n * |                                 | qqqqq   | 1, 2, 3, 4                        | 4     |\n * | Month (formatting)              | M       | 1, 2, ..., 12                     |       |\n * |                                 | Mo      | 1st, 2nd, ..., 12th               | 7     |\n * |                                 | MM      | 01, 02, ..., 12                   |       |\n * |                                 | MMM     | Jan, Feb, ..., Dec                |       |\n * |                                 | MMMM    | January, February, ..., December  | 2     |\n * |                                 | MMMMM   | J, F, ..., D                      |       |\n * | Month (stand-alone)             | L       | 1, 2, ..., 12                     |       |\n * |                                 | Lo      | 1st, 2nd, ..., 12th               | 7     |\n * |                                 | LL      | 01, 02, ..., 12                   |       |\n * |                                 | LLL     | Jan, Feb, ..., Dec                |       |\n * |                                 | LLLL    | January, February, ..., December  | 2     |\n * |                                 | LLLLL   | J, F, ..., D                      |       |\n * | Local week of year              | w       | 1, 2, ..., 53                     |       |\n * |                                 | wo      | 1st, 2nd, ..., 53th               | 7     |\n * |                                 | ww      | 01, 02, ..., 53                   |       |\n * | ISO week of year                | I       | 1, 2, ..., 53                     | 7     |\n * |                                 | Io      | 1st, 2nd, ..., 53th               | 7     |\n * |                                 | II      | 01, 02, ..., 53                   | 7     |\n * | Day of month                    | d       | 1, 2, ..., 31                     |       |\n * |                                 | do      | 1st, 2nd, ..., 31st               | 7     |\n * |                                 | dd      | 01, 02, ..., 31                   |       |\n * | Day of year                     | D       | 1, 2, ..., 365, 366               | 9     |\n * |                                 | Do      | 1st, 2nd, ..., 365th, 366th       | 7     |\n * |                                 | DD      | 01, 02, ..., 365, 366             | 9     |\n * |                                 | DDD     | 001, 002, ..., 365, 366           |       |\n * |                                 | DDDD    | ...                               | 3     |\n * | Day of week (formatting)        | E..EEE  | Mon, Tue, Wed, ..., Sun           |       |\n * |                                 | EEEE    | Monday, Tuesday, ..., Sunday      | 2     |\n * |                                 | EEEEE   | M, T, W, T, F, S, S               |       |\n * |                                 | EEEEEE  | Mo, Tu, We, Th, Fr, Sa, Su        |       |\n * | ISO day of week (formatting)    | i       | 1, 2, 3, ..., 7                   | 7     |\n * |                                 | io      | 1st, 2nd, ..., 7th                | 7     |\n * |                                 | ii      | 01, 02, ..., 07                   | 7     |\n * |                                 | iii     | Mon, Tue, Wed, ..., Sun           | 7     |\n * |                                 | iiii    | Monday, Tuesday, ..., Sunday      | 2,7   |\n * |                                 | iiiii   | M, T, W, T, F, S, S               | 7     |\n * |                                 | iiiiii  | Mo, Tu, We, Th, Fr, Sa, Su        | 7     |\n * | Local day of week (formatting)  | e       | 2, 3, 4, ..., 1                   |       |\n * |                                 | eo      | 2nd, 3rd, ..., 1st                | 7     |\n * |                                 | ee      | 02, 03, ..., 01                   |       |\n * |                                 | eee     | Mon, Tue, Wed, ..., Sun           |       |\n * |                                 | eeee    | Monday, Tuesday, ..., Sunday      | 2     |\n * |                                 | eeeee   | M, T, W, T, F, S, S               |       |\n * |                                 | eeeeee  | Mo, Tu, We, Th, Fr, Sa, Su        |       |\n * | Local day of week (stand-alone) | c       | 2, 3, 4, ..., 1                   |       |\n * |                                 | co      | 2nd, 3rd, ..., 1st                | 7     |\n * |                                 | cc      | 02, 03, ..., 01                   |       |\n * |                                 | ccc     | Mon, Tue, Wed, ..., Sun           |       |\n * |                                 | cccc    | Monday, Tuesday, ..., Sunday      | 2     |\n * |                                 | ccccc   | M, T, W, T, F, S, S               |       |\n * |                                 | cccccc  | Mo, Tu, We, Th, Fr, Sa, Su        |       |\n * | AM, PM                          | a..aa   | AM, PM                            |       |\n * |                                 | aaa     | am, pm                            |       |\n * |                                 | aaaa    | a.m., p.m.                        | 2     |\n * |                                 | aaaaa   | a, p                              |       |\n * | AM, PM, noon, midnight          | b..bb   | AM, PM, noon, midnight            |       |\n * |                                 | bbb     | am, pm, noon, midnight            |       |\n * |                                 | bbbb    | a.m., p.m., noon, midnight        | 2     |\n * |                                 | bbbbb   | a, p, n, mi                       |       |\n * | Flexible day period             | B..BBB  | at night, in the morning, ...     |       |\n * |                                 | BBBB    | at night, in the morning, ...     | 2     |\n * |                                 | BBBBB   | at night, in the morning, ...     |       |\n * | Hour [1-12]                     | h       | 1, 2, ..., 11, 12                 |       |\n * |                                 | ho      | 1st, 2nd, ..., 11th, 12th         | 7     |\n * |                                 | hh      | 01, 02, ..., 11, 12               |       |\n * | Hour [0-23]                     | H       | 0, 1, 2, ..., 23                  |       |\n * |                                 | Ho      | 0th, 1st, 2nd, ..., 23rd          | 7     |\n * |                                 | HH      | 00, 01, 02, ..., 23               |       |\n * | Hour [0-11]                     | K       | 1, 2, ..., 11, 0                  |       |\n * |                                 | Ko      | 1st, 2nd, ..., 11th, 0th          | 7     |\n * |                                 | KK      | 01, 02, ..., 11, 00               |       |\n * | Hour [1-24]                     | k       | 24, 1, 2, ..., 23                 |       |\n * |                                 | ko      | 24th, 1st, 2nd, ..., 23rd         | 7     |\n * |                                 | kk      | 24, 01, 02, ..., 23               |       |\n * | Minute                          | m       | 0, 1, ..., 59                     |       |\n * |                                 | mo      | 0th, 1st, ..., 59th               | 7     |\n * |                                 | mm      | 00, 01, ..., 59                   |       |\n * | Second                          | s       | 0, 1, ..., 59                     |       |\n * |                                 | so      | 0th, 1st, ..., 59th               | 7     |\n * |                                 | ss      | 00, 01, ..., 59                   |       |\n * | Fraction of second              | S       | 0, 1, ..., 9                      |       |\n * |                                 | SS      | 00, 01, ..., 99                   |       |\n * |                                 | SSS     | 000, 001, ..., 999                |       |\n * |                                 | SSSS    | ...                               | 3     |\n * | Timezone (ISO-8601 w/ Z)        | X       | -08, +0530, Z                     |       |\n * |                                 | XX      | -0800, +0530, Z                   |       |\n * |                                 | XXX     | -08:00, +05:30, Z                 |       |\n * |                                 | XXXX    | -0800, +0530, Z, +123456          | 2     |\n * |                                 | XXXXX   | -08:00, +05:30, Z, +12:34:56      |       |\n * | Timezone (ISO-8601 w/o Z)       | x       | -08, +0530, +00                   |       |\n * |                                 | xx      | -0800, +0530, +0000               |       |\n * |                                 | xxx     | -08:00, +05:30, +00:00            | 2     |\n * |                                 | xxxx    | -0800, +0530, +0000, +123456      |       |\n * |                                 | xxxxx   | -08:00, +05:30, +00:00, +12:34:56 |       |\n * | Timezone (GMT)                  | O...OOO | GMT-8, GMT+5:30, GMT+0            |       |\n * |                                 | OOOO    | GMT-08:00, GMT+05:30, GMT+00:00   | 2     |\n * | Timezone (specific non-locat.)  | z...zzz | GMT-8, GMT+5:30, GMT+0            | 6     |\n * |                                 | zzzz    | GMT-08:00, GMT+05:30, GMT+00:00   | 2,6   |\n * | Seconds timestamp               | t       | 512969520                         | 7     |\n * |                                 | tt      | ...                               | 3,7   |\n * | Milliseconds timestamp          | T       | 512969520900                      | 7     |\n * |                                 | TT      | ...                               | 3,7   |\n * | Long localized date             | P       | 04/29/1453                        | 7     |\n * |                                 | PP      | Apr 29, 1453                      | 7     |\n * |                                 | PPP     | April 29th, 1453                  | 7     |\n * |                                 | PPPP    | Friday, April 29th, 1453          | 2,7   |\n * | Long localized time             | p       | 12:00 AM                          | 7     |\n * |                                 | pp      | 12:00:00 AM                       | 7     |\n * |                                 | ppp     | 12:00:00 AM GMT+2                 | 7     |\n * |                                 | pppp    | 12:00:00 AM GMT+02:00             | 2,7   |\n * | Combination of date and time    | Pp      | 04/29/1453, 12:00 AM              | 7     |\n * |                                 | PPpp    | Apr 29, 1453, 12:00:00 AM         | 7     |\n * |                                 | PPPppp  | April 29th, 1453 at ...           | 7     |\n * |                                 | PPPPpppp| Friday, April 29th, 1453 at ...   | 2,7   |\n * Notes:\n * 1. \"Formatting\" units (e.g. formatting quarter) in the default en-US locale\n *    are the same as \"stand-alone\" units, but are different in some languages.\n *    \"Formatting\" units are declined according to the rules of the language\n *    in the context of a date. \"Stand-alone\" units are always nominative singular:\n *\n *    `format(new Date(2017, 10, 6), 'do LLLL', {locale: cs}) //=> '6. listopad'`\n *\n *    `format(new Date(2017, 10, 6), 'do MMMM', {locale: cs}) //=> '6. listopadu'`\n *\n * 2. Any sequence of the identical letters is a pattern, unless it is escaped by\n *    the single quote characters (see below).\n *    If the sequence is longer than listed in table (e.g. `EEEEEEEEEEE`)\n *    the output will be the same as default pattern for this unit, usually\n *    the longest one (in case of ISO weekdays, `EEEE`). Default patterns for units\n *    are marked with \"2\" in the last column of the table.\n *\n *    `format(new Date(2017, 10, 6), 'MMM') //=> 'Nov'`\n *\n *    `format(new Date(2017, 10, 6), 'MMMM') //=> 'November'`\n *\n *    `format(new Date(2017, 10, 6), 'MMMMM') //=> 'N'`\n *\n *    `format(new Date(2017, 10, 6), 'MMMMMM') //=> 'November'`\n *\n *    `format(new Date(2017, 10, 6), 'MMMMMMM') //=> 'November'`\n *\n * 3. Some patterns could be unlimited length (such as `yyyyyyyy`).\n *    The output will be padded with zeros to match the length of the pattern.\n *\n *    `format(new Date(2017, 10, 6), 'yyyyyyyy') //=> '00002017'`\n *\n * 4. `QQQQQ` and `qqqqq` could be not strictly numerical in some locales.\n *    These tokens represent the shortest form of the quarter.\n *\n * 5. The main difference between `y` and `u` patterns are B.C. years:\n *\n *    | Year | `y` | `u` |\n *    |------|-----|-----|\n *    | AC 1 |   1 |   1 |\n *    | BC 1 |   1 |   0 |\n *    | BC 2 |   2 |  -1 |\n *\n *    Also `yy` always returns the last two digits of a year,\n *    while `uu` pads single digit years to 2 characters and returns other years unchanged:\n *\n *    | Year | `yy` | `uu` |\n *    |------|------|------|\n *    | 1    |   01 |   01 |\n *    | 14   |   14 |   14 |\n *    | 376  |   76 |  376 |\n *    | 1453 |   53 | 1453 |\n *\n *    The same difference is true for local and ISO week-numbering years (`Y` and `R`),\n *    except local week-numbering years are dependent on `options.weekStartsOn`\n *    and `options.firstWeekContainsDate` (compare [getISOWeekYear](https://date-fns.org/docs/getISOWeekYear)\n *    and [getWeekYear](https://date-fns.org/docs/getWeekYear)).\n *\n * 6. Specific non-location timezones are currently unavailable in `date-fns`,\n *    so right now these tokens fall back to GMT timezones.\n *\n * 7. These patterns are not in the Unicode Technical Standard #35:\n *    - `i`: ISO day of week\n *    - `I`: ISO week of year\n *    - `R`: ISO week-numbering year\n *    - `t`: seconds timestamp\n *    - `T`: milliseconds timestamp\n *    - `o`: ordinal number modifier\n *    - `P`: long localized date\n *    - `p`: long localized time\n *\n * 8. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years.\n *    You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * 9. `D` and `DD` tokens represent days of the year but they are often confused with days of the month.\n *    You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * @param date - The original date\n * @param format - The string of tokens\n * @param options - An object with options\n *\n * @returns The formatted date string\n *\n * @throws `date` must not be Invalid Date\n * @throws `options.locale` must contain `localize` property\n * @throws `options.locale` must contain `formatLong` property\n * @throws use `yyyy` instead of `YYYY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws use `yy` instead of `YY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws use `d` instead of `D` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws use `dd` instead of `DD` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws format string contains an unescaped latin alphabet character\n *\n * @example\n * // Represent 11 February 2014 in middle-endian format:\n * const result = format(new Date(2014, 1, 11), 'MM/dd/yyyy')\n * //=> '02/11/2014'\n *\n * @example\n * // Represent 2 July 2014 in Esperanto:\n * import { eoLocale } from 'date-fns/locale/eo'\n * const result = format(new Date(2014, 6, 2), \"do 'de' MMMM yyyy\", {\n *   locale: eoLocale\n * })\n * //=> '2-a de julio 2014'\n *\n * @example\n * // Escape string by single quote characters:\n * const result = format(new Date(2014, 6, 2, 15), \"h 'o''clock'\")\n * //=> \"3 o'clock\"\n */\nexport function format(date, formatStr, options) {\n  const defaultOptions = getDefaultOptions();\n  const locale = options?.locale ?? defaultOptions.locale ?? defaultLocale;\n\n  const firstWeekContainsDate =\n    options?.firstWeekContainsDate ??\n    options?.locale?.options?.firstWeekContainsDate ??\n    defaultOptions.firstWeekContainsDate ??\n    defaultOptions.locale?.options?.firstWeekContainsDate ??\n    1;\n\n  const weekStartsOn =\n    options?.weekStartsOn ??\n    options?.locale?.options?.weekStartsOn ??\n    defaultOptions.weekStartsOn ??\n    defaultOptions.locale?.options?.weekStartsOn ??\n    0;\n\n  const originalDate = toDate(date, options?.in);\n\n  if (!isValid(originalDate)) {\n    throw new RangeError(\"Invalid time value\");\n  }\n\n  let parts = formatStr\n    .match(longFormattingTokensRegExp)\n    .map((substring) => {\n      const firstCharacter = substring[0];\n      if (firstCharacter === \"p\" || firstCharacter === \"P\") {\n        const longFormatter = longFormatters[firstCharacter];\n        return longFormatter(substring, locale.formatLong);\n      }\n      return substring;\n    })\n    .join(\"\")\n    .match(formattingTokensRegExp)\n    .map((substring) => {\n      // Replace two single quote characters with one single quote character\n      if (substring === \"''\") {\n        return { isToken: false, value: \"'\" };\n      }\n\n      const firstCharacter = substring[0];\n      if (firstCharacter === \"'\") {\n        return { isToken: false, value: cleanEscapedString(substring) };\n      }\n\n      if (formatters[firstCharacter]) {\n        return { isToken: true, value: substring };\n      }\n\n      if (firstCharacter.match(unescapedLatinCharacterRegExp)) {\n        throw new RangeError(\n          \"Format string contains an unescaped latin alphabet character `\" +\n            firstCharacter +\n            \"`\",\n        );\n      }\n\n      return { isToken: false, value: substring };\n    });\n\n  // invoke localize preprocessor (only for french locales at the moment)\n  if (locale.localize.preprocessor) {\n    parts = locale.localize.preprocessor(originalDate, parts);\n  }\n\n  const formatterOptions = {\n    firstWeekContainsDate,\n    weekStartsOn,\n    locale,\n  };\n\n  return parts\n    .map((part) => {\n      if (!part.isToken) return part.value;\n\n      const token = part.value;\n\n      if (\n        (!options?.useAdditionalWeekYearTokens &&\n          isProtectedWeekYearToken(token)) ||\n        (!options?.useAdditionalDayOfYearTokens &&\n          isProtectedDayOfYearToken(token))\n      ) {\n        warnOrThrowProtectedError(token, formatStr, String(date));\n      }\n\n      const formatter = formatters[token[0]];\n      return formatter(originalDate, token, locale.localize, formatterOptions);\n    })\n    .join(\"\");\n}\n\nfunction cleanEscapedString(input) {\n  const matched = input.match(escapedStringRegExp);\n\n  if (!matched) {\n    return input;\n  }\n\n  return matched[1].replace(doubleQuoteRegExp, \"'\");\n}\n\n// Fallback for modularized imports:\nexport default format;\n","import { isDate } from \"./isDate.js\";\nimport { toDate } from \"./toDate.js\";\n\n/**\n * @name isValid\n * @category Common Helpers\n * @summary Is the given date valid?\n *\n * @description\n * Returns false if argument is Invalid Date and true otherwise.\n * Argument is converted to Date using `toDate`. See [toDate](https://date-fns.org/docs/toDate)\n * Invalid Date is a Date, whose time value is NaN.\n *\n * Time value of Date: http://es5.github.io/#x15.9.1.1\n *\n * @param date - The date to check\n *\n * @returns The date is valid\n *\n * @example\n * // For the valid date:\n * const result = isValid(new Date(2014, 1, 31))\n * //=> true\n *\n * @example\n * // For the value, convertible into a date:\n * const result = isValid(1393804800000)\n * //=> true\n *\n * @example\n * // For the invalid date:\n * const result = isValid(new Date(''))\n * //=> false\n */\nexport function isValid(date) {\n  return !((!isDate(date) && typeof date !== \"number\") || isNaN(+toDate(date)));\n}\n\n// Fallback for modularized imports:\nexport default isValid;\n","import { constructFrom } from \"./constructFrom.js\";\nimport { getDaysInMonth } from \"./getDaysInMonth.js\";\nimport { toDate } from \"./toDate.js\";\n\n/**\n * The {@link setMonth} function options.\n */\n\n/**\n * @name setMonth\n * @category Month Helpers\n * @summary Set the month to the given date.\n *\n * @description\n * Set the month to the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The date to be changed\n * @param month - The month index to set (0-11)\n * @param options - The options\n *\n * @returns The new date with the month set\n *\n * @example\n * // Set February to 1 September 2014:\n * const result = setMonth(new Date(2014, 8, 1), 1)\n * //=> Sat Feb 01 2014 00:00:00\n */\nexport function setMonth(date, month, options) {\n  const _date = toDate(date, options?.in);\n  const year = _date.getFullYear();\n  const day = _date.getDate();\n\n  const midMonth = constructFrom(options?.in || date, 0);\n  midMonth.setFullYear(year, month, 15);\n  midMonth.setHours(0, 0, 0, 0);\n  const daysInMonth = getDaysInMonth(midMonth);\n\n  // Set the earlier date, allows to wrap Jan 31 to Feb 28\n  _date.setMonth(month, Math.min(day, daysInMonth));\n  return _date;\n}\n\n// Fallback for modularized imports:\nexport default setMonth;\n","import { constructFrom } from \"./constructFrom.js\";\nimport { toDate } from \"./toDate.js\";\n\n/**\n * The {@link getDaysInMonth} function options.\n */\n\n/**\n * @name getDaysInMonth\n * @category Month Helpers\n * @summary Get the number of days in a month of the given date.\n *\n * @description\n * Get the number of days in a month of the given date, considering the context if provided.\n *\n * @param date - The given date\n * @param options - An object with options\n *\n * @returns The number of days in a month\n *\n * @example\n * // How many days are in February 2000?\n * const result = getDaysInMonth(new Date(2000, 1))\n * //=> 29\n */\nexport function getDaysInMonth(date, options) {\n  const _date = toDate(date, options?.in);\n  const year = _date.getFullYear();\n  const monthIndex = _date.getMonth();\n  const lastDayOfMonth = constructFrom(_date, 0);\n  lastDayOfMonth.setFullYear(year, monthIndex + 1, 0);\n  lastDayOfMonth.setHours(0, 0, 0, 0);\n  return lastDayOfMonth.getDate();\n}\n\n// Fallback for modularized imports:\nexport default getDaysInMonth;\n","/**\n * Returns the start date of the week in the broadcast calendar.\n *\n * The broadcast week starts on Monday. If the first day of the month is not a\n * Monday, this function calculates the previous Monday as the start of the\n * broadcast week.\n *\n * @since 9.4.0\n * @param date The date for which to calculate the start of the broadcast week.\n * @param dateLib The date library to use for date manipulation.\n * @returns The start date of the broadcast week.\n */\nexport function startOfBroadcastWeek(date, dateLib) {\n    const firstOfMonth = dateLib.startOfMonth(date);\n    const dayOfWeek = firstOfMonth.getDay();\n    if (dayOfWeek === 1) {\n        return firstOfMonth;\n    }\n    else if (dayOfWeek === 0) {\n        return dateLib.addDays(firstOfMonth, -1 * 6);\n    }\n    else {\n        return dateLib.addDays(firstOfMonth, -1 * (dayOfWeek - 1));\n    }\n}\n//# sourceMappingURL=startOfBroadcastWeek.js.map","import { TZDate } from \"@date-fns/tz\";\nimport { addDays, addMonths, addWeeks, addYears, differenceInCalendarDays, differenceInCalendarMonths, eachMonthOfInterval, endOfISOWeek, endOfMonth, endOfWeek, endOfYear, format, getISOWeek, getMonth, getWeek, getYear, isAfter, isBefore, isDate, isSameDay, isSameMonth, isSameYear, max, min, setMonth, setYear, startOfDay, startOfISOWeek, startOfMonth, startOfWeek, startOfYear } from \"date-fns\";\nimport { enUS } from \"date-fns/locale/en-US\";\nimport { endOfBroadcastWeek } from \"../helpers/endOfBroadcastWeek.js\";\nimport { startOfBroadcastWeek } from \"../helpers/startOfBroadcastWeek.js\";\n/**\n * A wrapper class around [date-fns](http://date-fns.org) that provides utility\n * methods for date manipulation and formatting.\n *\n * @since 9.2.0\n * @example\n *   const dateLib = new DateLib({ locale: es });\n *   const newDate = dateLib.addDays(new Date(), 5);\n */\nexport class DateLib {\n    /**\n     * Creates an instance of `DateLib`.\n     *\n     * @param options Configuration options for the date library.\n     * @param overrides Custom overrides for the date library functions.\n     */\n    constructor(options, overrides) {\n        /**\n         * Reference to the built-in Date constructor.\n         *\n         * @deprecated Use `newDate()` or `today()`.\n         */\n        this.Date = Date;\n        /**\n         * Creates a new `Date` object representing today's date.\n         *\n         * @since 9.5.0\n         * @returns A `Date` object for today's date.\n         */\n        this.today = () => {\n            if (this.overrides?.today) {\n                return this.overrides.today();\n            }\n            if (this.options.timeZone) {\n                return TZDate.tz(this.options.timeZone);\n            }\n            return new this.Date();\n        };\n        /**\n         * Creates a new `Date` object with the specified year, month, and day.\n         *\n         * @since 9.5.0\n         * @param year The year.\n         * @param monthIndex The month (0-11).\n         * @param date The day of the month.\n         * @returns A new `Date` object.\n         */\n        this.newDate = (year, monthIndex, date) => {\n            if (this.overrides?.newDate) {\n                return this.overrides.newDate(year, monthIndex, date);\n            }\n            if (this.options.timeZone) {\n                return new TZDate(year, monthIndex, date, this.options.timeZone);\n            }\n            return new Date(year, monthIndex, date);\n        };\n        /**\n         * Adds the specified number of days to the given date.\n         *\n         * @param date The date to add days to.\n         * @param amount The number of days to add.\n         * @returns The new date with the days added.\n         */\n        this.addDays = (date, amount) => {\n            return this.overrides?.addDays\n                ? this.overrides.addDays(date, amount)\n                : addDays(date, amount);\n        };\n        /**\n         * Adds the specified number of months to the given date.\n         *\n         * @param date The date to add months to.\n         * @param amount The number of months to add.\n         * @returns The new date with the months added.\n         */\n        this.addMonths = (date, amount) => {\n            return this.overrides?.addMonths\n                ? this.overrides.addMonths(date, amount)\n                : addMonths(date, amount);\n        };\n        /**\n         * Adds the specified number of weeks to the given date.\n         *\n         * @param date The date to add weeks to.\n         * @param amount The number of weeks to add.\n         * @returns The new date with the weeks added.\n         */\n        this.addWeeks = (date, amount) => {\n            return this.overrides?.addWeeks\n                ? this.overrides.addWeeks(date, amount)\n                : addWeeks(date, amount);\n        };\n        /**\n         * Adds the specified number of years to the given date.\n         *\n         * @param date The date to add years to.\n         * @param amount The number of years to add.\n         * @returns The new date with the years added.\n         */\n        this.addYears = (date, amount) => {\n            return this.overrides?.addYears\n                ? this.overrides.addYears(date, amount)\n                : addYears(date, amount);\n        };\n        /**\n         * Returns the number of calendar days between the given dates.\n         *\n         * @param dateLeft The later date.\n         * @param dateRight The earlier date.\n         * @returns The number of calendar days between the dates.\n         */\n        this.differenceInCalendarDays = (dateLeft, dateRight) => {\n            return this.overrides?.differenceInCalendarDays\n                ? this.overrides.differenceInCalendarDays(dateLeft, dateRight)\n                : differenceInCalendarDays(dateLeft, dateRight);\n        };\n        /**\n         * Returns the number of calendar months between the given dates.\n         *\n         * @param dateLeft The later date.\n         * @param dateRight The earlier date.\n         * @returns The number of calendar months between the dates.\n         */\n        this.differenceInCalendarMonths = (dateLeft, dateRight) => {\n            return this.overrides?.differenceInCalendarMonths\n                ? this.overrides.differenceInCalendarMonths(dateLeft, dateRight)\n                : differenceInCalendarMonths(dateLeft, dateRight);\n        };\n        /**\n         * Returns the months between the given dates.\n         *\n         * @param interval The interval to get the months for.\n         */\n        this.eachMonthOfInterval = (interval) => {\n            return this.overrides?.eachMonthOfInterval\n                ? this.overrides.eachMonthOfInterval(interval)\n                : eachMonthOfInterval(interval);\n        };\n        /**\n         * Returns the end of the broadcast week for the given date.\n         *\n         * @param date The original date.\n         * @returns The end of the broadcast week.\n         */\n        this.endOfBroadcastWeek = (date) => {\n            return this.overrides?.endOfBroadcastWeek\n                ? this.overrides.endOfBroadcastWeek(date)\n                : endOfBroadcastWeek(date, this);\n        };\n        /**\n         * Returns the end of the ISO week for the given date.\n         *\n         * @param date The original date.\n         * @returns The end of the ISO week.\n         */\n        this.endOfISOWeek = (date) => {\n            return this.overrides?.endOfISOWeek\n                ? this.overrides.endOfISOWeek(date)\n                : endOfISOWeek(date);\n        };\n        /**\n         * Returns the end of the month for the given date.\n         *\n         * @param date The original date.\n         * @returns The end of the month.\n         */\n        this.endOfMonth = (date) => {\n            return this.overrides?.endOfMonth\n                ? this.overrides.endOfMonth(date)\n                : endOfMonth(date);\n        };\n        /**\n         * Returns the end of the week for the given date.\n         *\n         * @param date The original date.\n         * @returns The end of the week.\n         */\n        this.endOfWeek = (date, options) => {\n            return this.overrides?.endOfWeek\n                ? this.overrides.endOfWeek(date, options)\n                : endOfWeek(date, this.options);\n        };\n        /**\n         * Returns the end of the year for the given date.\n         *\n         * @param date The original date.\n         * @returns The end of the year.\n         */\n        this.endOfYear = (date) => {\n            return this.overrides?.endOfYear\n                ? this.overrides.endOfYear(date)\n                : endOfYear(date);\n        };\n        /**\n         * Formats the given date using the specified format string.\n         *\n         * @param date The date to format.\n         * @param formatStr The format string.\n         * @returns The formatted date string.\n         */\n        this.format = (date, formatStr, options) => {\n            const formatted = this.overrides?.format\n                ? this.overrides.format(date, formatStr, this.options)\n                : format(date, formatStr, this.options);\n            if (this.options.numerals && this.options.numerals !== \"latn\") {\n                return this.replaceDigits(formatted);\n            }\n            return formatted;\n        };\n        /**\n         * Returns the ISO week number for the given date.\n         *\n         * @param date The date to get the ISO week number for.\n         * @returns The ISO week number.\n         */\n        this.getISOWeek = (date) => {\n            return this.overrides?.getISOWeek\n                ? this.overrides.getISOWeek(date)\n                : getISOWeek(date);\n        };\n        /**\n         * Returns the month of the given date.\n         *\n         * @param date The date to get the month for.\n         * @returns The month.\n         */\n        this.getMonth = (date, options) => {\n            return this.overrides?.getMonth\n                ? this.overrides.getMonth(date, this.options)\n                : getMonth(date, this.options);\n        };\n        /**\n         * Returns the year of the given date.\n         *\n         * @param date The date to get the year for.\n         * @returns The year.\n         */\n        this.getYear = (date, options) => {\n            return this.overrides?.getYear\n                ? this.overrides.getYear(date, this.options)\n                : getYear(date, this.options);\n        };\n        /**\n         * Returns the local week number for the given date.\n         *\n         * @param date The date to get the week number for.\n         * @returns The week number.\n         */\n        this.getWeek = (date, options) => {\n            return this.overrides?.getWeek\n                ? this.overrides.getWeek(date, this.options)\n                : getWeek(date, this.options);\n        };\n        /**\n         * Checks if the first date is after the second date.\n         *\n         * @param date The date to compare.\n         * @param dateToCompare The date to compare with.\n         * @returns True if the first date is after the second date.\n         */\n        this.isAfter = (date, dateToCompare) => {\n            return this.overrides?.isAfter\n                ? this.overrides.isAfter(date, dateToCompare)\n                : isAfter(date, dateToCompare);\n        };\n        /**\n         * Checks if the first date is before the second date.\n         *\n         * @param date The date to compare.\n         * @param dateToCompare The date to compare with.\n         * @returns True if the first date is before the second date.\n         */\n        this.isBefore = (date, dateToCompare) => {\n            return this.overrides?.isBefore\n                ? this.overrides.isBefore(date, dateToCompare)\n                : isBefore(date, dateToCompare);\n        };\n        /**\n         * Checks if the given value is a Date object.\n         *\n         * @param value The value to check.\n         * @returns True if the value is a Date object.\n         */\n        this.isDate = (value) => {\n            return this.overrides?.isDate\n                ? this.overrides.isDate(value)\n                : isDate(value);\n        };\n        /**\n         * Checks if the given dates are on the same day.\n         *\n         * @param dateLeft The first date to compare.\n         * @param dateRight The second date to compare.\n         * @returns True if the dates are on the same day.\n         */\n        this.isSameDay = (dateLeft, dateRight) => {\n            return this.overrides?.isSameDay\n                ? this.overrides.isSameDay(dateLeft, dateRight)\n                : isSameDay(dateLeft, dateRight);\n        };\n        /**\n         * Checks if the given dates are in the same month.\n         *\n         * @param dateLeft The first date to compare.\n         * @param dateRight The second date to compare.\n         * @returns True if the dates are in the same month.\n         */\n        this.isSameMonth = (dateLeft, dateRight) => {\n            return this.overrides?.isSameMonth\n                ? this.overrides.isSameMonth(dateLeft, dateRight)\n                : isSameMonth(dateLeft, dateRight);\n        };\n        /**\n         * Checks if the given dates are in the same year.\n         *\n         * @param dateLeft The first date to compare.\n         * @param dateRight The second date to compare.\n         * @returns True if the dates are in the same year.\n         */\n        this.isSameYear = (dateLeft, dateRight) => {\n            return this.overrides?.isSameYear\n                ? this.overrides.isSameYear(dateLeft, dateRight)\n                : isSameYear(dateLeft, dateRight);\n        };\n        /**\n         * Returns the latest date in the given array of dates.\n         *\n         * @param dates The array of dates to compare.\n         * @returns The latest date.\n         */\n        this.max = (dates) => {\n            return this.overrides?.max ? this.overrides.max(dates) : max(dates);\n        };\n        /**\n         * Returns the earliest date in the given array of dates.\n         *\n         * @param dates The array of dates to compare.\n         * @returns The earliest date.\n         */\n        this.min = (dates) => {\n            return this.overrides?.min ? this.overrides.min(dates) : min(dates);\n        };\n        /**\n         * Sets the month of the given date.\n         *\n         * @param date The date to set the month on.\n         * @param month The month to set (0-11).\n         * @returns The new date with the month set.\n         */\n        this.setMonth = (date, month) => {\n            return this.overrides?.setMonth\n                ? this.overrides.setMonth(date, month)\n                : setMonth(date, month);\n        };\n        /**\n         * Sets the year of the given date.\n         *\n         * @param date The date to set the year on.\n         * @param year The year to set.\n         * @returns The new date with the year set.\n         */\n        this.setYear = (date, year) => {\n            return this.overrides?.setYear\n                ? this.overrides.setYear(date, year)\n                : setYear(date, year);\n        };\n        /**\n         * Returns the start of the broadcast week for the given date.\n         *\n         * @param date The original date.\n         * @returns The start of the broadcast week.\n         */\n        this.startOfBroadcastWeek = (date, dateLib) => {\n            return this.overrides?.startOfBroadcastWeek\n                ? this.overrides.startOfBroadcastWeek(date, this)\n                : startOfBroadcastWeek(date, this);\n        };\n        /**\n         * Returns the start of the day for the given date.\n         *\n         * @param date The original date.\n         * @returns The start of the day.\n         */\n        this.startOfDay = (date) => {\n            return this.overrides?.startOfDay\n                ? this.overrides.startOfDay(date)\n                : startOfDay(date);\n        };\n        /**\n         * Returns the start of the ISO week for the given date.\n         *\n         * @param date The original date.\n         * @returns The start of the ISO week.\n         */\n        this.startOfISOWeek = (date) => {\n            return this.overrides?.startOfISOWeek\n                ? this.overrides.startOfISOWeek(date)\n                : startOfISOWeek(date);\n        };\n        /**\n         * Returns the start of the month for the given date.\n         *\n         * @param date The original date.\n         * @returns The start of the month.\n         */\n        this.startOfMonth = (date) => {\n            return this.overrides?.startOfMonth\n                ? this.overrides.startOfMonth(date)\n                : startOfMonth(date);\n        };\n        /**\n         * Returns the start of the week for the given date.\n         *\n         * @param date The original date.\n         * @returns The start of the week.\n         */\n        this.startOfWeek = (date, options) => {\n            return this.overrides?.startOfWeek\n                ? this.overrides.startOfWeek(date, this.options)\n                : startOfWeek(date, this.options);\n        };\n        /**\n         * Returns the start of the year for the given date.\n         *\n         * @param date The original date.\n         * @returns The start of the year.\n         */\n        this.startOfYear = (date) => {\n            return this.overrides?.startOfYear\n                ? this.overrides.startOfYear(date)\n                : startOfYear(date);\n        };\n        this.options = { locale: enUS, ...options };\n        this.overrides = overrides;\n    }\n    /**\n     * Generates a mapping of Arabic digits (0-9) to the target numbering system\n     * digits.\n     *\n     * @since 9.5.0\n     * @returns A record mapping Arabic digits to the target numerals.\n     */\n    getDigitMap() {\n        const { numerals = \"latn\" } = this.options;\n        // Use Intl.NumberFormat to create a formatter with the specified numbering system\n        const formatter = new Intl.NumberFormat(\"en-US\", {\n            numberingSystem: numerals\n        });\n        // Map Arabic digits (0-9) to the target numerals\n        const digitMap = {};\n        for (let i = 0; i < 10; i++) {\n            digitMap[i.toString()] = formatter.format(i);\n        }\n        return digitMap;\n    }\n    /**\n     * Replaces Arabic digits in a string with the target numbering system digits.\n     *\n     * @since 9.5.0\n     * @param input The string containing Arabic digits.\n     * @returns The string with digits replaced.\n     */\n    replaceDigits(input) {\n        const digitMap = this.getDigitMap();\n        return input.replace(/\\d/g, (digit) => digitMap[digit] || digit);\n    }\n    /**\n     * Formats a number using the configured numbering system.\n     *\n     * @since 9.5.0\n     * @param value The number to format.\n     * @returns The formatted number as a string.\n     */\n    formatNumber(value) {\n        return this.replaceDigits(value.toString());\n    }\n}\n/** The default locale (English). */\nexport { enUS as defaultLocale } from \"date-fns/locale/en-US\";\n/**\n * The default date library with English locale.\n *\n * @since 9.2.0\n */\nexport const defaultDateLib = new DateLib();\n/**\n * @ignore\n * @deprecated Use `defaultDateLib`.\n */\nexport const dateLib = defaultDateLib;\n//# sourceMappingURL=DateLib.js.map","import { addDays } from \"./addDays.js\";\n\n/**\n * The {@link addWeeks} function options.\n */\n\n/**\n * @name addWeeks\n * @category Week Helpers\n * @summary Add the specified number of weeks to the given date.\n *\n * @description\n * Add the specified number of weeks to the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The date to be changed\n * @param amount - The amount of weeks to be added.\n * @param options - An object with options\n *\n * @returns The new date with the weeks added\n *\n * @example\n * // Add 4 weeks to 1 September 2014:\n * const result = addWeeks(new Date(2014, 8, 1), 4)\n * //=> Mon Sep 29 2014 00:00:00\n */\nexport function addWeeks(date, amount, options) {\n  return addDays(date, amount * 7, options);\n}\n\n// Fallback for modularized imports:\nexport default addWeeks;\n","import { addMonths } from \"./addMonths.js\";\n\n/**\n * The {@link addYears} function options.\n */\n\n/**\n * @name addYears\n * @category Year Helpers\n * @summary Add the specified number of years to the given date.\n *\n * @description\n * Add the specified number of years to the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type.\n *\n * @param date - The date to be changed\n * @param amount - The amount of years to be added.\n * @param options - The options\n *\n * @returns The new date with the years added\n *\n * @example\n * // Add 5 years to 1 September 2014:\n * const result = addYears(new Date(2014, 8, 1), 5)\n * //=> Sun Sep 01 2019 00:00:00\n */\nexport function addYears(date, amount, options) {\n  return addMonths(date, amount * 12, options);\n}\n\n// Fallback for modularized imports:\nexport default addYears;\n","import { normalizeDates } from \"./_lib/normalizeDates.js\";\n\n/**\n * The {@link differenceInCalendarMonths} function options.\n */\n\n/**\n * @name differenceInCalendarMonths\n * @category Month Helpers\n * @summary Get the number of calendar months between the given dates.\n *\n * @description\n * Get the number of calendar months between the given dates.\n *\n * @param laterDate - The later date\n * @param earlierDate - The earlier date\n * @param options - An object with options\n *\n * @returns The number of calendar months\n *\n * @example\n * // How many calendar months are between 31 January 2014 and 1 September 2014?\n * const result = differenceInCalendarMonths(\n *   new Date(2014, 8, 1),\n *   new Date(2014, 0, 31)\n * )\n * //=> 8\n */\nexport function differenceInCalendarMonths(laterDate, earlierDate, options) {\n  const [laterDate_, earlierDate_] = normalizeDates(\n    options?.in,\n    laterDate,\n    earlierDate,\n  );\n\n  const yearsDiff = laterDate_.getFullYear() - earlierDate_.getFullYear();\n  const monthsDiff = laterDate_.getMonth() - earlierDate_.getMonth();\n\n  return yearsDiff * 12 + monthsDiff;\n}\n\n// Fallback for modularized imports:\nexport default differenceInCalendarMonths;\n","import { getBroadcastWeeksInMonth } from \"./getBroadcastWeeksInMonth.js\";\nimport { startOfBroadcastWeek } from \"./startOfBroadcastWeek.js\";\n/**\n * Returns the end date of the week in the broadcast calendar.\n *\n * The broadcast week ends on the last day of the last broadcast week for the\n * given date.\n *\n * @since 9.4.0\n * @param date The date for which to calculate the end of the broadcast week.\n * @param dateLib The date library to use for date manipulation.\n * @returns The end date of the broadcast week.\n */\nexport function endOfBroadcastWeek(date, dateLib) {\n    const startDate = startOfBroadcastWeek(date, dateLib);\n    const numberOfWeeks = getBroadcastWeeksInMonth(date, dateLib);\n    const endDate = dateLib.addDays(startDate, numberOfWeeks * 7 - 1);\n    return endDate;\n}\n//# sourceMappingURL=endOfBroadcastWeek.js.map","const FIVE_WEEKS = 5;\nconst FOUR_WEEKS = 4;\n/**\n * Returns the number of weeks to display in the broadcast calendar for a given\n * month.\n *\n * The broadcast calendar may have either 4 or 5 weeks in a month, depending on\n * the start and end dates of the broadcast weeks.\n *\n * @since 9.4.0\n * @param month The month for which to calculate the number of weeks.\n * @param dateLib The date library to use for date manipulation.\n * @returns The number of weeks in the broadcast calendar (4 or 5).\n */\nexport function getBroadcastWeeksInMonth(month, dateLib) {\n    // Get the first day of the month\n    const firstDayOfMonth = dateLib.startOfMonth(month);\n    // Get the day of the week for the first day of the month (1-7, where 1 is Monday)\n    const firstDayOfWeek = firstDayOfMonth.getDay() > 0 ? firstDayOfMonth.getDay() : 7;\n    const broadcastStartDate = dateLib.addDays(month, -firstDayOfWeek + 1);\n    const lastDateOfLastWeek = dateLib.addDays(broadcastStartDate, FIVE_WEEKS * 7 - 1);\n    const numberOfWeeks = dateLib.getMonth(month) === dateLib.getMonth(lastDateOfLastWeek)\n        ? FIVE_WEEKS\n        : FOUR_WEEKS;\n    return numberOfWeeks;\n}\n//# sourceMappingURL=getBroadcastWeeksInMonth.js.map","import { endOfWeek } from \"./endOfWeek.js\";\n\n/**\n * The {@link endOfISOWeek} function options.\n */\n\n/**\n * @name endOfISOWeek\n * @category ISO Week Helpers\n * @summary Return the end of an ISO week for the given date.\n *\n * @description\n * Return the end of an ISO week for the given date.\n * The result will be in the local timezone.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The original date\n * @param options - An object with options\n *\n * @returns The end of an ISO week\n *\n * @example\n * // The end of an ISO week for 2 September 2014 11:55:00:\n * const result = endOfISOWeek(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Sun Sep 07 2014 23:59:59.999\n */\nexport function endOfISOWeek(date, options) {\n  return endOfWeek(date, { ...options, weekStartsOn: 1 });\n}\n\n// Fallback for modularized imports:\nexport default endOfISOWeek;\n","import { toDate } from \"./toDate.js\";\n\n/**\n * The {@link endOfMonth} function options.\n */\n\n/**\n * @name endOfMonth\n * @category Month Helpers\n * @summary Return the end of a month for the given date.\n *\n * @description\n * Return the end of a month for the given date.\n * The result will be in the local timezone.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The original date\n * @param options - An object with options\n *\n * @returns The end of a month\n *\n * @example\n * // The end of a month for 2 September 2014 11:55:00:\n * const result = endOfMonth(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Tue Sep 30 2014 23:59:59.999\n */\nexport function endOfMonth(date, options) {\n  const _date = toDate(date, options?.in);\n  const month = _date.getMonth();\n  _date.setFullYear(_date.getFullYear(), month + 1, 0);\n  _date.setHours(23, 59, 59, 999);\n  return _date;\n}\n\n// Fallback for modularized imports:\nexport default endOfMonth;\n","import { toDate } from \"./toDate.js\";\n\n/**\n * The {@link endOfYear} function options.\n */\n\n/**\n * @name endOfYear\n * @category Year Helpers\n * @summary Return the end of a year for the given date.\n *\n * @description\n * Return the end of a year for the given date.\n * The result will be in the local timezone.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The original date\n * @param options - The options\n *\n * @returns The end of a year\n *\n * @example\n * // The end of a year for 2 September 2014 11:55:00:\n * const result = endOfYear(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Wed Dec 31 2014 23:59:59.999\n */\nexport function endOfYear(date, options) {\n  const _date = toDate(date, options?.in);\n  const year = _date.getFullYear();\n  _date.setFullYear(year + 1, 0, 0);\n  _date.setHours(23, 59, 59, 999);\n  return _date;\n}\n\n// Fallback for modularized imports:\nexport default endOfYear;\n","import { toDate } from \"./toDate.js\";\n\n/**\n * The {@link getMonth} function options.\n */\n\n/**\n * @name getMonth\n * @category Month Helpers\n * @summary Get the month of the given date.\n *\n * @description\n * Get the month of the given date.\n *\n * @param date - The given date\n * @param options - An object with options\n *\n * @returns The month index (0-11)\n *\n * @example\n * // Which month is 29 February 2012?\n * const result = getMonth(new Date(2012, 1, 29))\n * //=> 1\n */\nexport function getMonth(date, options) {\n  return toDate(date, options?.in).getMonth();\n}\n\n// Fallback for modularized imports:\nexport default getMonth;\n","import { toDate } from \"./toDate.js\";\n\n/**\n * The {@link getYear} function options.\n */\n\n/**\n * @name getYear\n * @category Year Helpers\n * @summary Get the year of the given date.\n *\n * @description\n * Get the year of the given date.\n *\n * @param date - The given date\n * @param options - An object with options\n *\n * @returns The year\n *\n * @example\n * // Which year is 2 July 2014?\n * const result = getYear(new Date(2014, 6, 2))\n * //=> 2014\n */\nexport function getYear(date, options) {\n  return toDate(date, options?.in).getFullYear();\n}\n\n// Fallback for modularized imports:\nexport default getYear;\n","import { toDate } from \"./toDate.js\";\n\n/**\n * @name isAfter\n * @category Common Helpers\n * @summary Is the first date after the second one?\n *\n * @description\n * Is the first date after the second one?\n *\n * @param date - The date that should be after the other one to return true\n * @param dateToCompare - The date to compare with\n *\n * @returns The first date is after the second date\n *\n * @example\n * // Is 10 July 1989 after 11 February 1987?\n * const result = isAfter(new Date(1989, 6, 10), new Date(1987, 1, 11))\n * //=> true\n */\nexport function isAfter(date, dateToCompare) {\n  return +toDate(date) > +toDate(dateToCompare);\n}\n\n// Fallback for modularized imports:\nexport default isAfter;\n","import { toDate } from \"./toDate.js\";\n\n/**\n * @name isBefore\n * @category Common Helpers\n * @summary Is the first date before the second one?\n *\n * @description\n * Is the first date before the second one?\n *\n * @param date - The date that should be before the other one to return true\n * @param dateToCompare - The date to compare with\n *\n * @returns The first date is before the second date\n *\n * @example\n * // Is 10 July 1989 before 11 February 1987?\n * const result = isBefore(new Date(1989, 6, 10), new Date(1987, 1, 11))\n * //=> false\n */\nexport function isBefore(date, dateToCompare) {\n  return +toDate(date) < +toDate(dateToCompare);\n}\n\n// Fallback for modularized imports:\nexport default isBefore;\n","import { normalizeDates } from \"./_lib/normalizeDates.js\";\nimport { startOfDay } from \"./startOfDay.js\";\n\n/**\n * The {@link isSameDay} function options.\n */\n\n/**\n * @name isSameDay\n * @category Day Helpers\n * @summary Are the given dates in the same day (and year and month)?\n *\n * @description\n * Are the given dates in the same day (and year and month)?\n *\n * @param laterDate - The first date to check\n * @param earlierDate - The second date to check\n * @param options - An object with options\n *\n * @returns The dates are in the same day (and year and month)\n *\n * @example\n * // Are 4 September 06:00:00 and 4 September 18:00:00 in the same day?\n * const result = isSameDay(new Date(2014, 8, 4, 6, 0), new Date(2014, 8, 4, 18, 0))\n * //=> true\n *\n * @example\n * // Are 4 September and 4 October in the same day?\n * const result = isSameDay(new Date(2014, 8, 4), new Date(2014, 9, 4))\n * //=> false\n *\n * @example\n * // Are 4 September, 2014 and 4 September, 2015 in the same day?\n * const result = isSameDay(new Date(2014, 8, 4), new Date(2015, 8, 4))\n * //=> false\n */\nexport function isSameDay(laterDate, earlierDate, options) {\n  const [dateLeft_, dateRight_] = normalizeDates(\n    options?.in,\n    laterDate,\n    earlierDate,\n  );\n  return +startOfDay(dateLeft_) === +startOfDay(dateRight_);\n}\n\n// Fallback for modularized imports:\nexport default isSameDay;\n","import { normalizeDates } from \"./_lib/normalizeDates.js\";\n\n/**\n * The {@link isSameMonth} function options.\n */\n\n/**\n * @name isSameMonth\n * @category Month Helpers\n * @summary Are the given dates in the same month (and year)?\n *\n * @description\n * Are the given dates in the same month (and year)?\n *\n * @param laterDate - The first date to check\n * @param earlierDate - The second date to check\n * @param options - An object with options\n *\n * @returns The dates are in the same month (and year)\n *\n * @example\n * // Are 2 September 2014 and 25 September 2014 in the same month?\n * const result = isSameMonth(new Date(2014, 8, 2), new Date(2014, 8, 25))\n * //=> true\n *\n * @example\n * // Are 2 September 2014 and 25 September 2015 in the same month?\n * const result = isSameMonth(new Date(2014, 8, 2), new Date(2015, 8, 25))\n * //=> false\n */\nexport function isSameMonth(laterDate, earlierDate, options) {\n  const [laterDate_, earlierDate_] = normalizeDates(\n    options?.in,\n    laterDate,\n    earlierDate,\n  );\n  return (\n    laterDate_.getFullYear() === earlierDate_.getFullYear() &&\n    laterDate_.getMonth() === earlierDate_.getMonth()\n  );\n}\n\n// Fallback for modularized imports:\nexport default isSameMonth;\n","import { normalizeDates } from \"./_lib/normalizeDates.js\";\n\n/**\n * The {@link isSameYear} function options.\n */\n\n/**\n * @name isSameYear\n * @category Year Helpers\n * @summary Are the given dates in the same year?\n *\n * @description\n * Are the given dates in the same year?\n *\n * @param laterDate - The first date to check\n * @param earlierDate - The second date to check\n * @param options - An object with options\n *\n * @returns The dates are in the same year\n *\n * @example\n * // Are 2 September 2014 and 25 September 2014 in the same year?\n * const result = isSameYear(new Date(2014, 8, 2), new Date(2014, 8, 25))\n * //=> true\n */\nexport function isSameYear(laterDate, earlierDate, options) {\n  const [laterDate_, earlierDate_] = normalizeDates(\n    options?.in,\n    laterDate,\n    earlierDate,\n  );\n  return laterDate_.getFullYear() === earlierDate_.getFullYear();\n}\n\n// Fallback for modularized imports:\nexport default isSameYear;\n","import { constructFrom } from \"./constructFrom.js\";\nimport { toDate } from \"./toDate.js\";\n\n/**\n * The {@link max} function options.\n */\n\n/**\n * @name max\n * @category Common Helpers\n * @summary Return the latest of the given dates.\n *\n * @description\n * Return the latest of the given dates.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param dates - The dates to compare\n *\n * @returns The latest of the dates\n *\n * @example\n * // Which of these dates is the latest?\n * const result = max([\n *   new Date(1989, 6, 10),\n *   new Date(1987, 1, 11),\n *   new Date(1995, 6, 2),\n *   new Date(1990, 0, 1)\n * ])\n * //=> Sun Jul 02 1995 00:00:00\n */\nexport function max(dates, options) {\n  let result;\n  let context = options?.in;\n\n  dates.forEach((date) => {\n    // Use the first date object as the context function\n    if (!context && typeof date === \"object\")\n      context = constructFrom.bind(null, date);\n\n    const date_ = toDate(date, context);\n    if (!result || result < date_ || isNaN(+date_)) result = date_;\n  });\n\n  return constructFrom(context, result || NaN);\n}\n\n// Fallback for modularized imports:\nexport default max;\n","import { constructFrom } from \"./constructFrom.js\";\nimport { toDate } from \"./toDate.js\";\n\n/**\n * The {@link min} function options.\n */\n\n/**\n * @name min\n * @category Common Helpers\n * @summary Returns the earliest of the given dates.\n *\n * @description\n * Returns the earliest of the given dates.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param dates - The dates to compare\n *\n * @returns The earliest of the dates\n *\n * @example\n * // Which of these dates is the earliest?\n * const result = min([\n *   new Date(1989, 6, 10),\n *   new Date(1987, 1, 11),\n *   new Date(1995, 6, 2),\n *   new Date(1990, 0, 1)\n * ])\n * //=> Wed Feb 11 1987 00:00:00\n */\nexport function min(dates, options) {\n  let result;\n  let context = options?.in;\n\n  dates.forEach((date) => {\n    // Use the first date object as the context function\n    if (!context && typeof date === \"object\")\n      context = constructFrom.bind(null, date);\n\n    const date_ = toDate(date, context);\n    if (!result || result > date_ || isNaN(+date_)) result = date_;\n  });\n\n  return constructFrom(context, result || NaN);\n}\n\n// Fallback for modularized imports:\nexport default min;\n","import { constructFrom } from \"./constructFrom.js\";\nimport { toDate } from \"./toDate.js\";\n\n/**\n * The {@link setYear} function options.\n */\n\n/**\n * @name setYear\n * @category Year Helpers\n * @summary Set the year to the given date.\n *\n * @description\n * Set the year to the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The date to be changed\n * @param year - The year of the new date\n * @param options - An object with options.\n *\n * @returns The new date with the year set\n *\n * @example\n * // Set year 2013 to 1 September 2014:\n * const result = setYear(new Date(2014, 8, 1), 2013)\n * //=> Sun Sep 01 2013 00:00:00\n */\nexport function setYear(date, year, options) {\n  const date_ = toDate(date, options?.in);\n\n  // Check if date is Invalid Date because Date.prototype.setFullYear ignores the value of Invalid Date\n  if (isNaN(+date_)) return constructFrom(options?.in || date, NaN);\n\n  date_.setFullYear(year);\n  return date_;\n}\n\n// Fallback for modularized imports:\nexport default setYear;\n","import { toDate } from \"./toDate.js\";\n\n/**\n * The {@link startOfMonth} function options.\n */\n\n/**\n * @name startOfMonth\n * @category Month Helpers\n * @summary Return the start of a month for the given date.\n *\n * @description\n * Return the start of a month for the given date. The result will be in the local timezone.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments.\n * Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed,\n * or inferred from the arguments.\n *\n * @param date - The original date\n * @param options - An object with options\n *\n * @returns The start of a month\n *\n * @example\n * // The start of a month for 2 September 2014 11:55:00:\n * const result = startOfMonth(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Mon Sep 01 2014 00:00:00\n */\nexport function startOfMonth(date, options) {\n  const _date = toDate(date, options?.in);\n  _date.setDate(1);\n  _date.setHours(0, 0, 0, 0);\n  return _date;\n}\n\n// Fallback for modularized imports:\nexport default startOfMonth;\n","import { defaultDateLib } from \"./DateLib.js\";\n/**\n * Represents a day displayed in the calendar.\n *\n * In DayPicker, a `CalendarDay` is a wrapper around a `Date` object that\n * provides additional information about the day, such as whether it belongs to\n * the displayed month.\n */\nexport class CalendarDay {\n    constructor(date, displayMonth, dateLib = defaultDateLib) {\n        this.date = date;\n        this.displayMonth = displayMonth;\n        this.outside = Boolean(displayMonth && !dateLib.isSameMonth(date, displayMonth));\n        this.dateLib = dateLib;\n    }\n    /**\n     * Checks if this day is equal to another `CalendarDay`, considering both the\n     * date and the displayed month.\n     *\n     * @param day The `CalendarDay` to compare with.\n     * @returns `true` if the days are equal, otherwise `false`.\n     */\n    isEqualTo(day) {\n        return (this.dateLib.isSameDay(day.date, this.date) &&\n            this.dateLib.isSameMonth(day.displayMonth, this.displayMonth));\n    }\n}\n//# sourceMappingURL=CalendarDay.js.map","/**\n * Represents a month in a calendar year.\n *\n * A `CalendarMonth` contains the weeks within the month and the date of the\n * month.\n */\nexport class CalendarMonth {\n    constructor(month, weeks) {\n        this.date = month;\n        this.weeks = weeks;\n    }\n}\n//# sourceMappingURL=CalendarMonth.js.map","/**\n * Represents a week in a calendar month.\n *\n * A `CalendarWeek` contains the days within the week and the week number.\n */\nexport class CalendarWeek {\n    constructor(weekNumber, days) {\n        this.days = days;\n        this.weekNumber = weekNumber;\n    }\n}\n//# sourceMappingURL=CalendarWeek.js.map","import { defaultDateLib } from \"../classes/index.js\";\n/**\n * Checks if a given date is within a specified date range.\n *\n * @since 9.0.0\n * @param range - The date range to check against.\n * @param date - The date to check.\n * @param excludeEnds - If `true`, the range's start and end dates are excluded.\n * @param dateLib - The date utility library instance.\n * @returns `true` if the date is within the range, otherwise `false`.\n * @group Utilities\n */\nexport function rangeIncludesDate(range, date, excludeEnds = false, dateLib = defaultDateLib) {\n    let { from, to } = range;\n    const { differenceInCalendarDays, isSameDay } = dateLib;\n    if (from && to) {\n        const isRangeInverted = differenceInCalendarDays(to, from) < 0;\n        if (isRangeInverted) {\n            [from, to] = [to, from];\n        }\n        const isInRange = differenceInCalendarDays(date, from) >= (excludeEnds ? 1 : 0) &&\n            differenceInCalendarDays(to, date) >= (excludeEnds ? 1 : 0);\n        return isInRange;\n    }\n    if (!excludeEnds && to) {\n        return isSameDay(to, date);\n    }\n    if (!excludeEnds && from) {\n        return isSameDay(from, date);\n    }\n    return false;\n}\n/**\n * @private\n * @deprecated Use {@link rangeIncludesDate} instead.\n */\nexport const isDateInRange = (range, date) => rangeIncludesDate(range, date, false, defaultDateLib);\n//# sourceMappingURL=rangeIncludesDate.js.map","/**\n * Checks if the given value is of type {@link DateInterval}.\n *\n * @param matcher - The value to check.\n * @returns `true` if the value is a {@link DateInterval}, otherwise `false`.\n * @group Utilities\n */\nexport function isDateInterval(matcher) {\n    return Boolean(matcher &&\n        typeof matcher === \"object\" &&\n        \"before\" in matcher &&\n        \"after\" in matcher);\n}\n/**\n * Checks if the given value is of type {@link DateRange}.\n *\n * @param value - The value to check.\n * @returns `true` if the value is a {@link DateRange}, otherwise `false`.\n * @group Utilities\n */\nexport function isDateRange(value) {\n    return Boolean(value && typeof value === \"object\" && \"from\" in value);\n}\n/**\n * Checks if the given value is of type {@link DateAfter}.\n *\n * @param value - The value to check.\n * @returns `true` if the value is a {@link DateAfter}, otherwise `false`.\n * @group Utilities\n */\nexport function isDateAfterType(value) {\n    return Boolean(value && typeof value === \"object\" && \"after\" in value);\n}\n/**\n * Checks if the given value is of type {@link DateBefore}.\n *\n * @param value - The value to check.\n * @returns `true` if the value is a {@link DateBefore}, otherwise `false`.\n * @group Utilities\n */\nexport function isDateBeforeType(value) {\n    return Boolean(value && typeof value === \"object\" && \"before\" in value);\n}\n/**\n * Checks if the given value is of type {@link DayOfWeek}.\n *\n * @param value - The value to check.\n * @returns `true` if the value is a {@link DayOfWeek}, otherwise `false`.\n * @group Utilities\n */\nexport function isDayOfWeekType(value) {\n    return Boolean(value && typeof value === \"object\" && \"dayOfWeek\" in value);\n}\n/**\n * Checks if the given value is an array of valid dates.\n *\n * @private\n * @param value - The value to check.\n * @param dateLib - The date utility library instance.\n * @returns `true` if the value is an array of valid dates, otherwise `false`.\n */\nexport function isDatesArray(value, dateLib) {\n    return Array.isArray(value) && value.every(dateLib.isDate);\n}\n//# sourceMappingURL=typeguards.js.map","import { defaultDateLib } from \"../classes/DateLib.js\";\nimport { rangeIncludesDate } from \"./rangeIncludesDate.js\";\nimport { isDateAfterType, isDateBeforeType, isDateInterval, isDateRange, isDatesArray, isDayOfWeekType } from \"./typeguards.js\";\n/**\n * Checks if a given date matches at least one of the specified {@link Matcher}.\n *\n * @param date - The date to check.\n * @param matchers - The matchers to check against.\n * @param dateLib - The date utility library instance.\n * @returns `true` if the date matches any of the matchers, otherwise `false`.\n * @group Utilities\n */\nexport function dateMatchModifiers(date, matchers, dateLib = defaultDateLib) {\n    const matchersArr = !Array.isArray(matchers) ? [matchers] : matchers;\n    const { isSameDay, differenceInCalendarDays, isAfter } = dateLib;\n    return matchersArr.some((matcher) => {\n        if (typeof matcher === \"boolean\") {\n            return matcher;\n        }\n        if (dateLib.isDate(matcher)) {\n            return isSameDay(date, matcher);\n        }\n        if (isDatesArray(matcher, dateLib)) {\n            return matcher.includes(date);\n        }\n        if (isDateRange(matcher)) {\n            return rangeIncludesDate(matcher, date, false, dateLib);\n        }\n        if (isDayOfWeekType(matcher)) {\n            if (!Array.isArray(matcher.dayOfWeek)) {\n                return matcher.dayOfWeek === date.getDay();\n            }\n            return matcher.dayOfWeek.includes(date.getDay());\n        }\n        if (isDateInterval(matcher)) {\n            const diffBefore = differenceInCalendarDays(matcher.before, date);\n            const diffAfter = differenceInCalendarDays(matcher.after, date);\n            const isDayBefore = diffBefore > 0;\n            const isDayAfter = diffAfter < 0;\n            const isClosedInterval = isAfter(matcher.before, matcher.after);\n            if (isClosedInterval) {\n                return isDayAfter && isDayBefore;\n            }\n            else {\n                return isDayBefore || isDayAfter;\n            }\n        }\n        if (isDateAfterType(matcher)) {\n            return differenceInCalendarDays(date, matcher.after) > 0;\n        }\n        if (isDateBeforeType(matcher)) {\n            return differenceInCalendarDays(matcher.before, date) > 0;\n        }\n        if (typeof matcher === \"function\") {\n            return matcher(date);\n        }\n        return false;\n    });\n}\n/**\n * @private\n * @deprecated Use {@link dateMatchModifiers} instead.\n */\nexport const isMatch = dateMatchModifiers;\n//# sourceMappingURL=dateMatchModifiers.js.map","import { createContext, useContext } from \"react\";\n/** @ignore */\nexport const dayPickerContext = createContext(undefined);\n/**\n * Provides access to the DayPicker context, which includes properties and\n * methods to interact with the DayPicker component. This hook must be used\n * within a custom component.\n *\n * @template T - Use this type to refine the returned context type with a\n *   specific selection mode.\n * @returns The context to work with DayPicker.\n * @throws {Error} If the hook is used outside of a DayPicker provider.\n * @group Hooks\n * @see https://daypicker.dev/guides/custom-components\n */\nexport function useDayPicker() {\n    const context = useContext(dayPickerContext);\n    if (context === undefined) {\n        throw new Error(\"useDayPicker() must be used within a custom component.\");\n    }\n    return context;\n}\n//# sourceMappingURL=useDayPicker.js.map","import React from \"react\";\n/**\n * Render the button elements in the calendar.\n *\n * @private\n * @deprecated Use `PreviousMonthButton` or `@link NextMonthButton` instead.\n */\nexport function Button(props) {\n    return React.createElement(\"button\", { ...props });\n}\n//# sourceMappingURL=Button.js.map","import React from \"react\";\n/**\n * Render the label in the month caption.\n *\n * @group Components\n * @see https://daypicker.dev/guides/custom-components\n */\nexport function CaptionLabel(props) {\n    return React.createElement(\"span\", { ...props });\n}\n//# sourceMappingURL=CaptionLabel.js.map","import React from \"react\";\n/**\n * Render the chevron icon used in the navigation buttons and dropdowns.\n *\n * @group Components\n * @see https://daypicker.dev/guides/custom-components\n */\nexport function Chevron(props) {\n    const { size = 24, orientation = \"left\", className } = props;\n    return (React.createElement(\"svg\", { className: className, width: size, height: size, viewBox: \"0 0 24 24\" },\n        orientation === \"up\" && (React.createElement(\"polygon\", { points: \"6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28\" })),\n        orientation === \"down\" && (React.createElement(\"polygon\", { points: \"6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72\" })),\n        orientation === \"left\" && (React.createElement(\"polygon\", { points: \"16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20\" })),\n        orientation === \"right\" && (React.createElement(\"polygon\", { points: \"8 18.112 14.18888889 12 8 5.87733333 9.91111111 4 18 12 9.91111111 20\" }))));\n}\n//# sourceMappingURL=Chevron.js.map","import React from \"react\";\n/**\n * Render a grid cell for a specific day in the calendar.\n *\n * Handles interaction and focus for the day. If you only need to change the\n * content of the day cell, consider swapping the `DayButton` component\n * instead.\n *\n * @group Components\n * @see https://daypicker.dev/guides/custom-components\n */\nexport function Day(props) {\n    const { day, modifiers, ...tdProps } = props;\n    return React.createElement(\"td\", { ...tdProps });\n}\n//# sourceMappingURL=Day.js.map","import React from \"react\";\n/**\n * Render a button for a specific day in the calendar.\n *\n * @group Components\n * @see https://daypicker.dev/guides/custom-components\n */\nexport function DayButton(props) {\n    const { day, modifiers, ...buttonProps } = props;\n    const ref = React.useRef(null);\n    React.useEffect(() => {\n        if (modifiers.focused)\n            ref.current?.focus();\n    }, [modifiers.focused]);\n    return React.createElement(\"button\", { ref: ref, ...buttonProps });\n}\n//# sourceMappingURL=DayButton.js.map","import React from \"react\";\nimport { UI } from \"../UI.js\";\n/**\n * Render a dropdown component for navigation in the calendar.\n *\n * @group Components\n * @see https://daypicker.dev/guides/custom-components\n */\nexport function Dropdown(props) {\n    const { options, className, components, classNames, ...selectProps } = props;\n    const cssClassSelect = [classNames[UI.Dropdown], className].join(\" \");\n    const selectedOption = options?.find(({ value }) => value === selectProps.value);\n    return (React.createElement(\"span\", { \"data-disabled\": selectProps.disabled, className: classNames[UI.DropdownRoot] },\n        React.createElement(components.Select, { className: cssClassSelect, ...selectProps }, options?.map(({ value, label, disabled }) => (React.createElement(components.Option, { key: value, value: value, disabled: disabled }, label)))),\n        React.createElement(\"span\", { className: classNames[UI.CaptionLabel], \"aria-hidden\": true },\n            selectedOption?.label,\n            React.createElement(components.Chevron, { orientation: \"down\", size: 18, className: classNames[UI.Chevron] }))));\n}\n//# sourceMappingURL=Dropdown.js.map","import React from \"react\";\n/**\n * Render the navigation dropdowns for the calendar.\n *\n * @group Components\n * @see https://daypicker.dev/guides/custom-components\n */\nexport function DropdownNav(props) {\n    return React.createElement(\"div\", { ...props });\n}\n//# sourceMappingURL=DropdownNav.js.map","import React from \"react\";\n/**\n * Render the footer of the calendar.\n *\n * @group Components\n * @see https://daypicker.dev/guides/custom-components\n */\nexport function Footer(props) {\n    return React.createElement(\"div\", { ...props });\n}\n//# sourceMappingURL=Footer.js.map","import React from \"react\";\n/**\n * Render the grid with the weekday header row and the weeks for a specific\n * month.\n *\n * @group Components\n * @see https://daypicker.dev/guides/custom-components\n */\nexport function Month(props) {\n    const { calendarMonth, displayIndex, ...divProps } = props;\n    return React.createElement(\"div\", { ...divProps }, props.children);\n}\n//# sourceMappingURL=Month.js.map","import React from \"react\";\n/**\n * Render the caption for a month in the calendar.\n *\n * @group Components\n * @see https://daypicker.dev/guides/custom-components\n */\nexport function MonthCaption(props) {\n    const { calendarMonth, displayIndex, ...divProps } = props;\n    return React.createElement(\"div\", { ...divProps });\n}\n//# sourceMappingURL=MonthCaption.js.map","import React from \"react\";\n/**\n * Render the grid of days for a specific month.\n *\n * @group Components\n * @see https://daypicker.dev/guides/custom-components\n */\nexport function MonthGrid(props) {\n    return React.createElement(\"table\", { ...props });\n}\n//# sourceMappingURL=MonthGrid.js.map","import React from \"react\";\n/**\n * Render a container wrapping the month grids.\n *\n * @group Components\n * @see https://daypicker.dev/guides/custom-components\n */\nexport function Months(props) {\n    return React.createElement(\"div\", { ...props });\n}\n//# sourceMappingURL=Months.js.map","import React from \"react\";\nimport { useDayPicker } from \"../useDayPicker.js\";\n/**\n * Render a dropdown to navigate between months in the calendar.\n *\n * @group Components\n * @see https://daypicker.dev/guides/custom-components\n */\nexport function MonthsDropdown(props) {\n    const { components } = useDayPicker();\n    return React.createElement(components.Dropdown, { ...props });\n}\n//# sourceMappingURL=MonthsDropdown.js.map","import React, { useCallback } from \"react\";\nimport { UI } from \"../UI.js\";\nimport { useDayPicker } from \"../useDayPicker.js\";\n/**\n * Render the navigation toolbar with buttons to navigate between months.\n *\n * @group Components\n * @see https://daypicker.dev/guides/custom-components\n */\nexport function Nav(props) {\n    const { onPreviousClick, onNextClick, previousMonth, nextMonth, ...navProps } = props;\n    const { components, classNames, labels: { labelPrevious, labelNext } } = useDayPicker();\n    const handleNextClick = useCallback((e) => {\n        if (nextMonth) {\n            onNextClick?.(e);\n        }\n    }, [nextMonth, onNextClick]);\n    const handlePreviousClick = useCallback((e) => {\n        if (previousMonth) {\n            onPreviousClick?.(e);\n        }\n    }, [previousMonth, onPreviousClick]);\n    return (React.createElement(\"nav\", { ...navProps },\n        React.createElement(components.PreviousMonthButton, { type: \"button\", className: classNames[UI.PreviousMonthButton], tabIndex: previousMonth ? undefined : -1, \"aria-disabled\": previousMonth ? undefined : true, \"aria-label\": labelPrevious(previousMonth), onClick: handlePreviousClick },\n            React.createElement(components.Chevron, { disabled: previousMonth ? undefined : true, className: classNames[UI.Chevron], orientation: \"left\" })),\n        React.createElement(components.NextMonthButton, { type: \"button\", className: classNames[UI.NextMonthButton], tabIndex: nextMonth ? undefined : -1, \"aria-disabled\": nextMonth ? undefined : true, \"aria-label\": labelNext(nextMonth), onClick: handleNextClick },\n            React.createElement(components.Chevron, { disabled: nextMonth ? undefined : true, orientation: \"right\", className: classNames[UI.Chevron] }))));\n}\n//# sourceMappingURL=Nav.js.map","import React from \"react\";\nimport { useDayPicker } from \"../useDayPicker.js\";\n/**\n * Render the button to navigate to the next month in the calendar.\n *\n * @group Components\n * @see https://daypicker.dev/guides/custom-components\n */\nexport function NextMonthButton(props) {\n    const { components } = useDayPicker();\n    return React.createElement(components.Button, { ...props });\n}\n//# sourceMappingURL=NextMonthButton.js.map","import React from \"react\";\n/**\n * Render an `option` element.\n *\n * @group Components\n * @see https://daypicker.dev/guides/custom-components\n */\nexport function Option(props) {\n    return React.createElement(\"option\", { ...props });\n}\n//# sourceMappingURL=Option.js.map","import React from \"react\";\nimport { useDayPicker } from \"../useDayPicker.js\";\n/**\n * Render the button to navigate to the previous month in the calendar.\n *\n * @group Components\n * @see https://daypicker.dev/guides/custom-components\n */\nexport function PreviousMonthButton(props) {\n    const { components } = useDayPicker();\n    return React.createElement(components.Button, { ...props });\n}\n//# sourceMappingURL=PreviousMonthButton.js.map","import React from \"react\";\n/**\n * Render the root element of the calendar.\n *\n * @group Components\n * @see https://daypicker.dev/guides/custom-components\n */\nexport function Root(props) {\n    const { rootRef, ...rest } = props;\n    return React.createElement(\"div\", { ...rest, ref: rootRef });\n}\n//# sourceMappingURL=Root.js.map","import React from \"react\";\n/**\n * Render a `select` element.\n *\n * @group Components\n * @see https://daypicker.dev/guides/custom-components\n */\nexport function Select(props) {\n    return React.createElement(\"select\", { ...props });\n}\n//# sourceMappingURL=Select.js.map","import React from \"react\";\n/**\n * Render a table row representing a week in the calendar.\n *\n * @group Components\n * @see https://daypicker.dev/guides/custom-components\n */\nexport function Week(props) {\n    const { week, ...trProps } = props;\n    return React.createElement(\"tr\", { ...trProps });\n}\n//# sourceMappingURL=Week.js.map","import React from \"react\";\n/**\n * Render a table cell displaying the number of the week.\n *\n * @group Components\n * @see https://daypicker.dev/guides/custom-components\n */\nexport function WeekNumber(props) {\n    const { week, ...thProps } = props;\n    return React.createElement(\"th\", { ...thProps });\n}\n//# sourceMappingURL=WeekNumber.js.map","import React from \"react\";\n/**\n * Render the header cell for the week numbers column.\n *\n * @group Components\n * @see https://daypicker.dev/guides/custom-components\n */\nexport function WeekNumberHeader(props) {\n    return React.createElement(\"th\", { ...props });\n}\n//# sourceMappingURL=WeekNumberHeader.js.map","import React from \"react\";\n/**\n * Render a table header cell with the name of a weekday (e.g., \"Mo\", \"Tu\").\n *\n * @group Components\n * @see https://daypicker.dev/guides/custom-components\n */\nexport function Weekday(props) {\n    return React.createElement(\"th\", { ...props });\n}\n//# sourceMappingURL=Weekday.js.map","import React from \"react\";\n/**\n * Render the table row containing the weekday names.\n *\n * @group Components\n * @see https://daypicker.dev/guides/custom-components\n */\nexport function Weekdays(props) {\n    return (React.createElement(\"thead\", { \"aria-hidden\": true },\n        React.createElement(\"tr\", { ...props })));\n}\n//# sourceMappingURL=Weekdays.js.map","import React from \"react\";\n/**\n * Render the container for the weeks in the month grid.\n *\n * @group Components\n * @see https://daypicker.dev/guides/custom-components\n */\nexport function Weeks(props) {\n    return React.createElement(\"tbody\", { ...props });\n}\n//# sourceMappingURL=Weeks.js.map","import React from \"react\";\nimport { useDayPicker } from \"../useDayPicker.js\";\n/**\n * Render a dropdown to navigate between years in the calendar.\n *\n * @group Components\n * @see https://daypicker.dev/guides/custom-components\n */\nexport function YearsDropdown(props) {\n    const { components } = useDayPicker();\n    return React.createElement(components.Dropdown, { ...props });\n}\n//# sourceMappingURL=YearsDropdown.js.map","import * as components from \"../components/custom-components.js\";\n/**\n * Merges custom components from the props with the default components.\n *\n * This function ensures that any custom components provided in the props\n * override the default components.\n *\n * @param customComponents The custom components provided in the DayPicker\n *   props.\n * @returns An object containing the merged components.\n */\nexport function getComponents(customComponents) {\n    return {\n        ...components,\n        ...customComponents\n    };\n}\n//# sourceMappingURL=getComponents.js.map","import { UI, DayFlag, SelectionState, Animation } from \"../UI.js\";\n/**\n * Returns the default class names for the UI elements.\n *\n * This function generates a mapping of default class names for various UI\n * elements, day flags, selection states, and animations.\n *\n * @returns An object containing the default class names.\n * @group Utilities\n */\nexport function getDefaultClassNames() {\n    const classNames = {};\n    for (const key in UI) {\n        classNames[UI[key]] =\n            `rdp-${UI[key]}`;\n    }\n    for (const key in DayFlag) {\n        classNames[DayFlag[key]] =\n            `rdp-${DayFlag[key]}`;\n    }\n    for (const key in SelectionState) {\n        classNames[SelectionState[key]] =\n            `rdp-${SelectionState[key]}`;\n    }\n    for (const key in Animation) {\n        classNames[Animation[key]] =\n            `rdp-${Animation[key]}`;\n    }\n    return classNames;\n}\n//# sourceMappingURL=getDefaultClassNames.js.map","import { DateLib } from \"../classes/DateLib.js\";\n/**\n * Formats the caption of the month.\n *\n * @defaultValue `LLLL y` (e.g., \"November 2022\").\n * @param month The date representing the month.\n * @param options Configuration options for the date library.\n * @param dateLib The date library to use for formatting. If not provided, a new\n *   instance is created.\n * @returns The formatted caption as a string.\n * @group Formatters\n * @see https://daypicker.dev/docs/translation#custom-formatters\n */\nexport function formatCaption(month, options, dateLib) {\n    return (dateLib ?? new DateLib(options)).format(month, \"LLLL y\");\n}\n/**\n * @private\n * @deprecated Use {@link formatCaption} instead.\n * @group Formatters\n */\nexport const formatMonthCaption = formatCaption;\n//# sourceMappingURL=formatCaption.js.map","import { defaultDateLib } from \"../classes/DateLib.js\";\n/**\n * Formats the year for the dropdown option label.\n *\n * @param year The year to format.\n * @param dateLib The date library to use for formatting. Defaults to\n *   `defaultDateLib`.\n * @returns The formatted year as a string.\n * @group Formatters\n * @see https://daypicker.dev/docs/translation#custom-formatters\n */\nexport function formatYearDropdown(year, dateLib = defaultDateLib) {\n    return dateLib.format(year, \"yyyy\");\n}\n/**\n * @private\n * @deprecated Use `formatYearDropdown` instead.\n * @group Formatters\n */\nexport const formatYearCaption = formatYearDropdown;\n//# sourceMappingURL=formatYearDropdown.js.map","import { DateLib } from \"../classes/DateLib.js\";\n/**\n * Formats the day date shown in the day cell.\n *\n * @defaultValue `d` (e.g., \"1\").\n * @param date The date to format.\n * @param options Configuration options for the date library.\n * @param dateLib The date library to use for formatting. If not provided, a new\n *   instance is created.\n * @returns The formatted day as a string.\n * @group Formatters\n * @see https://daypicker.dev/docs/translation#custom-formatters\n */\nexport function formatDay(date, options, dateLib) {\n    return (dateLib ?? new DateLib(options)).format(date, \"d\");\n}\n//# sourceMappingURL=formatDay.js.map","import { defaultDateLib } from \"../classes/DateLib.js\";\n/**\n * Formats the month for the dropdown option label.\n *\n * @defaultValue The localized full month name.\n * @param month The date representing the month.\n * @param dateLib The date library to use for formatting. Defaults to\n *   `defaultDateLib`.\n * @returns The formatted month name as a string.\n * @group Formatters\n * @see https://daypicker.dev/docs/translation#custom-formatters\n */\nexport function formatMonthDropdown(month, dateLib = defaultDateLib) {\n    return dateLib.format(month, \"LLLL\");\n}\n//# sourceMappingURL=formatMonthDropdown.js.map","import { defaultDateLib } from \"../classes/DateLib.js\";\n/**\n * Formats the week number.\n *\n * @defaultValue The week number as a string, with a leading zero for single-digit numbers.\n * @param weekNumber The week number to format.\n * @param dateLib The date library to use for formatting. Defaults to\n *   `defaultDateLib`.\n * @returns The formatted week number as a string.\n * @group Formatters\n * @see https://daypicker.dev/docs/translation#custom-formatters\n */\nexport function formatWeekNumber(weekNumber, dateLib = defaultDateLib) {\n    if (weekNumber < 10) {\n        return dateLib.formatNumber(`0${weekNumber.toLocaleString()}`);\n    }\n    return dateLib.formatNumber(`${weekNumber.toLocaleString()}`);\n}\n//# sourceMappingURL=formatWeekNumber.js.map","/**\n * Formats the header for the week number column.\n *\n * @defaultValue An empty string `\"\"`.\n * @returns The formatted week number header as a string.\n * @group Formatters\n * @see https://daypicker.dev/docs/translation#custom-formatters\n */\nexport function formatWeekNumberHeader() {\n    return ``;\n}\n//# sourceMappingURL=formatWeekNumberHeader.js.map","import { DateLib } from \"../classes/DateLib.js\";\n/**\n * Formats the name of a weekday to be displayed in the weekdays header.\n *\n * @defaultValue `cccccc` (e.g., \"Mo\" for Monday).\n * @param weekday The date representing the weekday.\n * @param options Configuration options for the date library.\n * @param dateLib The date library to use for formatting. If not provided, a new\n *   instance is created.\n * @returns The formatted weekday name as a string.\n * @group Formatters\n * @see https://daypicker.dev/docs/translation#custom-formatters\n */\nexport function formatWeekdayName(weekday, options, dateLib) {\n    return (dateLib ?? new DateLib(options)).format(weekday, \"cccccc\");\n}\n//# sourceMappingURL=formatWeekdayName.js.map","import { DateLib } from \"../classes/DateLib.js\";\n/**\n * Generates the ARIA label for the month grid, which is announced when entering\n * the grid.\n *\n * @defaultValue `LLLL y` (e.g., \"November 2022\").\n * @param date - The date representing the month.\n * @param options - Optional configuration for the date formatting library.\n * @param dateLib - An optional instance of the date formatting library.\n * @returns The ARIA label for the month grid.\n * @group Labels\n * @see https://daypicker.dev/docs/translation#aria-labels\n */\nexport function labelGrid(date, options, dateLib) {\n    return (dateLib ?? new DateLib(options)).format(date, \"LLLL y\");\n}\n/**\n * @ignore\n * @deprecated Use {@link labelGrid} instead.\n */\nexport const labelCaption = labelGrid;\n//# sourceMappingURL=labelGrid.js.map","import { DateLib } from \"../classes/DateLib.js\";\n/**\n * Generates the ARIA label for a day button.\n *\n * Use the `modifiers` argument to provide additional context for the label,\n * such as indicating if the day is \"today\" or \"selected.\"\n *\n * @defaultValue The formatted date.\n * @param date - The date to format.\n * @param modifiers - The modifiers providing context for the day.\n * @param options - Optional configuration for the date formatting library.\n * @param dateLib - An optional instance of the date formatting library.\n * @returns The ARIA label for the day button.\n * @group Labels\n * @see https://daypicker.dev/docs/translation#aria-labels\n */\nexport function labelDayButton(date, modifiers, options, dateLib) {\n    let label = (dateLib ?? new DateLib(options)).format(date, \"PPPP\");\n    if (modifiers.today)\n        label = `Today, ${label}`;\n    if (modifiers.selected)\n        label = `${label}, selected`;\n    return label;\n}\n/**\n * @ignore\n * @deprecated Use `labelDayButton` instead.\n */\nexport const labelDay = labelDayButton;\n//# sourceMappingURL=labelDayButton.js.map","import { DateLib } from \"../classes/DateLib.js\";\n/**\n * Generates the label for a day grid cell when the calendar is not interactive.\n *\n * @param date - The date to format.\n * @param modifiers - Optional modifiers providing context for the day.\n * @param options - Optional configuration for the date formatting library.\n * @param dateLib - An optional instance of the date formatting library.\n * @returns The label for the day grid cell.\n * @group Labels\n * @see https://daypicker.dev/docs/translation#aria-labels\n */\nexport function labelGridcell(date, modifiers, options, dateLib) {\n    let label = (dateLib ?? new DateLib(options)).format(date, \"PPPP\");\n    if (modifiers?.today) {\n        label = `Today, ${label}`;\n    }\n    return label;\n}\n//# sourceMappingURL=labelGridcell.js.map","/**\n * Generates the ARIA label for the months dropdown.\n *\n * @defaultValue `\"Choose the Month\"`\n * @param options - Optional configuration for the date formatting library.\n * @returns The ARIA label for the months dropdown.\n * @group Labels\n * @see https://daypicker.dev/docs/translation#aria-labels\n */\nexport function labelMonthDropdown(options) {\n    return \"Choose the Month\";\n}\n//# sourceMappingURL=labelMonthDropdown.js.map","/**\n * Generates the ARIA label for the navigation toolbar.\n *\n * @defaultValue `\"\"`\n * @returns The ARIA label for the navigation toolbar.\n * @group Labels\n * @see https://daypicker.dev/docs/translation#aria-labels\n */\nexport function labelNav() {\n    return \"\";\n}\n//# sourceMappingURL=labelNav.js.map","/**\n * Generates the ARIA label for the \"next month\" button.\n *\n * @defaultValue `\"Go to the Next Month\"`\n * @param month - The date representing the next month, or `undefined` if there\n *   is no next month.\n * @returns The ARIA label for the \"next month\" button.\n * @group Labels\n * @see https://daypicker.dev/docs/translation#aria-labels\n */\nexport function labelNext(month) {\n    return \"Go to the Next Month\";\n}\n//# sourceMappingURL=labelNext.js.map","/**\n * Generates the ARIA label for the \"previous month\" button.\n *\n * @defaultValue `\"Go to the Previous Month\"`\n * @param month - The date representing the previous month, or `undefined` if\n *   there is no previous month.\n * @returns The ARIA label for the \"previous month\" button.\n * @group Labels\n * @see https://daypicker.dev/docs/translation#aria-labels\n */\nexport function labelPrevious(month) {\n    return \"Go to the Previous Month\";\n}\n//# sourceMappingURL=labelPrevious.js.map","/**\n * Generates the ARIA label for the week number cell (the first cell in a row).\n *\n * @defaultValue `Week ${weekNumber}`\n * @param weekNumber - The number of the week.\n * @param options - Optional configuration for the date formatting library.\n * @returns The ARIA label for the week number cell.\n * @group Labels\n * @see https://daypicker.dev/docs/translation#aria-labels\n */\nexport function labelWeekNumber(weekNumber, options) {\n    return `Week ${weekNumber}`;\n}\n//# sourceMappingURL=labelWeekNumber.js.map","/**\n * Generates the ARIA label for the week number header element.\n *\n * @defaultValue `\"Week Number\"`\n * @param options - Optional configuration for the date formatting library.\n * @returns The ARIA label for the week number header.\n * @group Labels\n * @see https://daypicker.dev/docs/translation#aria-labels\n */\nexport function labelWeekNumberHeader(options) {\n    return \"Week Number\";\n}\n//# sourceMappingURL=labelWeekNumberHeader.js.map","import { DateLib } from \"../classes/DateLib.js\";\n/**\n * Generates the ARIA label for a weekday column header.\n *\n * @defaultValue `\"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\", \"Sunday\"`\n * @param date - The date representing the weekday.\n * @param options - Optional configuration for the date formatting library.\n * @param dateLib - An optional instance of the date formatting library.\n * @returns The ARIA label for the weekday column header.\n * @group Labels\n * @see https://daypicker.dev/docs/translation#aria-labels\n */\nexport function labelWeekday(date, options, dateLib) {\n    return (dateLib ?? new DateLib(options)).format(date, \"cccc\");\n}\n//# sourceMappingURL=labelWeekday.js.map","/**\n * Generates the ARIA label for the years dropdown.\n *\n * @defaultValue `\"Choose the Year\"`\n * @param options - Optional configuration for the date formatting library.\n * @returns The ARIA label for the years dropdown.\n * @group Labels\n * @see https://daypicker.dev/docs/translation#aria-labels\n */\nexport function labelYearDropdown(options) {\n    return \"Choose the Year\";\n}\n//# sourceMappingURL=labelYearDropdown.js.map","import { useLayoutEffect, useRef } from \"react\";\nimport { Animation } from \"./UI.js\";\nconst asHtmlElement = (element) => {\n    if (element instanceof HTMLElement)\n        return element;\n    return null;\n};\nconst queryMonthEls = (element) => [\n    ...(element.querySelectorAll(\"[data-animated-month]\") ?? [])\n];\nconst queryMonthEl = (element) => asHtmlElement(element.querySelector(\"[data-animated-month]\"));\nconst queryCaptionEl = (element) => asHtmlElement(element.querySelector(\"[data-animated-caption]\"));\nconst queryWeeksEl = (element) => asHtmlElement(element.querySelector(\"[data-animated-weeks]\"));\nconst queryNavEl = (element) => asHtmlElement(element.querySelector(\"[data-animated-nav]\"));\nconst queryWeekdaysEl = (element) => asHtmlElement(element.querySelector(\"[data-animated-weekdays]\"));\n/**\n * Handles animations for transitioning between months in the DayPicker\n * component.\n *\n * @private\n * @param rootElRef - A reference to the root element of the DayPicker\n *   component.\n * @param enabled - Whether animations are enabled.\n * @param options - Configuration options for the animation, including class\n *   names, months, focused day, and the date utility library.\n */\nexport function useAnimation(rootElRef, enabled, { classNames, months, focused, dateLib }) {\n    const previousRootElSnapshotRef = useRef(null);\n    const previousMonthsRef = useRef(months);\n    const animatingRef = useRef(false);\n    useLayoutEffect(() => {\n        // get previous months before updating the previous months ref\n        const previousMonths = previousMonthsRef.current;\n        // update previous months ref for next effect trigger\n        previousMonthsRef.current = months;\n        if (!enabled ||\n            !rootElRef.current ||\n            // safety check because the ref can be set to anything by consumers\n            !(rootElRef.current instanceof HTMLElement) ||\n            // validation required for the animation to work as expected\n            months.length === 0 ||\n            previousMonths.length === 0 ||\n            months.length !== previousMonths.length) {\n            return;\n        }\n        const isSameMonth = dateLib.isSameMonth(months[0].date, previousMonths[0].date);\n        const isAfterPreviousMonth = dateLib.isAfter(months[0].date, previousMonths[0].date);\n        const captionAnimationClass = isAfterPreviousMonth\n            ? classNames[Animation.caption_after_enter]\n            : classNames[Animation.caption_before_enter];\n        const weeksAnimationClass = isAfterPreviousMonth\n            ? classNames[Animation.weeks_after_enter]\n            : classNames[Animation.weeks_before_enter];\n        // get previous root element snapshot before updating the snapshot ref\n        const previousRootElSnapshot = previousRootElSnapshotRef.current;\n        // update snapshot for next effect trigger\n        const rootElSnapshot = rootElRef.current.cloneNode(true);\n        if (rootElSnapshot instanceof HTMLElement) {\n            // if this effect is triggered while animating, we need to clean up the new root snapshot\n            // to put it in the same state as when not animating, to correctly animate the next month change\n            const currentMonthElsSnapshot = queryMonthEls(rootElSnapshot);\n            currentMonthElsSnapshot.forEach((currentMonthElSnapshot) => {\n                if (!(currentMonthElSnapshot instanceof HTMLElement))\n                    return;\n                // remove the old month snapshots from the new root snapshot\n                const previousMonthElSnapshot = queryMonthEl(currentMonthElSnapshot);\n                if (previousMonthElSnapshot &&\n                    currentMonthElSnapshot.contains(previousMonthElSnapshot)) {\n                    currentMonthElSnapshot.removeChild(previousMonthElSnapshot);\n                }\n                // remove animation classes from the new month snapshots\n                const captionEl = queryCaptionEl(currentMonthElSnapshot);\n                if (captionEl) {\n                    captionEl.classList.remove(captionAnimationClass);\n                }\n                const weeksEl = queryWeeksEl(currentMonthElSnapshot);\n                if (weeksEl) {\n                    weeksEl.classList.remove(weeksAnimationClass);\n                }\n            });\n            previousRootElSnapshotRef.current = rootElSnapshot;\n        }\n        else {\n            previousRootElSnapshotRef.current = null;\n        }\n        if (animatingRef.current ||\n            isSameMonth ||\n            // skip animation if a day is focused because it can cause issues to the animation and is better for a11y\n            focused) {\n            return;\n        }\n        const previousMonthEls = previousRootElSnapshot instanceof HTMLElement\n            ? queryMonthEls(previousRootElSnapshot)\n            : [];\n        const currentMonthEls = queryMonthEls(rootElRef.current);\n        if (currentMonthEls &&\n            currentMonthEls.every((el) => el instanceof HTMLElement) &&\n            previousMonthEls &&\n            previousMonthEls.every((el) => el instanceof HTMLElement)) {\n            animatingRef.current = true;\n            const cleanUpFunctions = [];\n            // set isolation to isolate to isolate the stacking context during animation\n            rootElRef.current.style.isolation = \"isolate\";\n            // set z-index to 1 to ensure the nav is clickable over the other elements being animated\n            const navEl = queryNavEl(rootElRef.current);\n            if (navEl) {\n                navEl.style.zIndex = \"1\";\n            }\n            currentMonthEls.forEach((currentMonthEl, index) => {\n                const previousMonthEl = previousMonthEls[index];\n                if (!previousMonthEl) {\n                    return;\n                }\n                // animate new displayed month\n                currentMonthEl.style.position = \"relative\";\n                currentMonthEl.style.overflow = \"hidden\";\n                const captionEl = queryCaptionEl(currentMonthEl);\n                if (captionEl) {\n                    captionEl.classList.add(captionAnimationClass);\n                }\n                const weeksEl = queryWeeksEl(currentMonthEl);\n                if (weeksEl) {\n                    weeksEl.classList.add(weeksAnimationClass);\n                }\n                // animate new displayed month end\n                const cleanUp = () => {\n                    animatingRef.current = false;\n                    if (rootElRef.current) {\n                        rootElRef.current.style.isolation = \"\";\n                    }\n                    if (navEl) {\n                        navEl.style.zIndex = \"\";\n                    }\n                    if (captionEl) {\n                        captionEl.classList.remove(captionAnimationClass);\n                    }\n                    if (weeksEl) {\n                        weeksEl.classList.remove(weeksAnimationClass);\n                    }\n                    currentMonthEl.style.position = \"\";\n                    currentMonthEl.style.overflow = \"\";\n                    if (currentMonthEl.contains(previousMonthEl)) {\n                        currentMonthEl.removeChild(previousMonthEl);\n                    }\n                };\n                cleanUpFunctions.push(cleanUp);\n                // animate old displayed month\n                previousMonthEl.style.pointerEvents = \"none\";\n                previousMonthEl.style.position = \"absolute\";\n                previousMonthEl.style.overflow = \"hidden\";\n                previousMonthEl.setAttribute(\"aria-hidden\", \"true\");\n                // hide the weekdays container of the old month and only the new one\n                const previousWeekdaysEl = queryWeekdaysEl(previousMonthEl);\n                if (previousWeekdaysEl) {\n                    previousWeekdaysEl.style.opacity = \"0\";\n                }\n                const previousCaptionEl = queryCaptionEl(previousMonthEl);\n                if (previousCaptionEl) {\n                    previousCaptionEl.classList.add(isAfterPreviousMonth\n                        ? classNames[Animation.caption_before_exit]\n                        : classNames[Animation.caption_after_exit]);\n                    previousCaptionEl.addEventListener(\"animationend\", cleanUp);\n                }\n                const previousWeeksEl = queryWeeksEl(previousMonthEl);\n                if (previousWeeksEl) {\n                    previousWeeksEl.classList.add(isAfterPreviousMonth\n                        ? classNames[Animation.weeks_before_exit]\n                        : classNames[Animation.weeks_after_exit]);\n                }\n                currentMonthEl.insertBefore(previousMonthEl, currentMonthEl.firstChild);\n            });\n        }\n    });\n}\n//# sourceMappingURL=useAnimation.js.map","/**\n * Determines the initial month to display in the calendar based on the provided\n * props.\n *\n * This function calculates the starting month, considering constraints such as\n * `startMonth`, `endMonth`, and the number of months to display.\n *\n * @param props The DayPicker props, including navigation and date constraints.\n * @param dateLib The date library to use for date manipulation.\n * @returns The initial month to display.\n */\nexport function getInitialMonth(props, dateLib) {\n    const { month, defaultMonth, today = dateLib.today(), numberOfMonths = 1, endMonth, startMonth } = props;\n    let initialMonth = month || defaultMonth || today;\n    const { differenceInCalendarMonths, addMonths, startOfMonth } = dateLib;\n    // Adjust the initial month if it is after the endMonth\n    if (endMonth && differenceInCalendarMonths(endMonth, initialMonth) < 0) {\n        const offset = -1 * (numberOfMonths - 1);\n        initialMonth = addMonths(endMonth, offset);\n    }\n    // Adjust the initial month if it is before the startMonth\n    if (startMonth && differenceInCalendarMonths(initialMonth, startMonth) < 0) {\n        initialMonth = startMonth;\n    }\n    return startOfMonth(initialMonth);\n}\n//# sourceMappingURL=getInitialMonth.js.map","import { useState } from \"react\";\n/**\n * A custom hook for managing both controlled and uncontrolled component states.\n *\n * This hook allows a component to support both controlled and uncontrolled\n * states by determining whether the `controlledValue` is provided. If it is\n * undefined, the hook falls back to using the internal state.\n *\n * @example\n *   // Uncontrolled usage\n *   const [value, setValue] = useControlledValue(0, undefined);\n *\n *   // Controlled usage\n *   const [value, setValue] = useControlledValue(0, props.value);\n *\n * @template T - The type of the value.\n * @param defaultValue The initial value for the uncontrolled state.\n * @param controlledValue The value for the controlled state. If undefined, the\n *   component will use the uncontrolled state.\n * @returns A tuple where the first element is the current value (either\n *   controlled or uncontrolled) and the second element is a setter function to\n *   update the value.\n */\nexport function useControlledValue(defaultValue, controlledValue) {\n    const [uncontrolledValue, setValue] = useState(defaultValue);\n    const value = controlledValue === undefined ? uncontrolledValue : controlledValue;\n    return [value, setValue];\n}\n//# sourceMappingURL=useControlledValue.js.map","import { useEffect } from \"react\";\nimport { getDates } from \"./helpers/getDates.js\";\nimport { getDays } from \"./helpers/getDays.js\";\nimport { getDisplayMonths } from \"./helpers/getDisplayMonths.js\";\nimport { getInitialMonth } from \"./helpers/getInitialMonth.js\";\nimport { getMonths } from \"./helpers/getMonths.js\";\nimport { getNavMonths } from \"./helpers/getNavMonth.js\";\nimport { getNextMonth } from \"./helpers/getNextMonth.js\";\nimport { getPreviousMonth } from \"./helpers/getPreviousMonth.js\";\nimport { getWeeks } from \"./helpers/getWeeks.js\";\nimport { useControlledValue } from \"./helpers/useControlledValue.js\";\n/**\n * Provides the calendar object to work with the calendar in custom components.\n *\n * @private\n * @param props - The DayPicker props related to calendar configuration.\n * @param dateLib - The date utility library instance.\n * @returns The calendar object containing displayed days, weeks, months, and\n *   navigation methods.\n */\nexport function useCalendar(props, dateLib) {\n    const [navStart, navEnd] = getNavMonths(props, dateLib);\n    const { startOfMonth, endOfMonth } = dateLib;\n    const initialMonth = getInitialMonth(props, dateLib);\n    const [firstMonth, setFirstMonth] = useControlledValue(initialMonth, \n    // initialMonth is always computed from props.month if provided\n    props.month ? initialMonth : undefined);\n    useEffect(() => {\n        const newInitialMonth = getInitialMonth(props, dateLib);\n        setFirstMonth(newInitialMonth);\n        // eslint-disable-next-line react-hooks/exhaustive-deps\n    }, [props.timeZone]);\n    /** The months displayed in the calendar. */\n    const displayMonths = getDisplayMonths(firstMonth, navEnd, props, dateLib);\n    /** The dates displayed in the calendar. */\n    const dates = getDates(displayMonths, props.endMonth ? endOfMonth(props.endMonth) : undefined, props, dateLib);\n    /** The Months displayed in the calendar. */\n    const months = getMonths(displayMonths, dates, props, dateLib);\n    /** The Weeks displayed in the calendar. */\n    const weeks = getWeeks(months);\n    /** The Days displayed in the calendar. */\n    const days = getDays(months);\n    const previousMonth = getPreviousMonth(firstMonth, navStart, props, dateLib);\n    const nextMonth = getNextMonth(firstMonth, navEnd, props, dateLib);\n    const { disableNavigation, onMonthChange } = props;\n    const isDayInCalendar = (day) => weeks.some((week) => week.days.some((d) => d.isEqualTo(day)));\n    const goToMonth = (date) => {\n        if (disableNavigation) {\n            return;\n        }\n        let newMonth = startOfMonth(date);\n        // if month is before start, use the first month instead\n        if (navStart && newMonth < startOfMonth(navStart)) {\n            newMonth = startOfMonth(navStart);\n        }\n        // if month is after endMonth, use the last month instead\n        if (navEnd && newMonth > startOfMonth(navEnd)) {\n            newMonth = startOfMonth(navEnd);\n        }\n        setFirstMonth(newMonth);\n        onMonthChange?.(newMonth);\n    };\n    const goToDay = (day) => {\n        // is this check necessary?\n        if (isDayInCalendar(day)) {\n            return;\n        }\n        goToMonth(day.date);\n    };\n    const calendar = {\n        months,\n        weeks,\n        days,\n        navStart,\n        navEnd,\n        previousMonth,\n        nextMonth,\n        goToMonth,\n        goToDay\n    };\n    return calendar;\n}\n//# sourceMappingURL=useCalendar.js.map","/**\n * Returns the start and end months for calendar navigation.\n *\n * @param props The DayPicker props, including navigation and layout options.\n * @param dateLib The date library to use for date manipulation.\n * @returns A tuple containing the start and end months for navigation.\n */\nexport function getNavMonths(props, dateLib) {\n    let { startMonth, endMonth } = props;\n    const { startOfYear, startOfDay, startOfMonth, endOfMonth, addYears, endOfYear, newDate, today } = dateLib;\n    // Handle deprecated code\n    const { fromYear, toYear, fromMonth, toMonth } = props;\n    if (!startMonth && fromMonth) {\n        startMonth = fromMonth;\n    }\n    if (!startMonth && fromYear) {\n        startMonth = dateLib.newDate(fromYear, 0, 1);\n    }\n    if (!endMonth && toMonth) {\n        endMonth = toMonth;\n    }\n    if (!endMonth && toYear) {\n        endMonth = newDate(toYear, 11, 31);\n    }\n    const hasYearDropdown = props.captionLayout === \"dropdown\" ||\n        props.captionLayout === \"dropdown-years\";\n    if (startMonth) {\n        startMonth = startOfMonth(startMonth);\n    }\n    else if (fromYear) {\n        startMonth = newDate(fromYear, 0, 1);\n    }\n    else if (!startMonth && hasYearDropdown) {\n        startMonth = startOfYear(addYears(props.today ?? today(), -100));\n    }\n    if (endMonth) {\n        endMonth = endOfMonth(endMonth);\n    }\n    else if (toYear) {\n        endMonth = newDate(toYear, 11, 31);\n    }\n    else if (!endMonth && hasYearDropdown) {\n        endMonth = endOfYear(props.today ?? today());\n    }\n    return [\n        startMonth ? startOfDay(startMonth) : startMonth,\n        endMonth ? startOfDay(endMonth) : endMonth\n    ];\n}\n//# sourceMappingURL=getNavMonth.js.map","/**\n * Returns the months to display in the calendar.\n *\n * @param firstDisplayedMonth The first month currently displayed in the\n *   calendar.\n * @param calendarEndMonth The latest month the user can navigate to.\n * @param props The DayPicker props, including `numberOfMonths`.\n * @param dateLib The date library to use for date manipulation.\n * @returns An array of dates representing the months to display.\n */\nexport function getDisplayMonths(firstDisplayedMonth, calendarEndMonth, props, dateLib) {\n    const { numberOfMonths = 1 } = props;\n    const months = [];\n    for (let i = 0; i < numberOfMonths; i++) {\n        const month = dateLib.addMonths(firstDisplayedMonth, i);\n        if (calendarEndMonth && month > calendarEndMonth) {\n            break;\n        }\n        months.push(month);\n    }\n    return months;\n}\n//# sourceMappingURL=getDisplayMonths.js.map","/**\n * Returns all the dates to display in the calendar.\n *\n * This function calculates the range of dates to display based on the provided\n * display months, constraints, and calendar configuration.\n *\n * @param displayMonths The months to display in the calendar.\n * @param maxDate The maximum date to include in the range.\n * @param props The DayPicker props, including calendar configuration options.\n * @param dateLib The date library to use for date manipulation.\n * @returns An array of dates to display in the calendar.\n */\nexport function getDates(displayMonths, maxDate, props, dateLib) {\n    const firstMonth = displayMonths[0];\n    const lastMonth = displayMonths[displayMonths.length - 1];\n    const { ISOWeek, fixedWeeks, broadcastCalendar } = props ?? {};\n    const { addDays, differenceInCalendarDays, differenceInCalendarMonths, endOfBroadcastWeek, endOfISOWeek, endOfMonth, endOfWeek, isAfter, startOfBroadcastWeek, startOfISOWeek, startOfWeek } = dateLib;\n    const startWeekFirstDate = broadcastCalendar\n        ? startOfBroadcastWeek(firstMonth, dateLib)\n        : ISOWeek\n            ? startOfISOWeek(firstMonth)\n            : startOfWeek(firstMonth);\n    const endWeekLastDate = broadcastCalendar\n        ? endOfBroadcastWeek(lastMonth)\n        : ISOWeek\n            ? endOfISOWeek(endOfMonth(lastMonth))\n            : endOfWeek(endOfMonth(lastMonth));\n    const nOfDays = differenceInCalendarDays(endWeekLastDate, startWeekFirstDate);\n    const nOfMonths = differenceInCalendarMonths(lastMonth, firstMonth) + 1;\n    const dates = [];\n    for (let i = 0; i <= nOfDays; i++) {\n        const date = addDays(startWeekFirstDate, i);\n        if (maxDate && isAfter(date, maxDate)) {\n            break;\n        }\n        dates.push(date);\n    }\n    // If fixed weeks is enabled, add the extra dates to the array\n    const nrOfDaysWithFixedWeeks = broadcastCalendar ? 35 : 42;\n    const extraDates = nrOfDaysWithFixedWeeks * nOfMonths;\n    if (fixedWeeks && dates.length < extraDates) {\n        const daysToAdd = extraDates - dates.length;\n        for (let i = 0; i < daysToAdd; i++) {\n            const date = addDays(dates[dates.length - 1], 1);\n            dates.push(date);\n        }\n    }\n    return dates;\n}\n//# sourceMappingURL=getDates.js.map","import { CalendarWeek, CalendarDay, CalendarMonth } from \"../classes/index.js\";\n/**\n * Returns the months to display in the calendar.\n *\n * This function generates `CalendarMonth` objects for each month to be\n * displayed, including their weeks and days, based on the provided display\n * months and dates.\n *\n * @param displayMonths The months (as dates) to display in the calendar.\n * @param dates The dates to display in the calendar.\n * @param props Options from the DayPicker props context.\n * @param dateLib The date library to use for date manipulation.\n * @returns An array of `CalendarMonth` objects representing the months to\n *   display.\n */\nexport function getMonths(displayMonths, dates, props, dateLib) {\n    const { addDays, endOfBroadcastWeek, endOfISOWeek, endOfMonth, endOfWeek, getISOWeek, getWeek, startOfBroadcastWeek, startOfISOWeek, startOfWeek } = dateLib;\n    const dayPickerMonths = displayMonths.reduce((months, month) => {\n        const firstDateOfFirstWeek = props.broadcastCalendar\n            ? startOfBroadcastWeek(month, dateLib)\n            : props.ISOWeek\n                ? startOfISOWeek(month)\n                : startOfWeek(month);\n        const lastDateOfLastWeek = props.broadcastCalendar\n            ? endOfBroadcastWeek(month)\n            : props.ISOWeek\n                ? endOfISOWeek(endOfMonth(month))\n                : endOfWeek(endOfMonth(month));\n        /** The dates to display in the month. */\n        const monthDates = dates.filter((date) => {\n            return date >= firstDateOfFirstWeek && date <= lastDateOfLastWeek;\n        });\n        const nrOfDaysWithFixedWeeks = props.broadcastCalendar ? 35 : 42;\n        if (props.fixedWeeks && monthDates.length < nrOfDaysWithFixedWeeks) {\n            const extraDates = dates.filter((date) => {\n                const daysToAdd = nrOfDaysWithFixedWeeks - monthDates.length;\n                return (date > lastDateOfLastWeek &&\n                    date <= addDays(lastDateOfLastWeek, daysToAdd));\n            });\n            monthDates.push(...extraDates);\n        }\n        const weeks = monthDates.reduce((weeks, date) => {\n            const weekNumber = props.ISOWeek ? getISOWeek(date) : getWeek(date);\n            const week = weeks.find((week) => week.weekNumber === weekNumber);\n            const day = new CalendarDay(date, month, dateLib);\n            if (!week) {\n                weeks.push(new CalendarWeek(weekNumber, [day]));\n            }\n            else {\n                week.days.push(day);\n            }\n            return weeks;\n        }, []);\n        const dayPickerMonth = new CalendarMonth(month, weeks);\n        months.push(dayPickerMonth);\n        return months;\n    }, []);\n    if (!props.reverseMonths) {\n        return dayPickerMonths;\n    }\n    else {\n        return dayPickerMonths.reverse();\n    }\n}\n//# sourceMappingURL=getMonths.js.map","/**\n * Returns an array of calendar weeks from an array of calendar months.\n *\n * @param months The array of calendar months.\n * @returns An array of calendar weeks.\n */\nexport function getWeeks(months) {\n    const initialWeeks = [];\n    return months.reduce((weeks, month) => {\n        return [...weeks, ...month.weeks];\n    }, initialWeeks);\n}\n//# sourceMappingURL=getWeeks.js.map","/**\n * Returns all the days belonging to the calendar by merging the days in the\n * weeks for each month.\n *\n * @param calendarMonths The array of calendar months.\n * @returns An array of `CalendarDay` objects representing all the days in the\n *   calendar.\n */\nexport function getDays(calendarMonths) {\n    const initialDays = [];\n    return calendarMonths.reduce((days, month) => {\n        const weekDays = month.weeks.reduce((weekDays, week) => {\n            return [...weekDays, ...week.days];\n        }, initialDays);\n        return [...days, ...weekDays];\n    }, initialDays);\n}\n//# sourceMappingURL=getDays.js.map","/**\n * Returns the previous month the user can navigate to, based on the given\n * options.\n *\n * The previous month is not always the previous calendar month:\n *\n * - If it is before the `calendarStartMonth`, it returns `undefined`.\n * - If paged navigation is enabled, it skips back by the number of displayed\n *   months.\n *\n * @param firstDisplayedMonth The first month currently displayed in the\n *   calendar.\n * @param calendarStartMonth The earliest month the user can navigate to.\n * @param options Navigation options, including `numberOfMonths` and\n *   `pagedNavigation`.\n * @param dateLib The date library to use for date manipulation.\n * @returns The previous month, or `undefined` if navigation is not possible.\n */\nexport function getPreviousMonth(firstDisplayedMonth, calendarStartMonth, options, dateLib) {\n    if (options.disableNavigation) {\n        return undefined;\n    }\n    const { pagedNavigation, numberOfMonths } = options;\n    const { startOfMonth, addMonths, differenceInCalendarMonths } = dateLib;\n    const offset = pagedNavigation ? (numberOfMonths ?? 1) : 1;\n    const month = startOfMonth(firstDisplayedMonth);\n    if (!calendarStartMonth) {\n        return addMonths(month, -offset);\n    }\n    const monthsDiff = differenceInCalendarMonths(month, calendarStartMonth);\n    if (monthsDiff <= 0) {\n        return undefined;\n    }\n    return addMonths(month, -offset);\n}\n//# sourceMappingURL=getPreviousMonth.js.map","/**\n * Returns the next month the user can navigate to, based on the given options.\n *\n * The next month is not always the next calendar month:\n *\n * - If it is after the `calendarEndMonth`, it returns `undefined`.\n * - If paged navigation is enabled, it skips forward by the number of displayed\n *   months.\n *\n * @param firstDisplayedMonth The first month currently displayed in the\n *   calendar.\n * @param calendarEndMonth The latest month the user can navigate to.\n * @param options Navigation options, including `numberOfMonths` and\n *   `pagedNavigation`.\n * @param dateLib The date library to use for date manipulation.\n * @returns The next month, or `undefined` if navigation is not possible.\n */\nexport function getNextMonth(firstDisplayedMonth, calendarEndMonth, options, dateLib) {\n    if (options.disableNavigation) {\n        return undefined;\n    }\n    const { pagedNavigation, numberOfMonths = 1 } = options;\n    const { startOfMonth, addMonths, differenceInCalendarMonths } = dateLib;\n    const offset = pagedNavigation ? numberOfMonths : 1;\n    const month = startOfMonth(firstDisplayedMonth);\n    if (!calendarEndMonth) {\n        return addMonths(month, offset);\n    }\n    const monthsDiff = differenceInCalendarMonths(calendarEndMonth, firstDisplayedMonth);\n    if (monthsDiff < numberOfMonths) {\n        return undefined;\n    }\n    return addMonths(month, offset);\n}\n//# sourceMappingURL=getNextMonth.js.map","import { DayFlag } from \"../UI.js\";\nvar FocusTargetPriority;\n(function (FocusTargetPriority) {\n    FocusTargetPriority[FocusTargetPriority[\"Today\"] = 0] = \"Today\";\n    FocusTargetPriority[FocusTargetPriority[\"Selected\"] = 1] = \"Selected\";\n    FocusTargetPriority[FocusTargetPriority[\"LastFocused\"] = 2] = \"LastFocused\";\n    FocusTargetPriority[FocusTargetPriority[\"FocusedModifier\"] = 3] = \"FocusedModifier\";\n})(FocusTargetPriority || (FocusTargetPriority = {}));\n/**\n * Determines if a day is focusable based on its modifiers.\n *\n * A day is considered focusable if it is not disabled, hidden, or outside the\n * displayed month.\n *\n * @param modifiers The modifiers applied to the day.\n * @returns `true` if the day is focusable, otherwise `false`.\n */\nfunction isFocusableDay(modifiers) {\n    return (!modifiers[DayFlag.disabled] &&\n        !modifiers[DayFlag.hidden] &&\n        !modifiers[DayFlag.outside]);\n}\n/**\n * Calculates the focus target day based on priority.\n *\n * This function determines the day that should receive focus in the calendar,\n * prioritizing days with specific modifiers (e.g., \"focused\", \"today\") or\n * selection states.\n *\n * @param days The array of `CalendarDay` objects to evaluate.\n * @param getModifiers A function to retrieve the modifiers for a given day.\n * @param isSelected A function to determine if a day is selected.\n * @param lastFocused The last focused day, if any.\n * @returns The `CalendarDay` that should receive focus, or `undefined` if no\n *   focusable day is found.\n */\nexport function calculateFocusTarget(days, getModifiers, isSelected, lastFocused) {\n    let focusTarget;\n    let foundFocusTargetPriority = -1;\n    for (const day of days) {\n        const modifiers = getModifiers(day);\n        if (isFocusableDay(modifiers)) {\n            if (modifiers[DayFlag.focused] &&\n                foundFocusTargetPriority < FocusTargetPriority.FocusedModifier) {\n                focusTarget = day;\n                foundFocusTargetPriority = FocusTargetPriority.FocusedModifier;\n            }\n            else if (lastFocused?.isEqualTo(day) &&\n                foundFocusTargetPriority < FocusTargetPriority.LastFocused) {\n                focusTarget = day;\n                foundFocusTargetPriority = FocusTargetPriority.LastFocused;\n            }\n            else if (isSelected(day.date) &&\n                foundFocusTargetPriority < FocusTargetPriority.Selected) {\n                focusTarget = day;\n                foundFocusTargetPriority = FocusTargetPriority.Selected;\n            }\n            else if (modifiers[DayFlag.today] &&\n                foundFocusTargetPriority < FocusTargetPriority.Today) {\n                focusTarget = day;\n                foundFocusTargetPriority = FocusTargetPriority.Today;\n            }\n        }\n    }\n    if (!focusTarget) {\n        // Return the first day that is focusable\n        focusTarget = days.find((day) => isFocusableDay(getModifiers(day)));\n    }\n    return focusTarget;\n}\n//# sourceMappingURL=calculateFocusTarget.js.map","import { CalendarDay } from \"../classes/index.js\";\nimport { dateMatchModifiers } from \"../utils/dateMatchModifiers.js\";\nimport { getFocusableDate } from \"./getFocusableDate.js\";\n/**\n * Determines the next focusable day in the calendar.\n *\n * This function recursively calculates the next focusable day based on the\n * movement direction and modifiers applied to the days.\n *\n * @param moveBy The unit of movement (e.g., \"day\", \"week\").\n * @param moveDir The direction of movement (\"before\" or \"after\").\n * @param refDay The currently focused day.\n * @param calendarStartMonth The earliest month the user can navigate to.\n * @param calendarEndMonth The latest month the user can navigate to.\n * @param props The DayPicker props, including modifiers and configuration\n *   options.\n * @param dateLib The date library to use for date manipulation.\n * @param attempt The current recursion attempt (used to limit recursion depth).\n * @returns The next focusable day, or `undefined` if no focusable day is found.\n */\nexport function getNextFocus(moveBy, moveDir, refDay, calendarStartMonth, calendarEndMonth, props, dateLib, attempt = 0) {\n    if (attempt > 365) {\n        // Limit the recursion to 365 attempts\n        return undefined;\n    }\n    const focusableDate = getFocusableDate(moveBy, moveDir, refDay.date, calendarStartMonth, calendarEndMonth, props, dateLib);\n    const isDisabled = Boolean(props.disabled && dateMatchModifiers(focusableDate, props.disabled, dateLib));\n    const isHidden = Boolean(props.hidden && dateMatchModifiers(focusableDate, props.hidden, dateLib));\n    const targetMonth = focusableDate;\n    const focusDay = new CalendarDay(focusableDate, targetMonth, dateLib);\n    if (!isDisabled && !isHidden) {\n        return focusDay;\n    }\n    // Recursively attempt to find the next focusable date\n    return getNextFocus(moveBy, moveDir, focusDay, calendarStartMonth, calendarEndMonth, props, dateLib, attempt + 1);\n}\n//# sourceMappingURL=getNextFocus.js.map","/**\n * Calculates the next date that should be focused in the calendar.\n *\n * This function determines the next focusable date based on the movement\n * direction, constraints, and calendar configuration.\n *\n * @param moveBy The unit of movement (e.g., \"day\", \"week\").\n * @param moveDir The direction of movement (\"before\" or \"after\").\n * @param refDate The reference date from which to calculate the next focusable\n *   date.\n * @param navStart The earliest date the user can navigate to.\n * @param navEnd The latest date the user can navigate to.\n * @param props The DayPicker props, including calendar configuration options.\n * @param dateLib The date library to use for date manipulation.\n * @returns The next focusable date.\n */\nexport function getFocusableDate(moveBy, moveDir, refDate, navStart, navEnd, props, dateLib) {\n    const { ISOWeek, broadcastCalendar } = props;\n    const { addDays, addMonths, addWeeks, addYears, endOfBroadcastWeek, endOfISOWeek, endOfWeek, max, min, startOfBroadcastWeek, startOfISOWeek, startOfWeek } = dateLib;\n    const moveFns = {\n        day: addDays,\n        week: addWeeks,\n        month: addMonths,\n        year: addYears,\n        startOfWeek: (date) => broadcastCalendar\n            ? startOfBroadcastWeek(date, dateLib)\n            : ISOWeek\n                ? startOfISOWeek(date)\n                : startOfWeek(date),\n        endOfWeek: (date) => broadcastCalendar\n            ? endOfBroadcastWeek(date)\n            : ISOWeek\n                ? endOfISOWeek(date)\n                : endOfWeek(date)\n    };\n    let focusableDate = moveFns[moveBy](refDate, moveDir === \"after\" ? 1 : -1);\n    if (moveDir === \"before\" && navStart) {\n        focusableDate = max([navStart, focusableDate]);\n    }\n    else if (moveDir === \"after\" && navEnd) {\n        focusableDate = min([navEnd, focusableDate]);\n    }\n    return focusableDate;\n}\n//# sourceMappingURL=getFocusableDate.js.map","import { useState } from \"react\";\nimport { calculateFocusTarget } from \"./helpers/calculateFocusTarget.js\";\nimport { getNextFocus } from \"./helpers/getNextFocus.js\";\n/**\n * Manages focus behavior for the DayPicker component, including setting,\n * moving, and blurring focus on calendar days.\n *\n * @template T - The type of DayPicker props.\n * @param props - The DayPicker props.\n * @param calendar - The calendar object containing the displayed days and\n *   months.\n * @param getModifiers - A function to retrieve modifiers for a given day.\n * @param isSelected - A function to check if a date is selected.\n * @param dateLib - The date utility library instance.\n * @returns An object containing focus-related methods and the currently focused\n *   day.\n */\nexport function useFocus(props, calendar, getModifiers, isSelected, dateLib) {\n    const { autoFocus } = props;\n    const [lastFocused, setLastFocused] = useState();\n    const focusTarget = calculateFocusTarget(calendar.days, getModifiers, isSelected || (() => false), lastFocused);\n    const [focusedDay, setFocused] = useState(autoFocus ? focusTarget : undefined);\n    const blur = () => {\n        setLastFocused(focusedDay);\n        setFocused(undefined);\n    };\n    const moveFocus = (moveBy, moveDir) => {\n        if (!focusedDay)\n            return;\n        const nextFocus = getNextFocus(moveBy, moveDir, focusedDay, calendar.navStart, calendar.navEnd, props, dateLib);\n        if (!nextFocus)\n            return;\n        calendar.goToDay(nextFocus);\n        setFocused(nextFocus);\n    };\n    const isFocusTarget = (day) => {\n        return Boolean(focusTarget?.isEqualTo(day));\n    };\n    const useFocus = {\n        isFocusTarget,\n        setFocused,\n        focused: focusedDay,\n        blur,\n        moveFocus\n    };\n    return useFocus;\n}\n//# sourceMappingURL=useFocus.js.map","import { defaultDateLib } from \"../classes/index.js\";\nimport { rangeIncludesDate } from \"./rangeIncludesDate.js\";\n/**\n * Determines if two date ranges overlap.\n *\n * @since 9.2.2\n * @param rangeLeft - The first date range.\n * @param rangeRight - The second date range.\n * @param dateLib - The date utility library instance.\n * @returns `true` if the ranges overlap, otherwise `false`.\n * @group Utilities\n */\nexport function rangeOverlaps(rangeLeft, rangeRight, dateLib = defaultDateLib) {\n    return (rangeIncludesDate(rangeLeft, rangeRight.from, false, dateLib) ||\n        rangeIncludesDate(rangeLeft, rangeRight.to, false, dateLib) ||\n        rangeIncludesDate(rangeRight, rangeLeft.from, false, dateLib) ||\n        rangeIncludesDate(rangeRight, rangeLeft.to, false, dateLib));\n}\n//# sourceMappingURL=rangeOverlaps.js.map","import { defaultDateLib } from \"../classes/DateLib.js\";\nimport { dateMatchModifiers } from \"./dateMatchModifiers.js\";\nimport { rangeContainsDayOfWeek } from \"./rangeContainsDayOfWeek.js\";\nimport { rangeIncludesDate } from \"./rangeIncludesDate.js\";\nimport { rangeOverlaps } from \"./rangeOverlaps.js\";\nimport { isDateAfterType, isDateBeforeType, isDateInterval, isDateRange, isDatesArray, isDayOfWeekType } from \"./typeguards.js\";\n/**\n * Checks if a date range contains dates that match the given modifiers.\n *\n * @since 9.2.2\n * @param range - The date range to check.\n * @param modifiers - The modifiers to match against.\n * @param dateLib - The date utility library instance.\n * @returns `true` if the range contains matching dates, otherwise `false`.\n * @group Utilities\n */\nexport function rangeContainsModifiers(range, modifiers, dateLib = defaultDateLib) {\n    const matchers = Array.isArray(modifiers) ? modifiers : [modifiers];\n    // Defer function matchers evaluation as they are the least performant.\n    const nonFunctionMatchers = matchers.filter((matcher) => typeof matcher !== \"function\");\n    const nonFunctionMatchersResult = nonFunctionMatchers.some((matcher) => {\n        if (typeof matcher === \"boolean\")\n            return matcher;\n        if (dateLib.isDate(matcher)) {\n            return rangeIncludesDate(range, matcher, false, dateLib);\n        }\n        if (isDatesArray(matcher, dateLib)) {\n            return matcher.some((date) => rangeIncludesDate(range, date, false, dateLib));\n        }\n        if (isDateRange(matcher)) {\n            if (matcher.from && matcher.to) {\n                return rangeOverlaps(range, { from: matcher.from, to: matcher.to }, dateLib);\n            }\n            return false;\n        }\n        if (isDayOfWeekType(matcher)) {\n            return rangeContainsDayOfWeek(range, matcher.dayOfWeek, dateLib);\n        }\n        if (isDateInterval(matcher)) {\n            const isClosedInterval = dateLib.isAfter(matcher.before, matcher.after);\n            if (isClosedInterval) {\n                return rangeOverlaps(range, {\n                    from: dateLib.addDays(matcher.after, 1),\n                    to: dateLib.addDays(matcher.before, -1)\n                }, dateLib);\n            }\n            return (dateMatchModifiers(range.from, matcher, dateLib) ||\n                dateMatchModifiers(range.to, matcher, dateLib));\n        }\n        if (isDateAfterType(matcher) || isDateBeforeType(matcher)) {\n            return (dateMatchModifiers(range.from, matcher, dateLib) ||\n                dateMatchModifiers(range.to, matcher, dateLib));\n        }\n        return false;\n    });\n    if (nonFunctionMatchersResult) {\n        return true;\n    }\n    const functionMatchers = matchers.filter((matcher) => typeof matcher === \"function\");\n    if (functionMatchers.length) {\n        let date = range.from;\n        const totalDays = dateLib.differenceInCalendarDays(range.to, range.from);\n        for (let i = 0; i <= totalDays; i++) {\n            if (functionMatchers.some((matcher) => matcher(date))) {\n                return true;\n            }\n            date = dateLib.addDays(date, 1);\n        }\n    }\n    return false;\n}\n//# sourceMappingURL=rangeContainsModifiers.js.map","import { defaultDateLib } from \"../classes/DateLib.js\";\n/**\n * Checks if a date range contains one or more specified days of the week.\n *\n * @since 9.2.2\n * @param range - The date range to check.\n * @param dayOfWeek - The day(s) of the week to check for (`0-6`, where `0` is\n *   Sunday).\n * @param dateLib - The date utility library instance.\n * @returns `true` if the range contains the specified day(s) of the week,\n *   otherwise `false`.\n * @group Utilities\n */\nexport function rangeContainsDayOfWeek(range, dayOfWeek, dateLib = defaultDateLib) {\n    const dayOfWeekArr = !Array.isArray(dayOfWeek) ? [dayOfWeek] : dayOfWeek;\n    let date = range.from;\n    const totalDays = dateLib.differenceInCalendarDays(range.to, range.from);\n    // iterate at maximum one week or the total days if the range is shorter than one week\n    const totalDaysLimit = Math.min(totalDays, 6);\n    for (let i = 0; i <= totalDaysLimit; i++) {\n        if (dayOfWeekArr.includes(date.getDay())) {\n            return true;\n        }\n        date = dateLib.addDays(date, 1);\n    }\n    return false;\n}\n//# sourceMappingURL=rangeContainsDayOfWeek.js.map","import { useControlledValue } from \"../helpers/useControlledValue.js\";\nimport { addToRange, rangeContainsModifiers } from \"../utils/index.js\";\nimport { rangeIncludesDate } from \"../utils/rangeIncludesDate.js\";\n/**\n * Hook to manage range selection in the DayPicker component.\n *\n * @template T - The type of DayPicker props.\n * @param props - The DayPicker props.\n * @param dateLib - The date utility library instance.\n * @returns An object containing the selected range, a function to select a\n *   range, and a function to check if a date is within the range.\n */\nexport function useRange(props, dateLib) {\n    const { disabled, excludeDisabled, selected: initiallySelected, required, onSelect } = props;\n    const [internallySelected, setSelected] = useControlledValue(initiallySelected, onSelect ? initiallySelected : undefined);\n    const selected = !onSelect ? internallySelected : initiallySelected;\n    const isSelected = (date) => selected && rangeIncludesDate(selected, date, false, dateLib);\n    const select = (triggerDate, modifiers, e) => {\n        const { min, max } = props;\n        const newRange = triggerDate\n            ? addToRange(triggerDate, selected, min, max, required, dateLib)\n            : undefined;\n        if (excludeDisabled && disabled && newRange?.from && newRange.to) {\n            if (rangeContainsModifiers({ from: newRange.from, to: newRange.to }, disabled, dateLib)) {\n                // if a disabled days is found, the range is reset\n                newRange.from = triggerDate;\n                newRange.to = undefined;\n            }\n        }\n        if (!onSelect) {\n            setSelected(newRange);\n        }\n        onSelect?.(newRange, triggerDate, modifiers, e);\n        return newRange;\n    };\n    return {\n        selected,\n        select,\n        isSelected\n    };\n}\n//# sourceMappingURL=useRange.js.map","import { defaultDateLib } from \"../classes/DateLib.js\";\n/**\n * Adds a date to an existing range, considering constraints like minimum and\n * maximum range size.\n *\n * @param date - The date to add to the range.\n * @param initialRange - The initial range to which the date will be added.\n * @param min - The minimum number of days in the range.\n * @param max - The maximum number of days in the range.\n * @param required - Whether the range must always include at least one date.\n * @param dateLib - The date utility library instance.\n * @returns The updated date range, or `undefined` if the range is cleared.\n * @group Utilities\n */\nexport function addToRange(date, initialRange, min = 0, max = 0, required = false, dateLib = defaultDateLib) {\n    const { from, to } = initialRange || {};\n    const { isSameDay, isAfter, isBefore } = dateLib;\n    let range;\n    if (!from && !to) {\n        // the range is empty, add the date\n        range = { from: date, to: min > 0 ? undefined : date };\n    }\n    else if (from && !to) {\n        // adding date to an incomplete range\n        if (isSameDay(from, date)) {\n            // adding a date equal to the start of the range\n            if (required) {\n                range = { from, to: undefined };\n            }\n            else {\n                range = undefined;\n            }\n        }\n        else if (isBefore(date, from)) {\n            // adding a date before the start of the range\n            range = { from: date, to: from };\n        }\n        else {\n            // adding a date after the start of the range\n            range = { from, to: date };\n        }\n    }\n    else if (from && to) {\n        // adding date to a complete range\n        if (isSameDay(from, date) && isSameDay(to, date)) {\n            // adding a date that is equal to both start and end of the range\n            if (required) {\n                range = { from, to };\n            }\n            else {\n                range = undefined;\n            }\n        }\n        else if (isSameDay(from, date)) {\n            // adding a date equal to the the start of the range\n            range = { from, to: min > 0 ? undefined : date };\n        }\n        else if (isSameDay(to, date)) {\n            // adding a dare equal to the end of the range\n            range = { from: date, to: min > 0 ? undefined : date };\n        }\n        else if (isBefore(date, from)) {\n            // adding a date before the start of the range\n            range = { from: date, to: to };\n        }\n        else if (isAfter(date, from)) {\n            // adding a date after the start of the range\n            range = { from, to: date };\n        }\n        else if (isAfter(date, to)) {\n            // adding a date after the end of the range\n            range = { from, to: date };\n        }\n        else {\n            throw new Error(\"Invalid range\");\n        }\n    }\n    // check for min / max\n    if (range?.from && range?.to) {\n        const diff = dateLib.differenceInCalendarDays(range.to, range.from);\n        if (max > 0 && diff > max) {\n            range = { from: date, to: undefined };\n        }\n        else if (min > 1 && diff < min) {\n            range = { from: date, to: undefined };\n        }\n    }\n    return range;\n}\n//# sourceMappingURL=addToRange.js.map","import { useMulti } from \"./selection/useMulti.js\";\nimport { useRange } from \"./selection/useRange.js\";\nimport { useSingle } from \"./selection/useSingle.js\";\n/**\n * Determines the appropriate selection hook to use based on the selection mode\n * and returns the corresponding selection object.\n *\n * @template T - The type of DayPicker props.\n * @param props - The DayPicker props.\n * @param dateLib - The date utility library instance.\n * @returns The selection object for the specified mode, or `undefined` if no\n *   mode is set.\n */\nexport function useSelection(props, dateLib) {\n    const single = useSingle(props, dateLib);\n    const multi = useMulti(props, dateLib);\n    const range = useRange(props, dateLib);\n    switch (props.mode) {\n        case \"single\":\n            return single;\n        case \"multiple\":\n            return multi;\n        case \"range\":\n            return range;\n        default:\n            return undefined;\n    }\n}\n//# sourceMappingURL=useSelection.js.map","import { useControlledValue } from \"../helpers/useControlledValue.js\";\n/**\n * Hook to manage single-date selection in the DayPicker component.\n *\n * @template T - The type of DayPicker props.\n * @param props - The DayPicker props.\n * @param dateLib - The date utility library instance.\n * @returns An object containing the selected date, a function to select a date,\n *   and a function to check if a date is selected.\n */\nexport function useSingle(props, dateLib) {\n    const { selected: initiallySelected, required, onSelect } = props;\n    const [internallySelected, setSelected] = useControlledValue(initiallySelected, onSelect ? initiallySelected : undefined);\n    const selected = !onSelect ? internallySelected : initiallySelected;\n    const { isSameDay } = dateLib;\n    const isSelected = (compareDate) => {\n        return selected ? isSameDay(selected, compareDate) : false;\n    };\n    const select = (triggerDate, modifiers, e) => {\n        let newDate = triggerDate;\n        if (!required && selected && selected && isSameDay(triggerDate, selected)) {\n            // If the date is the same, clear the selection.\n            newDate = undefined;\n        }\n        if (!onSelect) {\n            setSelected(newDate);\n        }\n        if (required) {\n            onSelect?.(newDate, triggerDate, modifiers, e);\n        }\n        else {\n            onSelect?.(newDate, triggerDate, modifiers, e);\n        }\n        return newDate;\n    };\n    return {\n        selected,\n        select,\n        isSelected\n    };\n}\n//# sourceMappingURL=useSingle.js.map","import { useControlledValue } from \"../helpers/useControlledValue.js\";\n/**\n * Hook to manage multiple-date selection in the DayPicker component.\n *\n * @template T - The type of DayPicker props.\n * @param props - The DayPicker props.\n * @param dateLib - The date utility library instance.\n * @returns An object containing the selected dates, a function to select dates,\n *   and a function to check if a date is selected.\n */\nexport function useMulti(props, dateLib) {\n    const { selected: initiallySelected, required, onSelect } = props;\n    const [internallySelected, setSelected] = useControlledValue(initiallySelected, onSelect ? initiallySelected : undefined);\n    const selected = !onSelect ? internallySelected : initiallySelected;\n    const { isSameDay } = dateLib;\n    const isSelected = (date) => {\n        return selected?.some((d) => isSameDay(d, date)) ?? false;\n    };\n    const { min, max } = props;\n    const select = (triggerDate, modifiers, e) => {\n        let newDates = [...(selected ?? [])];\n        if (isSelected(triggerDate)) {\n            if (selected?.length === min) {\n                // Min value reached, do nothing\n                return;\n            }\n            if (required && selected?.length === 1) {\n                // Required value already selected do nothing\n                return;\n            }\n            newDates = selected?.filter((d) => !isSameDay(d, triggerDate));\n        }\n        else {\n            if (selected?.length === max) {\n                // Max value reached, reset the selection to date\n                newDates = [triggerDate];\n            }\n            else {\n                // Add the date to the selection\n                newDates = [...newDates, triggerDate];\n            }\n        }\n        if (!onSelect) {\n            setSelected(newDates);\n        }\n        onSelect?.(newDates, triggerDate, modifiers, e);\n        return newDates;\n    };\n    return {\n        selected,\n        select,\n        isSelected\n    };\n}\n//# sourceMappingURL=useMulti.js.map","import React, { useCallback, useMemo, useRef } from \"react\";\nimport { TZDate } from \"@date-fns/tz\";\nimport { UI, DayFlag, SelectionState } from \"./UI.js\";\nimport { DateLib, defaultLocale } from \"./classes/DateLib.js\";\nimport { createGetModifiers } from \"./helpers/createGetModifiers.js\";\nimport { getClassNamesForModifiers } from \"./helpers/getClassNamesForModifiers.js\";\nimport { getComponents } from \"./helpers/getComponents.js\";\nimport { getDataAttributes } from \"./helpers/getDataAttributes.js\";\nimport { getDefaultClassNames } from \"./helpers/getDefaultClassNames.js\";\nimport { getFormatters } from \"./helpers/getFormatters.js\";\nimport { getMonthOptions } from \"./helpers/getMonthOptions.js\";\nimport { getStyleForModifiers } from \"./helpers/getStyleForModifiers.js\";\nimport { getWeekdays } from \"./helpers/getWeekdays.js\";\nimport { getYearOptions } from \"./helpers/getYearOptions.js\";\nimport * as defaultLabels from \"./labels/index.js\";\nimport { useAnimation } from \"./useAnimation.js\";\nimport { useCalendar } from \"./useCalendar.js\";\nimport { dayPickerContext } from \"./useDayPicker.js\";\nimport { useFocus } from \"./useFocus.js\";\nimport { useSelection } from \"./useSelection.js\";\nimport { rangeIncludesDate } from \"./utils/rangeIncludesDate.js\";\nimport { isDateRange } from \"./utils/typeguards.js\";\n/**\n * Renders the DayPicker calendar component.\n *\n * @param initialProps - The props for the DayPicker component.\n * @returns The rendered DayPicker component.\n * @group DayPicker\n * @see https://daypicker.dev\n */\nexport function DayPicker(initialProps) {\n    let props = initialProps;\n    if (props.timeZone) {\n        props = {\n            ...initialProps\n        };\n        if (props.today) {\n            props.today = new TZDate(props.today, props.timeZone);\n        }\n        if (props.month) {\n            props.month = new TZDate(props.month, props.timeZone);\n        }\n        if (props.defaultMonth) {\n            props.defaultMonth = new TZDate(props.defaultMonth, props.timeZone);\n        }\n        if (props.startMonth) {\n            props.startMonth = new TZDate(props.startMonth, props.timeZone);\n        }\n        if (props.endMonth) {\n            props.endMonth = new TZDate(props.endMonth, props.timeZone);\n        }\n        if (props.mode === \"single\" && props.selected) {\n            props.selected = new TZDate(props.selected, props.timeZone);\n        }\n        else if (props.mode === \"multiple\" && props.selected) {\n            props.selected = props.selected?.map((date) => new TZDate(date, props.timeZone));\n        }\n        else if (props.mode === \"range\" && props.selected) {\n            props.selected = {\n                from: props.selected.from\n                    ? new TZDate(props.selected.from, props.timeZone)\n                    : undefined,\n                to: props.selected.to\n                    ? new TZDate(props.selected.to, props.timeZone)\n                    : undefined\n            };\n        }\n    }\n    const { components, formatters, labels, dateLib, locale, classNames } = useMemo(() => {\n        const locale = { ...defaultLocale, ...props.locale };\n        const dateLib = new DateLib({\n            locale,\n            weekStartsOn: props.broadcastCalendar ? 1 : props.weekStartsOn,\n            firstWeekContainsDate: props.firstWeekContainsDate,\n            useAdditionalWeekYearTokens: props.useAdditionalWeekYearTokens,\n            useAdditionalDayOfYearTokens: props.useAdditionalDayOfYearTokens,\n            timeZone: props.timeZone,\n            numerals: props.numerals\n        }, props.dateLib);\n        return {\n            dateLib,\n            components: getComponents(props.components),\n            formatters: getFormatters(props.formatters),\n            labels: { ...defaultLabels, ...props.labels },\n            locale,\n            classNames: { ...getDefaultClassNames(), ...props.classNames }\n        };\n    }, [\n        props.locale,\n        props.broadcastCalendar,\n        props.weekStartsOn,\n        props.firstWeekContainsDate,\n        props.useAdditionalWeekYearTokens,\n        props.useAdditionalDayOfYearTokens,\n        props.timeZone,\n        props.numerals,\n        props.dateLib,\n        props.components,\n        props.formatters,\n        props.labels,\n        props.classNames\n    ]);\n    const { captionLayout, mode, navLayout, numberOfMonths = 1, onDayBlur, onDayClick, onDayFocus, onDayKeyDown, onDayMouseEnter, onDayMouseLeave, onNextClick, onPrevClick, showWeekNumber, styles } = props;\n    const { formatCaption, formatDay, formatMonthDropdown, formatWeekNumber, formatWeekNumberHeader, formatWeekdayName, formatYearDropdown } = formatters;\n    const calendar = useCalendar(props, dateLib);\n    const { days, months, navStart, navEnd, previousMonth, nextMonth, goToMonth } = calendar;\n    const getModifiers = createGetModifiers(days, props, dateLib);\n    const { isSelected, select, selected: selectedValue } = useSelection(props, dateLib) ?? {};\n    const { blur, focused, isFocusTarget, moveFocus, setFocused } = useFocus(props, calendar, getModifiers, isSelected ?? (() => false), dateLib);\n    const { labelDayButton, labelGridcell, labelGrid, labelMonthDropdown, labelNav, labelPrevious, labelNext, labelWeekday, labelWeekNumber, labelWeekNumberHeader, labelYearDropdown } = labels;\n    const weekdays = useMemo(() => getWeekdays(dateLib, props.ISOWeek), [dateLib, props.ISOWeek]);\n    const isInteractive = mode !== undefined || onDayClick !== undefined;\n    const handlePreviousClick = useCallback(() => {\n        if (!previousMonth)\n            return;\n        goToMonth(previousMonth);\n        onPrevClick?.(previousMonth);\n    }, [previousMonth, goToMonth, onPrevClick]);\n    const handleNextClick = useCallback(() => {\n        if (!nextMonth)\n            return;\n        goToMonth(nextMonth);\n        onNextClick?.(nextMonth);\n    }, [goToMonth, nextMonth, onNextClick]);\n    const handleDayClick = useCallback((day, m) => (e) => {\n        e.preventDefault();\n        e.stopPropagation();\n        setFocused(day);\n        select?.(day.date, m, e);\n        onDayClick?.(day.date, m, e);\n    }, [select, onDayClick, setFocused]);\n    const handleDayFocus = useCallback((day, m) => (e) => {\n        setFocused(day);\n        onDayFocus?.(day.date, m, e);\n    }, [onDayFocus, setFocused]);\n    const handleDayBlur = useCallback((day, m) => (e) => {\n        blur();\n        onDayBlur?.(day.date, m, e);\n    }, [blur, onDayBlur]);\n    const handleDayKeyDown = useCallback((day, modifiers) => (e) => {\n        const keyMap = {\n            ArrowLeft: [\"day\", props.dir === \"rtl\" ? \"after\" : \"before\"],\n            ArrowRight: [\"day\", props.dir === \"rtl\" ? \"before\" : \"after\"],\n            ArrowDown: [\"week\", \"after\"],\n            ArrowUp: [\"week\", \"before\"],\n            PageUp: [e.shiftKey ? \"year\" : \"month\", \"before\"],\n            PageDown: [e.shiftKey ? \"year\" : \"month\", \"after\"],\n            Home: [\"startOfWeek\", \"before\"],\n            End: [\"endOfWeek\", \"after\"]\n        };\n        if (keyMap[e.key]) {\n            e.preventDefault();\n            e.stopPropagation();\n            const [moveBy, moveDir] = keyMap[e.key];\n            moveFocus(moveBy, moveDir);\n        }\n        onDayKeyDown?.(day.date, modifiers, e);\n    }, [moveFocus, onDayKeyDown, props.dir]);\n    const handleDayMouseEnter = useCallback((day, modifiers) => (e) => {\n        onDayMouseEnter?.(day.date, modifiers, e);\n    }, [onDayMouseEnter]);\n    const handleDayMouseLeave = useCallback((day, modifiers) => (e) => {\n        onDayMouseLeave?.(day.date, modifiers, e);\n    }, [onDayMouseLeave]);\n    const handleMonthChange = useCallback((date) => (e) => {\n        const selectedMonth = Number(e.target.value);\n        const month = dateLib.setMonth(dateLib.startOfMonth(date), selectedMonth);\n        goToMonth(month);\n    }, [dateLib, goToMonth]);\n    const handleYearChange = useCallback((date) => (e) => {\n        const selectedYear = Number(e.target.value);\n        const month = dateLib.setYear(dateLib.startOfMonth(date), selectedYear);\n        goToMonth(month);\n    }, [dateLib, goToMonth]);\n    const { className, style } = useMemo(() => ({\n        className: [classNames[UI.Root], props.className]\n            .filter(Boolean)\n            .join(\" \"),\n        style: { ...styles?.[UI.Root], ...props.style }\n    }), [classNames, props.className, props.style, styles]);\n    const dataAttributes = getDataAttributes(props);\n    const rootElRef = useRef(null);\n    useAnimation(rootElRef, Boolean(props.animate), {\n        classNames,\n        months,\n        focused,\n        dateLib\n    });\n    const contextValue = {\n        dayPickerProps: props,\n        selected: selectedValue,\n        select: select,\n        isSelected,\n        months,\n        nextMonth,\n        previousMonth,\n        goToMonth,\n        getModifiers,\n        components,\n        classNames,\n        styles,\n        labels,\n        formatters\n    };\n    return (React.createElement(dayPickerContext.Provider, { value: contextValue },\n        React.createElement(components.Root, { rootRef: props.animate ? rootElRef : undefined, className: className, style: style, dir: props.dir, id: props.id, lang: props.lang, nonce: props.nonce, title: props.title, role: props.role, \"aria-label\": props[\"aria-label\"], ...dataAttributes },\n            React.createElement(components.Months, { className: classNames[UI.Months], style: styles?.[UI.Months] },\n                !props.hideNavigation && !navLayout && (React.createElement(components.Nav, { \"data-animated-nav\": props.animate ? \"true\" : undefined, className: classNames[UI.Nav], style: styles?.[UI.Nav], \"aria-label\": labelNav(), onPreviousClick: handlePreviousClick, onNextClick: handleNextClick, previousMonth: previousMonth, nextMonth: nextMonth })),\n                months.map((calendarMonth, displayIndex) => {\n                    const dropdownMonths = getMonthOptions(calendarMonth.date, navStart, navEnd, formatters, dateLib);\n                    const dropdownYears = getYearOptions(navStart, navEnd, formatters, dateLib);\n                    return (React.createElement(components.Month, { \"data-animated-month\": props.animate ? \"true\" : undefined, className: classNames[UI.Month], style: styles?.[UI.Month], key: displayIndex, displayIndex: displayIndex, calendarMonth: calendarMonth },\n                        navLayout === \"around\" &&\n                            !props.hideNavigation &&\n                            displayIndex === 0 && (React.createElement(components.PreviousMonthButton, { type: \"button\", className: classNames[UI.PreviousMonthButton], tabIndex: previousMonth ? undefined : -1, \"aria-disabled\": previousMonth ? undefined : true, \"aria-label\": labelPrevious(previousMonth), onClick: handlePreviousClick, \"data-animated-button\": props.animate ? \"true\" : undefined },\n                            React.createElement(components.Chevron, { disabled: previousMonth ? undefined : true, className: classNames[UI.Chevron], orientation: props.dir === \"rtl\" ? \"right\" : \"left\" }))),\n                        React.createElement(components.MonthCaption, { \"data-animated-caption\": props.animate ? \"true\" : undefined, className: classNames[UI.MonthCaption], style: styles?.[UI.MonthCaption], calendarMonth: calendarMonth, displayIndex: displayIndex }, captionLayout?.startsWith(\"dropdown\") ? (React.createElement(components.DropdownNav, { className: classNames[UI.Dropdowns], style: styles?.[UI.Dropdowns] },\n                            captionLayout === \"dropdown\" ||\n                                captionLayout === \"dropdown-months\" ? (React.createElement(components.MonthsDropdown, { className: classNames[UI.MonthsDropdown], \"aria-label\": labelMonthDropdown(), classNames: classNames, components: components, disabled: Boolean(props.disableNavigation), onChange: handleMonthChange(calendarMonth.date), options: dropdownMonths, style: styles?.[UI.Dropdown], value: dateLib.getMonth(calendarMonth.date) })) : (React.createElement(\"span\", null, formatMonthDropdown(calendarMonth.date, dateLib))),\n                            captionLayout === \"dropdown\" ||\n                                captionLayout === \"dropdown-years\" ? (React.createElement(components.YearsDropdown, { className: classNames[UI.YearsDropdown], \"aria-label\": labelYearDropdown(dateLib.options), classNames: classNames, components: components, disabled: Boolean(props.disableNavigation), onChange: handleYearChange(calendarMonth.date), options: dropdownYears, style: styles?.[UI.Dropdown], value: dateLib.getYear(calendarMonth.date) })) : (React.createElement(\"span\", null, formatYearDropdown(calendarMonth.date, dateLib))),\n                            React.createElement(\"span\", { role: \"status\", \"aria-live\": \"polite\", style: {\n                                    border: 0,\n                                    clip: \"rect(0 0 0 0)\",\n                                    height: \"1px\",\n                                    margin: \"-1px\",\n                                    overflow: \"hidden\",\n                                    padding: 0,\n                                    position: \"absolute\",\n                                    width: \"1px\",\n                                    whiteSpace: \"nowrap\",\n                                    wordWrap: \"normal\"\n                                } }, formatCaption(calendarMonth.date, dateLib.options, dateLib)))) : (React.createElement(components.CaptionLabel, { className: classNames[UI.CaptionLabel], role: \"status\", \"aria-live\": \"polite\" }, formatCaption(calendarMonth.date, dateLib.options, dateLib)))),\n                        navLayout === \"around\" &&\n                            !props.hideNavigation &&\n                            displayIndex === numberOfMonths - 1 && (React.createElement(components.NextMonthButton, { type: \"button\", className: classNames[UI.NextMonthButton], tabIndex: nextMonth ? undefined : -1, \"aria-disabled\": nextMonth ? undefined : true, \"aria-label\": labelNext(nextMonth), onClick: handleNextClick, \"data-animated-button\": props.animate ? \"true\" : undefined },\n                            React.createElement(components.Chevron, { disabled: nextMonth ? undefined : true, className: classNames[UI.Chevron], orientation: props.dir === \"rtl\" ? \"left\" : \"right\" }))),\n                        displayIndex === numberOfMonths - 1 &&\n                            navLayout === \"after\" &&\n                            !props.hideNavigation && (React.createElement(components.Nav, { \"data-animated-nav\": props.animate ? \"true\" : undefined, className: classNames[UI.Nav], style: styles?.[UI.Nav], \"aria-label\": labelNav(), onPreviousClick: handlePreviousClick, onNextClick: handleNextClick, previousMonth: previousMonth, nextMonth: nextMonth })),\n                        React.createElement(components.MonthGrid, { role: \"grid\", \"aria-multiselectable\": mode === \"multiple\" || mode === \"range\", \"aria-label\": labelGrid(calendarMonth.date, dateLib.options, dateLib) ||\n                                undefined, className: classNames[UI.MonthGrid], style: styles?.[UI.MonthGrid] },\n                            !props.hideWeekdays && (React.createElement(components.Weekdays, { \"data-animated-weekdays\": props.animate ? \"true\" : undefined, className: classNames[UI.Weekdays], style: styles?.[UI.Weekdays] },\n                                showWeekNumber && (React.createElement(components.WeekNumberHeader, { \"aria-label\": labelWeekNumberHeader(dateLib.options), className: classNames[UI.WeekNumberHeader], style: styles?.[UI.WeekNumberHeader], scope: \"col\" }, formatWeekNumberHeader())),\n                                weekdays.map((weekday, i) => (React.createElement(components.Weekday, { \"aria-label\": labelWeekday(weekday, dateLib.options, dateLib), className: classNames[UI.Weekday], key: i, style: styles?.[UI.Weekday], scope: \"col\" }, formatWeekdayName(weekday, dateLib.options, dateLib)))))),\n                            React.createElement(components.Weeks, { \"data-animated-weeks\": props.animate ? \"true\" : undefined, className: classNames[UI.Weeks], style: styles?.[UI.Weeks] }, calendarMonth.weeks.map((week, weekIndex) => {\n                                return (React.createElement(components.Week, { className: classNames[UI.Week], key: week.weekNumber, style: styles?.[UI.Week], week: week },\n                                    showWeekNumber && (React.createElement(components.WeekNumber, { week: week, style: styles?.[UI.WeekNumber], \"aria-label\": labelWeekNumber(week.weekNumber, {\n                                            locale\n                                        }), className: classNames[UI.WeekNumber], scope: \"row\", role: \"rowheader\" }, formatWeekNumber(week.weekNumber, dateLib))),\n                                    week.days.map((day) => {\n                                        const { date } = day;\n                                        const modifiers = getModifiers(day);\n                                        modifiers[DayFlag.focused] =\n                                            !modifiers.hidden &&\n                                                Boolean(focused?.isEqualTo(day));\n                                        modifiers[SelectionState.selected] =\n                                            isSelected?.(date) || modifiers.selected;\n                                        if (isDateRange(selectedValue)) {\n                                            // add range modifiers\n                                            const { from, to } = selectedValue;\n                                            modifiers[SelectionState.range_start] = Boolean(from && to && dateLib.isSameDay(date, from));\n                                            modifiers[SelectionState.range_end] = Boolean(from && to && dateLib.isSameDay(date, to));\n                                            modifiers[SelectionState.range_middle] =\n                                                rangeIncludesDate(selectedValue, date, true, dateLib);\n                                        }\n                                        const style = getStyleForModifiers(modifiers, styles, props.modifiersStyles);\n                                        const className = getClassNamesForModifiers(modifiers, classNames, props.modifiersClassNames);\n                                        const ariaLabel = !isInteractive && !modifiers.hidden\n                                            ? labelGridcell(date, modifiers, dateLib.options, dateLib)\n                                            : undefined;\n                                        return (React.createElement(components.Day, { key: `${dateLib.format(date, \"yyyy-MM-dd\")}_${dateLib.format(day.displayMonth, \"yyyy-MM\")}`, day: day, modifiers: modifiers, className: className.join(\" \"), style: style, role: \"gridcell\", \"aria-selected\": modifiers.selected || undefined, \"aria-label\": ariaLabel, \"data-day\": dateLib.format(date, \"yyyy-MM-dd\"), \"data-month\": day.outside\n                                                ? dateLib.format(date, \"yyyy-MM\")\n                                                : undefined, \"data-selected\": modifiers.selected || undefined, \"data-disabled\": modifiers.disabled || undefined, \"data-hidden\": modifiers.hidden || undefined, \"data-outside\": day.outside || undefined, \"data-focused\": modifiers.focused || undefined, \"data-today\": modifiers.today || undefined }, !modifiers.hidden && isInteractive ? (React.createElement(components.DayButton, { className: classNames[UI.DayButton], style: styles?.[UI.DayButton], type: \"button\", day: day, modifiers: modifiers, disabled: modifiers.disabled || undefined, tabIndex: isFocusTarget(day) ? 0 : -1, \"aria-label\": labelDayButton(date, modifiers, dateLib.options, dateLib), onClick: handleDayClick(day, modifiers), onBlur: handleDayBlur(day, modifiers), onFocus: handleDayFocus(day, modifiers), onKeyDown: handleDayKeyDown(day, modifiers), onMouseEnter: handleDayMouseEnter(day, modifiers), onMouseLeave: handleDayMouseLeave(day, modifiers) }, formatDay(date, dateLib.options, dateLib))) : (!modifiers.hidden &&\n                                            formatDay(day.date, dateLib.options, dateLib))));\n                                    })));\n                            })))));\n                })),\n            props.footer && (React.createElement(components.Footer, { className: classNames[UI.Footer], style: styles?.[UI.Footer], role: \"status\", \"aria-live\": \"polite\" }, props.footer)))));\n}\n//# sourceMappingURL=DayPicker.js.map","import * as defaultFormatters from \"../formatters/index.js\";\n/**\n * Merges custom formatters from the props with the default formatters.\n *\n * @param customFormatters The custom formatters provided in the DayPicker\n *   props.\n * @returns The merged formatters object.\n */\nexport function getFormatters(customFormatters) {\n    if (customFormatters?.formatMonthCaption && !customFormatters.formatCaption) {\n        customFormatters.formatCaption = customFormatters.formatMonthCaption;\n    }\n    if (customFormatters?.formatYearCaption &&\n        !customFormatters.formatYearDropdown) {\n        customFormatters.formatYearDropdown = customFormatters.formatYearCaption;\n    }\n    return {\n        ...defaultFormatters,\n        ...customFormatters\n    };\n}\n//# sourceMappingURL=getFormatters.js.map","import { DayFlag } from \"../UI.js\";\nimport { dateMatchModifiers } from \"../utils/dateMatchModifiers.js\";\n/**\n * Creates a function to retrieve the modifiers for a given day.\n *\n * This function calculates both internal and custom modifiers for each day\n * based on the provided calendar days and DayPicker props.\n *\n * @private\n * @param days The array of `CalendarDay` objects to process.\n * @param props The DayPicker props, including modifiers and configuration\n *   options.\n * @param dateLib The date library to use for date manipulation.\n * @returns A function that retrieves the modifiers for a given `CalendarDay`.\n */\nexport function createGetModifiers(days, props, dateLib) {\n    const { disabled, hidden, modifiers, showOutsideDays, broadcastCalendar, today } = props;\n    const { isSameDay, isSameMonth, startOfMonth, isBefore, endOfMonth, isAfter } = dateLib;\n    const startMonth = props.startMonth && startOfMonth(props.startMonth);\n    const endMonth = props.endMonth && endOfMonth(props.endMonth);\n    const internalModifiersMap = {\n        [DayFlag.focused]: [],\n        [DayFlag.outside]: [],\n        [DayFlag.disabled]: [],\n        [DayFlag.hidden]: [],\n        [DayFlag.today]: []\n    };\n    const customModifiersMap = {};\n    for (const day of days) {\n        const { date, displayMonth } = day;\n        const isOutside = Boolean(displayMonth && !isSameMonth(date, displayMonth));\n        const isBeforeStartMonth = Boolean(startMonth && isBefore(date, startMonth));\n        const isAfterEndMonth = Boolean(endMonth && isAfter(date, endMonth));\n        const isDisabled = Boolean(disabled && dateMatchModifiers(date, disabled, dateLib));\n        const isHidden = Boolean(hidden && dateMatchModifiers(date, hidden, dateLib)) ||\n            isBeforeStartMonth ||\n            isAfterEndMonth ||\n            // Broadcast calendar will show outside days as default\n            (!broadcastCalendar && !showOutsideDays && isOutside) ||\n            (broadcastCalendar && showOutsideDays === false && isOutside);\n        const isToday = isSameDay(date, today ?? dateLib.today());\n        if (isOutside)\n            internalModifiersMap.outside.push(day);\n        if (isDisabled)\n            internalModifiersMap.disabled.push(day);\n        if (isHidden)\n            internalModifiersMap.hidden.push(day);\n        if (isToday)\n            internalModifiersMap.today.push(day);\n        // Add custom modifiers\n        if (modifiers) {\n            Object.keys(modifiers).forEach((name) => {\n                const modifierValue = modifiers?.[name];\n                const isMatch = modifierValue\n                    ? dateMatchModifiers(date, modifierValue, dateLib)\n                    : false;\n                if (!isMatch)\n                    return;\n                if (customModifiersMap[name]) {\n                    customModifiersMap[name].push(day);\n                }\n                else {\n                    customModifiersMap[name] = [day];\n                }\n            });\n        }\n    }\n    return (day) => {\n        // Initialize all the modifiers to false\n        const dayFlags = {\n            [DayFlag.focused]: false,\n            [DayFlag.disabled]: false,\n            [DayFlag.hidden]: false,\n            [DayFlag.outside]: false,\n            [DayFlag.today]: false\n        };\n        const customModifiers = {};\n        // Find the modifiers for the given day\n        for (const name in internalModifiersMap) {\n            const days = internalModifiersMap[name];\n            dayFlags[name] = days.some((d) => d === day);\n        }\n        for (const name in customModifiersMap) {\n            customModifiers[name] = customModifiersMap[name].some((d) => d === day);\n        }\n        return {\n            ...dayFlags,\n            // custom modifiers should override all the previous ones\n            ...customModifiers\n        };\n    };\n}\n//# sourceMappingURL=createGetModifiers.js.map","/**\n * Generates a series of 7 days, starting from the beginning of the week, to use\n * for formatting weekday names (e.g., Monday, Tuesday, etc.).\n *\n * @param dateLib The date library to use for date manipulation.\n * @param ISOWeek Whether to use ISO week numbering (weeks start on Monday).\n * @param broadcastCalendar Whether to use the broadcast calendar (weeks start\n *   on Monday, but may include adjustments for broadcast-specific rules).\n * @returns An array of 7 dates representing the weekdays.\n */\nexport function getWeekdays(dateLib, ISOWeek, broadcastCalendar) {\n    const today = dateLib.today();\n    const start = broadcastCalendar\n        ? dateLib.startOfBroadcastWeek(today, dateLib)\n        : ISOWeek\n            ? dateLib.startOfISOWeek(today)\n            : dateLib.startOfWeek(today);\n    const days = [];\n    for (let i = 0; i < 7; i++) {\n        const day = dateLib.addDays(start, i);\n        days.push(day);\n    }\n    return days;\n}\n//# sourceMappingURL=getWeekdays.js.map","/**\n * Extracts `data-` attributes from the DayPicker props.\n *\n * This function collects all `data-` attributes from the props and adds\n * additional attributes based on the DayPicker configuration.\n *\n * @param props The DayPicker props.\n * @returns An object containing the `data-` attributes.\n */\nexport function getDataAttributes(props) {\n    const dataAttributes = {\n        \"data-mode\": props.mode ?? undefined,\n        \"data-required\": \"required\" in props ? props.required : undefined,\n        \"data-multiple-months\": (props.numberOfMonths && props.numberOfMonths > 1) || undefined,\n        \"data-week-numbers\": props.showWeekNumber || undefined,\n        \"data-broadcast-calendar\": props.broadcastCalendar || undefined,\n        \"data-nav-layout\": props.navLayout || undefined\n    };\n    Object.entries(props).forEach(([key, val]) => {\n        if (key.startsWith(\"data-\")) {\n            dataAttributes[key] = val;\n        }\n    });\n    return dataAttributes;\n}\n//# sourceMappingURL=getDataAttributes.js.map","/**\n * Returns the months to show in the dropdown.\n *\n * This function generates a list of months for the current year, formatted\n * using the provided formatter, and determines whether each month should be\n * disabled based on the navigation range.\n *\n * @param displayMonth The currently displayed month.\n * @param navStart The start date for navigation.\n * @param navEnd The end date for navigation.\n * @param formatters The formatters to use for formatting the month labels.\n * @param dateLib The date library to use for date manipulation.\n * @returns An array of dropdown options representing the months, or `undefined`\n *   if no months are available.\n */\nexport function getMonthOptions(displayMonth, navStart, navEnd, formatters, dateLib) {\n    const { startOfMonth, startOfYear, endOfYear, eachMonthOfInterval, getMonth } = dateLib;\n    const months = eachMonthOfInterval({\n        start: startOfYear(displayMonth),\n        end: endOfYear(displayMonth)\n    });\n    const options = months.map((month) => {\n        const label = formatters.formatMonthDropdown(month, dateLib);\n        const value = getMonth(month);\n        const disabled = (navStart && month < startOfMonth(navStart)) ||\n            (navEnd && month > startOfMonth(navEnd)) ||\n            false;\n        return { value, label, disabled };\n    });\n    return options;\n}\n//# sourceMappingURL=getMonthOptions.js.map","/**\n * Returns the years to display in the dropdown.\n *\n * This function generates a list of years between the navigation start and end\n * dates, formatted using the provided formatter.\n *\n * @param navStart The start date for navigation.\n * @param navEnd The end date for navigation.\n * @param formatters The formatters to use for formatting the year labels.\n * @param dateLib The date library to use for date manipulation.\n * @returns An array of dropdown options representing the years, or `undefined`\n *   if `navStart` or `navEnd` is not provided.\n */\nexport function getYearOptions(navStart, navEnd, formatters, dateLib) {\n    if (!navStart)\n        return undefined;\n    if (!navEnd)\n        return undefined;\n    const { startOfYear, endOfYear, addYears, getYear, isBefore, isSameYear } = dateLib;\n    const firstNavYear = startOfYear(navStart);\n    const lastNavYear = endOfYear(navEnd);\n    const years = [];\n    let year = firstNavYear;\n    while (isBefore(year, lastNavYear) || isSameYear(year, lastNavYear)) {\n        years.push(year);\n        year = addYears(year, 1);\n    }\n    return years.map((year) => {\n        const label = formatters.formatYearDropdown(year, dateLib);\n        return {\n            value: getYear(year),\n            label,\n            disabled: false\n        };\n    });\n}\n//# sourceMappingURL=getYearOptions.js.map","import { UI } from \"../UI.js\";\n/**\n * Returns the computed style for a day based on its modifiers.\n *\n * This function merges the base styles for the day with any styles associated\n * with active modifiers.\n *\n * @param dayModifiers The modifiers applied to the day.\n * @param styles The base styles for the calendar elements.\n * @param modifiersStyles The styles associated with specific modifiers.\n * @returns The computed style for the day.\n */\nexport function getStyleForModifiers(dayModifiers, styles = {}, modifiersStyles = {}) {\n    let style = { ...styles?.[UI.Day] };\n    Object.entries(dayModifiers)\n        .filter(([, active]) => active === true)\n        .forEach(([modifier]) => {\n        style = {\n            ...style,\n            ...modifiersStyles?.[modifier]\n        };\n    });\n    return style;\n}\n//# sourceMappingURL=getStyleForModifiers.js.map","import { DayFlag, SelectionState, UI } from \"../UI.js\";\n/**\n * Returns the class names for a day based on its modifiers.\n *\n * This function combines the base class name for the day with any class names\n * associated with active modifiers.\n *\n * @param modifiers The modifiers applied to the day.\n * @param classNames The base class names for the calendar elements.\n * @param modifiersClassNames The class names associated with specific\n *   modifiers.\n * @returns An array of class names for the day.\n */\nexport function getClassNamesForModifiers(modifiers, classNames, modifiersClassNames = {}) {\n    const modifierClassNames = Object.entries(modifiers)\n        .filter(([, active]) => active === true)\n        .reduce((previousValue, [key]) => {\n        if (modifiersClassNames[key]) {\n            previousValue.push(modifiersClassNames[key]);\n        }\n        else if (classNames[DayFlag[key]]) {\n            previousValue.push(classNames[DayFlag[key]]);\n        }\n        else if (classNames[SelectionState[key]]) {\n            previousValue.push(classNames[SelectionState[key]]);\n        }\n        return previousValue;\n    }, [classNames[UI.Day]]);\n    return modifierClassNames;\n}\n//# sourceMappingURL=getClassNamesForModifiers.js.map","import { ChevronLeft, ChevronRight } from \"lucide-react\";\nimport React from \"react\";\nimport { DayPicker } from \"react-day-picker\";\n\nimport { buttonVariants } from \"@/components/ui/button\";\nimport { cn } from \"@/lib/utils\";\n\nexport type CalendarProps = React.ComponentProps<typeof DayPicker>;\n\nfunction Calendar({ className, classNames, showOutsideDays = true, ...props }: CalendarProps) {\n\treturn (\n\t\t<DayPicker\n\t\t\tshowOutsideDays={showOutsideDays}\n\t\t\tclassName={cn(\"p-3\", className)}\n\t\t\tclassNames={{\n\t\t\t\tmonth: \"space-y-4\",\n\t\t\t\tmonths: \"flex flex-col sm:flex-row space-y-4 sm:space-y-0 relative\",\n\t\t\t\tmonth_caption: \"flex justify-center pt-1 relative items-center\",\n\t\t\t\tmonth_grid: \"w-full border-collapse space-y-1\",\n\t\t\t\tcaption_label: \"text-sm font-medium capitalize\",\n\t\t\t\tnav: \"flex items-center justify-between absolute inset-x-0\",\n\t\t\t\tbutton_previous: cn(\n\t\t\t\t\tbuttonVariants({ variant: \"outline\" }),\n\t\t\t\t\t\"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100 z-10\",\n\t\t\t\t),\n\t\t\t\tbutton_next: cn(\n\t\t\t\t\tbuttonVariants({ variant: \"outline\" }),\n\t\t\t\t\t\"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100 z-10\",\n\t\t\t\t),\n\t\t\t\tweeks: \"w-full border-collapse space-y-\",\n\t\t\t\tweekdays: \"flex\",\n\t\t\t\tweekday: \"text-muted-foreground rounded-md w-9 font-normal text-[0.8rem] capitalize\",\n\t\t\t\tweek: \"flex w-full mt-2\",\n\t\t\t\tday_button:\n\t\t\t\t\t\"h-9 w-9 text-center text-sm p-0 relative [&:has([aria-selected].day-range-end)]:rounded-r-md [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected])]:bg-accent first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md focus-within:relative focus-within:z-20 cursor-pointer disabled:cursor-default\",\n\t\t\t\tday: cn(\n\t\t\t\t\tbuttonVariants({ variant: \"ghost\" }),\n\t\t\t\t\t\"h-9 w-9 p-0 font-normal aria-selected:opacity-100\",\n\t\t\t\t),\n\t\t\t\trange_end: \"day-range-end\",\n\t\t\t\tselected:\n\t\t\t\t\t\"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground\",\n\t\t\t\ttoday: \"bg-accent text-accent-foreground\",\n\t\t\t\toutside:\n\t\t\t\t\t\"day-outside text-muted-foreground opacity-50 aria-selected:bg-accent/50 aria-selected:text-muted-foreground aria-selected:opacity-30\",\n\t\t\t\tdisabled: \"text-muted-foreground opacity-50\",\n\t\t\t\trange_middle: \"aria-selected:bg-accent aria-selected:text-accent-foreground\",\n\t\t\t\thidden: \"invisible\",\n\t\t\t\t...classNames,\n\t\t\t}}\n\t\t\tcomponents={{\n\t\t\t\tChevron: ({ ...props }) =>\n\t\t\t\t\tprops.orientation === \"left\" ? (\n\t\t\t\t\t\t<ChevronLeft {...props} className=\"h-4 w-4\" />\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<ChevronRight {...props} className=\"h-4 w-4\" />\n\t\t\t\t\t),\n\t\t\t}}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\nCalendar.displayName = \"Calendar\";\n\nexport { Calendar };\n"],"names":["offsetFormatCache","offsetCache","tzOffset","timeZone","date","offsetStr","Intl","DateTimeFormat","hour","timeZoneName","format","split","calcOffset","captures","match","offsetRe","slice","NaN","cacheStr","values","hours","minutes","TZDateMini","Date","tz","args","length","now","withTimeZone","this","getTimezoneOffset","setTime","time","prototype","apply","arguments","syncToInternal","Symbol","for","constructor","super","pop","internal","isNaN","adjustToSystemTZ","re","setUTCMinutes","getUTCMinutes","offset","prevHour","setUTCHours","getUTCHours","systemOffset","systemDSTChange","dstShift","getHours","offsetDiff","call","postOffset","postDiff","offsetChange","Object","getOwnPropertyNames","forEach","method","test","utcMethod","replace","startsWith","setFullYear","getUTCFullYear","getUTCMonth","getUTCDate","setHours","getUTCSeconds","getUTCMilliseconds","TZDate","toISOString","sign","tzComponents","toString","toDateString","toTimeString","day","month","year","toUTCString","toLocaleString","locales","options","toLocaleDateString","toLocaleTimeString","String","Math","floor","abs","padStart","UI","DayFlag","SelectionState","Animation","millisecondsInWeek","constructFromSymbol","constructFrom","value","toDate","argument","context","addDays","amount","_date","in","setDate","getDate","addMonths","dayOfMonth","endOfDesiredMonth","getTime","setMonth","getMonth","getFullYear","defaultOptions","getDefaultOptions","startOfWeek","weekStartsOn","locale","getDay","diff","startOfISOWeek","getISOWeekYear","fourthOfJanuaryOfNextYear","startOfNextYear","fourthOfJanuaryOfThisYear","startOfThisYear","getTimezoneOffsetInMilliseconds","utcDate","UTC","getMinutes","getSeconds","getMilliseconds","setUTCFullYear","normalizeDates","dates","normalize","bind","find","map","startOfDay","differenceInCalendarDays","laterDate","earlierDate","laterDate_","earlierDate_","laterStartOfDay","earlierStartOfDay","laterTimestamp","earlierTimestamp","round","isDate","eachMonthOfInterval","interval","start","end","normalizeInterval","reversed","endTime","push","reverse","startOfYear","date_","endOfWeek","formatDistanceLocale","lessThanXSeconds","one","other","xSeconds","halfAMinute","lessThanXMinutes","xMinutes","aboutXHours","xHours","xDays","aboutXWeeks","xWeeks","aboutXMonths","xMonths","aboutXYears","xYears","overXYears","almostXYears","buildFormatLongFn","width","defaultWidth","formats","formatLong","full","long","medium","short","dateTime","formatRelativeLocale","lastWeek","yesterday","today","tomorrow","nextWeek","buildLocalizeFn","valuesArray","formattingValues","defaultFormattingWidth","argumentCallback","buildMatchFn","string","matchPattern","matchPatterns","defaultMatchWidth","matchResult","matchedString","parsePatterns","defaultParseWidth","key","Array","isArray","array","predicate","findIndex","pattern","object","hasOwnProperty","findKey","valueCallback","rest","buildMatchPatternFn","parseResult","parsePattern","enUS","code","formatDistance","token","count","result","tokenValue","addSuffix","comparison","formatRelative","_baseDate","_options","localize","ordinalNumber","dirtyNumber","number","Number","rem100","era","narrow","abbreviated","wide","quarter","dayPeriod","am","pm","midnight","noon","morning","afternoon","evening","night","parseInt","any","index","firstWeekContainsDate","getISOWeek","fourthOfJanuary","startOfISOWeekYear","getWeekYear","firstWeekOfNextYear","firstWeekOfThisYear","getWeek","firstWeek","startOfWeekYear","addLeadingZeros","targetLength","lightFormatters","y","signedYear","M","d","a","dayPeriodEnumValue","toUpperCase","h","H","m","s","S","numberOfDigits","milliseconds","trunc","pow","dayPeriodEnum","formatters","G","unit","Y","signedWeekYear","weekYear","R","u","Q","ceil","q","L","w","week","I","isoWeek","D","dayOfYear","getDayOfYear","E","dayOfWeek","e","localDayOfWeek","c","i","isoDayOfWeek","toLowerCase","b","B","K","k","X","_localize","timezoneOffset","formatTimezoneWithOptionalMinutes","formatTimezone","x","O","formatTimezoneShort","z","t","T","delimiter","absOffset","dateLongFormatter","timeLongFormatter","longFormatters","p","P","datePattern","timePattern","dateTimeFormat","dayOfYearTokenRE","weekYearTokenRE","throwTokens","formattingTokensRegExp","longFormattingTokensRegExp","escapedStringRegExp","doubleQuoteRegExp","unescapedLatinCharacterRegExp","formatStr","defaultLocale","originalDate","isValid","RangeError","parts","substring","firstCharacter","longFormatter","join","isToken","cleanEscapedString","preprocessor","formatterOptions","part","useAdditionalWeekYearTokens","isProtectedWeekYearToken","useAdditionalDayOfYearTokens","isProtectedDayOfYearToken","input","_message","subject","message","includes","warnOrThrowProtectedError","formatter","matched","midMonth","daysInMonth","monthIndex","lastDayOfMonth","getDaysInMonth","min","startOfBroadcastWeek","dateLib","firstOfMonth","startOfMonth","DateLib","getDigitMap","numerals","NumberFormat","numberingSystem","digitMap","replaceDigits","digit","formatNumber","overrides","newDate","addWeeks","addYears","dateLeft","dateRight","differenceInCalendarMonths","endOfBroadcastWeek","startDate","numberOfWeeks","firstDayOfMonth","firstDayOfWeek","broadcastStartDate","lastDateOfLastWeek","FIVE_WEEKS","getBroadcastWeeksInMonth","endOfISOWeek","endOfMonth","endOfYear","formatted","getYear","isAfter","dateToCompare","isBefore","isSameDay","dateLeft_","dateRight_","isSameMonth","isSameYear","max","setYear","defaultDateLib","CalendarDay","isEqualTo","displayMonth","outside","Boolean","CalendarMonth","weeks","CalendarWeek","weekNumber","days","rangeIncludesDate","range","excludeEnds","from","to","isDateInterval","matcher","isDateRange","isDateAfterType","isDateBeforeType","isDayOfWeekType","isDatesArray","every","dateMatchModifiers","matchers","matchersArr","some","isDayBefore","before","isDayAfter","after","dayPickerContext","createContext","undefined","useDayPicker","useContext","Error","props","React","createElement","size","orientation","className","height","viewBox","points","modifiers","tdProps","buttonProps","ref","useRef","useEffect","focused","current","focus","components","classNames","selectProps","cssClassSelect","Dropdown","selectedOption","disabled","DropdownRoot","Select","label","Option","CaptionLabel","Chevron","calendarMonth","displayIndex","divProps","children","onPreviousClick","onNextClick","previousMonth","nextMonth","navProps","labels","labelPrevious","labelNext","handleNextClick","useCallback","handlePreviousClick","PreviousMonthButton","type","tabIndex","onClick","NextMonthButton","Button","rootRef","trProps","thProps","getComponents","customComponents","getDefaultClassNames","formatCaption","formatMonthCaption","formatYearDropdown","formatYearCaption","weekday","labelGrid","labelCaption","labelDayButton","selected","labelDay","asHtmlElement","element","HTMLElement","queryMonthEls","querySelectorAll","queryCaptionEl","querySelector","queryWeeksEl","useAnimation","rootElRef","enabled","months","previousRootElSnapshotRef","previousMonthsRef","animatingRef","useLayoutEffect","previousMonths","isAfterPreviousMonth","captionAnimationClass","caption_after_enter","caption_before_enter","weeksAnimationClass","weeks_after_enter","weeks_before_enter","previousRootElSnapshot","rootElSnapshot","cloneNode","currentMonthElSnapshot","previousMonthElSnapshot","contains","removeChild","captionEl","classList","remove","weeksEl","previousMonthEls","currentMonthEls","el","style","isolation","navEl","zIndex","currentMonthEl","previousMonthEl","position","overflow","add","cleanUp","pointerEvents","setAttribute","previousWeekdaysEl","queryWeekdaysEl","opacity","previousCaptionEl","caption_before_exit","caption_after_exit","addEventListener","previousWeeksEl","weeks_before_exit","weeks_after_exit","insertBefore","firstChild","getInitialMonth","defaultMonth","numberOfMonths","endMonth","startMonth","initialMonth","useControlledValue","defaultValue","controlledValue","uncontrolledValue","setValue","useState","useCalendar","navStart","navEnd","fromYear","toYear","fromMonth","toMonth","hasYearDropdown","captionLayout","getNavMonths","firstMonth","setFirstMonth","newInitialMonth","displayMonths","firstDisplayedMonth","calendarEndMonth","getDisplayMonths","maxDate","lastMonth","ISOWeek","fixedWeeks","broadcastCalendar","startWeekFirstDate","nOfDays","nOfMonths","extraDates","daysToAdd","getDates","dayPickerMonths","reduce","firstDateOfFirstWeek","monthDates","filter","nrOfDaysWithFixedWeeks","dayPickerMonth","reverseMonths","getMonths","getWeeks","calendarMonths","initialDays","weekDays","getDays","calendarStartMonth","disableNavigation","pagedNavigation","getPreviousMonth","getNextMonth","onMonthChange","goToMonth","newMonth","goToDay","isDayInCalendar","FocusTargetPriority","isFocusableDay","hidden","getNextFocus","moveBy","moveDir","refDay","attempt","focusableDate","refDate","getFocusableDate","isDisabled","isHidden","focusDay","useFocus","calendar","getModifiers","isSelected","autoFocus","lastFocused","setLastFocused","focusTarget","foundFocusTargetPriority","FocusedModifier","LastFocused","Selected","Today","calculateFocusTarget","focusedDay","setFocused","isFocusTarget","blur","moveFocus","nextFocus","rangeOverlaps","rangeLeft","rangeRight","rangeContainsModifiers","dayOfWeekArr","totalDays","totalDaysLimit","rangeContainsDayOfWeek","functionMatchers","useRange","excludeDisabled","initiallySelected","required","onSelect","internallySelected","setSelected","select","triggerDate","newRange","initialRange","addToRange","useSelection","single","compareDate","useSingle","multi","newDates","useMulti","mode","DayPicker","initialProps","useMemo","customFormatters","defaultFormatters","defaultLabels","navLayout","onDayBlur","onDayClick","onDayFocus","onDayKeyDown","onDayMouseEnter","onDayMouseLeave","onPrevClick","showWeekNumber","styles","formatDay","formatMonthDropdown","formatWeekNumber","formatWeekNumberHeader","formatWeekdayName","showOutsideDays","internalModifiersMap","customModifiersMap","isOutside","isBeforeStartMonth","isAfterEndMonth","isToday","keys","name","modifierValue","dayFlags","customModifiers","createGetModifiers","selectedValue","labelGridcell","labelMonthDropdown","labelNav","labelWeekday","labelWeekNumber","labelWeekNumberHeader","labelYearDropdown","weekdays","getWeekdays","isInteractive","handleDayClick","preventDefault","stopPropagation","handleDayFocus","handleDayBlur","handleDayKeyDown","keyMap","ArrowLeft","dir","ArrowRight","ArrowDown","ArrowUp","PageUp","shiftKey","PageDown","Home","End","handleDayMouseEnter","handleDayMouseLeave","handleMonthChange","selectedMonth","target","handleYearChange","selectedYear","Root","dataAttributes","entries","val","getDataAttributes","animate","contextValue","dayPickerProps","Provider","id","lang","nonce","title","role","Months","hideNavigation","Nav","dropdownMonths","getMonthOptions","dropdownYears","firstNavYear","lastNavYear","years","getYearOptions","Month","MonthCaption","DropdownNav","Dropdowns","MonthsDropdown","onChange","YearsDropdown","border","clip","margin","padding","whiteSpace","wordWrap","MonthGrid","hideWeekdays","Weekdays","WeekNumberHeader","scope","Weekday","Weeks","weekIndex","Week","WeekNumber","range_start","range_end","range_middle","dayModifiers","modifiersStyles","Day","active","modifier","getStyleForModifiers","modifiersClassNames","previousValue","getClassNamesForModifiers","ariaLabel","DayButton","onBlur","onFocus","onKeyDown","onMouseEnter","onMouseLeave","footer","Footer","Calendar","cn","month_caption","month_grid","caption_label","nav","button_previous","buttonVariants","variant","button_next","day_button","ChevronLeft","ChevronRight","displayName"],"mappings":"oUAAA,MAAMA,EAAoB,CAAC,EACrBC,EAAc,CAAC,EAed,SAASC,EAASC,EAAUC,GACjC,QACiBJ,EAAkBG,EAAjC,MAKME,IALSL,EAAAA,GAAkBG,EAAAA,KAAlBH,EAAkBG,GAAc,IAAIG,KAAKC,eAAe,QAAS,CAC9EJ,WACAK,KAAM,UACNC,aAAc,eACbC,SACsBN,GAAMO,MAAM,OAAO,IAAM,GAClD,OAAIN,KAAaJ,EAAoBA,EAAYI,GAC1CO,EAAWP,EAAWA,EAAUM,MAAM,KAC/C,CAAE,MAGA,GAAIR,KAAYF,EAAa,OAAOA,EAAYE,GAChD,MAAMU,EAAWV,GAAUW,MAAMC,GACjC,OAAIF,EAAiBD,EAAWT,EAAUU,EAASG,MAAM,IAClDC,GACT,CACF,CACA,MAAMF,EAAW,sBACjB,SAASH,EAAWM,EAAUC,GAC5B,MAAMC,GAASD,EAAO,GAChBE,IAAYF,EAAO,IAAM,GAC/B,OAAOlB,EAAYiB,GAAYE,EAAQ,EAAY,GAARA,EAAaC,EAAkB,GAARD,EAAaC,CACjF,CCvCO,MAAMC,UAAmBC,KA2B9B,SAAOC,CAAGA,KAAOC,GACf,OAAOA,EAAKC,OAAS,IAAIJ,KAAcG,EAAMD,GAAM,IAAIF,EAAWC,KAAKI,MAAOH,EAChF,CAMAI,YAAAA,CAAazB,GACX,OAAO,IAAImB,GAAYO,KAAM1B,EAC/B,CACA2B,iBAAAA,GACE,OAAQ5B,EAAS2B,KAAK1B,SAAU0B,KAClC,CAMAE,OAAAA,CAAQC,GAGN,OAFAT,KAAKU,UAAUF,QAAQG,MAAML,KAAMM,WACnCC,EAAeP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AGP,ErBzDA,SAAKkM,GACHA,EAAAA,EAAA,MAAA,GAAA,QACAA,EAAAA,EAAA,SAAA,GAAA,WACAA,EAAAA,EAAA,YAAA,GAAA,cACAA,EAAAA,EAAA,gBAAA,GAAA,iBACF,CALA,CAAKA,KAAAA,GAAmB,CAAA,IqB0DxBwM,GAASa,YAAc","x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153]}