temporal-polyfill-lite 0.4.2 → 1.0.0
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 +41 -24
- package/README.md +1 -1
- package/dist/calendars/global.js +1 -1
- package/dist/calendars/index.js +1 -2
- package/dist/calendars/shim.js +1 -1
- package/dist/calendars/{src-Bu0ZLzZY.js → src-CLej0F_-.js} +358 -377
- package/dist/global.js +1 -1
- package/dist/index.js +1 -2
- package/dist/shim.js +1 -1
- package/dist/{src-C0TzYU7p.js → src-DYpWRzuf.js} +356 -374
- package/package.json +1 -1
|
@@ -26,7 +26,7 @@ function getNameFromUnit(e) {
|
|
|
26
26
|
return y[e];
|
|
27
27
|
}
|
|
28
28
|
function nanosecondsForTimeUnit(e) {
|
|
29
|
-
return
|
|
29
|
+
return E[e - 3];
|
|
30
30
|
}
|
|
31
31
|
function mapUnlessUndefined(e, t) {
|
|
32
32
|
return void 0 === e ? void 0 : t(e);
|
|
@@ -49,7 +49,7 @@ function getInternalSlotOrThrowForDurationFormat(e) {
|
|
|
49
49
|
}
|
|
50
50
|
function durationRecordToDurationLikeObject(e) {
|
|
51
51
|
const t = createNullPrototypeObject();
|
|
52
|
-
return
|
|
52
|
+
return P.map((o, n) => {
|
|
53
53
|
t[o] = e[n];
|
|
54
54
|
}), t;
|
|
55
55
|
}
|
|
@@ -85,7 +85,7 @@ function getOptionsObject(e = createNullPrototypeObject()) {
|
|
|
85
85
|
}
|
|
86
86
|
function getOption(e, t, o, n) {
|
|
87
87
|
const r = e[t];
|
|
88
|
-
if (void 0 === r) return n ===
|
|
88
|
+
if (void 0 === r) return n === q && throwRangeError(missingField(t)), n;
|
|
89
89
|
const a = toString(r);
|
|
90
90
|
return o.includes(a) || throwRangeError(invalidField(t)), a;
|
|
91
91
|
}
|
|
@@ -176,7 +176,7 @@ function negateTimeDuration(e) {
|
|
|
176
176
|
return normalize(-e[0], -e[1]);
|
|
177
177
|
}
|
|
178
178
|
function signTimeDuration(e) {
|
|
179
|
-
return
|
|
179
|
+
return Pe(e, ye);
|
|
180
180
|
}
|
|
181
181
|
function timeDurationToSubsecondsNumber(e, t, o) {
|
|
182
182
|
const n = signTimeDuration(e);
|
|
@@ -194,7 +194,7 @@ function interpretISODateTimeOffset(e, t, o, n, r, a, i, l) {
|
|
|
194
194
|
if (o === ne || o === te && "ignore" == i) return getEpochNanosecondsFor(r, c, a);
|
|
195
195
|
if (o === oe || o === te && "use" == i) return validateEpochNanoseconds(getUtcEpochNanoseconds(balanceIsoDateTime(c.o.t, c.o.u, c.o.T, c.p.D, c.p.I, c.p.O, c.p.F, c.p.S, c.p.v - n)));
|
|
196
196
|
((e) => {
|
|
197
|
-
Math.abs(isoDateToEpochDays(e.t, e.u - 1, e.T)) > 1e8 && throwRangeError(
|
|
197
|
+
Math.abs(isoDateToEpochDays(e.t, e.u - 1, e.T)) > 1e8 && throwRangeError(R);
|
|
198
198
|
})(e);
|
|
199
199
|
const s = getPossibleEpochNanoseconds(r, c);
|
|
200
200
|
for (const e of s) {
|
|
@@ -213,19 +213,19 @@ function toTemporalZonedDateTime(e, t) {
|
|
|
213
213
|
}
|
|
214
214
|
i = getTemporalCalendarIdentifierWithIsoDefault(e);
|
|
215
215
|
const s = prepareCalendarFields(i, e, [
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
], [
|
|
216
|
+
ht.t,
|
|
217
|
+
ht.u,
|
|
218
|
+
ht.P,
|
|
219
|
+
ht.T,
|
|
220
|
+
ht.D,
|
|
221
|
+
ht.I,
|
|
222
|
+
ht.O,
|
|
223
|
+
ht.F,
|
|
224
|
+
ht.S,
|
|
225
|
+
ht.v,
|
|
226
|
+
ht.R,
|
|
227
|
+
ht.Z
|
|
228
|
+
], [ht.Z]);
|
|
229
229
|
o = s.timeZone, n = s.offset;
|
|
230
230
|
const d = getOptionsObject(t);
|
|
231
231
|
r = getTemporalDisambiguationOption(d), a = getTemporalOffsetOption(d, X);
|
|
@@ -233,7 +233,7 @@ function toTemporalZonedDateTime(e, t) {
|
|
|
233
233
|
l = m.o, c = m.p;
|
|
234
234
|
} else {
|
|
235
235
|
validateString(e);
|
|
236
|
-
const m = parseIsoDateTime(e, [
|
|
236
|
+
const m = parseIsoDateTime(e, [et]);
|
|
237
237
|
o = toTemporalTimeZoneIdentifier(m.Z.$), n = m.Z.N, s = m.Z.M, i = canonicalizeCalendar(m.U || "iso8601"), d = !1, n && (d = hasUtcOffsetSubMinuteParts(n));
|
|
238
238
|
const u = getOptionsObject(t);
|
|
239
239
|
r = getTemporalDisambiguationOption(u), a = getTemporalOffsetOption(u, X), getTemporalOverflowOption(u), l = createIsoDateRecord(m.t, m.u, m.T), c = m.p;
|
|
@@ -242,7 +242,7 @@ function toTemporalZonedDateTime(e, t) {
|
|
|
242
242
|
return createZonedDateTimeSlot(interpretISODateTimeOffset(l, c, m, m === te ? parseDateTimeUtcOffset(n) : 0, o, r, a, d), o, i);
|
|
243
243
|
}
|
|
244
244
|
function createTemporalZonedDateTime(e, t, o, n) {
|
|
245
|
-
return createTemporalZonedDateTimeFromSlot(createZonedDateTimeSlot(e, t, o, ((e, t) =>
|
|
245
|
+
return createTemporalZonedDateTimeFromSlot(createZonedDateTimeSlot(e, t, o, ((e, t) => Ne[e] && Ne[e].C(clampEpochSecond(t)))(t, epochSeconds(e))), n);
|
|
246
246
|
}
|
|
247
247
|
function createZonedDateTimeSlot(e, t, o, n) {
|
|
248
248
|
return {
|
|
@@ -267,7 +267,7 @@ function differenceZonedDateTime(e, t, o) {
|
|
|
267
267
|
const r = getIsoDateTimeForZonedDateTimeSlot(e), a = getIsoDateTimeForZonedDateTimeSlot(t);
|
|
268
268
|
if (!compareIsoDate(r.o, a.o)) return combineDateAndTimeDuration(zeroDateDuration(), timeDurationFromEpochNanosecondsDifference(t.Y, e.Y));
|
|
269
269
|
let i, l = differenceTime(r.p, a.p);
|
|
270
|
-
for (let o =
|
|
270
|
+
for (let o = Ot(l) === n ? 1 : 0; o <= (3 - n) / 2 && (i = combineIsoDateAndTimeRecord(addDaysToIsoDate(a.o, o * n), r.p), l = timeDurationFromEpochNanosecondsDifference(t.Y, getEpochNanosecondsFor(e.Z, i, G)), Ot(l) === n); o++);
|
|
271
271
|
return combineDateAndTimeDuration(calendarDateUntil(e.U, r.o, i.o, largerOfTwoTemporalUnits(o, d)), l);
|
|
272
272
|
}
|
|
273
273
|
function differenceZonedDateTimeWithRounding(e, t, o, n, r, a) {
|
|
@@ -279,7 +279,7 @@ function differenceTemporalZonedDateTime(e, t, o, n) {
|
|
|
279
279
|
const r = toTemporalZonedDateTime(o);
|
|
280
280
|
calendarEquals(t.U, r.U) || throwRangeError(M);
|
|
281
281
|
const a = getDifferenceSettings(e, getOptionsObject(n), H, [], D, m);
|
|
282
|
-
return isDateUnit(a.V) ? (timeZoneEquals(t.Z, r.Z) || throwRangeError("time zone mismatch"), compareEpochNanoseconds(t.Y, r.Y) ? createTemporalDuration(applySignToDurationSlot(temporalDurationFromInternal(differenceZonedDateTimeWithRounding(t, r, a.V, a.L, a.H, a.
|
|
282
|
+
return isDateUnit(a.V) ? (timeZoneEquals(t.Z, r.Z) || throwRangeError("time zone mismatch"), compareEpochNanoseconds(t.Y, r.Y) ? createTemporalDuration(applySignToDurationSlot(temporalDurationFromInternal(differenceZonedDateTimeWithRounding(t, r, a.V, a.L, a.H, a.B), m), e)) : createTemporalDuration(createTemporalDurationSlot([
|
|
283
283
|
0,
|
|
284
284
|
0,
|
|
285
285
|
0,
|
|
@@ -290,7 +290,7 @@ function differenceTemporalZonedDateTime(e, t, o, n) {
|
|
|
290
290
|
0,
|
|
291
291
|
0,
|
|
292
292
|
0
|
|
293
|
-
]))) : createTemporalDuration(applySignToDurationSlot(temporalDurationFromInternal(differenceInstant(t.Y, r.Y, a.L, a.H, a.
|
|
293
|
+
]))) : createTemporalDuration(applySignToDurationSlot(temporalDurationFromInternal(differenceInstant(t.Y, r.Y, a.L, a.H, a.B), a.V), e));
|
|
294
294
|
}
|
|
295
295
|
function addDurationToZonedDateTime(e, t, o, n) {
|
|
296
296
|
return createTemporalZonedDateTime(addZonedDateTime(t, toInternalDurationRecord(applySignToDurationSlot(toTemporalDuration(o), e)), getTemporalOverflowOption(getOptionsObject(n))), t.Z, t.U);
|
|
@@ -301,17 +301,17 @@ function getOffsetNanosecondsForZonedDateTimeSlot(e) {
|
|
|
301
301
|
function getIsoDateTimeForZonedDateTimeSlot(e) {
|
|
302
302
|
return getIsoDateTimeFromOffsetNanoseconds(e.Y, getOffsetNanosecondsForZonedDateTimeSlot(e));
|
|
303
303
|
}
|
|
304
|
-
function createTemporalZonedDateTimeFromSlot(e, t = Object.create(
|
|
305
|
-
return
|
|
304
|
+
function createTemporalZonedDateTimeFromSlot(e, t = Object.create(be.prototype)) {
|
|
305
|
+
return Ee.set(t, e), t;
|
|
306
306
|
}
|
|
307
307
|
function calendarIsoToDateForZonedDateTimeSlot(e) {
|
|
308
308
|
return calendarIsoToDate(e.U, getIsoDateTimeForZonedDateTimeSlot(e).o);
|
|
309
309
|
}
|
|
310
310
|
function getInternalSlotForZonedDateTime(e) {
|
|
311
|
-
return
|
|
311
|
+
return Ee.get(e);
|
|
312
312
|
}
|
|
313
313
|
function getInternalSlotOrThrowForZonedDateTime(e) {
|
|
314
|
-
return getInternalSlotOrThrow(
|
|
314
|
+
return getInternalSlotOrThrow(Ee, e);
|
|
315
315
|
}
|
|
316
316
|
function isZonedDateTime(e) {
|
|
317
317
|
return !!getInternalSlotForZonedDateTime(e);
|
|
@@ -320,20 +320,20 @@ function utcEpochMilliseconds(e, t, o, n = 0, a = 0, i = 0, l = 0) {
|
|
|
320
320
|
return isoDateToEpochDays(e, t - 1, o) * r + Date.UTC(1970, 0, 1, n, a, i, l);
|
|
321
321
|
}
|
|
322
322
|
function clampEpochSecond(e) {
|
|
323
|
-
return clamp(e, -1e10,
|
|
323
|
+
return clamp(e, -1e10, 1 / 0);
|
|
324
324
|
}
|
|
325
325
|
function getNamedTimeZoneOffsetNanosecondsForEpochSecond(t, o, n) {
|
|
326
326
|
if ("UTC" === t) return 0;
|
|
327
|
-
const r = clampEpochSecond(o), a =
|
|
327
|
+
const r = clampEpochSecond(o), a = Ne[t] ||= (function() {
|
|
328
328
|
const e = /* @__PURE__ */ new Map();
|
|
329
329
|
return {
|
|
330
330
|
C(t) {
|
|
331
331
|
const o = e.get(t);
|
|
332
332
|
if (void 0 !== o) return e.delete(t), e.set(t, o), o;
|
|
333
333
|
},
|
|
334
|
-
|
|
334
|
+
q: (t, o) => (e.size >= 5e3 && e.delete(e.keys().next().value), e.set(t, o), o),
|
|
335
335
|
J(e, t) {
|
|
336
|
-
return this.C(e) ?? this.
|
|
336
|
+
return this.C(e) ?? this.q(e, t());
|
|
337
337
|
}
|
|
338
338
|
};
|
|
339
339
|
})(), i = a.C(r);
|
|
@@ -346,10 +346,10 @@ function getNamedTimeZoneOffsetNanosecondsForEpochSecond(t, o, n) {
|
|
|
346
346
|
"minute",
|
|
347
347
|
"second"
|
|
348
348
|
].map((e) => toIntegerIfIntegral(l.find((t) => t.type === e).value))) - 1e3 * r) * e;
|
|
349
|
-
return n || a.
|
|
349
|
+
return n || a.q(r, c), c;
|
|
350
350
|
}
|
|
351
351
|
function getFormatterForTimeZone(e) {
|
|
352
|
-
return
|
|
352
|
+
return Ze[e] ||= new vt("en-u-hc-h23", {
|
|
353
353
|
timeZone: e,
|
|
354
354
|
year: "numeric",
|
|
355
355
|
month: "numeric",
|
|
@@ -400,12 +400,12 @@ function toTemporalTimeZoneIdentifier(e) {
|
|
|
400
400
|
const t = ((e) => {
|
|
401
401
|
if (isTimeZoneIdentifier(e)) return parseTimeZoneIdentifier(e);
|
|
402
402
|
const t = parseIsoDateTime(e, [
|
|
403
|
-
Qe,
|
|
404
403
|
et,
|
|
405
404
|
tt,
|
|
406
405
|
ot,
|
|
407
406
|
nt,
|
|
408
|
-
rt
|
|
407
|
+
rt,
|
|
408
|
+
at
|
|
409
409
|
]).Z, o = t.$ || t.M && "UTC" || t.N;
|
|
410
410
|
return o || throwRangeError(invalidTimeZone(e)), parseTimeZoneIdentifier(o);
|
|
411
411
|
})(e);
|
|
@@ -428,7 +428,7 @@ function getStartOfDay(e, t) {
|
|
|
428
428
|
return getPossibleEpochNanoseconds(e, o)[0] || createEpochNanosecondsFromEpochSeconds(bisectOffsetTransition(e, ...getNamedTimeZoneEpochCandidates(e, o).map(epochSeconds)));
|
|
429
429
|
}
|
|
430
430
|
function timeZoneEquals(e, t) {
|
|
431
|
-
return e === t || !isOffsetTimeZoneIdentifier(e) && !isOffsetTimeZoneIdentifier(t) && getFormatterForTimeZone(e).resolvedOptions().timeZone === getFormatterForTimeZone(t).resolvedOptions().timeZone;
|
|
431
|
+
return e === t || !isOffsetTimeZoneIdentifier(e) && !isOffsetTimeZoneIdentifier(t) && (Re ? new Re.ZonedDateTime(BigInt(0), e).equals(new Re.ZonedDateTime(BigInt(0), t)) : getFormatterForTimeZone(e).resolvedOptions().timeZone === getFormatterForTimeZone(t).resolvedOptions().timeZone);
|
|
432
432
|
}
|
|
433
433
|
function parseTimeZoneIdentifier(e) {
|
|
434
434
|
return isTimeZoneIdentifier(e) || throwRangeError(invalidTimeZone(e)), createNullPrototypeObject(isOffsetTimeZoneIdentifier(e) ? { G: parseDateTimeUtcOffset(e) / t } : { _: e });
|
|
@@ -443,10 +443,8 @@ function getNamedTimeZoneEpochCandidates(e, t) {
|
|
|
443
443
|
return n === r ? [a] : [a, i].sort(compareEpochNanoseconds);
|
|
444
444
|
}
|
|
445
445
|
function getIsoDateTimeFromOffsetNanoseconds(e, t) {
|
|
446
|
-
return ((e)
|
|
447
|
-
|
|
448
|
-
return combineIsoDateAndTimeRecord(epochDaysToIsoDate(t[0]), balanceTime(0, 0, 0, 0, 0, t[1]));
|
|
449
|
-
})(addNanosecondsToEpochSeconds(e, t));
|
|
446
|
+
return combineIsoDateAndTimeRecord(epochDaysToIsoDate((o = addNanosecondsToEpochSeconds(e, t))[0]), balanceTime(0, 0, 0, 0, 0, o[1]));
|
|
447
|
+
var o;
|
|
450
448
|
}
|
|
451
449
|
function combineIsoDateAndTimeRecord(e, t) {
|
|
452
450
|
return {
|
|
@@ -455,7 +453,7 @@ function combineIsoDateAndTimeRecord(e, t) {
|
|
|
455
453
|
};
|
|
456
454
|
}
|
|
457
455
|
function interpretTemporalDateTimeFields(e, t, o) {
|
|
458
|
-
return combineIsoDateAndTimeRecord(calendarDateFromFields(e, t, o), regulateTime(t[
|
|
456
|
+
return combineIsoDateAndTimeRecord(calendarDateFromFields(e, t, o), regulateTime(t[ht.D], t[ht.I], t[ht.O], t[ht.F], t[ht.S], t[ht.v], o));
|
|
459
457
|
}
|
|
460
458
|
function toTemporalDateTime(e, t) {
|
|
461
459
|
if (isObject(e)) {
|
|
@@ -475,28 +473,28 @@ function toTemporalDateTime(e, t) {
|
|
|
475
473
|
}
|
|
476
474
|
const o = getTemporalCalendarIdentifierWithIsoDefault(e);
|
|
477
475
|
return createTemporalDateTime(interpretTemporalDateTimeFields(o, prepareCalendarFields(o, e, [
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
476
|
+
ht.t,
|
|
477
|
+
ht.u,
|
|
478
|
+
ht.P,
|
|
479
|
+
ht.T,
|
|
480
|
+
ht.D,
|
|
481
|
+
ht.I,
|
|
482
|
+
ht.O,
|
|
483
|
+
ht.F,
|
|
484
|
+
ht.S,
|
|
485
|
+
ht.v
|
|
488
486
|
], []), getTemporalOverflowOption(getOptionsObject(t))), o);
|
|
489
487
|
}
|
|
490
488
|
validateString(e);
|
|
491
|
-
const o = parseIsoDateTime(e, [
|
|
489
|
+
const o = parseIsoDateTime(e, [tt]), n = canonicalizeCalendar(o.U || "iso8601");
|
|
492
490
|
return getTemporalOverflowOption(getOptionsObject(t)), createTemporalDateTime(combineIsoDateAndTimeRecord(createIsoDateRecord(o.t, o.u, o.T), o.p || midnightTimeRecord()), n);
|
|
493
491
|
}
|
|
494
492
|
function balanceIsoDateTime(e, t, o, n, r, a, i, l, c) {
|
|
495
493
|
const s = balanceTime(n, r, a, i, l, c);
|
|
496
494
|
return combineIsoDateAndTimeRecord(addDaysToIsoDate(createIsoDateRecord(e, t, o), s.X), s);
|
|
497
495
|
}
|
|
498
|
-
function createTemporalDateTime(e, t, o = Object.create(
|
|
499
|
-
return
|
|
496
|
+
function createTemporalDateTime(e, t, o = Object.create(Ue.prototype)) {
|
|
497
|
+
return Me.set(o, {
|
|
500
498
|
K: validateIsoDateTime(e),
|
|
501
499
|
U: t
|
|
502
500
|
}), o;
|
|
@@ -513,7 +511,7 @@ function roundIsoDateTime(e, t, o, n) {
|
|
|
513
511
|
}
|
|
514
512
|
function differenceISODateTime(e, t, o, n) {
|
|
515
513
|
let r = differenceTime(e.p, t.p);
|
|
516
|
-
const a =
|
|
514
|
+
const a = Ot(r);
|
|
517
515
|
let i = t.o;
|
|
518
516
|
a === compareIsoDate(e.o, t.o) && (i = addDaysToIsoDate(i, a), r = add24HourDaysToTimeDuration(r, -a));
|
|
519
517
|
const l = largerOfTwoTemporalUnits(d, n), c = calendarDateUntil(o, e.o, i, l);
|
|
@@ -529,7 +527,7 @@ function differenceTemporalPlainDateTime(e, t, o, n) {
|
|
|
529
527
|
const r = getInternalSlotOrThrowForPlainDateTime(toTemporalDateTime(o));
|
|
530
528
|
calendarEquals(t.U, r.U) || throwRangeError(M);
|
|
531
529
|
const a = getDifferenceSettings(e, getOptionsObject(n), H, [], D, d);
|
|
532
|
-
return compareIsoDateTime(t.K, r.K) ? createTemporalDuration(applySignToDurationSlot(temporalDurationFromInternal(differencePlainDateTimeWithRounding(t.K, r.K, t.U, a.V, a.L, a.H, a.
|
|
530
|
+
return compareIsoDateTime(t.K, r.K) ? createTemporalDuration(applySignToDurationSlot(temporalDurationFromInternal(differencePlainDateTimeWithRounding(t.K, r.K, t.U, a.V, a.L, a.H, a.B), a.V), e)) : createTemporalDuration(createTemporalDurationSlot([
|
|
533
531
|
0,
|
|
534
532
|
0,
|
|
535
533
|
0,
|
|
@@ -550,13 +548,13 @@ function validateIsoDateTime(e) {
|
|
|
550
548
|
return ((e) => {
|
|
551
549
|
const t = isoDateRecordToEpochDays(e.o);
|
|
552
550
|
return Math.abs(t) <= 1e8 || -100000001 === t && !!compareTimeRecord(e.p, midnightTimeRecord());
|
|
553
|
-
})(e) || throwRangeError(
|
|
551
|
+
})(e) || throwRangeError(R), e;
|
|
554
552
|
}
|
|
555
553
|
function getInternalSlotForPlainDateTime(e) {
|
|
556
|
-
return
|
|
554
|
+
return Me.get(e);
|
|
557
555
|
}
|
|
558
556
|
function getInternalSlotOrThrowForPlainDateTime(e) {
|
|
559
|
-
return getInternalSlotOrThrow(
|
|
557
|
+
return getInternalSlotOrThrow(Me, e);
|
|
560
558
|
}
|
|
561
559
|
function isPlainDateTime(e) {
|
|
562
560
|
return !!getInternalSlotForPlainDateTime(e);
|
|
@@ -566,7 +564,7 @@ function calendarDateForPlainDateTime(e) {
|
|
|
566
564
|
return calendarIsoToDate(t.U, t.K.o);
|
|
567
565
|
}
|
|
568
566
|
function createTimeRecord(e, t, o, n, r, a, i = 0) {
|
|
569
|
-
return {
|
|
567
|
+
return ((e, t, o, n, r, a) => isWithin(e, 0, 23) && isWithin(t, 0, 59) && isWithin(o, 0, 59) && isWithin(n, 0, 999) && isWithin(r, 0, 999) && isWithin(a, 0, 999))(e, t, o, n, r, a) || throwRangeError(b), {
|
|
570
568
|
D: e,
|
|
571
569
|
I: t,
|
|
572
570
|
O: o,
|
|
@@ -585,17 +583,14 @@ function differenceTime(e, t) {
|
|
|
585
583
|
function toTemporalTime(e, t) {
|
|
586
584
|
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)));
|
|
587
585
|
validateString(e);
|
|
588
|
-
const o = parseIsoDateTime(e, [
|
|
586
|
+
const o = parseIsoDateTime(e, [nt]);
|
|
589
587
|
return getTemporalOverflowOption(getOptionsObject(t)), o.p;
|
|
590
588
|
}
|
|
591
589
|
function toTimeRecordOrMidnight(e) {
|
|
592
590
|
return void 0 === e ? midnightTimeRecord() : toTemporalTime(e);
|
|
593
591
|
}
|
|
594
592
|
function regulateTime(e, t, o, n, r, a, i) {
|
|
595
|
-
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)) :
|
|
596
|
-
}
|
|
597
|
-
function isValidTime(e, t, o, n, r, a) {
|
|
598
|
-
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);
|
|
593
|
+
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)) : createTimeRecord(e, t, o, n, r, a);
|
|
599
594
|
}
|
|
600
595
|
function balanceTime(e, t, o, n, r, a) {
|
|
601
596
|
return r += divFloor(a, 1e3), n += divFloor(r, 1e3), o += divFloor(n, 1e3), t += divFloor(o, 60), {
|
|
@@ -608,30 +603,26 @@ function balanceTime(e, t, o, n, r, a) {
|
|
|
608
603
|
X: divFloor(e, 24)
|
|
609
604
|
};
|
|
610
605
|
}
|
|
611
|
-
function createTemporalTime(e, t = Object.create(
|
|
612
|
-
return
|
|
606
|
+
function createTemporalTime(e, t = Object.create($e.prototype)) {
|
|
607
|
+
return je.set(t, e), t;
|
|
613
608
|
}
|
|
614
609
|
function toTemporalTimeRecord(e, t = !1) {
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
const r = e[n];
|
|
625
|
-
return void 0 !== r ? (o = !0, toIntegerWithTruncation(r)) : t ? void 0 : 0;
|
|
626
|
-
});
|
|
627
|
-
return o || throwTypeError(C), [
|
|
610
|
+
const o = [
|
|
611
|
+
ht.D,
|
|
612
|
+
ht.S,
|
|
613
|
+
ht.F,
|
|
614
|
+
ht.I,
|
|
615
|
+
ht.v,
|
|
616
|
+
ht.O
|
|
617
|
+
].map((t) => mapUnlessUndefined(e[t], toIntegerWithTruncation));
|
|
618
|
+
return o.some((e) => void 0 !== e) || throwTypeError(C), [
|
|
628
619
|
0,
|
|
629
620
|
3,
|
|
630
621
|
5,
|
|
631
622
|
2,
|
|
632
623
|
1,
|
|
633
624
|
4
|
|
634
|
-
].map((e) =>
|
|
625
|
+
].map((e) => t ? o[e] : o[e] || 0);
|
|
635
626
|
}
|
|
636
627
|
function timeRecordToString(e, t) {
|
|
637
628
|
return formatTimeString(e.D, e.I, e.O, 1e6 * e.F + 1e3 * e.S + e.v, t);
|
|
@@ -640,8 +631,8 @@ function compareTimeRecord(e, t) {
|
|
|
640
631
|
return compare(e.D, t.D) || compare(e.I, t.I) || compare(e.O, t.O) || compare(e.F, t.F) || compare(e.S, t.S) || compare(e.v, t.v);
|
|
641
632
|
}
|
|
642
633
|
function addTime(e, t) {
|
|
643
|
-
const o =
|
|
644
|
-
return
|
|
634
|
+
const o = balanceTime(e.D, e.I, e.O, e.F, e.S, e.v + t[1]);
|
|
635
|
+
return o.X += t[0], o;
|
|
645
636
|
}
|
|
646
637
|
function roundTime(e, n, r, a) {
|
|
647
638
|
const i = nanosecondsForTimeUnit(clamp(r - 1, 3, 8)), l = e.D * o + e.I * t + 1e9 * e.O + 1e6 * e.F + 1e3 * e.S + e.v;
|
|
@@ -649,16 +640,16 @@ function roundTime(e, n, r, a) {
|
|
|
649
640
|
}
|
|
650
641
|
function differenceTemporalPlainTime(e, t, o, n) {
|
|
651
642
|
const r = toTemporalTime(o), a = getDifferenceSettings(e, getOptionsObject(n), L, [], D, m);
|
|
652
|
-
return createTemporalDuration(applySignToDurationSlot(temporalDurationFromInternal(combineDateAndTimeDuration(zeroDateDuration(), roundTimeDuration(differenceTime(t, r), a.L, a.H, a.
|
|
643
|
+
return createTemporalDuration(applySignToDurationSlot(temporalDurationFromInternal(combineDateAndTimeDuration(zeroDateDuration(), roundTimeDuration(differenceTime(t, r), a.L, a.H, a.B)), a.V), e));
|
|
653
644
|
}
|
|
654
645
|
function addDurationToTime(e, t, o) {
|
|
655
646
|
return createTemporalTime(addTime(t, toInternalDurationRecord(applySignToDurationSlot(toTemporalDuration(o), e)).p));
|
|
656
647
|
}
|
|
657
648
|
function getInternalSlotOrThrowForPlainTime(e) {
|
|
658
|
-
return getInternalSlotOrThrow(
|
|
649
|
+
return getInternalSlotOrThrow(je, e);
|
|
659
650
|
}
|
|
660
651
|
function isPlainTime(e) {
|
|
661
|
-
return
|
|
652
|
+
return je.has(e);
|
|
662
653
|
}
|
|
663
654
|
function optionalChain(e) {
|
|
664
655
|
return e.reduceRight((e, t) => `${t}(?:${e})?`);
|
|
@@ -670,10 +661,10 @@ function createRegExp(e) {
|
|
|
670
661
|
return RegExp(`^(?:${e})$`);
|
|
671
662
|
}
|
|
672
663
|
function isAmbiguousTemporalTimeString(e) {
|
|
673
|
-
return
|
|
664
|
+
return it.some((t) => isSemanticallyValid(e.match(t)?.groups));
|
|
674
665
|
}
|
|
675
666
|
function isTimeZoneIdentifier(e) {
|
|
676
|
-
return
|
|
667
|
+
return lt.test(e);
|
|
677
668
|
}
|
|
678
669
|
function isSemanticallyValid(e) {
|
|
679
670
|
return !!e && "-000000" !== (e.a || e.l) && (!e.a || isValidIsoDate(Se(e.a), Se(e.b), Se(e.c))) && (!e.n || isValidIsoDate(1972, Se(e.m), Se(e.n)));
|
|
@@ -681,12 +672,12 @@ function isSemanticallyValid(e) {
|
|
|
681
672
|
function parseIsoDateTime(e, t) {
|
|
682
673
|
for (const o of t) {
|
|
683
674
|
const t = e.match(o);
|
|
684
|
-
if (!t || !isSemanticallyValid(t.groups) || o ===
|
|
675
|
+
if (!t || !isSemanticallyValid(t.groups) || o === nt && isAmbiguousTemporalTimeString(e)) continue;
|
|
685
676
|
const n = t.groups;
|
|
686
677
|
let r;
|
|
687
678
|
if (n.k) {
|
|
688
679
|
let t = !1;
|
|
689
|
-
for (const [, o, a, i] of n.k.matchAll(
|
|
680
|
+
for (const [, o, a, i] of n.k.matchAll(Qe)) "u-ca" === a ? r ? (o || t) && throwRangeError(parseError(e)) : (r = i, t = !!o) : o && throwRangeError(parseError(e));
|
|
690
681
|
}
|
|
691
682
|
n.m && r && "iso8601" !== asciiLowerCase(r) && throwRangeError(parseError(e));
|
|
692
683
|
const a = (n.g || "").padEnd(9, "0");
|
|
@@ -706,11 +697,11 @@ function parseIsoDateTime(e, t) {
|
|
|
706
697
|
throwRangeError(parseError(e));
|
|
707
698
|
}
|
|
708
699
|
function parseDateTimeUtcOffset(e) {
|
|
709
|
-
const o = e.match(
|
|
700
|
+
const o = e.match(st);
|
|
710
701
|
return o || throwRangeError(parseError(e)), Se(`${o[1]}1`) * (36e11 * Se(o[2]) + Se(o[4] || "") * t + 1e9 * Se(o[5] || "") + Se((o[6] || "").padEnd(9, "0")) + 0);
|
|
711
702
|
}
|
|
712
703
|
function hasUtcOffsetSubMinuteParts(e) {
|
|
713
|
-
return !!e.match(
|
|
704
|
+
return !!e.match(st)[5];
|
|
714
705
|
}
|
|
715
706
|
function toTemporalMonthDay(e, t) {
|
|
716
707
|
if (isObject(e)) {
|
|
@@ -718,18 +709,18 @@ function toTemporalMonthDay(e, t) {
|
|
|
718
709
|
if (o) return getTemporalOverflowOption(getOptionsObject(t)), createTemporalMonthDay(o.o, o.U);
|
|
719
710
|
const n = getTemporalCalendarIdentifierWithIsoDefault(e);
|
|
720
711
|
return createTemporalMonthDay(calendarMonthDayFromFields(n, prepareCalendarFields(n, e, [
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
712
|
+
ht.t,
|
|
713
|
+
ht.u,
|
|
714
|
+
ht.P,
|
|
715
|
+
ht.T
|
|
725
716
|
], []), getTemporalOverflowOption(getOptionsObject(t))), n);
|
|
726
717
|
}
|
|
727
718
|
validateString(e);
|
|
728
|
-
const o = parseIsoDateTime(e, [
|
|
729
|
-
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)),
|
|
719
|
+
const o = parseIsoDateTime(e, [rt]), n = canonicalizeCalendar(o.U || "iso8601");
|
|
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)), B), _), n);
|
|
730
721
|
}
|
|
731
|
-
function createTemporalMonthDay(e, t, o = Object.create(
|
|
732
|
-
return
|
|
722
|
+
function createTemporalMonthDay(e, t, o = Object.create(mt.prototype)) {
|
|
723
|
+
return dt.set(o, {
|
|
733
724
|
o: validateIsoDate(e),
|
|
734
725
|
U: t
|
|
735
726
|
}), o;
|
|
@@ -738,10 +729,10 @@ function temporalMonthDayToString(e, t) {
|
|
|
738
729
|
return `${t === De || t === he || "iso8601" !== e.U ? `${padIsoYear(e.o.t)}-` : ""}${toZeroPaddedDecimalString(e.o.u, 2)}-${toZeroPaddedDecimalString(e.o.T, 2)}${formatCalendarAnnotation(e.U, t)}`;
|
|
739
730
|
}
|
|
740
731
|
function getInternalSlotForPlainMonthDay(e) {
|
|
741
|
-
return
|
|
732
|
+
return dt.get(e);
|
|
742
733
|
}
|
|
743
734
|
function getInternalSlotOrThrowForPlainMonthDay(e) {
|
|
744
|
-
return getInternalSlotOrThrow(
|
|
735
|
+
return getInternalSlotOrThrow(dt, e);
|
|
745
736
|
}
|
|
746
737
|
function isPlainMonthDay(e) {
|
|
747
738
|
return !!getInternalSlotForPlainMonthDay(e);
|
|
@@ -752,13 +743,13 @@ function toTemporalYearMonth(e, t) {
|
|
|
752
743
|
if (o) return getTemporalOverflowOption(getOptionsObject(t)), createTemporalYearMonth(o.o, o.U);
|
|
753
744
|
const n = getTemporalCalendarIdentifierWithIsoDefault(e);
|
|
754
745
|
return createTemporalYearMonth(calendarYearMonthFromFields(n, prepareCalendarFields(n, e, [
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
746
|
+
ht.t,
|
|
747
|
+
ht.u,
|
|
748
|
+
ht.P
|
|
758
749
|
], []), getTemporalOverflowOption(getOptionsObject(t))), n);
|
|
759
750
|
}
|
|
760
751
|
validateString(e);
|
|
761
|
-
const o = parseIsoDateTime(e, [
|
|
752
|
+
const o = parseIsoDateTime(e, [at]), n = canonicalizeCalendar(o.U || "iso8601");
|
|
762
753
|
return getTemporalOverflowOption(getOptionsObject(t)), createTemporalYearMonth(calendarYearMonthFromFields(n, isoDateToFields(n, validateIsoYearMonth(createIsoDateRecord(o.t, o.u, o.T)), x), _), n);
|
|
763
754
|
}
|
|
764
755
|
function balanceIsoYearMonth(e, t) {
|
|
@@ -767,8 +758,8 @@ function balanceIsoYearMonth(e, t) {
|
|
|
767
758
|
u: modFloor(t - 1, 12) + 1
|
|
768
759
|
};
|
|
769
760
|
}
|
|
770
|
-
function createTemporalYearMonth(e, t, o = Object.create(
|
|
771
|
-
return
|
|
761
|
+
function createTemporalYearMonth(e, t, o = Object.create(Tt.prototype)) {
|
|
762
|
+
return ut.set(o, {
|
|
772
763
|
o: validateIsoYearMonth(e),
|
|
773
764
|
U: t
|
|
774
765
|
}), o;
|
|
@@ -794,15 +785,15 @@ function differenceTemporalPlainYearMonth(e, t, o, n) {
|
|
|
794
785
|
]));
|
|
795
786
|
const i = calendarDateFromFields(t.U, createNullPrototypeObject({
|
|
796
787
|
...isoDateToFields(t.U, t.o, x),
|
|
797
|
-
[
|
|
788
|
+
[ht.T]: 1
|
|
798
789
|
}), _), m = calendarDateFromFields(t.U, createNullPrototypeObject({
|
|
799
790
|
...isoDateToFields(t.U, r.o, x),
|
|
800
|
-
[
|
|
791
|
+
[ht.T]: 1
|
|
801
792
|
}), _);
|
|
802
793
|
let u = combineDateAndTimeDuration(adjustDateDurationRecord(calendarDateUntil(t.U, i, m, a.V), 0, 0), ye);
|
|
803
794
|
if (a.H !== c || 1 !== a.L) {
|
|
804
795
|
const e = combineIsoDateAndTimeRecord(i, midnightTimeRecord());
|
|
805
|
-
u = roundRelativeDuration(u, getUtcEpochNanoseconds(e), getUtcEpochNanoseconds(combineIsoDateAndTimeRecord(m, midnightTimeRecord())), e, void 0, t.U, a.V, a.L, a.H, a.
|
|
796
|
+
u = roundRelativeDuration(u, getUtcEpochNanoseconds(e), getUtcEpochNanoseconds(combineIsoDateAndTimeRecord(m, midnightTimeRecord())), e, void 0, t.U, a.V, a.L, a.H, a.B);
|
|
806
797
|
}
|
|
807
798
|
return createTemporalDuration(applySignToDurationSlot(temporalDurationFromInternal(u, d), e));
|
|
808
799
|
}
|
|
@@ -810,17 +801,17 @@ function addDurationToYearMonth(e, t, o, n) {
|
|
|
810
801
|
const r = toInternalDurationRecord(applySignToDurationSlot(toTemporalDuration(o), e)), a = getTemporalOverflowOption(getOptionsObject(n));
|
|
811
802
|
return (r.A.ee || r.A.X || signTimeDuration(r.p)) && throwRangeError("duration can contain only years and months"), createTemporalYearMonth(calendarYearMonthFromFields(t.U, isoDateToFields(t.U, calendarDateAdd(t.U, calendarDateFromFields(t.U, createNullPrototypeObject({
|
|
812
803
|
...isoDateToFields(t.U, t.o, x),
|
|
813
|
-
[
|
|
804
|
+
[ht.T]: 1
|
|
814
805
|
}), _), r.A, a), x), a), t.U);
|
|
815
806
|
}
|
|
816
807
|
function validateIsoYearMonth(e) {
|
|
817
|
-
return ((e) => isWithin(12 * e.t + e.u, -3261848, 3309129))(e) || throwRangeError(
|
|
808
|
+
return ((e) => isWithin(12 * e.t + e.u, -3261848, 3309129))(e) || throwRangeError(R), e;
|
|
818
809
|
}
|
|
819
810
|
function getInternalSlotForPlainYearMonth(e) {
|
|
820
|
-
return
|
|
811
|
+
return ut.get(e);
|
|
821
812
|
}
|
|
822
813
|
function getInternalSlotOrThrowForPlainYearMonth(e) {
|
|
823
|
-
return getInternalSlotOrThrow(
|
|
814
|
+
return getInternalSlotOrThrow(ut, e);
|
|
824
815
|
}
|
|
825
816
|
function isPlainYearMonth(e) {
|
|
826
817
|
return !!getInternalSlotForPlainYearMonth(e);
|
|
@@ -830,14 +821,14 @@ function calendarDateForPlainYearMonth(e) {
|
|
|
830
821
|
return calendarIsoToDate(t.U, t.o);
|
|
831
822
|
}
|
|
832
823
|
function createIsoDateRecord(e, t, o) {
|
|
833
|
-
return {
|
|
824
|
+
return isValidIsoDate(e, t, o) || throwRangeError(b), {
|
|
834
825
|
t: e,
|
|
835
826
|
u: t,
|
|
836
827
|
T: o
|
|
837
828
|
};
|
|
838
829
|
}
|
|
839
|
-
function createTemporalDate(e, t, o = Object.create(
|
|
840
|
-
return
|
|
830
|
+
function createTemporalDate(e, t, o = Object.create(pt.prototype)) {
|
|
831
|
+
return Dt.set(o, {
|
|
841
832
|
o: validateIsoDate(e),
|
|
842
833
|
U: t
|
|
843
834
|
}), o;
|
|
@@ -861,18 +852,18 @@ function toTemporalDate(e, t) {
|
|
|
861
852
|
}
|
|
862
853
|
const o = getTemporalCalendarIdentifierWithIsoDefault(e);
|
|
863
854
|
return createTemporalDate(calendarDateFromFields(o, prepareCalendarFields(o, e, [
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
855
|
+
ht.t,
|
|
856
|
+
ht.u,
|
|
857
|
+
ht.P,
|
|
858
|
+
ht.T
|
|
868
859
|
], []), getTemporalOverflowOption(getOptionsObject(t))), o);
|
|
869
860
|
}
|
|
870
861
|
validateString(e);
|
|
871
|
-
const o = parseIsoDateTime(e, [
|
|
862
|
+
const o = parseIsoDateTime(e, [tt]), n = canonicalizeCalendar(o.U || "iso8601");
|
|
872
863
|
return getTemporalOverflowOption(getOptionsObject(t)), createTemporalDate(createIsoDateRecord(o.t, o.u, o.T), n);
|
|
873
864
|
}
|
|
874
865
|
function regulateIsoDate(e, t, o, n) {
|
|
875
|
-
return "constrain" === n ? createIsoDateRecord(e, t = clamp(t, 1, 12), clamp(o, 1, isoDaysInMonth(e, t))) :
|
|
866
|
+
return "constrain" === n ? createIsoDateRecord(e, t = clamp(t, 1, 12), clamp(o, 1, isoDaysInMonth(e, t))) : createIsoDateRecord(e, t, o);
|
|
876
867
|
}
|
|
877
868
|
function isValidIsoDate(e, t, o) {
|
|
878
869
|
return isWithin(t, 1, 12) && isWithin(o, 1, isoDaysInMonth(e, t));
|
|
@@ -908,7 +899,7 @@ function differenceTemporalPlainDate(e, t, o, n) {
|
|
|
908
899
|
let i = combineDateAndTimeDuration(calendarDateUntil(t.U, t.o, r.o, a.V), ye);
|
|
909
900
|
if (a.H !== d || 1 !== a.L) {
|
|
910
901
|
const e = combineIsoDateAndTimeRecord(t.o, midnightTimeRecord());
|
|
911
|
-
i = roundRelativeDuration(i, getUtcEpochNanoseconds(e), getUtcEpochNanoseconds(combineIsoDateAndTimeRecord(r.o, midnightTimeRecord())), e, void 0, t.U, a.V, a.L, a.H, a.
|
|
902
|
+
i = roundRelativeDuration(i, getUtcEpochNanoseconds(e), getUtcEpochNanoseconds(combineIsoDateAndTimeRecord(r.o, midnightTimeRecord())), e, void 0, t.U, a.V, a.L, a.H, a.B);
|
|
912
903
|
}
|
|
913
904
|
return createTemporalDuration(applySignToDurationSlot(temporalDurationFromInternal(i, d), e));
|
|
914
905
|
}
|
|
@@ -919,10 +910,10 @@ function addDurationToDate(e, t, o, n) {
|
|
|
919
910
|
})(applySignToDurationSlot(toTemporalDuration(o), e)), getTemporalOverflowOption(getOptionsObject(n))), t.U);
|
|
920
911
|
}
|
|
921
912
|
function getInternalSlotForPlainDate(e) {
|
|
922
|
-
return
|
|
913
|
+
return Dt.get(e);
|
|
923
914
|
}
|
|
924
915
|
function getInternalSlotOrThrowForPlainDate(e) {
|
|
925
|
-
return getInternalSlotOrThrow(
|
|
916
|
+
return getInternalSlotOrThrow(Dt, e);
|
|
926
917
|
}
|
|
927
918
|
function isPlainDate(e) {
|
|
928
919
|
return !!getInternalSlotForPlainDate(e);
|
|
@@ -956,7 +947,7 @@ function calendarDateUntil(e, t, o, n) {
|
|
|
956
947
|
})(t, o, n);
|
|
957
948
|
}
|
|
958
949
|
function calendarDateToIso(e, t, o) {
|
|
959
|
-
return ((e, t) => regulateIsoDate(e[
|
|
950
|
+
return ((e, t) => regulateIsoDate(e[ht.t], e[ht.u], e[ht.T], t))(t, o);
|
|
960
951
|
}
|
|
961
952
|
function calendarSupportsEra(e) {
|
|
962
953
|
return "gregory" === e;
|
|
@@ -979,16 +970,16 @@ function prepareCalendarFields(e, t, o, n) {
|
|
|
979
970
|
let a = !1;
|
|
980
971
|
for (const e of o) {
|
|
981
972
|
const o = t[e];
|
|
982
|
-
void 0 !== o ? (a = !0, r[e] =
|
|
973
|
+
void 0 !== o ? (a = !0, r[e] = ft[e][0](o)) : n && (n.includes(e) && throwTypeError(missingField(e)), r[e] = ft[e][1]);
|
|
983
974
|
}
|
|
984
975
|
return n || a || throwTypeError(C), r;
|
|
985
976
|
}
|
|
986
977
|
function calendarMergeFields(e, t, o) {
|
|
987
978
|
const n = ((e, t) => {
|
|
988
979
|
const o = [];
|
|
989
|
-
return void 0 !== t[
|
|
980
|
+
return void 0 !== t[ht.u] && o.push(ht.P), void 0 !== t[ht.P] && o.push(ht.u), !calendarSupportsEra(e) || void 0 === t[ht.ne] && void 0 === t[ht.re] && void 0 === t[ht.t] || o.push(ht.ne, ht.re, ht.t), o;
|
|
990
981
|
})(e, o), r = createEmptyCalendarFieldsRecord();
|
|
991
|
-
for (const e of
|
|
982
|
+
for (const e of gt) void 0 === t[e] || n.includes(e) || (r[e] = t[e]), void 0 !== o[e] && (r[e] = o[e]);
|
|
992
983
|
return r;
|
|
993
984
|
}
|
|
994
985
|
function toTemporalCalendarIdentifier(e) {
|
|
@@ -996,15 +987,15 @@ function toTemporalCalendarIdentifier(e) {
|
|
|
996
987
|
return t ? t.U : (validateString(e), canonicalizeCalendar(((e) => {
|
|
997
988
|
try {
|
|
998
989
|
return parseIsoDateTime(e, [
|
|
999
|
-
Qe,
|
|
1000
990
|
et,
|
|
1001
991
|
tt,
|
|
1002
992
|
ot,
|
|
1003
993
|
nt,
|
|
1004
|
-
rt
|
|
994
|
+
rt,
|
|
995
|
+
at
|
|
1005
996
|
]).U || "iso8601";
|
|
1006
997
|
} catch {
|
|
1007
|
-
return
|
|
998
|
+
return ct.test(e) || throwRangeError(parseError(e)), e;
|
|
1008
999
|
}
|
|
1009
1000
|
})(e)));
|
|
1010
1001
|
}
|
|
@@ -1019,9 +1010,9 @@ function calendarYearMonthFromFields(e, t, o) {
|
|
|
1019
1010
|
return t.day = 1, calendarResolveFields(e, t, x), validateIsoYearMonth(calendarDateToIso(0, t, o));
|
|
1020
1011
|
}
|
|
1021
1012
|
function calendarMonthDayFromFields(e, t, o) {
|
|
1022
|
-
return calendarResolveFields(e, t,
|
|
1013
|
+
return calendarResolveFields(e, t, B), (function(e, t, o) {
|
|
1023
1014
|
return ((e, t, o) => {
|
|
1024
|
-
const n = regulateIsoDate(e[
|
|
1015
|
+
const n = regulateIsoDate(e[ht.t] ?? 1972, e[ht.u], e[ht.T], t);
|
|
1025
1016
|
return o || validateIsoDate(n), createIsoDateRecord(1972, n.u, n.T);
|
|
1026
1017
|
})(t, o, "iso8601" === e);
|
|
1027
1018
|
})(e, t, o);
|
|
@@ -1089,20 +1080,20 @@ function calendarExtraFields(e, t) {
|
|
|
1089
1080
|
return calendarSupportsEra(e) && t.includes("year") ? ["era", "eraYear"] : [];
|
|
1090
1081
|
}
|
|
1091
1082
|
function isoResolveFields(e, t) {
|
|
1092
|
-
t !==
|
|
1093
|
-
const o = mapUnlessUndefined(e[
|
|
1094
|
-
o && ((o[0] > 12 || o[1] || void 0 !== e[
|
|
1083
|
+
t !== B && void 0 === e[ht.t] && throwTypeError(missingField(ht.t)), t !== x && void 0 === e[ht.T] && throwTypeError(missingField(ht.T)), void 0 === e[ht.P] && void 0 === e[ht.u] && throwTypeError(missingField("month, monthCode"));
|
|
1084
|
+
const o = mapUnlessUndefined(e[ht.P], parseMonthCode);
|
|
1085
|
+
o && ((o[0] > 12 || o[1] || void 0 !== e[ht.u] && o[0] !== e[ht.u]) && throwRangeError(j), e[ht.u] = o[0]);
|
|
1095
1086
|
}
|
|
1096
1087
|
function calendarResolveFields(e, t, o = V) {
|
|
1097
1088
|
"iso8601" === e ? isoResolveFields(t, o) : (function(e, t, o = V) {
|
|
1098
|
-
const n = t[
|
|
1099
|
-
let a = t[
|
|
1100
|
-
const i = t[
|
|
1101
|
-
if (o ===
|
|
1089
|
+
const n = t[ht.ne], r = t[ht.re];
|
|
1090
|
+
let a = t[ht.t];
|
|
1091
|
+
const i = t[ht.P], l = t[ht.u], c = t[ht.T];
|
|
1092
|
+
if (o === B && void 0 !== i && void 0 === l || void 0 !== a || void 0 !== n && void 0 !== r || throwTypeError(missingField("year, era, eraYear")), void 0 === n != (void 0 === r) && throwTypeError(), o !== x && void 0 === c && throwTypeError(missingField("day")), l === i && throwTypeError(missingField("month, monthCode")), void 0 !== r) {
|
|
1102
1093
|
const e = ((e, t, o) => "ce" === canonicalizeEraInCalendar(0, t) ? o : 1 - o)(0, canonicalizeEraInCalendar(0, n), r);
|
|
1103
|
-
void 0 !== a && a !== e && throwRangeError("mismatch of `year`, `era` and `eraYear`"), t[
|
|
1094
|
+
void 0 !== a && a !== e && throwRangeError("mismatch of `year`, `era` and `eraYear`"), t[ht.t] = e;
|
|
1104
1095
|
}
|
|
1105
|
-
t[
|
|
1096
|
+
t[ht.ne] = t[ht.re] = void 0, isoResolveFields(t, o);
|
|
1106
1097
|
})(0, t, o);
|
|
1107
1098
|
}
|
|
1108
1099
|
function createEmptyCalendarFieldsRecord() {
|
|
@@ -1145,7 +1136,7 @@ function combineDateAndTimeDuration(e, t) {
|
|
|
1145
1136
|
};
|
|
1146
1137
|
}
|
|
1147
1138
|
function toTemporalDuration(e) {
|
|
1148
|
-
return
|
|
1139
|
+
return It.get(e) || (isObject(e) ? createTemporalDurationSlot(toTemporalPartialDurationRecord(e).map((e) => e || 0)) : (validateString(e), ((e) => {
|
|
1149
1140
|
const t = e.match(/^([+-]?)p(?:(\d+)y)?(?:(\d+)m)?(?:(\d+)w)?(?:(\d+)d)?(?:t(?:(\d+)(?:[.,](\d{1,9}))?h)?(?:(\d+)(?:[.,](\d{1,9}))?m)?(?:(\d+)(?:[.,](\d{1,9}))?s)?)?$/i);
|
|
1150
1141
|
t && !/[pt]$|[.,](\d{1,9})[hms]./i.test(e) || throwRangeError(parseError(e));
|
|
1151
1142
|
const o = balanceTime(0, 0, 0, 0, 0, 3600 * toIntegerWithTruncation((t[7] || "").padEnd(9, "0")) + 60 * toIntegerWithTruncation((t[9] || "").padEnd(9, "0")) + toIntegerWithTruncation((t[11] || "").padEnd(9, "0")));
|
|
@@ -1161,8 +1152,7 @@ function toTemporalDuration(e) {
|
|
|
1161
1152
|
o.S,
|
|
1162
1153
|
o.v
|
|
1163
1154
|
]), toIntegerWithTruncation(`${t[1]}1`));
|
|
1164
|
-
})(e));
|
|
1165
|
-
var t;
|
|
1155
|
+
})(e)));
|
|
1166
1156
|
}
|
|
1167
1157
|
function durationSign(e) {
|
|
1168
1158
|
return sign(e.find((e) => e) || 0);
|
|
@@ -1171,7 +1161,7 @@ function dateDurationSign(e) {
|
|
|
1171
1161
|
return sign(e.te || e.oe || e.ee || e.X);
|
|
1172
1162
|
}
|
|
1173
1163
|
function internalDurationSign(e) {
|
|
1174
|
-
return dateDurationSign(e.A) ||
|
|
1164
|
+
return dateDurationSign(e.A) || Ot(e.p);
|
|
1175
1165
|
}
|
|
1176
1166
|
function validateDuration(...e) {
|
|
1177
1167
|
e.some((e) => e < 0) && e.some((e) => e > 0) && throwRangeError("invalid duration"), (e.some((e) => Math.abs(e) > 1e25) || [
|
|
@@ -1196,7 +1186,7 @@ function toTemporalPartialDurationRecord(e) {
|
|
|
1196
1186
|
6,
|
|
1197
1187
|
2,
|
|
1198
1188
|
0
|
|
1199
|
-
].map((t) => mapUnlessUndefined(e[
|
|
1189
|
+
].map((t) => mapUnlessUndefined(e[P[t]], toIntegerIfIntegral));
|
|
1200
1190
|
return t.some((e) => void 0 !== e) || throwTypeError(C), [
|
|
1201
1191
|
9,
|
|
1202
1192
|
5,
|
|
@@ -1213,8 +1203,8 @@ function toTemporalPartialDurationRecord(e) {
|
|
|
1213
1203
|
function createTemporalDurationSlot(e) {
|
|
1214
1204
|
return validateDuration(...e), e;
|
|
1215
1205
|
}
|
|
1216
|
-
function createTemporalDuration(e, t = Object.create(
|
|
1217
|
-
return
|
|
1206
|
+
function createTemporalDuration(e, t = Object.create(Ft.prototype)) {
|
|
1207
|
+
return It.set(t, e), t;
|
|
1218
1208
|
}
|
|
1219
1209
|
function timeDurationFromComponents(e, t, o, n, r, a) {
|
|
1220
1210
|
return addTimeDuration(addTimeDuration(addTimeDuration(createTimeDurationFromUnit(3600 * e + 60 * t + o, 1e9), createTimeDurationFromUnit(n, 1e6)), createTimeDurationFromUnit(r, 1e3)), createTimeDurationFromUnit(a, 1));
|
|
@@ -1265,7 +1255,7 @@ function nudgeToCalendarUnit(e, t, o, n, r, a, i, l, c, s) {
|
|
|
1265
1255
|
compareEpochNanoseconds(m.he, n) * compareEpochNanoseconds(m.ge, n) > 0 && (m = computeNudgeWindow(e, t, o, r, a, 0, l, c, !0), d = !0);
|
|
1266
1256
|
const u = differenceEpochNanoseconds(m.he, n), T = differenceEpochNanoseconds(m.he, m.ge);
|
|
1267
1257
|
let D = m.fe, p = m.he;
|
|
1268
|
-
return roundNumberToIncrement(m.De + ((e, t, o) => signTimeDuration(e) ?
|
|
1258
|
+
return roundNumberToIncrement(m.De + ((e, t, o) => signTimeDuration(e) ? Pe(e, t) ? Pe(addTimeDuration(e, e), t) * o / 5 + .5 : 1 : 0)(u, T, e) * l * e, l, s) === m.pe && (d = !0, D = m.Ie, p = m.ge), signTimeDuration(T) || throwRangeError("internal error"), {
|
|
1269
1259
|
Oe: {
|
|
1270
1260
|
Fe: combineDateAndTimeDuration(D, ye),
|
|
1271
1261
|
Se: p,
|
|
@@ -1280,7 +1270,7 @@ function roundRelativeDuration(e, t, o, n, r, a, i, l, c, m) {
|
|
|
1280
1270
|
let p = roundTimeDurationToIncrement(t.p, a * D, l);
|
|
1281
1271
|
const h = addTimeDuration(p, negateTimeDuration(T));
|
|
1282
1272
|
let g = !1, f = 0;
|
|
1283
|
-
return
|
|
1273
|
+
return Ot(h) !== -e && (g = !0, f = e, p = roundTimeDurationToIncrement(h, a * D, l)), {
|
|
1284
1274
|
Fe: combineDateAndTimeDuration(adjustDateDurationRecord(t.A, t.A.X + f), p),
|
|
1285
1275
|
Se: addTimeDurationToEpochNanoseconds(u, p),
|
|
1286
1276
|
we: g
|
|
@@ -1290,7 +1280,7 @@ function roundRelativeDuration(e, t, o, n, r, a, i, l, c, m) {
|
|
|
1290
1280
|
return {
|
|
1291
1281
|
Fe: combineDateAndTimeDuration(adjustDateDurationRecord(e.A, isDateUnit(o) ? c : 0), isDateUnit(o) ? addTimeDuration(l, timeDurationFromComponents(24 * -c, 0, 0, 0, 0, 0)) : l),
|
|
1292
1282
|
Se: addTimeDurationToEpochNanoseconds(t, addTimeDuration(l, negateTimeDuration(i))),
|
|
1293
|
-
we: sign(c - i[0]) ===
|
|
1283
|
+
we: sign(c - i[0]) === Ot(i)
|
|
1294
1284
|
};
|
|
1295
1285
|
})(e, o, i, l, c, m);
|
|
1296
1286
|
return T.we && c !== s ? ((e, t, o, n, r, a, i, l) => {
|
|
@@ -1299,8 +1289,8 @@ function roundRelativeDuration(e, t, o, n, r, a, i, l, c, m) {
|
|
|
1299
1289
|
let d;
|
|
1300
1290
|
for (let a = l - 1; a >= c; a--) if (a !== g || i === s) {
|
|
1301
1291
|
d = a === p ? createDateDurationRecord(t.A.te + e, 0, 0, 0) : a === h ? adjustDateDurationRecord(t.A, 0, 0, t.A.oe + e) : adjustDateDurationRecord(t.A, 0, t.A.ee + e);
|
|
1302
|
-
const i = combineIsoDateAndTimeRecord(calendarDateAdd(0, n.o, d, _), n.p);
|
|
1303
|
-
if (
|
|
1292
|
+
const i = combineIsoDateAndTimeRecord(calendarDateAdd(0, n.o, d, _), n.p), l = r ? getEpochNanosecondsFor(r, i, G) : getUtcEpochNanoseconds(i);
|
|
1293
|
+
if (Ot(differenceEpochNanoseconds(l, o)) === -e) break;
|
|
1304
1294
|
t = combineDateAndTimeDuration(d, ye);
|
|
1305
1295
|
}
|
|
1306
1296
|
return t;
|
|
@@ -1317,7 +1307,7 @@ function temporalDurationToString(e, t) {
|
|
|
1317
1307
|
"D",
|
|
1318
1308
|
"H",
|
|
1319
1309
|
"M"
|
|
1320
|
-
].map((t, o) => e[o] ? `${e[o]}${t}` : ""), p = `${u}${D}${
|
|
1310
|
+
].map((t, o) => e[o] ? `${e[o]}${t}` : ""), p = `${u}${D}${Ot(n) || defaultTemporalLargestUnit(e) >= T || void 0 !== t ? `${toString(r)}${formatFractionalSeconds(1e6 * a + 1e3 * i + l, t)}S` : ""}`;
|
|
1321
1311
|
return `${o < 0 ? "-" : ""}P${c}${s}${d}${m}${p && `T${p}`}`;
|
|
1322
1312
|
}
|
|
1323
1313
|
function addDurations(e, t, o) {
|
|
@@ -1325,13 +1315,13 @@ function addDurations(e, t, o) {
|
|
|
1325
1315
|
return isCalendarUnit(r) && throwRangeError(durationWithDateUnit(r)), createTemporalDuration(temporalDurationFromInternal(combineDateAndTimeDuration(zeroDateDuration(), addTimeDuration(toInternalDurationRecordWith24HourDays(t).p, toInternalDurationRecordWith24HourDays(n).p)), r));
|
|
1326
1316
|
}
|
|
1327
1317
|
function getInternalSlotOrThrowForDuration(e) {
|
|
1328
|
-
return getInternalSlotOrThrow(
|
|
1318
|
+
return getInternalSlotOrThrow(It, e);
|
|
1329
1319
|
}
|
|
1330
1320
|
function applySignToDurationSlot(e, t) {
|
|
1331
1321
|
return createTemporalDurationSlot(e.map((e) => e * t + 0));
|
|
1332
1322
|
}
|
|
1333
1323
|
function validateTimeDurationRange(e) {
|
|
1334
|
-
return ((e) =>
|
|
1324
|
+
return ((e) => Pe(absTimeDuration(e), createTimeDurationFromUnit(2 ** 53, 1e9)) < 0)(e) || throwRangeError(Z), e;
|
|
1335
1325
|
}
|
|
1336
1326
|
function balanceTimeDuration(e, t) {
|
|
1337
1327
|
const o = clamp(t, 3, 9);
|
|
@@ -1344,7 +1334,7 @@ function balanceTimeDuration(e, t) {
|
|
|
1344
1334
|
0,
|
|
1345
1335
|
0
|
|
1346
1336
|
].slice(0, o - f),
|
|
1347
|
-
o > F ? timeDurationToSubsecondsNumber(e, 18 - 3 * o) : divTrunc((r = e, r[0] * n + divTrunc(r[1], 1e9)),
|
|
1337
|
+
o > F ? timeDurationToSubsecondsNumber(e, 18 - 3 * o) : divTrunc((r = e, r[0] * n + divTrunc(r[1], 1e9)), E[o - f] / 1e9),
|
|
1348
1338
|
...[
|
|
1349
1339
|
0,
|
|
1350
1340
|
1,
|
|
@@ -1352,7 +1342,7 @@ function balanceTimeDuration(e, t) {
|
|
|
1352
1342
|
3,
|
|
1353
1343
|
4,
|
|
1354
1344
|
5
|
|
1355
|
-
].map((t) => divTrunc(e[1],
|
|
1345
|
+
].map((t) => divTrunc(e[1], E[t + 1]) % (E[t] / E[t + 1]) + 0).slice(o - f)
|
|
1356
1346
|
];
|
|
1357
1347
|
var r;
|
|
1358
1348
|
}
|
|
@@ -1435,7 +1425,7 @@ function toSecondsStringPrecisionRecord(e, t) {
|
|
|
1435
1425
|
function getTemporalUnitValuedOption(e, t, o) {
|
|
1436
1426
|
return mapUnlessUndefined(getOption(e, t, [
|
|
1437
1427
|
...y,
|
|
1438
|
-
...
|
|
1428
|
+
...P,
|
|
1439
1429
|
"auto"
|
|
1440
1430
|
], o), (e) => {
|
|
1441
1431
|
return "auto" === e ? "auto" : (t = e.replace(/s$/, ""), y.indexOf(t));
|
|
@@ -1456,23 +1446,23 @@ function getTemporalRelativeToOption(e) {
|
|
|
1456
1446
|
if (e) return createNullPrototypeObject({ be: getInternalSlotOrThrowForPlainDate(createTemporalDate(e.K.o, e.U)) });
|
|
1457
1447
|
r = getTemporalCalendarIdentifierWithIsoDefault(t);
|
|
1458
1448
|
const l = prepareCalendarFields(r, t, [
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1449
|
+
ht.t,
|
|
1450
|
+
ht.u,
|
|
1451
|
+
ht.P,
|
|
1452
|
+
ht.T,
|
|
1453
|
+
ht.D,
|
|
1454
|
+
ht.I,
|
|
1455
|
+
ht.O,
|
|
1456
|
+
ht.F,
|
|
1457
|
+
ht.S,
|
|
1458
|
+
ht.v,
|
|
1459
|
+
ht.R,
|
|
1460
|
+
ht.Z
|
|
1471
1461
|
], []), s = interpretTemporalDateTimeFields(r, l, _);
|
|
1472
1462
|
a = s.o, i = s.p, o = l.timeZone, n = l.offset, c = n ? te : ne;
|
|
1473
1463
|
} else {
|
|
1474
1464
|
validateString(t);
|
|
1475
|
-
const e = parseIsoDateTime(t, [
|
|
1465
|
+
const e = parseIsoDateTime(t, [et, tt]);
|
|
1476
1466
|
n = e.Z.N, e.Z.$ ? (o = toTemporalTimeZoneIdentifier(e.Z.$), c = e.Z.M ? oe : n ? te : ne, l = void 0 !== n && hasUtcOffsetSubMinuteParts(n)) : o = void 0, r = canonicalizeCalendar(e.U || "iso8601"), a = createIsoDateRecord(e.t, e.u, e.T), i = e.p;
|
|
1477
1467
|
}
|
|
1478
1468
|
return createNullPrototypeObject(o ? { Re: getInternalSlotOrThrowForZonedDateTime(createTemporalZonedDateTime(interpretISODateTimeOffset(a, i, c, c === te ? parseDateTimeUtcOffset(n) : 0, o, G, ee, l), o, r)) } : { be: getInternalSlotOrThrowForPlainDate(createTemporalDate(a, r)) });
|
|
@@ -1504,7 +1494,7 @@ function formatTimeString(e, t, o, n, r) {
|
|
|
1504
1494
|
return `${toZeroPaddedDecimalString(e, 2)}:${toZeroPaddedDecimalString(t, 2)}${r === J ? "" : `:${toZeroPaddedDecimalString(o, 2)}${formatFractionalSeconds(n, r)}`}`;
|
|
1505
1495
|
}
|
|
1506
1496
|
function roundNumberToIncrement(e, t, o) {
|
|
1507
|
-
return
|
|
1497
|
+
return St[o](e / t) * t;
|
|
1508
1498
|
}
|
|
1509
1499
|
function getRoundingModeOption(e, t) {
|
|
1510
1500
|
return getOption(e, "roundingMode", [
|
|
@@ -1526,18 +1516,18 @@ function getRoundingIncrementOption(e) {
|
|
|
1526
1516
|
function isoDateToFields(e, t, o) {
|
|
1527
1517
|
const n = calendarIsoToDate(e, t);
|
|
1528
1518
|
return createNullPrototypeObject({
|
|
1529
|
-
[
|
|
1530
|
-
[
|
|
1531
|
-
[
|
|
1519
|
+
[ht.t]: o === B ? void 0 : n.t,
|
|
1520
|
+
[ht.P]: n.P,
|
|
1521
|
+
[ht.T]: o === x ? void 0 : n.T
|
|
1532
1522
|
});
|
|
1533
1523
|
}
|
|
1534
1524
|
function getDifferenceSettings(e, t, o, n, r, a) {
|
|
1535
|
-
let i = getTemporalUnitValuedOption(t, "largestUnit"
|
|
1536
|
-
const l = getRoundingIncrementOption(t), c = getRoundingModeOption(t, le), s = getTemporalUnitValuedOption(t, "smallestUnit"
|
|
1525
|
+
let i = getTemporalUnitValuedOption(t, "largestUnit") ?? "auto";
|
|
1526
|
+
const l = getRoundingIncrementOption(t), c = getRoundingModeOption(t, le), s = getTemporalUnitValuedOption(t, "smallestUnit") ?? r;
|
|
1537
1527
|
return validateTemporalUnitValue(i, o, ["auto"]), n.includes(i) && throwRangeError(disallowedUnit(i)), validateTemporalUnitValue(s, o), n.includes(s) && throwRangeError(disallowedUnit(s)), "auto" === i && (i = largerOfTwoTemporalUnits(a, s)), i > s && throwRangeError(U), isDateUnit(s) || validateTemporalRoundingIncrement(l, maximumTemporalDurationRoundingIncrement(s), !1), {
|
|
1538
1528
|
H: s,
|
|
1539
1529
|
V: i,
|
|
1540
|
-
|
|
1530
|
+
B: -1 === e ? negateRoundingMode(c) : c,
|
|
1541
1531
|
L: l
|
|
1542
1532
|
};
|
|
1543
1533
|
}
|
|
@@ -1555,16 +1545,16 @@ function epochDaysToIsoDate(e) {
|
|
|
1555
1545
|
function isoDateTimeToFields(e, t) {
|
|
1556
1546
|
return createNullPrototypeObject({
|
|
1557
1547
|
...isoDateToFields(e, t.o, V),
|
|
1558
|
-
[
|
|
1559
|
-
[
|
|
1560
|
-
[
|
|
1561
|
-
[
|
|
1562
|
-
[
|
|
1563
|
-
[
|
|
1548
|
+
[ht.D]: t.p.D,
|
|
1549
|
+
[ht.I]: t.p.I,
|
|
1550
|
+
[ht.O]: t.p.O,
|
|
1551
|
+
[ht.F]: t.p.F,
|
|
1552
|
+
[ht.S]: t.p.S,
|
|
1553
|
+
[ht.v]: t.p.v
|
|
1564
1554
|
});
|
|
1565
1555
|
}
|
|
1566
1556
|
function getInternalSlotOrThrowForDateTimeFormat(e) {
|
|
1567
|
-
return getInternalSlotOrThrow(
|
|
1557
|
+
return getInternalSlotOrThrow(yt, e);
|
|
1568
1558
|
}
|
|
1569
1559
|
function formatDateTime(e, t) {
|
|
1570
1560
|
const [o, n] = handleDateTimeValue(e, t);
|
|
@@ -1578,19 +1568,19 @@ function dateStyleToMonthStyle(e) {
|
|
|
1578
1568
|
}
|
|
1579
1569
|
function amendOptionsForPlainDate(e) {
|
|
1580
1570
|
const t = createNullPrototypeObject(e);
|
|
1581
|
-
return hasAnyOptions(e,
|
|
1571
|
+
return hasAnyOptions(e, Pt) || (hasAnyOptions(e, Et) && throwTypeError(N), t.year = t.month = t.day = "numeric"), removeDateTimeFormatOptions(t, [...Et, "timeZoneName"]), t.timeZone = "UTC", t;
|
|
1582
1572
|
}
|
|
1583
1573
|
function amendOptionsForPlainTime(e) {
|
|
1584
1574
|
const t = createNullPrototypeObject(e);
|
|
1585
|
-
return hasAnyOptions(e, Et) || (hasAnyOptions(e,
|
|
1586
|
-
...
|
|
1575
|
+
return hasAnyOptions(e, Et) || (hasAnyOptions(e, Pt) && throwTypeError(N), 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, [
|
|
1576
|
+
...Pt,
|
|
1587
1577
|
"era",
|
|
1588
1578
|
"timeZoneName"
|
|
1589
1579
|
]), t.timeZone = "UTC", t;
|
|
1590
1580
|
}
|
|
1591
1581
|
function amendOptionsForPlainDateTime(e) {
|
|
1592
1582
|
const t = createNullPrototypeObject(e);
|
|
1593
|
-
return "long" !== e.timeStyle && "full" !== e.timeStyle || (removeDateTimeFormatOptions(t, ["timeStyle"]), t.hour = t.minute = t.second = "numeric", e.dateStyle && (removeDateTimeFormatOptions(t, ["dateStyle"]), t.year = t.day = "numeric", t.month = dateStyleToMonthStyle(e.dateStyle), t.weekday = "full" === e.dateStyle ? "long" : void 0)), hasAnyOptions(e, [...
|
|
1583
|
+
return "long" !== e.timeStyle && "full" !== e.timeStyle || (removeDateTimeFormatOptions(t, ["timeStyle"]), t.hour = t.minute = t.second = "numeric", e.dateStyle && (removeDateTimeFormatOptions(t, ["dateStyle"]), t.year = t.day = "numeric", t.month = dateStyleToMonthStyle(e.dateStyle), t.weekday = "full" === e.dateStyle ? "long" : void 0)), hasAnyOptions(e, [...Pt, ...Et]) || (t.year = t.month = t.day = t.hour = t.minute = t.second = "numeric"), removeDateTimeFormatOptions(t, ["timeZoneName"]), t.timeZone = "UTC", t;
|
|
1594
1584
|
}
|
|
1595
1585
|
function amendOptionsForPlainYearMonth(e) {
|
|
1596
1586
|
const t = createNullPrototypeObject(e);
|
|
@@ -1598,7 +1588,7 @@ function amendOptionsForPlainYearMonth(e) {
|
|
|
1598
1588
|
"year",
|
|
1599
1589
|
"month",
|
|
1600
1590
|
"dateStyle"
|
|
1601
|
-
]) || (hasAnyOptions(e, [...
|
|
1591
|
+
]) || (hasAnyOptions(e, [...Pt, ...Et]) && throwTypeError(N), t.year = t.month = "numeric"), removeDateTimeFormatOptions(t, [
|
|
1602
1592
|
...Et,
|
|
1603
1593
|
"day",
|
|
1604
1594
|
"weekday",
|
|
@@ -1611,7 +1601,7 @@ function amendOptionsForPlainMonthDay(e) {
|
|
|
1611
1601
|
"month",
|
|
1612
1602
|
"day",
|
|
1613
1603
|
"dateStyle"
|
|
1614
|
-
]) || (hasAnyOptions(e, [...
|
|
1604
|
+
]) || (hasAnyOptions(e, [...Pt, ...Et]) && throwTypeError(N), t.month = t.day = "numeric"), removeDateTimeFormatOptions(t, [
|
|
1615
1605
|
...Et,
|
|
1616
1606
|
"era",
|
|
1617
1607
|
"year",
|
|
@@ -1621,7 +1611,7 @@ function amendOptionsForPlainMonthDay(e) {
|
|
|
1621
1611
|
}
|
|
1622
1612
|
function amendOptionsForInstant(e) {
|
|
1623
1613
|
const t = createNullPrototypeObject(e);
|
|
1624
|
-
return hasAnyOptions(e, [...
|
|
1614
|
+
return hasAnyOptions(e, [...Pt, ...Et]) || (t.year = t.month = t.day = t.hour = t.minute = t.second = "numeric"), t;
|
|
1625
1615
|
}
|
|
1626
1616
|
function hasAnyOptions(e, t) {
|
|
1627
1617
|
return t.some((t) => void 0 !== e[t]);
|
|
@@ -1629,15 +1619,15 @@ function hasAnyOptions(e, t) {
|
|
|
1629
1619
|
function createDateTimeFormat(e, t = createNullPrototypeObject(), o, n) {
|
|
1630
1620
|
null === t && throwTypeError(N);
|
|
1631
1621
|
const r = createNullPrototypeObject();
|
|
1632
|
-
let a = new
|
|
1622
|
+
let a = new vt(e, new Proxy({}, { get(e, o) {
|
|
1633
1623
|
const a = t[o];
|
|
1634
1624
|
return "timeZone" === o && void 0 !== n ? (void 0 !== a && throwTypeError("disallowed field: timeZone"), r[o] = n) : void 0 === a ? a : r[o] = "hour12" === o ? ((e) => !!e)(a) : "fractionalSecondDigits" === o ? Se(a) : toString(a);
|
|
1635
1625
|
} }));
|
|
1636
1626
|
return (o === V && r.timeStyle || o === L && r.dateStyle) && throwTypeError(N), r.calendar = a.resolvedOptions().calendar, void 0 === n || hasAnyOptions(r, [
|
|
1637
|
-
...
|
|
1627
|
+
...Pt,
|
|
1638
1628
|
...Et,
|
|
1639
1629
|
"timeZoneName"
|
|
1640
|
-
]) || (r.timeZoneName = "short", a = new
|
|
1630
|
+
]) || (r.timeZoneName = "short", a = new vt(a.resolvedOptions().locale, r)), createNullPrototypeObject({
|
|
1641
1631
|
Ze: a,
|
|
1642
1632
|
$e: r,
|
|
1643
1633
|
Ne: a.resolvedOptions().locale
|
|
@@ -1659,10 +1649,10 @@ function toDateTimeFormattable(e) {
|
|
|
1659
1649
|
}
|
|
1660
1650
|
function handleDateTimeValue(e, t) {
|
|
1661
1651
|
const o = getInternalSlotForPlainDate(t), n = getInternalSlotForPlainDateTime(t), r = getInternalSlotForPlainYearMonth(t), a = getInternalSlotForPlainMonthDay(t);
|
|
1662
|
-
return isPlainTime(t) ? [e.Me ||= new
|
|
1652
|
+
return isPlainTime(t) ? [e.Me ||= new vt(e.Ne, amendOptionsForPlainTime(e.$e)), epochMilliseconds(getUtcEpochNanoseconds(combineIsoDateAndTimeRecord(createIsoDateRecord(1970, 1, 1), getInternalSlotOrThrowForPlainTime(t))))] : o ? (o.U !== e.$e.calendar && "iso8601" !== o.U && throwRangeError(M), [e.Ue ||= new vt(e.Ne, amendOptionsForPlainDate(e.$e)), epochMilliseconds(getUtcEpochNanoseconds(combineIsoDateAndTimeRecord(o.o, midnightTimeRecord())))]) : n ? (n.U !== e.$e.calendar && "iso8601" !== n.U && throwRangeError(M), [e.je ||= new vt(e.Ne, amendOptionsForPlainDateTime(e.$e)), epochMilliseconds(getUtcEpochNanoseconds(n.K))]) : r ? (r.U !== e.$e.calendar && throwRangeError(M), [e.Ce ||= new vt(e.Ne, amendOptionsForPlainYearMonth(e.$e)), epochMilliseconds(getUtcEpochNanoseconds(combineIsoDateAndTimeRecord(r.o, midnightTimeRecord())))]) : a ? (a.U !== e.$e.calendar && throwRangeError(M), [e.Ye ||= new vt(e.Ne, amendOptionsForPlainMonthDay(e.$e)), epochMilliseconds(getUtcEpochNanoseconds(combineIsoDateAndTimeRecord(a.o, midnightTimeRecord())))]) : isInstant(t) ? [e.We ||= new vt(e.Ne, amendOptionsForInstant(e.$e)), epochMilliseconds(getInternalSlotOrThrowForInstant(t).Y)] : (isZonedDateTime(t) && throwTypeError($), [e.Ze, t]);
|
|
1663
1653
|
}
|
|
1664
1654
|
function DateTimeFormat(e, t) {
|
|
1665
|
-
return new
|
|
1655
|
+
return new bt(e, t);
|
|
1666
1656
|
}
|
|
1667
1657
|
function createTemporalInstant(e, t = Object.create(Mt.prototype)) {
|
|
1668
1658
|
return Nt.set(t, { Y: e }), t;
|
|
@@ -1675,7 +1665,7 @@ function toTemporalInstant$1(e) {
|
|
|
1675
1665
|
}
|
|
1676
1666
|
var t;
|
|
1677
1667
|
validateString(e);
|
|
1678
|
-
const o = parseIsoDateTime(e, [
|
|
1668
|
+
const o = parseIsoDateTime(e, [ot]), n = o.Z.M ? 0 : parseDateTimeUtcOffset(o.Z.N), r = o.p;
|
|
1679
1669
|
return createTemporalInstant(validateEpochNanoseconds(getUtcEpochNanoseconds(balanceIsoDateTime(o.t, o.u, o.T, r.D, r.I, r.O, r.F, r.S, r.v - n))));
|
|
1680
1670
|
}
|
|
1681
1671
|
function addInstant(e, t) {
|
|
@@ -1686,7 +1676,7 @@ function differenceInstant(e, t, o, n, r) {
|
|
|
1686
1676
|
}
|
|
1687
1677
|
function roundTemporalInstant(e, t, o, n) {
|
|
1688
1678
|
return (function(e, t, o) {
|
|
1689
|
-
return normalizeEpochNanoseconds(e[0], ((e, t, o) =>
|
|
1679
|
+
return normalizeEpochNanoseconds(e[0], ((e, t, o) => wt[o](e / t) * t)(e[1], t, o));
|
|
1690
1680
|
})(e, t * nanosecondsForTimeUnit(o), n);
|
|
1691
1681
|
}
|
|
1692
1682
|
function temporalInstantToString(e, t, o) {
|
|
@@ -1695,14 +1685,14 @@ function temporalInstantToString(e, t, o) {
|
|
|
1695
1685
|
}
|
|
1696
1686
|
function differenceTemporalInstant(e, t, o, n) {
|
|
1697
1687
|
const r = getInternalSlotOrThrowForInstant(toTemporalInstant$1(o)), a = getDifferenceSettings(e, getOptionsObject(n), L, [], D, T);
|
|
1698
|
-
return createTemporalDuration(applySignToDurationSlot(temporalDurationFromInternal(differenceInstant(t.Y, r.Y, a.L, a.H, a.
|
|
1688
|
+
return createTemporalDuration(applySignToDurationSlot(temporalDurationFromInternal(differenceInstant(t.Y, r.Y, a.L, a.H, a.B), a.V), e));
|
|
1699
1689
|
}
|
|
1700
1690
|
function addDurationToInstant(e, t, o) {
|
|
1701
1691
|
const n = applySignToDurationSlot(toTemporalDuration(o), e);
|
|
1702
1692
|
return isDateUnit(defaultTemporalLargestUnit(n)) && throwRangeError(durationWithDateUnit(defaultTemporalLargestUnit(n))), createTemporalInstant(addInstant(t.Y, toInternalDurationRecordWith24HourDays(n).p));
|
|
1703
1693
|
}
|
|
1704
1694
|
function validateEpochNanoseconds(e) {
|
|
1705
|
-
return ((e) => compareEpochNanoseconds(we, e) * compareEpochNanoseconds(ve, e) <= 0)(e) || throwRangeError(
|
|
1695
|
+
return ((e) => compareEpochNanoseconds(we, e) * compareEpochNanoseconds(ve, e) <= 0)(e) || throwRangeError(R), e;
|
|
1706
1696
|
}
|
|
1707
1697
|
function getInternalSlotOrThrowForInstant(e) {
|
|
1708
1698
|
return getInternalSlotOrThrow(Nt, e);
|
|
@@ -1714,10 +1704,10 @@ function clampEpochNanoseconds(e) {
|
|
|
1714
1704
|
return compareEpochNanoseconds(e, ve) > 0 ? ve : compareEpochNanoseconds(e, we) < 0 ? we : e;
|
|
1715
1705
|
}
|
|
1716
1706
|
function systemTimeZoneIdentifier() {
|
|
1717
|
-
return Yt && Wt + Yt > Date.now() && Ct ? Ct : (Wt = Date.now(), Ct = new
|
|
1707
|
+
return Yt && Wt + Yt > Date.now() && Ct ? Ct : (Wt = Date.now(), Ct = new vt().resolvedOptions().timeZone);
|
|
1718
1708
|
}
|
|
1719
1709
|
function setSystemTimeZoneIdCacheTtl(e) {
|
|
1720
|
-
Yt = e, e || (Ct = void 0, Wt = -
|
|
1710
|
+
Yt = e, e || (Ct = void 0, Wt = -1 / 0);
|
|
1721
1711
|
}
|
|
1722
1712
|
function systemUtcEpochNanoseconds() {
|
|
1723
1713
|
return createEpochNanosecondsFromEpochMilliseconds(Date.now());
|
|
@@ -1736,7 +1726,7 @@ const e = 1e6, t = 6e10, o = 36e11, n = 86400, r = 864e5, a = 864e11, i = 146097
|
|
|
1736
1726
|
"millisecond",
|
|
1737
1727
|
"microsecond",
|
|
1738
1728
|
"nanosecond"
|
|
1739
|
-
],
|
|
1729
|
+
], P = y.map((e) => `${e}s`), E = [
|
|
1740
1730
|
a,
|
|
1741
1731
|
o,
|
|
1742
1732
|
t,
|
|
@@ -1744,7 +1734,7 @@ const e = 1e6, t = 6e10, o = 36e11, n = 86400, r = 864e5, a = 864e11, i = 146097
|
|
|
1744
1734
|
1e6,
|
|
1745
1735
|
1e3,
|
|
1746
1736
|
1
|
|
1747
|
-
], missingField = (e) => `missing field: ${e}`, invalidField = (e) => `invalid field: ${e}`, parseError = (e) => `parse error: ${e}`,
|
|
1737
|
+
], missingField = (e) => `missing field: ${e}`, invalidField = (e) => `invalid field: ${e}`, parseError = (e) => `parse error: ${e}`, b = "invalid date / time", R = "out-of-bounds date", Z = "out-of-bounds duration", N = "invalid formatting options", M = "calendar mismatch", disallowedUnit = (e) => `disallowed unit: ${"auto" === e ? e : getNameFromUnit(e)}`, invalidNumber = (e) => `invalid number: ${e}`, invalidTimeZone = (e) => `invalid time zone: ${e}`, invalidMonthCode = (e) => `invalid month code:${e}`, durationWithDateUnit = (e) => `duration has a date unit: ${getNameFromUnit(e)}`, U = "invalid `largestUnit` and `smallestUnit` options", j = "mismatch of `month` and `monthCode`", $ = "value is not formattable", notObject = (e) => `not object: ${e}`, C = "empty fields", Y = "can't convert Temporal classes to number", W = "argument is undefined", A = globalThis.Intl.DurationFormat, z = /* @__PURE__ */ new WeakMap();
|
|
1748
1738
|
var k = class {
|
|
1749
1739
|
static supportedLocalesOf(e, t = void 0) {
|
|
1750
1740
|
return A.supportedLocalesOf(e, t);
|
|
@@ -1763,8 +1753,8 @@ var k = class {
|
|
|
1763
1753
|
}
|
|
1764
1754
|
};
|
|
1765
1755
|
defineStringTag(k.prototype, "Intl.DurationFormat"), renameFunction(k, "DurationFormat");
|
|
1766
|
-
const V = Symbol(), L = Symbol(), H = Symbol(), x = Symbol(),
|
|
1767
|
-
var
|
|
1756
|
+
const V = Symbol(), L = Symbol(), H = Symbol(), x = Symbol(), B = Symbol(), q = Symbol(), J = Symbol(), _ = "constrain", X = "reject", G = "compatible", K = "later", Q = "prefer", ee = "reject", te = Symbol(), oe = Symbol(), ne = Symbol(), re = "ceil", ae = "floor", ie = "expand", le = "trunc", ce = "halfCeil", se = "halfFloor", de = "halfExpand", me = "halfTrunc", ue = "halfEven", Te = "auto", De = "always", pe = "never", he = "critical", ge = "auto", fe = "never", Ie = "auto", Oe = "never", Fe = "critical", Se = Math.max, we = createEpochNanosecondsFromEpochMilliseconds(-864e13), ve = createEpochNanosecondsFromEpochMilliseconds(864e13), ye = [0, 0], Pe = compareEpochNanoseconds, Ee = /* @__PURE__ */ new WeakMap();
|
|
1757
|
+
var be = class {
|
|
1768
1758
|
constructor(e, t, o = "iso8601") {
|
|
1769
1759
|
const n = validateEpochNanoseconds(createEpochNanosecondsFromBigInt(toBigInt(e)));
|
|
1770
1760
|
validateString(t);
|
|
@@ -1867,21 +1857,21 @@ var Re = class {
|
|
|
1867
1857
|
validatePartialTemporalObject(e);
|
|
1868
1858
|
const n = getOffsetNanosecondsForZonedDateTimeSlot(o), r = getIsoDateTimeForZonedDateTimeSlot(o), a = calendarMergeFields(o.U, createNullPrototypeObject({
|
|
1869
1859
|
...isoDateTimeToFields(o.U, r),
|
|
1870
|
-
[
|
|
1860
|
+
[ht.R]: formatUtcOffsetNanoseconds(n)
|
|
1871
1861
|
}), prepareCalendarFields(o.U, e, [
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1862
|
+
ht.t,
|
|
1863
|
+
ht.u,
|
|
1864
|
+
ht.P,
|
|
1865
|
+
ht.T,
|
|
1866
|
+
ht.D,
|
|
1867
|
+
ht.I,
|
|
1868
|
+
ht.O,
|
|
1869
|
+
ht.F,
|
|
1870
|
+
ht.S,
|
|
1871
|
+
ht.v,
|
|
1872
|
+
ht.R
|
|
1883
1873
|
])), i = getOptionsObject(t), l = getTemporalDisambiguationOption(i), c = getTemporalOffsetOption(i, Q), s = getTemporalOverflowOption(i), d = interpretTemporalDateTimeFields(o.U, a, s);
|
|
1884
|
-
return createTemporalZonedDateTime(interpretISODateTimeOffset(d.o, d.p, te, parseDateTimeUtcOffset(a[
|
|
1874
|
+
return createTemporalZonedDateTime(interpretISODateTimeOffset(d.o, d.p, te, parseDateTimeUtcOffset(a[ht.R]), o.Z, l, c, !0), o.Z, o.U);
|
|
1885
1875
|
}
|
|
1886
1876
|
withPlainTime(e = void 0) {
|
|
1887
1877
|
const t = getInternalSlotOrThrowForZonedDateTime(this), o = getIsoDateTimeForZonedDateTimeSlot(t);
|
|
@@ -1908,7 +1898,7 @@ var Re = class {
|
|
|
1908
1898
|
return differenceTemporalZonedDateTime(-1, getInternalSlotOrThrowForZonedDateTime(this), e, t);
|
|
1909
1899
|
}
|
|
1910
1900
|
round(e) {
|
|
1911
|
-
const t = getInternalSlotOrThrowForZonedDateTime(this), o = getRoundToOptionsObject(e), n = getRoundingIncrementOption(o), r = getRoundingModeOption(o, "halfExpand"), a = getTemporalUnitValuedOption(o, "smallestUnit",
|
|
1901
|
+
const t = getInternalSlotOrThrowForZonedDateTime(this), o = getRoundToOptionsObject(e), n = getRoundingIncrementOption(o), r = getRoundingModeOption(o, "halfExpand"), a = getTemporalUnitValuedOption(o, "smallestUnit", q);
|
|
1912
1902
|
if (validateTemporalUnitValue(a, L, [d]), validateTemporalRoundingIncrement(n, a === d ? 1 : maximumTemporalDurationRoundingIncrement(a), a === d), a === D && 1 === n) return createTemporalZonedDateTimeFromSlot(t);
|
|
1913
1903
|
const i = getIsoDateTimeForZonedDateTimeSlot(t);
|
|
1914
1904
|
if (a === d) {
|
|
@@ -1923,7 +1913,7 @@ var Re = class {
|
|
|
1923
1913
|
return !compareEpochNanoseconds(t.Y, o.Y) && timeZoneEquals(t.Z, o.Z) && calendarEquals(t.U, o.U);
|
|
1924
1914
|
}
|
|
1925
1915
|
toString(e = void 0) {
|
|
1926
|
-
const t = getInternalSlotOrThrowForZonedDateTime(this), o = getOptionsObject(e), n = getTemporalShowCalendarNameOption(o), r = getTemporalFractionalSecondDigitsOption(o), a = ((e) => getOption(e, "offset", [ge, fe], ge))(o), i = getRoundingModeOption(o, le), l = getTemporalUnitValuedOption(o, "smallestUnit"
|
|
1916
|
+
const t = getInternalSlotOrThrowForZonedDateTime(this), o = getOptionsObject(e), n = getTemporalShowCalendarNameOption(o), r = getTemporalFractionalSecondDigitsOption(o), a = ((e) => getOption(e, "offset", [ge, fe], ge))(o), i = getRoundingModeOption(o, le), l = getTemporalUnitValuedOption(o, "smallestUnit"), c = ((e) => getOption(e, "timeZoneName", [
|
|
1927
1917
|
Ie,
|
|
1928
1918
|
Oe,
|
|
1929
1919
|
Fe
|
|
@@ -1949,10 +1939,9 @@ var Re = class {
|
|
|
1949
1939
|
getTimeZoneTransition(e) {
|
|
1950
1940
|
const t = getInternalSlotOrThrowForZonedDateTime(this);
|
|
1951
1941
|
void 0 === e && throwTypeError(W);
|
|
1952
|
-
const o = getOption("string" == typeof e ? { direction: e } : getOptionsObject(e), "direction", ["next", "previous"],
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
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);
|
|
1942
|
+
const o = getOption("string" == typeof e ? { direction: e } : getOptionsObject(e), "direction", ["next", "previous"], q), n = ((e, t, o) => {
|
|
1943
|
+
const n = -4e9, r = Math.floor((Date.now() + 31536e7) / 1e3), a = clamp(epochSeconds(addNanosecondsToEpochSeconds(t, o > 0 ? 0 : -1)), n, 1 / 0);
|
|
1944
|
+
return "UTC" === e || isOffsetTimeZoneIdentifier(e) ? null : -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, Math.max(a + 31536e3, r), o);
|
|
1956
1945
|
})(t.Z, t.Y, "next" === o ? 1 : -1);
|
|
1957
1946
|
return null === n ? null : createTemporalZonedDateTime(n, t.Z, t.U);
|
|
1958
1947
|
}
|
|
@@ -1971,9 +1960,9 @@ var Re = class {
|
|
|
1971
1960
|
return createTemporalDateTime(getIsoDateTimeForZonedDateTimeSlot(e), e.U);
|
|
1972
1961
|
}
|
|
1973
1962
|
};
|
|
1974
|
-
defineStringTag(
|
|
1975
|
-
const
|
|
1976
|
-
var
|
|
1963
|
+
defineStringTag(be.prototype, "Temporal.ZonedDateTime"), renameFunction(be, "ZonedDateTime");
|
|
1964
|
+
const Re = globalThis.Temporal, Ze = createNullPrototypeObject(), Ne = createNullPrototypeObject(), Me = /* @__PURE__ */ new WeakMap();
|
|
1965
|
+
var Ue = class {
|
|
1977
1966
|
constructor(e, t, o, n = 0, r = 0, a = 0, i = 0, l = 0, c = 0, s = "iso8601") {
|
|
1978
1967
|
const d = [
|
|
1979
1968
|
e,
|
|
@@ -1989,7 +1978,7 @@ var Me = class {
|
|
|
1989
1978
|
].map(toIntegerWithTruncation);
|
|
1990
1979
|
validateString(s);
|
|
1991
1980
|
const u = canonicalizeCalendar(s);
|
|
1992
|
-
|
|
1981
|
+
createTemporalDateTime(combineIsoDateAndTimeRecord(createIsoDateRecord(...d), createTimeRecord(...m)), u, this);
|
|
1993
1982
|
}
|
|
1994
1983
|
static from(e, t = void 0) {
|
|
1995
1984
|
return toTemporalDateTime(e, t);
|
|
@@ -2067,16 +2056,16 @@ var Me = class {
|
|
|
2067
2056
|
const o = getInternalSlotOrThrowForPlainDateTime(this);
|
|
2068
2057
|
validatePartialTemporalObject(e);
|
|
2069
2058
|
const n = calendarMergeFields(o.U, isoDateTimeToFields(o.U, o.K), prepareCalendarFields(o.U, e, [
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2059
|
+
ht.t,
|
|
2060
|
+
ht.u,
|
|
2061
|
+
ht.P,
|
|
2062
|
+
ht.T,
|
|
2063
|
+
ht.D,
|
|
2064
|
+
ht.I,
|
|
2065
|
+
ht.O,
|
|
2066
|
+
ht.F,
|
|
2067
|
+
ht.S,
|
|
2068
|
+
ht.v
|
|
2080
2069
|
]));
|
|
2081
2070
|
return createTemporalDateTime(interpretTemporalDateTimeFields(o.U, n, getTemporalOverflowOption(getOptionsObject(t))), o.U);
|
|
2082
2071
|
}
|
|
@@ -2100,7 +2089,7 @@ var Me = class {
|
|
|
2100
2089
|
return differenceTemporalPlainDateTime(-1, getInternalSlotOrThrowForPlainDateTime(this), e, t);
|
|
2101
2090
|
}
|
|
2102
2091
|
round(e) {
|
|
2103
|
-
const t = getInternalSlotOrThrowForPlainDateTime(this), o = getRoundToOptionsObject(e), n = getRoundingIncrementOption(o), r = getRoundingModeOption(o, "halfExpand"), a = getTemporalUnitValuedOption(o, "smallestUnit",
|
|
2092
|
+
const t = getInternalSlotOrThrowForPlainDateTime(this), o = getRoundToOptionsObject(e), n = getRoundingIncrementOption(o), r = getRoundingModeOption(o, "halfExpand"), a = getTemporalUnitValuedOption(o, "smallestUnit", q);
|
|
2104
2093
|
return validateTemporalUnitValue(a, L, [d]), validateTemporalRoundingIncrement(n, a === d ? 1 : maximumTemporalDurationRoundingIncrement(a), a === d), createTemporalDateTime(roundIsoDateTime(t.K, n, a, r), t.U);
|
|
2105
2094
|
}
|
|
2106
2095
|
equals(e) {
|
|
@@ -2108,7 +2097,7 @@ var Me = class {
|
|
|
2108
2097
|
return !compareIsoDateTime(t.K, o.K) && calendarEquals(t.U, o.U);
|
|
2109
2098
|
}
|
|
2110
2099
|
toString(e = void 0) {
|
|
2111
|
-
const t = getInternalSlotOrThrowForPlainDateTime(this), o = getOptionsObject(e), n = getTemporalShowCalendarNameOption(o), r = getTemporalFractionalSecondDigitsOption(o), a = getRoundingModeOption(o, le), i = getTemporalUnitValuedOption(o, "smallestUnit"
|
|
2100
|
+
const t = getInternalSlotOrThrowForPlainDateTime(this), o = getOptionsObject(e), n = getTemporalShowCalendarNameOption(o), r = getTemporalFractionalSecondDigitsOption(o), a = getRoundingModeOption(o, le), i = getTemporalUnitValuedOption(o, "smallestUnit");
|
|
2112
2101
|
validateTemporalUnitValue(i, L), i === m && throwRangeError(invalidField("smallestUnit"));
|
|
2113
2102
|
const l = toSecondsStringPrecisionRecord(i, r);
|
|
2114
2103
|
return isoDateTimeToString(validateIsoDateTime(roundIsoDateTime(t.K, l.Pe, l.Ee, a)), t.U, l.ye, n);
|
|
@@ -2135,19 +2124,18 @@ var Me = class {
|
|
|
2135
2124
|
return createTemporalTime(getInternalSlotOrThrowForPlainDateTime(this).K.p);
|
|
2136
2125
|
}
|
|
2137
2126
|
};
|
|
2138
|
-
defineStringTag(
|
|
2139
|
-
const
|
|
2140
|
-
var
|
|
2127
|
+
defineStringTag(Ue.prototype, "Temporal.PlainDateTime"), renameFunction(Ue, "PlainDateTime");
|
|
2128
|
+
const je = /* @__PURE__ */ new WeakMap();
|
|
2129
|
+
var $e = class {
|
|
2141
2130
|
constructor(e = 0, t = 0, o = 0, n = 0, r = 0, a = 0) {
|
|
2142
|
-
|
|
2131
|
+
createTemporalTime(createTimeRecord(...[
|
|
2143
2132
|
e,
|
|
2144
2133
|
t,
|
|
2145
2134
|
o,
|
|
2146
2135
|
n,
|
|
2147
2136
|
r,
|
|
2148
2137
|
a
|
|
2149
|
-
].map(toIntegerWithTruncation);
|
|
2150
|
-
isValidTime(...i) || throwRangeError(R), createTemporalTime(createTimeRecord(...i), this);
|
|
2138
|
+
].map(toIntegerWithTruncation)), this);
|
|
2151
2139
|
}
|
|
2152
2140
|
static from(e, t = void 0) {
|
|
2153
2141
|
return createTemporalTime(toTemporalTime(e, t));
|
|
@@ -2197,14 +2185,14 @@ var je = class {
|
|
|
2197
2185
|
return differenceTemporalPlainTime(-1, getInternalSlotOrThrowForPlainTime(this), e, t);
|
|
2198
2186
|
}
|
|
2199
2187
|
round(e) {
|
|
2200
|
-
const t = getInternalSlotOrThrowForPlainTime(this), o = getRoundToOptionsObject(e), n = getRoundingIncrementOption(o), r = getRoundingModeOption(o, de), a = getTemporalUnitValuedOption(o, "smallestUnit",
|
|
2188
|
+
const t = getInternalSlotOrThrowForPlainTime(this), o = getRoundToOptionsObject(e), n = getRoundingIncrementOption(o), r = getRoundingModeOption(o, de), a = getTemporalUnitValuedOption(o, "smallestUnit", q);
|
|
2201
2189
|
return validateTemporalUnitValue(a, L), validateTemporalRoundingIncrement(n, maximumTemporalDurationRoundingIncrement(a), !1), createTemporalTime(roundTime(t, n, a, r));
|
|
2202
2190
|
}
|
|
2203
2191
|
equals(e) {
|
|
2204
2192
|
return !compareTimeRecord(getInternalSlotOrThrowForPlainTime(this), toTemporalTime(e));
|
|
2205
2193
|
}
|
|
2206
2194
|
toString(e = void 0) {
|
|
2207
|
-
const t = getInternalSlotOrThrowForPlainTime(this), o = getOptionsObject(e), n = getTemporalFractionalSecondDigitsOption(o), r = getRoundingModeOption(o, le), a = getTemporalUnitValuedOption(o, "smallestUnit"
|
|
2195
|
+
const t = getInternalSlotOrThrowForPlainTime(this), o = getOptionsObject(e), n = getTemporalFractionalSecondDigitsOption(o), r = getRoundingModeOption(o, le), a = getTemporalUnitValuedOption(o, "smallestUnit");
|
|
2208
2196
|
validateTemporalUnitValue(a, L), a === m && throwRangeError(invalidField("smallestUnit"));
|
|
2209
2197
|
const i = toSecondsStringPrecisionRecord(a, n);
|
|
2210
2198
|
return timeRecordToString(roundTime(t, i.Pe, i.Ee, r), i.ye);
|
|
@@ -2219,32 +2207,32 @@ var je = class {
|
|
|
2219
2207
|
throwTypeError(Y);
|
|
2220
2208
|
}
|
|
2221
2209
|
};
|
|
2222
|
-
defineStringTag(
|
|
2223
|
-
const
|
|
2224
|
-
`(?<d>${
|
|
2225
|
-
`(?<y>:?)(?<e>${
|
|
2210
|
+
defineStringTag($e.prototype, "Temporal.PlainTime"), renameFunction($e, "PlainTime");
|
|
2211
|
+
const Ce = "\\d{4}|[-+]\\d{6}", Ye = "0[1-9]|1[0-2]", We = "0[1-9]|[12]\\d|30|31", Ae = "[01]\\d|2[0-3]", ze = "[0-5]\\d", ke = `(?<a>${Ce})(?<x>-?)(?<b>${Ye})\\k<x>(?<c>${We})`, Ve = optionalChain([
|
|
2212
|
+
`(?<d>${Ae})`,
|
|
2213
|
+
`(?<y>:?)(?<e>${ze})`,
|
|
2226
2214
|
"\\k<y>(?<f>[0-5]\\d|60)",
|
|
2227
2215
|
"[.,](?<g>\\d{1,9})"
|
|
2228
|
-
]), Ve = optionalChain([
|
|
2229
|
-
`([+-])(${We})`,
|
|
2230
|
-
`(?<z>:?)(${Ae})`,
|
|
2231
|
-
`\\k<z>(${Ae})`,
|
|
2232
|
-
"[.,](\\d{1,9})"
|
|
2233
2216
|
]), Le = optionalChain([
|
|
2234
|
-
|
|
2235
|
-
`
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
|
|
2217
|
+
`([+-])(${Ae})`,
|
|
2218
|
+
`(?<z>:?)(${ze})`,
|
|
2219
|
+
`\\k<z>(${ze})`,
|
|
2220
|
+
"[.,](\\d{1,9})"
|
|
2221
|
+
]), He = optionalChain([
|
|
2222
|
+
ke,
|
|
2223
|
+
`[ tT]${Ve}`,
|
|
2224
|
+
`(?<h>${Le})`
|
|
2225
|
+
]), xe = `(?<l>${Ce})-?(?<m>${Ye})`, Be = `(?:--)?(?<m>${Ye})-?(?<n>${We})`, qe = `(?<h>${Le})|(?<i>[zZ])`, Je = `([+-])(${Ae})(?::?(${ze}))?|${join("[a-zA-Z._][a-zA-Z._+-\\d]*", "\\/")}`, _e = `\\[!?(?<j>${Je})\\]`, Xe = join("[a-zA-Z\\d]+", "-"), Ge = `\\[(!)?([a-z_][a-z\\d_-]*)=(${Xe})\\]`, Ke = `(?<k>(${Ge})*)`, Qe = RegExp(Ge, "g"), et = createRegExp(`${optionalChain([
|
|
2226
|
+
ke,
|
|
2227
|
+
`[ tT]${Ve}`,
|
|
2240
2228
|
qe
|
|
2241
|
-
])}${
|
|
2242
|
-
var
|
|
2229
|
+
])}${_e}${Ke}`), tt = createRegExp(`${He}(?:${_e})?${Ke}`), ot = createRegExp(`${ke}[ tT]${Ve}(?:${qe})(?:${_e})?${Ke}`), nt = createRegExp(`(${ke}[ tT]|[tT]?)${Ve}(?<h>${Le})?(?:${_e})?${Ke}`), rt = createRegExp(`(${He}|${Be})(?:${_e})?${Ke}`), at = createRegExp(`(${He}|${xe})(?:${_e})?${Ke}`), it = [createRegExp(`${Be}(${_e})?(${Ge})*`), createRegExp(`${xe}(${_e})?(${Ge})*`)], lt = createRegExp(Je), ct = createRegExp(Xe), st = createRegExp(Le), dt = /* @__PURE__ */ new WeakMap();
|
|
2230
|
+
var mt = class {
|
|
2243
2231
|
constructor(e, t, o = "iso8601", n = 1972) {
|
|
2244
2232
|
const r = toIntegerWithTruncation(e), a = toIntegerWithTruncation(t);
|
|
2245
2233
|
validateString(o);
|
|
2246
|
-
const i = canonicalizeCalendar(o)
|
|
2247
|
-
|
|
2234
|
+
const i = canonicalizeCalendar(o);
|
|
2235
|
+
createTemporalMonthDay(createIsoDateRecord(toIntegerWithTruncation(n), r, a), i, this);
|
|
2248
2236
|
}
|
|
2249
2237
|
static from(e, t = void 0) {
|
|
2250
2238
|
return toTemporalMonthDay(e, t);
|
|
@@ -2262,11 +2250,11 @@ var dt = class {
|
|
|
2262
2250
|
}
|
|
2263
2251
|
with(e, t = void 0) {
|
|
2264
2252
|
const o = getInternalSlotOrThrowForPlainMonthDay(this);
|
|
2265
|
-
return validatePartialTemporalObject(e), createTemporalMonthDay(calendarMonthDayFromFields(o.U, calendarMergeFields(o.U, isoDateToFields(o.U, o.o,
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2253
|
+
return validatePartialTemporalObject(e), createTemporalMonthDay(calendarMonthDayFromFields(o.U, calendarMergeFields(o.U, isoDateToFields(o.U, o.o, B), prepareCalendarFields(o.U, e, [
|
|
2254
|
+
ht.t,
|
|
2255
|
+
ht.u,
|
|
2256
|
+
ht.P,
|
|
2257
|
+
ht.T
|
|
2270
2258
|
])), getTemporalOverflowOption(getOptionsObject(t))), o.U);
|
|
2271
2259
|
}
|
|
2272
2260
|
equals(e) {
|
|
@@ -2287,17 +2275,17 @@ var dt = class {
|
|
|
2287
2275
|
}
|
|
2288
2276
|
toPlainDate(e) {
|
|
2289
2277
|
const t = getInternalSlotOrThrowForPlainMonthDay(this);
|
|
2290
|
-
return isObject(e) || throwTypeError(notObject(e)), createTemporalDate(calendarDateFromFields(t.U, calendarMergeFields(t.U, isoDateToFields(t.U, t.o,
|
|
2278
|
+
return isObject(e) || throwTypeError(notObject(e)), createTemporalDate(calendarDateFromFields(t.U, calendarMergeFields(t.U, isoDateToFields(t.U, t.o, B), prepareCalendarFields(t.U, e, [ht.t], [])), _), t.U);
|
|
2291
2279
|
}
|
|
2292
2280
|
};
|
|
2293
|
-
defineStringTag(
|
|
2294
|
-
const
|
|
2295
|
-
var
|
|
2281
|
+
defineStringTag(mt.prototype, "Temporal.PlainMonthDay"), renameFunction(mt, "PlainMonthDay");
|
|
2282
|
+
const ut = /* @__PURE__ */ new WeakMap();
|
|
2283
|
+
var Tt = class {
|
|
2296
2284
|
constructor(e, t, o = "iso8601", n = 1) {
|
|
2297
2285
|
const r = toIntegerWithTruncation(e), a = toIntegerWithTruncation(t);
|
|
2298
2286
|
validateString(o);
|
|
2299
|
-
const i = canonicalizeCalendar(o)
|
|
2300
|
-
|
|
2287
|
+
const i = canonicalizeCalendar(o);
|
|
2288
|
+
createTemporalYearMonth(createIsoDateRecord(r, a, toIntegerWithTruncation(n)), i, this);
|
|
2301
2289
|
}
|
|
2302
2290
|
static from(e, t = void 0) {
|
|
2303
2291
|
return toTemporalYearMonth(e, t);
|
|
@@ -2339,9 +2327,9 @@ var ut = class {
|
|
|
2339
2327
|
const o = getInternalSlotOrThrowForPlainYearMonth(this);
|
|
2340
2328
|
validatePartialTemporalObject(e);
|
|
2341
2329
|
const n = calendarMergeFields(o.U, isoDateToFields(o.U, o.o, x), prepareCalendarFields(o.U, e, [
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2330
|
+
ht.t,
|
|
2331
|
+
ht.u,
|
|
2332
|
+
ht.P
|
|
2345
2333
|
]));
|
|
2346
2334
|
return createTemporalYearMonth(calendarYearMonthFromFields(o.U, n, getTemporalOverflowOption(getOptionsObject(t))), o.U);
|
|
2347
2335
|
}
|
|
@@ -2375,17 +2363,17 @@ var ut = class {
|
|
|
2375
2363
|
}
|
|
2376
2364
|
toPlainDate(e) {
|
|
2377
2365
|
const t = getInternalSlotOrThrowForPlainYearMonth(this);
|
|
2378
|
-
return isObject(e) || throwTypeError(notObject(e)), createTemporalDate(calendarDateFromFields(t.U, calendarMergeFields(t.U, isoDateToFields(t.U, t.o, x), prepareCalendarFields(t.U, e, [
|
|
2366
|
+
return isObject(e) || throwTypeError(notObject(e)), createTemporalDate(calendarDateFromFields(t.U, calendarMergeFields(t.U, isoDateToFields(t.U, t.o, x), prepareCalendarFields(t.U, e, [ht.T], [])), _), t.U);
|
|
2379
2367
|
}
|
|
2380
2368
|
};
|
|
2381
|
-
defineStringTag(
|
|
2382
|
-
const
|
|
2383
|
-
var
|
|
2369
|
+
defineStringTag(Tt.prototype, "Temporal.PlainYearMonth"), renameFunction(Tt, "PlainYearMonth");
|
|
2370
|
+
const Dt = /* @__PURE__ */ new WeakMap();
|
|
2371
|
+
var pt = class {
|
|
2384
2372
|
constructor(e, t, o, n = "iso8601") {
|
|
2385
2373
|
const r = toIntegerWithTruncation(e), a = toIntegerWithTruncation(t), i = toIntegerWithTruncation(o);
|
|
2386
2374
|
validateString(n);
|
|
2387
2375
|
const l = canonicalizeCalendar(n);
|
|
2388
|
-
|
|
2376
|
+
createTemporalDate(createIsoDateRecord(r, a, i), l, this);
|
|
2389
2377
|
}
|
|
2390
2378
|
static from(e, t = void 0) {
|
|
2391
2379
|
return toTemporalDate(e, t);
|
|
@@ -2459,10 +2447,10 @@ var Dt = class {
|
|
|
2459
2447
|
const o = getInternalSlotOrThrowForPlainDate(this);
|
|
2460
2448
|
validatePartialTemporalObject(e);
|
|
2461
2449
|
const n = calendarMergeFields(o.U, isoDateToFields(o.U, o.o, V), prepareCalendarFields(o.U, e, [
|
|
2462
|
-
|
|
2463
|
-
|
|
2464
|
-
|
|
2465
|
-
|
|
2450
|
+
ht.t,
|
|
2451
|
+
ht.u,
|
|
2452
|
+
ht.P,
|
|
2453
|
+
ht.T
|
|
2466
2454
|
])), r = getTemporalOverflowOption(getOptionsObject(t));
|
|
2467
2455
|
return createTemporalDate(calendarDateFromFields(o.U, n, r), o.U);
|
|
2468
2456
|
}
|
|
@@ -2505,8 +2493,8 @@ var Dt = class {
|
|
|
2505
2493
|
throwTypeError(Y);
|
|
2506
2494
|
}
|
|
2507
2495
|
};
|
|
2508
|
-
defineStringTag(
|
|
2509
|
-
const
|
|
2496
|
+
defineStringTag(pt.prototype, "Temporal.PlainDate"), renameFunction(pt, "PlainDate");
|
|
2497
|
+
const ht = {
|
|
2510
2498
|
ne: "era",
|
|
2511
2499
|
re: "eraYear",
|
|
2512
2500
|
t: "year",
|
|
@@ -2521,41 +2509,41 @@ const pt = {
|
|
|
2521
2509
|
v: "nanosecond",
|
|
2522
2510
|
R: "offset",
|
|
2523
2511
|
Z: "timeZone"
|
|
2524
|
-
},
|
|
2525
|
-
|
|
2526
|
-
|
|
2527
|
-
|
|
2528
|
-
|
|
2529
|
-
|
|
2530
|
-
|
|
2531
|
-
|
|
2532
|
-
|
|
2533
|
-
|
|
2534
|
-
|
|
2535
|
-
|
|
2536
|
-
|
|
2537
|
-
|
|
2538
|
-
|
|
2539
|
-
],
|
|
2540
|
-
[
|
|
2541
|
-
[
|
|
2542
|
-
[
|
|
2543
|
-
[
|
|
2544
|
-
[
|
|
2545
|
-
[
|
|
2546
|
-
[
|
|
2547
|
-
[
|
|
2548
|
-
[
|
|
2549
|
-
[
|
|
2550
|
-
[
|
|
2551
|
-
[
|
|
2552
|
-
[
|
|
2512
|
+
}, gt = [
|
|
2513
|
+
ht.ne,
|
|
2514
|
+
ht.re,
|
|
2515
|
+
ht.t,
|
|
2516
|
+
ht.u,
|
|
2517
|
+
ht.P,
|
|
2518
|
+
ht.T,
|
|
2519
|
+
ht.D,
|
|
2520
|
+
ht.I,
|
|
2521
|
+
ht.O,
|
|
2522
|
+
ht.F,
|
|
2523
|
+
ht.S,
|
|
2524
|
+
ht.v,
|
|
2525
|
+
ht.R,
|
|
2526
|
+
ht.Z
|
|
2527
|
+
], ft = {
|
|
2528
|
+
[ht.ne]: [toString],
|
|
2529
|
+
[ht.re]: [toIntegerWithTruncation],
|
|
2530
|
+
[ht.t]: [toIntegerWithTruncation],
|
|
2531
|
+
[ht.u]: [toPositiveIntegerWithTruncation],
|
|
2532
|
+
[ht.P]: [(e) => createMonthCode(...parseMonthCode(e))],
|
|
2533
|
+
[ht.T]: [toPositiveIntegerWithTruncation],
|
|
2534
|
+
[ht.D]: [toIntegerWithTruncation, 0],
|
|
2535
|
+
[ht.I]: [toIntegerWithTruncation, 0],
|
|
2536
|
+
[ht.O]: [toIntegerWithTruncation, 0],
|
|
2537
|
+
[ht.F]: [toIntegerWithTruncation, 0],
|
|
2538
|
+
[ht.S]: [toIntegerWithTruncation, 0],
|
|
2539
|
+
[ht.v]: [toIntegerWithTruncation, 0],
|
|
2540
|
+
[ht.R]: [(e) => {
|
|
2553
2541
|
const t = toPrimitive(e);
|
|
2554
2542
|
return validateString(t), parseDateTimeUtcOffset(t), t;
|
|
2555
2543
|
}],
|
|
2556
|
-
[
|
|
2557
|
-
},
|
|
2558
|
-
var
|
|
2544
|
+
[ht.Z]: [toTemporalTimeZoneIdentifier]
|
|
2545
|
+
}, It = /* @__PURE__ */ new WeakMap(), Ot = signTimeDuration;
|
|
2546
|
+
var Ft = class {
|
|
2559
2547
|
constructor(e = 0, t = 0, o = 0, n = 0, r = 0, a = 0, i = 0, l = 0, c = 0, s = 0) {
|
|
2560
2548
|
createTemporalDuration(createTemporalDurationSlot([
|
|
2561
2549
|
e,
|
|
@@ -2578,7 +2566,7 @@ var Ot = class {
|
|
|
2578
2566
|
if (!n.some((e, t) => r[t] !== e)) return 0;
|
|
2579
2567
|
const i = defaultTemporalLargestUnit(n), l = defaultTemporalLargestUnit(r), c = toInternalDurationRecord(n), s = toInternalDurationRecord(r);
|
|
2580
2568
|
let d, m;
|
|
2581
|
-
return a.Re && (isDateUnit(i) || isDateUnit(l)) ? compareEpochNanoseconds(addZonedDateTime(a.Re, c, _), addZonedDateTime(a.Re, s, _)) : (isCalendarUnit(i) || isCalendarUnit(l) ? (a.be || throwRangeError(missingField("relativeTo")), d = dateDurationDays(c.A, a.be), m = dateDurationDays(s.A, a.be)) : (d = n[f], m = r[f]),
|
|
2569
|
+
return a.Re && (isDateUnit(i) || isDateUnit(l)) ? compareEpochNanoseconds(addZonedDateTime(a.Re, c, _), addZonedDateTime(a.Re, s, _)) : (isCalendarUnit(i) || isCalendarUnit(l) ? (a.be || throwRangeError(missingField("relativeTo")), d = dateDurationDays(c.A, a.be), m = dateDurationDays(s.A, a.be)) : (d = n[f], m = r[f]), Pe(add24HourDaysToTimeDuration(c.p, d), add24HourDaysToTimeDuration(s.p, m)));
|
|
2582
2570
|
}
|
|
2583
2571
|
get years() {
|
|
2584
2572
|
return getInternalSlotOrThrowForDuration(this)[p];
|
|
@@ -2634,26 +2622,24 @@ var Ot = class {
|
|
|
2634
2622
|
}
|
|
2635
2623
|
round(e) {
|
|
2636
2624
|
const t = getInternalSlotOrThrowForDuration(this), o = getRoundToOptionsObject(e);
|
|
2637
|
-
let n = getTemporalUnitValuedOption(o, "largestUnit"
|
|
2625
|
+
let n = getTemporalUnitValuedOption(o, "largestUnit");
|
|
2638
2626
|
const r = getTemporalRelativeToOption(o), a = getRoundingIncrementOption(o), i = getRoundingModeOption(o, de);
|
|
2639
|
-
let l = getTemporalUnitValuedOption(o, "smallestUnit"
|
|
2627
|
+
let l = getTemporalUnitValuedOption(o, "smallestUnit");
|
|
2640
2628
|
validateTemporalUnitValue(l, H);
|
|
2641
|
-
const c = void 0
|
|
2642
|
-
l ??= D;
|
|
2643
|
-
const s = defaultTemporalLargestUnit(t), u = largerOfTwoTemporalUnits(s, l), T = void 0 !== n;
|
|
2644
|
-
if (void 0 !== n && "auto" !== n || (n = u), (!c && !T || n > l) && throwRangeError(U), isDateUnit(l) || validateTemporalRoundingIncrement(a, maximumTemporalDurationRoundingIncrement(l), !1), a > 1 && n !== l && isDateUnit(l) && throwRangeError(U), r.Re) return createTemporalDuration(temporalDurationFromInternal(differenceZonedDateTimeWithRounding(r.Re, createZonedDateTimeSlot(addZonedDateTime(r.Re, toInternalDurationRecord(t), _), r.Re.Z, r.Re.U), n, a, l, i), isDateUnit(n) ? m : n));
|
|
2629
|
+
const c = defaultTemporalLargestUnit(t), s = void 0 === l && void 0 === n;
|
|
2630
|
+
if (l ??= D, void 0 !== n && "auto" !== n || (n = largerOfTwoTemporalUnits(c, l)), (s || n > l) && throwRangeError(U), isDateUnit(l) || validateTemporalRoundingIncrement(a, maximumTemporalDurationRoundingIncrement(l), !1), a > 1 && n !== l && isDateUnit(l) && throwRangeError(U), r.Re) return createTemporalDuration(temporalDurationFromInternal(differenceZonedDateTimeWithRounding(r.Re, createZonedDateTimeSlot(addZonedDateTime(r.Re, toInternalDurationRecord(t), _), r.Re.Z, r.Re.U), n, a, l, i), isDateUnit(n) ? m : n));
|
|
2645
2631
|
if (r.be) {
|
|
2646
2632
|
const e = toInternalDurationRecordWith24HourDays(t), o = addTime(midnightTimeRecord(), e.p);
|
|
2647
2633
|
return createTemporalDuration(temporalDurationFromInternal(differencePlainDateTimeWithRounding(combineIsoDateAndTimeRecord(r.be.o, midnightTimeRecord()), combineIsoDateAndTimeRecord(calendarDateAdd(r.be.U, r.be.o, adjustDateDurationRecord(e.A, o.X), _), o), r.be.U, n, a, l, i), n));
|
|
2648
2634
|
}
|
|
2649
|
-
(isCalendarUnit(
|
|
2650
|
-
const
|
|
2651
|
-
return createTemporalDuration(temporalDurationFromInternal(l === d ? combineDateAndTimeDuration(createDateDurationRecord(0, 0, 0, roundTimeDurationByDays(
|
|
2635
|
+
(isCalendarUnit(c) || isCalendarUnit(n)) && throwRangeError(missingField("relativeTo"));
|
|
2636
|
+
const u = toInternalDurationRecordWith24HourDays(t);
|
|
2637
|
+
return createTemporalDuration(temporalDurationFromInternal(l === d ? combineDateAndTimeDuration(createDateDurationRecord(0, 0, 0, roundTimeDurationByDays(u.p, a, i)[0]), ye) : combineDateAndTimeDuration(zeroDateDuration(), roundTimeDuration(u.p, a, l, i)), n));
|
|
2652
2638
|
}
|
|
2653
2639
|
total(e) {
|
|
2654
2640
|
const t = getInternalSlotOrThrowForDuration(this);
|
|
2655
2641
|
void 0 === e && throwTypeError(W);
|
|
2656
|
-
const o = "string" == typeof e ? createNullPrototypeObject({ unit: e }) : getOptionsObject(e), n = getTemporalRelativeToOption(o), r = getTemporalUnitValuedOption(o, "unit",
|
|
2642
|
+
const o = "string" == typeof e ? createNullPrototypeObject({ unit: e }) : getOptionsObject(e), n = getTemporalRelativeToOption(o), r = getTemporalUnitValuedOption(o, "unit", q);
|
|
2657
2643
|
if (validateTemporalUnitValue(r, H), n.Re) return ((e, t, o) => isDateUnit(o) ? totalRelativeDuration(differenceZonedDateTime(e, t, o), e.Y, t.Y, getIsoDateTimeForZonedDateTimeSlot(e), e.Z, e.U, o) : totalTimeDuration(timeDurationFromEpochNanosecondsDifference(t.Y, e.Y), o))(n.Re, createZonedDateTimeSlot(addZonedDateTime(n.Re, toInternalDurationRecord(t), _), n.Re.Z, n.Re.U), r);
|
|
2658
2644
|
if (n.be) {
|
|
2659
2645
|
const e = toInternalDurationRecordWith24HourDays(t), o = addTime(midnightTimeRecord(), e.p);
|
|
@@ -2662,7 +2648,7 @@ var Ot = class {
|
|
|
2662
2648
|
return (isCalendarUnit(defaultTemporalLargestUnit(t)) || isCalendarUnit(r)) && throwRangeError(missingField("relativeTo")), totalTimeDuration(toInternalDurationRecordWith24HourDays(t).p, r);
|
|
2663
2649
|
}
|
|
2664
2650
|
toString(e = void 0) {
|
|
2665
|
-
const t = getInternalSlotOrThrowForDuration(this), o = getOptionsObject(e), n = getTemporalFractionalSecondDigitsOption(o), r = getRoundingModeOption(o, le), a = getTemporalUnitValuedOption(o, "smallestUnit"
|
|
2651
|
+
const t = getInternalSlotOrThrowForDuration(this), o = getOptionsObject(e), n = getTemporalFractionalSecondDigitsOption(o), r = getRoundingModeOption(o, le), a = getTemporalUnitValuedOption(o, "smallestUnit");
|
|
2666
2652
|
validateTemporalUnitValue(a, L), a !== m && a !== u || throwRangeError(disallowedUnit(a));
|
|
2667
2653
|
const i = toSecondsStringPrecisionRecord(a, n);
|
|
2668
2654
|
if (i.Ee === D && 1 === i.Pe) return temporalDurationToString(t, i.ye);
|
|
@@ -2679,8 +2665,8 @@ var Ot = class {
|
|
|
2679
2665
|
throwTypeError(Y);
|
|
2680
2666
|
}
|
|
2681
2667
|
};
|
|
2682
|
-
defineStringTag(
|
|
2683
|
-
const
|
|
2668
|
+
defineStringTag(Ft.prototype, "Temporal.Duration"), renameFunction(Ft, "Duration");
|
|
2669
|
+
const St = {
|
|
2684
2670
|
[re]: Math.ceil,
|
|
2685
2671
|
[ae]: Math.floor,
|
|
2686
2672
|
[ie]: roundExpand,
|
|
@@ -2690,7 +2676,7 @@ const Ft = {
|
|
|
2690
2676
|
[de]: (e) => (isIntegerAndHalf(e) ? roundExpand(e) : Math.round(e)) + 0,
|
|
2691
2677
|
[me]: (e) => (isIntegerAndHalf(e) ? Math.trunc(e) : Math.round(e)) + 0,
|
|
2692
2678
|
[ue]: roundHalfEven
|
|
2693
|
-
},
|
|
2679
|
+
}, wt = {
|
|
2694
2680
|
[re]: Math.ceil,
|
|
2695
2681
|
[ae]: Math.floor,
|
|
2696
2682
|
[ie]: Math.ceil,
|
|
@@ -2700,7 +2686,7 @@ const Ft = {
|
|
|
2700
2686
|
[de]: roundHalfCeil,
|
|
2701
2687
|
[me]: roundHalfFloor,
|
|
2702
2688
|
[ue]: roundHalfEven
|
|
2703
|
-
},
|
|
2689
|
+
}, vt = globalThis.Intl.DateTimeFormat, yt = /* @__PURE__ */ new WeakMap(), Pt = [
|
|
2704
2690
|
"year",
|
|
2705
2691
|
"month",
|
|
2706
2692
|
"day",
|
|
@@ -2714,16 +2700,14 @@ const Ft = {
|
|
|
2714
2700
|
"dayPeriod",
|
|
2715
2701
|
"timeStyle"
|
|
2716
2702
|
];
|
|
2717
|
-
var
|
|
2718
|
-
ke(e) {
|
|
2719
|
-
return formatDateTime(getInternalSlotOrThrowForDateTimeFormat(this), e);
|
|
2720
|
-
}
|
|
2721
|
-
}, Rt = class {
|
|
2703
|
+
var bt = class {
|
|
2722
2704
|
constructor(e, t) {
|
|
2723
|
-
|
|
2705
|
+
yt.set(this, createDateTimeFormat(e, t, H, void 0));
|
|
2724
2706
|
}
|
|
2725
2707
|
get format() {
|
|
2726
|
-
return Object.defineProperty(getInternalSlotOrThrowForDateTimeFormat(this).
|
|
2708
|
+
return Object.defineProperty(getInternalSlotOrThrowForDateTimeFormat(this).ke ||= { ze(e) {
|
|
2709
|
+
return formatDateTime(getInternalSlotOrThrowForDateTimeFormat(this), e);
|
|
2710
|
+
} }.ze.bind(this), "name", { value: "" });
|
|
2727
2711
|
}
|
|
2728
2712
|
formatToParts(e) {
|
|
2729
2713
|
return ((e, t) => {
|
|
@@ -2749,10 +2733,10 @@ var Pt = class {
|
|
|
2749
2733
|
return getInternalSlotOrThrowForDateTimeFormat(this).Ze.resolvedOptions();
|
|
2750
2734
|
}
|
|
2751
2735
|
};
|
|
2752
|
-
const
|
|
2753
|
-
|
|
2754
|
-
for (const e of ["formatRange", "formatRangeToParts"])
|
|
2755
|
-
Object.defineProperties(DateTimeFormat,
|
|
2736
|
+
const Rt = Object.getOwnPropertyDescriptors(vt), Zt = bt.prototype;
|
|
2737
|
+
Rt.prototype.value = Zt;
|
|
2738
|
+
for (const e of ["formatRange", "formatRangeToParts"]) vt.prototype[e] || delete Zt[e];
|
|
2739
|
+
Object.defineProperties(DateTimeFormat, Rt), DateTimeFormat.prototype.constructor = DateTimeFormat, defineStringTag(DateTimeFormat.prototype, "Intl.DateTimeFormat");
|
|
2756
2740
|
const Nt = /* @__PURE__ */ new WeakMap();
|
|
2757
2741
|
var Mt = class {
|
|
2758
2742
|
constructor(e) {
|
|
@@ -2789,14 +2773,14 @@ var Mt = class {
|
|
|
2789
2773
|
return differenceTemporalInstant(-1, getInternalSlotOrThrowForInstant(this), e, t);
|
|
2790
2774
|
}
|
|
2791
2775
|
round(e) {
|
|
2792
|
-
const t = getInternalSlotOrThrowForInstant(this), o = getRoundToOptionsObject(e), n = getRoundingIncrementOption(o), r = getRoundingModeOption(o, de), i = getTemporalUnitValuedOption(o, "smallestUnit",
|
|
2776
|
+
const t = getInternalSlotOrThrowForInstant(this), o = getRoundToOptionsObject(e), n = getRoundingIncrementOption(o), r = getRoundingModeOption(o, de), i = getTemporalUnitValuedOption(o, "smallestUnit", q);
|
|
2793
2777
|
return validateTemporalUnitValue(i, L), validateTemporalRoundingIncrement(n, a / nanosecondsForTimeUnit(i), !0), createTemporalInstant(roundTemporalInstant(t.Y, n, i, r));
|
|
2794
2778
|
}
|
|
2795
2779
|
equals(e) {
|
|
2796
2780
|
return !compareEpochNanoseconds(getInternalSlotOrThrowForInstant(this).Y, getInternalSlotOrThrowForInstant(toTemporalInstant$1(e)).Y);
|
|
2797
2781
|
}
|
|
2798
2782
|
toString(e = void 0) {
|
|
2799
|
-
const t = getInternalSlotOrThrowForInstant(this), o = getOptionsObject(e), n = getTemporalFractionalSecondDigitsOption(o), r = getRoundingModeOption(o, le), a = getTemporalUnitValuedOption(o, "smallestUnit"
|
|
2783
|
+
const t = getInternalSlotOrThrowForInstant(this), o = getOptionsObject(e), n = getTemporalFractionalSecondDigitsOption(o), r = getRoundingModeOption(o, le), a = getTemporalUnitValuedOption(o, "smallestUnit"), i = o.timeZone;
|
|
2800
2784
|
validateTemporalUnitValue(a, L), a === m && throwRangeError(invalidField("smallestUnit"));
|
|
2801
2785
|
const l = mapUnlessUndefined(i, toTemporalTimeZoneIdentifier), c = toSecondsStringPrecisionRecord(a, n);
|
|
2802
2786
|
return temporalInstantToString(roundTemporalInstant(t.Y, c.Pe, c.Ee, r), l, c.ye);
|
|
@@ -2815,14 +2799,12 @@ var Mt = class {
|
|
|
2815
2799
|
}
|
|
2816
2800
|
};
|
|
2817
2801
|
defineStringTag(Mt.prototype, "Temporal.Instant"), renameFunction(Mt, "Instant");
|
|
2818
|
-
const Ut =
|
|
2819
|
-
|
|
2820
|
-
|
|
2821
|
-
|
|
2822
|
-
}
|
|
2823
|
-
}.prototype.toTemporalInstant, jt = {}, $t = Object.getOwnPropertyDescriptors(globalThis.Intl);
|
|
2802
|
+
const Ut = { toTemporalInstant() {
|
|
2803
|
+
const e = Date.prototype.valueOf.call(this);
|
|
2804
|
+
return e != e && throwRangeError("invalid date"), createTemporalInstant(createEpochNanosecondsFromEpochMilliseconds(e));
|
|
2805
|
+
} }.toTemporalInstant, jt = {}, $t = Object.getOwnPropertyDescriptors(globalThis.Intl);
|
|
2824
2806
|
$t.DateTimeFormat.value = DateTimeFormat, $t.DurationFormat && ($t.DurationFormat.value = k), Object.defineProperties(jt, $t);
|
|
2825
|
-
let Ct, Yt = 0, Wt = -
|
|
2807
|
+
let Ct, Yt = 0, Wt = -1 / 0;
|
|
2826
2808
|
const At = {
|
|
2827
2809
|
timeZoneId: () => systemTimeZoneIdentifier(),
|
|
2828
2810
|
instant: () => createTemporalInstant(systemUtcEpochNanoseconds()),
|
|
@@ -2834,13 +2816,13 @@ const At = {
|
|
|
2834
2816
|
defineStringTag(At, "Temporal.Now"), makePropertiesNonEnumerable(At);
|
|
2835
2817
|
const zt = {
|
|
2836
2818
|
Instant: Mt,
|
|
2837
|
-
PlainDateTime:
|
|
2838
|
-
PlainDate:
|
|
2839
|
-
PlainTime:
|
|
2840
|
-
PlainYearMonth:
|
|
2841
|
-
PlainMonthDay:
|
|
2842
|
-
Duration:
|
|
2843
|
-
ZonedDateTime:
|
|
2819
|
+
PlainDateTime: Ue,
|
|
2820
|
+
PlainDate: pt,
|
|
2821
|
+
PlainTime: $e,
|
|
2822
|
+
PlainYearMonth: Tt,
|
|
2823
|
+
PlainMonthDay: mt,
|
|
2824
|
+
Duration: Ft,
|
|
2825
|
+
ZonedDateTime: be,
|
|
2844
2826
|
Now: At
|
|
2845
2827
|
};
|
|
2846
2828
|
defineStringTag(zt, "Temporal"), makePropertiesNonEnumerable(zt);
|