UNPKG

@farris/ui-vue

Version:

Farris Vue, a Farris Design based Vue3 component library.

1,859 lines 101 kB
var dt = Object.defineProperty; var ft = (t, r, e) => r in t ? dt(t, r, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[r] = e; var c = (t, r, e) => ft(t, typeof r != "symbol" ? r + "" : r, e); import { ref as I, computed as T, watch as ne, onUnmounted as ht } from "vue"; import B from "bignumber.js"; import { isUndefined as mt } from "lodash-es"; function Le(t) { const r = t.nativeElement ? t.nativeElement : t; return r.classList !== void 0 && r.classList !== null ? r : null; } function Be(t, r) { if (r === void 0) return; const e = Le(t); e && e.classList.remove(r); } function De(t, r) { if (r === void 0) return; const e = Le(t); e && e.classList.add(r); } const wt = [ { size: "sm", width: 576, pattern: /\b(col-|col-sm-)\d+\b/ }, { size: "md", width: 768, pattern: /\bcol-md-\d+\b/ }, { size: "lg", width: 888, pattern: /\bcol-lg-\d+\b/ }, { size: "xl", width: 1200, pattern: /\bcol-xl-\d+\b/ }, { size: "el", width: 1690, pattern: /\bcol-el-\d+\b/ } ]; function Fe(t) { t.resizeObserver && (t.resizeObserver.disconnect(), t.sharedObject = null); } function Qe(t, r, e = 0) { const n = []; if (!r) return; const a = e || r.getBoundingClientRect().width, s = parseFloat(a), i = t.breakPoints; for (let o = 0; o < i.length; o++) i[o].width <= s && n.push(i[o].size); if (t.className.join(",") !== n.join(",")) { if (t.className.length - n.length > 0) for (let u = n.length; u < t.className.length; u++) Be(r, "f-area-response--" + t.className[u]); else for (let u = t.className.length; u < n.length; u++) De(r, "f-area-response--" + n[u]); t.className = [...n]; } } function gt(t, r) { t.enable && t.autoWidth ? t.resizeObserver || (t.resizeObserver = new ResizeObserver((e) => { if (!e || e.length < 1 || !e[0].contentRect) return; const n = e[0].contentRect; Math.abs(parseInt(n.width + "") - t.width) > t.threshold && (Qe(t, r, n.width), t.width = parseInt(n.width + "")); }), t.resizeObserver.observe(r)) : Fe(t); } function Ye(t, r) { if (t.enable) De(r, "f-area-response"), Qe(t, r); else { Be(r, "f-area-response"); for (let e = t.className.length; e > 0; e--) De(r, "f-area-response--" + t.className[e]); t.className = []; } gt(t, r); } function yt(t) { const r = []; return wt.map((e) => { const n = "col-" + e.size + "-"; if (t.querySelectorAll('[class*="' + n + '"]').length > 0) r.push({ size: e.size, width: e.width }); else if (e.size === "sm") { const s = t.querySelectorAll('[class*="col-"]'); Array.from(s).some((o) => o.className.match(e.pattern)) && r.push({ size: e.size, width: e.width }); } }), r; } function Ee(t, r, e) { r.value && Object.prototype.hasOwnProperty.call(r.value, "enable") && (t.enable = r.value.enable), r.value && Object.prototype.hasOwnProperty.call(r.value, "autoWidth") && (t.autoWidth = r.value.autoWidth), t.breakPoints = yt(e); } const be = { // 在绑定元素的父组件 // 及他自己的所有子节点都挂载完成后调用 mounted: (t, r, e) => { e.sharedObject = { className: [], resizeObserver: null, enable: !0, autoWidth: !0, threshold: 10, width: 0, breakPoints: [] }, Ee(e.sharedObject, r, t), Ye(e.sharedObject, t); }, // 在绑定元素的父组件 // 及他自己的所有子节点都更新后调用 updated: function(t, r, e, n) { e.sharedObject = n.sharedObject, Ee(e.sharedObject, r, t), Ye(e.sharedObject, t); }, // 绑定元素的父组件卸载前调用 beforeUnmount(t, r, e) { Fe(e.sharedObject); } }; function zr(t, r, e, n, a) { const s = I(t.disabled), i = I(!1), o = I("text"), u = I(t.showBorder), m = I(t.textAlign), b = I(t.updateOn), w = I(!1), P = T(() => t.editable || !t.readonly && !t.disabled), D = T(() => t.editable && !t.disabled && !t.readonly), p = T(() => !t.disabled && !t.readonly && i.value), l = T(() => e.value === "" || e.value === null || e.value === void 0), d = T(() => (t.disabled || t.readonly) && !t.forcePlaceholder ? "" : t.placeholder), g = T(() => t.readonly || !t.editable), L = T(() => t.enableTitle ? e.value : ""), h = T(() => ({ "form-control": !0, "f-utils-fill": !0, "text-left": m.value === "left", "text-center": m.value === "center", "text-right": m.value === "right" })), y = T(() => { const f = { "f-cmp-inputgroup": !0, "input-group": !0, "f-state-disabled": s.value, "f-state-editable": D.value, "f-state-readonly": g.value, "f-state-focus": p.value, "input-group--has-clear": t.enableClear && w.value }; return (t.customClass || "").split(" ").reduce((oe, lt) => (oe[lt] = !0, oe), f), f; }), C = T(() => u.value ? "" : "border-width : 0 "); function j(f, E = !0) { e.value = f, n.value !== f && (n.value = f), E && r.emit("change", f), r.emit("update:modelValue", f), r.emit("update:value", f); } ne( () => t.modelValue, (f, E) => { f !== E && (e.value = f, n.value = f); } ), ne(() => t.disabled, (f, E) => { f !== E && (s.value = f); }); function F(f) { return f.stopPropagation(), i.value = !1, r.emit("blur", f), f.target.tagName === "TEXTAREA" && (r.emit("update:modelValue", f.target.value), r.emit("update:value", f.target.value), r.emit("change", f.target.value)), !1; } function Q(f) { r.emit("click", f); } function A(f) { s.value || g.value || (u.value && (i.value = !0), P.value && r.emit("focus", f)); } function se(f) { r.emit("input", f.target.value, f); const E = f.target.value; n.value = E, b.value === "change" && (r.emit("update:modelValue", E), r.emit("update:value", E), r.emit("change", E)); } function ie(f) { r.emit("keydown", f); } function V(f) { r.emit("keyup", f); } function G(f) { const E = f.target; E.tagName !== "INPUT" && E.tagName !== "TEXTAREA" && f.preventDefault(), f.stopPropagation(), r.emit("mousedownEvent", f); } function U(f) { r.emit("mouseupEvent", f); } function he(f) { if (b.value === "blur") { const E = f.target.value; f.stopPropagation(), j(E); } } return { changeTextBoxValue: j, disabled: s, displayText: n, editable: D, hasFocused: p, inputGroupClass: y, inputType: o, isEmpty: l, modelValue: e, readonly: g, onBlur: F, hasClearClass: w, onClick: Q, onFocus: A, onInput: se, onKeydown: ie, onKeyup: V, onMousedown: G, onMouseup: U, onTextBoxValueChange: he, placeholder: d, textBoxClass: h, textBoxTitle: L, inputGroupStyle: C }; } function jr(t, r, e, n) { const a = I(t.disabled), s = I(!1), i = I("text"), o = I(t.showBorder), u = I(t.textAlign); T(() => t.editable || !t.readonly); const m = T(() => t.editable && !t.disabled && !t.readonly), b = T(() => !t.disabled && s.value), w = T(() => e.value === "" || e.value === null || e.value === void 0), P = T(() => t.placeholder), D = T(() => t.readonly || !t.editable), p = T(() => t.enableTitle ? e.value : ""), l = T(() => ({ "form-control": !0, // 'f-utils-fill': true, "text-left": u.value === "left", "text-center": u.value === "center", "text-right": u.value === "right" })), d = T(() => ({ "f-cmp-inputgroup": !0, "input-group": !0, "f-state-disabled": !0, "f-state-editable": !1, "f-state-readonly": !0 // 'f-state-focus': hasFocused.value })), g = T(() => o.value ? "" : "border-width : 0 "); function L(h, y = !0) { } return { changeTextBoxValue: L, disabled: a, displayText: n, editable: m, hasFocused: b, inputGroupClass: d, inputType: i, isEmpty: w, modelValue: e, readonly: D, // onBlur, // onClick, // onFocus, // onInput, // onKeydown, // onKeyup, // onMousedown, // onTextBoxValueChange, placeholder: P, textBoxClass: l, textBoxTitle: p, inputGroupStyle: g }; } function Gr(t, r, e) { const n = I(!1), a = T(() => t.enableClear && !t.readonly && !t.disabled), { changeTextBoxValue: s, displayText: i, hasFocused: o, modelValue: u, isEmpty: m, hasClearClass: b } = e; function w(g) { n.value = g, b && (b.value = n.value); } ne(i, () => { o != null && o.value ? w(!!(i != null && i.value)) : w(!1); }); const P = T(() => ({ "input-group-text": !0, "input-group-clear": !0 })), D = T(() => ({ width: "24px", display: n.value ? "flex" : "none" })); function p(g) { g.stopPropagation(), a.value && (s("", !0), w(!n.value), r.emit("clear")); } function l(g) { var C, j; const L = ((C = g.target.querySelector("input")) == null ? void 0 : C.value) || "", h = ((j = g.target.querySelector("textarea")) == null ? void 0 : j.value) || "", y = L || h; y !== u.value && (u.value = y), a.value && w(!!y); } function d(g) { a.value && w(!1); } return { clearButtonClass: P, clearButtonStyle: D, hasShownClearButton: n, onClearValue: p, onMouseEnter: l, onMouseLeave: d, shouldShowClearButton: a }; } const bt = { jan: 1, feb: 2, mar: 3, apr: 4, may: 5, jun: 6, jul: 7, aug: 8, sep: 9, oct: 10, nov: 11, dec: 12 }, xt = { sun: 0, mon: 1, tue: 2, wed: 3, thu: 4, fri: 5, sat: 6 }; class $e { constructor() { c(this, "regexes", { YEAR: "[1-9]\\d{3}", MONTH: "1[0-2]|0?[1-9]", MONTH2: "1[0-2]|0[1-9]", MONTHNAME: "jan|january|feb|february|mar|march|apr|april|may|jun|june|jul|july|aug|august|sep|september|oct|october|nov|november|dec|december", DAYNAME: "mon|monday|tue|tuesday|wed|wednesday|thu|thursday|fri|friday|sat|saturday|sun|sunday", DAY: "3[01]|[12]\\d|0?[1-9]", DAY2: "3[01]|[12]\\d|0[1-9]", TIMEZONE: "[+-][01]\\d\\:?[0-5]\\d", H24: "[01]\\d|2[0-3]", MIN: "[0-5]\\d", SEC: "[0-5]\\d", MS: "\\d{3,}", H12: "0?[1-9]|1[012]", AMPM: "am|pm", UNIT: "year|month|week|day|hour|minute|second|millisecond" }); c(this, "patterns", [ // 2010-03-15 ["iso_8601", this.makePattern("^(_YEAR_)-(_MONTH_)-(_DAY_)$"), "$2/$3/$1"], // 3-15-2010 ["us", this.makePattern("^(_MONTH_)([\\/-])(_DAY_)\\2(_YEAR_)$"), "$1/$3/$4"], // 15.03.2010 ["world", this.makePattern("^(_DAY_)([\\/\\.])(_MONTH_)\\2(_YEAR_)$"), "$3/$1/$4"], // 15-Mar-2010, 8 Dec 2011, "Thu, 8 Dec 2011" ["chicago", this.makePattern("^(?:(?:_DAYNAME_),? )?(_DAY_)([ -])(_MONTHNAME_)\\2(_YEAR_)$"), "$3 $1, $4"], // "March 4, 2012", "Mar 4 2012", "Sun Mar 4 2012" ["conversational", this.makePattern("^(?:(?:_DAYNAME_),? )?(_MONTHNAME_) (_DAY_),? (_YEAR_)$"), "$1 $2, $3"], // Tue Jun 22 17:47:27 +0000 2010 [ "month_day_time_year", this.makePattern("^(?:_DAYNAME_) (_MONTHNAME_) (_DAY_) ((?:_H24_)\\:(?:_MIN_)(?:\\:_SEC_)?) (_TIMEZONE_) (_YEAR_)$"), (r) => { const e = ("" + this.getMonthByName(r[1])).padStart(2, "0"), n = ("" + r[2]).padStart(2, "0"), a = r[5], s = r[3], i = r[4], o = a + "-" + e + "-" + n + "T" + s + i; return isNaN(o) ? !1 : o; } ], // @123456789 [ "unix", /^@(-?\d+)$/, (r) => this.create(parseInt(r[1], 10) * 1e3) ], // 24-hour time (This will help catch Date objects that are casted to a string) [ "24_hour", this.makePattern("^(?:(.+?)(?: |T))?(_H24_)\\:(_MIN_)(?:\\:(_SEC_)(?:\\.(_MS_))?)? ?(?:GMT)?(_TIMEZONE_)?(?: \\([A-Z]+\\))?$"), (r) => { let e; const n = r[1]; if (n) { if (e = this.create(n), isNaN(e)) return !1; } else e = /* @__PURE__ */ new Date(), e.setMilliseconds(0); const a = r[2], s = r[3], i = r[4], o = r[5]; return e.setHours(parseFloat(a), parseFloat(s), parseFloat(i || 0)), o && e.setMilliseconds(+String(o).slice(0, 3)), e; } ], // 12-hour time [ "12_hour", this.makePattern("^(?:(.+) )?(_H12_)(?:\\:(_MIN_)(?:\\:(_SEC_))?)? ?(_AMPM_)$"), (r) => { let e; const n = r[1]; if (n) { if (e = this.create(n), isNaN(e)) return !1; } else e = /* @__PURE__ */ new Date(), e.setMilliseconds(0); let a = parseFloat(r[2]); a = r[5].toLowerCase() === "am" ? a === 12 ? 0 : a : a === 12 ? 12 : a + 12; const s = r[3], i = r[4]; return e.setHours(a, parseFloat(s || 0), parseFloat(i || 0)), e; } ] ]); } makePattern(r) { return r = r.replace(/_([A-Z][A-Z0-9]+)_/g, (e, n) => this.regexes[n]), new RegExp(r, "i"); } getMonthByName(r) { return bt[String(r).slice(0, 3).toLowerCase()]; } getWeekdayByName(r) { return xt[String(r).slice(0, 3).toLowerCase()]; } parse(r) { if (!isNaN(Number(r))) return new Date(r); if (r = String(r).replace(/^\s*(.*)\s*$/, "$1"), r = r.replace(/\s{2,}/g, " "), r === "") return Date.now(); let e = 0; for (; e < this.patterns.length; ) { const n = this.patterns[e]; let a, s; typeof n[0] == "string" ? (s = n[1], a = n[2]) : (s = n[0], a = n[1]); const i = r.match(s); if (!i) { e++; continue; } if (typeof a == "function") { const o = a(i); if (o instanceof Date) return o; } else { const o = Date.parse(r.replace(s, a)); if (!isNaN(o)) return new Date(o); } e++; } return NaN; } create(r) { return r == null ? Date.now() : r instanceof Date ? r : this.parse(r); } } function Y(t) { const r = Object.prototype.toString.call(t); return t instanceof Date || typeof t == "object" && r === "[object Date]" ? new t.constructor(+t) : typeof t == "number" || r === "[object Number]" || typeof t == "string" || r === "[object String]" ? new Date(t) : /* @__PURE__ */ new Date(NaN); } function N(t, r) { return t instanceof Date ? new t.constructor(r) : new Date(r); } function Xe(t, r) { const e = Y(t); return isNaN(r) ? N(t, NaN) : (r && e.setDate(e.getDate() + r), e); } const ze = 6048e5, pt = 864e5, ke = 6e4, Oe = 36e5, vt = 1e3; let Tt = {}; function ae() { return Tt; } function S(t, r) { var o, u, m, b; const e = ae(), n = (r == null ? void 0 : r.weekStartsOn) ?? ((u = (o = r == null ? void 0 : r.locale) == null ? void 0 : o.options) == null ? void 0 : u.weekStartsOn) ?? e.weekStartsOn ?? ((b = (m = e.locale) == null ? void 0 : m.options) == null ? void 0 : b.weekStartsOn) ?? 0, a = Y(t), s = a.getDay(), i = (s < n ? 7 : 0) + s - n; return a.setDate(a.getDate() - i), a.setHours(0, 0, 0, 0), a; } function re(t) { return S(t, { weekStartsOn: 1 }); } function je(t) { const r = Y(t), e = r.getFullYear(), n = N(t, 0); n.setFullYear(e + 1, 0, 4), n.setHours(0, 0, 0, 0); const a = re(n), s = N(t, 0); s.setFullYear(e, 0, 4), s.setHours(0, 0, 0, 0); const i = re(s); return r.getTime() >= a.getTime() ? e + 1 : r.getTime() >= i.getTime() ? e : e - 1; } function Ae(t) { const r = Y(t); return r.setHours(0, 0, 0, 0), r; } function we(t) { const r = Y(t), e = new Date( Date.UTC( r.getFullYear(), r.getMonth(), r.getDate(), r.getHours(), r.getMinutes(), r.getSeconds(), r.getMilliseconds() ) ); return e.setUTCFullYear(r.getFullYear()), +t - +e; } function Dt(t, r) { const e = Ae(t), n = Ae(r), a = +e - we(e), s = +n - we(n); return Math.round((a - s) / pt); } function Mt(t) { const r = je(t), e = N(t, 0); return e.setFullYear(r, 0, 4), e.setHours(0, 0, 0, 0), re(e); } function Nt(t) { return t instanceof Date || typeof t == "object" && Object.prototype.toString.call(t) === "[object Date]"; } function Ge(t) { if (!Nt(t) && typeof t != "number") return !1; const r = Y(t); return !isNaN(Number(r)); } function kt(t) { const r = Y(t), e = N(t, 0); return e.setFullYear(r.getFullYear(), 0, 1), e.setHours(0, 0, 0, 0), e; } const Ot = { 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" } }, _t = (t, r, e) => { let n; const a = Ot[t]; return typeof a == "string" ? n = a : r === 1 ? n = a.one : n = a.other.replace("{{count}}", r.toString()), e != null && e.addSuffix ? e.comparison && e.comparison > 0 ? "in " + n : n + " ago" : n; }; function xe(t) { return (r = {}) => { const e = r.width ? String(r.width) : t.defaultWidth; return t.formats[e] || t.formats[t.defaultWidth]; }; } const Pt = { full: "EEEE, MMMM do, y", long: "MMMM do, y", medium: "MMM d, y", short: "MM/dd/yyyy" }, Ct = { full: "h:mm:ss a zzzz", long: "h:mm:ss a z", medium: "h:mm:ss a", short: "h:mm a" }, Yt = { full: "{{date}} 'at' {{time}}", long: "{{date}} 'at' {{time}}", medium: "{{date}}, {{time}}", short: "{{date}}, {{time}}" }, Et = { date: xe({ formats: Pt, defaultWidth: "full" }), time: xe({ formats: Ct, defaultWidth: "full" }), dateTime: xe({ formats: Yt, defaultWidth: "full" }) }, At = { lastWeek: "'last' eeee 'at' p", yesterday: "'yesterday at' p", today: "'today at' p", tomorrow: "'tomorrow at' p", nextWeek: "eeee 'at' p", other: "P" }, Ht = (t, r, e, n) => At[t]; function ue(t) { return (r, e) => { const n = e != null && e.context ? String(e.context) : "standalone"; let a; if (n === "formatting" && t.formattingValues) { const i = t.defaultFormattingWidth || t.defaultWidth, o = e != null && e.width ? String(e.width) : i; a = t.formattingValues[o] || t.formattingValues[i]; } else { const i = t.defaultWidth, o = e != null && e.width ? String(e.width) : t.defaultWidth; a = t.values[o] || t.values[i]; } const s = t.argumentCallback ? t.argumentCallback(r) : r; return a[s]; }; } const Wt = { narrow: ["B", "A"], abbreviated: ["BC", "AD"], wide: ["Before Christ", "Anno Domini"] }, qt = { narrow: ["1", "2", "3", "4"], abbreviated: ["Q1", "Q2", "Q3", "Q4"], wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"] }, Rt = { 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" ] }, It = { 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" ] }, Lt = { 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" } }, Bt = { 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" } }, Ft = (t, r) => { const e = Number(t), n = e % 100; if (n > 20 || n < 10) switch (n % 10) { case 1: return e + "st"; case 2: return e + "nd"; case 3: return e + "rd"; } return e + "th"; }, Qt = { ordinalNumber: Ft, era: ue({ values: Wt, defaultWidth: "wide" }), quarter: ue({ values: qt, defaultWidth: "wide", argumentCallback: (t) => t - 1 }), month: ue({ values: Rt, defaultWidth: "wide" }), day: ue({ values: It, defaultWidth: "wide" }), dayPeriod: ue({ values: Lt, defaultWidth: "wide", formattingValues: Bt, defaultFormattingWidth: "wide" }) }; function ce(t) { return (r, e = {}) => { const n = e.width, a = n && t.matchPatterns[n] || t.matchPatterns[t.defaultMatchWidth], s = r.match(a); if (!s) return null; const i = s[0], o = n && t.parsePatterns[n] || t.parsePatterns[t.defaultParseWidth], u = Array.isArray(o) ? Xt(o, (w) => w.test(i)) : ( // eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type $t(o, (w) => w.test(i)) ); let m; m = t.valueCallback ? t.valueCallback(u) : u, m = e.valueCallback ? ( // eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type e.valueCallback(m) ) : m; const b = r.slice(i.length); return { value: m, rest: b }; }; } function $t(t, r) { for (const e in t) if (Object.prototype.hasOwnProperty.call(t, e) && r(t[e])) return e; } function Xt(t, r) { for (let e = 0; e < t.length; e++) if (r(t[e])) return e; } function zt(t) { return (r, e = {}) => { const n = r.match(t.matchPattern); if (!n) return null; const a = n[0], s = r.match(t.parsePattern); if (!s) return null; let i = t.valueCallback ? t.valueCallback(s[0]) : s[0]; i = e.valueCallback ? e.valueCallback(i) : i; const o = r.slice(a.length); return { value: i, rest: o }; }; } const jt = /^(\d+)(th|st|nd|rd)?/i, Gt = /\d+/i, Ut = { 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 }, Vt = { any: [/^b/i, /^(a|c)/i] }, Zt = { narrow: /^[1234]/i, abbreviated: /^q[1234]/i, wide: /^[1234](th|st|nd|rd)? quarter/i }, Kt = { any: [/1/i, /2/i, /3/i, /4/i] }, St = { 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 }, Jt = { 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 ] }, en = { 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 }, tn = { 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] }, nn = { 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 }, rn = { 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 } }, an = { ordinalNumber: zt({ matchPattern: jt, parsePattern: Gt, valueCallback: (t) => parseInt(t, 10) }), era: ce({ matchPatterns: Ut, defaultMatchWidth: "wide", parsePatterns: Vt, defaultParseWidth: "any" }), quarter: ce({ matchPatterns: Zt, defaultMatchWidth: "wide", parsePatterns: Kt, defaultParseWidth: "any", valueCallback: (t) => t + 1 }), month: ce({ matchPatterns: St, defaultMatchWidth: "wide", parsePatterns: Jt, defaultParseWidth: "any" }), day: ce({ matchPatterns: en, defaultMatchWidth: "wide", parsePatterns: tn, defaultParseWidth: "any" }), dayPeriod: ce({ matchPatterns: nn, defaultMatchWidth: "any", parsePatterns: rn, defaultParseWidth: "any" }) }, Ue = { code: "en-US", formatDistance: _t, formatLong: Et, formatRelative: Ht, localize: Qt, match: an, options: { weekStartsOn: 0, firstWeekContainsDate: 1 } }; function sn(t) { const r = Y(t); return Dt(r, kt(r)) + 1; } function Ve(t) { const r = Y(t), e = +re(r) - +Mt(r); return Math.round(e / ze) + 1; } function _e(t, r) { var b, w, P, D; const e = Y(t), n = e.getFullYear(), a = ae(), s = (r == null ? void 0 : r.firstWeekContainsDate) ?? ((w = (b = r == null ? void 0 : r.locale) == null ? void 0 : b.options) == null ? void 0 : w.firstWeekContainsDate) ?? a.firstWeekContainsDate ?? ((D = (P = a.locale) == null ? void 0 : P.options) == null ? void 0 : D.firstWeekContainsDate) ?? 1, i = N(t, 0); i.setFullYear(n + 1, 0, s), i.setHours(0, 0, 0, 0); const o = S(i, r), u = N(t, 0); u.setFullYear(n, 0, s), u.setHours(0, 0, 0, 0); const m = S(u, r); return e.getTime() >= o.getTime() ? n + 1 : e.getTime() >= m.getTime() ? n : n - 1; } function on(t, r) { var o, u, m, b; const e = ae(), n = (r == null ? void 0 : r.firstWeekContainsDate) ?? ((u = (o = r == null ? void 0 : r.locale) == null ? void 0 : o.options) == null ? void 0 : u.firstWeekContainsDate) ?? e.firstWeekContainsDate ?? ((b = (m = e.locale) == null ? void 0 : m.options) == null ? void 0 : b.firstWeekContainsDate) ?? 1, a = _e(t, r), s = N(t, 0); return s.setFullYear(a, 0, n), s.setHours(0, 0, 0, 0), S(s, r); } function Ze(t, r) { const e = Y(t), n = +S(e, r) - +on(e, r); return Math.round(n / ze) + 1; } function v(t, r) { const e = t < 0 ? "-" : "", n = Math.abs(t).toString().padStart(r, "0"); return e + n; } const Z = { // Year y(t, r) { const e = t.getFullYear(), n = e > 0 ? e : 1 - e; return v(r === "yy" ? n % 100 : n, r.length); }, // Month M(t, r) { const e = t.getMonth(); return r === "M" ? String(e + 1) : v(e + 1, 2); }, // Day of the month d(t, r) { return v(t.getDate(), r.length); }, // AM or PM a(t, r) { const e = t.getHours() / 12 >= 1 ? "pm" : "am"; switch (r) { case "a": case "aa": return e.toUpperCase(); case "aaa": return e; case "aaaaa": return e[0]; case "aaaa": default: return e === "am" ? "a.m." : "p.m."; } }, // Hour [1-12] h(t, r) { return v(t.getHours() % 12 || 12, r.length); }, // Hour [0-23] H(t, r) { return v(t.getHours(), r.length); }, // Minute m(t, r) { return v(t.getMinutes(), r.length); }, // Second s(t, r) { return v(t.getSeconds(), r.length); }, // Fraction of second S(t, r) { const e = r.length, n = t.getMilliseconds(), a = Math.trunc( n * Math.pow(10, e - 3) ); return v(a, r.length); } }, ee = { am: "am", pm: "pm", midnight: "midnight", noon: "noon", morning: "morning", afternoon: "afternoon", evening: "evening", night: "night" }, He = { // Era G: function(t, r, e) { const n = t.getFullYear() > 0 ? 1 : 0; switch (r) { case "G": case "GG": case "GGG": return e.era(n, { width: "abbreviated" }); case "GGGGG": return e.era(n, { width: "narrow" }); case "GGGG": default: return e.era(n, { width: "wide" }); } }, // Year y: function(t, r, e) { if (r === "yo") { const n = t.getFullYear(), a = n > 0 ? n : 1 - n; return e.ordinalNumber(a, { unit: "year" }); } return Z.y(t, r); }, // Local week-numbering year Y: function(t, r, e, n) { const a = _e(t, n), s = a > 0 ? a : 1 - a; if (r === "YY") { const i = s % 100; return v(i, 2); } return r === "Yo" ? e.ordinalNumber(s, { unit: "year" }) : v(s, r.length); }, // ISO week-numbering year R: function(t, r) { const e = je(t); return v(e, r.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, r) { const e = t.getFullYear(); return v(e, r.length); }, // Quarter Q: function(t, r, e) { const n = Math.ceil((t.getMonth() + 1) / 3); switch (r) { case "Q": return String(n); case "QQ": return v(n, 2); case "Qo": return e.ordinalNumber(n, { unit: "quarter" }); case "QQQ": return e.quarter(n, { width: "abbreviated", context: "formatting" }); case "QQQQQ": return e.quarter(n, { width: "narrow", context: "formatting" }); case "QQQQ": default: return e.quarter(n, { width: "wide", context: "formatting" }); } }, // Stand-alone quarter q: function(t, r, e) { const n = Math.ceil((t.getMonth() + 1) / 3); switch (r) { case "q": return String(n); case "qq": return v(n, 2); case "qo": return e.ordinalNumber(n, { unit: "quarter" }); case "qqq": return e.quarter(n, { width: "abbreviated", context: "standalone" }); case "qqqqq": return e.quarter(n, { width: "narrow", context: "standalone" }); case "qqqq": default: return e.quarter(n, { width: "wide", context: "standalone" }); } }, // Month M: function(t, r, e) { const n = t.getMonth(); switch (r) { case "M": case "MM": return Z.M(t, r); case "Mo": return e.ordinalNumber(n + 1, { unit: "month" }); case "MMM": return e.month(n, { width: "abbreviated", context: "formatting" }); case "MMMMM": return e.month(n, { width: "narrow", context: "formatting" }); case "MMMM": default: return e.month(n, { width: "wide", context: "formatting" }); } }, // Stand-alone month L: function(t, r, e) { const n = t.getMonth(); switch (r) { case "L": return String(n + 1); case "LL": return v(n + 1, 2); case "Lo": return e.ordinalNumber(n + 1, { unit: "month" }); case "LLL": return e.month(n, { width: "abbreviated", context: "standalone" }); case "LLLLL": return e.month(n, { width: "narrow", context: "standalone" }); case "LLLL": default: return e.month(n, { width: "wide", context: "standalone" }); } }, // Local week of year w: function(t, r, e, n) { const a = Ze(t, n); return r === "wo" ? e.ordinalNumber(a, { unit: "week" }) : v(a, r.length); }, // ISO week of year I: function(t, r, e) { const n = Ve(t); return r === "Io" ? e.ordinalNumber(n, { unit: "week" }) : v(n, r.length); }, // Day of the month d: function(t, r, e) { return r === "do" ? e.ordinalNumber(t.getDate(), { unit: "date" }) : Z.d(t, r); }, // Day of year D: function(t, r, e) { const n = sn(t); return r === "Do" ? e.ordinalNumber(n, { unit: "dayOfYear" }) : v(n, r.length); }, // Day of week E: function(t, r, e) { const n = t.getDay(); switch (r) { case "E": case "EE": case "EEE": return e.day(n, { width: "abbreviated", context: "formatting" }); case "EEEEE": return e.day(n, { width: "narrow", context: "formatting" }); case "EEEEEE": return e.day(n, { width: "short", context: "formatting" }); case "EEEE": default: return e.day(n, { width: "wide", context: "formatting" }); } }, // Local day of week e: function(t, r, e, n) { const a = t.getDay(), s = (a - n.weekStartsOn + 8) % 7 || 7; switch (r) { case "e": return String(s); case "ee": return v(s, 2); case "eo": return e.ordinalNumber(s, { unit: "day" }); case "eee": return e.day(a, { width: "abbreviated", context: "formatting" }); case "eeeee": return e.day(a, { width: "narrow", context: "formatting" }); case "eeeeee": return e.day(a, { width: "short", context: "formatting" }); case "eeee": default: return e.day(a, { width: "wide", context: "formatting" }); } }, // Stand-alone local day of week c: function(t, r, e, n) { const a = t.getDay(), s = (a - n.weekStartsOn + 8) % 7 || 7; switch (r) { case "c": return String(s); case "cc": return v(s, r.length); case "co": return e.ordinalNumber(s, { unit: "day" }); case "ccc": return e.day(a, { width: "abbreviated", context: "standalone" }); case "ccccc": return e.day(a, { width: "narrow", context: "standalone" }); case "cccccc": return e.day(a, { width: "short", context: "standalone" }); case "cccc": default: return e.day(a, { width: "wide", context: "standalone" }); } }, // ISO day of week i: function(t, r, e) { const n = t.getDay(), a = n === 0 ? 7 : n; switch (r) { case "i": return String(a); case "ii": return v(a, r.length); case "io": return e.ordinalNumber(a, { unit: "day" }); case "iii": return e.day(n, { width: "abbreviated", context: "formatting" }); case "iiiii": return e.day(n, { width: "narrow", context: "formatting" }); case "iiiiii": return e.day(n, { width: "short", context: "formatting" }); case "iiii": default: return e.day(n, { width: "wide", context: "formatting" }); } }, // AM or PM a: function(t, r, e) { const a = t.getHours() / 12 >= 1 ? "pm" : "am"; switch (r) { case "a": case "aa": return e.dayPeriod(a, { width: "abbreviated", context: "formatting" }); case "aaa": return e.dayPeriod(a, { width: "abbreviated", context: "formatting" }).toLowerCase(); case "aaaaa": return e.dayPeriod(a, { width: "narrow", context: "formatting" }); case "aaaa": default: return e.dayPeriod(a, { width: "wide", context: "formatting" }); } }, // AM, PM, midnight, noon b: function(t, r, e) { const n = t.getHours(); let a; switch (n === 12 ? a = ee.noon : n === 0 ? a = ee.midnight : a = n / 12 >= 1 ? "pm" : "am", r) { case "b": case "bb": return e.dayPeriod(a, { width: "abbreviated", context: "formatting" }); case "bbb": return e.dayPeriod(a, { width: "abbreviated", context: "formatting" }).toLowerCase(); case "bbbbb": return e.dayPeriod(a, { width: "narrow", context: "formatting" }); case "bbbb": default: return e.dayPeriod(a, { width: "wide", context: "formatting" }); } }, // in the morning, in the afternoon, in the evening, at night B: function(t, r, e) { const n = t.getHours(); let a; switch (n >= 17 ? a = ee.evening : n >= 12 ? a = ee.afternoon : n >= 4 ? a = ee.morning : a = ee.night, r) { case "B": case "BB": case "BBB": return e.dayPeriod(a, { width: "abbreviated", context: "formatting" }); case "BBBBB": return e.dayPeriod(a, { width: "narrow", context: "formatting" }); case "BBBB": default: return e.dayPeriod(a, { width: "wide", context: "formatting" }); } }, // Hour [1-12] h: function(t, r, e) { if (r === "ho") { let n = t.getHours() % 12; return n === 0 && (n = 12), e.ordinalNumber(n, { unit: "hour" }); } return Z.h(t, r); }, // Hour [0-23] H: function(t, r, e) { return r === "Ho" ? e.ordinalNumber(t.getHours(), { unit: "hour" }) : Z.H(t, r); }, // Hour [0-11] K: function(t, r, e) { const n = t.getHours() % 12; return r === "Ko" ? e.ordinalNumber(n, { unit: "hour" }) : v(n, r.length); }, // Hour [1-24] k: function(t, r, e) { let n = t.getHours(); return n === 0 && (n = 24), r === "ko" ? e.ordinalNumber(n, { unit: "hour" }) : v(n, r.length); }, // Minute m: function(t, r, e) { return r === "mo" ? e.ordinalNumber(t.getMinutes(), { unit: "minute" }) : Z.m(t, r); }, // Second s: function(t, r, e) { return r === "so" ? e.ordinalNumber(t.getSeconds(), { unit: "second" }) : Z.s(t, r); }, // Fraction of second S: function(t, r) { return Z.S(t, r); }, // Timezone (ISO-8601. If offset is 0, output is always `'Z'`) X: function(t, r, e) { const n = t.getTimezoneOffset(); if (n === 0) return "Z"; switch (r) { case "X": return qe(n); case "XXXX": case "XX": return J(n); case "XXXXX": case "XXX": default: return J(n, ":"); } }, // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent) x: function(t, r, e) { const n = t.getTimezoneOffset(); switch (r) { case "x": return qe(n); case "xxxx": case "xx": return J(n); case "xxxxx": case "xxx": default: return J(n, ":"); } }, // Timezone (GMT) O: function(t, r, e) { const n = t.getTimezoneOffset(); switch (r) { case "O": case "OO": case "OOO": return "GMT" + We(n, ":"); case "OOOO": default: return "GMT" + J(n, ":"); } }, // Timezone (specific non-location) z: function(t, r, e) { const n = t.getTimezoneOffset(); switch (r) { case "z": case "zz": case "zzz": return "GMT" + We(n, ":"); case "zzzz": default: return "GMT" + J(n, ":"); } }, // Seconds timestamp t: function(t, r, e) { const n = Math.trunc(t.getTime() / 1e3); return v(n, r.length); }, // Milliseconds timestamp T: function(t, r, e) { const n = t.getTime(); return v(n, r.length); } }; function We(t, r = "") { const e = t > 0 ? "-" : "+", n = Math.abs(t), a = Math.trunc(n / 60), s = n % 60; return s === 0 ? e + String(a) : e + String(a) + r + v(s, 2); } function qe(t, r) { return t % 60 === 0 ? (t > 0 ? "-" : "+") + v(Math.abs(t) / 60, 2) : J(t, r); } function J(t, r = "") { const e = t > 0 ? "-" : "+", n = Math.abs(t), a = v(Math.trunc(n / 60), 2), s = v(n % 60, 2); return e + a + r + s; } const Re = (t, r) => { switch (t) { case "P": return r.date({ width: "short" }); case "PP": return r.date({ width: "medium" }); case "PPP": return r.date({ width: "long" }); case "PPPP": default: return r.date({ width: "full" }); } }, Ke = (t, r) => { switch (t) { case "p": return r.time({ width: "short" }); case "pp": return r.time({ width: "medium" }); case "ppp": return r.time({ width: "long" }); case "pppp": default: return r.time({ width: "full" }); } }, un = (t, r) => { const e = t.match(/(P+)(p+)?/) || [], n = e[1], a = e[2]; if (!a) return Re(t, r); let s; switch (n) { case "P": s = r.dateTime({ width: "short" }); break; case "PP": s = r.dateTime({ width: "medium" }); break; case "PPP": s = r.dateTime({ width: "long" }); break; case "PPPP": default: s = r.dateTime({ width: "full" }); break; } return s.replace("{{date}}", Re(n, r)).replace("{{time}}", Ke(a, r)); }, Me = { p: Ke, P: un }, cn = /^D+$/, ln = /^Y+$/, dn = ["D", "DD", "YY", "YYYY"]; function Se(t) { return cn.test(t); } function Je(t) { return ln.test(t); } function Ne(t, r, e) { const n = fn(t, r, e); if (console.warn(n), dn.includes(t)) throw new RangeError(n); } function fn(t, r, e) { const n = t[0] === "Y" ? "years" : "days of the month"; return `Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${r}\`) for formatting ${n} to the input \`${e}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`; } const hn = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, mn = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, wn = /^'([^]*?)'?$/, gn = /''/g, yn = /[a-zA-Z]/; function fe(t, r, e) { var b, w, P, D; const n = ae(), a = n.locale ?? Ue, s = n.firstWeekContainsDate ?? ((w = (b = n.locale) == null ? void 0 : b.options) == null ? void 0 : w.firstWeekContainsDate) ?? 1, i = n.weekStartsOn ?? ((D = (P = n.locale) == null ? void 0 : P.options) == null ? void 0 : D.weekStartsOn) ?? 0, o = Y(t); if (!Ge(o)) throw new RangeError("Invalid time value"); let u = r.match(mn).map((p) => { const l = p[0]; if (l === "p" || l === "P") { const d = Me[l]; return d(p, a.formatLong); } return p; }).join("").match(hn).map((p) => { if (p === "''") return { isToken: !1, value: "'" }; const l = p[0]; if (l === "'") return { isToken: !1, value: bn(p) }; if (He[l]) return { isToken: !0, value: p }; if (l.match(yn)) throw new RangeError( "Format string contains an unescaped latin alphabet character `" + l + "`" ); return { isToken: !1, value: p }; }); a.localize.preprocessor && (u = a.localize.preprocessor(o, u)); const m = { firstWeekContainsDate: s, weekStartsOn: i, locale: a }; return u.map((p) => { if (!p.isToken) return p.value; const l = p.value; (Je(l) || Se(l)) && Ne(l, r, String(t)); const d = He[l[0]]; return d(o, l, a.localize, m); }).join(""); } function bn(t) { const r = t.match(wn); return r ? r[1].replace(gn, "'") : t; } function xn() { return Object.assign({}, ae()); } function pn(t) { let e = Y(t).getDay(); return e === 0 && (e = 7), e; } function vn(t, r) { const e = r instanceof Date ? N(r, 0) : new r(0); return e.setFullYear( t.getFullYear(), t.getMonth(), t.getDate() ), e.setHours( t.getHours(), t.getMinutes(), t.getSeconds(), t.getMilliseconds() ), e; } const Tn = 10; class et { constructor() { c(this, "subPriority", 0); } validate(r, e) { return !0; } } class Dn extends et { constructor(r, e, n, a, s) { super(), this.value = r, this.validateValue = e, this.setValue = n, this.priority = a, s && (this.subPriority = s); } validate(r, e) { return this.validateValue(r, this.value, e); } set(r, e, n) { return this.setValue(r, e, this.value, n); } } class Mn extends et { constructor() { super(...arguments); c(this, "priority", Tn); c(this, "subPriority", -1); } set(e, n) { return n.timestampIsSet ? e : N(e, vn(e, Date)); } } class x { run(r, e, n, a) { const s = this.parse(r, e, n, a); return s ? { setter: new Dn( s.value, this.validate, this.set, this.priority, this.subPriority ), rest: s.rest } : null; } validate(r, e, n) { return !0; } } class Nn extends x { constructor() { super(...arguments); c(this, "priority", 140); c(this, "incompatibleTokens", ["R", "u", "t", "T"]); } parse(e, n, a) { switch (n) { case "G": case "GG": case "GGG": return a.era(e, { width: "abbreviated" }) || a.era(e, { width: "narrow" }); case "GGGGG": return a.era(e, { width: "narrow" }); case "GGGG": default: return a.era(e, { width: "wide" }) || a.era(e, { width: "abbreviated" }) || a.era(e, { width: "narrow" }); } } set(e, n, a) { return n.era = a, e.setFullYear(a, 0, 1), e.setHours(0, 0, 0, 0), e; } } const O = { month: /^(1[0-2]|0?\d)/, // 0 to 12 date: /^(3[0-1]|[0-2]?\d)/, // 0 to 31 dayOfYear: /^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/, // 0 to 366 week: /^(5[0-3]|[0-4]?\d)/, // 0 to 53 hour23h: /^(2[0-3]|[0-1]?\d)/, // 0 to 23 hour24h: /^(2[0-4]|[0-1]?\d)/, // 0 to 24 hour11h: /^(1[0-1]|0?\d)/, // 0 to 11 hour12h: /^(1[0-2]|0?\d)/, // 0 to 12 minute: /^[0-5]?\d/, // 0 to 59 second: /^[0-5]?\d/, // 0 to 59 singleDigit: /^\d/, // 0 to 9 twoDigits: /^\d{1,2}/, // 0 to 99 threeDigits: /^\d{1,3}/, // 0 to 999 fourDigits: /^\d{1,4}/, // 0 to 9999 anyDigitsSigned: /^-?\d+/, singleDigitSigned: /^-?\d/, // 0 to 9, -0 to -9 twoDigitsSigned: /^-?\d{1,2}/, // 0 to 99, -0 to -99 threeDigitsSigned: /^-?\d{1,3}/, // 0 to 999, -0 to -999 fourDigitsSigned: /^-?\d{1,4}/ // 0 to 9999, -0 to -9999 }, X = { basicOptionalMinutes: /^([+-])(\d{2})(\d{2})?|Z/, basic: /^([+-])(\d{2})(\d{2})|Z/, basicOptionalSeconds: /^([+-])(\d{2})(\d{2})((\d{2}))?|Z/, extended: /^([+-])(\d{2}):(\d{2})|Z/, extendedOptionalSeconds: /^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/ }; function _(t, r) { return t && { value: r(t.value), rest: t.rest }; } function M(t, r) { const e = r.match(t); return e ? { value: parseInt(e[0], 10), rest: r.slice(e[0].length) } : null; } function z(t, r) { const e = r.match(t); if (!e) return null; if (e[0] === "Z") return { value: 0, rest: r.slice(1) }; const n = e[1] === "+" ? 1 : -1, a = e[2] ? parseInt(e[2], 10) : 0, s = e[3] ? parseInt(e[3], 10) : 0, i = e[5] ? parseInt(e[5], 10) : 0; return { value: n * (a * Oe + s * ke + i * vt), rest: r.slice(e[0].length) }; } function tt(t) { return M(O.anyDigitsSigned, t); } function k(t, r) { switch (t) { case 1: return M(O.singleDigit, r); case 2: return M(O.twoDigits, r); case 3: return M(O.threeDigits, r); case 4: return M(O.fourDigits, r); default: return M(new RegExp("^\\d{1," + t + "}"), r); } } function ge(t, r) { switch (t) { case 1: return M(O.singleDigitSigned, r); case 2: return M(O.twoDigitsSigned, r); case 3: return M(O.threeDigitsSigned, r); case 4: return M(O.fourDigitsSigned, r); default: return M(new RegExp("^-?\\d{1," + t + "}"), r); } } function Pe(t) { switch (t) { case "morning": return 4; case "evening": return 17; case "pm": case "noon": case "afternoon": return 12; case "am": case "midnight": case "night": default: return 0; } } function nt(t, r) { const e = r > 0, n = e ? r : 1 - r; let a; if (n <= 50) a = t || 100; else { const s = n + 50, i = Math.trunc(s / 100) * 100, o = t >= s % 100; a = t + i - (o ? 100 : 0); } return e ? a : 1 - a; } function rt(t) { return t % 400 === 0 || t % 4 === 0 && t % 100 !== 0; } class kn extends x { constructor() { super(...arguments); c(this, "priority", 130); c(this, "incompatibleTokens", ["Y", "R", "u", "w", "I", "i", "e", "c", "t", "T"]); } parse(e, n, a) { const s = (i) => ({ year: i, isTwoDigitYear: n === "yy" }); switch (n) { case "y": return _(k(4, e), s); case "yo": return _( a.ordinalNumber(e, { unit: "year" }), s ); default: return _(k(n.length, e), s); } } validate(e, n) { return n.isTwoDigitYear || n.year > 0; } set(e, n, a) { const s = e.getFullYear(); if (a.isTwoDigitYear) { const o = nt( a.year, s ); return e.setFullYear(o, 0, 1), e.setHours(0, 0, 0, 0), e; } const i = !("era" in n) || n.era === 1 ? a.year : 1 - a.year; return e.setFullYear(i, 0, 1), e.setHours(0, 0,