@agendize/vue-settings
Version:
Vue agendize's settings component
1,948 lines • 87.5 kB
JavaScript
class G extends Error {
}
class xn extends G {
constructor(e) {
super(`Invalid DateTime: ${e.toMessage()}`);
}
}
class bn extends G {
constructor(e) {
super(`Invalid Interval: ${e.toMessage()}`);
}
}
class Fn extends G {
constructor(e) {
super(`Invalid Duration: ${e.toMessage()}`);
}
}
class se extends G {
}
class Mt extends G {
constructor(e) {
super(`Invalid unit ${e}`);
}
}
class D extends G {
}
class A extends G {
constructor() {
super("Zone is an abstract class");
}
}
const c = "numeric", Z = "short", N = "long", ve = {
year: c,
month: c,
day: c
}, kt = {
year: c,
month: Z,
day: c
}, Vn = {
year: c,
month: Z,
day: c,
weekday: Z
}, Nt = {
year: c,
month: N,
day: c
}, It = {
year: c,
month: N,
day: c,
weekday: N
}, Dt = {
hour: c,
minute: c
}, xt = {
hour: c,
minute: c,
second: c
}, bt = {
hour: c,
minute: c,
second: c,
timeZoneName: Z
}, Ft = {
hour: c,
minute: c,
second: c,
timeZoneName: N
}, Vt = {
hour: c,
minute: c,
hourCycle: "h23"
}, Ct = {
hour: c,
minute: c,
second: c,
hourCycle: "h23"
}, Zt = {
hour: c,
minute: c,
second: c,
hourCycle: "h23",
timeZoneName: Z
}, Lt = {
hour: c,
minute: c,
second: c,
hourCycle: "h23",
timeZoneName: N
}, $t = {
year: c,
month: c,
day: c,
hour: c,
minute: c
}, At = {
year: c,
month: c,
day: c,
hour: c,
minute: c,
second: c
}, zt = {
year: c,
month: Z,
day: c,
hour: c,
minute: c
}, Ut = {
year: c,
month: Z,
day: c,
hour: c,
minute: c,
second: c
}, Cn = {
year: c,
month: Z,
day: c,
weekday: Z,
hour: c,
minute: c
}, Rt = {
year: c,
month: N,
day: c,
hour: c,
minute: c,
timeZoneName: Z
}, Wt = {
year: c,
month: N,
day: c,
hour: c,
minute: c,
second: c,
timeZoneName: Z
}, qt = {
year: c,
month: N,
day: c,
weekday: N,
hour: c,
minute: c,
timeZoneName: N
}, Ht = {
year: c,
month: N,
day: c,
weekday: N,
hour: c,
minute: c,
second: c,
timeZoneName: N
};
class ue {
get type() {
throw new A();
}
get name() {
throw new A();
}
get ianaName() {
return this.name;
}
get isUniversal() {
throw new A();
}
offsetName(e, t) {
throw new A();
}
formatOffset(e, t) {
throw new A();
}
offset(e) {
throw new A();
}
equals(e) {
throw new A();
}
get isValid() {
throw new A();
}
}
let Ve = null;
class Ne extends ue {
static get instance() {
return Ve === null && (Ve = new Ne()), Ve;
}
get type() {
return "system";
}
get name() {
return new Intl.DateTimeFormat().resolvedOptions().timeZone;
}
get isUniversal() {
return !1;
}
offsetName(e, { format: t, locale: r }) {
return Pt(e, t, r);
}
formatOffset(e, t) {
return oe(this.offset(e), t);
}
offset(e) {
return -new Date(e).getTimezoneOffset();
}
equals(e) {
return e.type === "system";
}
get isValid() {
return !0;
}
}
let Se = {};
function Zn(n) {
return Se[n] || (Se[n] = new Intl.DateTimeFormat("en-US", {
hour12: !1,
timeZone: n,
year: "numeric",
month: "2-digit",
day: "2-digit",
hour: "2-digit",
minute: "2-digit",
second: "2-digit",
era: "short"
})), Se[n];
}
const Ln = {
year: 0,
month: 1,
day: 2,
era: 3,
hour: 4,
minute: 5,
second: 6
};
function $n(n, e) {
const t = n.format(e).replace(/\u200E/g, ""), r = /(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(t), [, s, a, i, o, u, l, f] = r;
return [i, s, a, o, u, l, f];
}
function An(n, e) {
const t = n.formatToParts(e), r = [];
for (let s = 0; s < t.length; s++) {
const { type: a, value: i } = t[s], o = Ln[a];
a === "era" ? r[o] = i : m(o) || (r[o] = parseInt(i, 10));
}
return r;
}
let he = {};
class $ extends ue {
static create(e) {
return he[e] || (he[e] = new $(e)), he[e];
}
static resetCache() {
he = {}, Se = {};
}
static isValidSpecifier(e) {
return this.isValidZone(e);
}
static isValidZone(e) {
if (!e)
return !1;
try {
return new Intl.DateTimeFormat("en-US", { timeZone: e }).format(), !0;
} catch {
return !1;
}
}
constructor(e) {
super(), this.zoneName = e, this.valid = $.isValidZone(e);
}
get type() {
return "iana";
}
get name() {
return this.zoneName;
}
get isUniversal() {
return !1;
}
offsetName(e, { format: t, locale: r }) {
return Pt(e, t, r, this.name);
}
formatOffset(e, t) {
return oe(this.offset(e), t);
}
offset(e) {
const t = new Date(e);
if (isNaN(t))
return NaN;
const r = Zn(this.name);
let [s, a, i, o, u, l, f] = r.formatToParts ? An(r, t) : $n(r, t);
o === "BC" && (s = -Math.abs(s) + 1);
const S = De({
year: s,
month: a,
day: i,
hour: u === 24 ? 0 : u,
minute: l,
second: f,
millisecond: 0
});
let d = +t;
const O = d % 1e3;
return d -= O >= 0 ? O : 1e3 + O, (S - d) / (60 * 1e3);
}
equals(e) {
return e.type === "iana" && e.name === this.name;
}
get isValid() {
return this.valid;
}
}
let Ke = {};
function zn(n, e = {}) {
const t = JSON.stringify([n, e]);
let r = Ke[t];
return r || (r = new Intl.ListFormat(n, e), Ke[t] = r), r;
}
let Ue = {};
function Re(n, e = {}) {
const t = JSON.stringify([n, e]);
let r = Ue[t];
return r || (r = new Intl.DateTimeFormat(n, e), Ue[t] = r), r;
}
let We = {};
function Un(n, e = {}) {
const t = JSON.stringify([n, e]);
let r = We[t];
return r || (r = new Intl.NumberFormat(n, e), We[t] = r), r;
}
let qe = {};
function Rn(n, e = {}) {
const { base: t, ...r } = e, s = JSON.stringify([n, r]);
let a = qe[s];
return a || (a = new Intl.RelativeTimeFormat(n, e), qe[s] = a), a;
}
let ie = null;
function Wn() {
return ie || (ie = new Intl.DateTimeFormat().resolvedOptions().locale, ie);
}
function qn(n) {
const e = n.indexOf("-x-");
e !== -1 && (n = n.substring(0, e));
const t = n.indexOf("-u-");
if (t === -1)
return [n];
{
let r, s;
try {
r = Re(n).resolvedOptions(), s = n;
} catch {
const u = n.substring(0, t);
r = Re(u).resolvedOptions(), s = u;
}
const { numberingSystem: a, calendar: i } = r;
return [s, a, i];
}
}
function Hn(n, e, t) {
return (t || e) && (n.includes("-u-") || (n += "-u"), t && (n += `-ca-${t}`), e && (n += `-nu-${e}`)), n;
}
function Yn(n) {
const e = [];
for (let t = 1; t <= 12; t++) {
const r = h.utc(2009, t, 1);
e.push(n(r));
}
return e;
}
function Pn(n) {
const e = [];
for (let t = 1; t <= 7; t++) {
const r = h.utc(2016, 11, 13 + t);
e.push(n(r));
}
return e;
}
function me(n, e, t, r) {
const s = n.listingMode();
return s === "error" ? null : s === "en" ? t(e) : r(e);
}
function Gn(n) {
return n.numberingSystem && n.numberingSystem !== "latn" ? !1 : n.numberingSystem === "latn" || !n.locale || n.locale.startsWith("en") || new Intl.DateTimeFormat(n.intl).resolvedOptions().numberingSystem === "latn";
}
class Jn {
constructor(e, t, r) {
this.padTo = r.padTo || 0, this.floor = r.floor || !1;
const { padTo: s, floor: a, ...i } = r;
if (!t || Object.keys(i).length > 0) {
const o = { useGrouping: !1, ...r };
r.padTo > 0 && (o.minimumIntegerDigits = r.padTo), this.inf = Un(e, o);
}
}
format(e) {
if (this.inf) {
const t = this.floor ? Math.floor(e) : e;
return this.inf.format(t);
} else {
const t = this.floor ? Math.floor(e) : Ge(e, 3);
return E(t, this.padTo);
}
}
}
class _n {
constructor(e, t, r) {
this.opts = r, this.originalZone = void 0;
let s;
if (this.opts.timeZone)
this.dt = e;
else if (e.zone.type === "fixed") {
const i = -1 * (e.offset / 60), o = i >= 0 ? `Etc/GMT+${i}` : `Etc/GMT${i}`;
e.offset !== 0 && $.create(o).valid ? (s = o, this.dt = e) : (s = "UTC", this.dt = e.offset === 0 ? e : e.setZone("UTC").plus({ minutes: e.offset }), this.originalZone = e.zone);
} else
e.zone.type === "system" ? this.dt = e : e.zone.type === "iana" ? (this.dt = e, s = e.zone.name) : (s = "UTC", this.dt = e.setZone("UTC").plus({ minutes: e.offset }), this.originalZone = e.zone);
const a = { ...this.opts };
a.timeZone = a.timeZone || s, this.dtf = Re(t, a);
}
format() {
return this.originalZone ? this.formatToParts().map(({ value: e }) => e).join("") : this.dtf.format(this.dt.toJSDate());
}
formatToParts() {
const e = this.dtf.formatToParts(this.dt.toJSDate());
return this.originalZone ? e.map((t) => {
if (t.type === "timeZoneName") {
const r = this.originalZone.offsetName(this.dt.ts, {
locale: this.dt.locale,
format: this.opts.timeZoneName
});
return {
...t,
value: r
};
} else
return t;
}) : e;
}
resolvedOptions() {
return this.dtf.resolvedOptions();
}
}
class jn {
constructor(e, t, r) {
this.opts = { style: "long", ...r }, !t && Yt() && (this.rtf = Rn(e, r));
}
format(e, t) {
return this.rtf ? this.rtf.format(e, t) : dr(t, e, this.opts.numeric, this.opts.style !== "long");
}
formatToParts(e, t) {
return this.rtf ? this.rtf.formatToParts(e, t) : [];
}
}
class T {
static fromOpts(e) {
return T.create(e.locale, e.numberingSystem, e.outputCalendar, e.defaultToEN);
}
static create(e, t, r, s = !1) {
const a = e || v.defaultLocale, i = a || (s ? "en-US" : Wn()), o = t || v.defaultNumberingSystem, u = r || v.defaultOutputCalendar;
return new T(i, o, u, a);
}
static resetCache() {
ie = null, Ue = {}, We = {}, qe = {};
}
static fromObject({ locale: e, numberingSystem: t, outputCalendar: r } = {}) {
return T.create(e, t, r);
}
constructor(e, t, r, s) {
const [a, i, o] = qn(e);
this.locale = a, this.numberingSystem = t || i || null, this.outputCalendar = r || o || null, this.intl = Hn(this.locale, this.numberingSystem, this.outputCalendar), this.weekdaysCache = { format: {}, standalone: {} }, this.monthsCache = { format: {}, standalone: {} }, this.meridiemCache = null, this.eraCache = {}, this.specifiedLocale = s, this.fastNumbersCached = null;
}
get fastNumbers() {
return this.fastNumbersCached == null && (this.fastNumbersCached = Gn(this)), this.fastNumbersCached;
}
listingMode() {
const e = this.isEnglish(), t = (this.numberingSystem === null || this.numberingSystem === "latn") && (this.outputCalendar === null || this.outputCalendar === "gregory");
return e && t ? "en" : "intl";
}
clone(e) {
return !e || Object.getOwnPropertyNames(e).length === 0 ? this : T.create(
e.locale || this.specifiedLocale,
e.numberingSystem || this.numberingSystem,
e.outputCalendar || this.outputCalendar,
e.defaultToEN || !1
);
}
redefaultToEN(e = {}) {
return this.clone({ ...e, defaultToEN: !0 });
}
redefaultToSystem(e = {}) {
return this.clone({ ...e, defaultToEN: !1 });
}
months(e, t = !1) {
return me(this, e, _t, () => {
const r = t ? { month: e, day: "numeric" } : { month: e }, s = t ? "format" : "standalone";
return this.monthsCache[s][e] || (this.monthsCache[s][e] = Yn((a) => this.extract(a, r, "month"))), this.monthsCache[s][e];
});
}
weekdays(e, t = !1) {
return me(this, e, Qt, () => {
const r = t ? { weekday: e, year: "numeric", month: "long", day: "numeric" } : { weekday: e }, s = t ? "format" : "standalone";
return this.weekdaysCache[s][e] || (this.weekdaysCache[s][e] = Pn(
(a) => this.extract(a, r, "weekday")
)), this.weekdaysCache[s][e];
});
}
meridiems() {
return me(
this,
void 0,
() => Kt,
() => {
if (!this.meridiemCache) {
const e = { hour: "numeric", hourCycle: "h12" };
this.meridiemCache = [h.utc(2016, 11, 13, 9), h.utc(2016, 11, 13, 19)].map(
(t) => this.extract(t, e, "dayperiod")
);
}
return this.meridiemCache;
}
);
}
eras(e) {
return me(this, e, Xt, () => {
const t = { era: e };
return this.eraCache[e] || (this.eraCache[e] = [h.utc(-40, 1, 1), h.utc(2017, 1, 1)].map(
(r) => this.extract(r, t, "era")
)), this.eraCache[e];
});
}
extract(e, t, r) {
const s = this.dtFormatter(e, t), a = s.formatToParts(), i = a.find((o) => o.type.toLowerCase() === r);
return i ? i.value : null;
}
numberFormatter(e = {}) {
return new Jn(this.intl, e.forceSimple || this.fastNumbers, e);
}
dtFormatter(e, t = {}) {
return new _n(e, this.intl, t);
}
relFormatter(e = {}) {
return new jn(this.intl, this.isEnglish(), e);
}
listFormatter(e = {}) {
return zn(this.intl, e);
}
isEnglish() {
return this.locale === "en" || this.locale.toLowerCase() === "en-us" || new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us");
}
equals(e) {
return this.locale === e.locale && this.numberingSystem === e.numberingSystem && this.outputCalendar === e.outputCalendar;
}
}
let Ce = null;
class k extends ue {
static get utcInstance() {
return Ce === null && (Ce = new k(0)), Ce;
}
static instance(e) {
return e === 0 ? k.utcInstance : new k(e);
}
static parseSpecifier(e) {
if (e) {
const t = e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);
if (t)
return new k(xe(t[1], t[2]));
}
return null;
}
constructor(e) {
super(), this.fixed = e;
}
get type() {
return "fixed";
}
get name() {
return this.fixed === 0 ? "UTC" : `UTC${oe(this.fixed, "narrow")}`;
}
get ianaName() {
return this.fixed === 0 ? "Etc/UTC" : `Etc/GMT${oe(-this.fixed, "narrow")}`;
}
offsetName() {
return this.name;
}
formatOffset(e, t) {
return oe(this.fixed, t);
}
get isUniversal() {
return !0;
}
offset() {
return this.fixed;
}
equals(e) {
return e.type === "fixed" && e.fixed === this.fixed;
}
get isValid() {
return !0;
}
}
class Bn extends ue {
constructor(e) {
super(), this.zoneName = e;
}
get type() {
return "invalid";
}
get name() {
return this.zoneName;
}
get isUniversal() {
return !1;
}
offsetName() {
return null;
}
formatOffset() {
return "";
}
offset() {
return NaN;
}
equals() {
return !1;
}
get isValid() {
return !1;
}
}
function R(n, e) {
if (m(n) || n === null)
return e;
if (n instanceof ue)
return n;
if (Qn(n)) {
const t = n.toLowerCase();
return t === "default" ? e : t === "local" || t === "system" ? Ne.instance : t === "utc" || t === "gmt" ? k.utcInstance : k.parseSpecifier(t) || $.create(n);
} else
return P(n) ? k.instance(n) : typeof n == "object" && "offset" in n && typeof n.offset == "function" ? n : new Bn(n);
}
let Xe = () => Date.now(), et = "system", tt = null, nt = null, rt = null, st = 60, it;
class v {
static get now() {
return Xe;
}
static set now(e) {
Xe = e;
}
static set defaultZone(e) {
et = e;
}
static get defaultZone() {
return R(et, Ne.instance);
}
static get defaultLocale() {
return tt;
}
static set defaultLocale(e) {
tt = e;
}
static get defaultNumberingSystem() {
return nt;
}
static set defaultNumberingSystem(e) {
nt = e;
}
static get defaultOutputCalendar() {
return rt;
}
static set defaultOutputCalendar(e) {
rt = e;
}
static get twoDigitCutoffYear() {
return st;
}
static set twoDigitCutoffYear(e) {
st = e % 100;
}
static get throwOnInvalid() {
return it;
}
static set throwOnInvalid(e) {
it = e;
}
static resetCaches() {
T.resetCache(), $.resetCache();
}
}
function m(n) {
return typeof n > "u";
}
function P(n) {
return typeof n == "number";
}
function Ie(n) {
return typeof n == "number" && n % 1 === 0;
}
function Qn(n) {
return typeof n == "string";
}
function Kn(n) {
return Object.prototype.toString.call(n) === "[object Date]";
}
function Yt() {
try {
return typeof Intl < "u" && !!Intl.RelativeTimeFormat;
} catch {
return !1;
}
}
function Xn(n) {
return Array.isArray(n) ? n : [n];
}
function at(n, e, t) {
if (n.length !== 0)
return n.reduce((r, s) => {
const a = [e(s), s];
return r && t(r[0], a[0]) === r[0] ? r : a;
}, null)[1];
}
function er(n, e) {
return e.reduce((t, r) => (t[r] = n[r], t), {});
}
function B(n, e) {
return Object.prototype.hasOwnProperty.call(n, e);
}
function L(n, e, t) {
return Ie(n) && n >= e && n <= t;
}
function tr(n, e) {
return n - e * Math.floor(n / e);
}
function E(n, e = 2) {
const t = n < 0;
let r;
return t ? r = "-" + ("" + -n).padStart(e, "0") : r = ("" + n).padStart(e, "0"), r;
}
function U(n) {
if (!(m(n) || n === null || n === ""))
return parseInt(n, 10);
}
function q(n) {
if (!(m(n) || n === null || n === ""))
return parseFloat(n);
}
function Pe(n) {
if (!(m(n) || n === null || n === "")) {
const e = parseFloat("0." + n) * 1e3;
return Math.floor(e);
}
}
function Ge(n, e, t = !1) {
const r = 10 ** e;
return (t ? Math.trunc : Math.round)(n * r) / r;
}
function le(n) {
return n % 4 === 0 && (n % 100 !== 0 || n % 400 === 0);
}
function ae(n) {
return le(n) ? 366 : 365;
}
function Ee(n, e) {
const t = tr(e - 1, 12) + 1, r = n + (e - t) / 12;
return t === 2 ? le(r) ? 29 : 28 : [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][t - 1];
}
function De(n) {
let e = Date.UTC(
n.year,
n.month - 1,
n.day,
n.hour,
n.minute,
n.second,
n.millisecond
);
return n.year < 100 && n.year >= 0 && (e = new Date(e), e.setUTCFullYear(n.year, n.month - 1, n.day)), +e;
}
function Me(n) {
const e = (n + Math.floor(n / 4) - Math.floor(n / 100) + Math.floor(n / 400)) % 7, t = n - 1, r = (t + Math.floor(t / 4) - Math.floor(t / 100) + Math.floor(t / 400)) % 7;
return e === 4 || r === 3 ? 53 : 52;
}
function He(n) {
return n > 99 ? n : n > v.twoDigitCutoffYear ? 1900 + n : 2e3 + n;
}
function Pt(n, e, t, r = null) {
const s = new Date(n), a = {
hourCycle: "h23",
year: "numeric",
month: "2-digit",
day: "2-digit",
hour: "2-digit",
minute: "2-digit"
};
r && (a.timeZone = r);
const i = { timeZoneName: e, ...a }, o = new Intl.DateTimeFormat(t, i).formatToParts(s).find((u) => u.type.toLowerCase() === "timezonename");
return o ? o.value : null;
}
function xe(n, e) {
let t = parseInt(n, 10);
Number.isNaN(t) && (t = 0);
const r = parseInt(e, 10) || 0, s = t < 0 || Object.is(t, -0) ? -r : r;
return t * 60 + s;
}
function Gt(n) {
const e = Number(n);
if (typeof n == "boolean" || n === "" || Number.isNaN(e))
throw new D(`Invalid unit value ${n}`);
return e;
}
function ke(n, e) {
const t = {};
for (const r in n)
if (B(n, r)) {
const s = n[r];
if (s == null)
continue;
t[e(r)] = Gt(s);
}
return t;
}
function oe(n, e) {
const t = Math.trunc(Math.abs(n / 60)), r = Math.trunc(Math.abs(n % 60)), s = n >= 0 ? "+" : "-";
switch (e) {
case "short":
return `${s}${E(t, 2)}:${E(r, 2)}`;
case "narrow":
return `${s}${t}${r > 0 ? `:${r}` : ""}`;
case "techie":
return `${s}${E(t, 2)}${E(r, 2)}`;
default:
throw new RangeError(`Value format ${e} is out of range for property format`);
}
}
function be(n) {
return er(n, ["hour", "minute", "second", "millisecond"]);
}
const nr = [
"January",
"February",
"March",
"April",
"May",
"June",
"July",
"August",
"September",
"October",
"November",
"December"
], Jt = [
"Jan",
"Feb",
"Mar",
"Apr",
"May",
"Jun",
"Jul",
"Aug",
"Sep",
"Oct",
"Nov",
"Dec"
], rr = ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"];
function _t(n) {
switch (n) {
case "narrow":
return [...rr];
case "short":
return [...Jt];
case "long":
return [...nr];
case "numeric":
return ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"];
case "2-digit":
return ["01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12"];
default:
return null;
}
}
const jt = [
"Monday",
"Tuesday",
"Wednesday",
"Thursday",
"Friday",
"Saturday",
"Sunday"
], Bt = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"], sr = ["M", "T", "W", "T", "F", "S", "S"];
function Qt(n) {
switch (n) {
case "narrow":
return [...sr];
case "short":
return [...Bt];
case "long":
return [...jt];
case "numeric":
return ["1", "2", "3", "4", "5", "6", "7"];
default:
return null;
}
}
const Kt = ["AM", "PM"], ir = ["Before Christ", "Anno Domini"], ar = ["BC", "AD"], or = ["B", "A"];
function Xt(n) {
switch (n) {
case "narrow":
return [...or];
case "short":
return [...ar];
case "long":
return [...ir];
default:
return null;
}
}
function ur(n) {
return Kt[n.hour < 12 ? 0 : 1];
}
function lr(n, e) {
return Qt(e)[n.weekday - 1];
}
function cr(n, e) {
return _t(e)[n.month - 1];
}
function fr(n, e) {
return Xt(e)[n.year < 0 ? 0 : 1];
}
function dr(n, e, t = "always", r = !1) {
const s = {
years: ["year", "yr."],
quarters: ["quarter", "qtr."],
months: ["month", "mo."],
weeks: ["week", "wk."],
days: ["day", "day", "days"],
hours: ["hour", "hr."],
minutes: ["minute", "min."],
seconds: ["second", "sec."]
}, a = ["hours", "minutes", "seconds"].indexOf(n) === -1;
if (t === "auto" && a) {
const w = n === "days";
switch (e) {
case 1:
return w ? "tomorrow" : `next ${s[n][0]}`;
case -1:
return w ? "yesterday" : `last ${s[n][0]}`;
case 0:
return w ? "today" : `this ${s[n][0]}`;
}
}
const i = Object.is(e, -0) || e < 0, o = Math.abs(e), u = o === 1, l = s[n], f = r ? u ? l[1] : l[2] || l[1] : u ? s[n][0] : n;
return i ? `${o} ${f} ago` : `in ${o} ${f}`;
}
function ot(n, e) {
let t = "";
for (const r of n)
r.literal ? t += r.val : t += e(r.val);
return t;
}
const hr = {
D: ve,
DD: kt,
DDD: Nt,
DDDD: It,
t: Dt,
tt: xt,
ttt: bt,
tttt: Ft,
T: Vt,
TT: Ct,
TTT: Zt,
TTTT: Lt,
f: $t,
ff: zt,
fff: Rt,
ffff: qt,
F: At,
FF: Ut,
FFF: Wt,
FFFF: Ht
};
class M {
static create(e, t = {}) {
return new M(e, t);
}
static parseFormat(e) {
let t = null, r = "", s = !1;
const a = [];
for (let i = 0; i < e.length; i++) {
const o = e.charAt(i);
o === "'" ? (r.length > 0 && a.push({ literal: s || /^\s+$/.test(r), val: r }), t = null, r = "", s = !s) : s || o === t ? r += o : (r.length > 0 && a.push({ literal: /^\s+$/.test(r), val: r }), r = o, t = o);
}
return r.length > 0 && a.push({ literal: s || /^\s+$/.test(r), val: r }), a;
}
static macroTokenToFormatOpts(e) {
return hr[e];
}
constructor(e, t) {
this.opts = t, this.loc = e, this.systemLoc = null;
}
formatWithSystemDefault(e, t) {
return this.systemLoc === null && (this.systemLoc = this.loc.redefaultToSystem()), this.systemLoc.dtFormatter(e, { ...this.opts, ...t }).format();
}
dtFormatter(e, t = {}) {
return this.loc.dtFormatter(e, { ...this.opts, ...t });
}
formatDateTime(e, t) {
return this.dtFormatter(e, t).format();
}
formatDateTimeParts(e, t) {
return this.dtFormatter(e, t).formatToParts();
}
formatInterval(e, t) {
return this.dtFormatter(e.start, t).dtf.formatRange(e.start.toJSDate(), e.end.toJSDate());
}
resolvedOptions(e, t) {
return this.dtFormatter(e, t).resolvedOptions();
}
num(e, t = 0) {
if (this.opts.forceSimple)
return E(e, t);
const r = { ...this.opts };
return t > 0 && (r.padTo = t), this.loc.numberFormatter(r).format(e);
}
formatDateTimeFromString(e, t) {
const r = this.loc.listingMode() === "en", s = this.loc.outputCalendar && this.loc.outputCalendar !== "gregory", a = (d, O) => this.loc.extract(e, d, O), i = (d) => e.isOffsetFixed && e.offset === 0 && d.allowZ ? "Z" : e.isValid ? e.zone.formatOffset(e.ts, d.format) : "", o = () => r ? ur(e) : a({ hour: "numeric", hourCycle: "h12" }, "dayperiod"), u = (d, O) => r ? cr(e, d) : a(O ? { month: d } : { month: d, day: "numeric" }, "month"), l = (d, O) => r ? lr(e, d) : a(
O ? { weekday: d } : { weekday: d, month: "long", day: "numeric" },
"weekday"
), f = (d) => {
const O = M.macroTokenToFormatOpts(d);
return O ? this.formatWithSystemDefault(e, O) : d;
}, w = (d) => r ? fr(e, d) : a({ era: d }, "era"), S = (d) => {
switch (d) {
case "S":
return this.num(e.millisecond);
case "u":
case "SSS":
return this.num(e.millisecond, 3);
case "s":
return this.num(e.second);
case "ss":
return this.num(e.second, 2);
case "uu":
return this.num(Math.floor(e.millisecond / 10), 2);
case "uuu":
return this.num(Math.floor(e.millisecond / 100));
case "m":
return this.num(e.minute);
case "mm":
return this.num(e.minute, 2);
case "h":
return this.num(e.hour % 12 === 0 ? 12 : e.hour % 12);
case "hh":
return this.num(e.hour % 12 === 0 ? 12 : e.hour % 12, 2);
case "H":
return this.num(e.hour);
case "HH":
return this.num(e.hour, 2);
case "Z":
return i({ format: "narrow", allowZ: this.opts.allowZ });
case "ZZ":
return i({ format: "short", allowZ: this.opts.allowZ });
case "ZZZ":
return i({ format: "techie", allowZ: this.opts.allowZ });
case "ZZZZ":
return e.zone.offsetName(e.ts, { format: "short", locale: this.loc.locale });
case "ZZZZZ":
return e.zone.offsetName(e.ts, { format: "long", locale: this.loc.locale });
case "z":
return e.zoneName;
case "a":
return o();
case "d":
return s ? a({ day: "numeric" }, "day") : this.num(e.day);
case "dd":
return s ? a({ day: "2-digit" }, "day") : this.num(e.day, 2);
case "c":
return this.num(e.weekday);
case "ccc":
return l("short", !0);
case "cccc":
return l("long", !0);
case "ccccc":
return l("narrow", !0);
case "E":
return this.num(e.weekday);
case "EEE":
return l("short", !1);
case "EEEE":
return l("long", !1);
case "EEEEE":
return l("narrow", !1);
case "L":
return s ? a({ month: "numeric", day: "numeric" }, "month") : this.num(e.month);
case "LL":
return s ? a({ month: "2-digit", day: "numeric" }, "month") : this.num(e.month, 2);
case "LLL":
return u("short", !0);
case "LLLL":
return u("long", !0);
case "LLLLL":
return u("narrow", !0);
case "M":
return s ? a({ month: "numeric" }, "month") : this.num(e.month);
case "MM":
return s ? a({ month: "2-digit" }, "month") : this.num(e.month, 2);
case "MMM":
return u("short", !1);
case "MMMM":
return u("long", !1);
case "MMMMM":
return u("narrow", !1);
case "y":
return s ? a({ year: "numeric" }, "year") : this.num(e.year);
case "yy":
return s ? a({ year: "2-digit" }, "year") : this.num(e.year.toString().slice(-2), 2);
case "yyyy":
return s ? a({ year: "numeric" }, "year") : this.num(e.year, 4);
case "yyyyyy":
return s ? a({ year: "numeric" }, "year") : this.num(e.year, 6);
case "G":
return w("short");
case "GG":
return w("long");
case "GGGGG":
return w("narrow");
case "kk":
return this.num(e.weekYear.toString().slice(-2), 2);
case "kkkk":
return this.num(e.weekYear, 4);
case "W":
return this.num(e.weekNumber);
case "WW":
return this.num(e.weekNumber, 2);
case "o":
return this.num(e.ordinal);
case "ooo":
return this.num(e.ordinal, 3);
case "q":
return this.num(e.quarter);
case "qq":
return this.num(e.quarter, 2);
case "X":
return this.num(Math.floor(e.ts / 1e3));
case "x":
return this.num(e.ts);
default:
return f(d);
}
};
return ot(M.parseFormat(t), S);
}
formatDurationFromString(e, t) {
const r = (u) => {
switch (u[0]) {
case "S":
return "millisecond";
case "s":
return "second";
case "m":
return "minute";
case "h":
return "hour";
case "d":
return "day";
case "w":
return "week";
case "M":
return "month";
case "y":
return "year";
default:
return null;
}
}, s = (u) => (l) => {
const f = r(l);
return f ? this.num(u.get(f), l.length) : l;
}, a = M.parseFormat(t), i = a.reduce(
(u, { literal: l, val: f }) => l ? u : u.concat(f),
[]
), o = e.shiftTo(...i.map(r).filter((u) => u));
return ot(a, s(o));
}
}
class C {
constructor(e, t) {
this.reason = e, this.explanation = t;
}
toMessage() {
return this.explanation ? `${this.reason}: ${this.explanation}` : this.reason;
}
}
const en = /[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;
function Q(...n) {
const e = n.reduce((t, r) => t + r.source, "");
return RegExp(`^${e}$`);
}
function K(...n) {
return (e) => n.reduce(
([t, r, s], a) => {
const [i, o, u] = a(e, s);
return [{ ...t, ...i }, o || r, u];
},
[{}, null, 1]
).slice(0, 2);
}
function X(n, ...e) {
if (n == null)
return [null, null];
for (const [t, r] of e) {
const s = t.exec(n);
if (s)
return r(s);
}
return [null, null];
}
function tn(...n) {
return (e, t) => {
const r = {};
let s;
for (s = 0; s < n.length; s++)
r[n[s]] = U(e[t + s]);
return [r, null, t + s];
};
}
const nn = /(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/, mr = `(?:${nn.source}?(?:\\[(${en.source})\\])?)?`, Je = /(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/, rn = RegExp(`${Je.source}${mr}`), _e = RegExp(`(?:T${rn.source})?`), yr = /([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/, gr = /(\d{4})-?W(\d\d)(?:-?(\d))?/, wr = /(\d{4})-?(\d{3})/, Tr = tn("weekYear", "weekNumber", "weekDay"), pr = tn("year", "ordinal"), Sr = /(\d{4})-(\d\d)-(\d\d)/, sn = RegExp(
`${Je.source} ?(?:${nn.source}|(${en.source}))?`
), Or = RegExp(`(?: ${sn.source})?`);
function j(n, e, t) {
const r = n[e];
return m(r) ? t : U(r);
}
function vr(n, e) {
return [{
year: j(n, e),
month: j(n, e + 1, 1),
day: j(n, e + 2, 1)
}, null, e + 3];
}
function ee(n, e) {
return [{
hours: j(n, e, 0),
minutes: j(n, e + 1, 0),
seconds: j(n, e + 2, 0),
milliseconds: Pe(n[e + 3])
}, null, e + 4];
}
function ce(n, e) {
const t = !n[e] && !n[e + 1], r = xe(n[e + 1], n[e + 2]), s = t ? null : k.instance(r);
return [{}, s, e + 3];
}
function fe(n, e) {
const t = n[e] ? $.create(n[e]) : null;
return [{}, t, e + 1];
}
const Er = RegExp(`^T?${Je.source}$`), Mr = /^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/;
function kr(n) {
const [e, t, r, s, a, i, o, u, l] = n, f = e[0] === "-", w = u && u[0] === "-", S = (d, O = !1) => d !== void 0 && (O || d && f) ? -d : d;
return [
{
years: S(q(t)),
months: S(q(r)),
weeks: S(q(s)),
days: S(q(a)),
hours: S(q(i)),
minutes: S(q(o)),
seconds: S(q(u), u === "-0"),
milliseconds: S(Pe(l), w)
}
];
}
const Nr = {
GMT: 0,
EDT: -4 * 60,
EST: -5 * 60,
CDT: -5 * 60,
CST: -6 * 60,
MDT: -6 * 60,
MST: -7 * 60,
PDT: -7 * 60,
PST: -8 * 60
};
function je(n, e, t, r, s, a, i) {
const o = {
year: e.length === 2 ? He(U(e)) : U(e),
month: Jt.indexOf(t) + 1,
day: U(r),
hour: U(s),
minute: U(a)
};
return i && (o.second = U(i)), n && (o.weekday = n.length > 3 ? jt.indexOf(n) + 1 : Bt.indexOf(n) + 1), o;
}
const Ir = /^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;
function Dr(n) {
const [
,
e,
t,
r,
s,
a,
i,
o,
u,
l,
f,
w
] = n, S = je(e, s, r, t, a, i, o);
let d;
return u ? d = Nr[u] : l ? d = 0 : d = xe(f, w), [S, new k(d)];
}
function xr(n) {
return n.replace(/\([^()]*\)|[\n\t]/g, " ").replace(/(\s\s+)/g, " ").trim();
}
const br = /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/, Fr = /^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/, Vr = /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;
function ut(n) {
const [, e, t, r, s, a, i, o] = n;
return [je(e, s, r, t, a, i, o), k.utcInstance];
}
function Cr(n) {
const [, e, t, r, s, a, i, o] = n;
return [je(e, o, t, r, s, a, i), k.utcInstance];
}
const Zr = Q(yr, _e), Lr = Q(gr, _e), $r = Q(wr, _e), Ar = Q(rn), an = K(
vr,
ee,
ce,
fe
), zr = K(
Tr,
ee,
ce,
fe
), Ur = K(
pr,
ee,
ce,
fe
), Rr = K(
ee,
ce,
fe
);
function Wr(n) {
return X(
n,
[Zr, an],
[Lr, zr],
[$r, Ur],
[Ar, Rr]
);
}
function qr(n) {
return X(xr(n), [Ir, Dr]);
}
function Hr(n) {
return X(
n,
[br, ut],
[Fr, ut],
[Vr, Cr]
);
}
function Yr(n) {
return X(n, [Mr, kr]);
}
const Pr = K(ee);
function Gr(n) {
return X(n, [Er, Pr]);
}
const Jr = Q(Sr, Or), _r = Q(sn), jr = K(
ee,
ce,
fe
);
function Br(n) {
return X(
n,
[Jr, an],
[_r, jr]
);
}
const lt = "Invalid Duration", on = {
weeks: {
days: 7,
hours: 7 * 24,
minutes: 7 * 24 * 60,
seconds: 7 * 24 * 60 * 60,
milliseconds: 7 * 24 * 60 * 60 * 1e3
},
days: {
hours: 24,
minutes: 24 * 60,
seconds: 24 * 60 * 60,
milliseconds: 24 * 60 * 60 * 1e3
},
hours: { minutes: 60, seconds: 60 * 60, milliseconds: 60 * 60 * 1e3 },
minutes: { seconds: 60, milliseconds: 60 * 1e3 },
seconds: { milliseconds: 1e3 }
}, Qr = {
years: {
quarters: 4,
months: 12,
weeks: 52,
days: 365,
hours: 365 * 24,
minutes: 365 * 24 * 60,
seconds: 365 * 24 * 60 * 60,
milliseconds: 365 * 24 * 60 * 60 * 1e3
},
quarters: {
months: 3,
weeks: 13,
days: 91,
hours: 91 * 24,
minutes: 91 * 24 * 60,
seconds: 91 * 24 * 60 * 60,
milliseconds: 91 * 24 * 60 * 60 * 1e3
},
months: {
weeks: 4,
days: 30,
hours: 30 * 24,
minutes: 30 * 24 * 60,
seconds: 30 * 24 * 60 * 60,
milliseconds: 30 * 24 * 60 * 60 * 1e3
},
...on
}, I = 146097 / 400, J = 146097 / 4800, Kr = {
years: {
quarters: 4,
months: 12,
weeks: I / 7,
days: I,
hours: I * 24,
minutes: I * 24 * 60,
seconds: I * 24 * 60 * 60,
milliseconds: I * 24 * 60 * 60 * 1e3
},
quarters: {
months: 3,
weeks: I / 28,
days: I / 4,
hours: I * 24 / 4,
minutes: I * 24 * 60 / 4,
seconds: I * 24 * 60 * 60 / 4,
milliseconds: I * 24 * 60 * 60 * 1e3 / 4
},
months: {
weeks: J / 7,
days: J,
hours: J * 24,
minutes: J * 24 * 60,
seconds: J * 24 * 60 * 60,
milliseconds: J * 24 * 60 * 60 * 1e3
},
...on
}, Y = [
"years",
"quarters",
"months",
"weeks",
"days",
"hours",
"minutes",
"seconds",
"milliseconds"
], Xr = Y.slice(0).reverse();
function z(n, e, t = !1) {
const r = {
values: t ? e.values : { ...n.values, ...e.values || {} },
loc: n.loc.clone(e.loc),
conversionAccuracy: e.conversionAccuracy || n.conversionAccuracy,
matrix: e.matrix || n.matrix
};
return new y(r);
}
function un(n, e) {
var r;
let t = (r = e.milliseconds) != null ? r : 0;
for (const s of Xr.slice(1))
e[s] && (t += e[s] * n[s].milliseconds);
return t;
}
function ct(n, e) {
const t = un(n, e) < 0 ? -1 : 1;
Y.reduceRight((r, s) => {
if (m(e[s]))
return r;
if (r) {
const a = e[r] * t, i = n[s][r], o = Math.floor(a / i);
e[s] += o * t, e[r] -= o * i * t;
}
return s;
}, null), Y.reduce((r, s) => {
if (m(e[s]))
return r;
if (r) {
const a = e[r] % 1;
e[r] -= a, e[s] += a * n[r][s];
}
return s;
}, null);
}
function es(n) {
const e = {};
for (const [t, r] of Object.entries(n))
r !== 0 && (e[t] = r);
return e;
}
class y {
constructor(e) {
const t = e.conversionAccuracy === "longterm" || !1;
let r = t ? Kr : Qr;
e.matrix && (r = e.matrix), this.values = e.values, this.loc = e.loc || T.create(), this.conversionAccuracy = t ? "longterm" : "casual", this.invalid = e.invalid || null, this.matrix = r, this.isLuxonDuration = !0;
}
static fromMillis(e, t) {
return y.fromObject({ milliseconds: e }, t);
}
static fromObject(e, t = {}) {
if (e == null || typeof e != "object")
throw new D(
`Duration.fromObject: argument expected to be an object, got ${e === null ? "null" : typeof e}`
);
return new y({
values: ke(e, y.normalizeUnit),
loc: T.fromObject(t),
conversionAccuracy: t.conversionAccuracy,
matrix: t.matrix
});
}
static fromDurationLike(e) {
if (P(e))
return y.fromMillis(e);
if (y.isDuration(e))
return e;
if (typeof e == "object")
return y.fromObject(e);
throw new D(
`Unknown duration argument ${e} of type ${typeof e}`
);
}
static fromISO(e, t) {
const [r] = Yr(e);
return r ? y.fromObject(r, t) : y.invalid("unparsable", `the input "${e}" can't be parsed as ISO 8601`);
}
static fromISOTime(e, t) {
const [r] = Gr(e);
return r ? y.fromObject(r, t) : y.invalid("unparsable", `the input "${e}" can't be parsed as ISO 8601`);
}
static invalid(e, t = null) {
if (!e)
throw new D("need to specify a reason the Duration is invalid");
const r = e instanceof C ? e : new C(e, t);
if (v.throwOnInvalid)
throw new Fn(r);
return new y({ invalid: r });
}
static normalizeUnit(e) {
const t = {
year: "years",
years: "years",
quarter: "quarters",
quarters: "quarters",
month: "months",
months: "months",
week: "weeks",
weeks: "weeks",
day: "days",
days: "days",
hour: "hours",
hours: "hours",
minute: "minutes",
minutes: "minutes",
second: "seconds",
seconds: "seconds",
millisecond: "milliseconds",
milliseconds: "milliseconds"
}[e && e.toLowerCase()];
if (!t)
throw new Mt(e);
return t;
}
static isDuration(e) {
return e && e.isLuxonDuration || !1;
}
get locale() {
return this.isValid ? this.loc.locale : null;
}
get numberingSystem() {
return this.isValid ? this.loc.numberingSystem : null;
}
toFormat(e, t = {}) {
const r = {
...t,
floor: t.round !== !1 && t.floor !== !1
};
return this.isValid ? M.create(this.loc, r).formatDurationFromString(this, e) : lt;
}
toHuman(e = {}) {
if (!this.isValid)
return lt;
const t = Y.map((r) => {
const s = this.values[r];
return m(s) ? null : this.loc.numberFormatter({ style: "unit", unitDisplay: "long", ...e, unit: r.slice(0, -1) }).format(s);
}).filter((r) => r);
return this.loc.listFormatter({ type: "conjunction", style: e.listStyle || "narrow", ...e }).format(t);
}
toObject() {
return this.isValid ? { ...this.values } : {};
}
toISO() {
if (!this.isValid)
return null;
let e = "P";
return this.years !== 0 && (e += this.years + "Y"), (this.months !== 0 || this.quarters !== 0) && (e += this.months + this.quarters * 3 + "M"), this.weeks !== 0 && (e += this.weeks + "W"), this.days !== 0 && (e += this.days + "D"), (this.hours !== 0 || this.minutes !== 0 || this.seconds !== 0 || this.milliseconds !== 0) && (e += "T"), this.hours !== 0 && (e += this.hours + "H"), this.minutes !== 0 && (e += this.minutes + "M"), (this.seconds !== 0 || this.milliseconds !== 0) && (e += Ge(this.seconds + this.milliseconds / 1e3, 3) + "S"), e === "P" && (e += "T0S"), e;
}
toISOTime(e = {}) {
if (!this.isValid)
return null;
const t = this.toMillis();
return t < 0 || t >= 864e5 ? null : (e = {
suppressMilliseconds: !1,
suppressSeconds: !1,
includePrefix: !1,
format: "extended",
...e,
includeOffset: !1
}, h.fromMillis(t, { zone: "UTC" }).toISOTime(e));
}
toJSON() {
return this.toISO();
}
toString() {
return this.toISO();
}
toMillis() {
return this.isValid ? un(this.matrix, this.values) : NaN;
}
valueOf() {
return this.toMillis();
}
plus(e) {
if (!this.isValid)
return this;
const t = y.fromDurationLike(e), r = {};
for (const s of Y)
(B(t.values, s) || B(this.values, s)) && (r[s] = t.get(s) + this.get(s));
return z(this, { values: r }, !0);
}
minus(e) {
if (!this.isValid)
return this;
const t = y.fromDurationLike(e);
return this.plus(t.negate());
}
mapUnits(e) {
if (!this.isValid)
return this;
const t = {};
for (const r of Object.keys(this.values))
t[r] = Gt(e(this.values[r], r));
return z(this, { values: t }, !0);
}
get(e) {
return this[y.normalizeUnit(e)];
}
set(e) {
if (!this.isValid)
return this;
const t = { ...this.values, ...ke(e, y.normalizeUnit) };
return z(this, { values: t });
}
reconfigure({ locale: e, numberingSystem: t, conversionAccuracy: r, matrix: s } = {}) {
const i = { loc: this.loc.clone({ locale: e, numberingSystem: t }), matrix: s, conversionAccuracy: r };
return z(this, i);
}
as(e) {
return this.isValid ? this.shiftTo(e).get(e) : NaN;
}
normalize() {
if (!this.isValid)
return this;
const e = this.toObject();
return ct(this.matrix, e), z(this, { values: e }, !0);
}
rescale() {
if (!this.isValid)
return this;
const e = es(this.normalize().shiftToAll().toObject());
return z(this, { values: e }, !0);
}
shiftTo(...e) {
if (!this.isValid)
return this;
if (e.length === 0)
return this;
e = e.map((i) => y.normalizeUnit(i));
const t = {}, r = {}, s = this.toObject();
let a;
for (const i of Y)
if (e.indexOf(i) >= 0) {
a = i;
let o = 0;
for (const l in r)
o += this.matrix[l][i] * r[l], r[l] = 0;
P(s[i]) && (o += s[i]);
const u = Math.trunc(o);
t[i] = u, r[i] = (o * 1e3 - u * 1e3) / 1e3;
} else
P(s[i]) && (r[i] = s[i]);
for (const i in r)
r[i] !== 0 && (t[a] += i === a ? r[i] : r[i] / this.matrix[a][i]);
return ct(this.matrix, t), z(this, { values: t }, !0);
}
shiftToAll() {
return this.isValid ? this.shiftTo(
"years",
"months",
"weeks",
"days",
"hours",
"minutes",
"seconds",
"milliseconds"
) : this;
}
negate() {
if (!this.isValid)
return this;
const e = {};
for (const t of Object.keys(this.values))
e[t] = this.values[t] === 0 ? 0 : -this.values[t];
return z(this, { values: e }, !0);
}
get years() {
return this.isValid ? this.values.years || 0 : NaN;
}
get quarters() {
return this.isValid ? this.values.quarters || 0 : NaN;
}
get months() {
return this.isValid ? this.values.months || 0 : NaN;
}
get weeks() {
return this.isValid ? this.values.weeks || 0 : NaN;
}
get days() {
return this.isValid ? this.values.days || 0 : NaN;
}
get hours() {
return this.isValid ? this.values.hours || 0 : NaN;
}
get minutes() {
return this.isValid ? this.values.minutes || 0 : NaN;
}
get seconds() {
return this.isValid ? this.values.seconds || 0 : NaN;
}
get milliseconds() {
return this.isValid ? this.values.milliseconds || 0 : NaN;
}
get isValid() {
return this.invalid === null;
}
get invalidReason() {
return this.invalid ? this.invalid.reason : null;
}
get invalidExplanation() {
return this.invalid ? this.invalid.explanation : null;
}
equals(e) {
if (!this.isValid || !e.isValid || !this.loc.equals(e.loc))
return !1;
function t(r, s) {
return r === void 0 || r === 0 ? s === void 0 || s === 0 : r === s;
}
for (const r of Y)
if (!t(this.values[r], e.values[r]))
return !1;
return !0;
}
}
const _ = "Invalid Interval";
function ts(n, e) {
return !n || !n.isValid ? p.invalid("missing or invalid start") : !e || !e.isValid ? p.invalid("missing or invalid end") : e < n ? p.invalid(
"end before start",
`The end of an interval must be after its start, but you had start=${n.toISO()} and end=${e.toISO()}`
) : null;
}
class p {
constructor(e) {
this.s = e.start, this.e = e.end, this.invalid = e.invalid || null, this.isLuxonInterval = !0;
}
static invalid(e, t = null) {
if (!e)
throw new D("need to specify a reason the Interval is invalid");
const r = e instanceof C ? e : new C(e, t);
if (v.throwOnInvalid)
throw new bn(r);
return new p({ invalid: r });
}
static fromDateTimes(e, t) {
const r = re(e), s = re(t), a = ts(r, s);
return a == null ? new p({
start: r,
end: s
}) : a;
}
static after(e, t) {
const r = y.fromDurationLike(t), s = re(e);
return p.fromDateTimes(s, s.plus(r));
}
static before(e, t) {
const r = y.fromDurationLike(t), s = re(e);
return p.fromDateTimes(s.minus(r), s);
}
static fromISO(e, t) {
const [r, s] = (e || "").split("/", 2);
if (r && s) {
let a, i;
try {
a = h.fromISO(r, t), i = a.isValid;
} catch {
i = !1;
}
let o, u;
try {
o = h.fromISO(s, t), u = o.isValid;
} catch {
u = !1;
}
if (i && u)
return p.fromDateTimes(a, o);
if (i) {
const l = y.fromISO(s, t);
if (l.isValid)
return p.after(a, l);
} else if (u) {
const l = y.fromISO(r, t);
if (l.isValid)
return p.before(o, l);
}
}
return p.invalid("unparsable", `the input "${e}" can't be parsed as ISO 8601`);
}
static isInterval(e) {
return e && e.isLuxonInterval || !1;
}
get start() {
return this.isValid ? this.s : null;
}
get end() {
return this.isValid ? this.e : null;
}
get isValid() {
return this.invalidReason === null;
}
get invalidReason() {
return this.invalid ? this.invalid.reason : null;
}
get invalidExplanation() {
return this.invalid ? this.invalid.explanation : null;
}
length(e = "milliseconds") {
return this.isValid ? this.toDuration(e).get(e) : NaN;
}
count(e = "milliseconds") {
if (!this.isValid)
return NaN;
const t = this.start.startOf(e), r = this.end.startOf(e);
return Math.floor(r.diff(t, e).get(e)) + (r.valueOf() !== this.end.valueOf());
}
hasSame(e) {
return this.isValid ? this.isEmpty() || this.e.minus(1).hasSame(this.s, e) : !1;
}
isEmpty() {
return this.s.valueOf() === this.e.valueOf();
}
isAfter(e) {
return this.isValid ? this.s > e : !1;
}
isBefore(e) {
return this.isValid ? this.e <= e : !1;
}
contains(e) {
return this.isValid ? this.s <= e && this.e > e : !1;
}
set({ start: e, end: t } = {}) {
return this.isValid ? p.fromDateTimes(e || this.s, t || this.e) : this;
}
splitAt(...e) {
if (!this.isValid)
return [];
const t = e.map(re).filter((i) => this.contains(i)).sort(), r = [];
let { s } = this, a = 0;
for (; s < this.e; ) {
const i = t[a] || this.e, o = +i > +this.e ? this.e : i;
r.push(p.fromDateTimes(s, o)), s = o, a += 1;
}
return r;
}
splitBy(e) {
const t = y.fromDurationLike(e);
if (!this.isValid || !t.isValid || t.as("milliseconds") === 0)
return [];
let { s: r } = this, s = 1, a;
const i = [];
for (; r < this.e; ) {
const o = this.start.plus(t.mapUnits((u) => u * s));
a = +o > +this.e ? this.e : o, i.push(p.fromDateTimes(r, a)), r = a, s += 1;
}
return i;
}
divideEqually(e) {
return this.isValid ? this.splitBy(this.length() / e).slice(0, e) : [];
}
overlaps(e) {
return this.e > e.s && this.s < e.e;
}
abutsStart(e) {
return this.isValid ? +this.e == +e.s : !1;
}
abutsEnd(e) {
return this.isValid ? +e.e == +this.s : !1;
}
engulfs(e) {
return this.isValid ? this.s <= e.s && this.e >= e.e : !1;
}
equals(e) {
return !this.isValid || !e.isValid ? !1 : this.s.equals(e.s) && this.e.equals(e.e);
}
intersection(e) {
if (!this.isValid)
return this;
const t = this.s > e.s ? this.s : e.s, r = this.e < e.e ? this.e : e.e;
return t >= r ? null : p.fromDateTimes(t, r);
}
union(e) {
if (!this.isValid)
return this;
const t = this.s < e.s ? this.s : e.s, r = this.e > e.e ? this.e : e.e;
return p.fromDateTimes(t, r);
}
static merge(e) {
const [t, r] = e.sort((s, a) => s.s - a.s).reduce(
([