UNPKG

dgz-ui

Version:

Custom ui library using React.js, Shadcn/ui, TailwindCSS, Typescript

3,480 lines 121 kB
import { j as B } from "./jsx-runtime-DS1N_tNq.js";
import O, { createContext as pn, useContext as xn, useCallback as V, useRef as Ge, useLayoutEffect as Sn, useState as ge, useEffect as it, useMemo as Ye, forwardRef as Wn } from "react";
import { P as Nn, a as Cn, b as Yn } from "./popover-OZcfKDD9.js";
import { B as be, b as mt } from "./button-CdZDBhmr.js";
import { t as _n, c as ve } from "./utils-B6fNqzRf.js";
import { J as Yt, r as _t, g as Tn } from "./index-Br4MVOGV.js";
import { g as Tt, R as yt } from "./react-select-DVPHHTAP.js";
import { c as Pn } from "./createLucideIcon-B950nf2d.js";
/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */
const En = [
  ["path", { d: "M8 2v4", key: "1cmpym" }],
  ["path", { d: "M16 2v4", key: "4m81vk" }],
  ["rect", { width: "18", height: "18", x: "3", y: "4", rx: "2", key: "1hopcy" }],
  ["path", { d: "M3 10h18", key: "8toen8" }]
], $n = Pn("calendar", En), tt = {}, Ie = {};
function He(t, e) {
  try {
    const r = (tt[t] || (tt[t] = new Intl.DateTimeFormat("en-GB", {
      timeZone: t,
      hour: "numeric",
      timeZoneName: "longOffset"
    }).format))(e).split("GMT")[1] || "";
    return r in Ie ? Ie[r] : gt(r, r.split(":"));
  } catch {
    if (t in Ie) return Ie[t];
    const n = t == null ? void 0 : t.match(Fn);
    return n ? gt(t, n.slice(1)) : NaN;
  }
}
const Fn = /([+-]\d\d):?(\d\d)?/;
function gt(t, e) {
  const n = +e[0], r = +(e[1] || 0);
  return Ie[t] = n > 0 ? n * 60 + r : n * 60 - r;
}
class we extends Date {
  //#region static
  constructor(...e) {
    super(), e.length > 1 && typeof e[e.length - 1] == "string" && (this.timeZone = e.pop()), this.internal = /* @__PURE__ */ new Date(), isNaN(He(this.timeZone, this)) ? this.setTime(NaN) : e.length ? typeof e[0] == "number" && (e.length === 1 || e.length === 2 && typeof e[1] != "number") ? this.setTime(e[0]) : typeof e[0] == "string" ? this.setTime(+new Date(e[0])) : e[0] instanceof Date ? this.setTime(+e[0]) : (this.setTime(+new Date(...e)), Pt(this), ot(this)) : this.setTime(Date.now());
  }
  static tz(e, ...n) {
    return n.length ? new we(...n, e) : new we(Date.now(), e);
  }
  //#endregion
  //#region time zone
  withTimeZone(e) {
    return new we(+this, e);
  }
  getTimezoneOffset() {
    return -He(this.timeZone, this);
  }
  //#endregion
  //#region time
  setTime(e) {
    return Date.prototype.setTime.apply(this, arguments), ot(this), +this;
  }
  //#endregion
  //#region date-fns integration
  [Symbol.for("constructDateFrom")](e) {
    return new we(+new Date(e), this.timeZone);
  }
  //#endregion
}
const wt = /^(get|set)(?!UTC)/;
Object.getOwnPropertyNames(Date.prototype).forEach((t) => {
  if (!wt.test(t)) return;
  const e = t.replace(wt, "$1UTC");
  we.prototype[e] && (t.startsWith("get") ? we.prototype[t] = function() {
    return this.internal[e]();
  } : (we.prototype[t] = function() {
    return Date.prototype[e].apply(this.internal, arguments), Bn(this), +this;
  }, we.prototype[e] = function() {
    return Date.prototype[e].apply(this, arguments), ot(this), +this;
  }));
});
function ot(t) {
  t.internal.setTime(+t), t.internal.setUTCMinutes(t.internal.getUTCMinutes() - t.getTimezoneOffset());
}
function Bn(t) {
  Date.prototype.setFullYear.call(t, t.internal.getUTCFullYear(), t.internal.getUTCMonth(), t.internal.getUTCDate()), Date.prototype.setHours.call(t, t.internal.getUTCHours(), t.internal.getUTCMinutes(), t.internal.getUTCSeconds(), t.internal.getUTCMilliseconds()), Pt(t);
}
function Pt(t) {
  const e = He(t.timeZone, t), n = /* @__PURE__ */ new Date(+t);
  n.setUTCHours(n.getUTCHours() - 1);
  const r = -(/* @__PURE__ */ new Date(+t)).getTimezoneOffset(), a = -(/* @__PURE__ */ new Date(+n)).getTimezoneOffset(), s = r - a, i = Date.prototype.getHours.apply(t) !== t.internal.getUTCHours();
  s && i && t.internal.setUTCMinutes(t.internal.getUTCMinutes() + s);
  const o = r - e;
  o && Date.prototype.setUTCMinutes.call(t, Date.prototype.getUTCMinutes.call(t) + o);
  const u = He(t.timeZone, t), l = -(/* @__PURE__ */ new Date(+t)).getTimezoneOffset() - u, d = u !== e, w = l - o;
  if (d && w) {
    Date.prototype.setUTCMinutes.call(t, Date.prototype.getUTCMinutes.call(t) + w);
    const v = He(t.timeZone, t), D = u - v;
    D && (t.internal.setUTCMinutes(t.internal.getUTCMinutes() + D), Date.prototype.setUTCMinutes.call(t, Date.prototype.getUTCMinutes.call(t) + D));
  }
}
class ne extends we {
  //#region static
  static tz(e, ...n) {
    return n.length ? new ne(...n, e) : new ne(Date.now(), e);
  }
  //#endregion
  //#region representation
  toISOString() {
    const [e, n, r] = this.tzComponents(), a = `${e}${n}:${r}`;
    return this.internal.toISOString().slice(0, -1) + a;
  }
  toString() {
    return `${this.toDateString()} ${this.toTimeString()}`;
  }
  toDateString() {
    const [e, n, r, a] = this.internal.toUTCString().split(" ");
    return `${e == null ? void 0 : e.slice(0, -1)} ${r} ${n} ${a}`;
  }
  toTimeString() {
    const e = this.internal.toUTCString().split(" ")[4], [n, r, a] = this.tzComponents();
    return `${e} GMT${n}${r}${a} (${jn(this.timeZone, this)})`;
  }
  toLocaleString(e, n) {
    return Date.prototype.toLocaleString.call(this, e, {
      ...n,
      timeZone: (n == null ? void 0 : n.timeZone) || this.timeZone
    });
  }
  toLocaleDateString(e, n) {
    return Date.prototype.toLocaleDateString.call(this, e, {
      ...n,
      timeZone: (n == null ? void 0 : n.timeZone) || this.timeZone
    });
  }
  toLocaleTimeString(e, n) {
    return Date.prototype.toLocaleTimeString.call(this, e, {
      ...n,
      timeZone: (n == null ? void 0 : n.timeZone) || this.timeZone
    });
  }
  //#endregion
  //#region private
  tzComponents() {
    const e = this.getTimezoneOffset(), n = e > 0 ? "-" : "+", r = String(Math.floor(Math.abs(e) / 60)).padStart(2, "0"), a = String(Math.abs(e) % 60).padStart(2, "0");
    return [n, r, a];
  }
  //#endregion
  withTimeZone(e) {
    return new ne(+this, e);
  }
  //#region date-fns integration
  [Symbol.for("constructDateFrom")](e) {
    return new ne(+new Date(e), this.timeZone);
  }
  //#endregion
}
function jn(t, e) {
  return new Intl.DateTimeFormat("en-GB", {
    timeZone: t,
    timeZoneName: "long"
  }).format(e).slice(12);
}
var C;
(function(t) {
  t.Root = "root", t.Chevron = "chevron", t.Day = "day", t.DayButton = "day_button", t.CaptionLabel = "caption_label", t.Dropdowns = "dropdowns", t.Dropdown = "dropdown", t.DropdownRoot = "dropdown_root", t.Footer = "footer", t.MonthGrid = "month_grid", t.MonthCaption = "month_caption", t.MonthsDropdown = "months_dropdown", t.Month = "month", t.Months = "months", t.Nav = "nav", t.NextMonthButton = "button_next", t.PreviousMonthButton = "button_previous", t.Week = "week", t.Weeks = "weeks", t.Weekday = "weekday", t.Weekdays = "weekdays", t.WeekNumber = "week_number", t.WeekNumberHeader = "week_number_header", t.YearsDropdown = "years_dropdown";
})(C || (C = {}));
var X;
(function(t) {
  t.disabled = "disabled", t.hidden = "hidden", t.outside = "outside", t.focused = "focused", t.today = "today";
})(X || (X = {}));
var fe;
(function(t) {
  t.range_end = "range_end", t.range_middle = "range_middle", t.range_start = "range_start", t.selected = "selected";
})(fe || (fe = {}));
var ie;
(function(t) {
  t.weeks_before_enter = "weeks_before_enter", t.weeks_before_exit = "weeks_before_exit", t.weeks_after_enter = "weeks_after_enter", t.weeks_after_exit = "weeks_after_exit", t.caption_after_enter = "caption_after_enter", t.caption_after_exit = "caption_after_exit", t.caption_before_enter = "caption_before_enter", t.caption_before_exit = "caption_before_exit";
})(ie || (ie = {}));
const Et = 6048e5, In = 864e5, Mt = Symbol.for("constructDateFrom");
function K(t, e) {
  return typeof t == "function" ? t(e) : t && typeof t == "object" && Mt in t ? t[Mt](e) : t instanceof Date ? new t.constructor(e) : new Date(e);
}
function R(t, e) {
  return K(e || t, t);
}
function $t(t, e, n) {
  const r = R(t, n == null ? void 0 : n.in);
  return isNaN(e) ? K(t, NaN) : (e && r.setDate(r.getDate() + e), r);
}
function Ft(t, e, n) {
  const r = R(t, n == null ? void 0 : n.in);
  if (isNaN(e)) return K(t, NaN);
  if (!e)
    return r;
  const a = r.getDate(), s = K(t, r.getTime());
  s.setMonth(r.getMonth() + e + 1, 0);
  const i = s.getDate();
  return a >= i ? s : (r.setFullYear(
    s.getFullYear(),
    s.getMonth(),
    a
  ), r);
}
let Hn = {};
function ze() {
  return Hn;
}
function _e(t, e) {
  var o, u, c, l;
  const n = ze(), r = (e == null ? void 0 : e.weekStartsOn) ?? ((u = (o = e == null ? void 0 : e.locale) == null ? void 0 : o.options) == null ? void 0 : u.weekStartsOn) ?? n.weekStartsOn ?? ((l = (c = n.locale) == null ? void 0 : c.options) == null ? void 0 : l.weekStartsOn) ?? 0, a = R(t, e == null ? void 0 : e.in), s = a.getDay(), i = (s < r ? 7 : 0) + s - r;
  return a.setDate(a.getDate() - i), a.setHours(0, 0, 0, 0), a;
}
function Ae(t, e) {
  return _e(t, { ...e, weekStartsOn: 1 });
}
function Bt(t, e) {
  const n = R(t, e == null ? void 0 : e.in), r = n.getFullYear(), a = K(n, 0);
  a.setFullYear(r + 1, 0, 4), a.setHours(0, 0, 0, 0);
  const s = Ae(a), i = K(n, 0);
  i.setFullYear(r, 0, 4), i.setHours(0, 0, 0, 0);
  const o = Ae(i);
  return n.getTime() >= s.getTime() ? r + 1 : n.getTime() >= o.getTime() ? r : r - 1;
}
function bt(t) {
  const e = R(t), n = new Date(
    Date.UTC(
      e.getFullYear(),
      e.getMonth(),
      e.getDate(),
      e.getHours(),
      e.getMinutes(),
      e.getSeconds(),
      e.getMilliseconds()
    )
  );
  return n.setUTCFullYear(e.getFullYear()), +t - +n;
}
function Te(t, ...e) {
  const n = K.bind(
    null,
    e.find((r) => typeof r == "object")
  );
  return e.map(n);
}
function qe(t, e) {
  const n = R(t, e == null ? void 0 : e.in);
  return n.setHours(0, 0, 0, 0), n;
}
function jt(t, e, n) {
  const [r, a] = Te(
    n == null ? void 0 : n.in,
    t,
    e
  ), s = qe(r), i = qe(a), o = +s - bt(s), u = +i - bt(i);
  return Math.round((o - u) / In);
}
function An(t, e) {
  const n = Bt(t, e), r = K(t, 0);
  return r.setFullYear(n, 0, 4), r.setHours(0, 0, 0, 0), Ae(r);
}
function qn(t, e, n) {
  return $t(t, e * 7, n);
}
function zn(t, e, n) {
  return Ft(t, e * 12, n);
}
function Ln(t, e) {
  let n, r = e == null ? void 0 : e.in;
  return t.forEach((a) => {
    !r && typeof a == "object" && (r = K.bind(null, a));
    const s = R(a, r);
    (!n || n < s || isNaN(+s)) && (n = s);
  }), K(r, n || NaN);
}
function Rn(t, e) {
  let n, r = e == null ? void 0 : e.in;
  return t.forEach((a) => {
    !r && typeof a == "object" && (r = K.bind(null, a));
    const s = R(a, r);
    (!n || n > s || isNaN(+s)) && (n = s);
  }), K(r, n || NaN);
}
function Zn(t, e, n) {
  const [r, a] = Te(
    n == null ? void 0 : n.in,
    t,
    e
  );
  return +qe(r) == +qe(a);
}
function It(t) {
  return t instanceof Date || typeof t == "object" && Object.prototype.toString.call(t) === "[object Date]";
}
function Gn(t) {
  return !(!It(t) && typeof t != "number" || isNaN(+R(t)));
}
function Qn(t, e, n) {
  const [r, a] = Te(
    n == null ? void 0 : n.in,
    t,
    e
  ), s = r.getFullYear() - a.getFullYear(), i = r.getMonth() - a.getMonth();
  return s * 12 + i;
}
function Xn(t, e) {
  const n = R(t, e == null ? void 0 : e.in), r = n.getMonth();
  return n.setFullYear(n.getFullYear(), r + 1, 0), n.setHours(23, 59, 59, 999), n;
}
function Un(t, e) {
  const [n, r] = Te(t, e.start, e.end);
  return { start: n, end: r };
}
function Vn(t, e) {
  const { start: n, end: r } = Un(e == null ? void 0 : e.in, t);
  let a = +n > +r;
  const s = a ? +n : +r, i = a ? r : n;
  i.setHours(0, 0, 0, 0), i.setDate(1);
  let o = 1;
  const u = [];
  for (; +i <= s; )
    u.push(K(n, i)), i.setMonth(i.getMonth() + o);
  return a ? u.reverse() : u;
}
function Jn(t, e) {
  const n = R(t, e == null ? void 0 : e.in);
  return n.setDate(1), n.setHours(0, 0, 0, 0), n;
}
function Kn(t, e) {
  const n = R(t, e == null ? void 0 : e.in), r = n.getFullYear();
  return n.setFullYear(r + 1, 0, 0), n.setHours(23, 59, 59, 999), n;
}
function Ht(t, e) {
  const n = R(t, e == null ? void 0 : e.in);
  return n.setFullYear(n.getFullYear(), 0, 1), n.setHours(0, 0, 0, 0), n;
}
function At(t, e) {
  var o, u, c, l;
  const n = ze(), r = (e == null ? void 0 : e.weekStartsOn) ?? ((u = (o = e == null ? void 0 : e.locale) == null ? void 0 : o.options) == null ? void 0 : u.weekStartsOn) ?? n.weekStartsOn ?? ((l = (c = n.locale) == null ? void 0 : c.options) == null ? void 0 : l.weekStartsOn) ?? 0, a = R(t, e == null ? void 0 : e.in), s = a.getDay(), i = (s < r ? -7 : 0) + 6 - (s - r);
  return a.setDate(a.getDate() + i), a.setHours(23, 59, 59, 999), a;
}
function er(t, e) {
  return At(t, { ...e, weekStartsOn: 1 });
}
const tr = {
  lessThanXSeconds: {
    one: "less than a second",
    other: "less than {{count}} seconds"
  },
  xSeconds: {
    one: "1 second",
    other: "{{count}} seconds"
  },
  halfAMinute: "half a minute",
  lessThanXMinutes: {
    one: "less than a minute",
    other: "less than {{count}} minutes"
  },
  xMinutes: {
    one: "1 minute",
    other: "{{count}} minutes"
  },
  aboutXHours: {
    one: "about 1 hour",
    other: "about {{count}} hours"
  },
  xHours: {
    one: "1 hour",
    other: "{{count}} hours"
  },
  xDays: {
    one: "1 day",
    other: "{{count}} days"
  },
  aboutXWeeks: {
    one: "about 1 week",
    other: "about {{count}} weeks"
  },
  xWeeks: {
    one: "1 week",
    other: "{{count}} weeks"
  },
  aboutXMonths: {
    one: "about 1 month",
    other: "about {{count}} months"
  },
  xMonths: {
    one: "1 month",
    other: "{{count}} months"
  },
  aboutXYears: {
    one: "about 1 year",
    other: "about {{count}} years"
  },
  xYears: {
    one: "1 year",
    other: "{{count}} years"
  },
  overXYears: {
    one: "over 1 year",
    other: "over {{count}} years"
  },
  almostXYears: {
    one: "almost 1 year",
    other: "almost {{count}} years"
  }
}, nr = (t, e, n) => {
  let r;
  const a = tr[t];
  return typeof a == "string" ? r = a : e === 1 ? r = a.one : r = a.other.replace("{{count}}", e.toString()), n != null && n.addSuffix ? n.comparison && n.comparison > 0 ? "in " + r : r + " ago" : r;
};
function nt(t) {
  return (e = {}) => {
    const n = e.width ? String(e.width) : t.defaultWidth;
    return t.formats[n] || t.formats[t.defaultWidth];
  };
}
const rr = {
  full: "EEEE, MMMM do, y",
  long: "MMMM do, y",
  medium: "MMM d, y",
  short: "MM/dd/yyyy"
}, ar = {
  full: "h:mm:ss a zzzz",
  long: "h:mm:ss a z",
  medium: "h:mm:ss a",
  short: "h:mm a"
}, sr = {
  full: "{{date}} 'at' {{time}}",
  long: "{{date}} 'at' {{time}}",
  medium: "{{date}}, {{time}}",
  short: "{{date}}, {{time}}"
}, or = {
  date: nt({
    formats: rr,
    defaultWidth: "full"
  }),
  time: nt({
    formats: ar,
    defaultWidth: "full"
  }),
  dateTime: nt({
    formats: sr,
    defaultWidth: "full"
  })
}, ir = {
  lastWeek: "'last' eeee 'at' p",
  yesterday: "'yesterday at' p",
  today: "'today at' p",
  tomorrow: "'tomorrow at' p",
  nextWeek: "eeee 'at' p",
  other: "P"
}, ur = (t, e, n, r) => ir[t];
function Be(t) {
  return (e, n) => {
    const r = n != null && n.context ? String(n.context) : "standalone";
    let a;
    if (r === "formatting" && t.formattingValues) {
      const i = t.defaultFormattingWidth || t.defaultWidth, o = n != null && n.width ? String(n.width) : i;
      a = t.formattingValues[o] || t.formattingValues[i];
    } else {
      const i = t.defaultWidth, o = n != null && n.width ? String(n.width) : t.defaultWidth;
      a = t.values[o] || t.values[i];
    }
    const s = t.argumentCallback ? t.argumentCallback(e) : e;
    return a[s];
  };
}
const cr = {
  narrow: ["B", "A"],
  abbreviated: ["BC", "AD"],
  wide: ["Before Christ", "Anno Domini"]
}, dr = {
  narrow: ["1", "2", "3", "4"],
  abbreviated: ["Q1", "Q2", "Q3", "Q4"],
  wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"]
}, fr = {
  narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
  abbreviated: [
    "Jan",
    "Feb",
    "Mar",
    "Apr",
    "May",
    "Jun",
    "Jul",
    "Aug",
    "Sep",
    "Oct",
    "Nov",
    "Dec"
  ],
  wide: [
    "January",
    "February",
    "March",
    "April",
    "May",
    "June",
    "July",
    "August",
    "September",
    "October",
    "November",
    "December"
  ]
}, lr = {
  narrow: ["S", "M", "T", "W", "T", "F", "S"],
  short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
  abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
  wide: [
    "Sunday",
    "Monday",
    "Tuesday",
    "Wednesday",
    "Thursday",
    "Friday",
    "Saturday"
  ]
}, hr = {
  narrow: {
    am: "a",
    pm: "p",
    midnight: "mi",
    noon: "n",
    morning: "morning",
    afternoon: "afternoon",
    evening: "evening",
    night: "night"
  },
  abbreviated: {
    am: "AM",
    pm: "PM",
    midnight: "midnight",
    noon: "noon",
    morning: "morning",
    afternoon: "afternoon",
    evening: "evening",
    night: "night"
  },
  wide: {
    am: "a.m.",
    pm: "p.m.",
    midnight: "midnight",
    noon: "noon",
    morning: "morning",
    afternoon: "afternoon",
    evening: "evening",
    night: "night"
  }
}, mr = {
  narrow: {
    am: "a",
    pm: "p",
    midnight: "mi",
    noon: "n",
    morning: "in the morning",
    afternoon: "in the afternoon",
    evening: "in the evening",
    night: "at night"
  },
  abbreviated: {
    am: "AM",
    pm: "PM",
    midnight: "midnight",
    noon: "noon",
    morning: "in the morning",
    afternoon: "in the afternoon",
    evening: "in the evening",
    night: "at night"
  },
  wide: {
    am: "a.m.",
    pm: "p.m.",
    midnight: "midnight",
    noon: "noon",
    morning: "in the morning",
    afternoon: "in the afternoon",
    evening: "in the evening",
    night: "at night"
  }
}, yr = (t, e) => {
  const n = Number(t), r = n % 100;
  if (r > 20 || r < 10)
    switch (r % 10) {
      case 1:
        return n + "st";
      case 2:
        return n + "nd";
      case 3:
        return n + "rd";
    }
  return n + "th";
}, gr = {
  ordinalNumber: yr,
  era: Be({
    values: cr,
    defaultWidth: "wide"
  }),
  quarter: Be({
    values: dr,
    defaultWidth: "wide",
    argumentCallback: (t) => t - 1
  }),
  month: Be({
    values: fr,
    defaultWidth: "wide"
  }),
  day: Be({
    values: lr,
    defaultWidth: "wide"
  }),
  dayPeriod: Be({
    values: hr,
    defaultWidth: "wide",
    formattingValues: mr,
    defaultFormattingWidth: "wide"
  })
};
function je(t) {
  return (e, n = {}) => {
    const r = n.width, a = r && t.matchPatterns[r] || t.matchPatterns[t.defaultMatchWidth], s = e.match(a);
    if (!s)
      return null;
    const i = s[0], o = r && t.parsePatterns[r] || t.parsePatterns[t.defaultParseWidth], u = Array.isArray(o) ? Mr(o, (d) => d.test(i)) : (
      // [TODO] -- I challenge you to fix the type
      wr(o, (d) => d.test(i))
    );
    let c;
    c = t.valueCallback ? t.valueCallback(u) : u, c = n.valueCallback ? (
      // [TODO] -- I challenge you to fix the type
      n.valueCallback(c)
    ) : c;
    const l = e.slice(i.length);
    return { value: c, rest: l };
  };
}
function wr(t, e) {
  for (const n in t)
    if (Object.prototype.hasOwnProperty.call(t, n) && e(t[n]))
      return n;
}
function Mr(t, e) {
  for (let n = 0; n < t.length; n++)
    if (e(t[n]))
      return n;
}
function br(t) {
  return (e, n = {}) => {
    const r = e.match(t.matchPattern);
    if (!r) return null;
    const a = r[0], s = e.match(t.parsePattern);
    if (!s) return null;
    let i = t.valueCallback ? t.valueCallback(s[0]) : s[0];
    i = n.valueCallback ? n.valueCallback(i) : i;
    const o = e.slice(a.length);
    return { value: i, rest: o };
  };
}
const vr = /^(\d+)(th|st|nd|rd)?/i, Dr = /\d+/i, kr = {
  narrow: /^(b|a)/i,
  abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
  wide: /^(before christ|before common era|anno domini|common era)/i
}, Or = {
  any: [/^b/i, /^(a|c)/i]
}, pr = {
  narrow: /^[1234]/i,
  abbreviated: /^q[1234]/i,
  wide: /^[1234](th|st|nd|rd)? quarter/i
}, xr = {
  any: [/1/i, /2/i, /3/i, /4/i]
}, Sr = {
  narrow: /^[jfmasond]/i,
  abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
  wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
}, Wr = {
  narrow: [
    /^j/i,
    /^f/i,
    /^m/i,
    /^a/i,
    /^m/i,
    /^j/i,
    /^j/i,
    /^a/i,
    /^s/i,
    /^o/i,
    /^n/i,
    /^d/i
  ],
  any: [
    /^ja/i,
    /^f/i,
    /^mar/i,
    /^ap/i,
    /^may/i,
    /^jun/i,
    /^jul/i,
    /^au/i,
    /^s/i,
    /^o/i,
    /^n/i,
    /^d/i
  ]
}, Nr = {
  narrow: /^[smtwf]/i,
  short: /^(su|mo|tu|we|th|fr|sa)/i,
  abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
  wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
}, Cr = {
  narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
  any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
}, Yr = {
  narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
  any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
}, _r = {
  any: {
    am: /^a/i,
    pm: /^p/i,
    midnight: /^mi/i,
    noon: /^no/i,
    morning: /morning/i,
    afternoon: /afternoon/i,
    evening: /evening/i,
    night: /night/i
  }
}, Tr = {
  ordinalNumber: br({
    matchPattern: vr,
    parsePattern: Dr,
    valueCallback: (t) => parseInt(t, 10)
  }),
  era: je({
    matchPatterns: kr,
    defaultMatchWidth: "wide",
    parsePatterns: Or,
    defaultParseWidth: "any"
  }),
  quarter: je({
    matchPatterns: pr,
    defaultMatchWidth: "wide",
    parsePatterns: xr,
    defaultParseWidth: "any",
    valueCallback: (t) => t + 1
  }),
  month: je({
    matchPatterns: Sr,
    defaultMatchWidth: "wide",
    parsePatterns: Wr,
    defaultParseWidth: "any"
  }),
  day: je({
    matchPatterns: Nr,
    defaultMatchWidth: "wide",
    parsePatterns: Cr,
    defaultParseWidth: "any"
  }),
  dayPeriod: je({
    matchPatterns: Yr,
    defaultMatchWidth: "any",
    parsePatterns: _r,
    defaultParseWidth: "any"
  })
}, ut = {
  code: "en-US",
  formatDistance: nr,
  formatLong: or,
  formatRelative: ur,
  localize: gr,
  match: Tr,
  options: {
    weekStartsOn: 0,
    firstWeekContainsDate: 1
  }
};
function Pr(t, e) {
  const n = R(t, e == null ? void 0 : e.in);
  return jt(n, Ht(n)) + 1;
}
function qt(t, e) {
  const n = R(t, e == null ? void 0 : e.in), r = +Ae(n) - +An(n);
  return Math.round(r / Et) + 1;
}
function zt(t, e) {
  var l, d, w, v;
  const n = R(t, e == null ? void 0 : e.in), r = n.getFullYear(), a = ze(), s = (e == null ? void 0 : e.firstWeekContainsDate) ?? ((d = (l = e == null ? void 0 : e.locale) == null ? void 0 : l.options) == null ? void 0 : d.firstWeekContainsDate) ?? a.firstWeekContainsDate ?? ((v = (w = a.locale) == null ? void 0 : w.options) == null ? void 0 : v.firstWeekContainsDate) ?? 1, i = K((e == null ? void 0 : e.in) || t, 0);
  i.setFullYear(r + 1, 0, s), i.setHours(0, 0, 0, 0);
  const o = _e(i, e), u = K((e == null ? void 0 : e.in) || t, 0);
  u.setFullYear(r, 0, s), u.setHours(0, 0, 0, 0);
  const c = _e(u, e);
  return +n >= +o ? r + 1 : +n >= +c ? r : r - 1;
}
function Er(t, e) {
  var o, u, c, l;
  const n = ze(), r = (e == null ? void 0 : e.firstWeekContainsDate) ?? ((u = (o = e == null ? void 0 : e.locale) == null ? void 0 : o.options) == null ? void 0 : u.firstWeekContainsDate) ?? n.firstWeekContainsDate ?? ((l = (c = n.locale) == null ? void 0 : c.options) == null ? void 0 : l.firstWeekContainsDate) ?? 1, a = zt(t, e), s = K((e == null ? void 0 : e.in) || t, 0);
  return s.setFullYear(a, 0, r), s.setHours(0, 0, 0, 0), _e(s, e);
}
function Lt(t, e) {
  const n = R(t, e == null ? void 0 : e.in), r = +_e(n, e) - +Er(n, e);
  return Math.round(r / Et) + 1;
}
function L(t, e) {
  const n = t < 0 ? "-" : "", r = Math.abs(t).toString().padStart(e, "0");
  return n + r;
}
const xe = {
  // Year
  y(t, e) {
    const n = t.getFullYear(), r = n > 0 ? n : 1 - n;
    return L(e === "yy" ? r % 100 : r, e.length);
  },
  // Month
  M(t, e) {
    const n = t.getMonth();
    return e === "M" ? String(n + 1) : L(n + 1, 2);
  },
  // Day of the month
  d(t, e) {
    return L(t.getDate(), e.length);
  },
  // AM or PM
  a(t, e) {
    const n = t.getHours() / 12 >= 1 ? "pm" : "am";
    switch (e) {
      case "a":
      case "aa":
        return n.toUpperCase();
      case "aaa":
        return n;
      case "aaaaa":
        return n[0];
      case "aaaa":
      default:
        return n === "am" ? "a.m." : "p.m.";
    }
  },
  // Hour [1-12]
  h(t, e) {
    return L(t.getHours() % 12 || 12, e.length);
  },
  // Hour [0-23]
  H(t, e) {
    return L(t.getHours(), e.length);
  },
  // Minute
  m(t, e) {
    return L(t.getMinutes(), e.length);
  },
  // Second
  s(t, e) {
    return L(t.getSeconds(), e.length);
  },
  // Fraction of second
  S(t, e) {
    const n = e.length, r = t.getMilliseconds(), a = Math.trunc(
      r * Math.pow(10, n - 3)
    );
    return L(a, e.length);
  }
}, Ce = {
  midnight: "midnight",
  noon: "noon",
  morning: "morning",
  afternoon: "afternoon",
  evening: "evening",
  night: "night"
}, vt = {
  // Era
  G: function(t, e, n) {
    const r = t.getFullYear() > 0 ? 1 : 0;
    switch (e) {
      // AD, BC
      case "G":
      case "GG":
      case "GGG":
        return n.era(r, { width: "abbreviated" });
      // A, B
      case "GGGGG":
        return n.era(r, { width: "narrow" });
      // Anno Domini, Before Christ
      case "GGGG":
      default:
        return n.era(r, { width: "wide" });
    }
  },
  // Year
  y: function(t, e, n) {
    if (e === "yo") {
      const r = t.getFullYear(), a = r > 0 ? r : 1 - r;
      return n.ordinalNumber(a, { unit: "year" });
    }
    return xe.y(t, e);
  },
  // Local week-numbering year
  Y: function(t, e, n, r) {
    const a = zt(t, r), s = a > 0 ? a : 1 - a;
    if (e === "YY") {
      const i = s % 100;
      return L(i, 2);
    }
    return e === "Yo" ? n.ordinalNumber(s, { unit: "year" }) : L(s, e.length);
  },
  // ISO week-numbering year
  R: function(t, e) {
    const n = Bt(t);
    return L(n, e.length);
  },
  // Extended year. This is a single number designating the year of this calendar system.
  // The main difference between `y` and `u` localizers are B.C. years:
  // | Year | `y` | `u` |
  // |------|-----|-----|
  // | AC 1 |   1 |   1 |
  // | BC 1 |   1 |   0 |
  // | BC 2 |   2 |  -1 |
  // Also `yy` always returns the last two digits of a year,
  // while `uu` pads single digit years to 2 characters and returns other years unchanged.
  u: function(t, e) {
    const n = t.getFullYear();
    return L(n, e.length);
  },
  // Quarter
  Q: function(t, e, n) {
    const r = Math.ceil((t.getMonth() + 1) / 3);
    switch (e) {
      // 1, 2, 3, 4
      case "Q":
        return String(r);
      // 01, 02, 03, 04
      case "QQ":
        return L(r, 2);
      // 1st, 2nd, 3rd, 4th
      case "Qo":
        return n.ordinalNumber(r, { unit: "quarter" });
      // Q1, Q2, Q3, Q4
      case "QQQ":
        return n.quarter(r, {
          width: "abbreviated",
          context: "formatting"
        });
      // 1, 2, 3, 4 (narrow quarter; could be not numerical)
      case "QQQQQ":
        return n.quarter(r, {
          width: "narrow",
          context: "formatting"
        });
      // 1st quarter, 2nd quarter, ...
      case "QQQQ":
      default:
        return n.quarter(r, {
          width: "wide",
          context: "formatting"
        });
    }
  },
  // Stand-alone quarter
  q: function(t, e, n) {
    const r = Math.ceil((t.getMonth() + 1) / 3);
    switch (e) {
      // 1, 2, 3, 4
      case "q":
        return String(r);
      // 01, 02, 03, 04
      case "qq":
        return L(r, 2);
      // 1st, 2nd, 3rd, 4th
      case "qo":
        return n.ordinalNumber(r, { unit: "quarter" });
      // Q1, Q2, Q3, Q4
      case "qqq":
        return n.quarter(r, {
          width: "abbreviated",
          context: "standalone"
        });
      // 1, 2, 3, 4 (narrow quarter; could be not numerical)
      case "qqqqq":
        return n.quarter(r, {
          width: "narrow",
          context: "standalone"
        });
      // 1st quarter, 2nd quarter, ...
      case "qqqq":
      default:
        return n.quarter(r, {
          width: "wide",
          context: "standalone"
        });
    }
  },
  // Month
  M: function(t, e, n) {
    const r = t.getMonth();
    switch (e) {
      case "M":
      case "MM":
        return xe.M(t, e);
      // 1st, 2nd, ..., 12th
      case "Mo":
        return n.ordinalNumber(r + 1, { unit: "month" });
      // Jan, Feb, ..., Dec
      case "MMM":
        return n.month(r, {
          width: "abbreviated",
          context: "formatting"
        });
      // J, F, ..., D
      case "MMMMM":
        return n.month(r, {
          width: "narrow",
          context: "formatting"
        });
      // January, February, ..., December
      case "MMMM":
      default:
        return n.month(r, { width: "wide", context: "formatting" });
    }
  },
  // Stand-alone month
  L: function(t, e, n) {
    const r = t.getMonth();
    switch (e) {
      // 1, 2, ..., 12
      case "L":
        return String(r + 1);
      // 01, 02, ..., 12
      case "LL":
        return L(r + 1, 2);
      // 1st, 2nd, ..., 12th
      case "Lo":
        return n.ordinalNumber(r + 1, { unit: "month" });
      // Jan, Feb, ..., Dec
      case "LLL":
        return n.month(r, {
          width: "abbreviated",
          context: "standalone"
        });
      // J, F, ..., D
      case "LLLLL":
        return n.month(r, {
          width: "narrow",
          context: "standalone"
        });
      // January, February, ..., December
      case "LLLL":
      default:
        return n.month(r, { width: "wide", context: "standalone" });
    }
  },
  // Local week of year
  w: function(t, e, n, r) {
    const a = Lt(t, r);
    return e === "wo" ? n.ordinalNumber(a, { unit: "week" }) : L(a, e.length);
  },
  // ISO week of year
  I: function(t, e, n) {
    const r = qt(t);
    return e === "Io" ? n.ordinalNumber(r, { unit: "week" }) : L(r, e.length);
  },
  // Day of the month
  d: function(t, e, n) {
    return e === "do" ? n.ordinalNumber(t.getDate(), { unit: "date" }) : xe.d(t, e);
  },
  // Day of year
  D: function(t, e, n) {
    const r = Pr(t);
    return e === "Do" ? n.ordinalNumber(r, { unit: "dayOfYear" }) : L(r, e.length);
  },
  // Day of week
  E: function(t, e, n) {
    const r = t.getDay();
    switch (e) {
      // Tue
      case "E":
      case "EE":
      case "EEE":
        return n.day(r, {
          width: "abbreviated",
          context: "formatting"
        });
      // T
      case "EEEEE":
        return n.day(r, {
          width: "narrow",
          context: "formatting"
        });
      // Tu
      case "EEEEEE":
        return n.day(r, {
          width: "short",
          context: "formatting"
        });
      // Tuesday
      case "EEEE":
      default:
        return n.day(r, {
          width: "wide",
          context: "formatting"
        });
    }
  },
  // Local day of week
  e: function(t, e, n, r) {
    const a = t.getDay(), s = (a - r.weekStartsOn + 8) % 7 || 7;
    switch (e) {
      // Numerical value (Nth day of week with current locale or weekStartsOn)
      case "e":
        return String(s);
      // Padded numerical value
      case "ee":
        return L(s, 2);
      // 1st, 2nd, ..., 7th
      case "eo":
        return n.ordinalNumber(s, { unit: "day" });
      case "eee":
        return n.day(a, {
          width: "abbreviated",
          context: "formatting"
        });
      // T
      case "eeeee":
        return n.day(a, {
          width: "narrow",
          context: "formatting"
        });
      // Tu
      case "eeeeee":
        return n.day(a, {
          width: "short",
          context: "formatting"
        });
      // Tuesday
      case "eeee":
      default:
        return n.day(a, {
          width: "wide",
          context: "formatting"
        });
    }
  },
  // Stand-alone local day of week
  c: function(t, e, n, r) {
    const a = t.getDay(), s = (a - r.weekStartsOn + 8) % 7 || 7;
    switch (e) {
      // Numerical value (same as in `e`)
      case "c":
        return String(s);
      // Padded numerical value
      case "cc":
        return L(s, e.length);
      // 1st, 2nd, ..., 7th
      case "co":
        return n.ordinalNumber(s, { unit: "day" });
      case "ccc":
        return n.day(a, {
          width: "abbreviated",
          context: "standalone"
        });
      // T
      case "ccccc":
        return n.day(a, {
          width: "narrow",
          context: "standalone"
        });
      // Tu
      case "cccccc":
        return n.day(a, {
          width: "short",
          context: "standalone"
        });
      // Tuesday
      case "cccc":
      default:
        return n.day(a, {
          width: "wide",
          context: "standalone"
        });
    }
  },
  // ISO day of week
  i: function(t, e, n) {
    const r = t.getDay(), a = r === 0 ? 7 : r;
    switch (e) {
      // 2
      case "i":
        return String(a);
      // 02
      case "ii":
        return L(a, e.length);
      // 2nd
      case "io":
        return n.ordinalNumber(a, { unit: "day" });
      // Tue
      case "iii":
        return n.day(r, {
          width: "abbreviated",
          context: "formatting"
        });
      // T
      case "iiiii":
        return n.day(r, {
          width: "narrow",
          context: "formatting"
        });
      // Tu
      case "iiiiii":
        return n.day(r, {
          width: "short",
          context: "formatting"
        });
      // Tuesday
      case "iiii":
      default:
        return n.day(r, {
          width: "wide",
          context: "formatting"
        });
    }
  },
  // AM or PM
  a: function(t, e, n) {
    const a = t.getHours() / 12 >= 1 ? "pm" : "am";
    switch (e) {
      case "a":
      case "aa":
        return n.dayPeriod(a, {
          width: "abbreviated",
          context: "formatting"
        });
      case "aaa":
        return n.dayPeriod(a, {
          width: "abbreviated",
          context: "formatting"
        }).toLowerCase();
      case "aaaaa":
        return n.dayPeriod(a, {
          width: "narrow",
          context: "formatting"
        });
      case "aaaa":
      default:
        return n.dayPeriod(a, {
          width: "wide",
          context: "formatting"
        });
    }
  },
  // AM, PM, midnight, noon
  b: function(t, e, n) {
    const r = t.getHours();
    let a;
    switch (r === 12 ? a = Ce.noon : r === 0 ? a = Ce.midnight : a = r / 12 >= 1 ? "pm" : "am", e) {
      case "b":
      case "bb":
        return n.dayPeriod(a, {
          width: "abbreviated",
          context: "formatting"
        });
      case "bbb":
        return n.dayPeriod(a, {
          width: "abbreviated",
          context: "formatting"
        }).toLowerCase();
      case "bbbbb":
        return n.dayPeriod(a, {
          width: "narrow",
          context: "formatting"
        });
      case "bbbb":
      default:
        return n.dayPeriod(a, {
          width: "wide",
          context: "formatting"
        });
    }
  },
  // in the morning, in the afternoon, in the evening, at night
  B: function(t, e, n) {
    const r = t.getHours();
    let a;
    switch (r >= 17 ? a = Ce.evening : r >= 12 ? a = Ce.afternoon : r >= 4 ? a = Ce.morning : a = Ce.night, e) {
      case "B":
      case "BB":
      case "BBB":
        return n.dayPeriod(a, {
          width: "abbreviated",
          context: "formatting"
        });
      case "BBBBB":
        return n.dayPeriod(a, {
          width: "narrow",
          context: "formatting"
        });
      case "BBBB":
      default:
        return n.dayPeriod(a, {
          width: "wide",
          context: "formatting"
        });
    }
  },
  // Hour [1-12]
  h: function(t, e, n) {
    if (e === "ho") {
      let r = t.getHours() % 12;
      return r === 0 && (r = 12), n.ordinalNumber(r, { unit: "hour" });
    }
    return xe.h(t, e);
  },
  // Hour [0-23]
  H: function(t, e, n) {
    return e === "Ho" ? n.ordinalNumber(t.getHours(), { unit: "hour" }) : xe.H(t, e);
  },
  // Hour [0-11]
  K: function(t, e, n) {
    const r = t.getHours() % 12;
    return e === "Ko" ? n.ordinalNumber(r, { unit: "hour" }) : L(r, e.length);
  },
  // Hour [1-24]
  k: function(t, e, n) {
    let r = t.getHours();
    return r === 0 && (r = 24), e === "ko" ? n.ordinalNumber(r, { unit: "hour" }) : L(r, e.length);
  },
  // Minute
  m: function(t, e, n) {
    return e === "mo" ? n.ordinalNumber(t.getMinutes(), { unit: "minute" }) : xe.m(t, e);
  },
  // Second
  s: function(t, e, n) {
    return e === "so" ? n.ordinalNumber(t.getSeconds(), { unit: "second" }) : xe.s(t, e);
  },
  // Fraction of second
  S: function(t, e) {
    return xe.S(t, e);
  },
  // Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
  X: function(t, e, n) {
    const r = t.getTimezoneOffset();
    if (r === 0)
      return "Z";
    switch (e) {
      // Hours and optional minutes
      case "X":
        return kt(r);
      // Hours, minutes and optional seconds without `:` delimiter
      // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
      // so this token always has the same output as `XX`
      case "XXXX":
      case "XX":
        return We(r);
      // Hours, minutes and optional seconds with `:` delimiter
      // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
      // so this token always has the same output as `XXX`
      case "XXXXX":
      case "XXX":
      // Hours and minutes with `:` delimiter
      default:
        return We(r, ":");
    }
  },
  // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
  x: function(t, e, n) {
    const r = t.getTimezoneOffset();
    switch (e) {
      // Hours and optional minutes
      case "x":
        return kt(r);
      // Hours, minutes and optional seconds without `:` delimiter
      // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
      // so this token always has the same output as `xx`
      case "xxxx":
      case "xx":
        return We(r);
      // Hours, minutes and optional seconds with `:` delimiter
      // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
      // so this token always has the same output as `xxx`
      case "xxxxx":
      case "xxx":
      // Hours and minutes with `:` delimiter
      default:
        return We(r, ":");
    }
  },
  // Timezone (GMT)
  O: function(t, e, n) {
    const r = t.getTimezoneOffset();
    switch (e) {
      // Short
      case "O":
      case "OO":
      case "OOO":
        return "GMT" + Dt(r, ":");
      // Long
      case "OOOO":
      default:
        return "GMT" + We(r, ":");
    }
  },
  // Timezone (specific non-location)
  z: function(t, e, n) {
    const r = t.getTimezoneOffset();
    switch (e) {
      // Short
      case "z":
      case "zz":
      case "zzz":
        return "GMT" + Dt(r, ":");
      // Long
      case "zzzz":
      default:
        return "GMT" + We(r, ":");
    }
  },
  // Seconds timestamp
  t: function(t, e, n) {
    const r = Math.trunc(+t / 1e3);
    return L(r, e.length);
  },
  // Milliseconds timestamp
  T: function(t, e, n) {
    return L(+t, e.length);
  }
};
function Dt(t, e = "") {
  const n = t > 0 ? "-" : "+", r = Math.abs(t), a = Math.trunc(r / 60), s = r % 60;
  return s === 0 ? n + String(a) : n + String(a) + e + L(s, 2);
}
function kt(t, e) {
  return t % 60 === 0 ? (t > 0 ? "-" : "+") + L(Math.abs(t) / 60, 2) : We(t, e);
}
function We(t, e = "") {
  const n = t > 0 ? "-" : "+", r = Math.abs(t), a = L(Math.trunc(r / 60), 2), s = L(r % 60, 2);
  return n + a + e + s;
}
const Ot = (t, e) => {
  switch (t) {
    case "P":
      return e.date({ width: "short" });
    case "PP":
      return e.date({ width: "medium" });
    case "PPP":
      return e.date({ width: "long" });
    case "PPPP":
    default:
      return e.date({ width: "full" });
  }
}, Rt = (t, e) => {
  switch (t) {
    case "p":
      return e.time({ width: "short" });
    case "pp":
      return e.time({ width: "medium" });
    case "ppp":
      return e.time({ width: "long" });
    case "pppp":
    default:
      return e.time({ width: "full" });
  }
}, $r = (t, e) => {
  const n = t.match(/(P+)(p+)?/) || [], r = n[1], a = n[2];
  if (!a)
    return Ot(t, e);
  let s;
  switch (r) {
    case "P":
      s = e.dateTime({ width: "short" });
      break;
    case "PP":
      s = e.dateTime({ width: "medium" });
      break;
    case "PPP":
      s = e.dateTime({ width: "long" });
      break;
    case "PPPP":
    default:
      s = e.dateTime({ width: "full" });
      break;
  }
  return s.replace("{{date}}", Ot(r, e)).replace("{{time}}", Rt(a, e));
}, Fr = {
  p: Rt,
  P: $r
}, Br = /^D+$/, jr = /^Y+$/, Ir = ["D", "DD", "YY", "YYYY"];
function Hr(t) {
  return Br.test(t);
}
function Ar(t) {
  return jr.test(t);
}
function qr(t, e, n) {
  const r = zr(t, e, n);
  if (console.warn(r), Ir.includes(t)) throw new RangeError(r);
}
function zr(t, e, n) {
  const r = t[0] === "Y" ? "years" : "days of the month";
  return `Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${e}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`;
}
const Lr = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, Rr = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, Zr = /^'([^]*?)'?$/, Gr = /''/g, Qr = /[a-zA-Z]/;
function Xr(t, e, n) {
  var l, d, w, v, D, W, m, h;
  const r = ze(), a = (n == null ? void 0 : n.locale) ?? r.locale ?? ut, s = (n == null ? void 0 : n.firstWeekContainsDate) ?? ((d = (l = n == null ? void 0 : n.locale) == null ? void 0 : l.options) == null ? void 0 : d.firstWeekContainsDate) ?? r.firstWeekContainsDate ?? ((v = (w = r.locale) == null ? void 0 : w.options) == null ? void 0 : v.firstWeekContainsDate) ?? 1, i = (n == null ? void 0 : n.weekStartsOn) ?? ((W = (D = n == null ? void 0 : n.locale) == null ? void 0 : D.options) == null ? void 0 : W.weekStartsOn) ?? r.weekStartsOn ?? ((h = (m = r.locale) == null ? void 0 : m.options) == null ? void 0 : h.weekStartsOn) ?? 0, o = R(t, n == null ? void 0 : n.in);
  if (!Gn(o))
    throw new RangeError("Invalid time value");
  let u = e.match(Rr).map((k) => {
    const y = k[0];
    if (y === "p" || y === "P") {
      const F = Fr[y];
      return F(k, a.formatLong);
    }
    return k;
  }).join("").match(Lr).map((k) => {
    if (k === "''")
      return { isToken: !1, value: "'" };
    const y = k[0];
    if (y === "'")
      return { isToken: !1, value: Ur(k) };
    if (vt[y])
      return { isToken: !0, value: k };
    if (y.match(Qr))
      throw new RangeError(
        "Format string contains an unescaped latin alphabet character `" + y + "`"
      );
    return { isToken: !1, value: k };
  });
  a.localize.preprocessor && (u = a.localize.preprocessor(o, u));
  const c = {
    firstWeekContainsDate: s,
    weekStartsOn: i,
    locale: a
  };
  return u.map((k) => {
    if (!k.isToken) return k.value;
    const y = k.value;
    (!(n != null && n.useAdditionalWeekYearTokens) && Ar(y) || !(n != null && n.useAdditionalDayOfYearTokens) && Hr(y)) && qr(y, e, String(t));
    const F = vt[y[0]];
    return F(o, y, a.localize, c);
  }).join("");
}
function Ur(t) {
  const e = t.match(Zr);
  return e ? e[1].replace(Gr, "'") : t;
}
function Vr(t, e) {
  const n = R(t, e == null ? void 0 : e.in), r = n.getFullYear(), a = n.getMonth(), s = K(n, 0);
  return s.setFullYear(r, a + 1, 0), s.setHours(0, 0, 0, 0), s.getDate();
}
function Jr(t, e) {
  return R(t, e == null ? void 0 : e.in).getMonth();
}
function Kr(t, e) {
  return R(t, e == null ? void 0 : e.in).getFullYear();
}
function ea(t, e) {
  return +R(t) > +R(e);
}
function ta(t, e) {
  return +R(t) < +R(e);
}
function na(t, e, n) {
  const [r, a] = Te(
    n == null ? void 0 : n.in,
    t,
    e
  );
  return r.getFullYear() === a.getFullYear() && r.getMonth() === a.getMonth();
}
function ra(t, e, n) {
  const [r, a] = Te(
    n == null ? void 0 : n.in,
    t,
    e
  );
  return r.getFullYear() === a.getFullYear();
}
function aa(t, e, n) {
  const r = R(t, n == null ? void 0 : n.in), a = r.getFullYear(), s = r.getDate(), i = K(t, 0);
  i.setFullYear(a, e, 15), i.setHours(0, 0, 0, 0);
  const o = Vr(i);
  return r.setMonth(e, Math.min(s, o)), r;
}
function sa(t, e, n) {
  const r = R(t, n == null ? void 0 : n.in);
  return isNaN(+r) ? K(t, NaN) : (r.setFullYear(e), r);
}
const pt = 5, oa = 4;
function ia(t, e) {
  const n = e.startOfMonth(t), r = n.getDay() > 0 ? n.getDay() : 7, a = e.addDays(t, -r + 1), s = e.addDays(a, pt * 7 - 1);
  return e.getMonth(t) === e.getMonth(s) ? pt : oa;
}
function Zt(t, e) {
  const n = e.startOfMonth(t), r = n.getDay();
  return r === 1 ? n : r === 0 ? e.addDays(n, -6) : e.addDays(n, -1 * (r - 1));
}
function ua(t, e) {
  const n = Zt(t, e), r = ia(t, e);
  return e.addDays(n, r * 7 - 1);
}
class Oe {
  /**
   * Creates an instance of `DateLib`.
   *
   * @param options Configuration options for the date library.
   * @param overrides Custom overrides for the date library functions.
   */
  constructor(e, n) {
    this.Date = Date, this.today = () => {
      var r;
      return (r = this.overrides) != null && r.today ? this.overrides.today() : this.options.timeZone ? ne.tz(this.options.timeZone) : new this.Date();
    }, this.newDate = (r, a, s) => {
      var i;
      return (i = this.overrides) != null && i.newDate ? this.overrides.newDate(r, a, s) : this.options.timeZone ? new ne(r, a, s, this.options.timeZone) : new Date(r, a, s);
    }, this.addDays = (r, a) => {
      var s;
      return (s = this.overrides) != null && s.addDays ? this.overrides.addDays(r, a) : $t(r, a);
    }, this.addMonths = (r, a) => {
      var s;
      return (s = this.overrides) != null && s.addMonths ? this.overrides.addMonths(r, a) : Ft(r, a);
    }, this.addWeeks = (r, a) => {
      var s;
      return (s = this.overrides) != null && s.addWeeks ? this.overrides.addWeeks(r, a) : qn(r, a);
    }, this.addYears = (r, a) => {
      var s;
      return (s = this.overrides) != null && s.addYears ? this.overrides.addYears(r, a) : zn(r, a);
    }, this.differenceInCalendarDays = (r, a) => {
      var s;
      return (s = this.overrides) != null && s.differenceInCalendarDays ? this.overrides.differenceInCalendarDays(r, a) : jt(r, a);
    }, this.differenceInCalendarMonths = (r, a) => {
      var s;
      return (s = this.overrides) != null && s.differenceInCalendarMonths ? this.overrides.differenceInCalendarMonths(r, a) : Qn(r, a);
    }, this.eachMonthOfInterval = (r) => {
      var a;
      return (a = this.overrides) != null && a.eachMonthOfInterval ? this.overrides.eachMonthOfInterval(r) : Vn(r);
    }, this.endOfBroadcastWeek = (r) => {
      var a;
      return (a = this.overrides) != null && a.endOfBroadcastWeek ? this.overrides.endOfBroadcastWeek(r) : ua(r, this);
    }, this.endOfISOWeek = (r) => {
      var a;
      return (a = this.overrides) != null && a.endOfISOWeek ? this.overrides.endOfISOWeek(r) : er(r);
    }, this.endOfMonth = (r) => {
      var a;
      return (a = this.overrides) != null && a.endOfMonth ? this.overrides.endOfMonth(r) : Xn(r);
    }, this.endOfWeek = (r, a) => {
      var s;
      return (s = this.overrides) != null && s.endOfWeek ? this.overrides.endOfWeek(r, a) : At(r, this.options);
    }, this.endOfYear = (r) => {
      var a;
      return (a = this.overrides) != null && a.endOfYear ? this.overrides.endOfYear(r) : Kn(r);
    }, this.format = (r, a, s) => {
      var o;
      const i = (o = this.overrides) != null && o.format ? this.overrides.format(r, a, this.options) : Xr(r, a, this.options);
      return this.options.numerals && this.options.numerals !== "latn" ? this.replaceDigits(i) : i;
    }, this.getISOWeek = (r) => {
      var a;
      return (a = this.overrides) != null && a.getISOWeek ? this.overrides.getISOWeek(r) : qt(r);
    }, this.getMonth = (r, a) => {
      var s;
      return (s = this.overrides) != null && s.getMonth ? this.overrides.getMonth(r, this.options) : Jr(r, this.options);
    }, this.getYear = (r, a) => {
      var s;
      return (s = this.overrides) != null && s.getYear ? this.overrides.getYear(r, this.options) : Kr(r, this.options);
    }, this.getWeek = (r, a) => {
      var s;
      return (s = this.overrides) != null && s.getWeek ? this.overrides.getWeek(r, this.options) : Lt(r, this.options);
    }, this.isAfter = (r, a) => {
      var s;
      return (s = this.overrides) != null && s.isAfter ? this.overrides.isAfter(r, a) : ea(r, a);
    }, this.isBefore = (r, a) => {
      var s;
      return (s = this.overrides) != null && s.isBefore ? this.overrides.isBefore(r, a) : ta(r, a);
    }, this.isDate = (r) => {
      var a;
      return (a = this.overrides) != null && a.isDate ? this.overrides.isDate(r) : It(r);
    }, this.isSameDay = (r, a) => {
      var s;
      return (s = this.overrides) != null && s.isSameDay ? this.overrides.isSameDay(r, a) : Zn(r, a);
    }, this.isSameMonth = (r, a) => {
      var s;
      return (s = this.overrides) != null && s.isSameMonth ? this.overrides.isSameMonth(r, a) : na(r, a);
    }, this.isSameYear = (r, a) => {
      var s;
      return (s = this.overrides) != null && s.isSameYear ? this.overrides.isSameYear(r, a) : ra(r, a);
    }, this.max = (r) => {
      var a;
      return (a = this.overrides) != null && a.max ? this.overrides.max(r) : Ln(r);
    }, this.min = (r) => {
      var a;
      return (a = this.overrides) != null && a.min ? this.overrides.min(r) : Rn(r);
    }, this.setMonth = (r, a) => {
      var s;
      return (s = this.overrides) != null && s.setMonth ? this.overrides.setMonth(r, a) : aa(r, a);
    }, this.setYear = (r, a) => {
      var s;
      return (s = this.overrides) != null && s.setYear ? this.overrides.setYear(r, a) : sa(r, a);
    }, this.startOfBroadcastWeek = (r, a) => {
      var s;
      return (s = this.overrides) != null && s.startOfBroadcastWeek ? this.overrides.startOfBroadcastWeek(r, this) : Zt(r, this);
    }, this.startOfDay = (r) => {
      var a;
      return (a = this.overrides) != null && a.startOfDay ? this.overrides.startOfDay(r) : qe(r);
    }, this.startOfISOWeek = (r) => {
      var a;
      return (a = this.overrides) != null && a.startOfISOWeek ? this.overrides.startOfISOWeek(r) : Ae(r);
    }, this.startOfMonth = (r) => {
      var a;
      return (a = this.overrides) != null && a.startOfMonth ? this.overrides.startOfMonth(r) : Jn(r);
    }, this.startOfWeek = (r, a) => {
      var s;
      return (s = this.overrides) != null && s.startOfWeek ? this.overrides.startOfWeek(r, this.options) : _e(r, this.options);
    }, this.startOfYear = (r) => {
      var a;
      return (a = this.overrides) != null && a.startOfYear ? this.overrides.startOfYear(r) : Ht(r);
    }, this.options = { locale: ut, ...e }, this.overrides = n;
  }
  /**
   * Generates a mapping of Arabic digits (0-9) to the target numbering system
   * digits.
   *
   * @since 9.5.0
   * @returns A record mapping Arabic digits to the target numerals.
   */
  getDigitMap() {
    const { numerals: e = "latn" } = this.options, n = new Intl.NumberFormat("en-US", {
      numberingSystem: e
    }), r = {};
    for (let a = 0; a < 10; a++)
      r[a.toString()] = n.format(a);
    return r;
  }
  /**
   * Replaces Arabic digits in a string with the target numbering system digits.
   *
   * @since 9.5.0
   * @param input The string containing Arabic digits.
   * @returns The string with digits replaced.
   */
  replaceDigits(e) {
    const n = this.getDigitMap();
    return e.replace(/\d/g, (r) => n[r] || r);
  }
  /**
   * Formats a number using the configured numbering system.
   *
   * @since 9.5.0
   * @param value The number to format.
   * @returns The formatted number as a string.
   */
  formatNumber(e) {
    return this.replaceDigits(e.toString());
  }
}
const Me = new Oe();
class Gt {
  constructor(e, n, r = Me) {
    this.date = e, this.displayMonth = n, this.outside = !!(n && !r.isSameMonth(e, n)), this.dateLib = r;
  }
  /**
   * Checks if this day is equal to another `CalendarDay`, considering both the
   * date and the displayed month.
   *
   * @param day The `CalendarDay` to compare with.
   * @returns `true` if the days are equal, otherwise `false`.
   */
  isEqualTo(e) {
    return this.dateLib.isSameDay(e.date, this.date) && this.dateLib.isSameMonth(e.displayMonth, this.displayMonth);
  }
}
class ca {
  constructor(e, n) {
    this.date = e, this.weeks = n;
  }
}
class da {
  constructor(e, n) {
    this.days = n, this.weekNumber = e;
  }
}
function De(t, e, n = !1, r = Me) {
  let { from: a, to: s } = t;
  const { differenceInCalendarDays: i, isSameDay: o } = r;
  return a && s ? (i(s, a) < 0 && ([a, s] = [s, a]), i(e, a) >= (n ? 1 : 0) && i(s, e) >= (n ? 1 : 0)) : !n && s ? o(s, e) : !n && a ? o(a, e) : !1;
}
function Qt(t) {
  return !!(t && typeof t == "object" && "before" in t && "after" in t);
}
function ct(t) {
  return !!(t && typeof t == "object" && "from" in t);
}
function Xt(t) {
  return !!(t && typeof t == "object" && "after" in t);
}
function Ut(t) {
  return !!(t && typeof t == "object" && "before" in t);
}
function Vt(t) {
  return !!(t && typeof t == "object" && "dayOfWeek" in t);
}
function Jt(t, e) {
  return Array.isArray(t) && t.every(e.isDate);
}
function ke(t, e, n = Me) {
  const r = Array.isArray(e) ? e : [e], { isSameDay: a, differenceInCalendarDays: s, isAfter: i } = n;
  return r.some((o) => {
    if (typeof o == "boolean")
      return o;
    if (n.isDate(o))
      return a(t, o);
    if (Jt(o, n))
      return o.includes(t);
    if (ct(o))
      return De(o, t, !1, n);
    if (Vt(o))
      return Array.isArray(o.dayOfWeek) ? o.dayOfWeek.includes(t.getDay()) : o.dayOfWeek === t.getDay();
    if (Qt(o)) {
      const u = s(o.before, t), c = s(o.after, t), l = u > 0, d = c < 0;
      return i(o.before, o.after) ? d && l : l || d;
    }
    return Xt(o) ? s(t, o.after) > 0 : Ut(o) ? s(o.before, t) > 0 : typeof o == "function" ? o(t) : !1;
  });
}
function fa(t, e, n, r, a) {
  const { disabled: s, hidden: i, modifiers: o, showOutsideDays: u, broadcastCalendar: c, today: l } = e, { isSameDay: d, isSameMonth: w, startOfMonth: v, isBefore: D, endOfMonth: W, isAfter: m } = a, h = n && v(n), k = r && W(r), y = {
    [X.focused]: [],
    [X.outside]: [],
    [X.disabled]: [],
    [X.hidden]: [],
    [X.today]: []
  }, F = {};
  for (const f of t) {
    const { date: Y, displayMonth: T } = f, P = !!(T && !w(Y, T)), I = !!(h && D(Y, h)), $ = !!(k && m(Y, k)), _ = !!(s && ke(Y, s, a)), Z = !!(i && ke(Y, i, a)) || I || $ || // Broadcast calendar will show outside days as default
    !c && !u && P || c && u === !1 && P, U = d(Y, l ?? a.today());
    P && y.outside.push(f), _ && y.disabled.push(f), Z && y.hidden.push(f), U && y.today.push(f), o && Object.keys(o).forEach((S) => {
      const b = o == null ? void 0 : o[S];
      b && ke(Y, b, a) && (F[S] ? F[S].push(f) : F[S] = [f]);
    });
  }
  return (f) => {
    const Y = {
      [X.focused]: !1,
      [X.disabled]: !1,
      [X.hidden]: !1,
      [X.outside]: !1,
      [X.today]: !1
    }, T = {};
    for (const P in y) {
      const I = y[P];
      Y[P] = I.some(($) => $ === f);
    }
    for (const P in F)
      T[P] = F[P].some((I) => I === f);
    return {
      ...Y,
      // custom modifiers should override all the previous ones
      ...T
    };
  };
}
function la(t, e, n = {}) {
  return Object.entries(t).filter(([, a]) => a === !0).reduce((a, [s]) => (n[s] ? a.push(n[s]) : e[X[s]] ? a.push(e[X[s]]) : e[fe[s]] && a.push(e[fe[s]]), a), [e[C.Day]]);
}
function ha(t) {
  return O.createElement("button", { ...t });
}
function ma(t) {
  return O.createElement("span", { ...t });
}
function ya(t) {
  const { size: e = 24, orientation: n = "left", className: r } = t;
  return O.createElement(
    "svg",
    { className: r, width: e, height: e, viewBox: "0 0 24 24" },
    n === "up" && O.createElement("polygon", { points: "6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28" }),
    n === "down" && O.createElement("polygon", { points: "6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72" }),
    n === "left" && O.createElement("polygon", { points: "16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20" }),
    n === "right" && O.createElement("polygon", { points: "8 18.112 14.18888889 12 8 5.87733333 9.91111111 4 18 12 9.91111111 20" })
  );
}
function ga(t) {
  const { day: e, modifiers: n, ...r } = t;
  return O.createElement("td", { ...r });
}
function Kt(t) {
  const { day: e, modifiers: n, ...r } = t, a = O.useRef(null);
  return O.useEffect(() => {
    var s;
    n.focused && ((s = a.current) == null || s.focus());
  }, [n.focused]), O.createElement("button", { ref: a, ...r });
}
function wa(t) {
  const { options: e, className: n, components: r, classNames: a, ...s } = t, i = [a[C.Dropdown], n].join(" "), o = e == null ? void 0 : e.find(({ value: u }) => u === s.value);
  return O.createElement(
    "span",
    { "data-disabled": s.disabled, className: a[C.DropdownRoot] },
    O.createElement(r.Select, { className: i, ...s }, e == null ? void 0 : e.map(({ value: u, label: c, disabled: l }) => O.createElement(r.Option, { key: u, value: u, disabled: l }, c))),
    O.createElement(
      "span",
      { className: a[C.CaptionLabel], "aria-hidden": !0 },
      o == null ? void 0 : o.label,
      O.createElement(r.Chevron, { orientation: "down", size: 18, className: a[C.Chevron] })
    )
  );
}
function Ma(t) {
  return O.createElement("div", { ...t });
}
function ba(t) {
  return O.createElement("div", { ...t });
}
function va(t) {
  const { calendarMonth: e, displayIndex: n, ...r } = t;
  return O.createElement("div", { ...r }, t.children);
}
function Da(t) {
  const { calendarMonth: e, displayIndex: n, ...r } = t;
  return O.createElement("div", { ...r });
}
function ka(t) {
  return O.createElement("table", { ...t });
}
function Oa(t) {
  return O.createElement("div", { ...t });
}
const en = pn(void 0);
function Le() {
  const t = xn(en);
  if (t === void 0)
    throw new Error("useDayPicker() must be used within a custom component.");
  return t;
}
function pa(t) {
  const { components: e } = Le();
  return O.createElement(e.Dropdown, { ...t });
}
function xa(t) {
  const { onPreviousClick: e, onNextClick: n, previousMonth: r, nextMonth: a, ...s } = t, { components: i, classNames: o, labels: { labelPrevious: u, labelNext: c } } = Le(), l = V((w) => {
    a && (n == null || n(w));
  }, [a, n]), d = V((w) => {
    r && (e == null || e(w));
  }, [r, e]);
  return O.createElement(
    "nav",
    { ...s },
    O.createElement(
      i.PreviousMonthButton,
      { type: "button", className: o[C.PreviousMonthButton], tabIndex: r ? void 0 : -1, "aria-disabled": r ? void 0 : !0, "aria-label": u(r), onClick: d },
      O.createElement(i.Chevron, { disabled: r ? void 0 : !0, className: o[C.Chevron], orientation: "left" })
    ),
    O.createElement(
      i.NextMonthButton,
      { type: "button", className: o[C.NextMonthButton], tabIndex: a ? void 0 : -1, "aria-disabled": a ? void 0 : !0, "aria-label": c(a), onClick: l },
      O.createElement(i.Chevron, { disabled: a ? void 0 : !0, orientation: "right", className: o[C.Chevron] })
    )
  );
}
function Sa(t) {
  const { components: e } = Le();
  return O.createElement(e.Button, { ...t });
}
function Wa(t) {
  return O.createElement("option", { ...t });
}
function Na(t) {
  const { components: e } = Le();
  return O.createElement(e.Button, { ...t });
}
function Ca(t) {
  const { rootRef: e, ...n } = t;
  return O.createElement("div", { ...n, ref: e });
}
function Ya(t) {
  return O.createElement("select", { ...t });
}
function _a(t) {
  const { week: e, ...n } = t;
  return O.createElement("tr", { ...n });
}
function tn(t) {
  return O.createElement("th", { ...t });
}
function Ta(t) {
  return O.createElement(
    "thead",
    { "aria-hidden": !0 },
    O.createElement("tr", { ...t })
  );
}
function Pa(t) {
  const { week: e, ...n } = t;
  return O.createElement("th", { ...n });
}
function Ea(t) {
  return O.createElement("th", { ...t });
}
function $a(t) {
  return O.createElement("tbody", { ...t });
}
function Fa(t) {
  const { components: e } = Le();
  return O.createElement(e.Dropdown, { ...t });
}
const Ba = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  Button: ha,
  CaptionLabel: ma,
  Chevron: ya,
  Day: ga,
  DayButton: Kt,
  Dropdown: wa,
  DropdownNav: Ma,
  Footer: ba,
  Month: va,
  MonthCaption: Da,
  MonthGrid: ka,
  Months: Oa,
  MonthsDropdown: pa,
  Nav: xa,
  NextMonthButton: Sa,
  Option: Wa,
  PreviousMonthButton: Na,
  Root: Ca,
  Select: Ya,
  Week: _a,
  WeekNumber: Pa,
  WeekNumberHeader: Ea,
  Weekday: tn,
  Weekdays: Ta,
  Weeks: $a,
  YearsDropdown: Fa
}, Symbol.toStringTag, { value: "Module" }));
function ja(t) {
  return {
    ...Ba,
    ...t
  };
}
function Ia(t) {
  const e = {
    "data-mode": t.mode ?? void 0,
    "data-required": "required" in t ? t.required : void 0,
    "data-multiple-months": t.numberOfMonths && t.numberOfMonths > 1 || void 0,
    "data-week-numbers": t.showWeekNumber || void 0,
    "data-broadcast-calendar": t.broadcastCalendar || void 0,
    "data-nav-layout": t.navLayout || void 0
  };
  return Object.entries(t).forEach(([n, r]) => {
    n.startsWith("data-") && (e[n] = r);
  }), e;
}
function Ha() {
  const t = {};
  for (const e in C)
    t[C[e]] = `rdp-${C[e]}`;
  for (const e in X)
    t[X[e]] = `rdp-${X[e]}`;
  for (const e in fe)
    t[fe[e]] = `rdp-${fe[e]}`;
  for (const e in ie)
    t[ie[e]] = `rdp-${ie[e]}`;
  return t;
}
function nn(t, e, n) {
  return (n ?? new Oe(e)).format(t, "LLLL y");
}
const Aa = nn;
function qa(t, e, n) {
  return (n ?? new Oe(e)).format(t, "d");
}
function za(t, e = Me) {
  return e.format(t, "LLLL");
}
function La(t, e = Me) {
  return t < 10 ? e.formatNumber(`0${t.toLocaleString()}`) : e.formatNumber(`${t.toLocaleString()}`);
}
function Ra() {
  return "";
}
function Za(t, e, n) {
  return (n ?? new Oe(e)).format(t, "cccccc");
}
function rn(t, e = Me) {
  return e.format(t, "yyyy");
}
const Ga = rn, Qa = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  formatCaption: nn,
  formatDay: qa,
  formatMonthCaption: Aa,
  formatMonthDropdown: za,
  formatWeekNumber: La,
  formatWeekNumberHeader: Ra,
  formatWeekdayName: Za,
  formatYearCaption: Ga,
  formatYearDropdown: rn
}, Symbol.toStringTag, { value: "Module" }));
function Xa(t) {
  return t != null && t.formatMonthCaption && !t.formatCaption && (t.formatCaption = t.formatMonthCaption), t != null && t.formatYearCaption && !t.formatYearDropdown && (t.formatYearDropdown = t.formatYearCaption), {
    ...Qa,
    ...t
  };
}
function Ua(t, e, n, r, a) {
  const { startOfMonth: s, startOfYear: i, endOfYear: o, eachMonthOfInterval: u, getMonth: c } = a;
  return u({
    start: i(t),
    end: o(t)
  }).map((w) => {
    const v = r.formatMonthDropdown(w, a), D = c(w), W = e && w < s(e) || n && w > s(n) || !1;
    return { value: D, label: v, disabled: W };
  });
}
function Va(t, e = {}, n = {}) {
  let r = { ...e == null ? void 0 : e[C.Day] };
  return Object.entries(t).filter(([, a]) => a === !0).forEach(([a]) => {
    r = {
      ...r,
      ...n == null ? void 0 : n[a]
    };
  }), r;
}
function Ja(t, e, n) {
  const r = t.today(), a = e ? t.startOfISOWeek(r) : t.startOfWeek(r), s = [];
  for (let i = 0; i < 7; i++) {
    const o = t.addDays(a, i);
    s.push(o);
  }
  return s;
}
function Ka(t, e, n, r) {
  if (!t || !e)
    return;
  const { startOfYear: a, endOfYear: s, addYears: i, getYear: o, isBefore: u, isSameYear: c } = r, l = a(t), d = s(e), w = [];
  let v = l;
  for (; u(v, d) || c(v, d); )
    w.push(v), v = i(v, 1);
  return w.map((D) => {
    const W = n.formatYearDropdown(D, r);
    return {
      value: o(D),
      label: W,
      disabled: !1
    };
  });
}
function an(t, e, n) {
  return (n ?? new Oe(e)).format(t, "LLLL y");
}
const es = an;
function ts(t, e, n, r) {
  let a = (r ?? new Oe(n)).format(t, "PPPP");
  return e != null && e.today && (a = `Today, ${a}`), a;
}
function sn(t, e, n, r) {
  let a = (r ?? new Oe(n)).format(t, "PPPP");
  return e.today && (a = `Today, ${a}`), e.selected && (a = `${a}, selected`), a;
}
const ns = sn;
function rs() {
  return "";
}
function as(t) {
  return "Choose the Month";
}
function ss(t) {
  return "Go to the Next Month";
}
function os(t) {
  return "Go to the Previous Month";
}
function is(t, e, n) {
  return (n ?? new Oe(e)).format(t, "cccc");
}
function us(t, e) {
  return `Week ${t}`;
}
function cs(t) {
  return "Week Number";
}
function ds(t) {
  return "Choose the Year";
}
const fs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  labelCaption: es,
  labelDay: ns,
  labelDayButton: sn,
  labelGrid: an,
  labelGridcell: ts,
  labelMonthDropdown: as,
  labelNav: rs,
  labelNext: ss,
  labelPrevious: os,
  labelWeekNumber: us,
  labelWeekNumberHeader: cs,
  labelWeekday: is,
  labelYearDropdown: ds
}, Symbol.toStringTag, { value: "Module" })), Re = (t) => t instanceof HTMLElement ? t : null, rt = (t) => [
  ...t.querySelectorAll("[data-animated-month]") ?? []
], ls = (t) => Re(t.querySelector("[data-animated-month]")), at = (t) => Re(t.querySelector("[data-animated-caption]")), st = (t) => Re(t.querySelector("[data-animated-weeks]")), hs = (t) => Re(t.querySelector("[data-animated-nav]")), ms = (t) => Re(t.querySelector("[data-animated-weekdays]"));
function ys(t, e, { classNames: n, months: r, focused: a, dateLib: s }) {
  const i = Ge(null), o = Ge(r), u = Ge(!1);
  Sn(() => {
    const c = o.current;
    if (o.current = r, !e || !t.current || // safety check because the ref can be set to anything by consumers
    !(t.current instanceof HTMLElement) || // validation required for the animation to work as expected
    r.length === 0 || c.length === 0 || r.length !== c.length)
      return;
    const l = s.isSameMonth(r[0].date, c[0].date), d = s.isAfter(r[0].date, c[0].date), w = d ? n[ie.caption_after_enter] : n[ie.caption_before_enter], v = d ? n[ie.weeks_after_enter] : n[ie.weeks_before_enter], D = i.current, W = t.current.cloneNode(!0);
    if (W instanceof HTMLElement ? (rt(W).forEach((y) => {
      if (!(y instanceof HTMLElement))
        return;
      const F = ls(y);
      F && y.contains(F) && y.removeChild(F);
      const f = at(y);
      f && f.classList.remove(w);
      const Y = st(y);
      Y && Y.classList.remove(v);
    }), i.current = W) : i.current = null, u.current || l || // skip animation if a day is focused because it can cause issues to the animation and is better for a11y
    a)
      return;
    const m = D instanceof HTMLElement ? rt(D) : [], h = rt(t.current);
    if (h && h.every((k) => k instanceof HTMLElement) && m && m.every((k) => k instanceof HTMLElement)) {
      u.current = !0, t.current.style.isolation = "isolate";
      const k = hs(t.current);
      k && (k.style.zIndex = "1"), h.forEach((y, F) => {
        const f = m[F];
        if (!f)
          return;
        y.style.position = "relative", y.style.overflow = "hidden";
        const Y = at(y);
        Y && Y.classList.add(w);
        const T = st(y);
        T && T.classList.add(v);
        const P = () => {
          u.current = !1, t.current && (t.current.style.isolation = ""), k && (k.style.zIndex = ""), Y && Y.classList.remove(w), T && T.classList.remove(v), y.style.position = "", y.style.overflow = "", y.contains(f) && y.removeChild(f);
        };
        f.style.pointerEvents = "none", f.style.position = "absolute", f.style.overflow = "hidden", f.setAttribute("aria-hidden", "true");
        const I = ms(f);
        I && (I.style.opacity = "0");
        const $ = at(f);
        $ && ($.classList.add(d ? n[ie.caption_before_exit] : n[ie.caption_after_exit]), $.addEventListener("animationend", P));
        const _ = st(f);
        _ && _.classList.add(d ? n[ie.weeks_before_exit] : n[ie.weeks_after_exit]), y.insertBefore(f, y.firstChild);
      });
    }
  });
}
function gs(t, e, n, r) {
  const a = t[0], s = t[t.length - 1], { ISOWeek: i, fixedWeeks: o, broadcastCalendar: u } = n ?? {}, { addDays: c, differenceInCalendarDays: l, differenceInCalendarMonths: d, endOfBroadcastWeek: w, endOfISOWeek: v, endOfMonth: D, endOfWeek: W, isAfter: m, startOfBroadcastWeek: h, startOfISOWeek: k, startOfWeek: y } = r, F = u ? h(a, r) : i ? k(a) : y(a), f = u ? w(s) : i ? v(D(s)) : W(D(s)), Y = l(f, F), T = d(s, a) + 1, P = [];
  for (let _ = 0; _ <= Y; _++) {
    const Z = c(F, _);
    if (e && m(Z, e))
      break;
    P.push(Z);
  }
  const $ = (u ? 35 : 42) * T;
  if (o && P.length < $) {
    const _ = $ - P.length;
    for (let Z = 0; Z < _; Z++) {
      const U = c(P[P.length - 1], 1);
      P.push(U);
    }
  }
  return P;
}
function ws(t) {
  const e = [];
  return t.reduce((n, r) => {
    const a = r.weeks.reduce((s, i) => [...s, ...i.days], e);
    return [...n, ...a];
  }, e);
}
function Ms(t, e, n, r) {
  const { numberOfMonths: a = 1 } = n, s = [];
  for (let i = 0; i < a; i++) {
    const o = r.addMonths(t, i);
    if (e && o > e)
      break;
    s.push(o);
  }
  return s;
}
function xt(t, e, n, r) {
  const { month: a, defaultMonth: s, today: i = r.today(), numberOfMonths: o = 1 } = t;
  let u = a || s || i;
  const { differenceInCalendarMonths: c, addMonths: l, startOfMonth: d } = r;
  if (n && c(n, u) < o - 1) {
    const w = -1 * (o - 1);
    u = l(n, w);
  }
  return e && c(u, e) < 0 && (u = e), d(u);
}
function bs(t, e, n, r) {
  const { addDays: a, endOfBroadcastWeek: s, endOfISOWeek: i, endOfMonth: o, endOfWeek: u, getISOWeek: c, getWeek: l, startOfBroadcastWeek: d, startOfISOWeek: w, startOfWeek: v } = r, D = t.reduce((W, m) => {
    const h = n.broadcastCalendar ? d(m, r) : n.ISOWeek ? w(m) : v(m), k = n.broadcastCalendar ? s(m) : n.ISOWeek ? i(o(m)) : u(o(m)), y = e.filter((T) => T >= h && T <= k), F = n.broadcastCalendar ? 35 : 42;
    if (n.fixedWeeks && y.length < F) {
      const T = e.filter((P) => {
        const I = F - y.length;
        return P > k && P <= a(k, I);
      });
      y.push(...T);
    }
    const f = y.reduce((T, P) => {
      const I = n.ISOWeek ? c(P) : l(P), $ = T.find((Z) => Z.weekNumber === I), _ = new Gt(P, m, r);
      return $ ? $.days.push(_) : T.push(new da(I, [_])), T;
    }, []), Y = new ca(m, f);
    return W.push(Y), W;
  }, []);
  return n.reverseMonths ? D.reverse() : D;
}
function vs(t, e) {
  let { startMonth: n, endMonth: r } = t;
  const { startOfYear: a, startOfDay: s, startOfMonth: i, endOfMonth: o, addYears: u, endOfYear: c, newDate: l, today: d } = e, { fromYear: w, toYear: v, fromMonth: D, toMonth: W } = t;
  !n && D && (n = D), !n && w && (n = e.newDate(w, 0, 1)), !r && W && (r = W), !r && v && (r = l(v, 11, 31));
  const m = t.captionLayout === "dropdown" || t.captionLayout === "dropdown-years";
  return n ? n = i(n) : w ? n = l(w, 0, 1) : !n && m && (n = a(u(t.today ?? d(), -100))), r ? r = o(r) : v ? r = l(v, 11, 31) : !r && m && (r = c(t.today ?? d())), [
    n && s(n),
    r && s(r)
  ];
}
function Ds(t, e, n, r) {
  if (n.disableNavigation)
    return;
  const { pagedNavigation: a, numberOfMonths: s = 1 } = n, { startOfMonth: i, addMonths: o, differenceInCalendarMonths: u } = r, c = a ? s : 1, l = i(t);
  if (!e)
    return o(l, c);
  if (!(u(e, t) < s))
    return o(l, c);
}
function ks(t, e, n, r) {
  if (n.disableNavigation)
    return;
  const { pagedNavigation: a, numberOfMonths: s } = n, { startOfMonth: i, addMonths: o, differenceInCalendarMonths: u } = r, c = a ? s ?? 1 : 1, l = i(t);
  if (!e)
    return o(l, -c);
  if (!(u(l, e) <= 0))
    return o(l, -c);
}
function Os(t) {
  const e = [];
  return t.reduce((n, r) => [...n, ...r.weeks], e);
}
function Ue(t, e) {
  const [n, r] = ge(t);
  return [e === void 0 ? n : e, r];
}
function ps(t, e) {
  const [n, r] = vs(t, e), { startOfMonth: a, endOfMonth: s } = e, i = xt(t, n, r, e), [o, u] = Ue(
    i,
    // initialMonth is always computed from props.month if provided
    t.month ? i : void 0
  );
  it(() => {
    const Y = xt(t, n, r, e);
    u(Y);
  }, [t.timeZone]);
  const c = Ms(o, r, t, e), l = gs(c, t.endMonth ? s(t.endMonth) : void 0, t, e), d = bs(c, l, t, e), w = Os(d), v = ws(d), D = ks(o, n, t, e), W = Ds(o, r, t, e), { disableNavigation: m, onMonthChange: h } = t, k = (Y) => w.some((T) => T.days.some((P) => P.isEqualTo(Y))), y = (Y) => {
    if (m)
      return;
    let T = a(Y);
    n && T < a(n) && (T = a(n)), r && T > a(r) && (T = a(r)), u(T), h == null || h(T);
  };
  return {
    months: d,
    weeks: w,
    days: v,
    navStart: n,
    navEnd: r,
    previousMonth: D,
    nextMonth: W,
    goToMonth: y,
    goToDay: (Y) => {
      k(Y) || y(Y.date);
    }
  };
}
var ye;
(function(t) {
  t[t.Today = 0] = "Today", t[t.Selected = 1] = "Selected", t[t.LastFocused = 2] = "LastFocused", t[t.FocusedModifier = 3] = "FocusedModifier";
})(ye || (ye = {}));
function St(t) {
  return !t[X.disabled] && !t[X.hidden] && !t[X.outside];
}
function xs(t, e, n, r) {
  let a, s = -1;
  for (const i of t) {
    const o = e(i);
    St(o) && (o[X.focused] && s < ye.FocusedModifier ? (a = i, s = ye.FocusedModifier) : r != null && r.isEqualTo(i) && s < ye.LastFocused ? (a = i, s = ye.LastFocused) : n(i.date) && s < ye.Selected ? (a = i, s = ye.Selected) : o[X.today] && s < ye.Today && (a = i, s = ye.Today));
  }
  return a || (a = t.find((i) => St(e(i)))), a;
}
function Ss(t, e, n, r, a, s, i) {
  const { ISOWeek: o, broadcastCalendar: u } = s, { addDays: c, addMonths: l, addWeeks: d, addYears: w, endOfBroadcastWeek: v, endOfISOWeek: D, endOfWeek: W, max: m, min: h, startOfBroadcastWeek: k, startOfISOWeek: y, startOfWeek: F } = i;
  let Y = {
    day: c,
    week: d,
    month: l,
    year: w,
    startOfWeek: (T) => u ? k(T, i) : o ? y(T) : F(T),
    endOfWeek: (T) => u ? v(T) : o ? D(T) : W(T)
  }[t](n, e === "after" ? 1 : -1);
  return e === "before" && r ? Y = m([r, Y]) : e === "after" && a && (Y = h([a, Y])), Y;
}
function on(t, e, n, r, a, s, i, o = 0) {
  if (o > 365)
    return;
  const u = Ss(t, e, n.date, r, a, s, i), c = !!(s.disabled && ke(u, s.disabled, i)), l = !!(s.hidden && ke(u, s.hidden, i)), d = u, w = new Gt(u, d, i);
  return !c && !l ? w : on(t, e, w, r, a, s, i, o + 1);
}
function Ws(t, e, n, r, a) {
  const { autoFocus: s } = t, [i, o] = ge(), u = xs(e.days, n, r || (() => !1), i), [c, l] = ge(s ? u : void 0);
  return {
    isFocusTarget: (W) => !!(u != null && u.isEqualTo(W)),
    setFocused: l,
    focused: c,
    blur: () => {
      o(c), l(void 0);
    },
    moveFocus: (W, m) => {
      if (!c)
        return;
      const h = on(W, m, c, e.navStart, e.navEnd, t, a);
      h && (e.goToDay(h), l(h));
    }
  };
}
function Ns(t, e) {
  const { selected: n, required: r, onSelect: a } = t, [s, i] = Ue(n, a ? n : void 0), o = a ? n : s, { isSameDay: u } = e, c = (v) => (o == null ? void 0 : o.some((D) => u(D, v))) ?? !1, { min: l, max: d } = t;
  return {
    selected: o,
    select: (v, D, W) => {
      let m = [...o ?? []];
      if (c(v)) {
        if ((o == null ? void 0 : o.length) === l || r && (o == null ? void 0 : o.length) === 1)
          return;
        m = o == null ? void 0 : o.filter((h) => !u(h, v));
      } else
        (o == null ? void 0 : o.length) === d ? m = [v] : m = [...m, v];
      return a || i(m), a == null || a(m, v, D, W), m;
    },
    isSelected: c
  };
}
function Cs(t, e, n = 0, r = 0, a = !1, s = Me) {
  const { from: i, to: o } = e || {}, { isSameDay: u, isAfter: c, isBefore: l } = s;
  let d;
  if (!i && !o)
    d = { from: t, to: n > 0 ? void 0 : t };
  else if (i && !o)
    u(i, t) ? a ? d = { from: i, to: void 0 } : d = void 0 : l(t, i) ? d = { from: t, to: i } : d = { from: i, to: t };
  else if (i && o)
    if (u(i, t) && u(o, t))
      a ? d = { from: i, to: o } : d = void 0;
    else if (u(i, t))
      d = { from: i, to: n > 0 ? void 0 : t };
    else if (u(o, t))
      d = { from: t, to: n > 0 ? void 0 : t };
    else if (l(t, i))
      d = { from: t, to: o };
    else if (c(t, i))
      d = { from: i, to: t };
    else if (c(t, o))
      d = { from: i, to: t };
    else
      throw new Error("Invalid range");
  if (d != null && d.from && (d != null && d.to)) {
    const w = s.differenceInCalendarDays(d.to, d.from);
    r > 0 && w > r ? d = { from: t, to: void 0 } : n > 1 && w < n && (d = { from: t, to: void 0 });
  }
  return d;
}
function Ys(t, e, n = Me) {
  const r = Array.isArray(e) ? e : [e];
  let a = t.from;
  const s = n.differenceInCalendarDays(t.to, t.from), i = Math.min(s, 6);
  for (let o = 0; o <= i; o++) {
    if (r.includes(a.getDay()))
      return !0;
    a = n.addDays(a, 1);
  }
  return !1;
}
function Wt(t, e, n = Me) {
  return De(t, e.from, !1, n) || De(t, e.to, !1, n) || De(e, t.from, !1, n) || De(e, t.to, !1, n);
}
function _s(t, e, n = Me) {
  const r = Array.isArray(e) ? e : [e];
  if (r.filter((o) => typeof o != "function").some((o) => typeof o == "boolean" ? o : n.isDate(o) ? De(t, o, !1, n) : Jt(o, n) ? o.some((u) => De(t, u, !1, n)) : ct(o) ? o.from && o.to ? Wt(t, { from: o.from, to: o.to }, n) : !1 : Vt(o) ? Ys(t, o.dayOfWeek, n) : Qt(o) ? n.isAfter(o.before, o.after) ? Wt(t, {
    from: n.addDays(o.after, 1),
    to: n.addDays(o.before, -1)
  }, n) : ke(t.from, o, n) || ke(t.to, o, n) : Xt(o) || Ut(o) ? ke(t.from, o, n) || ke(t.to, o, n) : !1))
    return !0;
  const i = r.filter((o) => typeof o == "function");
  if (i.length) {
    let o = t.from;
    const u = n.differenceInCalendarDays(t.to, t.from);
    for (let c = 0; c <= u; c++) {
      if (i.some((l) => l(o)))
        return !0;
      o = n.addDays(o, 1);
    }
  }
  return !1;
}
function Ts(t, e) {
  const { disabled: n, excludeDisabled: r, selected: a, required: s, onSelect: i } = t, [o, u] = Ue(a, i ? a : void 0), c = i ? a : o;
  return {
    selected: c,
    select: (w, v, D) => {
      const { min: W, max: m } = t, h = w ? Cs(w, c, W, m, s, e) : void 0;
      return r && n && (h != null && h.from) && h.to && _s({ from: h.from, to: h.to }, n, e) && (h.from = w, h.to = void 0), i || u(h), i == null || i(h, w, v, D), h;
    },
    isSelected: (w) => c && De(c, w, !1, e)
  };
}
function Ps(t, e) {
  const { selected: n, required: r, onSelect: a } = t, [s, i] = Ue(n, a ? n : void 0), o = a ? n : s, { isSameDay: u } = e;
  return {
    selected: o,
    select: (d, w, v) => {
      let D = d;
      return !r && o && o && u(d, o) && (D = void 0), a || i(D), a == null || a(D, d, w, v), D;
    },
    isSelected: (d) => o ? u(o, d) : !1
  };
}
function Es(t, e) {
  const n = Ps(t, e), r = Ns(t, e), a = Ts(t, e);
  switch (t.mode) {
    case "single":
      return n;
    case "multiple":
      return r;
    case "range":
      return a;
    default:
      return;
  }
}
function $s(t) {
  var ht;
  let e = t;
  e.timeZone && (e = {
    ...t
  }, e.today && (e.today = new ne(e.today, e.timeZone)), e.month && (e.month = new ne(e.month, e.timeZone)), e.defaultMonth && (e.defaultMonth = new ne(e.defaultMonth, e.timeZone)), e.startMonth && (e.startMonth = new ne(e.startMonth, e.timeZone)), e.endMonth && (e.endMonth = new ne(e.endMonth, e.timeZone)), e.mode === "single" && e.selected ? e.selected = new ne(e.selected, e.timeZone) : e.mode === "multiple" && e.selected ? e.selected = (ht = e.selected) == null ? void 0 : ht.map((j) => new ne(j, e.timeZone)) : e.mode === "range" && e.selected && (e.selected = {
    from: e.selected.from ? new ne(e.selected.from, e.timeZone) : void 0,
    to: e.selected.to ? new ne(e.selected.to, e.timeZone) : void 0
  }));
  const { components: n, formatters: r, labels: a, dateLib: s, locale: i, classNames: o } = Ye(() => {
    const j = { ...ut, ...e.locale };
    return {
      dateLib: new Oe({
        locale: j,
        weekStartsOn: e.broadcastCalendar ? 1 : e.weekStartsOn,
        firstWeekContainsDate: e.firstWeekContainsDate,
        useAdditionalWeekYearTokens: e.useAdditionalWeekYearTokens,
        useAdditionalDayOfYearTokens: e.useAdditionalDayOfYearTokens,
        timeZone: e.timeZone,
        numerals: e.numerals
      }, e.dateLib),
      components: ja(e.components),
      formatters: Xa(e.formatters),
      labels: { ...fs, ...e.labels },
      locale: j,
      classNames: { ...Ha(), ...e.classNames }
    };
  }, [
    e.locale,
    e.broadcastCalendar,
    e.weekStartsOn,
    e.firstWeekContainsDate,
    e.useAdditionalWeekYearTokens,
    e.useAdditionalDayOfYearTokens,
    e.timeZone,
    e.numerals,
    e.dateLib,
    e.components,
    e.formatters,
    e.labels,
    e.classNames
  ]), { captionLayout: u, mode: c, navLayout: l, numberOfMonths: d = 1, onDayBlur: w, onDayClick: v, onDayFocus: D, onDayKeyDown: W, onDayMouseEnter: m, onDayMouseLeave: h, onNextClick: k, onPrevClick: y, showWeekNumber: F, styles: f } = e, { formatCaption: Y, formatDay: T, formatMonthDropdown: P, formatWeekNumber: I, formatWeekNumberHeader: $, formatWeekdayName: _, formatYearDropdown: Z } = r, U = ps(e, s), { days: S, months: b, navStart: M, navEnd: p, previousMonth: g, nextMonth: x, goToMonth: N } = U, E = fa(S, e, M, p, s), { isSelected: H, select: q, selected: Q } = Es(e, s) ?? {}, { blur: ee, focused: oe, isFocusTarget: ue, moveFocus: le, setFocused: re } = Ws(e, U, E, H ?? (() => !1), s), { labelDayButton: J, labelGridcell: se, labelGrid: ce, labelMonthDropdown: he, labelNav: Se, labelPrevious: Ne, labelNext: Pe, labelWeekday: Ee, labelWeekNumber: $e, labelWeekNumberHeader: Fe, labelYearDropdown: dt } = a, un = Ye(() => Ja(s, e.ISOWeek), [s, e.ISOWeek]), ft = c !== void 0 || v !== void 0, Ve = V(() => {
    g && (N(g), y == null || y(g));
  }, [g, N, y]), Je = V(() => {
    x && (N(x), k == null || k(x));
  }, [N, x, k]), cn = V((j, G) => (A) => {
    A.preventDefault(), A.stopPropagation(), re(j), q == null || q(j.date, G, A), v == null || v(j.date, G, A);
  }, [q, v, re]), dn = V((j, G) => (A) => {
    re(j), D == null || D(j.date, G, A);
  }, [D, re]), fn = V((j, G) => (A) => {
    ee(), w == null || w(j.date, G, A);
  }, [ee, w]), ln = V((j, G) => (A) => {
    const pe = {
      ArrowLeft: [
        A.shiftKey ? "month" : "day",
        e.dir === "rtl" ? "after" : "before"
      ],
      ArrowRight: [
        A.shiftKey ? "month" : "day",
        e.dir === "rtl" ? "before" : "after"
      ],
      ArrowDown: [A.shiftKey ? "year" : "week", "after"],
      ArrowUp: [A.shiftKey ? "year" : "week", "before"],
      PageUp: [A.shiftKey ? "year" : "month", "before"],
      PageDown: [A.shiftKey ? "year" : "month", "after"],
      Home: ["startOfWeek", "before"],
      End: ["endOfWeek", "after"]
    };
    if (pe[A.key]) {
      A.preventDefault(), A.stopPropagation();
      const [de, Ze] = pe[A.key];
      le(de, Ze);
    }
    W == null || W(j.date, G, A);
  }, [le, W, e.dir]), hn = V((j, G) => (A) => {
    m == null || m(j.date, G, A);
  }, [m]), mn = V((j, G) => (A) => {
    h == null || h(j.date, G, A);
  }, [h]), yn = V((j) => (G) => {
    const A = Number(G.target.value), pe = s.setMonth(s.startOfMonth(j), A);
    N(pe);
  }, [s, N]), gn = V((j) => (G) => {
    const A = Number(G.target.value), pe = s.setYear(s.startOfMonth(j), A);
    N(pe);
  }, [s, N]), { className: wn, style: Mn } = Ye(() => ({
    className: [o[C.Root], e.className].filter(Boolean).join(" "),
    style: { ...f == null ? void 0 : f[C.Root], ...e.style }
  }), [o, e.className, e.style, f]), bn = Ia(e), lt = Ge(null);
  ys(lt, !!e.animate, {
    classNames: o,
    months: b,
    focused: oe,
    dateLib: s
  });
  const vn = {
    dayPickerProps: e,
    selected: Q,
    select: q,
    isSelected: H,
    months: b,
    nextMonth: x,
    previousMonth: g,
    goToMonth: N,
    getModifiers: E,
    components: n,
    classNames: o,
    styles: f,
    labels: a,
    formatters: r
  };
  return O.createElement(
    en.Provider,
    { value: vn },
    O.createElement(
      n.Root,
      { rootRef: e.animate ? lt : void 0, className: wn, style: Mn, dir: e.dir, id: e.id, lang: e.lang, nonce: e.nonce, title: e.title, role: e.role, "aria-label": e["aria-label"], ...bn },
      O.createElement(
        n.Months,
        { className: o[C.Months], style: f == null ? void 0 : f[C.Months] },
        !e.hideNavigation && !l && O.createElement(n.Nav, { "data-animated-nav": e.animate ? "true" : void 0, className: o[C.Nav], style: f == null ? void 0 : f[C.Nav], "aria-label": Se(), onPreviousClick: Ve, onNextClick: Je, previousMonth: g, nextMonth: x }),
        b.map((j, G) => {
          const A = Ua(j.date, M, p, r, s), pe = Ka(M, p, r, s);
          return O.createElement(
            n.Month,
            { "data-animated-month": e.animate ? "true" : void 0, className: o[C.Month], style: f == null ? void 0 : f[C.Month], key: G, displayIndex: G, calendarMonth: j },
            l === "around" && !e.hideNavigation && G === 0 && O.createElement(
              n.PreviousMonthButton,
              { type: "button", className: o[C.PreviousMonthButton], tabIndex: g ? void 0 : -1, "aria-disabled": g ? void 0 : !0, "aria-label": Ne(g), onClick: Ve, "data-animated-button": e.animate ? "true" : void 0 },
              O.createElement(n.Chevron, { disabled: g ? void 0 : !0, className: o[C.Chevron], orientation: e.dir === "rtl" ? "right" : "left" })
            ),
            O.createElement(n.MonthCaption, { "data-animated-caption": e.animate ? "true" : void 0, className: o[C.MonthCaption], style: f == null ? void 0 : f[C.MonthCaption], calendarMonth: j, displayIndex: G }, u != null && u.startsWith("dropdown") ? O.createElement(
              n.DropdownNav,
              { className: o[C.Dropdowns], style: f == null ? void 0 : f[C.Dropdowns] },
              u === "dropdown" || u === "dropdown-months" ? O.createElement(n.MonthsDropdown, { className: o[C.MonthsDropdown], "aria-label": he(), classNames: o, components: n, disabled: !!e.disableNavigation, onChange: yn(j.date), options: A, style: f == null ? void 0 : f[C.Dropdown], value: s.getMonth(j.date) }) : O.createElement("span", null, P(j.date, s)),
              u === "dropdown" || u === "dropdown-years" ? O.createElement(n.YearsDropdown, { className: o[C.YearsDropdown], "aria-label": dt(s.options), classNames: o, components: n, disabled: !!e.disableNavigation, onChange: gn(j.date), options: pe, style: f == null ? void 0 : f[C.Dropdown], value: s.getYear(j.date) }) : O.createElement("span", null, Z(j.date, s)),
              O.createElement("span", { role: "status", "aria-live": "polite", style: {
                border: 0,
                clip: "rect(0 0 0 0)",
                height: "1px",
                margin: "-1px",
                overflow: "hidden",
                padding: 0,
                position: "absolute",
                width: "1px",
                whiteSpace: "nowrap",
                wordWrap: "normal"
              } }, Y(j.date, s.options, s))
            ) : O.createElement(n.CaptionLabel, { className: o[C.CaptionLabel], role: "status", "aria-live": "polite" }, Y(j.date, s.options, s))),
            l === "around" && !e.hideNavigation && G === d - 1 && O.createElement(
              n.NextMonthButton,
              { type: "button", className: o[C.NextMonthButton], tabIndex: x ? void 0 : -1, "aria-disabled": x ? void 0 : !0, "aria-label": Pe(x), onClick: Je, "data-animated-button": e.animate ? "true" : void 0 },
              O.createElement(n.Chevron, { disabled: x ? void 0 : !0, className: o[C.Chevron], orientation: e.dir === "rtl" ? "left" : "right" })
            ),
            G === d - 1 && l === "after" && !e.hideNavigation && O.createElement(n.Nav, { "data-animated-nav": e.animate ? "true" : void 0, className: o[C.Nav], style: f == null ? void 0 : f[C.Nav], "aria-label": Se(), onPreviousClick: Ve, onNextClick: Je, previousMonth: g, nextMonth: x }),
            O.createElement(
              n.MonthGrid,
              { role: "grid", "aria-multiselectable": c === "multiple" || c === "range", "aria-label": ce(j.date, s.options, s) || void 0, className: o[C.MonthGrid], style: f == null ? void 0 : f[C.MonthGrid] },
              !e.hideWeekdays && O.createElement(
                n.Weekdays,
                { "data-animated-weekdays": e.animate ? "true" : void 0, className: o[C.Weekdays], style: f == null ? void 0 : f[C.Weekdays] },
                F && O.createElement(n.WeekNumberHeader, { "aria-label": Fe(s.options), className: o[C.WeekNumberHeader], style: f == null ? void 0 : f[C.WeekNumberHeader], scope: "col" }, $()),
                un.map((de, Ze) => O.createElement(n.Weekday, { "aria-label": Ee(de, s.options, s), className: o[C.Weekday], key: Ze, style: f == null ? void 0 : f[C.Weekday], scope: "col" }, _(de, s.options, s)))
              ),
              O.createElement(n.Weeks, { "data-animated-weeks": e.animate ? "true" : void 0, className: o[C.Weeks], style: f == null ? void 0 : f[C.Weeks] }, j.weeks.map((de, Ze) => O.createElement(
                n.Week,
                { className: o[C.Week], key: de.weekNumber, style: f == null ? void 0 : f[C.Week], week: de },
                F && O.createElement(n.WeekNumber, { week: de, style: f == null ? void 0 : f[C.WeekNumber], "aria-label": $e(de.weekNumber, {
                  locale: i
                }), className: o[C.WeekNumber], scope: "row", role: "rowheader" }, I(de.weekNumber, s)),
                de.days.map((te) => {
                  const { date: me } = te, z = E(te);
                  if (z[X.focused] = !z.hidden && !!(oe != null && oe.isEqualTo(te)), z[fe.selected] = (H == null ? void 0 : H(me)) || z.selected, ct(Q)) {
                    const { from: Ke, to: et } = Q;
                    z[fe.range_start] = !!(Ke && et && s.isSameDay(me, Ke)), z[fe.range_end] = !!(Ke && et && s.isSameDay(me, et)), z[fe.range_middle] = De(Q, me, !0, s);
                  }
                  const Dn = Va(z, f, e.modifiersStyles), kn = la(z, o, e.modifiersClassNames), On = !ft && !z.hidden ? se(me, z, s.options, s) : void 0;
                  return O.createElement(n.Day, { key: `${s.format(me, "yyyy-MM-dd")}_${s.format(te.displayMonth, "yyyy-MM")}`, day: te, modifiers: z, className: kn.join(" "), style: Dn, role: "gridcell", "aria-selected": z.selected || void 0, "aria-label": On, "data-day": s.format(me, "yyyy-MM-dd"), "data-month": te.outside ? s.format(me, "yyyy-MM") : void 0, "data-selected": z.selected || void 0, "data-disabled": z.disabled || void 0, "data-hidden": z.hidden || void 0, "data-outside": te.outside || void 0, "data-focused": z.focused || void 0, "data-today": z.today || void 0 }, !z.hidden && ft ? O.createElement(n.DayButton, { className: o[C.DayButton], style: f == null ? void 0 : f[C.DayButton], type: "button", day: te, modifiers: z, disabled: z.disabled || void 0, tabIndex: ue(te) ? 0 : -1, "aria-label": J(me, z, s.options, s), onClick: cn(te, z), onBlur: fn(te, z), onFocus: dn(te, z), onKeyDown: ln(te, z), onMouseEnter: hn(te, z), onMouseLeave: mn(te, z) }, T(me, s.options, s)) : !z.hidden && T(te.date, s.options, s));
                })
              )))
            )
          );
        })
      ),
      e.footer && O.createElement(n.Footer, { className: o[C.Footer], style: f == null ? void 0 : f[C.Footer], role: "status", "aria-live": "polite" }, e.footer)
    )
  );
}
var Qe = { exports: {} }, Fs = Qe.exports, Nt;
function Bs() {
  return Nt || (Nt = 1, function(t, e) {
    (function(n, r) {
      t.exports = r();
    })(Fs, function() {
      var n = 1e3, r = 6e4, a = 36e5, s = "millisecond", i = "second", o = "minute", u = "hour", c = "day", l = "week", d = "month", w = "quarter", v = "year", D = "date", W = "Invalid Date", m = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, h = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, k = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(S) {
        var b = ["th", "st", "nd", "rd"], M = S % 100;
        return "[" + S + (b[(M - 20) % 10] || b[M] || b[0]) + "]";
      } }, y = function(S, b, M) {
        var p = String(S);
        return !p || p.length >= b ? S : "" + Array(b + 1 - p.length).join(M) + S;
      }, F = { s: y, z: function(S) {
        var b = -S.utcOffset(), M = Math.abs(b), p = Math.floor(M / 60), g = M % 60;
        return (b <= 0 ? "+" : "-") + y(p, 2, "0") + ":" + y(g, 2, "0");
      }, m: function S(b, M) {
        if (b.date() < M.date()) return -S(M, b);
        var p = 12 * (M.year() - b.year()) + (M.month() - b.month()), g = b.clone().add(p, d), x = M - g < 0, N = b.clone().add(p + (x ? -1 : 1), d);
        return +(-(p + (M - g) / (x ? g - N : N - g)) || 0);
      }, a: function(S) {
        return S < 0 ? Math.ceil(S) || 0 : Math.floor(S);
      }, p: function(S) {
        return { M: d, y: v, w: l, d: c, D, h: u, m: o, s: i, ms: s, Q: w }[S] || String(S || "").toLowerCase().replace(/s$/, "");
      }, u: function(S) {
        return S === void 0;
      } }, f = "en", Y = {};
      Y[f] = k;
      var T = "$isDayjsObject", P = function(S) {
        return S instanceof Z || !(!S || !S[T]);
      }, I = function S(b, M, p) {
        var g;
        if (!b) return f;
        if (typeof b == "string") {
          var x = b.toLowerCase();
          Y[x] && (g = x), M && (Y[x] = M, g = x);
          var N = b.split("-");
          if (!g && N.length > 1) return S(N[0]);
        } else {
          var E = b.name;
          Y[E] = b, g = E;
        }
        return !p && g && (f = g), g || !p && f;
      }, $ = function(S, b) {
        if (P(S)) return S.clone();
        var M = typeof b == "object" ? b : {};
        return M.date = S, M.args = arguments, new Z(M);
      }, _ = F;
      _.l = I, _.i = P, _.w = function(S, b) {
        return $(S, { locale: b.$L, utc: b.$u, x: b.$x, $offset: b.$offset });
      };
      var Z = function() {
        function S(M) {
          this.$L = I(M.locale, null, !0), this.parse(M), this.$x = this.$x || M.x || {}, this[T] = !0;
        }
        var b = S.prototype;
        return b.parse = function(M) {
          this.$d = function(p) {
            var g = p.date, x = p.utc;
            if (g === null) return /* @__PURE__ */ new Date(NaN);
            if (_.u(g)) return /* @__PURE__ */ new Date();
            if (g instanceof Date) return new Date(g);
            if (typeof g == "string" && !/Z$/i.test(g)) {
              var N = g.match(m);
              if (N) {
                var E = N[2] - 1 || 0, H = (N[7] || "0").substring(0, 3);
                return x ? new Date(Date.UTC(N[1], E, N[3] || 1, N[4] || 0, N[5] || 0, N[6] || 0, H)) : new Date(N[1], E, N[3] || 1, N[4] || 0, N[5] || 0, N[6] || 0, H);
              }
            }
            return new Date(g);
          }(M), this.init();
        }, b.init = function() {
          var M = this.$d;
          this.$y = M.getFullYear(), this.$M = M.getMonth(), this.$D = M.getDate(), this.$W = M.getDay(), this.$H = M.getHours(), this.$m = M.getMinutes(), this.$s = M.getSeconds(), this.$ms = M.getMilliseconds();
        }, b.$utils = function() {
          return _;
        }, b.isValid = function() {
          return this.$d.toString() !== W;
        }, b.isSame = function(M, p) {
          var g = $(M);
          return this.startOf(p) <= g && g <= this.endOf(p);
        }, b.isAfter = function(M, p) {
          return $(M) < this.startOf(p);
        }, b.isBefore = function(M, p) {
          return this.endOf(p) < $(M);
        }, b.$g = function(M, p, g) {
          return _.u(M) ? this[p] : this.set(g, M);
        }, b.unix = function() {
          return Math.floor(this.valueOf() / 1e3);
        }, b.valueOf = function() {
          return this.$d.getTime();
        }, b.startOf = function(M, p) {
          var g = this, x = !!_.u(p) || p, N = _.p(M), E = function(re, J) {
            var se = _.w(g.$u ? Date.UTC(g.$y, J, re) : new Date(g.$y, J, re), g);
            return x ? se : se.endOf(c);
          }, H = function(re, J) {
            return _.w(g.toDate()[re].apply(g.toDate("s"), (x ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(J)), g);
          }, q = this.$W, Q = this.$M, ee = this.$D, oe = "set" + (this.$u ? "UTC" : "");
          switch (N) {
            case v:
              return x ? E(1, 0) : E(31, 11);
            case d:
              return x ? E(1, Q) : E(0, Q + 1);
            case l:
              var ue = this.$locale().weekStart || 0, le = (q < ue ? q + 7 : q) - ue;
              return E(x ? ee - le : ee + (6 - le), Q);
            case c:
            case D:
              return H(oe + "Hours", 0);
            case u:
              return H(oe + "Minutes", 1);
            case o:
              return H(oe + "Seconds", 2);
            case i:
              return H(oe + "Milliseconds", 3);
            default:
              return this.clone();
          }
        }, b.endOf = function(M) {
          return this.startOf(M, !1);
        }, b.$set = function(M, p) {
          var g, x = _.p(M), N = "set" + (this.$u ? "UTC" : ""), E = (g = {}, g[c] = N + "Date", g[D] = N + "Date", g[d] = N + "Month", g[v] = N + "FullYear", g[u] = N + "Hours", g[o] = N + "Minutes", g[i] = N + "Seconds", g[s] = N + "Milliseconds", g)[x], H = x === c ? this.$D + (p - this.$W) : p;
          if (x === d || x === v) {
            var q = this.clone().set(D, 1);
            q.$d[E](H), q.init(), this.$d = q.set(D, Math.min(this.$D, q.daysInMonth())).$d;
          } else E && this.$d[E](H);
          return this.init(), this;
        }, b.set = function(M, p) {
          return this.clone().$set(M, p);
        }, b.get = function(M) {
          return this[_.p(M)]();
        }, b.add = function(M, p) {
          var g, x = this;
          M = Number(M);
          var N = _.p(p), E = function(Q) {
            var ee = $(x);
            return _.w(ee.date(ee.date() + Math.round(Q * M)), x);
          };
          if (N === d) return this.set(d, this.$M + M);
          if (N === v) return this.set(v, this.$y + M);
          if (N === c) return E(1);
          if (N === l) return E(7);
          var H = (g = {}, g[o] = r, g[u] = a, g[i] = n, g)[N] || 1, q = this.$d.getTime() + M * H;
          return _.w(q, this);
        }, b.subtract = function(M, p) {
          return this.add(-1 * M, p);
        }, b.format = function(M) {
          var p = this, g = this.$locale();
          if (!this.isValid()) return g.invalidDate || W;
          var x = M || "YYYY-MM-DDTHH:mm:ssZ", N = _.z(this), E = this.$H, H = this.$m, q = this.$M, Q = g.weekdays, ee = g.months, oe = g.meridiem, ue = function(J, se, ce, he) {
            return J && (J[se] || J(p, x)) || ce[se].slice(0, he);
          }, le = function(J) {
            return _.s(E % 12 || 12, J, "0");
          }, re = oe || function(J, se, ce) {
            var he = J < 12 ? "AM" : "PM";
            return ce ? he.toLowerCase() : he;
          };
          return x.replace(h, function(J, se) {
            return se || function(ce) {
              switch (ce) {
                case "YY":
                  return String(p.$y).slice(-2);
                case "YYYY":
                  return _.s(p.$y, 4, "0");
                case "M":
                  return q + 1;
                case "MM":
                  return _.s(q + 1, 2, "0");
                case "MMM":
                  return ue(g.monthsShort, q, ee, 3);
                case "MMMM":
                  return ue(ee, q);
                case "D":
                  return p.$D;
                case "DD":
                  return _.s(p.$D, 2, "0");
                case "d":
                  return String(p.$W);
                case "dd":
                  return ue(g.weekdaysMin, p.$W, Q, 2);
                case "ddd":
                  return ue(g.weekdaysShort, p.$W, Q, 3);
                case "dddd":
                  return Q[p.$W];
                case "H":
                  return String(E);
                case "HH":
                  return _.s(E, 2, "0");
                case "h":
                  return le(1);
                case "hh":
                  return le(2);
                case "a":
                  return re(E, H, !0);
                case "A":
                  return re(E, H, !1);
                case "m":
                  return String(H);
                case "mm":
                  return _.s(H, 2, "0");
                case "s":
                  return String(p.$s);
                case "ss":
                  return _.s(p.$s, 2, "0");
                case "SSS":
                  return _.s(p.$ms, 3, "0");
                case "Z":
                  return N;
              }
              return null;
            }(J) || N.replace(":", "");
          });
        }, b.utcOffset = function() {
          return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
        }, b.diff = function(M, p, g) {
          var x, N = this, E = _.p(p), H = $(M), q = (H.utcOffset() - this.utcOffset()) * r, Q = this - H, ee = function() {
            return _.m(N, H);
          };
          switch (E) {
            case v:
              x = ee() / 12;
              break;
            case d:
              x = ee();
              break;
            case w:
              x = ee() / 3;
              break;
            case l:
              x = (Q - q) / 6048e5;
              break;
            case c:
              x = (Q - q) / 864e5;
              break;
            case u:
              x = Q / a;
              break;
            case o:
              x = Q / r;
              break;
            case i:
              x = Q / n;
              break;
            default:
              x = Q;
          }
          return g ? x : _.a(x);
        }, b.daysInMonth = function() {
          return this.endOf(d).$D;
        }, b.$locale = function() {
          return Y[this.$L];
        }, b.locale = function(M, p) {
          if (!M) return this.$L;
          var g = this.clone(), x = I(M, p, !0);
          return x && (g.$L = x), g;
        }, b.clone = function() {
          return _.w(this.$d, this);
        }, b.toDate = function() {
          return new Date(this.valueOf());
        }, b.toJSON = function() {
          return this.isValid() ? this.toISOString() : null;
        }, b.toISOString = function() {
          return this.$d.toISOString();
        }, b.toString = function() {
          return this.$d.toUTCString();
        }, S;
      }(), U = Z.prototype;
      return $.prototype = U, [["$ms", s], ["$s", i], ["$m", o], ["$H", u], ["$W", c], ["$M", d], ["$y", v], ["$D", D]].forEach(function(S) {
        U[S[1]] = function(b) {
          return this.$g(b, S[0], S[1]);
        };
      }), $.extend = function(S, b) {
        return S.$i || (S(b, Z, $), S.$i = !0), $;
      }, $.locale = I, $.isDayjs = P, $.unix = function(S) {
        return $(1e3 * S);
      }, $.en = Y[f], $.Ls = Y, $.p = {}, $;
    });
  }(Qe)), Qe.exports;
}
var js = Bs();
const ae = /* @__PURE__ */ Tt(js);
var Xe = { exports: {} }, Is = Xe.exports, Ct;
function Hs() {
  return Ct || (Ct = 1, function(t, e) {
    (function(n, r) {
      t.exports = r();
    })(Is, function() {
      var n = { LTS: "h:mm:ss A", LT: "h:mm A", L: "MM/DD/YYYY", LL: "MMMM D, YYYY", LLL: "MMMM D, YYYY h:mm A", LLLL: "dddd, MMMM D, YYYY h:mm A" }, r = /(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g, a = /\d/, s = /\d\d/, i = /\d\d?/, o = /\d*[^-_:/,()\s\d]+/, u = {}, c = function(m) {
        return (m = +m) + (m > 68 ? 1900 : 2e3);
      }, l = function(m) {
        return function(h) {
          this[m] = +h;
        };
      }, d = [/[+-]\d\d:?(\d\d)?|Z/, function(m) {
        (this.zone || (this.zone = {})).offset = function(h) {
          if (!h || h === "Z") return 0;
          var k = h.match(/([+-]|\d\d)/g), y = 60 * k[1] + (+k[2] || 0);
          return y === 0 ? 0 : k[0] === "+" ? -y : y;
        }(m);
      }], w = function(m) {
        var h = u[m];
        return h && (h.indexOf ? h : h.s.concat(h.f));
      }, v = function(m, h) {
        var k, y = u.meridiem;
        if (y) {
          for (var F = 1; F <= 24; F += 1) if (m.indexOf(y(F, 0, h)) > -1) {
            k = F > 12;
            break;
          }
        } else k = m === (h ? "pm" : "PM");
        return k;
      }, D = { A: [o, function(m) {
        this.afternoon = v(m, !1);
      }], a: [o, function(m) {
        this.afternoon = v(m, !0);
      }], Q: [a, function(m) {
        this.month = 3 * (m - 1) + 1;
      }], S: [a, function(m) {
        this.milliseconds = 100 * +m;
      }], SS: [s, function(m) {
        this.milliseconds = 10 * +m;
      }], SSS: [/\d{3}/, function(m) {
        this.milliseconds = +m;
      }], s: [i, l("seconds")], ss: [i, l("seconds")], m: [i, l("minutes")], mm: [i, l("minutes")], H: [i, l("hours")], h: [i, l("hours")], HH: [i, l("hours")], hh: [i, l("hours")], D: [i, l("day")], DD: [s, l("day")], Do: [o, function(m) {
        var h = u.ordinal, k = m.match(/\d+/);
        if (this.day = k[0], h) for (var y = 1; y <= 31; y += 1) h(y).replace(/\[|\]/g, "") === m && (this.day = y);
      }], w: [i, l("week")], ww: [s, l("week")], M: [i, l("month")], MM: [s, l("month")], MMM: [o, function(m) {
        var h = w("months"), k = (w("monthsShort") || h.map(function(y) {
          return y.slice(0, 3);
        })).indexOf(m) + 1;
        if (k < 1) throw new Error();
        this.month = k % 12 || k;
      }], MMMM: [o, function(m) {
        var h = w("months").indexOf(m) + 1;
        if (h < 1) throw new Error();
        this.month = h % 12 || h;
      }], Y: [/[+-]?\d+/, l("year")], YY: [s, function(m) {
        this.year = c(m);
      }], YYYY: [/\d{4}/, l("year")], Z: d, ZZ: d };
      function W(m) {
        var h, k;
        h = m, k = u && u.formats;
        for (var y = (m = h.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g, function($, _, Z) {
          var U = Z && Z.toUpperCase();
          return _ || k[Z] || n[Z] || k[U].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, function(S, b, M) {
            return b || M.slice(1);
          });
        })).match(r), F = y.length, f = 0; f < F; f += 1) {
          var Y = y[f], T = D[Y], P = T && T[0], I = T && T[1];
          y[f] = I ? { regex: P, parser: I } : Y.replace(/^\[|\]$/g, "");
        }
        return function($) {
          for (var _ = {}, Z = 0, U = 0; Z < F; Z += 1) {
            var S = y[Z];
            if (typeof S == "string") U += S.length;
            else {
              var b = S.regex, M = S.parser, p = $.slice(U), g = b.exec(p)[0];
              M.call(_, g), $ = $.replace(g, "");
            }
          }
          return function(x) {
            var N = x.afternoon;
            if (N !== void 0) {
              var E = x.hours;
              N ? E < 12 && (x.hours += 12) : E === 12 && (x.hours = 0), delete x.afternoon;
            }
          }(_), _;
        };
      }
      return function(m, h, k) {
        k.p.customParseFormat = !0, m && m.parseTwoDigitYear && (c = m.parseTwoDigitYear);
        var y = h.prototype, F = y.parse;
        y.parse = function(f) {
          var Y = f.date, T = f.utc, P = f.args;
          this.$u = T;
          var I = P[1];
          if (typeof I == "string") {
            var $ = P[2] === !0, _ = P[3] === !0, Z = $ || _, U = P[2];
            _ && (U = P[2]), u = this.$locale(), !$ && U && (u = k.Ls[U]), this.$d = function(p, g, x, N) {
              try {
                if (["x", "X"].indexOf(g) > -1) return new Date((g === "X" ? 1e3 : 1) * p);
                var E = W(g)(p), H = E.year, q = E.month, Q = E.day, ee = E.hours, oe = E.minutes, ue = E.seconds, le = E.milliseconds, re = E.zone, J = E.week, se = /* @__PURE__ */ new Date(), ce = Q || (H || q ? 1 : se.getDate()), he = H || se.getFullYear(), Se = 0;
                H && !q || (Se = q > 0 ? q - 1 : se.getMonth());
                var Ne, Pe = ee || 0, Ee = oe || 0, $e = ue || 0, Fe = le || 0;
                return re ? new Date(Date.UTC(he, Se, ce, Pe, Ee, $e, Fe + 60 * re.offset * 1e3)) : x ? new Date(Date.UTC(he, Se, ce, Pe, Ee, $e, Fe)) : (Ne = new Date(he, Se, ce, Pe, Ee, $e, Fe), J && (Ne = N(Ne).week(J).toDate()), Ne);
              } catch {
                return /* @__PURE__ */ new Date("");
              }
            }(Y, I, T, k), this.init(), U && U !== !0 && (this.$L = this.locale(U).$L), Z && Y != this.format(I) && (this.$d = /* @__PURE__ */ new Date("")), u = {};
          } else if (I instanceof Array) for (var S = I.length, b = 1; b <= S; b += 1) {
            P[1] = I[b - 1];
            var M = k.apply(this, P);
            if (M.isValid()) {
              this.$d = M.$d, this.$L = M.$L, this.init();
              break;
            }
            b === S && (this.$d = /* @__PURE__ */ new Date(""));
          }
          else F.call(this, f);
        };
      };
    });
  }(Xe)), Xe.exports;
}
var As = Hs();
const qs = /* @__PURE__ */ Tt(As);
ae.extend(qs);
const no = "DD.MM.YYYY", zs = ({ calendarMonth: t, setMonth: e }) => {
  const n = ae(t.date), [r, a] = ge(!1), [s, i] = ge(!1), [o] = ge(20), [u, c] = ge(0), l = V(
    (w) => {
      a(!1), e(ae(n).month(parseInt(w)).toDate());
    },
    [n, e]
  ), d = V(
    (w) => {
      i(!1), e(ae(n).year(parseInt(w)).toDate());
    },
    [n, e]
  );
  return /* @__PURE__ */ B.jsxs("div", { className: "z-10 mx-auto flex justify-center gap-1", children: [
    /* @__PURE__ */ B.jsx(
      be,
      {
        size: "xs",
        variant: "secondary",
        className: "max-h-6 max-w-[60px]",
        onClick: () => a(!0),
        children: n.format("MMM")
      }
    ),
    r && /* @__PURE__ */ B.jsxs(
      "div",
      {
        className: "bg-bg absolute -inset-1 flex flex-col items-center gap-2",
        children: [
          /* @__PURE__ */ B.jsx("div", { className: "flex items-center justify-between gap-2", children: /* @__PURE__ */ B.jsx("span", { children: "Month" }) }),
          /* @__PURE__ */ B.jsx("div", { className: "grid grid-cols-3 gap-2", children: Array.from({ length: 12 }, (w, v) => /* @__PURE__ */ B.jsx(
            be,
            {
              onClick: () => l(v.toString()),
              size: "sm",
              variant: v === n.month() ? "default" : "secondary",
              children: ae().month(v).format("MMMM")
            },
            v
          )) })
        ]
      }
    ),
    /* @__PURE__ */ B.jsx(
      be,
      {
        size: "xs",
        variant: "secondary",
        className: "max-h-6 max-w-[60px]",
        onClick: () => i(!0),
        children: n.format("YYYY")
      }
    ),
    s && /* @__PURE__ */ B.jsxs("div", { className: "bg-bg absolute -inset-1 flex flex-col gap-2", children: [
      /* @__PURE__ */ B.jsxs("div", { className: "flex items-center justify-between gap-2", children: [
        /* @__PURE__ */ B.jsx(
          be,
          {
            size: "xs",
            variant: "secondary",
            onClick: () => c(u - 1),
            children: /* @__PURE__ */ B.jsx(Yt, {})
          }
        ),
        /* @__PURE__ */ B.jsx("span", { children: "Year" }),
        /* @__PURE__ */ B.jsx(
          be,
          {
            size: "xs",
            variant: "secondary",
            onClick: () => c(u + 1),
            children: /* @__PURE__ */ B.jsx(_t, {})
          }
        )
      ] }),
      /* @__PURE__ */ B.jsx("div", { className: "grid w-full grid-cols-4 gap-2", children: Array.from({ length: o }, (w, v) => {
        const D = Math.floor(n.year() / o) * o + u * o + v;
        return /* @__PURE__ */ B.jsx(
          be,
          {
            onClick: () => d(D.toString()),
            size: "xs",
            variant: D === n.year() ? "default" : "secondary",
            children: ae().year(D).format("YYYY")
          },
          v
        );
      }) })
    ] })
  ] });
};
function Ls({
  className: t,
  classNames: e,
  showOutsideDays: n = !0,
  selectedToDate: r,
  selectedFromDate: a,
  format: s,
  ...i
}) {
  const [o, u] = ge(ae().startOf("month").toDate()), c = V(
    (h) => /* @__PURE__ */ B.jsx(
      tn,
      {
        ...h,
        className: "text-body-xs-medium text-tertiary dark:text-primary"
      }
    ),
    []
  ), l = V(
    (h) => /* @__PURE__ */ B.jsx(
      zs,
      {
        calendarMonth: h.calendarMonth,
        setMonth: u
      }
    ),
    []
    // Fixed dependency array
  ), d = V(
    (h) => {
      const { day: k, modifiers: y, ...F } = h;
      return /* @__PURE__ */ B.jsx(
        Kt,
        {
          day: k,
          modifiers: y,
          ...F,
          className: _n(
            "size-7 cursor-pointer rounded-sm",
            (y.today || a && a <= k.date && r && r >= k.date) && "bg-item-tertiary text-item-primary",
            y.selected && "bg-item-primary dark:text-primary text-white",
            y.disabled && "pointer-events-none opacity-50"
          )
        }
      );
    },
    [a, r]
  ), w = V(
    () => u((h) => ae(h).subtract(1, "M").toDate()),
    []
  ), v = V(
    () => u((h) => ae(h).add(1, "M").toDate()),
    []
  ), D = V(
    ({ className: h, ...k }) => /* @__PURE__ */ B.jsx(
      be,
      {
        variant: "ghost",
        className: ve("size-6", h),
        ...k,
        onClick: w,
        children: /* @__PURE__ */ B.jsx(Yt, {})
      }
    ),
    [w]
  ), W = V(
    ({ className: h, ...k }) => /* @__PURE__ */ B.jsx(
      be,
      {
        variant: "ghost",
        className: ve("size-6", h),
        ...k,
        onClick: v,
        children: /* @__PURE__ */ B.jsx(_t, {})
      }
    ),
    [v]
  ), m = Ye(
    () => ({
      Weekday: c,
      DayButton: d,
      MonthCaption: l,
      NextMonthButton: W,
      PreviousMonthButton: D
    }),
    [
      c,
      d,
      l,
      W,
      D
    ]
  );
  return it(() => {
    const h = i.selected;
    u(h ? s ? ae(h, s).startOf("month").toDate() : ae(h).startOf("month").toDate() : ae().startOf("month").toDate());
  }, [i.selected, s]), /* @__PURE__ */ B.jsx(
    $s,
    {
      showOutsideDays: n,
      className: ve("pointer-events-auto relative p-3", t),
      classNames: {
        years_dropdown: "flex",
        months: "flex relative gap-2",
        month: "flex flex-col gap-4 text-center",
        caption: "flex justify-center pt-1 relative items-center w-full",
        caption_label: "text-sm font-medium",
        nav: "flex items-center gap-1 w-full absolute justify-between border-b pb-2",
        nav_button: ve(
          mt({ variant: "ghost" }),
          "size-7 bg-transparent p-0 opacity-50 hover:opacity-100"
        ),
        nav_button_previous: "absolute left-1",
        nav_button_next: "absolute right-1",
        table: "w-full border-collapse space-x-1",
        head_row: "flex",
        head_cell: "text-neutral-500 rounded-md w-8 font-normal text-[0.8rem] dark:text-neutral-400 ",
        row: "flex w-full mt-2",
        cell: ve(
          "relative p-0 text-center text-sm focus-within:relative focus-within:z-20 [&:has([aria-selected])]:bg-neutral-100 [&:has([aria-selected].day-range-end)]:rounded-r-md dark:[&:has([aria-selected])]:bg-neutral-800"
        ),
        day: ve(
          mt({ variant: "ghost" }),
          "table-cell size-8 p-0 font-normal aria-selected:opacity-100"
        ),
        day_range_start: "day-range-start aria-selected:bg-neutral-900 aria-selected:text-neutral-50 dark:aria-selected:bg-neutral-50 dark:aria-selected:text-neutral-900",
        day_range_end: "day-range-end aria-selected:bg-neutral-900 aria-selected:text-neutral-50 dark:aria-selected:bg-neutral-50 dark:aria-selected:text-neutral-900",
        day_selected: "bg-neutral-900 text-neutral-50 hover:bg-neutral-900 hover:text-neutral-50 focus:bg-neutral-900 focus:text-neutral-50 dark:bg-neutral-50 dark:text-neutral-900 dark:hover:bg-neutral-50 dark:hover:text-neutral-900 dark:focus:bg-neutral-50 dark:focus:text-neutral-900",
        day_today: "bg-neutral-100 text-red-900 dark:bg-neutral-800 dark:text-neutral-50",
        day_outside: "day-outside text-neutral-500 aria-selected:text-neutral-500 dark:text-neutral-400 dark:aria-selected:text-neutral-400",
        day_disabled: "text-neutral-500 opacity-50 dark:text-neutral-400",
        day_range_middle: "aria-selected:bg-neutral-100 aria-selected:text-neutral-900 dark:aria-selected:bg-neutral-800 dark:aria-selected:text-neutral-50",
        day_hidden: "invisible",
        ...e
      },
      components: m,
      ...i,
      mode: "single",
      onSelect: (h) => {
        h && i.onSelect && (s ? i.onSelect(ae(h).format(s)) : i.onSelect(h));
      },
      selected: ae(i.selected, s).toDate(),
      month: o
    }
  );
}
function ro() {
  const [t, e] = ge(/* @__PURE__ */ new Date());
  return /* @__PURE__ */ B.jsxs(Nn, { children: [
    /* @__PURE__ */ B.jsx(Cn, { asChild: !0, children: /* @__PURE__ */ B.jsxs(
      be,
      {
        variant: "tertiary",
        className: ve(
          "w-[280px] justify-start text-left font-normal",
          !t && "text-muted-foreground"
        ),
        children: [
          /* @__PURE__ */ B.jsx($n, { className: "mr-2 h-4 w-4" }),
          t ? ae(t).format("DD-MM-YYYY") : /* @__PURE__ */ B.jsx("span", { children: "Pick a date" })
        ]
      }
    ) }),
    /* @__PURE__ */ B.jsx(Yn, { className: "w-auto p-0", children: /* @__PURE__ */ B.jsx(
      Ls,
      {
        mode: "single",
        selected: t,
        onSelect: (n) => e(n)
      }
    ) })
  ] });
}
const Rs = "HH", Zs = "mm", ao = `${Rs}:${Zs}`, Gs = Wn(
  ({
    value: t,
    onChange: e,
    disabled: n = !1,
    className: r,
    icon: a = /* @__PURE__ */ B.jsx(Tn, { className: "size-5" })
  }, s) => {
    const i = (D) => {
      if (typeof D == "string") {
        const m = /^([0-1]?[0-9]|2[0-3]):([0-5][0-9])$/, h = D.match(m);
        if (h)
          return {
            hour: h[1].padStart(2, "0"),
            minute: h[2]
          };
      }
      const W = /* @__PURE__ */ new Date();
      return {
        hour: W.getHours().toString().padStart(2, "0"),
        minute: W.getMinutes().toString().padStart(2, "0")
      };
    }, { hour: o, minute: u } = i(t), [c, l] = ge({
      hour: o,
      minute: u
    });
    it(() => {
      const { hour: D, minute: W } = i(t);
      l({ hour: D, minute: W });
    }, [t]);
    const d = (D, W) => {
      const m = { ...c, [W]: D };
      l(m);
      const h = `${m.hour}:${m.minute}`;
      e && e(h);
    }, w = Ye(
      () => Array.from({ length: 24 }, (D, W) => {
        const m = String(W).padStart(2, "0");
        return { value: m, label: m };
      }),
      []
    ), v = Ye(
      () => Array.from({ length: 60 }, (D, W) => {
        const m = String(W).padStart(2, "0");
        return { value: m, label: m };
      }),
      []
    );
    return /* @__PURE__ */ B.jsxs("div", { className: ve("flex items-center space-x-2", r), ref: s, children: [
      a,
      /* @__PURE__ */ B.jsxs("div", { className: ve("flex items-center space-x-2"), children: [
        /* @__PURE__ */ B.jsx(
          yt,
          {
            isClearable: !1,
            options: w,
            value: c.hour,
            onChange: (D) => d(`${D}`, "hour"),
            isDisabled: n,
            menuPlacement: "auto",
            className: "min-w-20"
          }
        ),
        /* @__PURE__ */ B.jsx("span", { className: "text-lg", children: ":" }),
        /* @__PURE__ */ B.jsx(
          yt,
          {
            isClearable: !1,
            options: v,
            value: c.minute,
            onChange: (D) => d(`${D}`, "minute"),
            isDisabled: n,
            menuPlacement: "auto",
            className: "min-w-20"
          }
        )
      ] })
    ] });
  }
);
Gs.displayName = "TimePicker";
export {
  Ls as C,
  no as D,
  Rs as H,
  Zs as M,
  ao as T,
  ro as a,
  Gs as b
};