temporal-polyfill-lite 0.4.0 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/README.md +10 -0
- package/dist/calendars/index.js +1 -1
- package/dist/calendars/shim.js +1 -1
- package/dist/calendars/{src-BuTL4TvD.js → src-CIbGWA87.js} +601 -634
- package/dist/index.js +1 -1
- package/dist/shim.js +1 -1
- package/dist/{src-Dt_z3lNV.js → src-Cpu9wF28.js} +643 -670
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
function getNameFromUnit(e) {
|
|
2
|
-
return
|
|
2
|
+
return ae[e];
|
|
3
3
|
}
|
|
4
4
|
function nanosecondsForTimeUnit(e) {
|
|
5
|
-
return
|
|
5
|
+
return ce[e - 3];
|
|
6
6
|
}
|
|
7
7
|
function isObject(e) {
|
|
8
8
|
return ("object" == typeof e || "function" == typeof e) && null !== e;
|
|
@@ -38,11 +38,11 @@ function toBigInt(e) {
|
|
|
38
38
|
return BigInt.asIntN(2 ** 53 - 1, e);
|
|
39
39
|
}
|
|
40
40
|
function toIntegerIfIntegral(e) {
|
|
41
|
-
const t =
|
|
41
|
+
const t = Oe(e);
|
|
42
42
|
return Number.isInteger(t) || throwRangeError(invalidNumber(t)), t + 0;
|
|
43
43
|
}
|
|
44
44
|
function toIntegerWithTruncation(e) {
|
|
45
|
-
const t =
|
|
45
|
+
const t = Oe(e);
|
|
46
46
|
return isFinite(t) || throwRangeError(invalidNumber(t)), Math.trunc(t) + 0;
|
|
47
47
|
}
|
|
48
48
|
function toPositiveIntegerWithTruncation(e) {
|
|
@@ -54,11 +54,11 @@ function getOptionsObject(e = createNullPrototypeObject()) {
|
|
|
54
54
|
}
|
|
55
55
|
function getOption(e, t, o, n) {
|
|
56
56
|
const r = e[t];
|
|
57
|
-
if (void 0 === r) return n ===
|
|
57
|
+
if (void 0 === r) return n === u && throwRangeError(missingField(t)), n;
|
|
58
58
|
const a = toString(r);
|
|
59
59
|
return o.includes(a) || throwRangeError(invalidField(t)), a;
|
|
60
60
|
}
|
|
61
|
-
function getRoundToOptionsObject(e = throwTypeError(
|
|
61
|
+
function getRoundToOptionsObject(e = throwTypeError(Ie)) {
|
|
62
62
|
return "string" == typeof e ? createNullPrototypeObject({ smallestUnit: e }) : getOptionsObject(e);
|
|
63
63
|
}
|
|
64
64
|
function validateString(e) {
|
|
@@ -104,10 +104,10 @@ function renameFunction(e, t) {
|
|
|
104
104
|
Object.defineProperty(e, "name", { value: t });
|
|
105
105
|
}
|
|
106
106
|
function normalizeEpochNanoseconds(e, t) {
|
|
107
|
-
return [e + divFloor(t,
|
|
107
|
+
return [e + divFloor(t, a), modFloor(t, a)];
|
|
108
108
|
}
|
|
109
109
|
function createEpochNanosecondsFromBigInt(e) {
|
|
110
|
-
return normalizeEpochNanoseconds(Number(e / BigInt(
|
|
110
|
+
return normalizeEpochNanoseconds(Number(e / BigInt(a)), Number(e % BigInt(a)));
|
|
111
111
|
}
|
|
112
112
|
function createEpochNanosecondsFromEpochMilliseconds(e) {
|
|
113
113
|
return normalizeEpochNanoseconds(divFloor(e, r), 1e6 * modFloor(e, r));
|
|
@@ -116,7 +116,7 @@ function createEpochNanosecondsFromEpochSeconds(e) {
|
|
|
116
116
|
return createEpochNanosecondsFromEpochMilliseconds(1e3 * e);
|
|
117
117
|
}
|
|
118
118
|
function convertEpochNanosecondsToBigInt(e) {
|
|
119
|
-
return BigInt(e[0]) * BigInt(
|
|
119
|
+
return BigInt(e[0]) * BigInt(a) + BigInt(e[1]);
|
|
120
120
|
}
|
|
121
121
|
function compareEpochNanoseconds(e, t) {
|
|
122
122
|
return compare(e[0], t[0]) || compare(e[1], t[1]);
|
|
@@ -147,40 +147,41 @@ function toZeroPaddedDecimalString(e, t) {
|
|
|
147
147
|
}
|
|
148
148
|
function normalize(e, t) {
|
|
149
149
|
const [o, n] = normalizeEpochNanoseconds(e, t);
|
|
150
|
-
return o < 0 && n > 0 ? [o + 1, n -
|
|
150
|
+
return o < 0 && n > 0 ? [o + 1, n - a] : [o, n];
|
|
151
151
|
}
|
|
152
|
-
function
|
|
153
|
-
|
|
152
|
+
function createTimeDurationFromUnit(e, t) {
|
|
153
|
+
const o = a / t;
|
|
154
|
+
return normalize(Math.round((e - e % o) / o), e % o * t);
|
|
154
155
|
}
|
|
155
156
|
function addTimeDuration(e, t) {
|
|
156
157
|
return normalize(e[0] + t[0], e[1] + t[1]);
|
|
157
158
|
}
|
|
158
159
|
function absTimeDuration(e) {
|
|
159
|
-
return
|
|
160
|
+
return e.map(Math.abs);
|
|
160
161
|
}
|
|
161
162
|
function negateTimeDuration(e) {
|
|
162
163
|
return normalize(-e[0], -e[1]);
|
|
163
164
|
}
|
|
164
165
|
function signTimeDuration(e) {
|
|
165
|
-
return we(e,
|
|
166
|
+
return we(e, ye);
|
|
166
167
|
}
|
|
167
168
|
function timeDurationToSubsecondsNumber(e, t, o) {
|
|
168
169
|
const n = signTimeDuration(e);
|
|
169
|
-
return e = absTimeDuration(e), n *
|
|
170
|
+
return e = absTimeDuration(e), n * Oe(`${864 * e[0] + divTrunc(e[1], 1e11)}${toZeroPaddedDecimalString(divTrunc(e[1] % 1e11, 10 ** (9 + t)), 2 - t)}.${o ? toZeroPaddedDecimalString(e[1] % 10 ** (9 + t), 9 + t) : "0"}`) + 0;
|
|
170
171
|
}
|
|
171
172
|
function roundTimeDurationByDays(e, t, o) {
|
|
172
|
-
return normalize(roundNumberToIncrement(e[0] + signTimeDuration(e) * (e[1] ? .2 * compare(Math.abs(e[1] /
|
|
173
|
+
return normalize(roundNumberToIncrement(e[0] + signTimeDuration(e) * (e[1] ? .2 * compare(Math.abs(e[1] / a), .5) + .5 : 0), t, o), 0);
|
|
173
174
|
}
|
|
174
175
|
function divideTimeDurationToFloatingPoint(e, t) {
|
|
175
|
-
return t <= 1e9 ? timeDurationToSubsecondsNumber(e, -9 + Math.log10(t), !0) :
|
|
176
|
+
return t <= 1e9 ? timeDurationToSubsecondsNumber(e, -9 + Math.log10(t), !0) : a / t * e[0] + e[1] / t;
|
|
176
177
|
}
|
|
177
178
|
function interpretISODateTimeOffset(e, t, o, n, r, a, i, c) {
|
|
178
179
|
if (!t) return getStartOfDay(r, e);
|
|
179
180
|
const s = combineIsoDateAndTimeRecord(e, t);
|
|
180
|
-
if (o ===
|
|
181
|
-
if (o ===
|
|
181
|
+
if (o === S || o === O && "ignore" == i) return getEpochNanosecondsFor(r, s, a);
|
|
182
|
+
if (o === F || o === O && "use" == i) return validateEpochNanoseconds(getUtcEpochNanoseconds(balanceIsoDateTime(s.o.t, s.o.u, s.o.T, s.p.D, s.p.I, s.p.O, s.p.F, s.p.S, s.p.$ - n)));
|
|
182
183
|
((e) => {
|
|
183
|
-
Math.abs(isoDateToEpochDays(e.t, e.u - 1, e.T)) > 1e8 && throwRangeError(
|
|
184
|
+
Math.abs(isoDateToEpochDays(e.t, e.u - 1, e.T)) > 1e8 && throwRangeError(le);
|
|
184
185
|
})(e);
|
|
185
186
|
const l = getPossibleEpochNanoseconds(r, s);
|
|
186
187
|
for (const e of l) {
|
|
@@ -195,7 +196,7 @@ function toTemporalZonedDateTime(e, t) {
|
|
|
195
196
|
if (isObject(e)) {
|
|
196
197
|
if (isZonedDateTime(e)) {
|
|
197
198
|
const o = getOptionsObject(t);
|
|
198
|
-
return getTemporalDisambiguationOption(o), getTemporalOffsetOption(o,
|
|
199
|
+
return getTemporalDisambiguationOption(o), getTemporalOffsetOption(o, h), getTemporalOverflowOption(o), getInternalSlotOrThrowForZonedDateTime(e);
|
|
199
200
|
}
|
|
200
201
|
i = getTemporalCalendarIdentifierWithIsoDefault(e);
|
|
201
202
|
const l = prepareCalendarFields(i, e, [
|
|
@@ -214,7 +215,7 @@ function toTemporalZonedDateTime(e, t) {
|
|
|
214
215
|
], [Ot.P]);
|
|
215
216
|
o = l.timeZone, n = l.offset;
|
|
216
217
|
const d = getOptionsObject(t);
|
|
217
|
-
r = getTemporalDisambiguationOption(d), a = getTemporalOffsetOption(d,
|
|
218
|
+
r = getTemporalDisambiguationOption(d), a = getTemporalOffsetOption(d, h);
|
|
218
219
|
const m = interpretTemporalDateTimeFields(i, l, getTemporalOverflowOption(d));
|
|
219
220
|
c = m.o, s = m.p;
|
|
220
221
|
} else {
|
|
@@ -222,10 +223,10 @@ function toTemporalZonedDateTime(e, t) {
|
|
|
222
223
|
const m = parseIsoDateTime(e, [Ge]);
|
|
223
224
|
o = toTemporalTimeZoneIdentifier(m.P.R), n = m.P.N, l = m.P.Z, i = canonicalizeCalendar(m.Y || "iso8601"), d = !1, n && (d = hasUtcOffsetSubMinuteParts(n));
|
|
224
225
|
const u = getOptionsObject(t);
|
|
225
|
-
r = getTemporalDisambiguationOption(u), a = getTemporalOffsetOption(u,
|
|
226
|
+
r = getTemporalDisambiguationOption(u), a = getTemporalOffsetOption(u, h), getTemporalOverflowOption(u), c = createIsoDateRecord(m.t, m.u, m.T), s = m.p;
|
|
226
227
|
}
|
|
227
|
-
const m = l ?
|
|
228
|
-
return createZonedDateTimeSlot(interpretISODateTimeOffset(c, s, m, m ===
|
|
228
|
+
const m = l ? F : n ? O : S;
|
|
229
|
+
return createZonedDateTimeSlot(interpretISODateTimeOffset(c, s, m, m === O ? parseDateTimeUtcOffset(n) : 0, o, r, a, d), o, i);
|
|
229
230
|
}
|
|
230
231
|
function createTemporalZonedDateTime(e, t, o, n) {
|
|
231
232
|
return createTemporalZonedDateTimeFromSlot(createZonedDateTimeSlot(e, t, o, ((e, t) => be[e] && be[e].C(clampEpochSecond(t)))(t, epochSeconds(e))), n);
|
|
@@ -238,34 +239,34 @@ function createZonedDateTimeSlot(e, t, o, n) {
|
|
|
238
239
|
W: n
|
|
239
240
|
};
|
|
240
241
|
}
|
|
241
|
-
function temporalZonedDateTimeToString(e, t, o, n, r, a = 1, i =
|
|
242
|
+
function temporalZonedDateTimeToString(e, t, o, n, r, a = 1, i = J, c = E) {
|
|
242
243
|
const s = roundTemporalInstant(e.U, a, i, c), l = epochSeconds(s) === epochSeconds(e.U) ? getOffsetNanosecondsForZonedDateTimeSlot(e) : getOffsetNanosecondsFor(e.P, s);
|
|
243
|
-
return `${isoDateTimeToString(getIsoDateTimeFromOffsetNanoseconds(s, l), "iso8601", t,
|
|
244
|
+
return `${isoDateTimeToString(getIsoDateTimeFromOffsetNanoseconds(s, l), "iso8601", t, C)}${r === j ? "" : formatDateTimeUtcOffsetRounded(l)}${n === A ? "" : `[${n === L ? "!" : ""}${e.P}]`}${formatCalendarAnnotation(e.Y, o)}`;
|
|
244
245
|
}
|
|
245
246
|
function addZonedDateTime(e, t, o) {
|
|
246
247
|
if (!dateDurationSign(t.A)) return addInstant(e.U, t.p);
|
|
247
248
|
const n = getIsoDateTimeForZonedDateTimeSlot(e);
|
|
248
|
-
return addInstant(getEpochNanosecondsFor(e.P, validateIsoDateTime(combineIsoDateAndTimeRecord(calendarDateAdd(e.Y, n.o, t.A, o), n.p)),
|
|
249
|
+
return addInstant(getEpochNanosecondsFor(e.P, validateIsoDateTime(combineIsoDateAndTimeRecord(calendarDateAdd(e.Y, n.o, t.A, o), n.p)), p), t.p);
|
|
249
250
|
}
|
|
250
251
|
function differenceZonedDateTime(e, t, o) {
|
|
251
252
|
const n = compareEpochNanoseconds(e.U, t.U);
|
|
252
|
-
if (!n) return combineDateAndTimeDuration(zeroDateDuration(),
|
|
253
|
+
if (!n) return combineDateAndTimeDuration(zeroDateDuration(), ye);
|
|
253
254
|
const r = getIsoDateTimeForZonedDateTimeSlot(e), a = getIsoDateTimeForZonedDateTimeSlot(t);
|
|
254
255
|
if (!compareIsoDate(r.o, a.o)) return combineDateAndTimeDuration(zeroDateDuration(), timeDurationFromEpochNanosecondsDifference(t.U, e.U));
|
|
255
256
|
let i, c = differenceTime(r.p, a.p);
|
|
256
|
-
for (let o = wt(c) === n ? 1 : 0; o <= (3 - n) / 2 && (i = combineIsoDateAndTimeRecord(addDaysToIsoDate(a.o, o * n), r.p), c = timeDurationFromEpochNanosecondsDifference(t.U, getEpochNanosecondsFor(e.P, i,
|
|
257
|
-
return combineDateAndTimeDuration(calendarDateUntil(e.Y, r.o, i.o, largerOfTwoTemporalUnits(o,
|
|
257
|
+
for (let o = wt(c) === n ? 1 : 0; o <= (3 - n) / 2 && (i = combineIsoDateAndTimeRecord(addDaysToIsoDate(a.o, o * n), r.p), c = timeDurationFromEpochNanosecondsDifference(t.U, getEpochNanosecondsFor(e.P, i, p)), wt(c) === n); o++);
|
|
258
|
+
return combineDateAndTimeDuration(calendarDateUntil(e.Y, r.o, i.o, largerOfTwoTemporalUnits(o, x)), c);
|
|
258
259
|
}
|
|
259
260
|
function differenceZonedDateTimeWithRounding(e, t, o, n, r, a) {
|
|
260
261
|
if (!isDateUnit(o)) return differenceInstant(e.U, t.U, n, r, a);
|
|
261
262
|
const i = differenceZonedDateTime(e, t, o);
|
|
262
|
-
return r ===
|
|
263
|
+
return r === J && 1 === n ? i : roundRelativeDuration(i, e.U, t.U, getIsoDateTimeForZonedDateTimeSlot(e), e.P, e.Y, o, n, r, a);
|
|
263
264
|
}
|
|
264
265
|
function differenceTemporalZonedDateTime(e, t, o, n) {
|
|
265
266
|
const r = toTemporalZonedDateTime(o);
|
|
266
|
-
calendarEquals(t.Y, r.Y) || throwRangeError(
|
|
267
|
-
const a = getDifferenceSettings(e, getOptionsObject(n),
|
|
268
|
-
return isDateUnit(a.L) ? (timeZoneEquals(t.P, r.P) || throwRangeError("time zone mismatch"), compareEpochNanoseconds(t.U, r.U) ? createTemporalDuration(applySignToDurationSlot(temporalDurationFromInternal(differenceZonedDateTimeWithRounding(t, r, a.L, a.V, a.H, a.q),
|
|
267
|
+
calendarEquals(t.Y, r.Y) || throwRangeError(ue);
|
|
268
|
+
const a = getDifferenceSettings(e, getOptionsObject(n), l, [], J, H);
|
|
269
|
+
return isDateUnit(a.L) ? (timeZoneEquals(t.P, r.P) || throwRangeError("time zone mismatch"), compareEpochNanoseconds(t.U, r.U) ? createTemporalDuration(applySignToDurationSlot(temporalDurationFromInternal(differenceZonedDateTimeWithRounding(t, r, a.L, a.V, a.H, a.q), H), e)) : createTemporalDuration(createTemporalDurationSlot([
|
|
269
270
|
0,
|
|
270
271
|
0,
|
|
271
272
|
0,
|
|
@@ -298,7 +299,7 @@ function getInternalSlotForZonedDateTime(e) {
|
|
|
298
299
|
}
|
|
299
300
|
function getInternalSlotOrThrowForZonedDateTime(e) {
|
|
300
301
|
const t = getInternalSlotForZonedDateTime(e);
|
|
301
|
-
return t || throwTypeError(
|
|
302
|
+
return t || throwTypeError(Te), t;
|
|
302
303
|
}
|
|
303
304
|
function isZonedDateTime(e) {
|
|
304
305
|
return !!getInternalSlotForZonedDateTime(e);
|
|
@@ -307,13 +308,12 @@ function createLruCache(e) {
|
|
|
307
308
|
const t = /* @__PURE__ */ new Map();
|
|
308
309
|
return {
|
|
309
310
|
C(e) {
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
return t.delete(e), t.set(e, o), o;
|
|
313
|
-
}
|
|
311
|
+
const o = t.get(e);
|
|
312
|
+
if (void 0 !== o) return t.delete(e), t.set(e, o), o;
|
|
314
313
|
},
|
|
315
|
-
B(o, n)
|
|
316
|
-
|
|
314
|
+
B: (o, n) => (t.size >= e && t.delete(t.keys().next().value), t.set(o, n), n),
|
|
315
|
+
J(e, t) {
|
|
316
|
+
return this.C(e) ?? this.B(e, t());
|
|
317
317
|
}
|
|
318
318
|
};
|
|
319
319
|
}
|
|
@@ -378,10 +378,10 @@ function formatOffsetTimeZoneIdentifier(e) {
|
|
|
378
378
|
}
|
|
379
379
|
function formatUtcOffsetNanoseconds(e) {
|
|
380
380
|
const n = Math.abs(e);
|
|
381
|
-
return `${e < 0 ? "-" : "+"}${formatTimeString(divFloor(n, o), modFloor(divFloor(n, t), 60), modFloor(divFloor(n, 1e9), 60), 0, n % 6e10 ? void 0 :
|
|
381
|
+
return `${e < 0 ? "-" : "+"}${formatTimeString(divFloor(n, o), modFloor(divFloor(n, t), 60), modFloor(divFloor(n, 1e9), 60), 0, n % 6e10 ? void 0 : T)}`;
|
|
382
382
|
}
|
|
383
383
|
function formatDateTimeUtcOffsetRounded(e) {
|
|
384
|
-
return formatOffsetTimeZoneIdentifier(roundNumberToIncrement(e, t,
|
|
384
|
+
return formatOffsetTimeZoneIdentifier(roundNumberToIncrement(e, t, P) / t);
|
|
385
385
|
}
|
|
386
386
|
function toTemporalTimeZoneIdentifier(e) {
|
|
387
387
|
if (isZonedDateTime(e)) return getInternalSlotOrThrowForZonedDateTime(e).P;
|
|
@@ -390,7 +390,7 @@ function toTemporalTimeZoneIdentifier(e) {
|
|
|
390
390
|
if (isTimeZoneIdentifier(e)) return parseTimeZoneIdentifier(e);
|
|
391
391
|
const t = parseIsoDateTime(e, [
|
|
392
392
|
Ge,
|
|
393
|
-
|
|
393
|
+
Ke,
|
|
394
394
|
Qe,
|
|
395
395
|
et,
|
|
396
396
|
tt,
|
|
@@ -398,7 +398,7 @@ function toTemporalTimeZoneIdentifier(e) {
|
|
|
398
398
|
]).P, o = t.R || t.Z && "UTC" || t.N;
|
|
399
399
|
return o || throwRangeError(invalidTimeZone(e)), parseTimeZoneIdentifier(o);
|
|
400
400
|
})(e);
|
|
401
|
-
return t.
|
|
401
|
+
return t._ ? getAvailableNamedTimeZoneIdentifier(t._) : formatOffsetTimeZoneIdentifier(t.G);
|
|
402
402
|
}
|
|
403
403
|
function getOffsetNanosecondsFor(e, t) {
|
|
404
404
|
return isOffsetTimeZoneIdentifier(e) ? parseDateTimeUtcOffset(e) : getNamedTimeZoneOffsetNanosecondsForEpochSecond(e, epochSeconds(t));
|
|
@@ -407,7 +407,7 @@ function getEpochNanosecondsFor(e, t, o) {
|
|
|
407
407
|
return disambiguatePossibleEpochNanoseconds(getPossibleEpochNanoseconds(e, t), e, t, o);
|
|
408
408
|
}
|
|
409
409
|
function disambiguatePossibleEpochNanoseconds(e, t, o, n) {
|
|
410
|
-
return 1 === e.length ? e[0] : ("reject" === n && throwRangeError("ambiguity / gaps in local time"), getNamedTimeZoneEpochCandidates(t, o).map(validateEpochNanoseconds)["compatible" === n ? +!e[0] : +(n ===
|
|
410
|
+
return 1 === e.length ? e[0] : ("reject" === n && throwRangeError("ambiguity / gaps in local time"), getNamedTimeZoneEpochCandidates(t, o).map(validateEpochNanoseconds)["compatible" === n ? +!e[0] : +(n === g)]);
|
|
411
411
|
}
|
|
412
412
|
function getPossibleEpochNanoseconds(e, t) {
|
|
413
413
|
return isOffsetTimeZoneIdentifier(e) ? [validateEpochNanoseconds(getUtcEpochNanoseconds(balanceIsoDateTime(t.o.t, t.o.u, t.o.T, t.p.D, t.p.I, t.p.O, t.p.F, t.p.S, t.p.$ - parseDateTimeUtcOffset(e))))] : ((e, t) => getNamedTimeZoneEpochCandidates(e, t).filter((o) => !compareEpochNanoseconds(addNanosecondsToEpochSeconds(o, getOffsetNanosecondsFor(e, o)), getUtcEpochNanoseconds(t))))(e, t).map(validateEpochNanoseconds);
|
|
@@ -420,7 +420,7 @@ function timeZoneEquals(e, t) {
|
|
|
420
420
|
return e === t || !isOffsetTimeZoneIdentifier(e) && !isOffsetTimeZoneIdentifier(t) && getFormatterForTimeZone(e).resolvedOptions().timeZone === getFormatterForTimeZone(t).resolvedOptions().timeZone;
|
|
421
421
|
}
|
|
422
422
|
function parseTimeZoneIdentifier(e) {
|
|
423
|
-
return isTimeZoneIdentifier(e) || throwRangeError(invalidTimeZone(e)), createNullPrototypeObject(isOffsetTimeZoneIdentifier(e) ? {
|
|
423
|
+
return isTimeZoneIdentifier(e) || throwRangeError(invalidTimeZone(e)), createNullPrototypeObject(isOffsetTimeZoneIdentifier(e) ? { G: parseDateTimeUtcOffset(e) / t } : { _: e });
|
|
424
424
|
}
|
|
425
425
|
function isOffsetTimeZoneIdentifier(e) {
|
|
426
426
|
return /^[+-]/.test(e);
|
|
@@ -451,7 +451,7 @@ function toTemporalDateTime(e, t) {
|
|
|
451
451
|
if (isPlainDateTime(e)) {
|
|
452
452
|
getTemporalOverflowOption(getOptionsObject(t));
|
|
453
453
|
const o = getInternalSlotOrThrowForPlainDateTime(e);
|
|
454
|
-
return createTemporalDateTime(o.
|
|
454
|
+
return createTemporalDateTime(o.K, o.Y);
|
|
455
455
|
}
|
|
456
456
|
if (isZonedDateTime(e)) {
|
|
457
457
|
const o = getInternalSlotOrThrowForZonedDateTime(e);
|
|
@@ -477,16 +477,16 @@ function toTemporalDateTime(e, t) {
|
|
|
477
477
|
], []), getTemporalOverflowOption(getOptionsObject(t))), o);
|
|
478
478
|
}
|
|
479
479
|
validateString(e);
|
|
480
|
-
const o = parseIsoDateTime(e, [
|
|
480
|
+
const o = parseIsoDateTime(e, [Ke]), n = canonicalizeCalendar(o.Y || "iso8601");
|
|
481
481
|
return getTemporalOverflowOption(getOptionsObject(t)), createTemporalDateTime(combineIsoDateAndTimeRecord(createIsoDateRecord(o.t, o.u, o.T), o.p || midnightTimeRecord()), n);
|
|
482
482
|
}
|
|
483
483
|
function balanceIsoDateTime(e, t, o, n, r, a, i, c, s) {
|
|
484
484
|
const l = balanceTime(n, r, a, i, c, s);
|
|
485
|
-
return combineIsoDateAndTimeRecord(addDaysToIsoDate(createIsoDateRecord(e, t, o), l.
|
|
485
|
+
return combineIsoDateAndTimeRecord(addDaysToIsoDate(createIsoDateRecord(e, t, o), l.X), l);
|
|
486
486
|
}
|
|
487
487
|
function createTemporalDateTime(e, t, o = Object.create(Re.prototype)) {
|
|
488
488
|
return Pe.set(o, {
|
|
489
|
-
|
|
489
|
+
K: validateIsoDateTime(e),
|
|
490
490
|
Y: t
|
|
491
491
|
}), o;
|
|
492
492
|
}
|
|
@@ -498,27 +498,27 @@ function compareIsoDateTime(e, t) {
|
|
|
498
498
|
}
|
|
499
499
|
function roundIsoDateTime(e, t, o, n) {
|
|
500
500
|
const r = roundTime(e.p, t, o, n);
|
|
501
|
-
return combineIsoDateAndTimeRecord(addDaysToIsoDate(e.o, r.
|
|
501
|
+
return combineIsoDateAndTimeRecord(addDaysToIsoDate(e.o, r.X), r);
|
|
502
502
|
}
|
|
503
503
|
function differenceISODateTime(e, t, o, n) {
|
|
504
504
|
let r = differenceTime(e.p, t.p);
|
|
505
505
|
const a = wt(r);
|
|
506
506
|
let i = t.o;
|
|
507
507
|
a === compareIsoDate(e.o, t.o) && (i = addDaysToIsoDate(i, a), r = add24HourDaysToTimeDuration(r, -a));
|
|
508
|
-
const c = largerOfTwoTemporalUnits(
|
|
509
|
-
return n !== c && (r = add24HourDaysToTimeDuration(r, s.
|
|
508
|
+
const c = largerOfTwoTemporalUnits(x, n), s = calendarDateUntil(o, e.o, i, c);
|
|
509
|
+
return n !== c && (r = add24HourDaysToTimeDuration(r, s.X), s.X = 0), combineDateAndTimeDuration(s, r);
|
|
510
510
|
}
|
|
511
511
|
function differencePlainDateTimeWithRounding(e, t, o, n, r, a, i) {
|
|
512
|
-
if (!compareIsoDateTime(e, t)) return combineDateAndTimeDuration(zeroDateDuration(),
|
|
512
|
+
if (!compareIsoDateTime(e, t)) return combineDateAndTimeDuration(zeroDateDuration(), ye);
|
|
513
513
|
validateIsoDateTime(e), validateIsoDateTime(t);
|
|
514
514
|
const c = differenceISODateTime(e, t, o, n);
|
|
515
|
-
return a ===
|
|
515
|
+
return a === J && 1 === r ? c : roundRelativeDuration(c, getUtcEpochNanoseconds(e), getUtcEpochNanoseconds(t), e, void 0, o, n, r, a, i);
|
|
516
516
|
}
|
|
517
517
|
function differenceTemporalPlainDateTime(e, t, o, n) {
|
|
518
518
|
const r = getInternalSlotOrThrowForPlainDateTime(toTemporalDateTime(o));
|
|
519
|
-
calendarEquals(t.Y, r.Y) || throwRangeError(
|
|
520
|
-
const a = getDifferenceSettings(e, getOptionsObject(n),
|
|
521
|
-
return compareIsoDateTime(t.
|
|
519
|
+
calendarEquals(t.Y, r.Y) || throwRangeError(ue);
|
|
520
|
+
const a = getDifferenceSettings(e, getOptionsObject(n), l, [], J, x);
|
|
521
|
+
return compareIsoDateTime(t.K, r.K) ? createTemporalDuration(applySignToDurationSlot(temporalDurationFromInternal(differencePlainDateTimeWithRounding(t.K, r.K, t.Y, a.L, a.V, a.H, a.q), a.L), e)) : createTemporalDuration(createTemporalDurationSlot([
|
|
522
522
|
0,
|
|
523
523
|
0,
|
|
524
524
|
0,
|
|
@@ -532,25 +532,29 @@ function differenceTemporalPlainDateTime(e, t, o, n) {
|
|
|
532
532
|
]));
|
|
533
533
|
}
|
|
534
534
|
function addDurationToDateTime(e, t, o, n) {
|
|
535
|
-
const r = applySignToDurationSlot(toTemporalDuration(o), e), a = getTemporalOverflowOption(getOptionsObject(n)), i = toInternalDurationRecordWith24HourDays(r), c = addTime(t.
|
|
536
|
-
return createTemporalDateTime(combineIsoDateAndTimeRecord(calendarDateAdd(t.Y, t.
|
|
535
|
+
const r = applySignToDurationSlot(toTemporalDuration(o), e), a = getTemporalOverflowOption(getOptionsObject(n)), i = toInternalDurationRecordWith24HourDays(r), c = addTime(t.K.p, i.p);
|
|
536
|
+
return createTemporalDateTime(combineIsoDateAndTimeRecord(calendarDateAdd(t.Y, t.K.o, adjustDateDurationRecord(i.A, c.X), a), c), t.Y);
|
|
537
537
|
}
|
|
538
538
|
function validateIsoDateTime(e) {
|
|
539
539
|
return ((e) => {
|
|
540
540
|
const t = isoDateRecordToEpochDays(e.o);
|
|
541
541
|
return Math.abs(t) <= 1e8 || -100000001 === t && !!compareTimeRecord(e.p, midnightTimeRecord());
|
|
542
|
-
})(e) || throwRangeError(
|
|
542
|
+
})(e) || throwRangeError(le), e;
|
|
543
543
|
}
|
|
544
544
|
function getInternalSlotForPlainDateTime(e) {
|
|
545
545
|
return Pe.get(e);
|
|
546
546
|
}
|
|
547
547
|
function getInternalSlotOrThrowForPlainDateTime(e) {
|
|
548
548
|
const t = getInternalSlotForPlainDateTime(e);
|
|
549
|
-
return t || throwTypeError(
|
|
549
|
+
return t || throwTypeError(Te), t;
|
|
550
550
|
}
|
|
551
551
|
function isPlainDateTime(e) {
|
|
552
552
|
return !!getInternalSlotForPlainDateTime(e);
|
|
553
553
|
}
|
|
554
|
+
function calendarDateForPlainDateTime(e) {
|
|
555
|
+
const t = getInternalSlotOrThrowForPlainDateTime(e);
|
|
556
|
+
return calendarIsoToDate(t.Y, t.K.o);
|
|
557
|
+
}
|
|
554
558
|
function createTimeRecord(e, t, o, n, r, a, i = 0) {
|
|
555
559
|
return {
|
|
556
560
|
D: e,
|
|
@@ -559,7 +563,7 @@ function createTimeRecord(e, t, o, n, r, a, i = 0) {
|
|
|
559
563
|
F: n,
|
|
560
564
|
S: r,
|
|
561
565
|
$: a,
|
|
562
|
-
|
|
566
|
+
X: i
|
|
563
567
|
};
|
|
564
568
|
}
|
|
565
569
|
function midnightTimeRecord() {
|
|
@@ -569,7 +573,7 @@ function differenceTime(e, t) {
|
|
|
569
573
|
return timeDurationFromComponents(t.D - e.D, t.I - e.I, t.O - e.O, t.F - e.F, t.S - e.S, t.$ - e.$);
|
|
570
574
|
}
|
|
571
575
|
function toTemporalTime(e, t) {
|
|
572
|
-
if (isObject(e)) return isPlainTime(e) ? (getTemporalOverflowOption(getOptionsObject(t)), getInternalSlotOrThrowForPlainTime(e)) : isPlainDateTime(e) ? (getTemporalOverflowOption(getOptionsObject(t)), getInternalSlotOrThrowForPlainDateTime(e).
|
|
576
|
+
if (isObject(e)) return isPlainTime(e) ? (getTemporalOverflowOption(getOptionsObject(t)), getInternalSlotOrThrowForPlainTime(e)) : isPlainDateTime(e) ? (getTemporalOverflowOption(getOptionsObject(t)), getInternalSlotOrThrowForPlainDateTime(e).K.p) : isZonedDateTime(e) ? (getTemporalOverflowOption(getOptionsObject(t)), getIsoDateTimeForZonedDateTimeSlot(getInternalSlotOrThrowForZonedDateTime(e)).p) : regulateTime(...toTemporalTimeRecord(e), getTemporalOverflowOption(getOptionsObject(t)));
|
|
573
577
|
validateString(e);
|
|
574
578
|
const o = parseIsoDateTime(e, [et]);
|
|
575
579
|
return getTemporalOverflowOption(getOptionsObject(t)), o.p;
|
|
@@ -578,7 +582,7 @@ function toTimeRecordOrMidnight(e) {
|
|
|
578
582
|
return void 0 === e ? midnightTimeRecord() : toTemporalTime(e);
|
|
579
583
|
}
|
|
580
584
|
function regulateTime(e, t, o, n, r, a, i) {
|
|
581
|
-
return "constrain" === i ? createTimeRecord(clamp(e, 0, 23), clamp(t, 0, 59), clamp(o, 0, 59), clamp(n, 0, 999), clamp(r, 0, 999), clamp(a, 0, 999)) : (isValidTime(e, t, o, n, r, a) || throwRangeError(
|
|
585
|
+
return "constrain" === i ? createTimeRecord(clamp(e, 0, 23), clamp(t, 0, 59), clamp(o, 0, 59), clamp(n, 0, 999), clamp(r, 0, 999), clamp(a, 0, 999)) : (isValidTime(e, t, o, n, r, a) || throwRangeError(se), createTimeRecord(e, t, o, n, r, a));
|
|
582
586
|
}
|
|
583
587
|
function isValidTime(e, t, o, n, r, a) {
|
|
584
588
|
return isWithin(e, 0, 23) && isWithin(t, 0, 59) && isWithin(o, 0, 59) && isWithin(n, 0, 999) && isWithin(r, 0, 999) && isWithin(a, 0, 999);
|
|
@@ -591,7 +595,7 @@ function balanceTime(e, t, o, n, r, a) {
|
|
|
591
595
|
F: modFloor(n, 1e3),
|
|
592
596
|
S: modFloor(r, 1e3),
|
|
593
597
|
$: modFloor(a, 1e3),
|
|
594
|
-
|
|
598
|
+
X: divFloor(e, 24)
|
|
595
599
|
};
|
|
596
600
|
}
|
|
597
601
|
function createTemporalTime(e, t = Object.create(Ze.prototype)) {
|
|
@@ -610,7 +614,7 @@ function toTemporalTimeRecord(e, t = !1) {
|
|
|
610
614
|
const r = e[n];
|
|
611
615
|
return void 0 !== r ? (o = !0, toIntegerWithTruncation(r)) : t ? void 0 : 0;
|
|
612
616
|
});
|
|
613
|
-
return o || throwTypeError(
|
|
617
|
+
return o || throwTypeError(ge), [
|
|
614
618
|
0,
|
|
615
619
|
3,
|
|
616
620
|
5,
|
|
@@ -627,14 +631,14 @@ function compareTimeRecord(e, t) {
|
|
|
627
631
|
}
|
|
628
632
|
function addTime(e, t) {
|
|
629
633
|
const o = t, n = balanceTime(e.D, e.I, e.O, e.F, e.S, e.$ + o[1]);
|
|
630
|
-
return n.
|
|
634
|
+
return n.X += o[0], n;
|
|
631
635
|
}
|
|
632
636
|
function roundTime(e, n, r, a) {
|
|
633
637
|
const i = nanosecondsForTimeUnit(clamp(r - 1, 3, 8)), c = e.D * o + e.I * t + 1e9 * e.O + 1e6 * e.F + 1e3 * e.S + e.$;
|
|
634
638
|
return balanceTime(0, 0, 0, 0, 0, divFloor(c, i) * i + roundNumberToIncrement(modFloor(c, i), n * nanosecondsForTimeUnit(r), a));
|
|
635
639
|
}
|
|
636
640
|
function differenceTemporalPlainTime(e, t, o, n) {
|
|
637
|
-
const r = toTemporalTime(o), a = getDifferenceSettings(e, getOptionsObject(n),
|
|
641
|
+
const r = toTemporalTime(o), a = getDifferenceSettings(e, getOptionsObject(n), s, [], J, H);
|
|
638
642
|
return createTemporalDuration(applySignToDurationSlot(temporalDurationFromInternal(combineDateAndTimeDuration(zeroDateDuration(), roundTimeDuration(differenceTime(t, r), a.V, a.H, a.q)), a.L), e));
|
|
639
643
|
}
|
|
640
644
|
function addDurationToTime(e, t, o) {
|
|
@@ -642,7 +646,7 @@ function addDurationToTime(e, t, o) {
|
|
|
642
646
|
}
|
|
643
647
|
function getInternalSlotOrThrowForPlainTime(e) {
|
|
644
648
|
const t = Ne.get(e);
|
|
645
|
-
return t || throwTypeError(
|
|
649
|
+
return t || throwTypeError(Te), t;
|
|
646
650
|
}
|
|
647
651
|
function isPlainTime(e) {
|
|
648
652
|
return Ne.has(e);
|
|
@@ -657,16 +661,13 @@ function createRegExp(e) {
|
|
|
657
661
|
return RegExp(`^(?:${e})$`);
|
|
658
662
|
}
|
|
659
663
|
function isAmbiguousTemporalTimeString(e) {
|
|
660
|
-
return nt.some((t) =>
|
|
661
|
-
const o = e.match(t);
|
|
662
|
-
return o && isSemanticallyValid(o.groups);
|
|
663
|
-
});
|
|
664
|
+
return nt.some((t) => isSemanticallyValid(e.match(t)?.groups));
|
|
664
665
|
}
|
|
665
666
|
function isTimeZoneIdentifier(e) {
|
|
666
667
|
return rt.test(e);
|
|
667
668
|
}
|
|
668
669
|
function isSemanticallyValid(e) {
|
|
669
|
-
return "-000000" !== (e.a || e.l) && (!e.a || isValidIsoDate(
|
|
670
|
+
return !!e && "-000000" !== (e.a || e.l) && (!e.a || isValidIsoDate(Oe(e.a), Oe(e.b), Oe(e.c))) && (!e.n || isValidIsoDate(1972, Oe(e.m), Oe(e.n)));
|
|
670
671
|
}
|
|
671
672
|
function parseIsoDateTime(e, t) {
|
|
672
673
|
for (const o of t) {
|
|
@@ -676,15 +677,15 @@ function parseIsoDateTime(e, t) {
|
|
|
676
677
|
let r;
|
|
677
678
|
if (n.k) {
|
|
678
679
|
let t = !1;
|
|
679
|
-
for (const [, o, a, i] of n.k.matchAll(
|
|
680
|
+
for (const [, o, a, i] of n.k.matchAll(Xe)) "u-ca" === a ? r ? (o || t) && throwRangeError(parseError(e)) : (r = i, t = !!o) : o && throwRangeError(parseError(e));
|
|
680
681
|
}
|
|
681
682
|
n.m && r && "iso8601" !== asciiLowerCase(r) && throwRangeError(parseError(e));
|
|
682
683
|
const a = (n.g || "").padEnd(9, "0");
|
|
683
684
|
return {
|
|
684
|
-
t: mapUnlessUndefined(n.a || n.l,
|
|
685
|
-
u:
|
|
686
|
-
T:
|
|
687
|
-
p: n.d ? createTimeRecord(
|
|
685
|
+
t: mapUnlessUndefined(n.a || n.l, Oe),
|
|
686
|
+
u: Oe(n.b || n.m || 1),
|
|
687
|
+
T: Oe(n.c || n.n || 1),
|
|
688
|
+
p: n.d ? createTimeRecord(Oe(n.d || 0), Oe(n.e || 0), clamp(Oe(n.f || 0), 0, 59), Oe(a.slice(0, 3)), Oe(a.slice(3, 6)), Oe(a.slice(6))) : void 0,
|
|
688
689
|
P: {
|
|
689
690
|
Z: !!n.i,
|
|
690
691
|
N: n.h,
|
|
@@ -697,7 +698,7 @@ function parseIsoDateTime(e, t) {
|
|
|
697
698
|
}
|
|
698
699
|
function parseDateTimeUtcOffset(e) {
|
|
699
700
|
const o = e.match(it);
|
|
700
|
-
return o || throwRangeError(parseError(e)),
|
|
701
|
+
return o || throwRangeError(parseError(e)), Oe(`${o[1]}1`) * (36e11 * Oe(o[2]) + Oe(o[4] || "") * t + 1e9 * Oe(o[5] || "") + Oe((o[6] || "").padEnd(9, "0")) + 0);
|
|
701
702
|
}
|
|
702
703
|
function hasUtcOffsetSubMinuteParts(e) {
|
|
703
704
|
return !!e.match(it)[5];
|
|
@@ -716,7 +717,7 @@ function toTemporalMonthDay(e, t) {
|
|
|
716
717
|
}
|
|
717
718
|
validateString(e);
|
|
718
719
|
const o = parseIsoDateTime(e, [tt]), n = canonicalizeCalendar(o.Y || "iso8601");
|
|
719
|
-
return getTemporalOverflowOption(getOptionsObject(t)), createTemporalMonthDay("iso8601" === n ? createIsoDateRecord(1972, o.u, o.T) : calendarMonthDayFromFields(n, isoDateToFields(n, validateIsoDate(createIsoDateRecord(o.t, o.u, o.T)),
|
|
720
|
+
return getTemporalOverflowOption(getOptionsObject(t)), createTemporalMonthDay("iso8601" === n ? createIsoDateRecord(1972, o.u, o.T) : calendarMonthDayFromFields(n, isoDateToFields(n, validateIsoDate(createIsoDateRecord(o.t, o.u, o.T)), m), D), n);
|
|
720
721
|
}
|
|
721
722
|
function createTemporalMonthDay(e, t, o = Object.create(st.prototype)) {
|
|
722
723
|
return ct.set(o, {
|
|
@@ -725,14 +726,14 @@ function createTemporalMonthDay(e, t, o = Object.create(st.prototype)) {
|
|
|
725
726
|
}), o;
|
|
726
727
|
}
|
|
727
728
|
function temporalMonthDayToString(e, t) {
|
|
728
|
-
return `${t ===
|
|
729
|
+
return `${t === $ || t === Y || "iso8601" !== e.Y ? `${padIsoYear(e.o.t)}-` : ""}${toZeroPaddedDecimalString(e.o.u, 2)}-${toZeroPaddedDecimalString(e.o.T, 2)}${formatCalendarAnnotation(e.Y, t)}`;
|
|
729
730
|
}
|
|
730
731
|
function getInternalSlotForPlainMonthDay(e) {
|
|
731
732
|
return ct.get(e);
|
|
732
733
|
}
|
|
733
734
|
function getInternalSlotOrThrowForPlainMonthDay(e) {
|
|
734
735
|
const t = getInternalSlotForPlainMonthDay(e);
|
|
735
|
-
return t || throwTypeError(
|
|
736
|
+
return t || throwTypeError(Te), t;
|
|
736
737
|
}
|
|
737
738
|
function isPlainMonthDay(e) {
|
|
738
739
|
return !!getInternalSlotForPlainMonthDay(e);
|
|
@@ -750,7 +751,7 @@ function toTemporalYearMonth(e, t) {
|
|
|
750
751
|
}
|
|
751
752
|
validateString(e);
|
|
752
753
|
const o = parseIsoDateTime(e, [ot]), n = canonicalizeCalendar(o.Y || "iso8601");
|
|
753
|
-
return getTemporalOverflowOption(getOptionsObject(t)), createTemporalYearMonth(calendarYearMonthFromFields(n, isoDateToFields(n, validateIsoYearMonth(createIsoDateRecord(o.t, o.u, o.T)),
|
|
754
|
+
return getTemporalOverflowOption(getOptionsObject(t)), createTemporalYearMonth(calendarYearMonthFromFields(n, isoDateToFields(n, validateIsoYearMonth(createIsoDateRecord(o.t, o.u, o.T)), d), D), n);
|
|
754
755
|
}
|
|
755
756
|
function balanceIsoYearMonth(e, t) {
|
|
756
757
|
return {
|
|
@@ -765,12 +766,12 @@ function createTemporalYearMonth(e, t, o = Object.create(dt.prototype)) {
|
|
|
765
766
|
}), o;
|
|
766
767
|
}
|
|
767
768
|
function temporalYearMonthToString(e, t) {
|
|
768
|
-
return `${padIsoYear(e.o.t)}-${toZeroPaddedDecimalString(e.o.u, 2)}${t ===
|
|
769
|
+
return `${padIsoYear(e.o.t)}-${toZeroPaddedDecimalString(e.o.u, 2)}${t === $ || t === Y || "iso8601" !== e.Y ? `-${toZeroPaddedDecimalString(e.o.T, 2)}` : ""}${formatCalendarAnnotation(e.Y, t)}`;
|
|
769
770
|
}
|
|
770
771
|
function differenceTemporalPlainYearMonth(e, t, o, n) {
|
|
771
772
|
const r = getInternalSlotOrThrowForPlainYearMonth(toTemporalYearMonth(o));
|
|
772
|
-
calendarEquals(t.Y, r.Y) || throwRangeError(
|
|
773
|
-
const a = getDifferenceSettings(e, getOptionsObject(n),
|
|
773
|
+
calendarEquals(t.Y, r.Y) || throwRangeError(ue);
|
|
774
|
+
const a = getDifferenceSettings(e, getOptionsObject(n), c, [V, x], z, k);
|
|
774
775
|
if (!compareIsoDate(t.o, r.o)) return createTemporalDuration(createTemporalDurationSlot([
|
|
775
776
|
0,
|
|
776
777
|
0,
|
|
@@ -784,39 +785,43 @@ function differenceTemporalPlainYearMonth(e, t, o, n) {
|
|
|
784
785
|
0
|
|
785
786
|
]));
|
|
786
787
|
const i = calendarDateFromFields(t.Y, createNullPrototypeObject({
|
|
787
|
-
...isoDateToFields(t.Y, t.o,
|
|
788
|
+
...isoDateToFields(t.Y, t.o, d),
|
|
788
789
|
[Ot.T]: 1
|
|
789
|
-
}),
|
|
790
|
-
...isoDateToFields(t.Y, r.o,
|
|
790
|
+
}), D), s = calendarDateFromFields(t.Y, createNullPrototypeObject({
|
|
791
|
+
...isoDateToFields(t.Y, r.o, d),
|
|
791
792
|
[Ot.T]: 1
|
|
792
|
-
}),
|
|
793
|
-
let l = combineDateAndTimeDuration(adjustDateDurationRecord(calendarDateUntil(t.Y, i,
|
|
794
|
-
if (a.H !==
|
|
793
|
+
}), D);
|
|
794
|
+
let l = combineDateAndTimeDuration(adjustDateDurationRecord(calendarDateUntil(t.Y, i, s, a.L), 0, 0), ye);
|
|
795
|
+
if (a.H !== z || 1 !== a.V) {
|
|
795
796
|
const e = combineIsoDateAndTimeRecord(i, midnightTimeRecord());
|
|
796
|
-
l = roundRelativeDuration(l, getUtcEpochNanoseconds(e), getUtcEpochNanoseconds(combineIsoDateAndTimeRecord(
|
|
797
|
+
l = roundRelativeDuration(l, getUtcEpochNanoseconds(e), getUtcEpochNanoseconds(combineIsoDateAndTimeRecord(s, midnightTimeRecord())), e, void 0, t.Y, a.L, a.V, a.H, a.q);
|
|
797
798
|
}
|
|
798
|
-
return createTemporalDuration(applySignToDurationSlot(temporalDurationFromInternal(l,
|
|
799
|
+
return createTemporalDuration(applySignToDurationSlot(temporalDurationFromInternal(l, x), e));
|
|
799
800
|
}
|
|
800
801
|
function addDurationToYearMonth(e, t, o, n) {
|
|
801
802
|
const r = toInternalDurationRecord(applySignToDurationSlot(toTemporalDuration(o), e)), a = getTemporalOverflowOption(getOptionsObject(n));
|
|
802
|
-
return (r.A.
|
|
803
|
-
...isoDateToFields(t.Y, t.o,
|
|
803
|
+
return (r.A.ee || r.A.X || signTimeDuration(r.p)) && throwRangeError("duration can contain only years and months"), createTemporalYearMonth(calendarYearMonthFromFields(t.Y, isoDateToFields(t.Y, calendarDateAdd(t.Y, calendarDateFromFields(t.Y, createNullPrototypeObject({
|
|
804
|
+
...isoDateToFields(t.Y, t.o, d),
|
|
804
805
|
[Ot.T]: 1
|
|
805
|
-
}),
|
|
806
|
+
}), D), r.A, a), d), a), t.Y);
|
|
806
807
|
}
|
|
807
808
|
function validateIsoYearMonth(e) {
|
|
808
|
-
return ((e) => isWithin(12 * e.t + e.u, -3261848, 3309129))(e) || throwRangeError(
|
|
809
|
+
return ((e) => isWithin(12 * e.t + e.u, -3261848, 3309129))(e) || throwRangeError(le), e;
|
|
809
810
|
}
|
|
810
811
|
function getInternalSlotForPlainYearMonth(e) {
|
|
811
812
|
return lt.get(e);
|
|
812
813
|
}
|
|
813
814
|
function getInternalSlotOrThrowForPlainYearMonth(e) {
|
|
814
815
|
const t = getInternalSlotForPlainYearMonth(e);
|
|
815
|
-
return t || throwTypeError(
|
|
816
|
+
return t || throwTypeError(Te), t;
|
|
816
817
|
}
|
|
817
818
|
function isPlainYearMonth(e) {
|
|
818
819
|
return !!getInternalSlotForPlainYearMonth(e);
|
|
819
820
|
}
|
|
821
|
+
function calendarDateForPlainYearMonth(e) {
|
|
822
|
+
const t = getInternalSlotOrThrowForPlainYearMonth(e);
|
|
823
|
+
return calendarIsoToDate(t.Y, t.o);
|
|
824
|
+
}
|
|
820
825
|
function createIsoDateRecord(e, t, o) {
|
|
821
826
|
return {
|
|
822
827
|
t: e,
|
|
@@ -845,7 +850,7 @@ function toTemporalDate(e, t) {
|
|
|
845
850
|
if (isPlainDateTime(e)) {
|
|
846
851
|
getTemporalOverflowOption(getOptionsObject(t));
|
|
847
852
|
const o = getInternalSlotOrThrowForPlainDateTime(e);
|
|
848
|
-
return createTemporalDate(o.
|
|
853
|
+
return createTemporalDate(o.K.o, o.Y);
|
|
849
854
|
}
|
|
850
855
|
const o = getTemporalCalendarIdentifierWithIsoDefault(e);
|
|
851
856
|
return createTemporalDate(calendarDateFromFields(o, prepareCalendarFields(o, e, [
|
|
@@ -856,11 +861,11 @@ function toTemporalDate(e, t) {
|
|
|
856
861
|
], []), getTemporalOverflowOption(getOptionsObject(t))), o);
|
|
857
862
|
}
|
|
858
863
|
validateString(e);
|
|
859
|
-
const o = parseIsoDateTime(e, [
|
|
864
|
+
const o = parseIsoDateTime(e, [Ke]), n = canonicalizeCalendar(o.Y || "iso8601");
|
|
860
865
|
return getTemporalOverflowOption(getOptionsObject(t)), createTemporalDate(createIsoDateRecord(o.t, o.u, o.T), n);
|
|
861
866
|
}
|
|
862
867
|
function regulateIsoDate(e, t, o, n) {
|
|
863
|
-
return "constrain" === n ? createIsoDateRecord(e, t = clamp(t, 1, 12), clamp(o, 1, isoDaysInMonth(e, t))) : (isValidIsoDate(e, t, o) || throwRangeError(
|
|
868
|
+
return "constrain" === n ? createIsoDateRecord(e, t = clamp(t, 1, 12), clamp(o, 1, isoDaysInMonth(e, t))) : (isValidIsoDate(e, t, o) || throwRangeError(se), createIsoDateRecord(e, t, o));
|
|
864
869
|
}
|
|
865
870
|
function isValidIsoDate(e, t, o) {
|
|
866
871
|
return isWithin(t, 1, 12) && isWithin(o, 1, isoDaysInMonth(e, t));
|
|
@@ -879,8 +884,8 @@ function compareIsoDate(e, t) {
|
|
|
879
884
|
}
|
|
880
885
|
function differenceTemporalPlainDate(e, t, o, n) {
|
|
881
886
|
const r = getInternalSlotOrThrowForPlainDate(toTemporalDate(o));
|
|
882
|
-
calendarEquals(t.Y, r.Y) || throwRangeError(
|
|
883
|
-
const a = getDifferenceSettings(e, getOptionsObject(n),
|
|
887
|
+
calendarEquals(t.Y, r.Y) || throwRangeError(ue);
|
|
888
|
+
const a = getDifferenceSettings(e, getOptionsObject(n), c, [], x, x);
|
|
884
889
|
if (!compareIsoDate(t.o, r.o)) return createTemporalDuration(createTemporalDurationSlot([
|
|
885
890
|
0,
|
|
886
891
|
0,
|
|
@@ -893,17 +898,17 @@ function differenceTemporalPlainDate(e, t, o, n) {
|
|
|
893
898
|
0,
|
|
894
899
|
0
|
|
895
900
|
]));
|
|
896
|
-
let i = combineDateAndTimeDuration(calendarDateUntil(t.Y, t.o, r.o, a.L),
|
|
897
|
-
if (a.H !==
|
|
901
|
+
let i = combineDateAndTimeDuration(calendarDateUntil(t.Y, t.o, r.o, a.L), ye);
|
|
902
|
+
if (a.H !== x || 1 !== a.V) {
|
|
898
903
|
const e = combineIsoDateAndTimeRecord(t.o, midnightTimeRecord());
|
|
899
904
|
i = roundRelativeDuration(i, getUtcEpochNanoseconds(e), getUtcEpochNanoseconds(combineIsoDateAndTimeRecord(r.o, midnightTimeRecord())), e, void 0, t.Y, a.L, a.V, a.H, a.q);
|
|
900
905
|
}
|
|
901
|
-
return createTemporalDuration(applySignToDurationSlot(temporalDurationFromInternal(i,
|
|
906
|
+
return createTemporalDuration(applySignToDurationSlot(temporalDurationFromInternal(i, x), e));
|
|
902
907
|
}
|
|
903
908
|
function addDurationToDate(e, t, o, n) {
|
|
904
909
|
return createTemporalDate(calendarDateAdd(t.Y, t.o, ((e) => {
|
|
905
910
|
const t = toInternalDurationRecordWith24HourDays(e);
|
|
906
|
-
return createDateDurationRecord(t.A.
|
|
911
|
+
return createDateDurationRecord(t.A.te, t.A.oe, t.A.ee, t.p[0]);
|
|
907
912
|
})(applySignToDurationSlot(toTemporalDuration(o), e)), getTemporalOverflowOption(getOptionsObject(n))), t.Y);
|
|
908
913
|
}
|
|
909
914
|
function getInternalSlotForPlainDate(e) {
|
|
@@ -911,7 +916,7 @@ function getInternalSlotForPlainDate(e) {
|
|
|
911
916
|
}
|
|
912
917
|
function getInternalSlotOrThrowForPlainDate(e) {
|
|
913
918
|
const t = getInternalSlotForPlainDate(e);
|
|
914
|
-
return t || throwTypeError(
|
|
919
|
+
return t || throwTypeError(Te), t;
|
|
915
920
|
}
|
|
916
921
|
function isPlainDate(e) {
|
|
917
922
|
return !!getInternalSlotForPlainDate(e);
|
|
@@ -919,6 +924,10 @@ function isPlainDate(e) {
|
|
|
919
924
|
function validateIsoDate(e) {
|
|
920
925
|
return validateIsoDateTime(combineIsoDateAndTimeRecord(e, createTimeRecord(12, 0, 0, 0, 0, 0))), e;
|
|
921
926
|
}
|
|
927
|
+
function calendarDateForPlainDate(e) {
|
|
928
|
+
const t = getInternalSlotOrThrowForPlainDate(e);
|
|
929
|
+
return calendarIsoToDate(t.Y, t.o);
|
|
930
|
+
}
|
|
922
931
|
function formatToParts(e, t) {
|
|
923
932
|
return (Tt[e] ||= new bt("en", {
|
|
924
933
|
year: "numeric",
|
|
@@ -941,9 +950,7 @@ function extractYearMonthDay(e, t) {
|
|
|
941
950
|
};
|
|
942
951
|
}
|
|
943
952
|
function yearMonthDay(e, t) {
|
|
944
|
-
|
|
945
|
-
if (o) return o;
|
|
946
|
-
const n = ((e, t) => {
|
|
953
|
+
return ht[e].J(t, () => ((e, t) => {
|
|
947
954
|
const o = formatToParts(e, t), n = [
|
|
948
955
|
"relatedYear",
|
|
949
956
|
"month",
|
|
@@ -954,18 +961,17 @@ function yearMonthDay(e, t) {
|
|
|
954
961
|
v: createMonthCode(parseInt(n[1]), /bis/.test(n[1])),
|
|
955
962
|
T: toIntegerIfIntegral(n[2])
|
|
956
963
|
};
|
|
957
|
-
})(e, t);
|
|
958
|
-
return ht[e].B(t, n), n;
|
|
964
|
+
})(e, t));
|
|
959
965
|
}
|
|
960
966
|
function getNewYear(e, t) {
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
967
|
+
return Dt[e].J(t, () => {
|
|
968
|
+
let o = isoDateToEpochDays(t, 0, 1985 === t ? 53 : Math.floor(modFloor(-10.8822 * t + 16, 29.53)) + 23), n = yearMonthDay(e, o);
|
|
969
|
+
for (let r = 0; "M01" !== n.v; r++) {
|
|
970
|
+
if (r > 20) throw new Error("unexpected calendar error");
|
|
971
|
+
o += n.t < t ? 31 - n.T : -n.T, n = yearMonthDay(e, o);
|
|
972
|
+
}
|
|
973
|
+
return o - n.T + 1;
|
|
974
|
+
});
|
|
969
975
|
}
|
|
970
976
|
function ordinalMonthToMonthCode(e, t, o) {
|
|
971
977
|
return yearMonthDay(e, getNewYear(e, t) + 30 * (o - 1)).v;
|
|
@@ -982,8 +988,8 @@ function monthsInYear(e, t) {
|
|
|
982
988
|
}
|
|
983
989
|
function epochDaysToDate$6(e, t) {
|
|
984
990
|
return {
|
|
985
|
-
oe: void 0,
|
|
986
991
|
ne: void 0,
|
|
992
|
+
re: void 0,
|
|
987
993
|
get t() {
|
|
988
994
|
return yearMonthDay(e, t).t;
|
|
989
995
|
},
|
|
@@ -997,28 +1003,28 @@ function epochDaysToDate$6(e, t) {
|
|
|
997
1003
|
get T() {
|
|
998
1004
|
return yearMonthDay(e, t).T;
|
|
999
1005
|
},
|
|
1000
|
-
|
|
1001
|
-
get
|
|
1006
|
+
ae: isoDayOfWeek(epochDaysToIsoDate(t)),
|
|
1007
|
+
get ie() {
|
|
1002
1008
|
const o = yearMonthDay(e, t).t;
|
|
1003
1009
|
return t - getNewYear(e, o) + 1;
|
|
1004
1010
|
},
|
|
1005
|
-
|
|
1006
|
-
|
|
1011
|
+
ce: {
|
|
1012
|
+
se: void 0,
|
|
1007
1013
|
t: void 0
|
|
1008
1014
|
},
|
|
1009
|
-
|
|
1010
|
-
get
|
|
1015
|
+
le: 7,
|
|
1016
|
+
get de() {
|
|
1011
1017
|
const o = yearMonthDay(e, t);
|
|
1012
1018
|
return daysInMonth$6(e, o.t, Math.round((t - o.T - getNewYear(e, o.t)) / 29.53) + 1);
|
|
1013
1019
|
},
|
|
1014
|
-
get
|
|
1020
|
+
get me() {
|
|
1015
1021
|
const o = yearMonthDay(e, t).t;
|
|
1016
1022
|
return getNewYear(e, o + 1) - getNewYear(e, o);
|
|
1017
1023
|
},
|
|
1018
|
-
get
|
|
1024
|
+
get ue() {
|
|
1019
1025
|
return monthsInYear(e, yearMonthDay(e, t).t);
|
|
1020
1026
|
},
|
|
1021
|
-
get
|
|
1027
|
+
get Te() {
|
|
1022
1028
|
return monthsInYear(e, yearMonthDay(e, t).t) > 12;
|
|
1023
1029
|
}
|
|
1024
1030
|
};
|
|
@@ -1082,30 +1088,27 @@ function epochDaysToDate$2(e, t) {
|
|
|
1082
1088
|
let n = 12;
|
|
1083
1089
|
for (; calendarIntegersToEpochDays$2(e, o, n, 1) > t; n--);
|
|
1084
1090
|
return {
|
|
1085
|
-
|
|
1086
|
-
|
|
1091
|
+
ne: o > 0 ? "ah" : "bh",
|
|
1092
|
+
re: o > 0 ? o : 1 - o,
|
|
1087
1093
|
t: o,
|
|
1088
1094
|
u: n,
|
|
1089
1095
|
v: createMonthCode(n),
|
|
1090
1096
|
T: t - calendarIntegersToEpochDays$2(e, o, n, 1) + 1,
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1097
|
+
ae: isoDayOfWeek(epochDaysToIsoDate(t)),
|
|
1098
|
+
ie: t - calendarIntegersToEpochDays$2(e, o, 1, 1) + 1,
|
|
1099
|
+
ce: {
|
|
1100
|
+
se: void 0,
|
|
1095
1101
|
t: void 0
|
|
1096
1102
|
},
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1103
|
+
le: 7,
|
|
1104
|
+
de: daysInMonth$2(o, n),
|
|
1105
|
+
me: +isLeapYear$1(o) + 354,
|
|
1106
|
+
ue: 12,
|
|
1107
|
+
Te: isLeapYear$1(o)
|
|
1102
1108
|
};
|
|
1103
1109
|
}
|
|
1104
1110
|
function getYearMonthDay(e) {
|
|
1105
|
-
|
|
1106
|
-
if (t) return t;
|
|
1107
|
-
const o = extractYearMonthDay("islamic-umalqura", e);
|
|
1108
|
-
return pt.B(e, o), o;
|
|
1111
|
+
return pt.J(e, () => extractYearMonthDay("islamic-umalqura", e));
|
|
1109
1112
|
}
|
|
1110
1113
|
function getFirstDayOfMonth(e, t) {
|
|
1111
1114
|
const o = balanceIsoYearMonth(e, t), n = calendarIntegersToEpochDays$2("islamic-civil", o.t, o.u, 1);
|
|
@@ -1118,10 +1121,10 @@ function constrainDay$2(e, t, o) {
|
|
|
1118
1121
|
return o < 30 ? o : clamp(o, 1, ((e, t) => getFirstDayOfMonth(e, t + 1) - getFirstDayOfMonth(e, t))(e, t));
|
|
1119
1122
|
}
|
|
1120
1123
|
function startOfYear(e) {
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1124
|
+
return gt.J(e, () => {
|
|
1125
|
+
const t = isoDateToEpochDays(e + 621, 4, 1), o = extractYearMonthDay("persian", t);
|
|
1126
|
+
return t - dayOfYearFromMonthDay(o.u, o.T) + 1;
|
|
1127
|
+
});
|
|
1125
1128
|
}
|
|
1126
1129
|
function dayOfYearFromMonthDay(e, t) {
|
|
1127
1130
|
return 30 * (e - 1) + t + clamp(e - 1, 0, 6);
|
|
@@ -1144,7 +1147,7 @@ function getDate(e) {
|
|
|
1144
1147
|
t: o,
|
|
1145
1148
|
u: r[0],
|
|
1146
1149
|
T: r[1],
|
|
1147
|
-
|
|
1150
|
+
ie: e - n + 1
|
|
1148
1151
|
};
|
|
1149
1152
|
}
|
|
1150
1153
|
function daysInMonth(e, t) {
|
|
@@ -1154,39 +1157,39 @@ function canonicalizeCalendar(e) {
|
|
|
1154
1157
|
return "islamicc" === (e = asciiLowerCase(e)) ? "islamic-civil" : "ethiopic-amete-alem" === e ? "ethioaa" : It[e] ? e : throwRangeError(((e) => `unsupported calendar: ${e}`)(e));
|
|
1155
1158
|
}
|
|
1156
1159
|
function calendarDateAdd(e, t, o, n) {
|
|
1157
|
-
if (isIsoLikeCalendar(e) || !o.
|
|
1158
|
-
const n = balanceIsoYearMonth(e.t + t.
|
|
1159
|
-
return validateIsoDate(addDaysToIsoDate(regulateIsoDate(n.t, n.u, e.T, o), 7 * t.
|
|
1160
|
+
if (isIsoLikeCalendar(e) || !o.te && !o.oe) return ((e, t, o) => {
|
|
1161
|
+
const n = balanceIsoYearMonth(e.t + t.te, e.u + t.oe);
|
|
1162
|
+
return validateIsoDate(addDaysToIsoDate(regulateIsoDate(n.t, n.u, e.T, o), 7 * t.ee + t.X));
|
|
1160
1163
|
})(t, o, n);
|
|
1161
|
-
const r = nonIsoCalendarIsoToDate(e, t), a = r.t + o.
|
|
1162
|
-
return validateIsoDate(addDaysToIsoDate(calendarIntegersToIso(e, i.t, i.u, constrainDay(e, i.t, i.u, r.T, n)), 7 * o.
|
|
1164
|
+
const r = nonIsoCalendarIsoToDate(e, t), a = r.t + o.te, i = balanceNonIsoYearMonth(e, a, monthCodeToOrdinal(e, a, constrainMonthCode(e, a, parseMonthCode(r.v), n)) + o.oe);
|
|
1165
|
+
return validateIsoDate(addDaysToIsoDate(calendarIntegersToIso(e, i.t, i.u, constrainDay(e, i.t, i.u, r.T, n)), 7 * o.ee + o.X));
|
|
1163
1166
|
}
|
|
1164
1167
|
function compareSurpasses(e, t, o, n, r) {
|
|
1165
1168
|
return t !== r.t ? e * (t - r.t) > 0 : o !== r.u && o !== r.v ? e * ("string" == typeof o ? o > r.v ? 1 : o < r.v ? -1 : 0 : o - r.u) > 0 : e * (n - r.T) > 0;
|
|
1166
1169
|
}
|
|
1167
1170
|
function nonIsoDateSurpasses(e, t, o, n, r, a) {
|
|
1168
|
-
if (compareSurpasses(t, o.t + r, o.v, o.T, n)) return {
|
|
1169
|
-
const i = balanceNonIsoYearMonth(e, o.t + r, monthCodeToOrdinal(e, o.t + r, constrainMonthCode(e, o.t + r, parseMonthCode(o.v),
|
|
1170
|
-
return compareSurpasses(t, i.t, i.u, o.T, n) ? {
|
|
1171
|
-
|
|
1171
|
+
if (compareSurpasses(t, o.t + r, o.v, o.T, n)) return { De: !0 };
|
|
1172
|
+
const i = balanceNonIsoYearMonth(e, o.t + r, monthCodeToOrdinal(e, o.t + r, constrainMonthCode(e, o.t + r, parseMonthCode(o.v), D)) + a);
|
|
1173
|
+
return compareSurpasses(t, i.t, i.u, o.T, n) ? { De: !0 } : {
|
|
1174
|
+
De: !1,
|
|
1172
1175
|
...i
|
|
1173
1176
|
};
|
|
1174
1177
|
}
|
|
1175
1178
|
function calendarDateUntil(e, t, o, n) {
|
|
1176
1179
|
const r = compareIsoDate(o, t);
|
|
1177
|
-
if (isIsoLikeCalendar(e) || n ===
|
|
1180
|
+
if (isIsoLikeCalendar(e) || n === V || n === x || !r) return ((e, t, o) => {
|
|
1178
1181
|
const n = compareIsoDate(t, e);
|
|
1179
1182
|
if (!n) return zeroDateDuration();
|
|
1180
|
-
if (o ===
|
|
1183
|
+
if (o === V || o === x) {
|
|
1181
1184
|
const n = isoDateToEpochDays(t.t, t.u - 1, t.T) - isoDateToEpochDays(e.t, e.u - 1, e.T);
|
|
1182
|
-
return o ===
|
|
1185
|
+
return o === V ? createDateDurationRecord(0, 0, divTrunc(n, 7) + 0, n % 7 + 0) : createDateDurationRecord(0, 0, 0, n);
|
|
1183
1186
|
}
|
|
1184
|
-
const r = 12 * t.t + t.u - 12 * e.t - e.u - (n * (e.T - t.T) > 0 ? n : 0), a = balanceIsoYearMonth(e.t, e.u + r), i = isoDateRecordToEpochDays(t) - isoDateRecordToEpochDays(regulateIsoDate(a.t, a.u, e.T,
|
|
1185
|
-
return o ===
|
|
1187
|
+
const r = 12 * t.t + t.u - 12 * e.t - e.u - (n * (e.T - t.T) > 0 ? n : 0), a = balanceIsoYearMonth(e.t, e.u + r), i = isoDateRecordToEpochDays(t) - isoDateRecordToEpochDays(regulateIsoDate(a.t, a.u, e.T, D));
|
|
1188
|
+
return o === k ? createDateDurationRecord(divTrunc(r, 12), r % 12 + 0, 0, i) : createDateDurationRecord(0, r, 0, i);
|
|
1186
1189
|
})(t, o, n);
|
|
1187
1190
|
const a = nonIsoCalendarIsoToDate(e, t), i = nonIsoCalendarIsoToDate(e, o);
|
|
1188
1191
|
let c, s = 0;
|
|
1189
|
-
if (n ===
|
|
1192
|
+
if (n === k) for (s = i.t - a.t; (c = nonIsoDateSurpasses(e, r, a, i, s, 0)).De; s -= r);
|
|
1190
1193
|
const l = ("hebrew" === e ? (d = (c || a).t, m = (c || a).u, monthNumber(i.t, i.u) - monthNumber(d, m)) : isChineseDangi(e) ? (function(e, t, o, n, r) {
|
|
1191
1194
|
if (t === n) return r - o;
|
|
1192
1195
|
const a = calendarIntegersToEpochDays$6(e, t, o, 1), i = calendarIntegersToEpochDays$6(e, n, r, 1), c = sign(i - a);
|
|
@@ -1197,10 +1200,10 @@ function calendarDateUntil(e, t, o, n) {
|
|
|
1197
1200
|
t -= yearMonthDay(e, t).T - 1, s += Math.round((t - l) / 29.5306), l = t;
|
|
1198
1201
|
}
|
|
1199
1202
|
return s;
|
|
1200
|
-
})(e, (c || a).t, (c || a).u, i.t, i.u) : (i.t - (c || a).t) * a.
|
|
1203
|
+
})(e, (c || a).t, (c || a).u, i.t, i.u) : (i.t - (c || a).t) * a.ue + i.u - (c || a).u) - (r * (a.T - i.T) > 0 ? r : 0);
|
|
1201
1204
|
var d, m;
|
|
1202
1205
|
const u = nonIsoDateSurpasses(e, r, a, i, s, l);
|
|
1203
|
-
return createDateDurationRecord(s, l, 0, isoDateRecordToEpochDays(o) - isoDateRecordToEpochDays(calendarIntegersToIso(e, u.t, u.u, constrainDay(e, u.t, u.u, a.T,
|
|
1206
|
+
return createDateDurationRecord(s, l, 0, isoDateRecordToEpochDays(o) - isoDateRecordToEpochDays(calendarIntegersToIso(e, u.t, u.u, constrainDay(e, u.t, u.u, a.T, D))));
|
|
1204
1207
|
}
|
|
1205
1208
|
function calendarDateToIso(e, t, o) {
|
|
1206
1209
|
const n = t[Ot.t], r = t[Ot.u], a = mapUnlessUndefined(t[Ot.v], parseMonthCode), i = t[Ot.T];
|
|
@@ -1215,80 +1218,80 @@ function calendarDateToIso(e, t, o) {
|
|
|
1215
1218
|
function nonIsoCalendarIsoToDate(e, t) {
|
|
1216
1219
|
const o = isoDateRecordToEpochDays(t), n = {
|
|
1217
1220
|
...isoCalendarIsoToDate(t),
|
|
1218
|
-
|
|
1221
|
+
ce: {
|
|
1219
1222
|
t: void 0,
|
|
1220
|
-
|
|
1223
|
+
se: void 0
|
|
1221
1224
|
}
|
|
1222
1225
|
};
|
|
1223
1226
|
if ("japanese" === e) {
|
|
1224
1227
|
const r = o >= 18017 ? "reiwa" : o >= 6947 ? "heisei" : o >= -15713 ? "showa" : o >= -20974 ? "taisho" : o >= -35428 ? "meiji" : t.t > 0 ? "ce" : "bce", a = It[e].get(r);
|
|
1225
1228
|
return {
|
|
1226
|
-
|
|
1227
|
-
|
|
1229
|
+
ne: r,
|
|
1230
|
+
re: "bce" === r ? 1 - t.t : t.t - a + 1,
|
|
1228
1231
|
...n
|
|
1229
1232
|
};
|
|
1230
1233
|
}
|
|
1231
1234
|
return "gregory" === e ? {
|
|
1232
|
-
|
|
1233
|
-
|
|
1235
|
+
ne: t.t > 0 ? "ce" : "bce",
|
|
1236
|
+
re: t.t > 0 ? t.t : 1 - t.t,
|
|
1234
1237
|
...n
|
|
1235
1238
|
} : "buddhist" === e ? {
|
|
1236
|
-
|
|
1237
|
-
|
|
1239
|
+
ne: "be",
|
|
1240
|
+
re: t.t + 543,
|
|
1238
1241
|
...n,
|
|
1239
1242
|
t: t.t + 543
|
|
1240
1243
|
} : "roc" === e ? {
|
|
1241
|
-
|
|
1242
|
-
|
|
1244
|
+
ne: t.t >= 1912 ? "roc" : "broc",
|
|
1245
|
+
re: t.t >= 1912 ? t.t - 1911 : 1912 - t.t,
|
|
1243
1246
|
...n,
|
|
1244
1247
|
t: t.t - 1911
|
|
1245
1248
|
} : isCopticOrEthiopic(e) ? ((e, t) => {
|
|
1246
1249
|
const o = divFloor(t - epoch$1(e) + 365, 365.25) - 1, n = t - calendarIntegersToEpochDays$5(e, o, 1, 1) + 1, r = divFloor(n - 1, 30) + 1;
|
|
1247
1250
|
return {
|
|
1248
|
-
|
|
1249
|
-
|
|
1251
|
+
ne: "coptic" === e || "ethiopic" === e && o > 0 ? "am" : "aa",
|
|
1252
|
+
re: "ethiopic" === e && o <= 0 ? o + 5500 : o,
|
|
1250
1253
|
t: o,
|
|
1251
1254
|
u: r,
|
|
1252
1255
|
v: createMonthCode(r),
|
|
1253
1256
|
T: modFloor(n - 1, 30) + 1,
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1257
|
+
ae: isoDayOfWeek(epochDaysToIsoDate(t)),
|
|
1258
|
+
ie: n,
|
|
1259
|
+
ce: {
|
|
1260
|
+
se: void 0,
|
|
1258
1261
|
t: void 0
|
|
1259
1262
|
},
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1263
|
+
le: 7,
|
|
1264
|
+
de: daysInMonth$5(o, r),
|
|
1265
|
+
me: mathematicalInLeapYear$2(o) + 365,
|
|
1266
|
+
ue: 13,
|
|
1267
|
+
Te: !!mathematicalInLeapYear$2(o)
|
|
1265
1268
|
};
|
|
1266
1269
|
})(e, o) : "indian" === e ? ((e) => {
|
|
1267
1270
|
const t = epochDaysToIsoDate(e), o = firstDayOfYear(t.t - 78) <= e ? t.t - 78 : t.t - 79, n = mathematicalInLeapYear$1(o);
|
|
1268
1271
|
let r = 12;
|
|
1269
1272
|
for (; calendarIntegersToEpochDays$3(o, r, 1) > e; r--);
|
|
1270
1273
|
return {
|
|
1271
|
-
|
|
1272
|
-
|
|
1274
|
+
ne: "shaka",
|
|
1275
|
+
re: o,
|
|
1273
1276
|
t: o,
|
|
1274
1277
|
u: r,
|
|
1275
1278
|
v: createMonthCode(r),
|
|
1276
1279
|
T: e - calendarIntegersToEpochDays$3(o, r, 1) + 1,
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1280
|
+
ae: isoDayOfWeek(t),
|
|
1281
|
+
ie: e - firstDayOfYear(o) + 1,
|
|
1282
|
+
ce: {
|
|
1283
|
+
se: void 0,
|
|
1281
1284
|
t: void 0
|
|
1282
1285
|
},
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1286
|
+
le: 7,
|
|
1287
|
+
de: daysInMonth$3(o, r),
|
|
1288
|
+
me: 365 + n,
|
|
1289
|
+
ue: 12,
|
|
1290
|
+
Te: !!n
|
|
1288
1291
|
};
|
|
1289
1292
|
})(o) : "persian" === e ? ((e) => ({
|
|
1290
|
-
|
|
1291
|
-
get
|
|
1293
|
+
ne: "ap",
|
|
1294
|
+
get re() {
|
|
1292
1295
|
return getDate(e).t;
|
|
1293
1296
|
},
|
|
1294
1297
|
get t() {
|
|
@@ -1303,31 +1306,31 @@ function nonIsoCalendarIsoToDate(e, t) {
|
|
|
1303
1306
|
get T() {
|
|
1304
1307
|
return getDate(e).T;
|
|
1305
1308
|
},
|
|
1306
|
-
|
|
1307
|
-
get
|
|
1308
|
-
return getDate(e).
|
|
1309
|
+
ae: isoDayOfWeek(epochDaysToIsoDate(e)),
|
|
1310
|
+
get ie() {
|
|
1311
|
+
return getDate(e).ie;
|
|
1309
1312
|
},
|
|
1310
|
-
|
|
1311
|
-
|
|
1313
|
+
ce: {
|
|
1314
|
+
se: void 0,
|
|
1312
1315
|
t: void 0
|
|
1313
1316
|
},
|
|
1314
|
-
|
|
1315
|
-
get
|
|
1317
|
+
le: 7,
|
|
1318
|
+
get de() {
|
|
1316
1319
|
const t = getDate(e);
|
|
1317
1320
|
return daysInMonth(t.t, t.u);
|
|
1318
1321
|
},
|
|
1319
|
-
get
|
|
1322
|
+
get me() {
|
|
1320
1323
|
return isLeapYear(getDate(e).t) ? 366 : 365;
|
|
1321
1324
|
},
|
|
1322
|
-
|
|
1323
|
-
get
|
|
1325
|
+
ue: 12,
|
|
1326
|
+
get Te() {
|
|
1324
1327
|
return isLeapYear(getDate(e).t);
|
|
1325
1328
|
}
|
|
1326
1329
|
}))(o) : isChineseDangi(e) ? epochDaysToDate$6(e, o) : "islamic-umalqura" === e ? ((e) => {
|
|
1327
1330
|
const t = epochDaysToDate$2("islamic-civil", e);
|
|
1328
1331
|
return e < -33600 || e > 76200 ? t : {
|
|
1329
|
-
|
|
1330
|
-
get
|
|
1332
|
+
ne: "ah",
|
|
1333
|
+
get re() {
|
|
1331
1334
|
return getYearMonthDay(e).t;
|
|
1332
1335
|
},
|
|
1333
1336
|
get t() {
|
|
@@ -1342,25 +1345,25 @@ function nonIsoCalendarIsoToDate(e, t) {
|
|
|
1342
1345
|
get T() {
|
|
1343
1346
|
return getYearMonthDay(e).T;
|
|
1344
1347
|
},
|
|
1345
|
-
|
|
1346
|
-
get
|
|
1348
|
+
ae: isoDayOfWeek(epochDaysToIsoDate(e)),
|
|
1349
|
+
get ie() {
|
|
1347
1350
|
return e - getFirstDayOfMonth(getYearMonthDay(e).t, 1) + 1;
|
|
1348
1351
|
},
|
|
1349
|
-
|
|
1350
|
-
|
|
1352
|
+
ce: {
|
|
1353
|
+
se: void 0,
|
|
1351
1354
|
t: void 0
|
|
1352
1355
|
},
|
|
1353
|
-
|
|
1354
|
-
get
|
|
1356
|
+
le: 7,
|
|
1357
|
+
get de() {
|
|
1355
1358
|
const t = getYearMonthDay(e);
|
|
1356
1359
|
return getFirstDayOfMonth(t.t, t.u + 1) - getFirstDayOfMonth(t.t, t.u);
|
|
1357
1360
|
},
|
|
1358
|
-
get
|
|
1361
|
+
get me() {
|
|
1359
1362
|
const t = getYearMonthDay(e).t;
|
|
1360
1363
|
return getFirstDayOfMonth(t + 1, 1) - getFirstDayOfMonth(t, 1);
|
|
1361
1364
|
},
|
|
1362
|
-
|
|
1363
|
-
get
|
|
1365
|
+
ue: 12,
|
|
1366
|
+
get Te() {
|
|
1364
1367
|
const t = getYearMonthDay(e).t;
|
|
1365
1368
|
return getFirstDayOfMonth(t + 1, 1) - getFirstDayOfMonth(t, 1) > 354;
|
|
1366
1369
|
}
|
|
@@ -1372,23 +1375,23 @@ function nonIsoCalendarIsoToDate(e, t) {
|
|
|
1372
1375
|
let n = isLeapYear$2(o) ? 13 : 12;
|
|
1373
1376
|
for (; calendarIntegersToEpochDays$4(o, n, 1) > e; n--);
|
|
1374
1377
|
return {
|
|
1375
|
-
|
|
1376
|
-
|
|
1378
|
+
ne: "am",
|
|
1379
|
+
re: o,
|
|
1377
1380
|
t: o,
|
|
1378
1381
|
u: n,
|
|
1379
1382
|
v: isLeapYear$2(o) ? createMonthCode(n <= 5 ? n : n - 1, 6 === n) : createMonthCode(n),
|
|
1380
1383
|
T: e - calendarIntegersToEpochDays$4(o, n, 1) + 1,
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1384
|
+
ae: isoDayOfWeek(t),
|
|
1385
|
+
ie: e - calendarIntegersToEpochDays$4(o, 1, 1) + 1,
|
|
1386
|
+
ce: {
|
|
1387
|
+
se: void 0,
|
|
1385
1388
|
t: void 0
|
|
1386
1389
|
},
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1390
|
+
le: 7,
|
|
1391
|
+
de: daysInMonth$4(o, n),
|
|
1392
|
+
me: calendarIntegersToEpochDays$4(o + 1, 1, 1) - calendarIntegersToEpochDays$4(o, 1, 1),
|
|
1393
|
+
ue: isLeapYear$2(o) ? 13 : 12,
|
|
1394
|
+
Te: isLeapYear$2(o)
|
|
1392
1395
|
};
|
|
1393
1396
|
})(o) : epochDaysToDate$2(e, o);
|
|
1394
1397
|
}
|
|
@@ -1400,10 +1403,10 @@ function canonicalizeEraInCalendar(e, t) {
|
|
|
1400
1403
|
return It[e].has(o) ? o : throwRangeError(((e) => `invalid era: ${e}`)(t));
|
|
1401
1404
|
}
|
|
1402
1405
|
function constrainMonthCode(e, t, o, n) {
|
|
1403
|
-
if ("hebrew" === e) return o[1] && !isLeapYear$2(t) ? "reject" === n ? throwRangeError(
|
|
1406
|
+
if ("hebrew" === e) return o[1] && !isLeapYear$2(t) ? "reject" === n ? throwRangeError(se) : [6, !1] : o;
|
|
1404
1407
|
if (isChineseDangi(e)) {
|
|
1405
1408
|
const r = ((e, t, o) => o[1] && ordinalMonthToMonthCode(e, t, o[0] + 1) !== createMonthCode(...o) ? [o[0], !1] : o)(e, t, o);
|
|
1406
|
-
return o !== r && "reject" === n ? throwRangeError(
|
|
1409
|
+
return o !== r && "reject" === n ? throwRangeError(se) : r;
|
|
1407
1410
|
}
|
|
1408
1411
|
return o;
|
|
1409
1412
|
}
|
|
@@ -1427,11 +1430,11 @@ function isChineseDangi(e) {
|
|
|
1427
1430
|
}
|
|
1428
1431
|
function constrainDay(e, t, o, n, r) {
|
|
1429
1432
|
const a = "persian" === e ? ((e, t, o) => o < 30 ? o : clamp(o, 1, daysInMonth(e, t)))(t, o, n) : "islamic-umalqura" === e ? constrainDay$2(t, o, n) : isChineseDangi(e) ? ((e, t, o, n) => n <= 29 ? n : clamp(n, 1, daysInMonth$6(e, t, o)))(e, t, o, n) : clamp(n, 1, isCopticOrEthiopic(e) ? daysInMonth$5(t, o) : "indian" === e ? daysInMonth$3(t, o) : "hebrew" === e ? daysInMonth$4(t, o) : daysInMonth$2(t, o));
|
|
1430
|
-
return n !== a && "reject" === r ? throwRangeError(
|
|
1433
|
+
return n !== a && "reject" === r ? throwRangeError(se) : a;
|
|
1431
1434
|
}
|
|
1432
1435
|
function constrainMonth(e, t, o, n) {
|
|
1433
1436
|
const r = isChineseDangi(e) ? ((e, t, o) => isWithin(o, 1, 12) ? o : clamp(o, 1, monthsInYear(e, t)))(e, t, o) : clamp(o, 1, "hebrew" === e && isLeapYear$2(t) || isCopticOrEthiopic(e) ? 13 : 12);
|
|
1434
|
-
return r !== o && "reject" === n && throwRangeError(
|
|
1437
|
+
return r !== o && "reject" === n && throwRangeError(se), r;
|
|
1435
1438
|
}
|
|
1436
1439
|
function balanceNonIsoYearMonth(e, t, o) {
|
|
1437
1440
|
if ("hebrew" === e) return ((e, t) => {
|
|
@@ -1468,7 +1471,7 @@ function parseMonthCode(e) {
|
|
|
1468
1471
|
const t = toPrimitive(e);
|
|
1469
1472
|
validateString(t);
|
|
1470
1473
|
const o = t.match(/M(\d\d)(L?)/);
|
|
1471
|
-
return o && "M00" !== t || throwRangeError(invalidMonthCode(t)), [
|
|
1474
|
+
return o && "M00" !== t || throwRangeError(invalidMonthCode(t)), [Oe(o[1]), !!o[2]];
|
|
1472
1475
|
}
|
|
1473
1476
|
function createMonthCode(e, t = !1) {
|
|
1474
1477
|
return `M${toZeroPaddedDecimalString(e, 2)}${t ? "L" : ""}`;
|
|
@@ -1481,12 +1484,12 @@ function prepareCalendarFields(e, t, o, n) {
|
|
|
1481
1484
|
const o = t[e];
|
|
1482
1485
|
void 0 !== o ? (a = !0, r[e] = St[e][0](o)) : n && (n.includes(e) && throwTypeError(missingField(e)), r[e] = St[e][1]);
|
|
1483
1486
|
}
|
|
1484
|
-
return n || a || throwTypeError(
|
|
1487
|
+
return n || a || throwTypeError(ge), r;
|
|
1485
1488
|
}
|
|
1486
1489
|
function calendarMergeFields(e, t, o) {
|
|
1487
1490
|
const n = ((e, t) => {
|
|
1488
1491
|
const o = [];
|
|
1489
|
-
return void 0 !== t[Ot.u] && o.push(Ot.v), void 0 !== t[Ot.v] && o.push(Ot.u), !calendarSupportsEra(e) || void 0 === t[Ot.
|
|
1492
|
+
return void 0 !== t[Ot.u] && o.push(Ot.v), void 0 !== t[Ot.v] && o.push(Ot.u), !calendarSupportsEra(e) || void 0 === t[Ot.ne] && void 0 === t[Ot.re] && void 0 === t[Ot.t] || o.push(Ot.ne, Ot.re, Ot.t), !((e) => "japanese" === e)(e) || void 0 === t[Ot.T] && void 0 === t[Ot.u] && void 0 === t[Ot.v] || o.push(Ot.ne, Ot.re), o;
|
|
1490
1493
|
})(e, o), r = createEmptyCalendarFieldsRecord();
|
|
1491
1494
|
for (const e of Ft) void 0 === t[e] || n.includes(e) || (r[e] = t[e]), void 0 !== o[e] && (r[e] = o[e]);
|
|
1492
1495
|
return r;
|
|
@@ -1497,7 +1500,7 @@ function toTemporalCalendarIdentifier(e) {
|
|
|
1497
1500
|
try {
|
|
1498
1501
|
return parseIsoDateTime(e, [
|
|
1499
1502
|
Ge,
|
|
1500
|
-
|
|
1503
|
+
Ke,
|
|
1501
1504
|
Qe,
|
|
1502
1505
|
et,
|
|
1503
1506
|
tt,
|
|
@@ -1516,10 +1519,10 @@ function calendarDateFromFields(e, t, o) {
|
|
|
1516
1519
|
return calendarResolveFields(e, t), validateIsoDate(calendarDateToIso(e, t, o));
|
|
1517
1520
|
}
|
|
1518
1521
|
function calendarYearMonthFromFields(e, t, o) {
|
|
1519
|
-
return t.day = 1, calendarResolveFields(e, t,
|
|
1522
|
+
return t.day = 1, calendarResolveFields(e, t, d), validateIsoYearMonth(calendarDateToIso(e, t, o));
|
|
1520
1523
|
}
|
|
1521
1524
|
function calendarMonthDayFromFields(e, t, o) {
|
|
1522
|
-
return calendarResolveFields(e, t,
|
|
1525
|
+
return calendarResolveFields(e, t, m), (function(e, t, o) {
|
|
1523
1526
|
if (isIsoLikeCalendar(e)) return ((e, t, o) => {
|
|
1524
1527
|
const n = regulateIsoDate(e[Ot.t] ?? 1972, e[Ot.u], e[Ot.T], t);
|
|
1525
1528
|
return o || validateIsoDate(n), createIsoDateRecord(1972, n.u, n.T);
|
|
@@ -1532,10 +1535,10 @@ function calendarMonthDayFromFields(e, t, o) {
|
|
|
1532
1535
|
return void 0 !== n ? (a || (r = constrainMonth(e, n, r, o)), a = a ? constrainMonthCode(e, n, a, o) : parseMonthCode(nonIsoCalendarIsoToDate(e, calendarIntegersToIso(e, n, r, 1)).v), i = constrainDay(e, n, r, i, o), validateIsoDate(calendarIntegersToIso(e, n, r, i))) : i = ((e, t, o, n) => {
|
|
1533
1536
|
if (isChineseDangi(e) || "islamic-umalqura" === e || "persian" === e) {
|
|
1534
1537
|
const r = clamp(o, 1, "persian" === e && t[0] <= 6 ? 31 : 30);
|
|
1535
|
-
return o !== r && "reject" === n ? throwRangeError(
|
|
1538
|
+
return o !== r && "reject" === n ? throwRangeError(se) : r;
|
|
1536
1539
|
}
|
|
1537
1540
|
return "hebrew" === e ? t[1] ? constrainDay(e, 3, 6, o, n) : constrainDay(e, 1, t[0], o, n) : constrainDay(e, isCopticOrEthiopic(e) ? 3 : 2, t[0], o, n);
|
|
1538
|
-
})(e, a, i, o), isChineseDangi(e) && a[1] && (1 === a[0] || 12 === a[0] || 30 === i && (2 === a[0] || isWithin(a[0], 8, 11))) && ("reject" === o && throwRangeError(
|
|
1541
|
+
})(e, a, i, o), isChineseDangi(e) && a[1] && (1 === a[0] || 12 === a[0] || 30 === i && (2 === a[0] || isWithin(a[0], 8, 11))) && ("reject" === o && throwRangeError(se), a[1] = !1), isCopticOrEthiopic(e) ? epochDaysToIsoDate(((e, t) => 13 === e && 6 === t ? 618 : (30 * (e - 1) + t + 252) % 365 + 731)(a[0], i)) : "indian" === e ? epochDaysToIsoDate(((e, t) => calendarIntegersToEpochDays$3(30 * e + t <= 310 ? 1894 : 1893, e, t))(a[0], i)) : "persian" === e ? epochDaysToIsoDate(((e, t) => {
|
|
1539
1542
|
if (12 === e && 30 === t) {
|
|
1540
1543
|
for (let o = 1350;; o--) if (isLeapYear(o)) return calendarIntegersToEpochDays(o, e, t);
|
|
1541
1544
|
}
|
|
@@ -1573,7 +1576,7 @@ function calendarMonthDayFromFields(e, t, o) {
|
|
|
1573
1576
|
})(e, t, o);
|
|
1574
1577
|
}
|
|
1575
1578
|
function formatCalendarAnnotation(e, t) {
|
|
1576
|
-
return t ===
|
|
1579
|
+
return t === C || t === Z && "iso8601" === e ? "" : `[${t === Y ? "!" : ""}u-ca=${e}]`;
|
|
1577
1580
|
}
|
|
1578
1581
|
function calendarEquals(e, t) {
|
|
1579
1582
|
return e === t;
|
|
@@ -1588,13 +1591,13 @@ function isoWeekOfYear(e) {
|
|
|
1588
1591
|
const t = e.t, o = divFloor(isoDayOfYear(e) + 10 - isoDayOfWeek(e), 7);
|
|
1589
1592
|
return o < 1 ? {
|
|
1590
1593
|
t: t - 1,
|
|
1591
|
-
|
|
1594
|
+
se: isoWeeksInYear(t - 1)
|
|
1592
1595
|
} : o > isoWeeksInYear(t) ? {
|
|
1593
1596
|
t: t + 1,
|
|
1594
|
-
|
|
1597
|
+
se: 1
|
|
1595
1598
|
} : {
|
|
1596
1599
|
t,
|
|
1597
|
-
|
|
1600
|
+
se: o
|
|
1598
1601
|
};
|
|
1599
1602
|
}
|
|
1600
1603
|
function isoDayOfYear(e) {
|
|
@@ -1609,14 +1612,14 @@ function isoCalendarIsoToDate(e) {
|
|
|
1609
1612
|
u: e.u,
|
|
1610
1613
|
v: createMonthCode(e.u),
|
|
1611
1614
|
T: e.T,
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1615
|
+
ae: isoDayOfWeek(e),
|
|
1616
|
+
ie: isoDayOfYear(e),
|
|
1617
|
+
ce: isoWeekOfYear(e),
|
|
1618
|
+
le: 7,
|
|
1619
|
+
de: isoDaysInMonth(e.t, e.u),
|
|
1620
|
+
me: (t = e.t, 365 + mathematicalInLeapYear(t)),
|
|
1621
|
+
ue: 12,
|
|
1622
|
+
Te: !!mathematicalInLeapYear(e.t)
|
|
1620
1623
|
};
|
|
1621
1624
|
var t;
|
|
1622
1625
|
}
|
|
@@ -1627,30 +1630,30 @@ function calendarExtraFields(e, t) {
|
|
|
1627
1630
|
return calendarSupportsEra(e) && t.includes("year") ? ["era", "eraYear"] : [];
|
|
1628
1631
|
}
|
|
1629
1632
|
function isoResolveFields(e, t) {
|
|
1630
|
-
t !==
|
|
1633
|
+
t !== m && void 0 === e[Ot.t] && throwTypeError(missingField(Ot.t)), t !== d && void 0 === e[Ot.T] && throwTypeError(missingField(Ot.T)), void 0 === e[Ot.v] && void 0 === e[Ot.u] && throwTypeError(missingField("month, monthCode"));
|
|
1631
1634
|
const o = mapUnlessUndefined(e[Ot.v], parseMonthCode);
|
|
1632
|
-
o && ((o[0] > 12 || o[1] || void 0 !== e[Ot.u] && o[0] !== e[Ot.u]) && throwRangeError(
|
|
1635
|
+
o && ((o[0] > 12 || o[1] || void 0 !== e[Ot.u] && o[0] !== e[Ot.u]) && throwRangeError(he), e[Ot.u] = o[0]);
|
|
1633
1636
|
}
|
|
1634
|
-
function calendarResolveFields(e, t, o =
|
|
1635
|
-
"iso8601" === e ? isoResolveFields(t, o) : (function(e, t, o =
|
|
1636
|
-
const n = t[Ot.
|
|
1637
|
+
function calendarResolveFields(e, t, o = c) {
|
|
1638
|
+
"iso8601" === e ? isoResolveFields(t, o) : (function(e, t, o = c) {
|
|
1639
|
+
const n = t[Ot.ne], r = t[Ot.re];
|
|
1637
1640
|
let a = t[Ot.t];
|
|
1638
|
-
const i = t[Ot.v],
|
|
1639
|
-
if (o ===
|
|
1641
|
+
const i = t[Ot.v], s = t[Ot.u], l = t[Ot.T];
|
|
1642
|
+
if (o === m && void 0 !== i && void 0 === s || void 0 !== a || calendarSupportsEraForNonIsoCalendars(e) && void 0 !== n && void 0 !== r || throwTypeError(missingField("year, era, eraYear")), calendarSupportsEraForNonIsoCalendars(e) && void 0 === n != (void 0 === r) && throwTypeError(), o !== d && void 0 === l && throwTypeError(missingField("day")), s === i && throwTypeError(missingField("month, monthCode")), calendarSupportsEraForNonIsoCalendars(e) && void 0 !== r) {
|
|
1640
1643
|
const o = ((e, t, o) => {
|
|
1641
1644
|
const n = canonicalizeEraInCalendar(e, t), r = It[e].get(n);
|
|
1642
1645
|
return !1 === r ? 1 - o : r + o - 1;
|
|
1643
1646
|
})(e, canonicalizeEraInCalendar(e, n), r);
|
|
1644
1647
|
void 0 !== a && a !== o && throwRangeError("mismatch of `year`, `era` and `eraYear`"), t[Ot.t] = o;
|
|
1645
1648
|
}
|
|
1646
|
-
if (t[Ot.
|
|
1649
|
+
if (t[Ot.ne] = t[Ot.re] = void 0, isIsoLikeCalendar(e)) isoResolveFields(t, o);
|
|
1647
1650
|
else if (i) {
|
|
1648
1651
|
const o = parseMonthCode(i);
|
|
1649
1652
|
((e, t) => isWithin(t[0], 1, 12) && !t[1] || isChineseDangi(e) && isWithin(t[0], 1, 12) || isCopticOrEthiopic(e) && 13 === t[0] && !t[1] || "hebrew" === e && 5 === t[0] && t[1])(e, o) || throwRangeError(invalidMonthCode(i));
|
|
1650
1653
|
const n = t[Ot.t];
|
|
1651
1654
|
if (void 0 !== n) {
|
|
1652
|
-
const r = monthCodeToOrdinal(e, n, constrainMonthCode(e, n, o,
|
|
1653
|
-
void 0 !==
|
|
1655
|
+
const r = monthCodeToOrdinal(e, n, constrainMonthCode(e, n, o, D));
|
|
1656
|
+
void 0 !== s && s !== r && throwRangeError(he), t[Ot.u] = r;
|
|
1654
1657
|
}
|
|
1655
1658
|
}
|
|
1656
1659
|
})(e, t, o);
|
|
@@ -1662,7 +1665,7 @@ function zeroDateDuration() {
|
|
|
1662
1665
|
return createDateDurationRecord(0, 0, 0, 0);
|
|
1663
1666
|
}
|
|
1664
1667
|
function toInternalDurationRecord(e) {
|
|
1665
|
-
return combineDateAndTimeDuration(createDateDurationRecord(e[
|
|
1668
|
+
return combineDateAndTimeDuration(createDateDurationRecord(e[_], e[X], e[G], e[K]), timeDurationFromComponents(e[Q], e[ee], e[te], e[oe], e[ne], e[re]));
|
|
1666
1669
|
}
|
|
1667
1670
|
function toInternalDurationRecordWith24HourDays([e, t, o, n, ...r]) {
|
|
1668
1671
|
return combineDateAndTimeDuration(createDateDurationRecord(e, t, o, 0), add24HourDaysToTimeDuration(timeDurationFromComponents(...r), n));
|
|
@@ -1670,23 +1673,23 @@ function toInternalDurationRecordWith24HourDays([e, t, o, n, ...r]) {
|
|
|
1670
1673
|
function temporalDurationFromInternal(e, t) {
|
|
1671
1674
|
const [o, ...n] = balanceTimeDuration(e.p, t);
|
|
1672
1675
|
return createTemporalDurationSlot([
|
|
1673
|
-
e.A.ee,
|
|
1674
1676
|
e.A.te,
|
|
1675
|
-
e.A.
|
|
1676
|
-
e.A.
|
|
1677
|
+
e.A.oe,
|
|
1678
|
+
e.A.ee,
|
|
1679
|
+
e.A.X + o,
|
|
1677
1680
|
...n
|
|
1678
1681
|
]);
|
|
1679
1682
|
}
|
|
1680
1683
|
function createDateDurationRecord(e, t, o, n) {
|
|
1681
1684
|
return validateDuration(e, t, o, n, 0, 0, 0, 0, 0, 0), {
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1685
|
+
te: e,
|
|
1686
|
+
oe: t,
|
|
1687
|
+
ee: o,
|
|
1688
|
+
X: n
|
|
1686
1689
|
};
|
|
1687
1690
|
}
|
|
1688
|
-
function adjustDateDurationRecord(e, t, o = e.
|
|
1689
|
-
return createDateDurationRecord(e.
|
|
1691
|
+
function adjustDateDurationRecord(e, t, o = e.ee, n = e.oe) {
|
|
1692
|
+
return createDateDurationRecord(e.te, n, o, t);
|
|
1690
1693
|
}
|
|
1691
1694
|
function combineDateAndTimeDuration(e, t) {
|
|
1692
1695
|
return {
|
|
@@ -1718,13 +1721,17 @@ function durationSign(e) {
|
|
|
1718
1721
|
return sign(e.find((e) => e) || 0);
|
|
1719
1722
|
}
|
|
1720
1723
|
function dateDurationSign(e) {
|
|
1721
|
-
return sign(e.
|
|
1724
|
+
return sign(e.te || e.oe || e.ee || e.X);
|
|
1722
1725
|
}
|
|
1723
1726
|
function internalDurationSign(e) {
|
|
1724
1727
|
return dateDurationSign(e.A) || wt(e.p);
|
|
1725
1728
|
}
|
|
1726
1729
|
function validateDuration(...e) {
|
|
1727
|
-
e.some((e) => e < 0) && e.some((e) => e > 0) && throwRangeError("invalid duration"), e.
|
|
1730
|
+
e.some((e) => e < 0) && e.some((e) => e > 0) && throwRangeError("invalid duration"), (e.some((e) => Math.abs(e) > 1e25) || [
|
|
1731
|
+
e[_],
|
|
1732
|
+
e[X],
|
|
1733
|
+
e[G]
|
|
1734
|
+
].some((e) => Math.abs(e) >= 2 ** 32)) && throwRangeError(de), validateTimeDurationRange(timeDurationFromComponents(24 * e[K] + e[Q], e[ee], e[te], e[oe], e[ne], e[re]));
|
|
1728
1735
|
}
|
|
1729
1736
|
function defaultTemporalLargestUnit(e) {
|
|
1730
1737
|
return (e.findIndex((e) => e) + 10) % 10;
|
|
@@ -1742,8 +1749,8 @@ function toTemporalPartialDurationRecord(e) {
|
|
|
1742
1749
|
6,
|
|
1743
1750
|
2,
|
|
1744
1751
|
0
|
|
1745
|
-
].map((t) => mapUnlessUndefined(e[
|
|
1746
|
-
return t.
|
|
1752
|
+
].map((t) => mapUnlessUndefined(e[ie[t]], toIntegerIfIntegral));
|
|
1753
|
+
return t.some((e) => void 0 !== e) || throwTypeError(ge), [
|
|
1747
1754
|
9,
|
|
1748
1755
|
5,
|
|
1749
1756
|
8,
|
|
@@ -1762,9 +1769,8 @@ function createTemporalDurationSlot(e) {
|
|
|
1762
1769
|
function createTemporalDuration(e, t = Object.create(vt.prototype)) {
|
|
1763
1770
|
return yt.set(t, e), t;
|
|
1764
1771
|
}
|
|
1765
|
-
function timeDurationFromComponents(e, t, o, n,
|
|
1766
|
-
return addTimeDuration(addTimeDuration(addTimeDuration(
|
|
1767
|
-
var l, d, m;
|
|
1772
|
+
function timeDurationFromComponents(e, t, o, n, r, a) {
|
|
1773
|
+
return addTimeDuration(addTimeDuration(addTimeDuration(createTimeDurationFromUnit(3600 * e + 60 * t + o, 1e9), createTimeDurationFromUnit(n, 1e6)), createTimeDurationFromUnit(r, 1e3)), createTimeDurationFromUnit(a, 1));
|
|
1768
1774
|
}
|
|
1769
1775
|
function add24HourDaysToTimeDuration(e, t) {
|
|
1770
1776
|
return validateTimeDurationRange(((e, t) => normalize(e[0] + t, e[1]))(e, t));
|
|
@@ -1773,11 +1779,11 @@ function timeDurationFromEpochNanosecondsDifference(e, t) {
|
|
|
1773
1779
|
return differenceEpochNanoseconds(t, e);
|
|
1774
1780
|
}
|
|
1775
1781
|
function roundTimeDurationToIncrement(e, t, o) {
|
|
1776
|
-
return validateTimeDurationRange(((e, t, o) => normalize(2 * divTrunc(e[0], 2), roundNumberToIncrement(e[1] + e[0] % 2 *
|
|
1782
|
+
return validateTimeDurationRange(((e, t, o) => normalize(2 * divTrunc(e[0], 2), roundNumberToIncrement(e[1] + e[0] % 2 * a, t, o)))(e, t, o));
|
|
1777
1783
|
}
|
|
1778
1784
|
function dateDurationDays(e, t) {
|
|
1779
1785
|
const o = adjustDateDurationRecord(e, 0);
|
|
1780
|
-
return dateDurationSign(e) ? e.
|
|
1786
|
+
return dateDurationSign(e) ? e.X + isoDateRecordToEpochDays(calendarDateAdd(t.Y, t.o, o, D)) - isoDateRecordToEpochDays(t.o) : e.X;
|
|
1781
1787
|
}
|
|
1782
1788
|
function roundTimeDuration(e, t, o, n) {
|
|
1783
1789
|
return roundTimeDurationToIncrement(e, nanosecondsForTimeUnit(o) * t, n);
|
|
@@ -1787,84 +1793,84 @@ function totalTimeDuration(e, t) {
|
|
|
1787
1793
|
}
|
|
1788
1794
|
function computeNudgeWindow(e, t, o, n, r, a, i, c, s) {
|
|
1789
1795
|
let l, d, m, u, T;
|
|
1790
|
-
if (c ===
|
|
1791
|
-
else if (c ===
|
|
1792
|
-
else if (c ===
|
|
1793
|
-
const o = calendarDateAdd(a, n.o, adjustDateDurationRecord(t.A, 0, 0),
|
|
1794
|
-
l = roundNumberToIncrement(t.A.
|
|
1795
|
-
} else l = roundNumberToIncrement(t.A.
|
|
1796
|
+
if (c === k) l = roundNumberToIncrement(t.A.te, i, E) + (s ? i * e : 0), d = l + i * e, m = createDateDurationRecord(l, 0, 0, 0), u = createDateDurationRecord(d, 0, 0, 0);
|
|
1797
|
+
else if (c === z) l = roundNumberToIncrement(t.A.oe, i, E) + (s ? i * e : 0), d = l + i * e, m = adjustDateDurationRecord(t.A, 0, 0, l), u = adjustDateDurationRecord(t.A, 0, 0, d);
|
|
1798
|
+
else if (c === V) {
|
|
1799
|
+
const o = calendarDateAdd(a, n.o, adjustDateDurationRecord(t.A, 0, 0), D);
|
|
1800
|
+
l = roundNumberToIncrement(t.A.ee + calendarDateUntil(a, o, addDaysToIsoDate(o, t.A.X), V).ee, i, E), d = l + i * e, m = adjustDateDurationRecord(t.A, 0, l), u = adjustDateDurationRecord(t.A, 0, d);
|
|
1801
|
+
} else l = roundNumberToIncrement(t.A.X, i, E), d = l + i * e, m = adjustDateDurationRecord(t.A, l), u = adjustDateDurationRecord(t.A, d);
|
|
1796
1802
|
if (dateDurationSign(m)) {
|
|
1797
|
-
const e = combineIsoDateAndTimeRecord(calendarDateAdd(a, n.o, m,
|
|
1798
|
-
T = r ? getEpochNanosecondsFor(r, e,
|
|
1803
|
+
const e = combineIsoDateAndTimeRecord(calendarDateAdd(a, n.o, m, D), n.p);
|
|
1804
|
+
T = r ? getEpochNanosecondsFor(r, e, p) : getUtcEpochNanoseconds(e);
|
|
1799
1805
|
} else T = o;
|
|
1800
|
-
const
|
|
1806
|
+
const h = combineIsoDateAndTimeRecord(calendarDateAdd(a, n.o, u, D), n.p);
|
|
1801
1807
|
return {
|
|
1802
1808
|
he: l,
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1809
|
+
pe: d,
|
|
1810
|
+
ge: T,
|
|
1811
|
+
fe: r ? getEpochNanosecondsFor(r, h, p) : getUtcEpochNanoseconds(h),
|
|
1812
|
+
Ie: m,
|
|
1813
|
+
Oe: u
|
|
1808
1814
|
};
|
|
1809
1815
|
}
|
|
1810
1816
|
function nudgeToCalendarUnit(e, t, o, n, r, a, i, c, s, l) {
|
|
1811
1817
|
let d = !1, m = computeNudgeWindow(e, t, o, r, a, i, c, s, !1);
|
|
1812
|
-
compareEpochNanoseconds(m.
|
|
1813
|
-
const u = differenceEpochNanoseconds(m.
|
|
1814
|
-
let D = m.
|
|
1815
|
-
return roundNumberToIncrement(m.he + ((e, t, o) => signTimeDuration(e) ? we(e, t) ? we(addTimeDuration(e, e), t) * o / 5 + .5 : 1 : 0)(u, T, e) * c * e, c, l) === m.
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
+
compareEpochNanoseconds(m.ge, n) * compareEpochNanoseconds(m.fe, n) > 0 && (m = computeNudgeWindow(e, t, o, r, a, i, c, s, !0), d = !0);
|
|
1819
|
+
const u = differenceEpochNanoseconds(m.ge, n), T = differenceEpochNanoseconds(m.ge, m.fe);
|
|
1820
|
+
let D = m.Ie, h = m.ge;
|
|
1821
|
+
return roundNumberToIncrement(m.he + ((e, t, o) => signTimeDuration(e) ? we(e, t) ? we(addTimeDuration(e, e), t) * o / 5 + .5 : 1 : 0)(u, T, e) * c * e, c, l) === m.pe && (d = !0, D = m.Oe, h = m.fe), {
|
|
1822
|
+
Fe: {
|
|
1823
|
+
ye: combineDateAndTimeDuration(D, ye),
|
|
1818
1824
|
Se: h,
|
|
1819
|
-
|
|
1825
|
+
we: d
|
|
1820
1826
|
},
|
|
1821
|
-
|
|
1827
|
+
$e: m.he + divideTimeDurationToFloatingPoint(u, 1e9) / divideTimeDurationToFloatingPoint(T, 1e9) * c * e
|
|
1822
1828
|
};
|
|
1823
1829
|
}
|
|
1824
1830
|
function roundRelativeDuration(e, t, o, n, r, a, i, c, s, l) {
|
|
1825
|
-
const d = internalDurationSign(e) || 1, m = isCalendarUnit(s) || r && s ===
|
|
1826
|
-
const s = calendarDateAdd(r, o.o, t.A,
|
|
1827
|
-
let
|
|
1828
|
-
const f = addTimeDuration(
|
|
1831
|
+
const d = internalDurationSign(e) || 1, m = isCalendarUnit(s) || r && s === x ? nudgeToCalendarUnit(d, e, t, o, n, r, a, c, s, l).Fe : r ? ((e, t, o, n, r, a, i, c) => {
|
|
1832
|
+
const s = calendarDateAdd(r, o.o, t.A, D), l = combineIsoDateAndTimeRecord(s, o.p), d = combineIsoDateAndTimeRecord(addDaysToIsoDate(s, e), o.p), m = getEpochNanosecondsFor(n, l, p), u = getEpochNanosecondsFor(n, d, p), T = timeDurationFromEpochNanosecondsDifference(u, m), h = nanosecondsForTimeUnit(i);
|
|
1833
|
+
let g = roundTimeDurationToIncrement(t.p, a * h, c);
|
|
1834
|
+
const f = addTimeDuration(g, negateTimeDuration(T));
|
|
1829
1835
|
let I, O = !1, F = 0;
|
|
1830
|
-
return wt(f) !== -e ? (O = !0, F = e,
|
|
1831
|
-
|
|
1836
|
+
return wt(f) !== -e ? (O = !0, F = e, g = roundTimeDurationToIncrement(f, a * h, c), I = addTimeDurationToEpochNanoseconds(u, g)) : I = addTimeDurationToEpochNanoseconds(u, g), {
|
|
1837
|
+
ye: combineDateAndTimeDuration(adjustDateDurationRecord(t.A, t.A.X + F), g),
|
|
1832
1838
|
Se: I,
|
|
1833
|
-
|
|
1839
|
+
we: O
|
|
1834
1840
|
};
|
|
1835
1841
|
})(d, e, n, r, a, c, s, l) : (function(e, t, o, n, r, a) {
|
|
1836
|
-
const i = add24HourDaysToTimeDuration(e.p, e.A.
|
|
1842
|
+
const i = add24HourDaysToTimeDuration(e.p, e.A.X), c = r === x ? roundTimeDurationByDays(i, n, a) : roundTimeDurationToIncrement(i, nanosecondsForTimeUnit(r) * n, a), s = c[0], [l, d] = isDateUnit(o) ? [s, addTimeDuration(c, timeDurationFromComponents(24 * -s, 0, 0, 0, 0, 0))] : [0, c];
|
|
1837
1843
|
return {
|
|
1838
|
-
|
|
1844
|
+
ye: combineDateAndTimeDuration(adjustDateDurationRecord(e.A, l), d),
|
|
1839
1845
|
Se: addTimeDurationToEpochNanoseconds(t, addTimeDuration(c, negateTimeDuration(i))),
|
|
1840
|
-
|
|
1846
|
+
we: sign(s - i[0]) === wt(i)
|
|
1841
1847
|
};
|
|
1842
1848
|
})(e, o, i, c, s, l);
|
|
1843
|
-
return m.
|
|
1849
|
+
return m.we && s !== V ? ((e, t, o, n, r, a, i, c) => {
|
|
1844
1850
|
if (c === i) return t;
|
|
1845
1851
|
const s = i;
|
|
1846
1852
|
let l;
|
|
1847
|
-
for (let i = c - 1; i >= s; i--) if (i !==
|
|
1848
|
-
l = i ===
|
|
1849
|
-
const c = combineIsoDateAndTimeRecord(calendarDateAdd(a, n.o, l,
|
|
1853
|
+
for (let i = c - 1; i >= s; i--) if (i !== G || s === G) {
|
|
1854
|
+
l = i === _ ? createDateDurationRecord(t.A.te + e, 0, 0, 0) : i === X ? adjustDateDurationRecord(t.A, 0, 0, t.A.oe + e) : adjustDateDurationRecord(t.A, 0, t.A.ee + e);
|
|
1855
|
+
const c = combineIsoDateAndTimeRecord(calendarDateAdd(a, n.o, l, D), n.p);
|
|
1850
1856
|
if (wt(differenceEpochNanoseconds(r ? getEpochNanosecondsFor(r, c, "compatible") : getUtcEpochNanoseconds(c), o)) === -e) break;
|
|
1851
|
-
t = combineDateAndTimeDuration(l,
|
|
1857
|
+
t = combineDateAndTimeDuration(l, ye);
|
|
1852
1858
|
}
|
|
1853
1859
|
return t;
|
|
1854
|
-
})(d, m.
|
|
1860
|
+
})(d, m.ye, m.Se, n, r, a, i, largerOfTwoTemporalUnits(s, x)) : m.ye;
|
|
1855
1861
|
}
|
|
1856
1862
|
function totalRelativeDuration(e, t, o, n, r, a, i) {
|
|
1857
|
-
return isCalendarUnit(i) || r && i ===
|
|
1863
|
+
return isCalendarUnit(i) || r && i === x ? nudgeToCalendarUnit(internalDurationSign(e) || 1, e, t, o, n, r, a, 1, i, E).$e : totalTimeDuration(add24HourDaysToTimeDuration(e.p, e.A.X), i);
|
|
1858
1864
|
}
|
|
1859
1865
|
function temporalDurationToString(e, t) {
|
|
1860
|
-
const o = durationSign(e), n = timeDurationFromComponents(0, 0, (e = applySignToDurationSlot(e, o))[
|
|
1866
|
+
const o = durationSign(e), n = timeDurationFromComponents(0, 0, (e = applySignToDurationSlot(e, o))[te], e[oe], e[ne], e[re]), [, , , r, a, i, c] = balanceTimeDuration(n, B), [s, l, d, m, u, T] = [
|
|
1861
1867
|
"Y",
|
|
1862
1868
|
"M",
|
|
1863
1869
|
"W",
|
|
1864
1870
|
"D",
|
|
1865
1871
|
"H",
|
|
1866
1872
|
"M"
|
|
1867
|
-
].map((t, o) => e[o] ? `${e[o]}${t}` : ""), D = `${u}${T}${wt(n) || defaultTemporalLargestUnit(e) >=
|
|
1873
|
+
].map((t, o) => e[o] ? `${e[o]}${t}` : ""), D = `${u}${T}${wt(n) || defaultTemporalLargestUnit(e) >= B || void 0 !== t ? `${toString(r)}${formatFractionalSeconds(1e6 * a + 1e3 * i + c, t)}S` : ""}`;
|
|
1868
1874
|
return `${o < 0 ? "-" : ""}P${s}${l}${d}${m}${D && `T${D}`}`;
|
|
1869
1875
|
}
|
|
1870
1876
|
function addDurations(e, t, o) {
|
|
@@ -1873,13 +1879,13 @@ function addDurations(e, t, o) {
|
|
|
1873
1879
|
}
|
|
1874
1880
|
function getInternalSlotOrThrowForDuration(e) {
|
|
1875
1881
|
const t = yt.get(e);
|
|
1876
|
-
return t || throwTypeError(
|
|
1882
|
+
return t || throwTypeError(Te), t;
|
|
1877
1883
|
}
|
|
1878
1884
|
function applySignToDurationSlot(e, t) {
|
|
1879
1885
|
return createTemporalDurationSlot(e.map((e) => e * t + 0));
|
|
1880
1886
|
}
|
|
1881
1887
|
function validateTimeDurationRange(e) {
|
|
1882
|
-
return ((e) => we(absTimeDuration(e),
|
|
1888
|
+
return ((e) => we(absTimeDuration(e), createTimeDurationFromUnit(2 ** 53, 1e9)) < 0)(e) || throwRangeError(de), e;
|
|
1883
1889
|
}
|
|
1884
1890
|
function balanceTimeDuration(e, t) {
|
|
1885
1891
|
const o = clamp(t, 3, 9);
|
|
@@ -1891,8 +1897,8 @@ function balanceTimeDuration(e, t) {
|
|
|
1891
1897
|
0,
|
|
1892
1898
|
0,
|
|
1893
1899
|
0
|
|
1894
|
-
].slice(0, o -
|
|
1895
|
-
o >
|
|
1900
|
+
].slice(0, o - K),
|
|
1901
|
+
o > te ? timeDurationToSubsecondsNumber(e, 18 - 3 * o) : divTrunc((r = e, r[0] * n + divTrunc(r[1], 1e9)), ce[o - K] / 1e9),
|
|
1896
1902
|
...[
|
|
1897
1903
|
0,
|
|
1898
1904
|
1,
|
|
@@ -1900,7 +1906,7 @@ function balanceTimeDuration(e, t) {
|
|
|
1900
1906
|
3,
|
|
1901
1907
|
4,
|
|
1902
1908
|
5
|
|
1903
|
-
].map((t) => divTrunc(e[1],
|
|
1909
|
+
].map((t) => divTrunc(e[1], ce[t + 1]) % (ce[t] / ce[t + 1]) + 0).slice(o - K)
|
|
1904
1910
|
];
|
|
1905
1911
|
var r;
|
|
1906
1912
|
}
|
|
@@ -1921,7 +1927,7 @@ function roundHalfEven(e) {
|
|
|
1921
1927
|
}
|
|
1922
1928
|
function isoDateToEpochDays(e, t, o) {
|
|
1923
1929
|
const n = balanceIsoYearMonth(e, t + 1);
|
|
1924
|
-
return Date.UTC(n.t % 400 - 400, n.u - 1, 0) / r + (divTrunc(n.t, 400) + 1) *
|
|
1930
|
+
return Date.UTC(n.t % 400 - 400, n.u - 1, 0) / r + (divTrunc(n.t, 400) + 1) * i + o;
|
|
1925
1931
|
}
|
|
1926
1932
|
function isoDateRecordToEpochDays(e) {
|
|
1927
1933
|
return isoDateToEpochDays(e.t, e.u - 1, e.T);
|
|
@@ -1930,34 +1936,34 @@ function mathematicalInLeapYear(e) {
|
|
|
1930
1936
|
return +!(e % (e % 25 ? 4 : 16));
|
|
1931
1937
|
}
|
|
1932
1938
|
function getTemporalOverflowOption(e) {
|
|
1933
|
-
return getOption(e, "overflow", [
|
|
1939
|
+
return getOption(e, "overflow", [D, h], D);
|
|
1934
1940
|
}
|
|
1935
1941
|
function getTemporalDisambiguationOption(e) {
|
|
1936
1942
|
return getOption(e, "disambiguation", [
|
|
1937
|
-
|
|
1943
|
+
p,
|
|
1938
1944
|
"earlier",
|
|
1939
|
-
|
|
1945
|
+
g,
|
|
1940
1946
|
"reject"
|
|
1941
|
-
],
|
|
1947
|
+
], p);
|
|
1942
1948
|
}
|
|
1943
1949
|
function negateRoundingMode(e) {
|
|
1944
|
-
return "ceil" === e ?
|
|
1950
|
+
return "ceil" === e ? w : "floor" === e ? y : "halfCeil" === e ? b : "halfFloor" === e ? M : e;
|
|
1945
1951
|
}
|
|
1946
1952
|
function getTemporalOffsetOption(e, t) {
|
|
1947
1953
|
return getOption(e, "offset", [
|
|
1948
|
-
|
|
1954
|
+
f,
|
|
1949
1955
|
"use",
|
|
1950
1956
|
"ignore",
|
|
1951
|
-
|
|
1957
|
+
I
|
|
1952
1958
|
], t);
|
|
1953
1959
|
}
|
|
1954
1960
|
function getTemporalShowCalendarNameOption(e) {
|
|
1955
1961
|
return getOption(e, "calendarName", [
|
|
1962
|
+
Z,
|
|
1956
1963
|
$,
|
|
1957
1964
|
C,
|
|
1958
|
-
Y
|
|
1959
|
-
|
|
1960
|
-
], $);
|
|
1965
|
+
Y
|
|
1966
|
+
], Z);
|
|
1961
1967
|
}
|
|
1962
1968
|
function validateTemporalRoundingIncrement(e, t, o) {
|
|
1963
1969
|
(e > (o ? t : t - 1) || t % e) && throwRangeError(invalidField("roundingIncrement"));
|
|
@@ -1971,37 +1977,37 @@ function getTemporalFractionalSecondDigitsOption(e) {
|
|
|
1971
1977
|
}
|
|
1972
1978
|
function toSecondsStringPrecisionRecord(e, t) {
|
|
1973
1979
|
return e ? {
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1980
|
+
Ee: e === q ? T : 3 * (e - 6),
|
|
1981
|
+
ve: e,
|
|
1982
|
+
Me: 1
|
|
1977
1983
|
} : {
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1984
|
+
Ee: t,
|
|
1985
|
+
ve: divFloor((t ?? 9) - 1, 3) + 7,
|
|
1986
|
+
Me: 10 ** ((9 - (t ?? 9)) % 3)
|
|
1981
1987
|
};
|
|
1982
1988
|
}
|
|
1983
1989
|
function getTemporalUnitValuedOption(e, t, o) {
|
|
1984
1990
|
return mapUnlessUndefined(getOption(e, t, [
|
|
1991
|
+
...ae,
|
|
1985
1992
|
...ie,
|
|
1986
|
-
...ce,
|
|
1987
1993
|
"auto"
|
|
1988
1994
|
], o), (e) => {
|
|
1989
|
-
return "auto" === e ? "auto" : (t = e.replace(/s$/, ""),
|
|
1995
|
+
return "auto" === e ? "auto" : (t = e.replace(/s$/, ""), ae.indexOf(t));
|
|
1990
1996
|
var t;
|
|
1991
1997
|
});
|
|
1992
1998
|
}
|
|
1993
1999
|
function validateTemporalUnitValue(e, t, o = []) {
|
|
1994
|
-
void 0 === e || o.includes(e) || ("auto" === e && throwRangeError(disallowedUnit(e)), (e <=
|
|
2000
|
+
void 0 === e || o.includes(e) || ("auto" === e && throwRangeError(disallowedUnit(e)), (e <= x && t === s || e > x && t === c) && throwRangeError(disallowedUnit(e)));
|
|
1995
2001
|
}
|
|
1996
2002
|
function getTemporalRelativeToOption(e) {
|
|
1997
2003
|
const t = e.relativeTo;
|
|
1998
2004
|
if (void 0 === t) return createNullPrototypeObject();
|
|
1999
|
-
let o, n, r, a, i, c = !0, s =
|
|
2005
|
+
let o, n, r, a, i, c = !0, s = O;
|
|
2000
2006
|
if (isObject(t)) {
|
|
2001
|
-
if (isZonedDateTime(t)) return createNullPrototypeObject({
|
|
2002
|
-
if (isPlainDate(t)) return createNullPrototypeObject({
|
|
2007
|
+
if (isZonedDateTime(t)) return createNullPrototypeObject({ be: getInternalSlotOrThrowForZonedDateTime(t) });
|
|
2008
|
+
if (isPlainDate(t)) return createNullPrototypeObject({ Pe: getInternalSlotOrThrowForPlainDate(t) });
|
|
2003
2009
|
const e = getInternalSlotForPlainDateTime(t);
|
|
2004
|
-
if (e) return createNullPrototypeObject({
|
|
2010
|
+
if (e) return createNullPrototypeObject({ Pe: getInternalSlotOrThrowForPlainDate(createTemporalDate(e.K.o, e.Y)) });
|
|
2005
2011
|
r = getTemporalCalendarIdentifierWithIsoDefault(t);
|
|
2006
2012
|
const c = prepareCalendarFields(r, t, [
|
|
2007
2013
|
Ot.t,
|
|
@@ -2016,23 +2022,23 @@ function getTemporalRelativeToOption(e) {
|
|
|
2016
2022
|
Ot.$,
|
|
2017
2023
|
Ot.M,
|
|
2018
2024
|
Ot.P
|
|
2019
|
-
], []), l = interpretTemporalDateTimeFields(r, c,
|
|
2020
|
-
a = l.o, i = l.p, o = c.timeZone, n = c.offset, s = n ?
|
|
2025
|
+
], []), l = interpretTemporalDateTimeFields(r, c, D);
|
|
2026
|
+
a = l.o, i = l.p, o = c.timeZone, n = c.offset, s = n ? O : S;
|
|
2021
2027
|
} else {
|
|
2022
2028
|
validateString(t);
|
|
2023
|
-
const e = parseIsoDateTime(t, [Ge,
|
|
2024
|
-
n = e.P.N, e.P.R ? (o = toTemporalTimeZoneIdentifier(e.P.R), s = e.P.Z ?
|
|
2029
|
+
const e = parseIsoDateTime(t, [Ge, Ke]);
|
|
2030
|
+
n = e.P.N, e.P.R ? (o = toTemporalTimeZoneIdentifier(e.P.R), s = e.P.Z ? F : n ? O : S, c = void 0 !== n && hasUtcOffsetSubMinuteParts(n)) : o = void 0, r = canonicalizeCalendar(e.Y || "iso8601"), a = createIsoDateRecord(e.t, e.u, e.T), i = e.p;
|
|
2025
2031
|
}
|
|
2026
|
-
return createNullPrototypeObject(o ? {
|
|
2032
|
+
return createNullPrototypeObject(o ? { be: getInternalSlotOrThrowForZonedDateTime(createTemporalZonedDateTime(interpretISODateTimeOffset(a, i, s, s === O ? parseDateTimeUtcOffset(n) : 0, o, p, I, c), o, r)) } : { Pe: getInternalSlotOrThrowForPlainDate(createTemporalDate(a, r)) });
|
|
2027
2033
|
}
|
|
2028
2034
|
function largerOfTwoTemporalUnits(e, t) {
|
|
2029
2035
|
return e < t ? e : t;
|
|
2030
2036
|
}
|
|
2031
2037
|
function isCalendarUnit(e) {
|
|
2032
|
-
return e <
|
|
2038
|
+
return e < x;
|
|
2033
2039
|
}
|
|
2034
2040
|
function isDateUnit(e) {
|
|
2035
|
-
return e <=
|
|
2041
|
+
return e <= x;
|
|
2036
2042
|
}
|
|
2037
2043
|
function maximumTemporalDurationRoundingIncrement(e) {
|
|
2038
2044
|
return [
|
|
@@ -2049,13 +2055,14 @@ function formatFractionalSeconds(e, t) {
|
|
|
2049
2055
|
return void 0 === t ? e ? `.${o.replace(/0*$/, "")}` : "" : t ? `.${o.slice(0, t)}` : "";
|
|
2050
2056
|
}
|
|
2051
2057
|
function formatTimeString(e, t, o, n, r) {
|
|
2052
|
-
return `${toZeroPaddedDecimalString(e, 2)}:${toZeroPaddedDecimalString(t, 2)}${r ===
|
|
2058
|
+
return `${toZeroPaddedDecimalString(e, 2)}:${toZeroPaddedDecimalString(t, 2)}${r === T ? "" : `:${toZeroPaddedDecimalString(o, 2)}${formatFractionalSeconds(n, r)}`}`;
|
|
2053
2059
|
}
|
|
2054
2060
|
function roundNumberToIncrement(e, t, o) {
|
|
2055
2061
|
return Et[o](e / t) * t;
|
|
2056
2062
|
}
|
|
2057
2063
|
function getRoundingModeOption(e, t) {
|
|
2058
2064
|
return getOption(e, "roundingMode", [
|
|
2065
|
+
y,
|
|
2059
2066
|
w,
|
|
2060
2067
|
v,
|
|
2061
2068
|
E,
|
|
@@ -2063,26 +2070,25 @@ function getRoundingModeOption(e, t) {
|
|
|
2063
2070
|
b,
|
|
2064
2071
|
P,
|
|
2065
2072
|
R,
|
|
2066
|
-
N
|
|
2067
|
-
Z
|
|
2073
|
+
N
|
|
2068
2074
|
], t);
|
|
2069
2075
|
}
|
|
2070
2076
|
function getRoundingIncrementOption(e) {
|
|
2071
2077
|
const t = "roundingIncrement", o = mapUnlessUndefined(e[t], toIntegerWithTruncation) ?? 1;
|
|
2072
|
-
return (o
|
|
2078
|
+
return isWithin(o, 1, 1e9) || throwRangeError(invalidField(t)), o;
|
|
2073
2079
|
}
|
|
2074
2080
|
function isoDateToFields(e, t, o) {
|
|
2075
2081
|
const n = calendarIsoToDate(e, t);
|
|
2076
2082
|
return createNullPrototypeObject({
|
|
2077
|
-
[Ot.t]: o ===
|
|
2083
|
+
[Ot.t]: o === m ? void 0 : n.t,
|
|
2078
2084
|
[Ot.v]: n.v,
|
|
2079
|
-
[Ot.T]: o ===
|
|
2085
|
+
[Ot.T]: o === d ? void 0 : n.T
|
|
2080
2086
|
});
|
|
2081
2087
|
}
|
|
2082
2088
|
function getDifferenceSettings(e, t, o, n, r, a) {
|
|
2083
2089
|
let i = getTemporalUnitValuedOption(t, "largestUnit", void 0) ?? "auto";
|
|
2084
|
-
const c = getRoundingIncrementOption(t), s = getRoundingModeOption(t,
|
|
2085
|
-
return validateTemporalUnitValue(i, o, ["auto"]), n.includes(i) && throwRangeError(disallowedUnit(i)), validateTemporalUnitValue(l, o), n.includes(l) && throwRangeError(disallowedUnit(l)), "auto" === i && (i = largerOfTwoTemporalUnits(a, l)), i > l && throwRangeError(
|
|
2090
|
+
const c = getRoundingIncrementOption(t), s = getRoundingModeOption(t, E), l = getTemporalUnitValuedOption(t, "smallestUnit", void 0) ?? r;
|
|
2091
|
+
return validateTemporalUnitValue(i, o, ["auto"]), n.includes(i) && throwRangeError(disallowedUnit(i)), validateTemporalUnitValue(l, o), n.includes(l) && throwRangeError(disallowedUnit(l)), "auto" === i && (i = largerOfTwoTemporalUnits(a, l)), i > l && throwRangeError(De), isDateUnit(l) || validateTemporalRoundingIncrement(c, maximumTemporalDurationRoundingIncrement(l), !1), {
|
|
2086
2092
|
H: l,
|
|
2087
2093
|
L: i,
|
|
2088
2094
|
q: -1 === e ? negateRoundingMode(s) : s,
|
|
@@ -2093,16 +2099,16 @@ function getUtcEpochNanoseconds(e) {
|
|
|
2093
2099
|
return addNanosecondsToEpochSeconds(createEpochNanosecondsFromEpochMilliseconds(utcEpochMilliseconds(e.o.t, e.o.u, e.o.T, e.p.D, e.p.I, e.p.O, e.p.F)), 1e3 * e.p.S + e.p.$);
|
|
2094
2100
|
}
|
|
2095
2101
|
function epochDaysToIsoDate(e) {
|
|
2096
|
-
const t = new Date(modFloor(e,
|
|
2102
|
+
const t = new Date(modFloor(e, i) * r);
|
|
2097
2103
|
return {
|
|
2098
|
-
t: t.getUTCFullYear() + 400 * divFloor(e,
|
|
2104
|
+
t: t.getUTCFullYear() + 400 * divFloor(e, i),
|
|
2099
2105
|
u: t.getUTCMonth() + 1,
|
|
2100
2106
|
T: t.getUTCDate()
|
|
2101
2107
|
};
|
|
2102
2108
|
}
|
|
2103
2109
|
function isoDateTimeToFields(e, t) {
|
|
2104
2110
|
return createNullPrototypeObject({
|
|
2105
|
-
...isoDateToFields(e, t.o,
|
|
2111
|
+
...isoDateToFields(e, t.o, c),
|
|
2106
2112
|
[Ot.D]: t.p.D,
|
|
2107
2113
|
[Ot.I]: t.p.I,
|
|
2108
2114
|
[Ot.O]: t.p.O,
|
|
@@ -2113,7 +2119,7 @@ function isoDateTimeToFields(e, t) {
|
|
|
2113
2119
|
}
|
|
2114
2120
|
function getInternalSlotOrThrowForDateTimeFormat(e) {
|
|
2115
2121
|
const t = Pt.get(e);
|
|
2116
|
-
return t || throwTypeError(
|
|
2122
|
+
return t || throwTypeError(Te), t;
|
|
2117
2123
|
}
|
|
2118
2124
|
function formatDateTime(e, t) {
|
|
2119
2125
|
const [o, n] = handleDateTimeValue(getInternalSlotOrThrowForDateTimeFormat(e), t);
|
|
@@ -2127,11 +2133,11 @@ function dateStyleToMonthStyle(e) {
|
|
|
2127
2133
|
}
|
|
2128
2134
|
function amendOptionsForPlainDate(e) {
|
|
2129
2135
|
const t = createNullPrototypeObject(e);
|
|
2130
|
-
return hasAnyOptions(e, Rt) || (hasAnyOptions(e, Nt) && throwTypeError(
|
|
2136
|
+
return hasAnyOptions(e, Rt) || (hasAnyOptions(e, Nt) && throwTypeError(me), t.year = t.month = t.day = "numeric"), removeDateTimeFormatOptions(t, [...Nt, "timeZoneName"]), t.timeZone = "UTC", t;
|
|
2131
2137
|
}
|
|
2132
2138
|
function amendOptionsForPlainTime(e) {
|
|
2133
2139
|
const t = createNullPrototypeObject(e);
|
|
2134
|
-
return hasAnyOptions(e, Nt) || (hasAnyOptions(e, Rt) && throwTypeError(
|
|
2140
|
+
return hasAnyOptions(e, Nt) || (hasAnyOptions(e, Rt) && throwTypeError(me), t.hour = t.minute = t.second = "numeric"), "long" !== e.timeStyle && "full" !== e.timeStyle || (removeDateTimeFormatOptions(t, ["timeStyle"]), t.hour = t.minute = t.second = "numeric"), removeDateTimeFormatOptions(t, [
|
|
2135
2141
|
...Rt,
|
|
2136
2142
|
"era",
|
|
2137
2143
|
"timeZoneName"
|
|
@@ -2147,7 +2153,7 @@ function amendOptionsForPlainYearMonth(e) {
|
|
|
2147
2153
|
"year",
|
|
2148
2154
|
"month",
|
|
2149
2155
|
"dateStyle"
|
|
2150
|
-
]) || (hasAnyOptions(e, [...Rt, ...Nt]) && throwTypeError(
|
|
2156
|
+
]) || (hasAnyOptions(e, [...Rt, ...Nt]) && throwTypeError(me), t.year = t.month = "numeric"), removeDateTimeFormatOptions(t, [
|
|
2151
2157
|
...Nt,
|
|
2152
2158
|
"day",
|
|
2153
2159
|
"weekday",
|
|
@@ -2160,7 +2166,7 @@ function amendOptionsForPlainMonthDay(e) {
|
|
|
2160
2166
|
"month",
|
|
2161
2167
|
"day",
|
|
2162
2168
|
"dateStyle"
|
|
2163
|
-
]) || (hasAnyOptions(e, [...Rt, ...Nt]) && throwTypeError(
|
|
2169
|
+
]) || (hasAnyOptions(e, [...Rt, ...Nt]) && throwTypeError(me), t.month = t.day = "numeric"), removeDateTimeFormatOptions(t, [
|
|
2164
2170
|
...Nt,
|
|
2165
2171
|
"era",
|
|
2166
2172
|
"year",
|
|
@@ -2176,20 +2182,20 @@ function hasAnyOptions(e, t) {
|
|
|
2176
2182
|
return t.some((t) => void 0 !== e[t]);
|
|
2177
2183
|
}
|
|
2178
2184
|
function createDateTimeFormat(e, t = createNullPrototypeObject(), o, n, r = Object.create($t.prototype)) {
|
|
2179
|
-
null === t && throwTypeError(
|
|
2185
|
+
null === t && throwTypeError(me);
|
|
2180
2186
|
const a = createNullPrototypeObject();
|
|
2181
2187
|
let i = new bt(e, new Proxy({}, { get(e, o) {
|
|
2182
2188
|
const r = t[o];
|
|
2183
|
-
return "timeZone" === o && void 0 !== n ? (void 0 !== r && throwTypeError("disallowed field: timeZone"), a[o] = n) : void 0 === r ? r : a[o] = "hour12" === o ? ((e) => !!e)(r) : "fractionalSecondDigits" === o ?
|
|
2189
|
+
return "timeZone" === o && void 0 !== n ? (void 0 !== r && throwTypeError("disallowed field: timeZone"), a[o] = n) : void 0 === r ? r : a[o] = "hour12" === o ? ((e) => !!e)(r) : "fractionalSecondDigits" === o ? Oe(r) : toString(r);
|
|
2184
2190
|
} }));
|
|
2185
|
-
return (o ===
|
|
2191
|
+
return (o === c && a.timeStyle || o === s && a.dateStyle) && throwTypeError(me), a.calendar = i.resolvedOptions().calendar, void 0 === n || hasAnyOptions(a, [
|
|
2186
2192
|
...Rt,
|
|
2187
2193
|
...Nt,
|
|
2188
2194
|
"timeZoneName"
|
|
2189
2195
|
]) || (a.timeZoneName = "short", i = new bt(i.resolvedOptions().locale, a)), Pt.set(r, createNullPrototypeObject({
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
|
|
2196
|
+
Re: i,
|
|
2197
|
+
Ne: a,
|
|
2198
|
+
Ze: i.resolvedOptions().locale
|
|
2193
2199
|
})), r;
|
|
2194
2200
|
}
|
|
2195
2201
|
function validateSameTemporalType(e, t) {
|
|
@@ -2204,11 +2210,11 @@ function validateSameTemporalType(e, t) {
|
|
|
2204
2210
|
].some((o) => o(e) !== o(t)) && throwTypeError("Temporal type mismatch");
|
|
2205
2211
|
}
|
|
2206
2212
|
function toDateTimeFormattable(e) {
|
|
2207
|
-
return ((e) => isObject(e) && (isPlainDate(e) || isPlainTime(e) || isPlainDateTime(e) || isZonedDateTime(e) || isPlainYearMonth(e) || isPlainMonthDay(e) || isInstant(e)))(e) ? e :
|
|
2213
|
+
return ((e) => isObject(e) && (isPlainDate(e) || isPlainTime(e) || isPlainDateTime(e) || isZonedDateTime(e) || isPlainYearMonth(e) || isPlainMonthDay(e) || isInstant(e)))(e) ? e : Oe(e);
|
|
2208
2214
|
}
|
|
2209
2215
|
function handleDateTimeValue(e, t) {
|
|
2210
2216
|
const o = getInternalSlotForPlainDate(t), n = getInternalSlotForPlainDateTime(t), r = getInternalSlotForPlainYearMonth(t), a = getInternalSlotForPlainMonthDay(t);
|
|
2211
|
-
return isPlainTime(t) ? [e.
|
|
2217
|
+
return isPlainTime(t) ? [e.Ye ||= new bt(e.Ze, amendOptionsForPlainTime(e.Ne)), epochMilliseconds(getUtcEpochNanoseconds(combineIsoDateAndTimeRecord(createIsoDateRecord(1970, 1, 1), getInternalSlotOrThrowForPlainTime(t))))] : o ? (o.Y !== e.Ne.calendar && "iso8601" !== o.Y && throwRangeError(ue), [e.Ce ||= new bt(e.Ze, amendOptionsForPlainDate(e.Ne)), epochMilliseconds(getUtcEpochNanoseconds(combineIsoDateAndTimeRecord(o.o, midnightTimeRecord())))]) : n ? (n.Y !== e.Ne.calendar && "iso8601" !== n.Y && throwRangeError(ue), [e.Ue ||= new bt(e.Ze, amendOptionsForPlainDateTime(e.Ne)), epochMilliseconds(getUtcEpochNanoseconds(n.K))]) : r ? (r.Y !== e.Ne.calendar && throwRangeError(ue), [e.je ||= new bt(e.Ze, amendOptionsForPlainYearMonth(e.Ne)), epochMilliseconds(getUtcEpochNanoseconds(combineIsoDateAndTimeRecord(r.o, midnightTimeRecord())))]) : a ? (a.Y !== e.Ne.calendar && throwRangeError(ue), [e.We ||= new bt(e.Ze, amendOptionsForPlainMonthDay(e.Ne)), epochMilliseconds(getUtcEpochNanoseconds(combineIsoDateAndTimeRecord(a.o, midnightTimeRecord())))]) : isInstant(t) ? [e.Ae ||= new bt(e.Ze, amendOptionsForInstant(e.Ne)), epochMilliseconds(getInternalSlotOrThrowForInstant(t).U)] : (isZonedDateTime(t) && throwTypeError(pe), [e.Re, t]);
|
|
2212
2218
|
}
|
|
2213
2219
|
function DateTimeFormat(e, t) {
|
|
2214
2220
|
return new $t(e, t);
|
|
@@ -2239,10 +2245,10 @@ function roundTemporalInstant(e, t, o, n) {
|
|
|
2239
2245
|
}
|
|
2240
2246
|
function temporalInstantToString(e, t, o) {
|
|
2241
2247
|
const n = getOffsetNanosecondsFor(t || "UTC", e);
|
|
2242
|
-
return `${isoDateTimeToString(getIsoDateTimeFromOffsetNanoseconds(e, n), "iso8601", o,
|
|
2248
|
+
return `${isoDateTimeToString(getIsoDateTimeFromOffsetNanoseconds(e, n), "iso8601", o, C)}${t ? formatDateTimeUtcOffsetRounded(n) : "Z"}`;
|
|
2243
2249
|
}
|
|
2244
2250
|
function differenceTemporalInstant(e, t, o, n) {
|
|
2245
|
-
const r = getInternalSlotOrThrowForInstant(toTemporalInstant$1(o)), a = getDifferenceSettings(e, getOptionsObject(n),
|
|
2251
|
+
const r = getInternalSlotOrThrowForInstant(toTemporalInstant$1(o)), a = getDifferenceSettings(e, getOptionsObject(n), s, [], J, B);
|
|
2246
2252
|
return createTemporalDuration(applySignToDurationSlot(temporalDurationFromInternal(differenceInstant(t.U, r.U, a.V, a.H, a.q), a.L), e));
|
|
2247
2253
|
}
|
|
2248
2254
|
function addDurationToInstant(e, t, o) {
|
|
@@ -2250,20 +2256,20 @@ function addDurationToInstant(e, t, o) {
|
|
|
2250
2256
|
return isDateUnit(defaultTemporalLargestUnit(n)) && throwRangeError(durationWithDateUnit(defaultTemporalLargestUnit(n))), createTemporalInstant(addInstant(t.U, toInternalDurationRecordWith24HourDays(n).p));
|
|
2251
2257
|
}
|
|
2252
2258
|
function validateEpochNanoseconds(e) {
|
|
2253
|
-
return ((e) => compareEpochNanoseconds(
|
|
2259
|
+
return ((e) => compareEpochNanoseconds(Fe, e) * compareEpochNanoseconds(Se, e) <= 0)(e) || throwRangeError(le), e;
|
|
2254
2260
|
}
|
|
2255
2261
|
function getInternalSlotForInstant(e) {
|
|
2256
2262
|
return Ut.get(e);
|
|
2257
2263
|
}
|
|
2258
2264
|
function getInternalSlotOrThrowForInstant(e) {
|
|
2259
2265
|
const t = getInternalSlotForInstant(e);
|
|
2260
|
-
return t || throwTypeError(
|
|
2266
|
+
return t || throwTypeError(Te), t;
|
|
2261
2267
|
}
|
|
2262
2268
|
function isInstant(e) {
|
|
2263
2269
|
return Ut.has(e);
|
|
2264
2270
|
}
|
|
2265
2271
|
function clampEpochNanoseconds(e) {
|
|
2266
|
-
return compareEpochNanoseconds(e,
|
|
2272
|
+
return compareEpochNanoseconds(e, Se) > 0 ? Se : compareEpochNanoseconds(e, Fe) < 0 ? Fe : e;
|
|
2267
2273
|
}
|
|
2268
2274
|
function systemTimeZoneIdentifier() {
|
|
2269
2275
|
return zt && Vt + zt > Date.now() && kt ? kt : (Vt = Date.now(), kt = new bt().resolvedOptions().timeZone);
|
|
@@ -2277,7 +2283,7 @@ function systemUtcEpochNanoseconds() {
|
|
|
2277
2283
|
function systemDateTime(e = systemTimeZoneIdentifier()) {
|
|
2278
2284
|
return getIsoDateTimeForZonedDateTimeSlot(createZonedDateTimeSlot(systemUtcEpochNanoseconds(), toTemporalTimeZoneIdentifier(e), "iso8601"));
|
|
2279
2285
|
}
|
|
2280
|
-
const e = 1e6, t = 6e10, o = 36e11, n = 86400, r = 864e5, a =
|
|
2286
|
+
const e = 1e6, t = 6e10, o = 36e11, n = 86400, r = 864e5, a = 864e11, i = 146097, c = Symbol(), s = Symbol(), l = Symbol(), d = Symbol(), m = Symbol(), u = Symbol(), T = Symbol(), D = "constrain", h = "reject", p = "compatible", g = "later", f = "prefer", I = "reject", O = Symbol(), F = Symbol(), S = Symbol(), y = "ceil", w = "floor", v = "expand", E = "trunc", M = "halfCeil", b = "halfFloor", P = "halfExpand", R = "halfTrunc", N = "halfEven", Z = "auto", $ = "always", C = "never", Y = "critical", U = "auto", j = "never", W = "auto", A = "never", L = "critical", k = 0, z = 1, V = 2, x = 3, H = 4, q = 5, B = 6, J = 9, _ = 0, X = 1, G = 2, K = 3, Q = 4, ee = 5, te = 6, oe = 7, ne = 8, re = 9, ae = [
|
|
2281
2287
|
"year",
|
|
2282
2288
|
"month",
|
|
2283
2289
|
"week",
|
|
@@ -2288,20 +2294,20 @@ const e = 1e6, t = 6e10, o = 36e11, n = 86400, r = 864e5, a = 864e8, i = 864e11,
|
|
|
2288
2294
|
"millisecond",
|
|
2289
2295
|
"microsecond",
|
|
2290
2296
|
"nanosecond"
|
|
2291
|
-
],
|
|
2292
|
-
|
|
2297
|
+
], ie = ae.map((e) => `${e}s`), ce = [
|
|
2298
|
+
a,
|
|
2293
2299
|
o,
|
|
2294
2300
|
t,
|
|
2295
2301
|
1e9,
|
|
2296
2302
|
1e6,
|
|
2297
2303
|
1e3,
|
|
2298
2304
|
1
|
|
2299
|
-
], missingField = (e) => `missing field: ${e}`, invalidField = (e) => `invalid field: ${e}`, parseError = (e) => `parse error: ${e}`,
|
|
2305
|
+
], missingField = (e) => `missing field: ${e}`, invalidField = (e) => `invalid field: ${e}`, parseError = (e) => `parse error: ${e}`, se = "invalid date / time", le = "out-of-bounds date", de = "out-of-bounds duration", me = "invalid formatting options", ue = "calendar mismatch", disallowedUnit = (e) => `disallowed unit: ${"auto" === e ? e : getNameFromUnit(e)}`, invalidNumber = (e) => `invalid number: ${e}`, invalidTimeZone = (e) => `invalid time zone: ${e}`, Te = "invalid method call", invalidMonthCode = (e) => `invalid month code:${e}`, durationWithDateUnit = (e) => `duration has a date unit: ${getNameFromUnit(e)}`, De = "invalid `largestUnit` and `smallestUnit` options", he = "mismatch of `month` and `monthCode`", pe = "value is not formattable", notObject = (e) => `not object: ${e}`, ge = "empty fields", fe = "can't convert Temporal classes to number", Ie = "argument is undefined", Oe = Math.max, Fe = createEpochNanosecondsFromEpochMilliseconds(-864e13), Se = createEpochNanosecondsFromEpochMilliseconds(864e13), ye = [0, 0], we = compareEpochNanoseconds, ve = /* @__PURE__ */ new WeakMap();
|
|
2300
2306
|
var Ee = class {
|
|
2301
2307
|
constructor(e, t, o = "iso8601") {
|
|
2302
2308
|
const n = validateEpochNanoseconds(createEpochNanosecondsFromBigInt(toBigInt(e)));
|
|
2303
2309
|
validateString(t);
|
|
2304
|
-
const r = parseTimeZoneIdentifier(t), a = r.
|
|
2310
|
+
const r = parseTimeZoneIdentifier(t), a = r._ ? getAvailableNamedTimeZoneIdentifier(r._) : formatOffsetTimeZoneIdentifier(r.G);
|
|
2305
2311
|
validateString(o), createTemporalZonedDateTime(n, a, canonicalizeCalendar(o), this);
|
|
2306
2312
|
}
|
|
2307
2313
|
static from(e, t = void 0) {
|
|
@@ -2317,10 +2323,10 @@ var Ee = class {
|
|
|
2317
2323
|
return getInternalSlotOrThrowForZonedDateTime(this).P;
|
|
2318
2324
|
}
|
|
2319
2325
|
get era() {
|
|
2320
|
-
return calendarIsoToDateForZonedDateTimeSlot(getInternalSlotOrThrowForZonedDateTime(this)).
|
|
2326
|
+
return calendarIsoToDateForZonedDateTimeSlot(getInternalSlotOrThrowForZonedDateTime(this)).ne;
|
|
2321
2327
|
}
|
|
2322
2328
|
get eraYear() {
|
|
2323
|
-
return calendarIsoToDateForZonedDateTimeSlot(getInternalSlotOrThrowForZonedDateTime(this)).
|
|
2329
|
+
return calendarIsoToDateForZonedDateTimeSlot(getInternalSlotOrThrowForZonedDateTime(this)).re;
|
|
2324
2330
|
}
|
|
2325
2331
|
get year() {
|
|
2326
2332
|
return calendarIsoToDateForZonedDateTimeSlot(getInternalSlotOrThrowForZonedDateTime(this)).t;
|
|
@@ -2359,35 +2365,35 @@ var Ee = class {
|
|
|
2359
2365
|
return convertEpochNanosecondsToBigInt(getInternalSlotOrThrowForZonedDateTime(this).U);
|
|
2360
2366
|
}
|
|
2361
2367
|
get dayOfWeek() {
|
|
2362
|
-
return calendarIsoToDateForZonedDateTimeSlot(getInternalSlotOrThrowForZonedDateTime(this)).
|
|
2368
|
+
return calendarIsoToDateForZonedDateTimeSlot(getInternalSlotOrThrowForZonedDateTime(this)).ae;
|
|
2363
2369
|
}
|
|
2364
2370
|
get dayOfYear() {
|
|
2365
|
-
return calendarIsoToDateForZonedDateTimeSlot(getInternalSlotOrThrowForZonedDateTime(this)).
|
|
2371
|
+
return calendarIsoToDateForZonedDateTimeSlot(getInternalSlotOrThrowForZonedDateTime(this)).ie;
|
|
2366
2372
|
}
|
|
2367
2373
|
get weekOfYear() {
|
|
2368
|
-
return calendarIsoToDateForZonedDateTimeSlot(getInternalSlotOrThrowForZonedDateTime(this)).
|
|
2374
|
+
return calendarIsoToDateForZonedDateTimeSlot(getInternalSlotOrThrowForZonedDateTime(this)).ce.se;
|
|
2369
2375
|
}
|
|
2370
2376
|
get yearOfWeek() {
|
|
2371
|
-
return calendarIsoToDateForZonedDateTimeSlot(getInternalSlotOrThrowForZonedDateTime(this)).
|
|
2377
|
+
return calendarIsoToDateForZonedDateTimeSlot(getInternalSlotOrThrowForZonedDateTime(this)).ce.t;
|
|
2372
2378
|
}
|
|
2373
2379
|
get hoursInDay() {
|
|
2374
2380
|
const e = getInternalSlotOrThrowForZonedDateTime(this), t = getIsoDateTimeForZonedDateTimeSlot(e).o;
|
|
2375
2381
|
return timeDurationToSubsecondsNumber(differenceEpochNanoseconds(getStartOfDay(e.P, t), getStartOfDay(e.P, addDaysToIsoDate(t, 1))), -9) / o;
|
|
2376
2382
|
}
|
|
2377
2383
|
get daysInWeek() {
|
|
2378
|
-
return calendarIsoToDateForZonedDateTimeSlot(getInternalSlotOrThrowForZonedDateTime(this)).
|
|
2384
|
+
return calendarIsoToDateForZonedDateTimeSlot(getInternalSlotOrThrowForZonedDateTime(this)).le;
|
|
2379
2385
|
}
|
|
2380
2386
|
get daysInMonth() {
|
|
2381
|
-
return calendarIsoToDateForZonedDateTimeSlot(getInternalSlotOrThrowForZonedDateTime(this)).
|
|
2387
|
+
return calendarIsoToDateForZonedDateTimeSlot(getInternalSlotOrThrowForZonedDateTime(this)).de;
|
|
2382
2388
|
}
|
|
2383
2389
|
get daysInYear() {
|
|
2384
|
-
return calendarIsoToDateForZonedDateTimeSlot(getInternalSlotOrThrowForZonedDateTime(this)).
|
|
2390
|
+
return calendarIsoToDateForZonedDateTimeSlot(getInternalSlotOrThrowForZonedDateTime(this)).me;
|
|
2385
2391
|
}
|
|
2386
2392
|
get monthsInYear() {
|
|
2387
|
-
return calendarIsoToDateForZonedDateTimeSlot(getInternalSlotOrThrowForZonedDateTime(this)).
|
|
2393
|
+
return calendarIsoToDateForZonedDateTimeSlot(getInternalSlotOrThrowForZonedDateTime(this)).ue;
|
|
2388
2394
|
}
|
|
2389
2395
|
get inLeapYear() {
|
|
2390
|
-
return calendarIsoToDateForZonedDateTimeSlot(getInternalSlotOrThrowForZonedDateTime(this)).
|
|
2396
|
+
return calendarIsoToDateForZonedDateTimeSlot(getInternalSlotOrThrowForZonedDateTime(this)).Te;
|
|
2391
2397
|
}
|
|
2392
2398
|
get offsetNanoseconds() {
|
|
2393
2399
|
return getOffsetNanosecondsForZonedDateTimeSlot(getInternalSlotOrThrowForZonedDateTime(this));
|
|
@@ -2413,12 +2419,12 @@ var Ee = class {
|
|
|
2413
2419
|
Ot.S,
|
|
2414
2420
|
Ot.$,
|
|
2415
2421
|
Ot.M
|
|
2416
|
-
])), i = getOptionsObject(t), c = getTemporalDisambiguationOption(i), s = getTemporalOffsetOption(i,
|
|
2417
|
-
return createTemporalZonedDateTime(interpretISODateTimeOffset(d.o, d.p,
|
|
2422
|
+
])), i = getOptionsObject(t), c = getTemporalDisambiguationOption(i), s = getTemporalOffsetOption(i, f), l = getTemporalOverflowOption(i), d = interpretTemporalDateTimeFields(o.Y, a, l);
|
|
2423
|
+
return createTemporalZonedDateTime(interpretISODateTimeOffset(d.o, d.p, O, parseDateTimeUtcOffset(a[Ot.M]), o.P, c, s, !0), o.P, o.Y);
|
|
2418
2424
|
}
|
|
2419
2425
|
withPlainTime(e = void 0) {
|
|
2420
2426
|
const t = getInternalSlotOrThrowForZonedDateTime(this), o = getIsoDateTimeForZonedDateTimeSlot(t);
|
|
2421
|
-
return createTemporalZonedDateTime(void 0 === e ? getStartOfDay(t.P, o.o) : getEpochNanosecondsFor(t.P, combineIsoDateAndTimeRecord(o.o, toTemporalTime(e)),
|
|
2427
|
+
return createTemporalZonedDateTime(void 0 === e ? getStartOfDay(t.P, o.o) : getEpochNanosecondsFor(t.P, combineIsoDateAndTimeRecord(o.o, toTemporalTime(e)), p), t.P, t.Y);
|
|
2422
2428
|
}
|
|
2423
2429
|
withTimeZone(e) {
|
|
2424
2430
|
const t = getInternalSlotOrThrowForZonedDateTime(this);
|
|
@@ -2441,39 +2447,39 @@ var Ee = class {
|
|
|
2441
2447
|
return differenceTemporalZonedDateTime(-1, getInternalSlotOrThrowForZonedDateTime(this), e, t);
|
|
2442
2448
|
}
|
|
2443
2449
|
round(e) {
|
|
2444
|
-
const t = getInternalSlotOrThrowForZonedDateTime(this), o = getRoundToOptionsObject(e), n = getRoundingIncrementOption(o), r = getRoundingModeOption(o, "halfExpand"), a = getTemporalUnitValuedOption(o, "smallestUnit",
|
|
2445
|
-
if (validateTemporalUnitValue(a,
|
|
2450
|
+
const t = getInternalSlotOrThrowForZonedDateTime(this), o = getRoundToOptionsObject(e), n = getRoundingIncrementOption(o), r = getRoundingModeOption(o, "halfExpand"), a = getTemporalUnitValuedOption(o, "smallestUnit", u);
|
|
2451
|
+
if (validateTemporalUnitValue(a, s, [x]), validateTemporalRoundingIncrement(n, a === x ? 1 : maximumTemporalDurationRoundingIncrement(a), a === x), a === J && 1 === n) return createTemporalZonedDateTimeFromSlot(t);
|
|
2446
2452
|
const i = getIsoDateTimeForZonedDateTimeSlot(t);
|
|
2447
|
-
if (a ===
|
|
2453
|
+
if (a === x) {
|
|
2448
2454
|
const e = getStartOfDay(t.P, i.o), o = getStartOfDay(t.P, addDaysToIsoDate(i.o, 1));
|
|
2449
2455
|
return createTemporalZonedDateTime(addNanosecondsToEpochSeconds(e, roundNumberToIncrement(timeDurationToSubsecondsNumber(differenceEpochNanoseconds(e, 1 !== compareEpochNanoseconds(o, t.U) ? addNanosecondsToEpochSeconds(o, -1) : t.U), -9), timeDurationToSubsecondsNumber(differenceEpochNanoseconds(e, o), -9), r)), t.P, t.Y);
|
|
2450
2456
|
}
|
|
2451
|
-
const c = roundIsoDateTime(i, n, a, r),
|
|
2452
|
-
return createTemporalZonedDateTime(interpretISODateTimeOffset(c.o, c.p,
|
|
2457
|
+
const c = roundIsoDateTime(i, n, a, r), l = getOffsetNanosecondsForZonedDateTimeSlot(t);
|
|
2458
|
+
return createTemporalZonedDateTime(interpretISODateTimeOffset(c.o, c.p, O, l, t.P, p, f, !0), t.P, t.Y);
|
|
2453
2459
|
}
|
|
2454
2460
|
equals(e) {
|
|
2455
2461
|
const t = getInternalSlotOrThrowForZonedDateTime(this), o = toTemporalZonedDateTime(e);
|
|
2456
2462
|
return !compareEpochNanoseconds(t.U, o.U) && timeZoneEquals(t.P, o.P) && calendarEquals(t.Y, o.Y);
|
|
2457
2463
|
}
|
|
2458
2464
|
toString(e = void 0) {
|
|
2459
|
-
const t = getInternalSlotOrThrowForZonedDateTime(this), o = getOptionsObject(e), n = getTemporalShowCalendarNameOption(o), r = getTemporalFractionalSecondDigitsOption(o), a = ((e) => getOption(e, "offset", [
|
|
2465
|
+
const t = getInternalSlotOrThrowForZonedDateTime(this), o = getOptionsObject(e), n = getTemporalShowCalendarNameOption(o), r = getTemporalFractionalSecondDigitsOption(o), a = ((e) => getOption(e, "offset", [U, j], U))(o), i = getRoundingModeOption(o, E), c = getTemporalUnitValuedOption(o, "smallestUnit", void 0), l = ((e) => getOption(e, "timeZoneName", [
|
|
2466
|
+
W,
|
|
2460
2467
|
A,
|
|
2461
|
-
L
|
|
2462
|
-
|
|
2463
|
-
|
|
2464
|
-
validateTemporalUnitValue(c, l), c === q && throwRangeError(invalidField("smallestUnit"));
|
|
2468
|
+
L
|
|
2469
|
+
], W))(o);
|
|
2470
|
+
validateTemporalUnitValue(c, s), c === H && throwRangeError(invalidField("smallestUnit"));
|
|
2465
2471
|
const d = toSecondsStringPrecisionRecord(c, r);
|
|
2466
|
-
return temporalZonedDateTimeToString(t, d
|
|
2472
|
+
return temporalZonedDateTimeToString(t, d.Ee, n, l, a, d.Me, d.ve, i);
|
|
2467
2473
|
}
|
|
2468
2474
|
toLocaleString(e = void 0, t = void 0) {
|
|
2469
|
-
const o = getInternalSlotOrThrowForZonedDateTime(this), n = createDateTimeFormat(e, t,
|
|
2470
|
-
return "iso8601" === o.Y || calendarEquals(o.Y, r.
|
|
2475
|
+
const o = getInternalSlotOrThrowForZonedDateTime(this), n = createDateTimeFormat(e, t, l, o.P), r = getInternalSlotOrThrowForDateTimeFormat(n);
|
|
2476
|
+
return "iso8601" === o.Y || calendarEquals(o.Y, r.Ne.calendar) || throwRangeError(ue), formatDateTime(n, createTemporalInstant(o.U));
|
|
2471
2477
|
}
|
|
2472
2478
|
toJSON() {
|
|
2473
|
-
return temporalZonedDateTimeToString(getInternalSlotOrThrowForZonedDateTime(this), void 0,
|
|
2479
|
+
return temporalZonedDateTimeToString(getInternalSlotOrThrowForZonedDateTime(this), void 0, Z, W, U);
|
|
2474
2480
|
}
|
|
2475
2481
|
valueOf() {
|
|
2476
|
-
throwTypeError(
|
|
2482
|
+
throwTypeError(fe);
|
|
2477
2483
|
}
|
|
2478
2484
|
startOfDay() {
|
|
2479
2485
|
const e = getInternalSlotOrThrowForZonedDateTime(this);
|
|
@@ -2481,8 +2487,8 @@ var Ee = class {
|
|
|
2481
2487
|
}
|
|
2482
2488
|
getTimeZoneTransition(e) {
|
|
2483
2489
|
const t = getInternalSlotOrThrowForZonedDateTime(this);
|
|
2484
|
-
void 0 === e && throwTypeError(
|
|
2485
|
-
const o = getOption("string" == typeof e ? { direction: e } : getOptionsObject(e), "direction", ["next", "previous"],
|
|
2490
|
+
void 0 === e && throwTypeError(Ie);
|
|
2491
|
+
const o = getOption("string" == typeof e ? { direction: e } : getOptionsObject(e), "direction", ["next", "previous"], u), n = ((e, t, o) => {
|
|
2486
2492
|
if ("UTC" === e || isOffsetTimeZoneIdentifier(e)) return null;
|
|
2487
2493
|
const n = -4e9, r = Math.floor((Date.now() + 31536e7) / 1e3), a = clamp(epochSeconds(addNanosecondsToEpochSeconds(t, o > 0 ? 0 : -1)), n, Infinity);
|
|
2488
2494
|
return -1 === o ? a === n ? null : a > r ? searchTimeZoneTransition(e, a, a - 31536e3, o) || searchTimeZoneTransition(e, r, n, o) : searchTimeZoneTransition(e, a, n, o) : searchTimeZoneTransition(e, a, a > r ? a + 31536e3 : r, o);
|
|
@@ -2522,99 +2528,84 @@ var Re = class {
|
|
|
2522
2528
|
].map(toIntegerWithTruncation);
|
|
2523
2529
|
validateString(l);
|
|
2524
2530
|
const u = canonicalizeCalendar(l);
|
|
2525
|
-
isValidIsoDate(...d) && isValidTime(...m) || throwRangeError(
|
|
2531
|
+
isValidIsoDate(...d) && isValidTime(...m) || throwRangeError(se), createTemporalDateTime(combineIsoDateAndTimeRecord(createIsoDateRecord(...d), createTimeRecord(...m)), u, this);
|
|
2526
2532
|
}
|
|
2527
2533
|
static from(e, t = void 0) {
|
|
2528
2534
|
return toTemporalDateTime(e, t);
|
|
2529
2535
|
}
|
|
2530
2536
|
static compare(e, t) {
|
|
2531
|
-
return compareIsoDateTime(getInternalSlotOrThrowForPlainDateTime(toTemporalDateTime(e)).
|
|
2537
|
+
return compareIsoDateTime(getInternalSlotOrThrowForPlainDateTime(toTemporalDateTime(e)).K, getInternalSlotOrThrowForPlainDateTime(toTemporalDateTime(t)).K);
|
|
2532
2538
|
}
|
|
2533
2539
|
get calendarId() {
|
|
2534
2540
|
return getInternalSlotOrThrowForPlainDateTime(this).Y;
|
|
2535
2541
|
}
|
|
2536
2542
|
get era() {
|
|
2537
|
-
|
|
2538
|
-
return calendarIsoToDate(e.Y, e.G.o).oe;
|
|
2543
|
+
return calendarDateForPlainDateTime(this).ne;
|
|
2539
2544
|
}
|
|
2540
2545
|
get eraYear() {
|
|
2541
|
-
|
|
2542
|
-
return calendarIsoToDate(e.Y, e.G.o).ne;
|
|
2546
|
+
return calendarDateForPlainDateTime(this).re;
|
|
2543
2547
|
}
|
|
2544
2548
|
get year() {
|
|
2545
|
-
|
|
2546
|
-
return calendarIsoToDate(e.Y, e.G.o).t;
|
|
2549
|
+
return calendarDateForPlainDateTime(this).t;
|
|
2547
2550
|
}
|
|
2548
2551
|
get month() {
|
|
2549
|
-
|
|
2550
|
-
return calendarIsoToDate(e.Y, e.G.o).u;
|
|
2552
|
+
return calendarDateForPlainDateTime(this).u;
|
|
2551
2553
|
}
|
|
2552
2554
|
get monthCode() {
|
|
2553
|
-
|
|
2554
|
-
return calendarIsoToDate(e.Y, e.G.o).v;
|
|
2555
|
+
return calendarDateForPlainDateTime(this).v;
|
|
2555
2556
|
}
|
|
2556
2557
|
get day() {
|
|
2557
|
-
|
|
2558
|
-
return calendarIsoToDate(e.Y, e.G.o).T;
|
|
2558
|
+
return calendarDateForPlainDateTime(this).T;
|
|
2559
2559
|
}
|
|
2560
2560
|
get hour() {
|
|
2561
|
-
return getInternalSlotOrThrowForPlainDateTime(this).
|
|
2561
|
+
return getInternalSlotOrThrowForPlainDateTime(this).K.p.D;
|
|
2562
2562
|
}
|
|
2563
2563
|
get minute() {
|
|
2564
|
-
return getInternalSlotOrThrowForPlainDateTime(this).
|
|
2564
|
+
return getInternalSlotOrThrowForPlainDateTime(this).K.p.I;
|
|
2565
2565
|
}
|
|
2566
2566
|
get second() {
|
|
2567
|
-
return getInternalSlotOrThrowForPlainDateTime(this).
|
|
2567
|
+
return getInternalSlotOrThrowForPlainDateTime(this).K.p.O;
|
|
2568
2568
|
}
|
|
2569
2569
|
get millisecond() {
|
|
2570
|
-
return getInternalSlotOrThrowForPlainDateTime(this).
|
|
2570
|
+
return getInternalSlotOrThrowForPlainDateTime(this).K.p.F;
|
|
2571
2571
|
}
|
|
2572
2572
|
get microsecond() {
|
|
2573
|
-
return getInternalSlotOrThrowForPlainDateTime(this).
|
|
2573
|
+
return getInternalSlotOrThrowForPlainDateTime(this).K.p.S;
|
|
2574
2574
|
}
|
|
2575
2575
|
get nanosecond() {
|
|
2576
|
-
return getInternalSlotOrThrowForPlainDateTime(this).
|
|
2576
|
+
return getInternalSlotOrThrowForPlainDateTime(this).K.p.$;
|
|
2577
2577
|
}
|
|
2578
2578
|
get dayOfWeek() {
|
|
2579
|
-
|
|
2580
|
-
return calendarIsoToDate(e.Y, e.G.o).re;
|
|
2579
|
+
return calendarDateForPlainDateTime(this).ae;
|
|
2581
2580
|
}
|
|
2582
2581
|
get dayOfYear() {
|
|
2583
|
-
|
|
2584
|
-
return calendarIsoToDate(e.Y, e.G.o).ae;
|
|
2582
|
+
return calendarDateForPlainDateTime(this).ie;
|
|
2585
2583
|
}
|
|
2586
2584
|
get weekOfYear() {
|
|
2587
|
-
|
|
2588
|
-
return calendarIsoToDate(e.Y, e.G.o).ie.ce;
|
|
2585
|
+
return calendarDateForPlainDateTime(this).ce.se;
|
|
2589
2586
|
}
|
|
2590
2587
|
get yearOfWeek() {
|
|
2591
|
-
|
|
2592
|
-
return calendarIsoToDate(e.Y, e.G.o).ie.t;
|
|
2588
|
+
return calendarDateForPlainDateTime(this).ce.t;
|
|
2593
2589
|
}
|
|
2594
2590
|
get daysInWeek() {
|
|
2595
|
-
|
|
2596
|
-
return calendarIsoToDate(e.Y, e.G.o).se;
|
|
2591
|
+
return calendarDateForPlainDateTime(this).le;
|
|
2597
2592
|
}
|
|
2598
2593
|
get daysInMonth() {
|
|
2599
|
-
|
|
2600
|
-
return calendarIsoToDate(e.Y, e.G.o).le;
|
|
2594
|
+
return calendarDateForPlainDateTime(this).de;
|
|
2601
2595
|
}
|
|
2602
2596
|
get daysInYear() {
|
|
2603
|
-
|
|
2604
|
-
return calendarIsoToDate(e.Y, e.G.o).de;
|
|
2597
|
+
return calendarDateForPlainDateTime(this).me;
|
|
2605
2598
|
}
|
|
2606
2599
|
get monthsInYear() {
|
|
2607
|
-
|
|
2608
|
-
return calendarIsoToDate(e.Y, e.G.o).me;
|
|
2600
|
+
return calendarDateForPlainDateTime(this).ue;
|
|
2609
2601
|
}
|
|
2610
2602
|
get inLeapYear() {
|
|
2611
|
-
|
|
2612
|
-
return calendarIsoToDate(e.Y, e.G.o).ue;
|
|
2603
|
+
return calendarDateForPlainDateTime(this).Te;
|
|
2613
2604
|
}
|
|
2614
2605
|
with(e, t = void 0) {
|
|
2615
2606
|
const o = getInternalSlotOrThrowForPlainDateTime(this);
|
|
2616
2607
|
validatePartialTemporalObject(e);
|
|
2617
|
-
const n = calendarMergeFields(o.Y, isoDateTimeToFields(o.Y, o.
|
|
2608
|
+
const n = calendarMergeFields(o.Y, isoDateTimeToFields(o.Y, o.K), prepareCalendarFields(o.Y, e, [
|
|
2618
2609
|
Ot.t,
|
|
2619
2610
|
Ot.u,
|
|
2620
2611
|
Ot.v,
|
|
@@ -2630,10 +2621,10 @@ var Re = class {
|
|
|
2630
2621
|
}
|
|
2631
2622
|
withPlainTime(e = void 0) {
|
|
2632
2623
|
const t = getInternalSlotOrThrowForPlainDateTime(this);
|
|
2633
|
-
return createTemporalDateTime(combineIsoDateAndTimeRecord(t.
|
|
2624
|
+
return createTemporalDateTime(combineIsoDateAndTimeRecord(t.K.o, toTimeRecordOrMidnight(e)), t.Y);
|
|
2634
2625
|
}
|
|
2635
2626
|
withCalendar(e) {
|
|
2636
|
-
return createTemporalDateTime(getInternalSlotOrThrowForPlainDateTime(this).
|
|
2627
|
+
return createTemporalDateTime(getInternalSlotOrThrowForPlainDateTime(this).K, toTemporalCalendarIdentifier(e));
|
|
2637
2628
|
}
|
|
2638
2629
|
add(e, t = void 0) {
|
|
2639
2630
|
return addDurationToDateTime(1, getInternalSlotOrThrowForPlainDateTime(this), e, t);
|
|
@@ -2648,39 +2639,39 @@ var Re = class {
|
|
|
2648
2639
|
return differenceTemporalPlainDateTime(-1, getInternalSlotOrThrowForPlainDateTime(this), e, t);
|
|
2649
2640
|
}
|
|
2650
2641
|
round(e) {
|
|
2651
|
-
const t = getInternalSlotOrThrowForPlainDateTime(this), o = getRoundToOptionsObject(e), n = getRoundingIncrementOption(o), r = getRoundingModeOption(o, "halfExpand"), a = getTemporalUnitValuedOption(o, "smallestUnit",
|
|
2652
|
-
return validateTemporalUnitValue(a,
|
|
2642
|
+
const t = getInternalSlotOrThrowForPlainDateTime(this), o = getRoundToOptionsObject(e), n = getRoundingIncrementOption(o), r = getRoundingModeOption(o, "halfExpand"), a = getTemporalUnitValuedOption(o, "smallestUnit", u);
|
|
2643
|
+
return validateTemporalUnitValue(a, s, [x]), validateTemporalRoundingIncrement(n, a === x ? 1 : maximumTemporalDurationRoundingIncrement(a), a === x), createTemporalDateTime(roundIsoDateTime(t.K, n, a, r), t.Y);
|
|
2653
2644
|
}
|
|
2654
2645
|
equals(e) {
|
|
2655
2646
|
const t = getInternalSlotOrThrowForPlainDateTime(this), o = getInternalSlotOrThrowForPlainDateTime(toTemporalDateTime(e));
|
|
2656
|
-
return !compareIsoDateTime(t.
|
|
2647
|
+
return !compareIsoDateTime(t.K, o.K) && calendarEquals(t.Y, o.Y);
|
|
2657
2648
|
}
|
|
2658
2649
|
toString(e = void 0) {
|
|
2659
|
-
const t = getInternalSlotOrThrowForPlainDateTime(this), o = getOptionsObject(e), n = getTemporalShowCalendarNameOption(o), r = getTemporalFractionalSecondDigitsOption(o), a = getRoundingModeOption(o,
|
|
2660
|
-
validateTemporalUnitValue(i,
|
|
2650
|
+
const t = getInternalSlotOrThrowForPlainDateTime(this), o = getOptionsObject(e), n = getTemporalShowCalendarNameOption(o), r = getTemporalFractionalSecondDigitsOption(o), a = getRoundingModeOption(o, E), i = getTemporalUnitValuedOption(o, "smallestUnit", void 0);
|
|
2651
|
+
validateTemporalUnitValue(i, s), i === H && throwRangeError(invalidField("smallestUnit"));
|
|
2661
2652
|
const c = toSecondsStringPrecisionRecord(i, r);
|
|
2662
|
-
return isoDateTimeToString(validateIsoDateTime(roundIsoDateTime(t.
|
|
2653
|
+
return isoDateTimeToString(validateIsoDateTime(roundIsoDateTime(t.K, c.Me, c.ve, a)), t.Y, c.Ee, n);
|
|
2663
2654
|
}
|
|
2664
2655
|
toLocaleString(e = void 0, t = void 0) {
|
|
2665
|
-
return getInternalSlotOrThrowForPlainDateTime(this), formatDateTime(createDateTimeFormat(e, t,
|
|
2656
|
+
return getInternalSlotOrThrowForPlainDateTime(this), formatDateTime(createDateTimeFormat(e, t, l), this);
|
|
2666
2657
|
}
|
|
2667
2658
|
toJSON() {
|
|
2668
2659
|
const e = getInternalSlotOrThrowForPlainDateTime(this);
|
|
2669
|
-
return isoDateTimeToString(e.
|
|
2660
|
+
return isoDateTimeToString(e.K, e.Y, void 0, Z);
|
|
2670
2661
|
}
|
|
2671
2662
|
valueOf() {
|
|
2672
|
-
throwTypeError(
|
|
2663
|
+
throwTypeError(fe);
|
|
2673
2664
|
}
|
|
2674
2665
|
toZonedDateTime(e, t = void 0) {
|
|
2675
2666
|
const o = getInternalSlotOrThrowForPlainDateTime(this), n = toTemporalTimeZoneIdentifier(e), r = getTemporalDisambiguationOption(getOptionsObject(t));
|
|
2676
|
-
return createTemporalZonedDateTime(getEpochNanosecondsFor(n, o.
|
|
2667
|
+
return createTemporalZonedDateTime(getEpochNanosecondsFor(n, o.K, r), n, o.Y);
|
|
2677
2668
|
}
|
|
2678
2669
|
toPlainDate() {
|
|
2679
2670
|
const e = getInternalSlotOrThrowForPlainDateTime(this);
|
|
2680
|
-
return createTemporalDate(e.
|
|
2671
|
+
return createTemporalDate(e.K.o, e.Y);
|
|
2681
2672
|
}
|
|
2682
2673
|
toPlainTime() {
|
|
2683
|
-
return createTemporalTime(getInternalSlotOrThrowForPlainDateTime(this).
|
|
2674
|
+
return createTemporalTime(getInternalSlotOrThrowForPlainDateTime(this).K.p);
|
|
2684
2675
|
}
|
|
2685
2676
|
};
|
|
2686
2677
|
defineStringTag(Re.prototype, "Temporal.PlainDateTime"), renameFunction(Re, "PlainDateTime");
|
|
@@ -2695,7 +2686,7 @@ var Ze = class {
|
|
|
2695
2686
|
r,
|
|
2696
2687
|
a
|
|
2697
2688
|
].map(toIntegerWithTruncation);
|
|
2698
|
-
isValidTime(...i) || throwRangeError(
|
|
2689
|
+
isValidTime(...i) || throwRangeError(se), createTemporalTime(createTimeRecord(...i), this);
|
|
2699
2690
|
}
|
|
2700
2691
|
static from(e, t = void 0) {
|
|
2701
2692
|
return createTemporalTime(toTemporalTime(e, t));
|
|
@@ -2745,26 +2736,26 @@ var Ze = class {
|
|
|
2745
2736
|
return differenceTemporalPlainTime(-1, getInternalSlotOrThrowForPlainTime(this), e, t);
|
|
2746
2737
|
}
|
|
2747
2738
|
round(e) {
|
|
2748
|
-
const t = getInternalSlotOrThrowForPlainTime(this), o = getRoundToOptionsObject(e), n = getRoundingIncrementOption(o), r = getRoundingModeOption(o,
|
|
2749
|
-
return validateTemporalUnitValue(a,
|
|
2739
|
+
const t = getInternalSlotOrThrowForPlainTime(this), o = getRoundToOptionsObject(e), n = getRoundingIncrementOption(o), r = getRoundingModeOption(o, P), a = getTemporalUnitValuedOption(o, "smallestUnit", u);
|
|
2740
|
+
return validateTemporalUnitValue(a, s), validateTemporalRoundingIncrement(n, maximumTemporalDurationRoundingIncrement(a), !1), createTemporalTime(roundTime(t, n, a, r));
|
|
2750
2741
|
}
|
|
2751
2742
|
equals(e) {
|
|
2752
2743
|
return !compareTimeRecord(getInternalSlotOrThrowForPlainTime(this), toTemporalTime(e));
|
|
2753
2744
|
}
|
|
2754
2745
|
toString(e = void 0) {
|
|
2755
|
-
const t = getInternalSlotOrThrowForPlainTime(this), o = getOptionsObject(e), n = getTemporalFractionalSecondDigitsOption(o), r = getRoundingModeOption(o,
|
|
2756
|
-
validateTemporalUnitValue(a,
|
|
2746
|
+
const t = getInternalSlotOrThrowForPlainTime(this), o = getOptionsObject(e), n = getTemporalFractionalSecondDigitsOption(o), r = getRoundingModeOption(o, E), a = getTemporalUnitValuedOption(o, "smallestUnit", void 0);
|
|
2747
|
+
validateTemporalUnitValue(a, s), a === H && throwRangeError(invalidField("smallestUnit"));
|
|
2757
2748
|
const i = toSecondsStringPrecisionRecord(a, n);
|
|
2758
|
-
return timeRecordToString(roundTime(t, i.
|
|
2749
|
+
return timeRecordToString(roundTime(t, i.Me, i.ve, r), i.Ee);
|
|
2759
2750
|
}
|
|
2760
2751
|
toLocaleString(e = void 0, t = void 0) {
|
|
2761
|
-
return getInternalSlotOrThrowForPlainTime(this), formatDateTime(createDateTimeFormat(e, t,
|
|
2752
|
+
return getInternalSlotOrThrowForPlainTime(this), formatDateTime(createDateTimeFormat(e, t, s), this);
|
|
2762
2753
|
}
|
|
2763
2754
|
toJSON() {
|
|
2764
2755
|
return timeRecordToString(getInternalSlotOrThrowForPlainTime(this));
|
|
2765
2756
|
}
|
|
2766
2757
|
valueOf() {
|
|
2767
|
-
throwTypeError(
|
|
2758
|
+
throwTypeError(fe);
|
|
2768
2759
|
}
|
|
2769
2760
|
};
|
|
2770
2761
|
defineStringTag(Ze.prototype, "Temporal.PlainTime"), renameFunction(Ze, "PlainTime");
|
|
@@ -2782,17 +2773,17 @@ const $e = "\\d{4}|[-+]\\d{6}", Ce = "0[1-9]|1[0-2]", Ye = "0[1-9]|[12]\\d|30|31
|
|
|
2782
2773
|
We,
|
|
2783
2774
|
`[ tT]${Ae}`,
|
|
2784
2775
|
`(?<h>${Le})`
|
|
2785
|
-
]), ze = `(?<l>${$e})-?(?<m>${Ce})`, Ve = `(?:--)?(?<m>${Ce})-?(?<n>${Ye})`, xe = `(?<h>${Le})|(?<i>[zZ])`, He = `([+-])(${Ue})(?::?(${je}))?|${join("[a-zA-Z._][a-zA-Z._+-\\d]*", "\\/")}`, qe = `\\[!?(?<j>${He})\\]`, Be = join("[a-zA-Z\\d]+", "-"), Je = `\\[(!)?([a-z_][a-z\\d_-]*)=(${Be})\\]`, _e = `(?<k>(${Je})*)`,
|
|
2776
|
+
]), ze = `(?<l>${$e})-?(?<m>${Ce})`, Ve = `(?:--)?(?<m>${Ce})-?(?<n>${Ye})`, xe = `(?<h>${Le})|(?<i>[zZ])`, He = `([+-])(${Ue})(?::?(${je}))?|${join("[a-zA-Z._][a-zA-Z._+-\\d]*", "\\/")}`, qe = `\\[!?(?<j>${He})\\]`, Be = join("[a-zA-Z\\d]+", "-"), Je = `\\[(!)?([a-z_][a-z\\d_-]*)=(${Be})\\]`, _e = `(?<k>(${Je})*)`, Xe = RegExp(Je, "g"), Ge = createRegExp(`${optionalChain([
|
|
2786
2777
|
We,
|
|
2787
2778
|
`[ tT]${Ae}`,
|
|
2788
2779
|
xe
|
|
2789
|
-
])}${qe}${_e}`),
|
|
2780
|
+
])}${qe}${_e}`), Ke = createRegExp(`${ke}(?:${qe})?${_e}`), Qe = createRegExp(`${We}[ tT]${Ae}(?:${xe})(?:${qe})?${_e}`), et = createRegExp(`(${We}[ tT]|[tT]?)${Ae}(?<h>${Le})?(?:${qe})?${_e}`), tt = createRegExp(`(${ke}|${Ve})(?:${qe})?${_e}`), ot = createRegExp(`(${ke}|${ze})(?:${qe})?${_e}`), nt = [createRegExp(`${Ve}(${qe})?(${Je})*`), createRegExp(`${ze}(${qe})?(${Je})*`)], rt = createRegExp(He), at = createRegExp(Be), it = createRegExp(Le), ct = /* @__PURE__ */ new WeakMap();
|
|
2790
2781
|
var st = class {
|
|
2791
2782
|
constructor(e, t, o = "iso8601", n = 1972) {
|
|
2792
2783
|
const r = toIntegerWithTruncation(e), a = toIntegerWithTruncation(t);
|
|
2793
2784
|
validateString(o);
|
|
2794
2785
|
const i = canonicalizeCalendar(o), c = toIntegerWithTruncation(n);
|
|
2795
|
-
isValidIsoDate(c, r, a) || throwRangeError(
|
|
2786
|
+
isValidIsoDate(c, r, a) || throwRangeError(se), createTemporalMonthDay(createIsoDateRecord(c, r, a), i, this);
|
|
2796
2787
|
}
|
|
2797
2788
|
static from(e, t = void 0) {
|
|
2798
2789
|
return toTemporalMonthDay(e, t);
|
|
@@ -2810,7 +2801,7 @@ var st = class {
|
|
|
2810
2801
|
}
|
|
2811
2802
|
with(e, t = void 0) {
|
|
2812
2803
|
const o = getInternalSlotOrThrowForPlainMonthDay(this);
|
|
2813
|
-
return validatePartialTemporalObject(e), createTemporalMonthDay(calendarMonthDayFromFields(o.Y, calendarMergeFields(o.Y, isoDateToFields(o.Y, o.o,
|
|
2804
|
+
return validatePartialTemporalObject(e), createTemporalMonthDay(calendarMonthDayFromFields(o.Y, calendarMergeFields(o.Y, isoDateToFields(o.Y, o.o, m), prepareCalendarFields(o.Y, e, [
|
|
2814
2805
|
Ot.t,
|
|
2815
2806
|
Ot.u,
|
|
2816
2807
|
Ot.v,
|
|
@@ -2825,17 +2816,17 @@ var st = class {
|
|
|
2825
2816
|
return temporalMonthDayToString(getInternalSlotOrThrowForPlainMonthDay(this), getTemporalShowCalendarNameOption(getOptionsObject(e)));
|
|
2826
2817
|
}
|
|
2827
2818
|
toLocaleString(e = void 0, t = void 0) {
|
|
2828
|
-
return getInternalSlotOrThrowForPlainMonthDay(this), formatDateTime(createDateTimeFormat(e, t,
|
|
2819
|
+
return getInternalSlotOrThrowForPlainMonthDay(this), formatDateTime(createDateTimeFormat(e, t, c), this);
|
|
2829
2820
|
}
|
|
2830
2821
|
toJSON() {
|
|
2831
|
-
return temporalMonthDayToString(getInternalSlotOrThrowForPlainMonthDay(this),
|
|
2822
|
+
return temporalMonthDayToString(getInternalSlotOrThrowForPlainMonthDay(this), Z);
|
|
2832
2823
|
}
|
|
2833
2824
|
valueOf() {
|
|
2834
|
-
throwTypeError(
|
|
2825
|
+
throwTypeError(fe);
|
|
2835
2826
|
}
|
|
2836
2827
|
toPlainDate(e) {
|
|
2837
2828
|
const t = getInternalSlotOrThrowForPlainMonthDay(this);
|
|
2838
|
-
return isObject(e) || throwTypeError(notObject(e)), createTemporalDate(calendarDateFromFields(t.Y, calendarMergeFields(t.Y, isoDateToFields(t.Y, t.o,
|
|
2829
|
+
return isObject(e) || throwTypeError(notObject(e)), createTemporalDate(calendarDateFromFields(t.Y, calendarMergeFields(t.Y, isoDateToFields(t.Y, t.o, m), prepareCalendarFields(t.Y, e, [Ot.t], [])), D), t.Y);
|
|
2839
2830
|
}
|
|
2840
2831
|
};
|
|
2841
2832
|
defineStringTag(st.prototype, "Temporal.PlainMonthDay"), renameFunction(st, "PlainMonthDay");
|
|
@@ -2845,7 +2836,7 @@ var dt = class {
|
|
|
2845
2836
|
const r = toIntegerWithTruncation(e), a = toIntegerWithTruncation(t);
|
|
2846
2837
|
validateString(o);
|
|
2847
2838
|
const i = canonicalizeCalendar(o), c = toIntegerWithTruncation(n);
|
|
2848
|
-
isValidIsoDate(r, a, c) || throwRangeError(
|
|
2839
|
+
isValidIsoDate(r, a, c) || throwRangeError(se), createTemporalYearMonth(createIsoDateRecord(r, a, c), i, this);
|
|
2849
2840
|
}
|
|
2850
2841
|
static from(e, t = void 0) {
|
|
2851
2842
|
return toTemporalYearMonth(e, t);
|
|
@@ -2857,45 +2848,36 @@ var dt = class {
|
|
|
2857
2848
|
return getInternalSlotOrThrowForPlainYearMonth(this).Y;
|
|
2858
2849
|
}
|
|
2859
2850
|
get era() {
|
|
2860
|
-
|
|
2861
|
-
return calendarIsoToDate(e.Y, e.o).oe;
|
|
2851
|
+
return calendarDateForPlainYearMonth(this).ne;
|
|
2862
2852
|
}
|
|
2863
2853
|
get eraYear() {
|
|
2864
|
-
|
|
2865
|
-
return calendarIsoToDate(e.Y, e.o).ne;
|
|
2854
|
+
return calendarDateForPlainYearMonth(this).re;
|
|
2866
2855
|
}
|
|
2867
2856
|
get year() {
|
|
2868
|
-
|
|
2869
|
-
return calendarIsoToDate(e.Y, e.o).t;
|
|
2857
|
+
return calendarDateForPlainYearMonth(this).t;
|
|
2870
2858
|
}
|
|
2871
2859
|
get month() {
|
|
2872
|
-
|
|
2873
|
-
return calendarIsoToDate(e.Y, e.o).u;
|
|
2860
|
+
return calendarDateForPlainYearMonth(this).u;
|
|
2874
2861
|
}
|
|
2875
2862
|
get monthCode() {
|
|
2876
|
-
|
|
2877
|
-
return calendarIsoToDate(e.Y, e.o).v;
|
|
2863
|
+
return calendarDateForPlainYearMonth(this).v;
|
|
2878
2864
|
}
|
|
2879
2865
|
get daysInYear() {
|
|
2880
|
-
|
|
2881
|
-
return calendarIsoToDate(e.Y, e.o).de;
|
|
2866
|
+
return calendarDateForPlainYearMonth(this).me;
|
|
2882
2867
|
}
|
|
2883
2868
|
get daysInMonth() {
|
|
2884
|
-
|
|
2885
|
-
return calendarIsoToDate(e.Y, e.o).le;
|
|
2869
|
+
return calendarDateForPlainYearMonth(this).de;
|
|
2886
2870
|
}
|
|
2887
2871
|
get monthsInYear() {
|
|
2888
|
-
|
|
2889
|
-
return calendarIsoToDate(e.Y, e.o).me;
|
|
2872
|
+
return calendarDateForPlainYearMonth(this).ue;
|
|
2890
2873
|
}
|
|
2891
2874
|
get inLeapYear() {
|
|
2892
|
-
|
|
2893
|
-
return calendarIsoToDate(e.Y, e.o).ue;
|
|
2875
|
+
return calendarDateForPlainYearMonth(this).Te;
|
|
2894
2876
|
}
|
|
2895
2877
|
with(e, t = void 0) {
|
|
2896
2878
|
const o = getInternalSlotOrThrowForPlainYearMonth(this);
|
|
2897
2879
|
validatePartialTemporalObject(e);
|
|
2898
|
-
const n = calendarMergeFields(o.Y, isoDateToFields(o.Y, o.o,
|
|
2880
|
+
const n = calendarMergeFields(o.Y, isoDateToFields(o.Y, o.o, d), prepareCalendarFields(o.Y, e, [
|
|
2899
2881
|
Ot.t,
|
|
2900
2882
|
Ot.u,
|
|
2901
2883
|
Ot.v
|
|
@@ -2922,17 +2904,17 @@ var dt = class {
|
|
|
2922
2904
|
return temporalYearMonthToString(getInternalSlotOrThrowForPlainYearMonth(this), getTemporalShowCalendarNameOption(getOptionsObject(e)));
|
|
2923
2905
|
}
|
|
2924
2906
|
toLocaleString(e = void 0, t = void 0) {
|
|
2925
|
-
return getInternalSlotOrThrowForPlainYearMonth(this), formatDateTime(createDateTimeFormat(e, t,
|
|
2907
|
+
return getInternalSlotOrThrowForPlainYearMonth(this), formatDateTime(createDateTimeFormat(e, t, c), this);
|
|
2926
2908
|
}
|
|
2927
2909
|
toJSON() {
|
|
2928
|
-
return temporalYearMonthToString(getInternalSlotOrThrowForPlainYearMonth(this),
|
|
2910
|
+
return temporalYearMonthToString(getInternalSlotOrThrowForPlainYearMonth(this), Z);
|
|
2929
2911
|
}
|
|
2930
2912
|
valueOf() {
|
|
2931
|
-
throwTypeError(
|
|
2913
|
+
throwTypeError(fe);
|
|
2932
2914
|
}
|
|
2933
2915
|
toPlainDate(e) {
|
|
2934
2916
|
const t = getInternalSlotOrThrowForPlainYearMonth(this);
|
|
2935
|
-
return isObject(e) || throwTypeError(notObject(e)), createTemporalDate(calendarDateFromFields(t.Y, calendarMergeFields(t.Y, isoDateToFields(t.Y, t.o,
|
|
2917
|
+
return isObject(e) || throwTypeError(notObject(e)), createTemporalDate(calendarDateFromFields(t.Y, calendarMergeFields(t.Y, isoDateToFields(t.Y, t.o, d), prepareCalendarFields(t.Y, e, [Ot.T], [])), D), t.Y);
|
|
2936
2918
|
}
|
|
2937
2919
|
};
|
|
2938
2920
|
defineStringTag(dt.prototype, "Temporal.PlainYearMonth"), renameFunction(dt, "PlainYearMonth");
|
|
@@ -2942,7 +2924,7 @@ var ut = class {
|
|
|
2942
2924
|
const r = toIntegerWithTruncation(e), a = toIntegerWithTruncation(t), i = toIntegerWithTruncation(o);
|
|
2943
2925
|
validateString(n);
|
|
2944
2926
|
const c = canonicalizeCalendar(n);
|
|
2945
|
-
isValidIsoDate(r, a, i) || throwRangeError(
|
|
2927
|
+
isValidIsoDate(r, a, i) || throwRangeError(se), createTemporalDate(createIsoDateRecord(r, a, i), c, this);
|
|
2946
2928
|
}
|
|
2947
2929
|
static from(e, t = void 0) {
|
|
2948
2930
|
return toTemporalDate(e, t);
|
|
@@ -2954,72 +2936,57 @@ var ut = class {
|
|
|
2954
2936
|
return getInternalSlotOrThrowForPlainDate(this).Y;
|
|
2955
2937
|
}
|
|
2956
2938
|
get era() {
|
|
2957
|
-
|
|
2958
|
-
return calendarIsoToDate(e.Y, e.o).oe;
|
|
2939
|
+
return calendarDateForPlainDate(this).ne;
|
|
2959
2940
|
}
|
|
2960
2941
|
get eraYear() {
|
|
2961
|
-
|
|
2962
|
-
return calendarIsoToDate(e.Y, e.o).ne;
|
|
2942
|
+
return calendarDateForPlainDate(this).re;
|
|
2963
2943
|
}
|
|
2964
2944
|
get year() {
|
|
2965
|
-
|
|
2966
|
-
return calendarIsoToDate(e.Y, e.o).t;
|
|
2945
|
+
return calendarDateForPlainDate(this).t;
|
|
2967
2946
|
}
|
|
2968
2947
|
get month() {
|
|
2969
|
-
|
|
2970
|
-
return calendarIsoToDate(e.Y, e.o).u;
|
|
2948
|
+
return calendarDateForPlainDate(this).u;
|
|
2971
2949
|
}
|
|
2972
2950
|
get monthCode() {
|
|
2973
|
-
|
|
2974
|
-
return calendarIsoToDate(e.Y, e.o).v;
|
|
2951
|
+
return calendarDateForPlainDate(this).v;
|
|
2975
2952
|
}
|
|
2976
2953
|
get day() {
|
|
2977
|
-
|
|
2978
|
-
return calendarIsoToDate(e.Y, e.o).T;
|
|
2954
|
+
return calendarDateForPlainDate(this).T;
|
|
2979
2955
|
}
|
|
2980
2956
|
get dayOfWeek() {
|
|
2981
|
-
|
|
2982
|
-
return calendarIsoToDate(e.Y, e.o).re;
|
|
2957
|
+
return calendarDateForPlainDate(this).ae;
|
|
2983
2958
|
}
|
|
2984
2959
|
get dayOfYear() {
|
|
2985
|
-
|
|
2986
|
-
return calendarIsoToDate(e.Y, e.o).ae;
|
|
2960
|
+
return calendarDateForPlainDate(this).ie;
|
|
2987
2961
|
}
|
|
2988
2962
|
get weekOfYear() {
|
|
2989
|
-
|
|
2990
|
-
return calendarIsoToDate(e.Y, e.o).ie.ce;
|
|
2963
|
+
return calendarDateForPlainDate(this).ce.se;
|
|
2991
2964
|
}
|
|
2992
2965
|
get yearOfWeek() {
|
|
2993
|
-
|
|
2994
|
-
return calendarIsoToDate(e.Y, e.o).ie.t;
|
|
2966
|
+
return calendarDateForPlainDate(this).ce.t;
|
|
2995
2967
|
}
|
|
2996
2968
|
get daysInWeek() {
|
|
2997
|
-
|
|
2998
|
-
return calendarIsoToDate(e.Y, e.o).se;
|
|
2969
|
+
return calendarDateForPlainDate(this).le;
|
|
2999
2970
|
}
|
|
3000
2971
|
get daysInMonth() {
|
|
3001
|
-
|
|
3002
|
-
return calendarIsoToDate(e.Y, e.o).le;
|
|
2972
|
+
return calendarDateForPlainDate(this).de;
|
|
3003
2973
|
}
|
|
3004
2974
|
get daysInYear() {
|
|
3005
|
-
|
|
3006
|
-
return calendarIsoToDate(e.Y, e.o).de;
|
|
2975
|
+
return calendarDateForPlainDate(this).me;
|
|
3007
2976
|
}
|
|
3008
2977
|
get monthsInYear() {
|
|
3009
|
-
|
|
3010
|
-
return calendarIsoToDate(e.Y, e.o).me;
|
|
2978
|
+
return calendarDateForPlainDate(this).ue;
|
|
3011
2979
|
}
|
|
3012
2980
|
get inLeapYear() {
|
|
3013
|
-
|
|
3014
|
-
return calendarIsoToDate(e.Y, e.o).ue;
|
|
2981
|
+
return calendarDateForPlainDate(this).Te;
|
|
3015
2982
|
}
|
|
3016
2983
|
toPlainYearMonth() {
|
|
3017
2984
|
const e = getInternalSlotOrThrowForPlainDate(this);
|
|
3018
|
-
return createTemporalYearMonth(calendarYearMonthFromFields(e.Y, isoDateToFields(e.Y, e.o,
|
|
2985
|
+
return createTemporalYearMonth(calendarYearMonthFromFields(e.Y, isoDateToFields(e.Y, e.o, c), D), e.Y);
|
|
3019
2986
|
}
|
|
3020
2987
|
toPlainMonthDay() {
|
|
3021
2988
|
const e = getInternalSlotOrThrowForPlainDate(this);
|
|
3022
|
-
return createTemporalMonthDay(calendarMonthDayFromFields(e.Y, isoDateToFields(e.Y, e.o,
|
|
2989
|
+
return createTemporalMonthDay(calendarMonthDayFromFields(e.Y, isoDateToFields(e.Y, e.o, c), D), e.Y);
|
|
3023
2990
|
}
|
|
3024
2991
|
add(e, t = void 0) {
|
|
3025
2992
|
return addDurationToDate(1, getInternalSlotOrThrowForPlainDate(this), e, t);
|
|
@@ -3030,7 +2997,7 @@ var ut = class {
|
|
|
3030
2997
|
with(e, t = void 0) {
|
|
3031
2998
|
const o = getInternalSlotOrThrowForPlainDate(this);
|
|
3032
2999
|
validatePartialTemporalObject(e);
|
|
3033
|
-
const n = calendarMergeFields(o.Y, isoDateToFields(o.Y, o.o,
|
|
3000
|
+
const n = calendarMergeFields(o.Y, isoDateToFields(o.Y, o.o, c), prepareCalendarFields(o.Y, e, [
|
|
3034
3001
|
Ot.t,
|
|
3035
3002
|
Ot.u,
|
|
3036
3003
|
Ot.v,
|
|
@@ -3062,19 +3029,19 @@ var ut = class {
|
|
|
3062
3029
|
const t = e.timeZone;
|
|
3063
3030
|
void 0 === t ? n = toTemporalTimeZoneIdentifier(e) : (n = toTemporalTimeZoneIdentifier(t), o = e.plainTime);
|
|
3064
3031
|
} else n = toTemporalTimeZoneIdentifier(e);
|
|
3065
|
-
return createTemporalZonedDateTime(void 0 === o ? getStartOfDay(n, t.o) : getEpochNanosecondsFor(n, validateIsoDateTime(combineIsoDateAndTimeRecord(t.o, toTemporalTime(o))),
|
|
3032
|
+
return createTemporalZonedDateTime(void 0 === o ? getStartOfDay(n, t.o) : getEpochNanosecondsFor(n, validateIsoDateTime(combineIsoDateAndTimeRecord(t.o, toTemporalTime(o))), p), n, t.Y);
|
|
3066
3033
|
}
|
|
3067
3034
|
toString(e = void 0) {
|
|
3068
3035
|
return temporalDateToString(getInternalSlotOrThrowForPlainDate(this), getTemporalShowCalendarNameOption(getOptionsObject(e)));
|
|
3069
3036
|
}
|
|
3070
3037
|
toLocaleString(e = void 0, t = void 0) {
|
|
3071
|
-
return getInternalSlotOrThrowForPlainDate(this), formatDateTime(createDateTimeFormat(e, t,
|
|
3038
|
+
return getInternalSlotOrThrowForPlainDate(this), formatDateTime(createDateTimeFormat(e, t, c), this);
|
|
3072
3039
|
}
|
|
3073
3040
|
toJSON() {
|
|
3074
|
-
return temporalDateToString(getInternalSlotOrThrowForPlainDate(this),
|
|
3041
|
+
return temporalDateToString(getInternalSlotOrThrowForPlainDate(this), Z);
|
|
3075
3042
|
}
|
|
3076
3043
|
valueOf() {
|
|
3077
|
-
throwTypeError(
|
|
3044
|
+
throwTypeError(fe);
|
|
3078
3045
|
}
|
|
3079
3046
|
};
|
|
3080
3047
|
defineStringTag(ut.prototype, "Temporal.PlainDate"), renameFunction(ut, "PlainDate");
|
|
@@ -3110,8 +3077,8 @@ const Tt = createNullPrototypeObject(), Dt = {
|
|
|
3110
3077
|
persian: new Map([["ap", 1]]),
|
|
3111
3078
|
roc: new Map([["roc", 1], ["broc", !1]])
|
|
3112
3079
|
}), Ot = {
|
|
3113
|
-
|
|
3114
|
-
|
|
3080
|
+
ne: "era",
|
|
3081
|
+
re: "eraYear",
|
|
3115
3082
|
t: "year",
|
|
3116
3083
|
u: "month",
|
|
3117
3084
|
v: "monthCode",
|
|
@@ -3125,8 +3092,8 @@ const Tt = createNullPrototypeObject(), Dt = {
|
|
|
3125
3092
|
M: "offset",
|
|
3126
3093
|
P: "timeZone"
|
|
3127
3094
|
}, Ft = [
|
|
3128
|
-
Ot.oe,
|
|
3129
3095
|
Ot.ne,
|
|
3096
|
+
Ot.re,
|
|
3130
3097
|
Ot.t,
|
|
3131
3098
|
Ot.u,
|
|
3132
3099
|
Ot.v,
|
|
@@ -3140,8 +3107,8 @@ const Tt = createNullPrototypeObject(), Dt = {
|
|
|
3140
3107
|
Ot.M,
|
|
3141
3108
|
Ot.P
|
|
3142
3109
|
], St = {
|
|
3143
|
-
[Ot.
|
|
3144
|
-
[Ot.
|
|
3110
|
+
[Ot.ne]: [toString],
|
|
3111
|
+
[Ot.re]: [toIntegerWithTruncation],
|
|
3145
3112
|
[Ot.t]: [toIntegerWithTruncation],
|
|
3146
3113
|
[Ot.u]: [toPositiveIntegerWithTruncation],
|
|
3147
3114
|
[Ot.v]: [(e) => createMonthCode(...parseMonthCode(e))],
|
|
@@ -3178,40 +3145,40 @@ var vt = class {
|
|
|
3178
3145
|
}
|
|
3179
3146
|
static compare(e, t, o = void 0) {
|
|
3180
3147
|
const n = toTemporalDuration(e), r = toTemporalDuration(t), a = getTemporalRelativeToOption(getOptionsObject(o));
|
|
3181
|
-
if (n.
|
|
3148
|
+
if (!n.some((e, t) => r[t] !== e)) return 0;
|
|
3182
3149
|
const i = defaultTemporalLargestUnit(n), c = defaultTemporalLargestUnit(r), s = toInternalDurationRecord(n), l = toInternalDurationRecord(r);
|
|
3183
3150
|
let d, m;
|
|
3184
|
-
return a.
|
|
3151
|
+
return a.be && (isDateUnit(i) || isDateUnit(c)) ? compareEpochNanoseconds(addZonedDateTime(a.be, s, D), addZonedDateTime(a.be, l, D)) : (isCalendarUnit(i) || isCalendarUnit(c) ? (a.Pe || throwRangeError(missingField("relativeTo")), d = dateDurationDays(s.A, a.Pe), m = dateDurationDays(l.A, a.Pe)) : (d = n[K], m = r[K]), we(add24HourDaysToTimeDuration(s.p, d), add24HourDaysToTimeDuration(l.p, m)));
|
|
3185
3152
|
}
|
|
3186
3153
|
get years() {
|
|
3187
|
-
return getInternalSlotOrThrowForDuration(this)[
|
|
3154
|
+
return getInternalSlotOrThrowForDuration(this)[_];
|
|
3188
3155
|
}
|
|
3189
3156
|
get months() {
|
|
3190
|
-
return getInternalSlotOrThrowForDuration(this)[
|
|
3157
|
+
return getInternalSlotOrThrowForDuration(this)[X];
|
|
3191
3158
|
}
|
|
3192
3159
|
get weeks() {
|
|
3193
|
-
return getInternalSlotOrThrowForDuration(this)[
|
|
3160
|
+
return getInternalSlotOrThrowForDuration(this)[G];
|
|
3194
3161
|
}
|
|
3195
3162
|
get days() {
|
|
3196
|
-
return getInternalSlotOrThrowForDuration(this)[
|
|
3163
|
+
return getInternalSlotOrThrowForDuration(this)[K];
|
|
3197
3164
|
}
|
|
3198
3165
|
get hours() {
|
|
3199
|
-
return getInternalSlotOrThrowForDuration(this)[
|
|
3166
|
+
return getInternalSlotOrThrowForDuration(this)[Q];
|
|
3200
3167
|
}
|
|
3201
3168
|
get minutes() {
|
|
3202
|
-
return getInternalSlotOrThrowForDuration(this)[
|
|
3169
|
+
return getInternalSlotOrThrowForDuration(this)[ee];
|
|
3203
3170
|
}
|
|
3204
3171
|
get seconds() {
|
|
3205
|
-
return getInternalSlotOrThrowForDuration(this)[
|
|
3172
|
+
return getInternalSlotOrThrowForDuration(this)[te];
|
|
3206
3173
|
}
|
|
3207
3174
|
get milliseconds() {
|
|
3208
|
-
return getInternalSlotOrThrowForDuration(this)[
|
|
3175
|
+
return getInternalSlotOrThrowForDuration(this)[oe];
|
|
3209
3176
|
}
|
|
3210
3177
|
get microseconds() {
|
|
3211
|
-
return getInternalSlotOrThrowForDuration(this)[
|
|
3178
|
+
return getInternalSlotOrThrowForDuration(this)[ne];
|
|
3212
3179
|
}
|
|
3213
3180
|
get nanoseconds() {
|
|
3214
|
-
return getInternalSlotOrThrowForDuration(this)[
|
|
3181
|
+
return getInternalSlotOrThrowForDuration(this)[re];
|
|
3215
3182
|
}
|
|
3216
3183
|
get sign() {
|
|
3217
3184
|
return durationSign(getInternalSlotOrThrowForDuration(this));
|
|
@@ -3238,74 +3205,74 @@ var vt = class {
|
|
|
3238
3205
|
round(e) {
|
|
3239
3206
|
const t = getInternalSlotOrThrowForDuration(this), o = getRoundToOptionsObject(e);
|
|
3240
3207
|
let n = getTemporalUnitValuedOption(o, "largestUnit", void 0);
|
|
3241
|
-
const r = getTemporalRelativeToOption(o), a = getRoundingIncrementOption(o), i = getRoundingModeOption(o,
|
|
3208
|
+
const r = getTemporalRelativeToOption(o), a = getRoundingIncrementOption(o), i = getRoundingModeOption(o, P);
|
|
3242
3209
|
let c = getTemporalUnitValuedOption(o, "smallestUnit", void 0);
|
|
3243
|
-
validateTemporalUnitValue(c,
|
|
3210
|
+
validateTemporalUnitValue(c, l);
|
|
3244
3211
|
const s = void 0 !== c;
|
|
3245
|
-
c ??=
|
|
3246
|
-
const
|
|
3247
|
-
if (void 0 !== n && "auto" !== n || (n = m), (!s && !u || n > c) && throwRangeError(
|
|
3248
|
-
if (r.
|
|
3212
|
+
c ??= J;
|
|
3213
|
+
const d = defaultTemporalLargestUnit(t), m = largerOfTwoTemporalUnits(d, c), u = void 0 !== n;
|
|
3214
|
+
if (void 0 !== n && "auto" !== n || (n = m), (!s && !u || n > c) && throwRangeError(De), isDateUnit(c) || validateTemporalRoundingIncrement(a, maximumTemporalDurationRoundingIncrement(c), !1), a > 1 && n !== c && isDateUnit(c) && throwRangeError(De), r.be) return createTemporalDuration(temporalDurationFromInternal(differenceZonedDateTimeWithRounding(r.be, createZonedDateTimeSlot(addZonedDateTime(r.be, toInternalDurationRecord(t), D), r.be.P, r.be.Y), n, a, c, i), isDateUnit(n) ? H : n));
|
|
3215
|
+
if (r.Pe) {
|
|
3249
3216
|
const e = toInternalDurationRecordWith24HourDays(t), o = addTime(midnightTimeRecord(), e.p);
|
|
3250
|
-
return createTemporalDuration(temporalDurationFromInternal(differencePlainDateTimeWithRounding(combineIsoDateAndTimeRecord(r.
|
|
3217
|
+
return createTemporalDuration(temporalDurationFromInternal(differencePlainDateTimeWithRounding(combineIsoDateAndTimeRecord(r.Pe.o, midnightTimeRecord()), combineIsoDateAndTimeRecord(calendarDateAdd(r.Pe.Y, r.Pe.o, adjustDateDurationRecord(e.A, o.X), D), o), r.Pe.Y, n, a, c, i), n));
|
|
3251
3218
|
}
|
|
3252
|
-
(isCalendarUnit(
|
|
3219
|
+
(isCalendarUnit(d) || isCalendarUnit(n)) && throwRangeError(missingField("relativeTo"));
|
|
3253
3220
|
const T = toInternalDurationRecordWith24HourDays(t);
|
|
3254
|
-
return createTemporalDuration(temporalDurationFromInternal(c ===
|
|
3221
|
+
return createTemporalDuration(temporalDurationFromInternal(c === x ? combineDateAndTimeDuration(createDateDurationRecord(0, 0, 0, roundTimeDurationByDays(T.p, a, i)[0]), ye) : combineDateAndTimeDuration(zeroDateDuration(), roundTimeDuration(T.p, a, c, i)), n));
|
|
3255
3222
|
}
|
|
3256
3223
|
total(e) {
|
|
3257
3224
|
const t = getInternalSlotOrThrowForDuration(this);
|
|
3258
|
-
void 0 === e && throwTypeError(
|
|
3259
|
-
const o = "string" == typeof e ? createNullPrototypeObject({ unit: e }) : getOptionsObject(e), n = getTemporalRelativeToOption(o), r = getTemporalUnitValuedOption(o, "unit",
|
|
3260
|
-
if (validateTemporalUnitValue(r,
|
|
3261
|
-
if (n.
|
|
3225
|
+
void 0 === e && throwTypeError(Ie);
|
|
3226
|
+
const o = "string" == typeof e ? createNullPrototypeObject({ unit: e }) : getOptionsObject(e), n = getTemporalRelativeToOption(o), r = getTemporalUnitValuedOption(o, "unit", u);
|
|
3227
|
+
if (validateTemporalUnitValue(r, l), n.be) return ((e, t, o) => isDateUnit(o) ? totalRelativeDuration(differenceZonedDateTime(e, t, o), e.U, t.U, getIsoDateTimeForZonedDateTimeSlot(e), e.P, e.Y, o) : totalTimeDuration(timeDurationFromEpochNanosecondsDifference(t.U, e.U), o))(n.be, createZonedDateTimeSlot(addZonedDateTime(n.be, toInternalDurationRecord(t), D), n.be.P, n.be.Y), r);
|
|
3228
|
+
if (n.Pe) {
|
|
3262
3229
|
const e = toInternalDurationRecordWith24HourDays(t), o = addTime(midnightTimeRecord(), e.p);
|
|
3263
|
-
return ((e, t, o, n) => compareIsoDateTime(e, t) ? (validateIsoDateTime(e), validateIsoDateTime(t), totalRelativeDuration(differenceISODateTime(e, t, o, n), getUtcEpochNanoseconds(e), getUtcEpochNanoseconds(t), e, void 0, o, n)) : 0)(combineIsoDateAndTimeRecord(n.
|
|
3230
|
+
return ((e, t, o, n) => compareIsoDateTime(e, t) ? (validateIsoDateTime(e), validateIsoDateTime(t), totalRelativeDuration(differenceISODateTime(e, t, o, n), getUtcEpochNanoseconds(e), getUtcEpochNanoseconds(t), e, void 0, o, n)) : 0)(combineIsoDateAndTimeRecord(n.Pe.o, midnightTimeRecord()), combineIsoDateAndTimeRecord(calendarDateAdd(n.Pe.Y, n.Pe.o, adjustDateDurationRecord(e.A, o.X), D), o), n.Pe.Y, r);
|
|
3264
3231
|
}
|
|
3265
3232
|
return (isCalendarUnit(defaultTemporalLargestUnit(t)) || isCalendarUnit(r)) && throwRangeError(missingField("relativeTo")), totalTimeDuration(toInternalDurationRecordWith24HourDays(t).p, r);
|
|
3266
3233
|
}
|
|
3267
3234
|
toString(e = void 0) {
|
|
3268
|
-
const t = getInternalSlotOrThrowForDuration(this), o = getOptionsObject(e), n = getTemporalFractionalSecondDigitsOption(o), r = getRoundingModeOption(o,
|
|
3269
|
-
validateTemporalUnitValue(a,
|
|
3235
|
+
const t = getInternalSlotOrThrowForDuration(this), o = getOptionsObject(e), n = getTemporalFractionalSecondDigitsOption(o), r = getRoundingModeOption(o, E), a = getTemporalUnitValuedOption(o, "smallestUnit", void 0);
|
|
3236
|
+
validateTemporalUnitValue(a, s), a !== H && a !== q || throwRangeError(disallowedUnit(a));
|
|
3270
3237
|
const i = toSecondsStringPrecisionRecord(a, n);
|
|
3271
|
-
if (i.
|
|
3238
|
+
if (i.ve === J && 1 === i.Me) return temporalDurationToString(t, i.Ee);
|
|
3272
3239
|
const c = toInternalDurationRecord(t);
|
|
3273
|
-
return temporalDurationToString(temporalDurationFromInternal(combineDateAndTimeDuration(c.A, roundTimeDuration(c.p, i.
|
|
3240
|
+
return temporalDurationToString(temporalDurationFromInternal(combineDateAndTimeDuration(c.A, roundTimeDuration(c.p, i.Me, i.ve, r)), largerOfTwoTemporalUnits(defaultTemporalLargestUnit(t), B)), i.Ee);
|
|
3274
3241
|
}
|
|
3275
3242
|
toJSON() {
|
|
3276
3243
|
return temporalDurationToString(getInternalSlotOrThrowForDuration(this));
|
|
3277
3244
|
}
|
|
3278
3245
|
toLocaleString(e = void 0, t = void 0) {
|
|
3279
3246
|
const o = getInternalSlotOrThrowForDuration(this), n = createNullPrototypeObject();
|
|
3280
|
-
return
|
|
3247
|
+
return ie.map((e, t) => {
|
|
3281
3248
|
n[e] = o[t];
|
|
3282
3249
|
}), new Intl.DurationFormat(e, t).format(n);
|
|
3283
3250
|
}
|
|
3284
3251
|
valueOf() {
|
|
3285
|
-
throwTypeError(
|
|
3252
|
+
throwTypeError(fe);
|
|
3286
3253
|
}
|
|
3287
3254
|
};
|
|
3288
3255
|
defineStringTag(vt.prototype, "Temporal.Duration"), renameFunction(vt, "Duration");
|
|
3289
3256
|
const Et = {
|
|
3290
|
-
[
|
|
3291
|
-
[
|
|
3292
|
-
[
|
|
3293
|
-
[
|
|
3294
|
-
[
|
|
3295
|
-
[
|
|
3296
|
-
[
|
|
3297
|
-
[
|
|
3298
|
-
[
|
|
3257
|
+
[y]: Math.ceil,
|
|
3258
|
+
[w]: Math.floor,
|
|
3259
|
+
[v]: roundExpand,
|
|
3260
|
+
[E]: Math.trunc,
|
|
3261
|
+
[M]: roundHalfCeil,
|
|
3262
|
+
[b]: roundHalfFloor,
|
|
3263
|
+
[P]: (e) => (isIntegerAndHalf(e) ? roundExpand(e) : Math.round(e)) + 0,
|
|
3264
|
+
[R]: (e) => (isIntegerAndHalf(e) ? Math.trunc(e) : Math.round(e)) + 0,
|
|
3265
|
+
[N]: roundHalfEven
|
|
3299
3266
|
}, Mt = {
|
|
3300
|
-
[
|
|
3301
|
-
[
|
|
3302
|
-
[
|
|
3303
|
-
[
|
|
3304
|
-
[
|
|
3305
|
-
[
|
|
3306
|
-
[
|
|
3307
|
-
[
|
|
3308
|
-
[
|
|
3267
|
+
[y]: Math.ceil,
|
|
3268
|
+
[w]: Math.floor,
|
|
3269
|
+
[v]: Math.ceil,
|
|
3270
|
+
[E]: Math.floor,
|
|
3271
|
+
[M]: roundHalfCeil,
|
|
3272
|
+
[b]: roundHalfFloor,
|
|
3273
|
+
[P]: roundHalfCeil,
|
|
3274
|
+
[R]: roundHalfFloor,
|
|
3275
|
+
[N]: roundHalfEven
|
|
3309
3276
|
}, bt = globalThis.Intl.DateTimeFormat, Pt = /* @__PURE__ */ new WeakMap(), Rt = [
|
|
3310
3277
|
"year",
|
|
3311
3278
|
"month",
|
|
@@ -3321,15 +3288,15 @@ const Et = {
|
|
|
3321
3288
|
"timeStyle"
|
|
3322
3289
|
];
|
|
3323
3290
|
var Zt = class {
|
|
3324
|
-
|
|
3291
|
+
ke(e) {
|
|
3325
3292
|
return formatDateTime(this, e);
|
|
3326
3293
|
}
|
|
3327
3294
|
}, $t = class {
|
|
3328
3295
|
constructor(e, t) {
|
|
3329
|
-
createDateTimeFormat(e, t,
|
|
3296
|
+
createDateTimeFormat(e, t, l, void 0, this);
|
|
3330
3297
|
}
|
|
3331
3298
|
get format() {
|
|
3332
|
-
return Object.defineProperty(getInternalSlotOrThrowForDateTimeFormat(this).
|
|
3299
|
+
return Object.defineProperty(getInternalSlotOrThrowForDateTimeFormat(this).Le ||= Zt.prototype.ke.bind(this), "name", { value: "" });
|
|
3333
3300
|
}
|
|
3334
3301
|
formatToParts(e) {
|
|
3335
3302
|
return ((e, t) => {
|
|
@@ -3338,7 +3305,7 @@ var Zt = class {
|
|
|
3338
3305
|
})(this, e);
|
|
3339
3306
|
}
|
|
3340
3307
|
formatRange(e, t) {
|
|
3341
|
-
return void 0 !== e && void 0 !== t || throwTypeError(
|
|
3308
|
+
return void 0 !== e && void 0 !== t || throwTypeError(pe), ((e, t, o) => {
|
|
3342
3309
|
const n = getInternalSlotOrThrowForDateTimeFormat(e);
|
|
3343
3310
|
validateSameTemporalType(t, o);
|
|
3344
3311
|
const [r, a] = handleDateTimeValue(n, t);
|
|
@@ -3346,7 +3313,7 @@ var Zt = class {
|
|
|
3346
3313
|
})(this, toDateTimeFormattable(e), toDateTimeFormattable(t));
|
|
3347
3314
|
}
|
|
3348
3315
|
formatRangeToParts(e, t) {
|
|
3349
|
-
return void 0 !== e && void 0 !== t || throwTypeError(
|
|
3316
|
+
return void 0 !== e && void 0 !== t || throwTypeError(pe), ((e, t, o) => {
|
|
3350
3317
|
const n = getInternalSlotOrThrowForDateTimeFormat(e);
|
|
3351
3318
|
validateSameTemporalType(t, o);
|
|
3352
3319
|
const [r, a] = handleDateTimeValue(n, t);
|
|
@@ -3354,7 +3321,7 @@ var Zt = class {
|
|
|
3354
3321
|
})(this, toDateTimeFormattable(e), toDateTimeFormattable(t));
|
|
3355
3322
|
}
|
|
3356
3323
|
resolvedOptions() {
|
|
3357
|
-
return getInternalSlotOrThrowForDateTimeFormat(this).
|
|
3324
|
+
return getInternalSlotOrThrowForDateTimeFormat(this).Re.resolvedOptions();
|
|
3358
3325
|
}
|
|
3359
3326
|
};
|
|
3360
3327
|
const Ct = Object.getOwnPropertyDescriptors(bt), Yt = $t.prototype;
|
|
@@ -3397,26 +3364,26 @@ var jt = class {
|
|
|
3397
3364
|
return differenceTemporalInstant(-1, getInternalSlotOrThrowForInstant(this), e, t);
|
|
3398
3365
|
}
|
|
3399
3366
|
round(e) {
|
|
3400
|
-
const t = getInternalSlotOrThrowForInstant(this), o = getRoundToOptionsObject(e), n = getRoundingIncrementOption(o), r = getRoundingModeOption(o,
|
|
3401
|
-
return validateTemporalUnitValue(
|
|
3367
|
+
const t = getInternalSlotOrThrowForInstant(this), o = getRoundToOptionsObject(e), n = getRoundingIncrementOption(o), r = getRoundingModeOption(o, P), i = getTemporalUnitValuedOption(o, "smallestUnit", u);
|
|
3368
|
+
return validateTemporalUnitValue(i, s), validateTemporalRoundingIncrement(n, a / nanosecondsForTimeUnit(i), !0), createTemporalInstant(roundTemporalInstant(t.U, n, i, r));
|
|
3402
3369
|
}
|
|
3403
3370
|
equals(e) {
|
|
3404
3371
|
return !compareEpochNanoseconds(getInternalSlotOrThrowForInstant(this).U, getInternalSlotOrThrowForInstant(toTemporalInstant$1(e)).U);
|
|
3405
3372
|
}
|
|
3406
3373
|
toString(e = void 0) {
|
|
3407
|
-
const t = getInternalSlotOrThrowForInstant(this), o = getOptionsObject(e), n = getTemporalFractionalSecondDigitsOption(o), r = getRoundingModeOption(o,
|
|
3408
|
-
validateTemporalUnitValue(a,
|
|
3409
|
-
const c = mapUnlessUndefined(i, toTemporalTimeZoneIdentifier),
|
|
3410
|
-
return temporalInstantToString(roundTemporalInstant(t.U,
|
|
3374
|
+
const t = getInternalSlotOrThrowForInstant(this), o = getOptionsObject(e), n = getTemporalFractionalSecondDigitsOption(o), r = getRoundingModeOption(o, E), a = getTemporalUnitValuedOption(o, "smallestUnit", void 0), i = o.timeZone;
|
|
3375
|
+
validateTemporalUnitValue(a, s), a === H && throwRangeError(invalidField("smallestUnit"));
|
|
3376
|
+
const c = mapUnlessUndefined(i, toTemporalTimeZoneIdentifier), l = toSecondsStringPrecisionRecord(a, n);
|
|
3377
|
+
return temporalInstantToString(roundTemporalInstant(t.U, l.Me, l.ve, r), c, l.Ee);
|
|
3411
3378
|
}
|
|
3412
3379
|
toLocaleString(e = void 0, t = void 0) {
|
|
3413
|
-
return getInternalSlotOrThrowForInstant(this), formatDateTime(createDateTimeFormat(e, t,
|
|
3380
|
+
return getInternalSlotOrThrowForInstant(this), formatDateTime(createDateTimeFormat(e, t, l), this);
|
|
3414
3381
|
}
|
|
3415
3382
|
toJSON() {
|
|
3416
3383
|
return temporalInstantToString(getInternalSlotOrThrowForInstant(this).U);
|
|
3417
3384
|
}
|
|
3418
3385
|
valueOf() {
|
|
3419
|
-
throwTypeError(
|
|
3386
|
+
throwTypeError(fe);
|
|
3420
3387
|
}
|
|
3421
3388
|
toZonedDateTimeISO(e) {
|
|
3422
3389
|
return createTemporalZonedDateTime(getInternalSlotOrThrowForInstant(this).U, toTemporalTimeZoneIdentifier(e), "iso8601");
|