@absurd-sqlite/bun-worker 0.3.0-alpha.0 → 0.3.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bun.lock +6 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3827 -91
- package/dist/sqlite.d.ts.map +1 -1
- package/package.json +3 -2
- package/src/index.ts +1 -0
- package/src/sqlite.ts +30 -10
- package/test/basic.test.ts +12 -6
- package/test/events.test.ts +13 -6
- package/test/retry.test.ts +5 -5
- package/test/setup.ts +10 -9
- package/test/sqlite.test.ts +5 -4
- package/test/step.test.ts +13 -5
package/dist/index.js
CHANGED
|
@@ -5,6 +5,3713 @@ import { Database } from "bun:sqlite";
|
|
|
5
5
|
// node_modules/@absurd-sqlite/sdk/dist/absurd.js
|
|
6
6
|
import * as os from "os";
|
|
7
7
|
|
|
8
|
+
// node_modules/temporal-polyfill/chunks/internal.js
|
|
9
|
+
function clampProp(e, n, t, o, r) {
|
|
10
|
+
return clampEntity(n, ((e2, n2) => {
|
|
11
|
+
const t2 = e2[n2];
|
|
12
|
+
if (t2 === undefined) {
|
|
13
|
+
throw new TypeError(missingField(n2));
|
|
14
|
+
}
|
|
15
|
+
return t2;
|
|
16
|
+
})(e, n), t, o, r);
|
|
17
|
+
}
|
|
18
|
+
function clampEntity(e, n, t, o, r, i) {
|
|
19
|
+
const a = clampNumber(n, t, o);
|
|
20
|
+
if (r && n !== a) {
|
|
21
|
+
throw new RangeError(numberOutOfRange(e, n, t, o, i));
|
|
22
|
+
}
|
|
23
|
+
return a;
|
|
24
|
+
}
|
|
25
|
+
function s(e) {
|
|
26
|
+
return e !== null && /object|function/.test(typeof e);
|
|
27
|
+
}
|
|
28
|
+
function on(e, n = Map) {
|
|
29
|
+
const t = new n;
|
|
30
|
+
return (n2, ...o) => {
|
|
31
|
+
if (t.has(n2)) {
|
|
32
|
+
return t.get(n2);
|
|
33
|
+
}
|
|
34
|
+
const r = e(n2, ...o);
|
|
35
|
+
return t.set(n2, r), r;
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
function r(e) {
|
|
39
|
+
return n({
|
|
40
|
+
name: e
|
|
41
|
+
}, 1);
|
|
42
|
+
}
|
|
43
|
+
function n(n2, t) {
|
|
44
|
+
return e((e) => ({
|
|
45
|
+
value: e,
|
|
46
|
+
configurable: 1,
|
|
47
|
+
writable: !t
|
|
48
|
+
}), n2);
|
|
49
|
+
}
|
|
50
|
+
function t(n2) {
|
|
51
|
+
return e((e) => ({
|
|
52
|
+
get: e,
|
|
53
|
+
configurable: 1
|
|
54
|
+
}), n2);
|
|
55
|
+
}
|
|
56
|
+
function o(e) {
|
|
57
|
+
return {
|
|
58
|
+
[Symbol.toStringTag]: {
|
|
59
|
+
value: e,
|
|
60
|
+
configurable: 1
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
function zipProps(e, n2) {
|
|
65
|
+
const t2 = {};
|
|
66
|
+
let o2 = e.length;
|
|
67
|
+
for (const r2 of n2) {
|
|
68
|
+
t2[e[--o2]] = r2;
|
|
69
|
+
}
|
|
70
|
+
return t2;
|
|
71
|
+
}
|
|
72
|
+
function e(e2, n2, t2) {
|
|
73
|
+
const o2 = {};
|
|
74
|
+
for (const r2 in n2) {
|
|
75
|
+
o2[r2] = e2(n2[r2], r2, t2);
|
|
76
|
+
}
|
|
77
|
+
return o2;
|
|
78
|
+
}
|
|
79
|
+
function g(e2, n2, t2) {
|
|
80
|
+
const o2 = {};
|
|
81
|
+
for (let r2 = 0;r2 < n2.length; r2++) {
|
|
82
|
+
const i = n2[r2];
|
|
83
|
+
o2[i] = e2(i, r2, t2);
|
|
84
|
+
}
|
|
85
|
+
return o2;
|
|
86
|
+
}
|
|
87
|
+
function remapProps(e2, n2, t2) {
|
|
88
|
+
const o2 = {};
|
|
89
|
+
for (let r2 = 0;r2 < e2.length; r2++) {
|
|
90
|
+
o2[n2[r2]] = t2[e2[r2]];
|
|
91
|
+
}
|
|
92
|
+
return o2;
|
|
93
|
+
}
|
|
94
|
+
function nn(e2, n2) {
|
|
95
|
+
const t2 = Object.create(null);
|
|
96
|
+
for (const o2 of e2) {
|
|
97
|
+
t2[o2] = n2[o2];
|
|
98
|
+
}
|
|
99
|
+
return t2;
|
|
100
|
+
}
|
|
101
|
+
function hasAnyPropsByName(e2, n2) {
|
|
102
|
+
for (const t2 of n2) {
|
|
103
|
+
if (t2 in e2) {
|
|
104
|
+
return 1;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
return 0;
|
|
108
|
+
}
|
|
109
|
+
function allPropsEqual(e2, n2, t2) {
|
|
110
|
+
for (const o2 of e2) {
|
|
111
|
+
if (n2[o2] !== t2[o2]) {
|
|
112
|
+
return 0;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
return 1;
|
|
116
|
+
}
|
|
117
|
+
function zeroOutProps(e2, n2, t2) {
|
|
118
|
+
const o2 = {
|
|
119
|
+
...t2
|
|
120
|
+
};
|
|
121
|
+
for (let t3 = 0;t3 < n2; t3++) {
|
|
122
|
+
o2[e2[t3]] = 0;
|
|
123
|
+
}
|
|
124
|
+
return o2;
|
|
125
|
+
}
|
|
126
|
+
function Pt(e2, ...n2) {
|
|
127
|
+
return (...t2) => e2(...n2, ...t2);
|
|
128
|
+
}
|
|
129
|
+
function capitalize(e2) {
|
|
130
|
+
return e2[0].toUpperCase() + e2.substring(1);
|
|
131
|
+
}
|
|
132
|
+
function sortStrings(e2) {
|
|
133
|
+
return e2.slice().sort();
|
|
134
|
+
}
|
|
135
|
+
function padNumber(e2, n2) {
|
|
136
|
+
return String(n2).padStart(e2, "0");
|
|
137
|
+
}
|
|
138
|
+
function compareNumbers(e2, n2) {
|
|
139
|
+
return Math.sign(e2 - n2);
|
|
140
|
+
}
|
|
141
|
+
function clampNumber(e2, n2, t2) {
|
|
142
|
+
return Math.min(Math.max(e2, n2), t2);
|
|
143
|
+
}
|
|
144
|
+
function divModFloor(e2, n2) {
|
|
145
|
+
return [Math.floor(e2 / n2), modFloor(e2, n2)];
|
|
146
|
+
}
|
|
147
|
+
function modFloor(e2, n2) {
|
|
148
|
+
return (e2 % n2 + n2) % n2;
|
|
149
|
+
}
|
|
150
|
+
function divModTrunc(e2, n2) {
|
|
151
|
+
return [divTrunc(e2, n2), modTrunc(e2, n2)];
|
|
152
|
+
}
|
|
153
|
+
function divTrunc(e2, n2) {
|
|
154
|
+
return Math.trunc(e2 / n2) || 0;
|
|
155
|
+
}
|
|
156
|
+
function modTrunc(e2, n2) {
|
|
157
|
+
return e2 % n2 || 0;
|
|
158
|
+
}
|
|
159
|
+
function hasHalf(e2) {
|
|
160
|
+
return Math.abs(e2 % 1) === 0.5;
|
|
161
|
+
}
|
|
162
|
+
function givenFieldsToBigNano(e2, n2, t2) {
|
|
163
|
+
let o2 = 0, r2 = 0;
|
|
164
|
+
for (let i2 = 0;i2 <= n2; i2++) {
|
|
165
|
+
const n3 = e2[t2[i2]], a2 = Ao[i2], s2 = Uo / a2, [c, u] = divModTrunc(n3, s2);
|
|
166
|
+
o2 += u * a2, r2 += c;
|
|
167
|
+
}
|
|
168
|
+
const [i, a] = divModTrunc(o2, Uo);
|
|
169
|
+
return [r2 + i, a];
|
|
170
|
+
}
|
|
171
|
+
function nanoToGivenFields(e2, n2, t2) {
|
|
172
|
+
const o2 = {};
|
|
173
|
+
for (let r2 = n2;r2 >= 0; r2--) {
|
|
174
|
+
const n3 = Ao[r2];
|
|
175
|
+
o2[t2[r2]] = divTrunc(e2, n3), e2 = modTrunc(e2, n3);
|
|
176
|
+
}
|
|
177
|
+
return o2;
|
|
178
|
+
}
|
|
179
|
+
function d(e2) {
|
|
180
|
+
if (e2 !== undefined) {
|
|
181
|
+
return m(e2);
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
function P(e2) {
|
|
185
|
+
if (e2 !== undefined) {
|
|
186
|
+
return h(e2);
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
function S(e2) {
|
|
190
|
+
if (e2 !== undefined) {
|
|
191
|
+
return T(e2);
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
function h(e2) {
|
|
195
|
+
return requireNumberIsPositive(T(e2));
|
|
196
|
+
}
|
|
197
|
+
function T(e2) {
|
|
198
|
+
return ze(cr(e2));
|
|
199
|
+
}
|
|
200
|
+
function requirePropDefined(e2, n2) {
|
|
201
|
+
if (n2 == null) {
|
|
202
|
+
throw new RangeError(missingField(e2));
|
|
203
|
+
}
|
|
204
|
+
return n2;
|
|
205
|
+
}
|
|
206
|
+
function requireObjectLike(e2) {
|
|
207
|
+
if (!s(e2)) {
|
|
208
|
+
throw new TypeError(oo);
|
|
209
|
+
}
|
|
210
|
+
return e2;
|
|
211
|
+
}
|
|
212
|
+
function requireType(e2, n2, t2 = e2) {
|
|
213
|
+
if (typeof n2 !== e2) {
|
|
214
|
+
throw new TypeError(invalidEntity(t2, n2));
|
|
215
|
+
}
|
|
216
|
+
return n2;
|
|
217
|
+
}
|
|
218
|
+
function ze(e2, n2 = "number") {
|
|
219
|
+
if (!Number.isInteger(e2)) {
|
|
220
|
+
throw new RangeError(expectedInteger(n2, e2));
|
|
221
|
+
}
|
|
222
|
+
return e2 || 0;
|
|
223
|
+
}
|
|
224
|
+
function requireNumberIsPositive(e2, n2 = "number") {
|
|
225
|
+
if (e2 <= 0) {
|
|
226
|
+
throw new RangeError(expectedPositive(n2, e2));
|
|
227
|
+
}
|
|
228
|
+
return e2;
|
|
229
|
+
}
|
|
230
|
+
function toString(e2) {
|
|
231
|
+
if (typeof e2 == "symbol") {
|
|
232
|
+
throw new TypeError(no);
|
|
233
|
+
}
|
|
234
|
+
return String(e2);
|
|
235
|
+
}
|
|
236
|
+
function toStringViaPrimitive(e2, n2) {
|
|
237
|
+
return s(e2) ? String(e2) : m(e2, n2);
|
|
238
|
+
}
|
|
239
|
+
function toBigInt(e2) {
|
|
240
|
+
if (typeof e2 == "string") {
|
|
241
|
+
return BigInt(e2);
|
|
242
|
+
}
|
|
243
|
+
if (typeof e2 != "bigint") {
|
|
244
|
+
throw new TypeError(invalidBigInt(e2));
|
|
245
|
+
}
|
|
246
|
+
return e2;
|
|
247
|
+
}
|
|
248
|
+
function toNumber(e2, n2 = "number") {
|
|
249
|
+
if (typeof e2 == "bigint") {
|
|
250
|
+
throw new TypeError(forbiddenBigIntToNumber(n2));
|
|
251
|
+
}
|
|
252
|
+
if (e2 = Number(e2), !Number.isFinite(e2)) {
|
|
253
|
+
throw new RangeError(expectedFinite(n2, e2));
|
|
254
|
+
}
|
|
255
|
+
return e2;
|
|
256
|
+
}
|
|
257
|
+
function toInteger(e2, n2) {
|
|
258
|
+
return Math.trunc(toNumber(e2, n2)) || 0;
|
|
259
|
+
}
|
|
260
|
+
function toStrictInteger(e2, n2) {
|
|
261
|
+
return ze(toNumber(e2, n2), n2);
|
|
262
|
+
}
|
|
263
|
+
function toPositiveInteger(e2, n2) {
|
|
264
|
+
return requireNumberIsPositive(toInteger(e2, n2), n2);
|
|
265
|
+
}
|
|
266
|
+
function createBigNano(e2, n2) {
|
|
267
|
+
let [t2, o2] = divModTrunc(n2, Uo), r2 = e2 + t2;
|
|
268
|
+
const i = Math.sign(r2);
|
|
269
|
+
return i && i === -Math.sign(o2) && (r2 -= i, o2 += i * Uo), [r2, o2];
|
|
270
|
+
}
|
|
271
|
+
function addBigNanos(e2, n2, t2 = 1) {
|
|
272
|
+
return createBigNano(e2[0] + n2[0] * t2, e2[1] + n2[1] * t2);
|
|
273
|
+
}
|
|
274
|
+
function moveBigNano(e2, n2) {
|
|
275
|
+
return createBigNano(e2[0], e2[1] + n2);
|
|
276
|
+
}
|
|
277
|
+
function diffBigNanos(e2, n2) {
|
|
278
|
+
return addBigNanos(n2, e2, -1);
|
|
279
|
+
}
|
|
280
|
+
function compareBigNanos(e2, n2) {
|
|
281
|
+
return compareNumbers(e2[0], n2[0]) || compareNumbers(e2[1], n2[1]);
|
|
282
|
+
}
|
|
283
|
+
function bigNanoOutside(e2, n2, t2) {
|
|
284
|
+
return compareBigNanos(e2, n2) === -1 || compareBigNanos(e2, t2) === 1;
|
|
285
|
+
}
|
|
286
|
+
function bigIntToBigNano(e2, n2 = 1) {
|
|
287
|
+
const t2 = BigInt(Uo / n2);
|
|
288
|
+
return [Number(e2 / t2), Number(e2 % t2) * n2];
|
|
289
|
+
}
|
|
290
|
+
function Ge(e2, n2 = 1) {
|
|
291
|
+
const t2 = Uo / n2, [o2, r2] = divModTrunc(e2, t2);
|
|
292
|
+
return [o2, r2 * n2];
|
|
293
|
+
}
|
|
294
|
+
function bigNanoToNumber(e2, n2 = 1, t2) {
|
|
295
|
+
const [o2, r2] = e2, [i, a] = divModTrunc(r2, n2);
|
|
296
|
+
return o2 * (Uo / n2) + (i + (t2 ? a / n2 : 0));
|
|
297
|
+
}
|
|
298
|
+
function divModBigNano(e2, n2, t2 = divModFloor) {
|
|
299
|
+
const [o2, r2] = e2, [i, a] = t2(r2, n2);
|
|
300
|
+
return [o2 * (Uo / n2) + i, a];
|
|
301
|
+
}
|
|
302
|
+
function checkIsoYearMonthInBounds(e2) {
|
|
303
|
+
return clampProp(e2, "isoYear", wr, Fr, 1), e2.isoYear === wr ? clampProp(e2, "isoMonth", 4, 12, 1) : e2.isoYear === Fr && clampProp(e2, "isoMonth", 1, 9, 1), e2;
|
|
304
|
+
}
|
|
305
|
+
function checkIsoDateInBounds(e2) {
|
|
306
|
+
return checkIsoDateTimeInBounds({
|
|
307
|
+
...e2,
|
|
308
|
+
...Nt,
|
|
309
|
+
isoHour: 12
|
|
310
|
+
}), e2;
|
|
311
|
+
}
|
|
312
|
+
function checkIsoDateTimeInBounds(e2) {
|
|
313
|
+
const n2 = clampProp(e2, "isoYear", wr, Fr, 1), t2 = n2 === wr ? 1 : n2 === Fr ? -1 : 0;
|
|
314
|
+
return t2 && checkEpochNanoInBounds(isoToEpochNano({
|
|
315
|
+
...e2,
|
|
316
|
+
isoDay: e2.isoDay + t2,
|
|
317
|
+
isoNanosecond: e2.isoNanosecond - t2
|
|
318
|
+
})), e2;
|
|
319
|
+
}
|
|
320
|
+
function checkEpochNanoInBounds(e2) {
|
|
321
|
+
if (!e2 || bigNanoOutside(e2, Sr, Er)) {
|
|
322
|
+
throw new RangeError(Io);
|
|
323
|
+
}
|
|
324
|
+
return e2;
|
|
325
|
+
}
|
|
326
|
+
function isoTimeFieldsToNano(e2) {
|
|
327
|
+
return givenFieldsToBigNano(e2, 5, w)[1];
|
|
328
|
+
}
|
|
329
|
+
function nanoToIsoTimeAndDay(e2) {
|
|
330
|
+
const [n2, t2] = divModFloor(e2, Uo);
|
|
331
|
+
return [nanoToGivenFields(t2, 5, w), n2];
|
|
332
|
+
}
|
|
333
|
+
function epochNanoToSecMod(e2) {
|
|
334
|
+
return divModBigNano(e2, Ro);
|
|
335
|
+
}
|
|
336
|
+
function isoToEpochMilli(e2) {
|
|
337
|
+
return isoArgsToEpochMilli(e2.isoYear, e2.isoMonth, e2.isoDay, e2.isoHour, e2.isoMinute, e2.isoSecond, e2.isoMillisecond);
|
|
338
|
+
}
|
|
339
|
+
function isoToEpochNano(e2) {
|
|
340
|
+
const n2 = isoToEpochMilli(e2);
|
|
341
|
+
if (n2 !== undefined) {
|
|
342
|
+
const [t2, o2] = divModTrunc(n2, ko);
|
|
343
|
+
return [t2, o2 * Qe + (e2.isoMicrosecond || 0) * Yo + (e2.isoNanosecond || 0)];
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
function isoToEpochNanoWithOffset(e2, n2) {
|
|
347
|
+
const [t2, o2] = nanoToIsoTimeAndDay(isoTimeFieldsToNano(e2) - n2);
|
|
348
|
+
return checkEpochNanoInBounds(isoToEpochNano({
|
|
349
|
+
...e2,
|
|
350
|
+
isoDay: e2.isoDay + o2,
|
|
351
|
+
...t2
|
|
352
|
+
}));
|
|
353
|
+
}
|
|
354
|
+
function isoArgsToEpochSec(...e2) {
|
|
355
|
+
return isoArgsToEpochMilli(...e2) / Co;
|
|
356
|
+
}
|
|
357
|
+
function isoArgsToEpochMilli(...e2) {
|
|
358
|
+
const [n2, t2] = isoToLegacyDate(...e2), o2 = n2.valueOf();
|
|
359
|
+
if (!isNaN(o2)) {
|
|
360
|
+
return o2 - t2 * ko;
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
function isoToLegacyDate(e2, n2 = 1, t2 = 1, o2 = 0, r2 = 0, i = 0, a = 0) {
|
|
364
|
+
const s2 = e2 === wr ? 1 : e2 === Fr ? -1 : 0, c = new Date;
|
|
365
|
+
return c.setUTCHours(o2, r2, i, a), c.setUTCFullYear(e2, n2 - 1, t2 + s2), [c, s2];
|
|
366
|
+
}
|
|
367
|
+
function epochNanoToIso(e2, n2) {
|
|
368
|
+
let [t2, o2] = moveBigNano(e2, n2);
|
|
369
|
+
o2 < 0 && (o2 += Uo, t2 -= 1);
|
|
370
|
+
const [r2, i] = divModFloor(o2, Qe), [a, s2] = divModFloor(i, Yo);
|
|
371
|
+
return epochMilliToIso(t2 * ko + r2, a, s2);
|
|
372
|
+
}
|
|
373
|
+
function epochMilliToIso(e2, n2 = 0, t2 = 0) {
|
|
374
|
+
const o2 = Math.ceil(Math.max(0, Math.abs(e2) - Pr) / ko) * Math.sign(e2), r2 = new Date(e2 - o2 * ko);
|
|
375
|
+
return zipProps(Tr, [r2.getUTCFullYear(), r2.getUTCMonth() + 1, r2.getUTCDate() + o2, r2.getUTCHours(), r2.getUTCMinutes(), r2.getUTCSeconds(), r2.getUTCMilliseconds(), n2, t2]);
|
|
376
|
+
}
|
|
377
|
+
function hashIntlFormatParts(e2, n2) {
|
|
378
|
+
if (n2 < -Pr) {
|
|
379
|
+
throw new RangeError(Io);
|
|
380
|
+
}
|
|
381
|
+
const t2 = e2.formatToParts(n2), o2 = {};
|
|
382
|
+
for (const e3 of t2) {
|
|
383
|
+
o2[e3.type] = e3.value;
|
|
384
|
+
}
|
|
385
|
+
return o2;
|
|
386
|
+
}
|
|
387
|
+
function computeIsoDateParts(e2) {
|
|
388
|
+
return [e2.isoYear, e2.isoMonth, e2.isoDay];
|
|
389
|
+
}
|
|
390
|
+
function computeIsoMonthCodeParts(e2, n2) {
|
|
391
|
+
return [n2, 0];
|
|
392
|
+
}
|
|
393
|
+
function computeIsoMonthsInYear() {
|
|
394
|
+
return kr;
|
|
395
|
+
}
|
|
396
|
+
function computeIsoDaysInMonth(e2, n2) {
|
|
397
|
+
switch (n2) {
|
|
398
|
+
case 2:
|
|
399
|
+
return computeIsoInLeapYear(e2) ? 29 : 28;
|
|
400
|
+
case 4:
|
|
401
|
+
case 6:
|
|
402
|
+
case 9:
|
|
403
|
+
case 11:
|
|
404
|
+
return 30;
|
|
405
|
+
}
|
|
406
|
+
return 31;
|
|
407
|
+
}
|
|
408
|
+
function computeIsoDaysInYear(e2) {
|
|
409
|
+
return computeIsoInLeapYear(e2) ? 366 : 365;
|
|
410
|
+
}
|
|
411
|
+
function computeIsoInLeapYear(e2) {
|
|
412
|
+
return e2 % 4 == 0 && (e2 % 100 != 0 || e2 % 400 == 0);
|
|
413
|
+
}
|
|
414
|
+
function computeIsoDayOfWeek(e2) {
|
|
415
|
+
const [n2, t2] = isoToLegacyDate(e2.isoYear, e2.isoMonth, e2.isoDay);
|
|
416
|
+
return modFloor(n2.getUTCDay() - t2, 7) || 7;
|
|
417
|
+
}
|
|
418
|
+
function computeIsoEraParts(e2) {
|
|
419
|
+
return this.id === or ? (({ isoYear: e3 }) => e3 < 1 ? ["gregory-inverse", 1 - e3] : ["gregory", e3])(e2) : this.id === rr ? Yr(e2) : [];
|
|
420
|
+
}
|
|
421
|
+
function computeJapaneseEraParts(e2) {
|
|
422
|
+
const n2 = isoToEpochMilli(e2);
|
|
423
|
+
if (n2 < Cr) {
|
|
424
|
+
const { isoYear: n3 } = e2;
|
|
425
|
+
return n3 < 1 ? ["japanese-inverse", 1 - n3] : ["japanese", n3];
|
|
426
|
+
}
|
|
427
|
+
const t2 = hashIntlFormatParts(Ci(rr), n2), { era: o2, eraYear: r2 } = parseIntlYear(t2, rr);
|
|
428
|
+
return [o2, r2];
|
|
429
|
+
}
|
|
430
|
+
function checkIsoDateTimeFields(e2) {
|
|
431
|
+
return checkIsoDateFields(e2), constrainIsoTimeFields(e2, 1), e2;
|
|
432
|
+
}
|
|
433
|
+
function checkIsoDateFields(e2) {
|
|
434
|
+
return constrainIsoDateFields(e2, 1), e2;
|
|
435
|
+
}
|
|
436
|
+
function isIsoDateFieldsValid(e2) {
|
|
437
|
+
return allPropsEqual(Dr, e2, constrainIsoDateFields(e2));
|
|
438
|
+
}
|
|
439
|
+
function constrainIsoDateFields(e2, n2) {
|
|
440
|
+
const { isoYear: t2 } = e2, o2 = clampProp(e2, "isoMonth", 1, computeIsoMonthsInYear(), n2);
|
|
441
|
+
return {
|
|
442
|
+
isoYear: t2,
|
|
443
|
+
isoMonth: o2,
|
|
444
|
+
isoDay: clampProp(e2, "isoDay", 1, computeIsoDaysInMonth(t2, o2), n2)
|
|
445
|
+
};
|
|
446
|
+
}
|
|
447
|
+
function constrainIsoTimeFields(e2, n2) {
|
|
448
|
+
return zipProps(w, [clampProp(e2, "isoHour", 0, 23, n2), clampProp(e2, "isoMinute", 0, 59, n2), clampProp(e2, "isoSecond", 0, 59, n2), clampProp(e2, "isoMillisecond", 0, 999, n2), clampProp(e2, "isoMicrosecond", 0, 999, n2), clampProp(e2, "isoNanosecond", 0, 999, n2)]);
|
|
449
|
+
}
|
|
450
|
+
function mt(e2) {
|
|
451
|
+
return e2 === undefined ? 0 : Xr(requireObjectLike(e2));
|
|
452
|
+
}
|
|
453
|
+
function je(e2, n2 = 0) {
|
|
454
|
+
e2 = normalizeOptions(e2);
|
|
455
|
+
const t2 = ei(e2), o2 = ni(e2, n2);
|
|
456
|
+
return [Xr(e2), o2, t2];
|
|
457
|
+
}
|
|
458
|
+
function refineDiffOptions(e2, n2, t2, o2 = 9, r2 = 0, i = 4) {
|
|
459
|
+
n2 = normalizeOptions(n2);
|
|
460
|
+
let a = Kr(n2, o2, r2), s2 = parseRoundingIncInteger(n2), c = ii(n2, i);
|
|
461
|
+
const u = Jr(n2, o2, r2, 1);
|
|
462
|
+
return a == null ? a = Math.max(t2, u) : checkLargestSmallestUnit(a, u), s2 = refineRoundingInc(s2, u, 1), e2 && (c = ((e3) => e3 < 4 ? (e3 + 2) % 4 : e3)(c)), [a, u, s2, c];
|
|
463
|
+
}
|
|
464
|
+
function refineRoundingOptions(e2, n2 = 6, t2) {
|
|
465
|
+
let o2 = parseRoundingIncInteger(e2 = normalizeOptionsOrString(e2, Rr));
|
|
466
|
+
const r2 = ii(e2, 7);
|
|
467
|
+
let i = Jr(e2, n2);
|
|
468
|
+
return i = requirePropDefined(Rr, i), o2 = refineRoundingInc(o2, i, undefined, t2), [i, o2, r2];
|
|
469
|
+
}
|
|
470
|
+
function refineDateDisplayOptions(e2) {
|
|
471
|
+
return ti(normalizeOptions(e2));
|
|
472
|
+
}
|
|
473
|
+
function refineTimeDisplayOptions(e2, n2) {
|
|
474
|
+
return refineTimeDisplayTuple(normalizeOptions(e2), n2);
|
|
475
|
+
}
|
|
476
|
+
function Me(e2) {
|
|
477
|
+
const n2 = normalizeOptionsOrString(e2, qr), t2 = refineChoiceOption(qr, _r, n2, 0);
|
|
478
|
+
if (!t2) {
|
|
479
|
+
throw new RangeError(invalidEntity(qr, t2));
|
|
480
|
+
}
|
|
481
|
+
return t2;
|
|
482
|
+
}
|
|
483
|
+
function refineTimeDisplayTuple(e2, n2 = 4) {
|
|
484
|
+
const t2 = refineSubsecDigits(e2);
|
|
485
|
+
return [ii(e2, 4), ...refineSmallestUnitAndSubsecDigits(Jr(e2, n2), t2)];
|
|
486
|
+
}
|
|
487
|
+
function refineSmallestUnitAndSubsecDigits(e2, n2) {
|
|
488
|
+
return e2 != null ? [Ao[e2], e2 < 4 ? 9 - 3 * e2 : -1] : [n2 === undefined ? 1 : 10 ** (9 - n2), n2];
|
|
489
|
+
}
|
|
490
|
+
function parseRoundingIncInteger(e2) {
|
|
491
|
+
const n2 = e2[zr];
|
|
492
|
+
return n2 === undefined ? 1 : toInteger(n2, zr);
|
|
493
|
+
}
|
|
494
|
+
function refineRoundingInc(e2, n2, t2, o2) {
|
|
495
|
+
const r2 = o2 ? Uo : Ao[n2 + 1];
|
|
496
|
+
if (r2) {
|
|
497
|
+
const t3 = Ao[n2];
|
|
498
|
+
if (r2 % ((e2 = clampEntity(zr, e2, 1, r2 / t3 - (o2 ? 0 : 1), 1)) * t3)) {
|
|
499
|
+
throw new RangeError(invalidEntity(zr, e2));
|
|
500
|
+
}
|
|
501
|
+
} else {
|
|
502
|
+
e2 = clampEntity(zr, e2, 1, t2 ? 10 ** 9 : 1, 1);
|
|
503
|
+
}
|
|
504
|
+
return e2;
|
|
505
|
+
}
|
|
506
|
+
function refineSubsecDigits(e2) {
|
|
507
|
+
let n2 = e2[Ur];
|
|
508
|
+
if (n2 !== undefined) {
|
|
509
|
+
if (typeof n2 != "number") {
|
|
510
|
+
if (toString(n2) === "auto") {
|
|
511
|
+
return;
|
|
512
|
+
}
|
|
513
|
+
throw new RangeError(invalidEntity(Ur, n2));
|
|
514
|
+
}
|
|
515
|
+
n2 = clampEntity(Ur, Math.floor(n2), 0, 9, 1);
|
|
516
|
+
}
|
|
517
|
+
return n2;
|
|
518
|
+
}
|
|
519
|
+
function normalizeOptions(e2) {
|
|
520
|
+
return e2 === undefined ? {} : requireObjectLike(e2);
|
|
521
|
+
}
|
|
522
|
+
function normalizeOptionsOrString(e2, n2) {
|
|
523
|
+
return typeof e2 == "string" ? {
|
|
524
|
+
[n2]: e2
|
|
525
|
+
} : requireObjectLike(e2);
|
|
526
|
+
}
|
|
527
|
+
function fabricateOverflowOptions(e2) {
|
|
528
|
+
return {
|
|
529
|
+
overflow: jr[e2]
|
|
530
|
+
};
|
|
531
|
+
}
|
|
532
|
+
function refineUnitOption(e2, n2, t2 = 9, o2 = 0, r2) {
|
|
533
|
+
let i = n2[e2];
|
|
534
|
+
if (i === undefined) {
|
|
535
|
+
return r2 ? o2 : undefined;
|
|
536
|
+
}
|
|
537
|
+
if (i = toString(i), i === "auto") {
|
|
538
|
+
return r2 ? o2 : null;
|
|
539
|
+
}
|
|
540
|
+
let a = Oo[i];
|
|
541
|
+
if (a === undefined && (a = mr[i]), a === undefined) {
|
|
542
|
+
throw new RangeError(invalidChoice(e2, i, Oo));
|
|
543
|
+
}
|
|
544
|
+
return clampEntity(e2, a, o2, t2, 1, Bo), a;
|
|
545
|
+
}
|
|
546
|
+
function refineChoiceOption(e2, n2, t2, o2 = 0) {
|
|
547
|
+
const r2 = t2[e2];
|
|
548
|
+
if (r2 === undefined) {
|
|
549
|
+
return o2;
|
|
550
|
+
}
|
|
551
|
+
const i = toString(r2), a = n2[i];
|
|
552
|
+
if (a === undefined) {
|
|
553
|
+
throw new RangeError(invalidChoice(e2, i, n2));
|
|
554
|
+
}
|
|
555
|
+
return a;
|
|
556
|
+
}
|
|
557
|
+
function checkLargestSmallestUnit(e2, n2) {
|
|
558
|
+
if (n2 > e2) {
|
|
559
|
+
throw new RangeError(Eo);
|
|
560
|
+
}
|
|
561
|
+
}
|
|
562
|
+
function xe(e2) {
|
|
563
|
+
return {
|
|
564
|
+
branding: Re,
|
|
565
|
+
epochNanoseconds: e2
|
|
566
|
+
};
|
|
567
|
+
}
|
|
568
|
+
function _e(e2, n2, t2) {
|
|
569
|
+
return {
|
|
570
|
+
branding: z,
|
|
571
|
+
calendar: t2,
|
|
572
|
+
timeZone: n2,
|
|
573
|
+
epochNanoseconds: e2
|
|
574
|
+
};
|
|
575
|
+
}
|
|
576
|
+
function jt(e2, n2 = e2.calendar) {
|
|
577
|
+
return {
|
|
578
|
+
branding: x,
|
|
579
|
+
calendar: n2,
|
|
580
|
+
...nn(Nr, e2)
|
|
581
|
+
};
|
|
582
|
+
}
|
|
583
|
+
function W(e2, n2 = e2.calendar) {
|
|
584
|
+
return {
|
|
585
|
+
branding: G,
|
|
586
|
+
calendar: n2,
|
|
587
|
+
...nn(Ir, e2)
|
|
588
|
+
};
|
|
589
|
+
}
|
|
590
|
+
function createPlainYearMonthSlots(e2, n2 = e2.calendar) {
|
|
591
|
+
return {
|
|
592
|
+
branding: Ut,
|
|
593
|
+
calendar: n2,
|
|
594
|
+
...nn(Ir, e2)
|
|
595
|
+
};
|
|
596
|
+
}
|
|
597
|
+
function createPlainMonthDaySlots(e2, n2 = e2.calendar) {
|
|
598
|
+
return {
|
|
599
|
+
branding: qt,
|
|
600
|
+
calendar: n2,
|
|
601
|
+
...nn(Ir, e2)
|
|
602
|
+
};
|
|
603
|
+
}
|
|
604
|
+
function St(e2) {
|
|
605
|
+
return {
|
|
606
|
+
branding: ft,
|
|
607
|
+
...nn(Mr, e2)
|
|
608
|
+
};
|
|
609
|
+
}
|
|
610
|
+
function Oe(e2) {
|
|
611
|
+
return {
|
|
612
|
+
branding: N,
|
|
613
|
+
sign: computeDurationSign(e2),
|
|
614
|
+
...nn(ur, e2)
|
|
615
|
+
};
|
|
616
|
+
}
|
|
617
|
+
function I(e2) {
|
|
618
|
+
return divModBigNano(e2.epochNanoseconds, Qe)[0];
|
|
619
|
+
}
|
|
620
|
+
function v(e2) {
|
|
621
|
+
return ((e3, n2 = 1) => {
|
|
622
|
+
const [t2, o2] = e3, r2 = Math.floor(o2 / n2), i = Uo / n2;
|
|
623
|
+
return BigInt(t2) * BigInt(i) + BigInt(r2);
|
|
624
|
+
})(e2.epochNanoseconds);
|
|
625
|
+
}
|
|
626
|
+
function extractEpochNano(e2) {
|
|
627
|
+
return e2.epochNanoseconds;
|
|
628
|
+
}
|
|
629
|
+
function J(e2, n2, t2, o2, r2) {
|
|
630
|
+
const i = getMaxDurationUnit(o2), [a, s2] = ((e3, n3) => {
|
|
631
|
+
const t3 = n3((e3 = normalizeOptionsOrString(e3, Zr))[Ar]);
|
|
632
|
+
let o3 = Qr(e3);
|
|
633
|
+
return o3 = requirePropDefined(Zr, o3), [o3, t3];
|
|
634
|
+
})(r2, e2), c = Math.max(a, i);
|
|
635
|
+
if (!s2 && isUniformUnit(c, s2)) {
|
|
636
|
+
return totalDayTimeDuration(o2, a);
|
|
637
|
+
}
|
|
638
|
+
if (!s2) {
|
|
639
|
+
throw new RangeError(yo);
|
|
640
|
+
}
|
|
641
|
+
if (!o2.sign) {
|
|
642
|
+
return 0;
|
|
643
|
+
}
|
|
644
|
+
const [u, f, l] = createMarkerSystem(n2, t2, s2), d2 = createMarkerToEpochNano(l), m = createMoveMarker(l), h2 = createDiffMarkers(l), g2 = m(f, u, o2);
|
|
645
|
+
isZonedEpochSlots(s2) || (checkIsoDateTimeInBounds(u), checkIsoDateTimeInBounds(g2));
|
|
646
|
+
const D = h2(f, u, g2, a);
|
|
647
|
+
return isUniformUnit(a, s2) ? totalDayTimeDuration(D, a) : ((e3, n3, t3, o3, r3, i2, a2) => {
|
|
648
|
+
const s3 = computeDurationSign(e3), [c2, u2] = clampRelativeDuration(o3, gr(t3, e3), t3, s3, r3, i2, a2), f2 = computeEpochNanoFrac(n3, c2, u2);
|
|
649
|
+
return e3[p[t3]] + f2 * s3;
|
|
650
|
+
})(D, d2(g2), a, f, u, d2, m);
|
|
651
|
+
}
|
|
652
|
+
function totalDayTimeDuration(e2, n2) {
|
|
653
|
+
return bigNanoToNumber(durationFieldsToBigNano(e2), Ao[n2], 1);
|
|
654
|
+
}
|
|
655
|
+
function clampRelativeDuration(e2, n2, t2, o2, r2, i, a) {
|
|
656
|
+
const s2 = p[t2], c = {
|
|
657
|
+
...n2,
|
|
658
|
+
[s2]: n2[s2] + o2
|
|
659
|
+
}, u = a(e2, r2, n2), f = a(e2, r2, c);
|
|
660
|
+
return [i(u), i(f)];
|
|
661
|
+
}
|
|
662
|
+
function computeEpochNanoFrac(e2, n2, t2) {
|
|
663
|
+
const o2 = bigNanoToNumber(diffBigNanos(n2, t2));
|
|
664
|
+
if (!o2) {
|
|
665
|
+
throw new RangeError(fo);
|
|
666
|
+
}
|
|
667
|
+
return bigNanoToNumber(diffBigNanos(n2, e2)) / o2;
|
|
668
|
+
}
|
|
669
|
+
function Le(e2, n2) {
|
|
670
|
+
const [t2, o2, r2] = refineRoundingOptions(n2, 5, 1);
|
|
671
|
+
return xe(roundBigNano(e2.epochNanoseconds, t2, o2, r2, 1));
|
|
672
|
+
}
|
|
673
|
+
function Ie(e2, n2, t2) {
|
|
674
|
+
let { epochNanoseconds: o2, timeZone: r2, calendar: i } = n2;
|
|
675
|
+
const [a, s2, c] = refineRoundingOptions(t2);
|
|
676
|
+
if (a === 0 && s2 === 1) {
|
|
677
|
+
return n2;
|
|
678
|
+
}
|
|
679
|
+
const u = e2(r2);
|
|
680
|
+
if (a === 6) {
|
|
681
|
+
o2 = ((e3, n3, t3, o3) => {
|
|
682
|
+
const r3 = he(t3, n3), [i2, a2] = e3(r3), s3 = t3.epochNanoseconds, c2 = getStartOfDayInstantFor(n3, i2), u2 = getStartOfDayInstantFor(n3, a2);
|
|
683
|
+
if (bigNanoOutside(s3, c2, u2)) {
|
|
684
|
+
throw new RangeError(fo);
|
|
685
|
+
}
|
|
686
|
+
return roundWithMode(computeEpochNanoFrac(s3, c2, u2), o3) ? u2 : c2;
|
|
687
|
+
})(computeDayInterval, u, n2, c);
|
|
688
|
+
} else {
|
|
689
|
+
const e3 = u.R(o2);
|
|
690
|
+
o2 = getMatchingInstantFor(u, roundDateTime(epochNanoToIso(o2, e3), a, s2, c), e3, 2, 0, 1);
|
|
691
|
+
}
|
|
692
|
+
return _e(o2, r2, i);
|
|
693
|
+
}
|
|
694
|
+
function vt(e2, n2) {
|
|
695
|
+
return jt(roundDateTime(e2, ...refineRoundingOptions(n2)), e2.calendar);
|
|
696
|
+
}
|
|
697
|
+
function lt(e2, n2) {
|
|
698
|
+
const [t2, o2, r2] = refineRoundingOptions(n2, 5);
|
|
699
|
+
var i;
|
|
700
|
+
return St((i = r2, roundTimeToNano(e2, computeNanoInc(t2, o2), i)[0]));
|
|
701
|
+
}
|
|
702
|
+
function Te(e2, n2) {
|
|
703
|
+
const t2 = e2(n2.timeZone), o2 = he(n2, t2), [r2, i] = computeDayInterval(o2), a = bigNanoToNumber(diffBigNanos(getStartOfDayInstantFor(t2, r2), getStartOfDayInstantFor(t2, i)), zo, 1);
|
|
704
|
+
if (a <= 0) {
|
|
705
|
+
throw new RangeError(fo);
|
|
706
|
+
}
|
|
707
|
+
return a;
|
|
708
|
+
}
|
|
709
|
+
function ve(e2, n2) {
|
|
710
|
+
const { timeZone: t2, calendar: o2 } = n2, r2 = ((e3, n3, t3) => getStartOfDayInstantFor(n3, e3(he(t3, n3))))(computeDayFloor, e2(t2), n2);
|
|
711
|
+
return _e(r2, t2, o2);
|
|
712
|
+
}
|
|
713
|
+
function roundDateTime(e2, n2, t2, o2) {
|
|
714
|
+
return roundDateTimeToNano(e2, computeNanoInc(n2, t2), o2);
|
|
715
|
+
}
|
|
716
|
+
function roundDateTimeToNano(e2, n2, t2) {
|
|
717
|
+
const [o2, r2] = roundTimeToNano(e2, n2, t2);
|
|
718
|
+
return checkIsoDateTimeInBounds({
|
|
719
|
+
...moveByDays(e2, r2),
|
|
720
|
+
...o2
|
|
721
|
+
});
|
|
722
|
+
}
|
|
723
|
+
function roundTimeToNano(e2, n2, t2) {
|
|
724
|
+
return nanoToIsoTimeAndDay(roundByInc(isoTimeFieldsToNano(e2), n2, t2));
|
|
725
|
+
}
|
|
726
|
+
function roundToMinute(e2) {
|
|
727
|
+
return roundByInc(e2, Zo, 7);
|
|
728
|
+
}
|
|
729
|
+
function computeNanoInc(e2, n2) {
|
|
730
|
+
return Ao[e2] * n2;
|
|
731
|
+
}
|
|
732
|
+
function computeDayInterval(e2) {
|
|
733
|
+
const n2 = computeDayFloor(e2);
|
|
734
|
+
return [n2, moveByDays(n2, 1)];
|
|
735
|
+
}
|
|
736
|
+
function computeDayFloor(e2) {
|
|
737
|
+
return yr(6, e2);
|
|
738
|
+
}
|
|
739
|
+
function roundDayTimeDurationByInc(e2, n2, t2) {
|
|
740
|
+
const o2 = Math.min(getMaxDurationUnit(e2), 6);
|
|
741
|
+
return nanoToDurationDayTimeFields(roundBigNanoByInc(durationFieldsToBigNano(e2, o2), n2, t2), o2);
|
|
742
|
+
}
|
|
743
|
+
function roundRelativeDuration(e2, n2, t2, o2, r2, i, a, s2, c, u) {
|
|
744
|
+
if (o2 === 0 && r2 === 1) {
|
|
745
|
+
return e2;
|
|
746
|
+
}
|
|
747
|
+
const f = isUniformUnit(o2, s2) ? isZonedEpochSlots(s2) && o2 < 6 && t2 >= 6 ? nudgeZonedTimeDuration : nudgeDayTimeDuration : nudgeRelativeDuration;
|
|
748
|
+
let [l, d2, m] = f(e2, n2, t2, o2, r2, i, a, s2, c, u);
|
|
749
|
+
return m && o2 !== 7 && (l = ((e3, n3, t3, o3, r3, i2, a2, s3) => {
|
|
750
|
+
const c2 = computeDurationSign(e3);
|
|
751
|
+
for (let u2 = o3 + 1;u2 <= t3; u2++) {
|
|
752
|
+
if (u2 === 7 && t3 !== 7) {
|
|
753
|
+
continue;
|
|
754
|
+
}
|
|
755
|
+
const o4 = gr(u2, e3);
|
|
756
|
+
o4[p[u2]] += c2;
|
|
757
|
+
const f2 = bigNanoToNumber(diffBigNanos(a2(s3(r3, i2, o4)), n3));
|
|
758
|
+
if (f2 && Math.sign(f2) !== c2) {
|
|
759
|
+
break;
|
|
760
|
+
}
|
|
761
|
+
e3 = o4;
|
|
762
|
+
}
|
|
763
|
+
return e3;
|
|
764
|
+
})(l, d2, t2, Math.max(6, o2), a, s2, c, u)), l;
|
|
765
|
+
}
|
|
766
|
+
function roundBigNano(e2, n2, t2, o2, r2) {
|
|
767
|
+
if (n2 === 6) {
|
|
768
|
+
const n3 = ((e3) => e3[0] + e3[1] / Uo)(e2);
|
|
769
|
+
return [roundByInc(n3, t2, o2), 0];
|
|
770
|
+
}
|
|
771
|
+
return roundBigNanoByInc(e2, computeNanoInc(n2, t2), o2, r2);
|
|
772
|
+
}
|
|
773
|
+
function roundBigNanoByInc(e2, n2, t2, o2) {
|
|
774
|
+
let [r2, i] = e2;
|
|
775
|
+
o2 && i < 0 && (i += Uo, r2 -= 1);
|
|
776
|
+
const [a, s2] = divModFloor(roundByInc(i, n2, t2), Uo);
|
|
777
|
+
return createBigNano(r2 + a, s2);
|
|
778
|
+
}
|
|
779
|
+
function roundByInc(e2, n2, t2) {
|
|
780
|
+
return roundWithMode(e2 / n2, t2) * n2;
|
|
781
|
+
}
|
|
782
|
+
function roundWithMode(e2, n2) {
|
|
783
|
+
return ai[n2](e2);
|
|
784
|
+
}
|
|
785
|
+
function nudgeDayTimeDuration(e2, n2, t2, o2, r2, i) {
|
|
786
|
+
const a = computeDurationSign(e2), s2 = durationFieldsToBigNano(e2), c = roundBigNano(s2, o2, r2, i), u = diffBigNanos(s2, c), f = Math.sign(c[0] - s2[0]) === a, l = nanoToDurationDayTimeFields(c, Math.min(t2, 6));
|
|
787
|
+
return [{
|
|
788
|
+
...e2,
|
|
789
|
+
...l
|
|
790
|
+
}, addBigNanos(n2, u), f];
|
|
791
|
+
}
|
|
792
|
+
function nudgeZonedTimeDuration(e2, n2, t2, o2, r2, i, a, s2, c, u) {
|
|
793
|
+
const f = computeDurationSign(e2) || 1, l = bigNanoToNumber(durationFieldsToBigNano(e2, 5)), d2 = computeNanoInc(o2, r2);
|
|
794
|
+
let m = roundByInc(l, d2, i);
|
|
795
|
+
const [p, h2] = clampRelativeDuration(a, {
|
|
796
|
+
...e2,
|
|
797
|
+
...hr
|
|
798
|
+
}, 6, f, s2, c, u), g2 = m - bigNanoToNumber(diffBigNanos(p, h2));
|
|
799
|
+
let D = 0;
|
|
800
|
+
g2 && Math.sign(g2) !== f ? n2 = moveBigNano(p, m) : (D += f, m = roundByInc(g2, d2, i), n2 = moveBigNano(h2, m));
|
|
801
|
+
const T2 = nanoToDurationTimeFields(m);
|
|
802
|
+
return [{
|
|
803
|
+
...e2,
|
|
804
|
+
...T2,
|
|
805
|
+
days: e2.days + D
|
|
806
|
+
}, n2, Boolean(D)];
|
|
807
|
+
}
|
|
808
|
+
function nudgeRelativeDuration(e2, n2, t2, o2, r2, i, a, s2, c, u) {
|
|
809
|
+
const f = computeDurationSign(e2), l = p[o2], d2 = gr(o2, e2);
|
|
810
|
+
o2 === 7 && (e2 = {
|
|
811
|
+
...e2,
|
|
812
|
+
weeks: e2.weeks + Math.trunc(e2.days / 7)
|
|
813
|
+
});
|
|
814
|
+
const m = divTrunc(e2[l], r2) * r2;
|
|
815
|
+
d2[l] = m;
|
|
816
|
+
const [h2, g2] = clampRelativeDuration(a, d2, o2, r2 * f, s2, c, u), D = m + computeEpochNanoFrac(n2, h2, g2) * f * r2, T2 = roundByInc(D, r2, i), I2 = Math.sign(T2 - D) === f;
|
|
817
|
+
return d2[l] = T2, [d2, I2 ? g2 : h2, I2];
|
|
818
|
+
}
|
|
819
|
+
function ke(e2, n2, t2, o2) {
|
|
820
|
+
const [r2, i, a, s2] = ((e3) => {
|
|
821
|
+
const n3 = refineTimeDisplayTuple(e3 = normalizeOptions(e3));
|
|
822
|
+
return [e3.timeZone, ...n3];
|
|
823
|
+
})(o2), c = r2 !== undefined;
|
|
824
|
+
return ((e3, n3, t3, o3, r3, i2) => {
|
|
825
|
+
t3 = roundBigNanoByInc(t3, r3, o3, 1);
|
|
826
|
+
const a2 = n3.R(t3);
|
|
827
|
+
return formatIsoDateTimeFields(epochNanoToIso(t3, a2), i2) + (e3 ? Se(roundToMinute(a2)) : "Z");
|
|
828
|
+
})(c, n2(c ? e2(r2) : si), t2.epochNanoseconds, i, a, s2);
|
|
829
|
+
}
|
|
830
|
+
function Fe(e2, n2, t2) {
|
|
831
|
+
const [o2, r2, i, a, s2, c] = ((e3) => {
|
|
832
|
+
e3 = normalizeOptions(e3);
|
|
833
|
+
const n3 = ti(e3), t3 = refineSubsecDigits(e3), o3 = ri(e3), r3 = ii(e3, 4), i2 = Jr(e3, 4);
|
|
834
|
+
return [n3, oi(e3), o3, r3, ...refineSmallestUnitAndSubsecDigits(i2, t3)];
|
|
835
|
+
})(t2);
|
|
836
|
+
return ((e3, n3, t3, o3, r3, i2, a2, s3, c2, u) => {
|
|
837
|
+
o3 = roundBigNanoByInc(o3, c2, s3, 1);
|
|
838
|
+
const f = e3(t3).R(o3);
|
|
839
|
+
return formatIsoDateTimeFields(epochNanoToIso(o3, f), u) + Se(roundToMinute(f), a2) + ((e4, n4) => n4 !== 1 ? "[" + (n4 === 2 ? "!" : "") + e4 + "]" : "")(t3, i2) + formatCalendar(n3, r3);
|
|
840
|
+
})(e2, n2.calendar, n2.timeZone, n2.epochNanoseconds, o2, r2, i, a, s2, c);
|
|
841
|
+
}
|
|
842
|
+
function Ft(e2, n2) {
|
|
843
|
+
const [t2, o2, r2, i] = ((e3) => (e3 = normalizeOptions(e3), [ti(e3), ...refineTimeDisplayTuple(e3)]))(n2);
|
|
844
|
+
return a = e2.calendar, s2 = t2, c = i, formatIsoDateTimeFields(roundDateTimeToNano(e2, r2, o2), c) + formatCalendar(a, s2);
|
|
845
|
+
var a, s2, c;
|
|
846
|
+
}
|
|
847
|
+
function ce(e2, n2) {
|
|
848
|
+
return t2 = e2.calendar, o2 = e2, r2 = refineDateDisplayOptions(n2), formatIsoDateFields(o2) + formatCalendar(t2, r2);
|
|
849
|
+
var t2, o2, r2;
|
|
850
|
+
}
|
|
851
|
+
function Kt(e2, n2) {
|
|
852
|
+
return formatDateLikeIso(e2.calendar, formatIsoYearMonthFields, e2, refineDateDisplayOptions(n2));
|
|
853
|
+
}
|
|
854
|
+
function Jt(e2, n2) {
|
|
855
|
+
return formatDateLikeIso(e2.calendar, formatIsoMonthDayFields, e2, refineDateDisplayOptions(n2));
|
|
856
|
+
}
|
|
857
|
+
function ct(e2, n2) {
|
|
858
|
+
const [t2, o2, r2] = refineTimeDisplayOptions(n2);
|
|
859
|
+
return i = r2, formatIsoTimeFields(roundTimeToNano(e2, o2, t2)[0], i);
|
|
860
|
+
var i;
|
|
861
|
+
}
|
|
862
|
+
function k(e2, n2) {
|
|
863
|
+
const [t2, o2, r2] = refineTimeDisplayOptions(n2, 3);
|
|
864
|
+
return o2 > 1 && checkDurationUnits(e2 = {
|
|
865
|
+
...e2,
|
|
866
|
+
...roundDayTimeDurationByInc(e2, o2, t2)
|
|
867
|
+
}), ((e3, n3) => {
|
|
868
|
+
const { sign: t3 } = e3, o3 = t3 === -1 ? negateDurationFields(e3) : e3, { hours: r3, minutes: i } = o3, [a, s2] = divModBigNano(durationFieldsToBigNano(o3, 3), Ro, divModTrunc);
|
|
869
|
+
checkDurationTimeUnit(a);
|
|
870
|
+
const c = formatSubsecNano(s2, n3), u = n3 >= 0 || !t3 || c;
|
|
871
|
+
return (t3 < 0 ? "-" : "") + "P" + formatDurationFragments({
|
|
872
|
+
Y: formatDurationNumber(o3.years),
|
|
873
|
+
M: formatDurationNumber(o3.months),
|
|
874
|
+
W: formatDurationNumber(o3.weeks),
|
|
875
|
+
D: formatDurationNumber(o3.days)
|
|
876
|
+
}) + (r3 || i || a || u ? "T" + formatDurationFragments({
|
|
877
|
+
H: formatDurationNumber(r3),
|
|
878
|
+
M: formatDurationNumber(i),
|
|
879
|
+
S: formatDurationNumber(a, u) + c
|
|
880
|
+
}) : "");
|
|
881
|
+
})(e2, r2);
|
|
882
|
+
}
|
|
883
|
+
function formatDateLikeIso(e2, n2, t2, o2) {
|
|
884
|
+
const r2 = o2 > 1 || o2 === 0 && e2 !== l;
|
|
885
|
+
return o2 === 1 ? e2 === l ? n2(t2) : formatIsoDateFields(t2) : r2 ? formatIsoDateFields(t2) + formatCalendarId(e2, o2 === 2) : n2(t2);
|
|
886
|
+
}
|
|
887
|
+
function formatDurationFragments(e2) {
|
|
888
|
+
const n2 = [];
|
|
889
|
+
for (const t2 in e2) {
|
|
890
|
+
const o2 = e2[t2];
|
|
891
|
+
o2 && n2.push(o2, t2);
|
|
892
|
+
}
|
|
893
|
+
return n2.join("");
|
|
894
|
+
}
|
|
895
|
+
function formatIsoDateTimeFields(e2, n2) {
|
|
896
|
+
return formatIsoDateFields(e2) + "T" + formatIsoTimeFields(e2, n2);
|
|
897
|
+
}
|
|
898
|
+
function formatIsoDateFields(e2) {
|
|
899
|
+
return formatIsoYearMonthFields(e2) + "-" + bo(e2.isoDay);
|
|
900
|
+
}
|
|
901
|
+
function formatIsoYearMonthFields(e2) {
|
|
902
|
+
const { isoYear: n2 } = e2;
|
|
903
|
+
return (n2 < 0 || n2 > 9999 ? getSignStr(n2) + padNumber(6, Math.abs(n2)) : padNumber(4, n2)) + "-" + bo(e2.isoMonth);
|
|
904
|
+
}
|
|
905
|
+
function formatIsoMonthDayFields(e2) {
|
|
906
|
+
return bo(e2.isoMonth) + "-" + bo(e2.isoDay);
|
|
907
|
+
}
|
|
908
|
+
function formatIsoTimeFields(e2, n2) {
|
|
909
|
+
const t2 = [bo(e2.isoHour), bo(e2.isoMinute)];
|
|
910
|
+
return n2 !== -1 && t2.push(bo(e2.isoSecond) + ((e3, n3, t3, o2) => formatSubsecNano(e3 * Qe + n3 * Yo + t3, o2))(e2.isoMillisecond, e2.isoMicrosecond, e2.isoNanosecond, n2)), t2.join(":");
|
|
911
|
+
}
|
|
912
|
+
function Se(e2, n2 = 0) {
|
|
913
|
+
if (n2 === 1) {
|
|
914
|
+
return "";
|
|
915
|
+
}
|
|
916
|
+
const [t2, o2] = divModFloor(Math.abs(e2), zo), [r2, i] = divModFloor(o2, Zo), [a, s2] = divModFloor(i, Ro);
|
|
917
|
+
return getSignStr(e2) + bo(t2) + ":" + bo(r2) + (a || s2 ? ":" + bo(a) + formatSubsecNano(s2) : "");
|
|
918
|
+
}
|
|
919
|
+
function formatCalendar(e2, n2) {
|
|
920
|
+
return n2 !== 1 && (n2 > 1 || n2 === 0 && e2 !== l) ? formatCalendarId(e2, n2 === 2) : "";
|
|
921
|
+
}
|
|
922
|
+
function formatCalendarId(e2, n2) {
|
|
923
|
+
return "[" + (n2 ? "!" : "") + "u-ca=" + e2 + "]";
|
|
924
|
+
}
|
|
925
|
+
function formatSubsecNano(e2, n2) {
|
|
926
|
+
let t2 = padNumber(9, e2);
|
|
927
|
+
return t2 = n2 === undefined ? t2.replace(li, "") : t2.slice(0, n2), t2 ? "." + t2 : "";
|
|
928
|
+
}
|
|
929
|
+
function getSignStr(e2) {
|
|
930
|
+
return e2 < 0 ? "-" : "+";
|
|
931
|
+
}
|
|
932
|
+
function formatDurationNumber(e2, n2) {
|
|
933
|
+
return e2 || n2 ? e2.toLocaleString("fullwide", {
|
|
934
|
+
useGrouping: 0
|
|
935
|
+
}) : "";
|
|
936
|
+
}
|
|
937
|
+
function _zonedEpochSlotsToIso(e2, n2) {
|
|
938
|
+
const { epochNanoseconds: t2 } = e2, o2 = (n2.R ? n2 : n2(e2.timeZone)).R(t2), r2 = epochNanoToIso(t2, o2);
|
|
939
|
+
return {
|
|
940
|
+
calendar: e2.calendar,
|
|
941
|
+
...r2,
|
|
942
|
+
offsetNanoseconds: o2
|
|
943
|
+
};
|
|
944
|
+
}
|
|
945
|
+
function getMatchingInstantFor(e2, n2, t2, o2 = 0, r2 = 0, i, a) {
|
|
946
|
+
if (t2 !== undefined && o2 === 1 && (o2 === 1 || a)) {
|
|
947
|
+
return isoToEpochNanoWithOffset(n2, t2);
|
|
948
|
+
}
|
|
949
|
+
const s2 = e2.I(n2);
|
|
950
|
+
if (t2 !== undefined && o2 !== 3) {
|
|
951
|
+
const e3 = ((e4, n3, t3, o3) => {
|
|
952
|
+
const r3 = isoToEpochNano(n3);
|
|
953
|
+
o3 && (t3 = roundToMinute(t3));
|
|
954
|
+
for (const n4 of e4) {
|
|
955
|
+
let e5 = bigNanoToNumber(diffBigNanos(n4, r3));
|
|
956
|
+
if (o3 && (e5 = roundToMinute(e5)), e5 === t3) {
|
|
957
|
+
return n4;
|
|
958
|
+
}
|
|
959
|
+
}
|
|
960
|
+
})(s2, n2, t2, i);
|
|
961
|
+
if (e3 !== undefined) {
|
|
962
|
+
return e3;
|
|
963
|
+
}
|
|
964
|
+
if (o2 === 0) {
|
|
965
|
+
throw new RangeError(Do);
|
|
966
|
+
}
|
|
967
|
+
}
|
|
968
|
+
return a ? isoToEpochNano(n2) : getSingleInstantFor(e2, n2, r2, s2);
|
|
969
|
+
}
|
|
970
|
+
function getSingleInstantFor(e2, n2, t2 = 0, o2 = e2.I(n2)) {
|
|
971
|
+
if (o2.length === 1) {
|
|
972
|
+
return o2[0];
|
|
973
|
+
}
|
|
974
|
+
if (t2 === 1) {
|
|
975
|
+
throw new RangeError(To);
|
|
976
|
+
}
|
|
977
|
+
if (o2.length) {
|
|
978
|
+
return o2[t2 === 3 ? 1 : 0];
|
|
979
|
+
}
|
|
980
|
+
const r2 = isoToEpochNano(n2), i = ((e3, n3) => {
|
|
981
|
+
const t3 = e3.R(moveBigNano(n3, -Uo));
|
|
982
|
+
return ((e4) => {
|
|
983
|
+
if (e4 > Uo) {
|
|
984
|
+
throw new RangeError(go);
|
|
985
|
+
}
|
|
986
|
+
return e4;
|
|
987
|
+
})(e3.R(moveBigNano(n3, Uo)) - t3);
|
|
988
|
+
})(e2, r2), a = i * (t2 === 2 ? -1 : 1);
|
|
989
|
+
return (o2 = e2.I(epochNanoToIso(r2, a)))[t2 === 2 ? 0 : o2.length - 1];
|
|
990
|
+
}
|
|
991
|
+
function getStartOfDayInstantFor(e2, n2) {
|
|
992
|
+
const t2 = e2.I(n2);
|
|
993
|
+
if (t2.length) {
|
|
994
|
+
return t2[0];
|
|
995
|
+
}
|
|
996
|
+
const o2 = moveBigNano(isoToEpochNano(n2), -Uo);
|
|
997
|
+
return e2.O(o2, 1);
|
|
998
|
+
}
|
|
999
|
+
function Ye(e2, n2, t2) {
|
|
1000
|
+
return xe(checkEpochNanoInBounds(addBigNanos(n2.epochNanoseconds, ((e3) => {
|
|
1001
|
+
if (durationHasDateParts(e3)) {
|
|
1002
|
+
throw new RangeError(vo);
|
|
1003
|
+
}
|
|
1004
|
+
return durationFieldsToBigNano(e3, 5);
|
|
1005
|
+
})(e2 ? negateDurationFields(t2) : t2))));
|
|
1006
|
+
}
|
|
1007
|
+
function pe(e2, n2, t2, o2, r2, i = Object.create(null)) {
|
|
1008
|
+
const a = n2(o2.timeZone), s2 = e2(o2.calendar);
|
|
1009
|
+
return {
|
|
1010
|
+
...o2,
|
|
1011
|
+
...moveZonedEpochs(a, s2, o2, t2 ? negateDurationFields(r2) : r2, i)
|
|
1012
|
+
};
|
|
1013
|
+
}
|
|
1014
|
+
function wt(e2, n2, t2, o2, r2 = Object.create(null)) {
|
|
1015
|
+
const { calendar: i } = t2;
|
|
1016
|
+
return jt(moveDateTime(e2(i), t2, n2 ? negateDurationFields(o2) : o2, r2), i);
|
|
1017
|
+
}
|
|
1018
|
+
function ne(e2, n2, t2, o2, r2) {
|
|
1019
|
+
const { calendar: i } = t2;
|
|
1020
|
+
return W(moveDate(e2(i), t2, n2 ? negateDurationFields(o2) : o2, r2), i);
|
|
1021
|
+
}
|
|
1022
|
+
function Gt(e2, n2, t2, o2, r2) {
|
|
1023
|
+
const i = t2.calendar, a = e2(i);
|
|
1024
|
+
let s2 = checkIsoDateInBounds(moveToDayOfMonthUnsafe(a, t2));
|
|
1025
|
+
n2 && (o2 = B(o2)), o2.sign < 0 && (s2 = a.P(s2, {
|
|
1026
|
+
...pr,
|
|
1027
|
+
months: 1
|
|
1028
|
+
}), s2 = moveByDays(s2, -1));
|
|
1029
|
+
const c = a.P(s2, o2, r2);
|
|
1030
|
+
return createPlainYearMonthSlots(moveToDayOfMonthUnsafe(a, c), i);
|
|
1031
|
+
}
|
|
1032
|
+
function at(e2, n2, t2) {
|
|
1033
|
+
return St(moveTime(n2, e2 ? negateDurationFields(t2) : t2)[0]);
|
|
1034
|
+
}
|
|
1035
|
+
function moveZonedEpochs(e2, n2, t2, o2, r2) {
|
|
1036
|
+
const i = durationFieldsToBigNano(o2, 5);
|
|
1037
|
+
let a = t2.epochNanoseconds;
|
|
1038
|
+
if (durationHasDateParts(o2)) {
|
|
1039
|
+
const s2 = he(t2, e2);
|
|
1040
|
+
a = addBigNanos(getSingleInstantFor(e2, {
|
|
1041
|
+
...moveDate(n2, s2, {
|
|
1042
|
+
...o2,
|
|
1043
|
+
...hr
|
|
1044
|
+
}, r2),
|
|
1045
|
+
...nn(w, s2)
|
|
1046
|
+
}), i);
|
|
1047
|
+
} else {
|
|
1048
|
+
a = addBigNanos(a, i), mt(r2);
|
|
1049
|
+
}
|
|
1050
|
+
return {
|
|
1051
|
+
epochNanoseconds: checkEpochNanoInBounds(a)
|
|
1052
|
+
};
|
|
1053
|
+
}
|
|
1054
|
+
function moveDateTime(e2, n2, t2, o2) {
|
|
1055
|
+
const [r2, i] = moveTime(n2, t2);
|
|
1056
|
+
return checkIsoDateTimeInBounds({
|
|
1057
|
+
...moveDate(e2, n2, {
|
|
1058
|
+
...t2,
|
|
1059
|
+
...hr,
|
|
1060
|
+
days: t2.days + i
|
|
1061
|
+
}, o2),
|
|
1062
|
+
...r2
|
|
1063
|
+
});
|
|
1064
|
+
}
|
|
1065
|
+
function moveDate(e2, n2, t2, o2) {
|
|
1066
|
+
if (t2.years || t2.months || t2.weeks) {
|
|
1067
|
+
return e2.P(n2, t2, o2);
|
|
1068
|
+
}
|
|
1069
|
+
mt(o2);
|
|
1070
|
+
const r2 = t2.days + durationFieldsToBigNano(t2, 5)[0];
|
|
1071
|
+
return r2 ? checkIsoDateInBounds(moveByDays(n2, r2)) : n2;
|
|
1072
|
+
}
|
|
1073
|
+
function moveToDayOfMonthUnsafe(e2, n2, t2 = 1) {
|
|
1074
|
+
return moveByDays(n2, t2 - e2.day(n2));
|
|
1075
|
+
}
|
|
1076
|
+
function moveTime(e2, n2) {
|
|
1077
|
+
const [t2, o2] = durationFieldsToBigNano(n2, 5), [r2, i] = nanoToIsoTimeAndDay(isoTimeFieldsToNano(e2) + o2);
|
|
1078
|
+
return [r2, t2 + i];
|
|
1079
|
+
}
|
|
1080
|
+
function moveByDays(e2, n2) {
|
|
1081
|
+
return n2 ? {
|
|
1082
|
+
...e2,
|
|
1083
|
+
...epochMilliToIso(isoToEpochMilli(e2) + n2 * ko)
|
|
1084
|
+
} : e2;
|
|
1085
|
+
}
|
|
1086
|
+
function createMarkerSystem(e2, n2, t2) {
|
|
1087
|
+
const o2 = e2(t2.calendar);
|
|
1088
|
+
return isZonedEpochSlots(t2) ? [t2, o2, n2(t2.timeZone)] : [{
|
|
1089
|
+
...t2,
|
|
1090
|
+
...Nt
|
|
1091
|
+
}, o2];
|
|
1092
|
+
}
|
|
1093
|
+
function createMarkerToEpochNano(e2) {
|
|
1094
|
+
return e2 ? extractEpochNano : isoToEpochNano;
|
|
1095
|
+
}
|
|
1096
|
+
function createMoveMarker(e2) {
|
|
1097
|
+
return e2 ? Pt(moveZonedEpochs, e2) : moveDateTime;
|
|
1098
|
+
}
|
|
1099
|
+
function createDiffMarkers(e2) {
|
|
1100
|
+
return e2 ? Pt(diffZonedEpochsExact, e2) : diffDateTimesExact;
|
|
1101
|
+
}
|
|
1102
|
+
function isZonedEpochSlots(e2) {
|
|
1103
|
+
return e2 && e2.epochNanoseconds;
|
|
1104
|
+
}
|
|
1105
|
+
function isUniformUnit(e2, n2) {
|
|
1106
|
+
return e2 <= 6 - (isZonedEpochSlots(n2) ? 1 : 0);
|
|
1107
|
+
}
|
|
1108
|
+
function E(e2, n2, t2, o2, r2, i, a) {
|
|
1109
|
+
const s2 = e2(normalizeOptions(a).relativeTo), c = Math.max(getMaxDurationUnit(r2), getMaxDurationUnit(i));
|
|
1110
|
+
if (isUniformUnit(c, s2)) {
|
|
1111
|
+
return Oe(checkDurationUnits(((e3, n3, t3, o3) => {
|
|
1112
|
+
const r3 = addBigNanos(durationFieldsToBigNano(e3), durationFieldsToBigNano(n3), o3 ? -1 : 1);
|
|
1113
|
+
if (!Number.isFinite(r3[0])) {
|
|
1114
|
+
throw new RangeError(Io);
|
|
1115
|
+
}
|
|
1116
|
+
return {
|
|
1117
|
+
...pr,
|
|
1118
|
+
...nanoToDurationDayTimeFields(r3, t3)
|
|
1119
|
+
};
|
|
1120
|
+
})(r2, i, c, o2)));
|
|
1121
|
+
}
|
|
1122
|
+
if (!s2) {
|
|
1123
|
+
throw new RangeError(yo);
|
|
1124
|
+
}
|
|
1125
|
+
o2 && (i = negateDurationFields(i));
|
|
1126
|
+
const [u, f, l] = createMarkerSystem(n2, t2, s2), d2 = createMoveMarker(l), m = createDiffMarkers(l), p = d2(f, u, r2);
|
|
1127
|
+
return Oe(m(f, u, d2(f, p, i), c));
|
|
1128
|
+
}
|
|
1129
|
+
function V(e2, n2, t2, o2, r2) {
|
|
1130
|
+
const i = getMaxDurationUnit(o2), [a, s2, c, u, f] = ((e3, n3, t3) => {
|
|
1131
|
+
e3 = normalizeOptionsOrString(e3, Rr);
|
|
1132
|
+
let o3 = Kr(e3);
|
|
1133
|
+
const r3 = t3(e3[Ar]);
|
|
1134
|
+
let i2 = parseRoundingIncInteger(e3);
|
|
1135
|
+
const a2 = ii(e3, 7);
|
|
1136
|
+
let s3 = Jr(e3);
|
|
1137
|
+
if (o3 === undefined && s3 === undefined) {
|
|
1138
|
+
throw new RangeError(Po);
|
|
1139
|
+
}
|
|
1140
|
+
if (s3 == null && (s3 = 0), o3 == null && (o3 = Math.max(s3, n3)), checkLargestSmallestUnit(o3, s3), i2 = refineRoundingInc(i2, s3, 1), i2 > 1 && s3 > 5 && o3 !== s3) {
|
|
1141
|
+
throw new RangeError("For calendar units with roundingIncrement > 1, use largestUnit = smallestUnit");
|
|
1142
|
+
}
|
|
1143
|
+
return [o3, s3, i2, a2, r3];
|
|
1144
|
+
})(r2, i, e2), l = Math.max(i, a);
|
|
1145
|
+
if (!f && l <= 6) {
|
|
1146
|
+
return Oe(checkDurationUnits(((e3, n3, t3, o3, r3) => {
|
|
1147
|
+
const i2 = roundBigNano(durationFieldsToBigNano(e3), t3, o3, r3);
|
|
1148
|
+
return {
|
|
1149
|
+
...pr,
|
|
1150
|
+
...nanoToDurationDayTimeFields(i2, n3)
|
|
1151
|
+
};
|
|
1152
|
+
})(o2, a, s2, c, u)));
|
|
1153
|
+
}
|
|
1154
|
+
if (!isZonedEpochSlots(f) && !o2.sign) {
|
|
1155
|
+
return o2;
|
|
1156
|
+
}
|
|
1157
|
+
if (!f) {
|
|
1158
|
+
throw new RangeError(yo);
|
|
1159
|
+
}
|
|
1160
|
+
const [d2, m, p] = createMarkerSystem(n2, t2, f), h2 = createMarkerToEpochNano(p), g2 = createMoveMarker(p), D = createDiffMarkers(p), T2 = g2(m, d2, o2);
|
|
1161
|
+
isZonedEpochSlots(f) || (checkIsoDateTimeInBounds(d2), checkIsoDateTimeInBounds(T2));
|
|
1162
|
+
let I2 = D(m, d2, T2, a);
|
|
1163
|
+
const M = o2.sign, N = computeDurationSign(I2);
|
|
1164
|
+
if (M && N && M !== N) {
|
|
1165
|
+
throw new RangeError(fo);
|
|
1166
|
+
}
|
|
1167
|
+
return I2 = roundRelativeDuration(I2, h2(T2), a, s2, c, u, m, d2, h2, g2), Oe(I2);
|
|
1168
|
+
}
|
|
1169
|
+
function Y(e2) {
|
|
1170
|
+
return e2.sign === -1 ? B(e2) : e2;
|
|
1171
|
+
}
|
|
1172
|
+
function B(e2) {
|
|
1173
|
+
return Oe(negateDurationFields(e2));
|
|
1174
|
+
}
|
|
1175
|
+
function negateDurationFields(e2) {
|
|
1176
|
+
const n2 = {};
|
|
1177
|
+
for (const t2 of p) {
|
|
1178
|
+
n2[t2] = -1 * e2[t2] || 0;
|
|
1179
|
+
}
|
|
1180
|
+
return n2;
|
|
1181
|
+
}
|
|
1182
|
+
function y(e2) {
|
|
1183
|
+
return !e2.sign;
|
|
1184
|
+
}
|
|
1185
|
+
function computeDurationSign(e2, n2 = p) {
|
|
1186
|
+
let t2 = 0;
|
|
1187
|
+
for (const o2 of n2) {
|
|
1188
|
+
const n3 = Math.sign(e2[o2]);
|
|
1189
|
+
if (n3) {
|
|
1190
|
+
if (t2 && t2 !== n3) {
|
|
1191
|
+
throw new RangeError(No);
|
|
1192
|
+
}
|
|
1193
|
+
t2 = n3;
|
|
1194
|
+
}
|
|
1195
|
+
}
|
|
1196
|
+
return t2;
|
|
1197
|
+
}
|
|
1198
|
+
function checkDurationUnits(e2) {
|
|
1199
|
+
for (const n2 of dr) {
|
|
1200
|
+
clampEntity(n2, e2[n2], -di, di, 1);
|
|
1201
|
+
}
|
|
1202
|
+
return checkDurationTimeUnit(bigNanoToNumber(durationFieldsToBigNano(e2), Ro)), e2;
|
|
1203
|
+
}
|
|
1204
|
+
function checkDurationTimeUnit(e2) {
|
|
1205
|
+
if (!Number.isSafeInteger(e2)) {
|
|
1206
|
+
throw new RangeError(Mo);
|
|
1207
|
+
}
|
|
1208
|
+
}
|
|
1209
|
+
function durationFieldsToBigNano(e2, n2 = 6) {
|
|
1210
|
+
return givenFieldsToBigNano(e2, n2, p);
|
|
1211
|
+
}
|
|
1212
|
+
function nanoToDurationDayTimeFields(e2, n2 = 6) {
|
|
1213
|
+
const [t2, o2] = e2, r2 = nanoToGivenFields(o2, n2, p);
|
|
1214
|
+
if (r2[p[n2]] += t2 * (Uo / Ao[n2]), !Number.isFinite(r2[p[n2]])) {
|
|
1215
|
+
throw new RangeError(Io);
|
|
1216
|
+
}
|
|
1217
|
+
return r2;
|
|
1218
|
+
}
|
|
1219
|
+
function nanoToDurationTimeFields(e2, n2 = 5) {
|
|
1220
|
+
return nanoToGivenFields(e2, n2, p);
|
|
1221
|
+
}
|
|
1222
|
+
function durationHasDateParts(e2) {
|
|
1223
|
+
return Boolean(computeDurationSign(e2, lr));
|
|
1224
|
+
}
|
|
1225
|
+
function getMaxDurationUnit(e2) {
|
|
1226
|
+
let n2 = 9;
|
|
1227
|
+
for (;n2 > 0 && !e2[p[n2]]; n2--) {}
|
|
1228
|
+
return n2;
|
|
1229
|
+
}
|
|
1230
|
+
function createSplitTuple(e2, n2) {
|
|
1231
|
+
return [e2, n2];
|
|
1232
|
+
}
|
|
1233
|
+
function computePeriod(e2) {
|
|
1234
|
+
const n2 = Math.floor(e2 / ci) * ci;
|
|
1235
|
+
return [n2, n2 + ci];
|
|
1236
|
+
}
|
|
1237
|
+
function We(e2) {
|
|
1238
|
+
const n2 = parseDateTimeLike(e2 = toStringViaPrimitive(e2));
|
|
1239
|
+
if (!n2) {
|
|
1240
|
+
throw new RangeError(failedParse(e2));
|
|
1241
|
+
}
|
|
1242
|
+
let t2;
|
|
1243
|
+
if (n2.j) {
|
|
1244
|
+
t2 = 0;
|
|
1245
|
+
} else {
|
|
1246
|
+
if (!n2.offset) {
|
|
1247
|
+
throw new RangeError(failedParse(e2));
|
|
1248
|
+
}
|
|
1249
|
+
t2 = parseOffsetNano(n2.offset);
|
|
1250
|
+
}
|
|
1251
|
+
return n2.timeZone && parseOffsetNanoMaybe(n2.timeZone, 1), xe(isoToEpochNanoWithOffset(checkIsoDateTimeFields(n2), t2));
|
|
1252
|
+
}
|
|
1253
|
+
function H(e2) {
|
|
1254
|
+
const n2 = parseDateTimeLike(m(e2));
|
|
1255
|
+
if (!n2) {
|
|
1256
|
+
throw new RangeError(failedParse(e2));
|
|
1257
|
+
}
|
|
1258
|
+
if (n2.timeZone) {
|
|
1259
|
+
return finalizeZonedDateTime(n2, n2.offset ? parseOffsetNano(n2.offset) : undefined);
|
|
1260
|
+
}
|
|
1261
|
+
if (n2.j) {
|
|
1262
|
+
throw new RangeError(failedParse(e2));
|
|
1263
|
+
}
|
|
1264
|
+
return finalizeDate(n2);
|
|
1265
|
+
}
|
|
1266
|
+
function Ae(e2, n2) {
|
|
1267
|
+
const t2 = parseDateTimeLike(m(e2));
|
|
1268
|
+
if (!t2 || !t2.timeZone) {
|
|
1269
|
+
throw new RangeError(failedParse(e2));
|
|
1270
|
+
}
|
|
1271
|
+
const { offset: o2 } = t2, r2 = o2 ? parseOffsetNano(o2) : undefined, [, i, a] = je(n2);
|
|
1272
|
+
return finalizeZonedDateTime(t2, r2, i, a);
|
|
1273
|
+
}
|
|
1274
|
+
function parseOffsetNano(e2) {
|
|
1275
|
+
const n2 = parseOffsetNanoMaybe(e2);
|
|
1276
|
+
if (n2 === undefined) {
|
|
1277
|
+
throw new RangeError(failedParse(e2));
|
|
1278
|
+
}
|
|
1279
|
+
return n2;
|
|
1280
|
+
}
|
|
1281
|
+
function Bt(e2) {
|
|
1282
|
+
const n2 = parseDateTimeLike(m(e2));
|
|
1283
|
+
if (!n2 || n2.j) {
|
|
1284
|
+
throw new RangeError(failedParse(e2));
|
|
1285
|
+
}
|
|
1286
|
+
return jt(finalizeDateTime(n2));
|
|
1287
|
+
}
|
|
1288
|
+
function de(e2, n2, t2) {
|
|
1289
|
+
let o2 = parseDateTimeLike(m(e2));
|
|
1290
|
+
if (!o2 || o2.j) {
|
|
1291
|
+
throw new RangeError(failedParse(e2));
|
|
1292
|
+
}
|
|
1293
|
+
return n2 ? o2.calendar === l && (o2 = o2.isoYear === -271821 && o2.isoMonth === 4 ? {
|
|
1294
|
+
...o2,
|
|
1295
|
+
isoDay: 20,
|
|
1296
|
+
...Nt
|
|
1297
|
+
} : {
|
|
1298
|
+
...o2,
|
|
1299
|
+
isoDay: 1,
|
|
1300
|
+
...Nt
|
|
1301
|
+
}) : t2 && o2.calendar === l && (o2 = {
|
|
1302
|
+
...o2,
|
|
1303
|
+
isoYear: Br
|
|
1304
|
+
}), W(o2.C ? finalizeDateTime(o2) : finalizeDate(o2));
|
|
1305
|
+
}
|
|
1306
|
+
function _t(e2, n2) {
|
|
1307
|
+
const t2 = parseYearMonthOnly(m(n2));
|
|
1308
|
+
if (t2) {
|
|
1309
|
+
return requireIsoCalendar(t2), createPlainYearMonthSlots(checkIsoYearMonthInBounds(checkIsoDateFields(t2)));
|
|
1310
|
+
}
|
|
1311
|
+
const o2 = de(n2, 1);
|
|
1312
|
+
return createPlainYearMonthSlots(moveToDayOfMonthUnsafe(e2(o2.calendar), o2));
|
|
1313
|
+
}
|
|
1314
|
+
function requireIsoCalendar(e2) {
|
|
1315
|
+
if (e2.calendar !== l) {
|
|
1316
|
+
throw new RangeError(invalidSubstring(e2.calendar));
|
|
1317
|
+
}
|
|
1318
|
+
}
|
|
1319
|
+
function xt(e2, n2) {
|
|
1320
|
+
const t2 = parseMonthDayOnly(m(n2));
|
|
1321
|
+
if (t2) {
|
|
1322
|
+
return requireIsoCalendar(t2), createPlainMonthDaySlots(checkIsoDateFields(t2));
|
|
1323
|
+
}
|
|
1324
|
+
const o2 = de(n2, 0, 1), { calendar: r2 } = o2, i = e2(r2), [a, s2, c] = i.v(o2), [u, f] = i.q(a, s2), [l, d2] = i.G(u, f, c);
|
|
1325
|
+
return createPlainMonthDaySlots(checkIsoDateInBounds(i.V(l, d2, c)), r2);
|
|
1326
|
+
}
|
|
1327
|
+
function ht(e2) {
|
|
1328
|
+
let n2, t2 = ((e3) => {
|
|
1329
|
+
const n3 = Pi.exec(e3);
|
|
1330
|
+
return n3 ? (organizeAnnotationParts(n3[10]), organizeTimeParts(n3)) : undefined;
|
|
1331
|
+
})(m(e2));
|
|
1332
|
+
if (!t2) {
|
|
1333
|
+
if (t2 = parseDateTimeLike(e2), !t2) {
|
|
1334
|
+
throw new RangeError(failedParse(e2));
|
|
1335
|
+
}
|
|
1336
|
+
if (!t2.C) {
|
|
1337
|
+
throw new RangeError(failedParse(e2));
|
|
1338
|
+
}
|
|
1339
|
+
if (t2.j) {
|
|
1340
|
+
throw new RangeError(invalidSubstring("Z"));
|
|
1341
|
+
}
|
|
1342
|
+
requireIsoCalendar(t2);
|
|
1343
|
+
}
|
|
1344
|
+
if ((n2 = parseYearMonthOnly(e2)) && isIsoDateFieldsValid(n2)) {
|
|
1345
|
+
throw new RangeError(failedParse(e2));
|
|
1346
|
+
}
|
|
1347
|
+
if ((n2 = parseMonthDayOnly(e2)) && isIsoDateFieldsValid(n2)) {
|
|
1348
|
+
throw new RangeError(failedParse(e2));
|
|
1349
|
+
}
|
|
1350
|
+
return St(constrainIsoTimeFields(t2, 1));
|
|
1351
|
+
}
|
|
1352
|
+
function R(e2) {
|
|
1353
|
+
const n2 = ((e3) => {
|
|
1354
|
+
const n3 = Fi.exec(e3);
|
|
1355
|
+
return n3 ? ((e4) => {
|
|
1356
|
+
function parseUnit(e5, r3, i) {
|
|
1357
|
+
let a = 0, s2 = 0;
|
|
1358
|
+
if (i && ([a, o2] = divModFloor(o2, Ao[i])), e5 !== undefined) {
|
|
1359
|
+
if (t2) {
|
|
1360
|
+
throw new RangeError(invalidSubstring(e5));
|
|
1361
|
+
}
|
|
1362
|
+
s2 = ((e6) => {
|
|
1363
|
+
const n5 = parseInt(e6);
|
|
1364
|
+
if (!Number.isFinite(n5)) {
|
|
1365
|
+
throw new RangeError(invalidSubstring(e6));
|
|
1366
|
+
}
|
|
1367
|
+
return n5;
|
|
1368
|
+
})(e5), n4 = 1, r3 && (o2 = parseSubsecNano(r3) * (Ao[i] / Ro), t2 = 1);
|
|
1369
|
+
}
|
|
1370
|
+
return a + s2;
|
|
1371
|
+
}
|
|
1372
|
+
let n4 = 0, t2 = 0, o2 = 0, r2 = {
|
|
1373
|
+
...zipProps(p, [parseUnit(e4[2]), parseUnit(e4[3]), parseUnit(e4[4]), parseUnit(e4[5]), parseUnit(e4[6], e4[7], 5), parseUnit(e4[8], e4[9], 4), parseUnit(e4[10], e4[11], 3)]),
|
|
1374
|
+
...nanoToGivenFields(o2, 2, p)
|
|
1375
|
+
};
|
|
1376
|
+
if (!n4) {
|
|
1377
|
+
throw new RangeError(noValidFields(p));
|
|
1378
|
+
}
|
|
1379
|
+
return parseSign(e4[1]) < 0 && (r2 = negateDurationFields(r2)), r2;
|
|
1380
|
+
})(n3) : undefined;
|
|
1381
|
+
})(m(e2));
|
|
1382
|
+
if (!n2) {
|
|
1383
|
+
throw new RangeError(failedParse(e2));
|
|
1384
|
+
}
|
|
1385
|
+
return Oe(checkDurationUnits(n2));
|
|
1386
|
+
}
|
|
1387
|
+
function f(e2) {
|
|
1388
|
+
const n2 = parseDateTimeLike(e2) || parseYearMonthOnly(e2) || parseMonthDayOnly(e2);
|
|
1389
|
+
return n2 ? n2.calendar : e2;
|
|
1390
|
+
}
|
|
1391
|
+
function Z(e2) {
|
|
1392
|
+
const n2 = parseDateTimeLike(e2);
|
|
1393
|
+
return n2 && (n2.timeZone || n2.j && si || n2.offset) || e2;
|
|
1394
|
+
}
|
|
1395
|
+
function finalizeZonedDateTime(e2, n2, t2 = 0, o2 = 0) {
|
|
1396
|
+
const r2 = M(e2.timeZone), i = L(r2);
|
|
1397
|
+
let a;
|
|
1398
|
+
return checkIsoDateTimeFields(e2), a = e2.C ? getMatchingInstantFor(i, e2, n2, t2, o2, !i.$, e2.j) : getStartOfDayInstantFor(i, e2), _e(a, r2, u(e2.calendar));
|
|
1399
|
+
}
|
|
1400
|
+
function finalizeDateTime(e2) {
|
|
1401
|
+
return resolveSlotsCalendar(checkIsoDateTimeInBounds(checkIsoDateTimeFields(e2)));
|
|
1402
|
+
}
|
|
1403
|
+
function finalizeDate(e2) {
|
|
1404
|
+
return resolveSlotsCalendar(checkIsoDateInBounds(checkIsoDateFields(e2)));
|
|
1405
|
+
}
|
|
1406
|
+
function resolveSlotsCalendar(e2) {
|
|
1407
|
+
return {
|
|
1408
|
+
...e2,
|
|
1409
|
+
calendar: u(e2.calendar)
|
|
1410
|
+
};
|
|
1411
|
+
}
|
|
1412
|
+
function parseDateTimeLike(e2) {
|
|
1413
|
+
const n2 = vi.exec(e2);
|
|
1414
|
+
return n2 ? ((e3) => {
|
|
1415
|
+
const n3 = e3[10], t2 = (n3 || "").toUpperCase() === "Z";
|
|
1416
|
+
return {
|
|
1417
|
+
isoYear: organizeIsoYearParts(e3),
|
|
1418
|
+
isoMonth: parseInt(e3[4]),
|
|
1419
|
+
isoDay: parseInt(e3[5]),
|
|
1420
|
+
...organizeTimeParts(e3.slice(5)),
|
|
1421
|
+
...organizeAnnotationParts(e3[16]),
|
|
1422
|
+
C: Boolean(e3[6]),
|
|
1423
|
+
j: t2,
|
|
1424
|
+
offset: t2 ? undefined : n3
|
|
1425
|
+
};
|
|
1426
|
+
})(n2) : undefined;
|
|
1427
|
+
}
|
|
1428
|
+
function parseYearMonthOnly(e2) {
|
|
1429
|
+
const n2 = Ni.exec(e2);
|
|
1430
|
+
return n2 ? ((e3) => ({
|
|
1431
|
+
isoYear: organizeIsoYearParts(e3),
|
|
1432
|
+
isoMonth: parseInt(e3[4]),
|
|
1433
|
+
isoDay: 1,
|
|
1434
|
+
...organizeAnnotationParts(e3[5])
|
|
1435
|
+
}))(n2) : undefined;
|
|
1436
|
+
}
|
|
1437
|
+
function parseMonthDayOnly(e2) {
|
|
1438
|
+
const n2 = yi.exec(e2);
|
|
1439
|
+
return n2 ? ((e3) => ({
|
|
1440
|
+
isoYear: Br,
|
|
1441
|
+
isoMonth: parseInt(e3[1]),
|
|
1442
|
+
isoDay: parseInt(e3[2]),
|
|
1443
|
+
...organizeAnnotationParts(e3[3])
|
|
1444
|
+
}))(n2) : undefined;
|
|
1445
|
+
}
|
|
1446
|
+
function parseOffsetNanoMaybe(e2, n2) {
|
|
1447
|
+
const t2 = Ei.exec(e2);
|
|
1448
|
+
return t2 ? ((e3, n3) => {
|
|
1449
|
+
const t3 = e3[4] || e3[5];
|
|
1450
|
+
if (n3 && t3) {
|
|
1451
|
+
throw new RangeError(invalidSubstring(t3));
|
|
1452
|
+
}
|
|
1453
|
+
return ((e4) => {
|
|
1454
|
+
if (Math.abs(e4) >= Uo) {
|
|
1455
|
+
throw new RangeError(ho);
|
|
1456
|
+
}
|
|
1457
|
+
return e4;
|
|
1458
|
+
})((parseInt0(e3[2]) * zo + parseInt0(e3[3]) * Zo + parseInt0(e3[4]) * Ro + parseSubsecNano(e3[5] || "")) * parseSign(e3[1]));
|
|
1459
|
+
})(t2, n2) : undefined;
|
|
1460
|
+
}
|
|
1461
|
+
function organizeIsoYearParts(e2) {
|
|
1462
|
+
const n2 = parseSign(e2[1]), t2 = parseInt(e2[2] || e2[3]);
|
|
1463
|
+
if (n2 < 0 && !t2) {
|
|
1464
|
+
throw new RangeError(invalidSubstring(-0));
|
|
1465
|
+
}
|
|
1466
|
+
return n2 * t2;
|
|
1467
|
+
}
|
|
1468
|
+
function organizeTimeParts(e2) {
|
|
1469
|
+
const n2 = parseInt0(e2[3]);
|
|
1470
|
+
return {
|
|
1471
|
+
...nanoToIsoTimeAndDay(parseSubsecNano(e2[4] || ""))[0],
|
|
1472
|
+
isoHour: parseInt0(e2[1]),
|
|
1473
|
+
isoMinute: parseInt0(e2[2]),
|
|
1474
|
+
isoSecond: n2 === 60 ? 59 : n2
|
|
1475
|
+
};
|
|
1476
|
+
}
|
|
1477
|
+
function organizeAnnotationParts(e2) {
|
|
1478
|
+
let n2, t2;
|
|
1479
|
+
const o2 = [];
|
|
1480
|
+
if (e2.replace(Si, (e3, r2, i) => {
|
|
1481
|
+
const a = Boolean(r2), [s2, c] = i.split("=").reverse();
|
|
1482
|
+
if (c) {
|
|
1483
|
+
if (c === "u-ca") {
|
|
1484
|
+
o2.push(s2), n2 || (n2 = a);
|
|
1485
|
+
} else if (a || /[A-Z]/.test(c)) {
|
|
1486
|
+
throw new RangeError(invalidSubstring(e3));
|
|
1487
|
+
}
|
|
1488
|
+
} else {
|
|
1489
|
+
if (t2) {
|
|
1490
|
+
throw new RangeError(invalidSubstring(e3));
|
|
1491
|
+
}
|
|
1492
|
+
t2 = s2;
|
|
1493
|
+
}
|
|
1494
|
+
return "";
|
|
1495
|
+
}), o2.length > 1 && n2) {
|
|
1496
|
+
throw new RangeError(invalidSubstring(e2));
|
|
1497
|
+
}
|
|
1498
|
+
return {
|
|
1499
|
+
timeZone: t2,
|
|
1500
|
+
calendar: o2[0] || l
|
|
1501
|
+
};
|
|
1502
|
+
}
|
|
1503
|
+
function parseSubsecNano(e2) {
|
|
1504
|
+
return parseInt(e2.padEnd(9, "0"));
|
|
1505
|
+
}
|
|
1506
|
+
function createRegExp(e2) {
|
|
1507
|
+
return new RegExp(`^${e2}$`, "i");
|
|
1508
|
+
}
|
|
1509
|
+
function parseSign(e2) {
|
|
1510
|
+
return e2 && e2 !== "+" ? -1 : 1;
|
|
1511
|
+
}
|
|
1512
|
+
function parseInt0(e2) {
|
|
1513
|
+
return e2 === undefined ? 0 : parseInt(e2);
|
|
1514
|
+
}
|
|
1515
|
+
function Ze(e2) {
|
|
1516
|
+
return M(m(e2));
|
|
1517
|
+
}
|
|
1518
|
+
function M(e2) {
|
|
1519
|
+
const n2 = getTimeZoneEssence(e2);
|
|
1520
|
+
return typeof n2 == "number" ? Se(n2) : n2 ? ((e3) => {
|
|
1521
|
+
if (Oi.test(e3)) {
|
|
1522
|
+
throw new RangeError(F(e3));
|
|
1523
|
+
}
|
|
1524
|
+
if (bi.test(e3)) {
|
|
1525
|
+
throw new RangeError(po);
|
|
1526
|
+
}
|
|
1527
|
+
return e3.toLowerCase().split("/").map((e4, n3) => (e4.length <= 3 || /\d/.test(e4)) && !/etc|yap/.test(e4) ? e4.toUpperCase() : e4.replace(/baja|dumont|[a-z]+/g, (e5, t2) => e5.length <= 2 && !n3 || e5 === "in" || e5 === "chat" ? e5.toUpperCase() : e5.length > 2 || !t2 ? capitalize(e5).replace(/island|noronha|murdo|rivadavia|urville/, capitalize) : e5)).join("/");
|
|
1528
|
+
})(e2) : si;
|
|
1529
|
+
}
|
|
1530
|
+
function getTimeZoneAtomic(e2) {
|
|
1531
|
+
const n2 = getTimeZoneEssence(e2);
|
|
1532
|
+
return typeof n2 == "number" ? n2 : n2 ? n2.resolvedOptions().timeZone : si;
|
|
1533
|
+
}
|
|
1534
|
+
function getTimeZoneEssence(e2) {
|
|
1535
|
+
const n2 = parseOffsetNanoMaybe(e2 = e2.toUpperCase(), 1);
|
|
1536
|
+
return n2 !== undefined ? n2 : e2 !== si ? wi(e2) : undefined;
|
|
1537
|
+
}
|
|
1538
|
+
function Ke(e2, n2) {
|
|
1539
|
+
return compareBigNanos(e2.epochNanoseconds, n2.epochNanoseconds);
|
|
1540
|
+
}
|
|
1541
|
+
function Be(e2, n2) {
|
|
1542
|
+
return compareBigNanos(e2.epochNanoseconds, n2.epochNanoseconds);
|
|
1543
|
+
}
|
|
1544
|
+
function K(e2, n2, t2, o2, r2, i) {
|
|
1545
|
+
const a = e2(normalizeOptions(i).relativeTo), s2 = Math.max(getMaxDurationUnit(o2), getMaxDurationUnit(r2));
|
|
1546
|
+
if (allPropsEqual(p, o2, r2)) {
|
|
1547
|
+
return 0;
|
|
1548
|
+
}
|
|
1549
|
+
if (isUniformUnit(s2, a)) {
|
|
1550
|
+
return compareBigNanos(durationFieldsToBigNano(o2), durationFieldsToBigNano(r2));
|
|
1551
|
+
}
|
|
1552
|
+
if (!a) {
|
|
1553
|
+
throw new RangeError(yo);
|
|
1554
|
+
}
|
|
1555
|
+
const [c, u, f2] = createMarkerSystem(n2, t2, a), l = createMarkerToEpochNano(f2), d2 = createMoveMarker(f2);
|
|
1556
|
+
return compareBigNanos(l(d2(u, c, o2)), l(d2(u, c, r2)));
|
|
1557
|
+
}
|
|
1558
|
+
function Yt(e2, n2) {
|
|
1559
|
+
return te(e2, n2) || Dt(e2, n2);
|
|
1560
|
+
}
|
|
1561
|
+
function te(e2, n2) {
|
|
1562
|
+
return compareNumbers(isoToEpochMilli(e2), isoToEpochMilli(n2));
|
|
1563
|
+
}
|
|
1564
|
+
function Dt(e2, n2) {
|
|
1565
|
+
return compareNumbers(isoTimeFieldsToNano(e2), isoTimeFieldsToNano(n2));
|
|
1566
|
+
}
|
|
1567
|
+
function Ve(e2, n2) {
|
|
1568
|
+
return !Ke(e2, n2);
|
|
1569
|
+
}
|
|
1570
|
+
function Ce(e2, n2) {
|
|
1571
|
+
return !Be(e2, n2) && !!isTimeZoneIdsEqual(e2.timeZone, n2.timeZone) && e2.calendar === n2.calendar;
|
|
1572
|
+
}
|
|
1573
|
+
function Ct(e2, n2) {
|
|
1574
|
+
return !Yt(e2, n2) && e2.calendar === n2.calendar;
|
|
1575
|
+
}
|
|
1576
|
+
function re(e2, n2) {
|
|
1577
|
+
return !te(e2, n2) && e2.calendar === n2.calendar;
|
|
1578
|
+
}
|
|
1579
|
+
function $t(e2, n2) {
|
|
1580
|
+
return !te(e2, n2) && e2.calendar === n2.calendar;
|
|
1581
|
+
}
|
|
1582
|
+
function Lt(e2, n2) {
|
|
1583
|
+
return !te(e2, n2) && e2.calendar === n2.calendar;
|
|
1584
|
+
}
|
|
1585
|
+
function st(e2, n2) {
|
|
1586
|
+
return !Dt(e2, n2);
|
|
1587
|
+
}
|
|
1588
|
+
function isTimeZoneIdsEqual(e2, n2) {
|
|
1589
|
+
if (e2 === n2) {
|
|
1590
|
+
return 1;
|
|
1591
|
+
}
|
|
1592
|
+
try {
|
|
1593
|
+
return getTimeZoneAtomic(e2) === getTimeZoneAtomic(n2);
|
|
1594
|
+
} catch (e3) {}
|
|
1595
|
+
}
|
|
1596
|
+
function Ee(e2, n2, t2, o2) {
|
|
1597
|
+
const r2 = refineDiffOptions(e2, o2, 3, 5), i = diffEpochNanos(n2.epochNanoseconds, t2.epochNanoseconds, ...r2);
|
|
1598
|
+
return Oe(e2 ? negateDurationFields(i) : i);
|
|
1599
|
+
}
|
|
1600
|
+
function we(e2, n2, t2, o2, r2, i) {
|
|
1601
|
+
const a = getCommonCalendarId(o2.calendar, r2.calendar), [s2, c, u, f2] = refineDiffOptions(t2, i, 5), l = o2.epochNanoseconds, d2 = r2.epochNanoseconds, m = compareBigNanos(d2, l);
|
|
1602
|
+
let p;
|
|
1603
|
+
if (m) {
|
|
1604
|
+
if (s2 < 6) {
|
|
1605
|
+
p = diffEpochNanos(l, d2, s2, c, u, f2);
|
|
1606
|
+
} else {
|
|
1607
|
+
const t3 = n2(((e3, n3) => {
|
|
1608
|
+
if (!isTimeZoneIdsEqual(e3, n3)) {
|
|
1609
|
+
throw new RangeError(mo);
|
|
1610
|
+
}
|
|
1611
|
+
return e3;
|
|
1612
|
+
})(o2.timeZone, r2.timeZone)), l2 = e2(a);
|
|
1613
|
+
p = diffZonedEpochsBig(l2, t3, o2, r2, m, s2, i), p = roundRelativeDuration(p, d2, s2, c, u, f2, l2, o2, extractEpochNano, Pt(moveZonedEpochs, t3));
|
|
1614
|
+
}
|
|
1615
|
+
} else {
|
|
1616
|
+
p = pr;
|
|
1617
|
+
}
|
|
1618
|
+
return Oe(t2 ? negateDurationFields(p) : p);
|
|
1619
|
+
}
|
|
1620
|
+
function It(e2, n2, t2, o2, r2) {
|
|
1621
|
+
const i = getCommonCalendarId(t2.calendar, o2.calendar), [a, s2, c, u] = refineDiffOptions(n2, r2, 6), f2 = isoToEpochNano(t2), l = isoToEpochNano(o2), d2 = compareBigNanos(l, f2);
|
|
1622
|
+
let m;
|
|
1623
|
+
if (d2) {
|
|
1624
|
+
if (a <= 6) {
|
|
1625
|
+
m = diffEpochNanos(f2, l, a, s2, c, u);
|
|
1626
|
+
} else {
|
|
1627
|
+
const n3 = e2(i);
|
|
1628
|
+
m = diffDateTimesBig(n3, t2, o2, d2, a, r2), m = roundRelativeDuration(m, l, a, s2, c, u, n3, t2, isoToEpochNano, moveDateTime);
|
|
1629
|
+
}
|
|
1630
|
+
} else {
|
|
1631
|
+
m = pr;
|
|
1632
|
+
}
|
|
1633
|
+
return Oe(n2 ? negateDurationFields(m) : m);
|
|
1634
|
+
}
|
|
1635
|
+
function oe(e2, n2, t2, o2, r2) {
|
|
1636
|
+
const i = getCommonCalendarId(t2.calendar, o2.calendar);
|
|
1637
|
+
return diffDateLike(n2, () => e2(i), t2, o2, ...refineDiffOptions(n2, r2, 6, 9, 6));
|
|
1638
|
+
}
|
|
1639
|
+
function zt(e2, n2, t2, o2, r2) {
|
|
1640
|
+
const i = getCommonCalendarId(t2.calendar, o2.calendar), a = refineDiffOptions(n2, r2, 9, 9, 8), s2 = e2(i), c = moveToDayOfMonthUnsafe(s2, t2), u = moveToDayOfMonthUnsafe(s2, o2);
|
|
1641
|
+
return c.isoYear === u.isoYear && c.isoMonth === u.isoMonth && c.isoDay === u.isoDay ? Oe(pr) : diffDateLike(n2, () => s2, checkIsoDateInBounds(c), checkIsoDateInBounds(u), ...a, 8);
|
|
1642
|
+
}
|
|
1643
|
+
function diffDateLike(e2, n2, t2, o2, r2, i, a, s2, c = 6) {
|
|
1644
|
+
const u = isoToEpochNano(t2), f2 = isoToEpochNano(o2);
|
|
1645
|
+
if (u === undefined || f2 === undefined) {
|
|
1646
|
+
throw new RangeError(Io);
|
|
1647
|
+
}
|
|
1648
|
+
let l;
|
|
1649
|
+
if (compareBigNanos(f2, u)) {
|
|
1650
|
+
if (r2 === 6) {
|
|
1651
|
+
l = diffEpochNanos(u, f2, r2, i, a, s2);
|
|
1652
|
+
} else {
|
|
1653
|
+
const e3 = n2();
|
|
1654
|
+
l = e3.N(t2, o2, r2), i === c && a === 1 || (l = roundRelativeDuration(l, f2, r2, i, a, s2, e3, t2, isoToEpochNano, moveDate));
|
|
1655
|
+
}
|
|
1656
|
+
} else {
|
|
1657
|
+
l = pr;
|
|
1658
|
+
}
|
|
1659
|
+
return Oe(e2 ? negateDurationFields(l) : l);
|
|
1660
|
+
}
|
|
1661
|
+
function it(e2, n2, t2, o2) {
|
|
1662
|
+
const [r2, i, a, s2] = refineDiffOptions(e2, o2, 5, 5), c = roundByInc(diffTimes(n2, t2), computeNanoInc(i, a), s2), u = {
|
|
1663
|
+
...pr,
|
|
1664
|
+
...nanoToDurationTimeFields(c, r2)
|
|
1665
|
+
};
|
|
1666
|
+
return Oe(e2 ? negateDurationFields(u) : u);
|
|
1667
|
+
}
|
|
1668
|
+
function diffZonedEpochsExact(e2, n2, t2, o2, r2, i) {
|
|
1669
|
+
const a = compareBigNanos(o2.epochNanoseconds, t2.epochNanoseconds);
|
|
1670
|
+
return a ? r2 < 6 ? diffEpochNanosExact(t2.epochNanoseconds, o2.epochNanoseconds, r2) : diffZonedEpochsBig(n2, e2, t2, o2, a, r2, i) : pr;
|
|
1671
|
+
}
|
|
1672
|
+
function diffDateTimesExact(e2, n2, t2, o2, r2) {
|
|
1673
|
+
const i = isoToEpochNano(n2), a = isoToEpochNano(t2), s2 = compareBigNanos(a, i);
|
|
1674
|
+
return s2 ? o2 <= 6 ? diffEpochNanosExact(i, a, o2) : diffDateTimesBig(e2, n2, t2, s2, o2, r2) : pr;
|
|
1675
|
+
}
|
|
1676
|
+
function diffZonedEpochsBig(e2, n2, t2, o2, r2, i, a) {
|
|
1677
|
+
const [s2, c, u] = ((e3, n3, t3, o3) => {
|
|
1678
|
+
function updateMid() {
|
|
1679
|
+
return f3 = {
|
|
1680
|
+
...moveByDays(a2, c2++ * -o3),
|
|
1681
|
+
...i2
|
|
1682
|
+
}, l2 = getSingleInstantFor(e3, f3), compareBigNanos(s3, l2) === -o3;
|
|
1683
|
+
}
|
|
1684
|
+
const r3 = he(n3, e3), i2 = nn(w, r3), a2 = he(t3, e3), s3 = t3.epochNanoseconds;
|
|
1685
|
+
let c2 = 0;
|
|
1686
|
+
const u2 = diffTimes(r3, a2);
|
|
1687
|
+
let f3, l2;
|
|
1688
|
+
if (Math.sign(u2) === -o3 && c2++, updateMid() && (o3 === -1 || updateMid())) {
|
|
1689
|
+
throw new RangeError(fo);
|
|
1690
|
+
}
|
|
1691
|
+
const d2 = bigNanoToNumber(diffBigNanos(l2, s3));
|
|
1692
|
+
return [r3, f3, d2];
|
|
1693
|
+
})(n2, t2, o2, r2);
|
|
1694
|
+
var f2, l;
|
|
1695
|
+
return {
|
|
1696
|
+
...i === 6 ? (f2 = s2, l = c, {
|
|
1697
|
+
...pr,
|
|
1698
|
+
days: diffDays(f2, l)
|
|
1699
|
+
}) : e2.N(s2, c, i, a),
|
|
1700
|
+
...nanoToDurationTimeFields(u)
|
|
1701
|
+
};
|
|
1702
|
+
}
|
|
1703
|
+
function diffDateTimesBig(e2, n2, t2, o2, r2, i) {
|
|
1704
|
+
const [a, s2, c] = ((e3, n3, t3) => {
|
|
1705
|
+
let o3 = n3, r3 = diffTimes(e3, n3);
|
|
1706
|
+
return Math.sign(r3) === -t3 && (o3 = moveByDays(n3, -t3), r3 += Uo * t3), [e3, o3, r3];
|
|
1707
|
+
})(n2, t2, o2);
|
|
1708
|
+
return {
|
|
1709
|
+
...e2.N(a, s2, r2, i),
|
|
1710
|
+
...nanoToDurationTimeFields(c)
|
|
1711
|
+
};
|
|
1712
|
+
}
|
|
1713
|
+
function diffEpochNanos(e2, n2, t2, o2, r2, i) {
|
|
1714
|
+
return {
|
|
1715
|
+
...pr,
|
|
1716
|
+
...nanoToDurationDayTimeFields(roundBigNano(diffBigNanos(e2, n2), o2, r2, i), t2)
|
|
1717
|
+
};
|
|
1718
|
+
}
|
|
1719
|
+
function diffEpochNanosExact(e2, n2, t2) {
|
|
1720
|
+
return {
|
|
1721
|
+
...pr,
|
|
1722
|
+
...nanoToDurationDayTimeFields(diffBigNanos(e2, n2), t2)
|
|
1723
|
+
};
|
|
1724
|
+
}
|
|
1725
|
+
function diffDays(e2, n2) {
|
|
1726
|
+
return diffEpochMilliByDay(isoToEpochMilli(e2), isoToEpochMilli(n2));
|
|
1727
|
+
}
|
|
1728
|
+
function diffEpochMilliByDay(e2, n2) {
|
|
1729
|
+
return Math.trunc((n2 - e2) / ko);
|
|
1730
|
+
}
|
|
1731
|
+
function diffTimes(e2, n2) {
|
|
1732
|
+
return isoTimeFieldsToNano(n2) - isoTimeFieldsToNano(e2);
|
|
1733
|
+
}
|
|
1734
|
+
function getCommonCalendarId(e2, n2) {
|
|
1735
|
+
if (e2 !== n2) {
|
|
1736
|
+
throw new RangeError(lo);
|
|
1737
|
+
}
|
|
1738
|
+
return e2;
|
|
1739
|
+
}
|
|
1740
|
+
function computeNativeWeekOfYear(e2) {
|
|
1741
|
+
return this.m(e2)[0];
|
|
1742
|
+
}
|
|
1743
|
+
function computeNativeYearOfWeek(e2) {
|
|
1744
|
+
return this.m(e2)[1];
|
|
1745
|
+
}
|
|
1746
|
+
function computeNativeDayOfYear(e2) {
|
|
1747
|
+
const [n2] = this.v(e2);
|
|
1748
|
+
return diffEpochMilliByDay(this.p(n2), isoToEpochMilli(e2)) + 1;
|
|
1749
|
+
}
|
|
1750
|
+
function parseMonthCode(e2) {
|
|
1751
|
+
const n2 = Bi.exec(e2);
|
|
1752
|
+
if (!n2) {
|
|
1753
|
+
throw new RangeError(invalidMonthCode(e2));
|
|
1754
|
+
}
|
|
1755
|
+
return [parseInt(n2[1]), Boolean(n2[2])];
|
|
1756
|
+
}
|
|
1757
|
+
function formatMonthCode(e2, n2) {
|
|
1758
|
+
return "M" + bo(e2) + (n2 ? "L" : "");
|
|
1759
|
+
}
|
|
1760
|
+
function monthCodeNumberToMonth(e2, n2, t2) {
|
|
1761
|
+
return e2 + (n2 || t2 && e2 >= t2 ? 1 : 0);
|
|
1762
|
+
}
|
|
1763
|
+
function monthToMonthCodeNumber(e2, n2) {
|
|
1764
|
+
return e2 - (n2 && e2 >= n2 ? 1 : 0);
|
|
1765
|
+
}
|
|
1766
|
+
function eraYearToYear(e2, n2) {
|
|
1767
|
+
return (n2 + e2) * (Math.sign(n2) || 1) || 0;
|
|
1768
|
+
}
|
|
1769
|
+
function getCalendarEraOrigins(e2) {
|
|
1770
|
+
return ir[getCalendarIdBase(e2)];
|
|
1771
|
+
}
|
|
1772
|
+
function getCalendarLeapMonthMeta(e2) {
|
|
1773
|
+
return sr[getCalendarIdBase(e2)];
|
|
1774
|
+
}
|
|
1775
|
+
function getCalendarIdBase(e2) {
|
|
1776
|
+
return computeCalendarIdBase(e2.id || l);
|
|
1777
|
+
}
|
|
1778
|
+
function createIntlCalendar(e2) {
|
|
1779
|
+
function epochMilliToIntlFields(e3) {
|
|
1780
|
+
return ((e4, n3) => ({
|
|
1781
|
+
...parseIntlYear(e4, n3),
|
|
1782
|
+
o: e4.month,
|
|
1783
|
+
day: parseInt(e4.day)
|
|
1784
|
+
}))(hashIntlFormatParts(n2, e3), t2);
|
|
1785
|
+
}
|
|
1786
|
+
const n2 = Ci(e2), t2 = computeCalendarIdBase(e2);
|
|
1787
|
+
return {
|
|
1788
|
+
id: e2,
|
|
1789
|
+
h: createIntlFieldCache(epochMilliToIntlFields),
|
|
1790
|
+
l: createIntlYearDataCache(epochMilliToIntlFields)
|
|
1791
|
+
};
|
|
1792
|
+
}
|
|
1793
|
+
function createIntlFieldCache(e2) {
|
|
1794
|
+
return on((n2) => {
|
|
1795
|
+
const t2 = isoToEpochMilli(n2);
|
|
1796
|
+
return e2(t2);
|
|
1797
|
+
}, WeakMap);
|
|
1798
|
+
}
|
|
1799
|
+
function createIntlYearDataCache(e2) {
|
|
1800
|
+
const n2 = e2(0).year - Or;
|
|
1801
|
+
return on((t2) => {
|
|
1802
|
+
let o2, r2 = isoArgsToEpochMilli(t2 - n2), i = 0;
|
|
1803
|
+
const a = [], s2 = [];
|
|
1804
|
+
do {
|
|
1805
|
+
r2 += 400 * ko;
|
|
1806
|
+
} while ((o2 = e2(r2)).year <= t2);
|
|
1807
|
+
do {
|
|
1808
|
+
if (r2 += (1 - o2.day) * ko, o2.year === t2 && (a.push(r2), s2.push(o2.o)), r2 -= ko, ++i > 100 || r2 < -Pr) {
|
|
1809
|
+
throw new RangeError(fo);
|
|
1810
|
+
}
|
|
1811
|
+
} while ((o2 = e2(r2)).year >= t2);
|
|
1812
|
+
return {
|
|
1813
|
+
i: a.reverse(),
|
|
1814
|
+
u: Fo(s2.reverse())
|
|
1815
|
+
};
|
|
1816
|
+
});
|
|
1817
|
+
}
|
|
1818
|
+
function parseIntlYear(e2, n2) {
|
|
1819
|
+
let t2, o2, r2 = parseIntlPartsYear(e2);
|
|
1820
|
+
if (e2.era) {
|
|
1821
|
+
const i = ir[n2], a = ar[n2] || {};
|
|
1822
|
+
i !== undefined && (t2 = n2 === "islamic" ? "ah" : e2.era.normalize("NFD").toLowerCase().replace(/[^a-z0-9]/g, ""), t2 === "bc" || t2 === "b" ? t2 = "bce" : t2 === "ad" || t2 === "a" ? t2 = "ce" : t2 === "beforeroc" && (t2 = "broc"), t2 = a[t2] || t2, o2 = r2, r2 = eraYearToYear(o2, i[t2] || 0));
|
|
1823
|
+
}
|
|
1824
|
+
return {
|
|
1825
|
+
era: t2,
|
|
1826
|
+
eraYear: o2,
|
|
1827
|
+
year: r2
|
|
1828
|
+
};
|
|
1829
|
+
}
|
|
1830
|
+
function parseIntlPartsYear(e2) {
|
|
1831
|
+
return parseInt(e2.relatedYear || e2.year);
|
|
1832
|
+
}
|
|
1833
|
+
function computeIntlDateParts(e2) {
|
|
1834
|
+
const { year: n2, o: t2, day: o2 } = this.h(e2), { u: r2 } = this.l(n2);
|
|
1835
|
+
return [n2, r2[t2] + 1, o2];
|
|
1836
|
+
}
|
|
1837
|
+
function computeIntlEpochMilli(e2, n2 = 1, t2 = 1) {
|
|
1838
|
+
return this.l(e2).i[n2 - 1] + (t2 - 1) * ko;
|
|
1839
|
+
}
|
|
1840
|
+
function computeIntlMonthCodeParts(e2, n2) {
|
|
1841
|
+
const t2 = computeIntlLeapMonth.call(this, e2);
|
|
1842
|
+
return [monthToMonthCodeNumber(n2, t2), t2 === n2];
|
|
1843
|
+
}
|
|
1844
|
+
function computeIntlLeapMonth(e2) {
|
|
1845
|
+
const n2 = queryMonthStrings(this, e2), t2 = queryMonthStrings(this, e2 - 1), o2 = n2.length;
|
|
1846
|
+
if (o2 > t2.length) {
|
|
1847
|
+
const e3 = getCalendarLeapMonthMeta(this);
|
|
1848
|
+
if (e3 < 0) {
|
|
1849
|
+
return -e3;
|
|
1850
|
+
}
|
|
1851
|
+
for (let e4 = 0;e4 < o2; e4++) {
|
|
1852
|
+
if (n2[e4] !== t2[e4]) {
|
|
1853
|
+
return e4 + 1;
|
|
1854
|
+
}
|
|
1855
|
+
}
|
|
1856
|
+
}
|
|
1857
|
+
}
|
|
1858
|
+
function computeIntlDaysInYear(e2) {
|
|
1859
|
+
return diffEpochMilliByDay(computeIntlEpochMilli.call(this, e2), computeIntlEpochMilli.call(this, e2 + 1));
|
|
1860
|
+
}
|
|
1861
|
+
function computeIntlDaysInMonth(e2, n2) {
|
|
1862
|
+
const { i: t2 } = this.l(e2);
|
|
1863
|
+
let o2 = n2 + 1, r2 = t2;
|
|
1864
|
+
return o2 > t2.length && (o2 = 1, r2 = this.l(e2 + 1).i), diffEpochMilliByDay(t2[n2 - 1], r2[o2 - 1]);
|
|
1865
|
+
}
|
|
1866
|
+
function computeIntlMonthsInYear(e2) {
|
|
1867
|
+
return this.l(e2).i.length;
|
|
1868
|
+
}
|
|
1869
|
+
function computeIntlEraParts(e2) {
|
|
1870
|
+
const n2 = this.h(e2);
|
|
1871
|
+
return [n2.era, n2.eraYear];
|
|
1872
|
+
}
|
|
1873
|
+
function queryMonthStrings(e2, n2) {
|
|
1874
|
+
return Object.keys(e2.l(n2).u);
|
|
1875
|
+
}
|
|
1876
|
+
function Mt(e2) {
|
|
1877
|
+
return u(m(e2));
|
|
1878
|
+
}
|
|
1879
|
+
function u(e2) {
|
|
1880
|
+
if ((e2 = e2.toLowerCase()) !== l && e2 !== or) {
|
|
1881
|
+
const n2 = Ci(e2).resolvedOptions().calendar;
|
|
1882
|
+
if (computeCalendarIdBase(e2) !== computeCalendarIdBase(n2)) {
|
|
1883
|
+
throw new RangeError(c(e2));
|
|
1884
|
+
}
|
|
1885
|
+
return n2;
|
|
1886
|
+
}
|
|
1887
|
+
return e2;
|
|
1888
|
+
}
|
|
1889
|
+
function computeCalendarIdBase(e2) {
|
|
1890
|
+
return e2 === "islamicc" && (e2 = "islamic"), e2.split("-")[0];
|
|
1891
|
+
}
|
|
1892
|
+
function createNativeOpsCreator(e2, n2) {
|
|
1893
|
+
return (t2) => t2 === l ? e2 : t2 === or || t2 === rr ? Object.assign(Object.create(e2), {
|
|
1894
|
+
id: t2
|
|
1895
|
+
}) : Object.assign(Object.create(n2), ki(t2));
|
|
1896
|
+
}
|
|
1897
|
+
function $(e2, n2, t2, o2) {
|
|
1898
|
+
const r2 = refineCalendarFields(t2, o2, Xo, [], xo);
|
|
1899
|
+
if (r2.timeZone !== undefined) {
|
|
1900
|
+
const o3 = t2.F(r2), i = refineTimeBag(r2), a = e2(r2.timeZone);
|
|
1901
|
+
return {
|
|
1902
|
+
epochNanoseconds: getMatchingInstantFor(n2(a), {
|
|
1903
|
+
...o3,
|
|
1904
|
+
...i
|
|
1905
|
+
}, r2.offset !== undefined ? parseOffsetNano(r2.offset) : undefined),
|
|
1906
|
+
timeZone: a
|
|
1907
|
+
};
|
|
1908
|
+
}
|
|
1909
|
+
return {
|
|
1910
|
+
...t2.F(r2),
|
|
1911
|
+
...Nt
|
|
1912
|
+
};
|
|
1913
|
+
}
|
|
1914
|
+
function Ne(e2, n2, t2, o2, r2, i) {
|
|
1915
|
+
const a = refineCalendarFields(t2, r2, Xo, jo, xo), s2 = e2(a.timeZone), [c, u2, f2] = je(i), l = t2.F(a, fabricateOverflowOptions(c)), d2 = refineTimeBag(a, c);
|
|
1916
|
+
return _e(getMatchingInstantFor(n2(s2), {
|
|
1917
|
+
...l,
|
|
1918
|
+
...d2
|
|
1919
|
+
}, a.offset !== undefined ? parseOffsetNano(a.offset) : undefined, u2, f2), s2, o2);
|
|
1920
|
+
}
|
|
1921
|
+
function At(e2, n2, t2) {
|
|
1922
|
+
const o2 = refineCalendarFields(e2, n2, Xo, [], O), r2 = mt(t2);
|
|
1923
|
+
return jt(checkIsoDateTimeInBounds({
|
|
1924
|
+
...e2.F(o2, fabricateOverflowOptions(r2)),
|
|
1925
|
+
...refineTimeBag(o2, r2)
|
|
1926
|
+
}));
|
|
1927
|
+
}
|
|
1928
|
+
function me(e2, n2, t2, o2 = []) {
|
|
1929
|
+
const r2 = refineCalendarFields(e2, n2, Xo, o2);
|
|
1930
|
+
return e2.F(r2, t2);
|
|
1931
|
+
}
|
|
1932
|
+
function Xt(e2, n2, t2, o2) {
|
|
1933
|
+
const r2 = refineCalendarFields(e2, n2, Ko, o2);
|
|
1934
|
+
return e2.K(r2, t2);
|
|
1935
|
+
}
|
|
1936
|
+
function Rt(e2, n2, t2, o2) {
|
|
1937
|
+
const r2 = refineCalendarFields(e2, t2, Xo, Jo);
|
|
1938
|
+
return n2 && r2.month !== undefined && r2.monthCode === undefined && r2.year === undefined && (r2.year = Br), e2._(r2, o2);
|
|
1939
|
+
}
|
|
1940
|
+
function Tt(e2, n2) {
|
|
1941
|
+
return St(refineTimeBag(refineFields(e2, qo, [], 1), mt(n2)));
|
|
1942
|
+
}
|
|
1943
|
+
function q(e2) {
|
|
1944
|
+
const n2 = refineFields(e2, ur);
|
|
1945
|
+
return Oe(checkDurationUnits({
|
|
1946
|
+
...pr,
|
|
1947
|
+
...n2
|
|
1948
|
+
}));
|
|
1949
|
+
}
|
|
1950
|
+
function refineCalendarFields(e2, n2, t2, o2 = [], r2 = []) {
|
|
1951
|
+
return refineFields(n2, [...e2.fields(t2), ...r2].sort(), o2);
|
|
1952
|
+
}
|
|
1953
|
+
function refineFields(e2, n2, t2, o2 = !t2) {
|
|
1954
|
+
const r2 = {};
|
|
1955
|
+
let i, a = 0;
|
|
1956
|
+
for (const o3 of n2) {
|
|
1957
|
+
if (o3 === i) {
|
|
1958
|
+
throw new RangeError(duplicateFields(o3));
|
|
1959
|
+
}
|
|
1960
|
+
if (o3 === "constructor" || o3 === "__proto__") {
|
|
1961
|
+
throw new RangeError(forbiddenField(o3));
|
|
1962
|
+
}
|
|
1963
|
+
let n3 = e2[o3];
|
|
1964
|
+
if (n3 !== undefined) {
|
|
1965
|
+
a = 1, Li[o3] && (n3 = Li[o3](n3, o3)), r2[o3] = n3;
|
|
1966
|
+
} else if (t2) {
|
|
1967
|
+
if (t2.includes(o3)) {
|
|
1968
|
+
throw new TypeError(missingField(o3));
|
|
1969
|
+
}
|
|
1970
|
+
r2[o3] = tr[o3];
|
|
1971
|
+
}
|
|
1972
|
+
i = o3;
|
|
1973
|
+
}
|
|
1974
|
+
if (o2 && !a) {
|
|
1975
|
+
throw new TypeError(noValidFields(n2));
|
|
1976
|
+
}
|
|
1977
|
+
return r2;
|
|
1978
|
+
}
|
|
1979
|
+
function refineTimeBag(e2, n2) {
|
|
1980
|
+
return constrainIsoTimeFields(xi({
|
|
1981
|
+
...tr,
|
|
1982
|
+
...e2
|
|
1983
|
+
}), n2);
|
|
1984
|
+
}
|
|
1985
|
+
function De(e2, n2, t2, o2, r2) {
|
|
1986
|
+
const { calendar: i, timeZone: a } = t2, s2 = e2(i), c = n2(a), u2 = [...s2.fields(Xo), ...Lo].sort(), f2 = ((e3) => {
|
|
1987
|
+
const n3 = he(e3, L), t3 = Se(n3.offsetNanoseconds), o3 = ji(e3.calendar), [r3, i2, a2] = o3.v(n3), [s3, c2] = o3.q(r3, i2), u3 = formatMonthCode(s3, c2);
|
|
1988
|
+
return {
|
|
1989
|
+
...$i(n3),
|
|
1990
|
+
year: r3,
|
|
1991
|
+
monthCode: u3,
|
|
1992
|
+
day: a2,
|
|
1993
|
+
offset: t3
|
|
1994
|
+
};
|
|
1995
|
+
})(t2), l = refineFields(o2, u2), d2 = s2.k(f2, l), m = {
|
|
1996
|
+
...f2,
|
|
1997
|
+
...l
|
|
1998
|
+
}, [p, h2, g2] = je(r2, 2);
|
|
1999
|
+
return _e(getMatchingInstantFor(c, {
|
|
2000
|
+
...s2.F(d2, fabricateOverflowOptions(p)),
|
|
2001
|
+
...constrainIsoTimeFields(xi(m), p)
|
|
2002
|
+
}, parseOffsetNano(m.offset), h2, g2), a, i);
|
|
2003
|
+
}
|
|
2004
|
+
function gt(e2, n2, t2, o2) {
|
|
2005
|
+
const r2 = e2(n2.calendar), i = [...r2.fields(Xo), ...O].sort(), a = {
|
|
2006
|
+
...computeDateEssentials(s2 = n2),
|
|
2007
|
+
hour: s2.isoHour,
|
|
2008
|
+
minute: s2.isoMinute,
|
|
2009
|
+
second: s2.isoSecond,
|
|
2010
|
+
millisecond: s2.isoMillisecond,
|
|
2011
|
+
microsecond: s2.isoMicrosecond,
|
|
2012
|
+
nanosecond: s2.isoNanosecond
|
|
2013
|
+
};
|
|
2014
|
+
var s2;
|
|
2015
|
+
const c = refineFields(t2, i), u2 = mt(o2), f2 = r2.k(a, c), l = {
|
|
2016
|
+
...a,
|
|
2017
|
+
...c
|
|
2018
|
+
};
|
|
2019
|
+
return jt(checkIsoDateTimeInBounds({
|
|
2020
|
+
...r2.F(f2, fabricateOverflowOptions(u2)),
|
|
2021
|
+
...constrainIsoTimeFields(xi(l), u2)
|
|
2022
|
+
}));
|
|
2023
|
+
}
|
|
2024
|
+
function ee(e2, n2, t2, o2) {
|
|
2025
|
+
const r2 = e2(n2.calendar), i = r2.fields(Xo).sort(), a = computeDateEssentials(n2), s2 = refineFields(t2, i), c = r2.k(a, s2);
|
|
2026
|
+
return r2.F(c, o2);
|
|
2027
|
+
}
|
|
2028
|
+
function Wt(e2, n2, t2, o2) {
|
|
2029
|
+
const r2 = e2(n2.calendar), i = r2.fields(Ko).sort(), a = ((e3) => {
|
|
2030
|
+
const n3 = ji(e3.calendar), [t3, o3] = n3.v(e3), [r3, i2] = n3.q(t3, o3);
|
|
2031
|
+
return {
|
|
2032
|
+
year: t3,
|
|
2033
|
+
monthCode: formatMonthCode(r3, i2)
|
|
2034
|
+
};
|
|
2035
|
+
})(n2), s2 = refineFields(t2, i), c = r2.k(a, s2);
|
|
2036
|
+
return r2.K(c, o2);
|
|
2037
|
+
}
|
|
2038
|
+
function Et(e2, n2, t2, o2) {
|
|
2039
|
+
const r2 = e2(n2.calendar), i = r2.fields(Xo).sort(), a = ((e3) => {
|
|
2040
|
+
const n3 = ji(e3.calendar), [t3, o3, r3] = n3.v(e3), [i2, a2] = n3.q(t3, o3);
|
|
2041
|
+
return {
|
|
2042
|
+
monthCode: formatMonthCode(i2, a2),
|
|
2043
|
+
day: r3
|
|
2044
|
+
};
|
|
2045
|
+
})(n2), s2 = refineFields(t2, i), c = r2.k(a, s2);
|
|
2046
|
+
return r2._(c, o2);
|
|
2047
|
+
}
|
|
2048
|
+
function rt(e2, n2, t2) {
|
|
2049
|
+
return St(((e3, n3, t3) => refineTimeBag({
|
|
2050
|
+
...nn(qo, e3),
|
|
2051
|
+
...refineFields(n3, qo)
|
|
2052
|
+
}, mt(t3)))(e2, n2, t2));
|
|
2053
|
+
}
|
|
2054
|
+
function A(e2, n2) {
|
|
2055
|
+
return Oe((t2 = e2, o2 = n2, checkDurationUnits({
|
|
2056
|
+
...t2,
|
|
2057
|
+
...refineFields(o2, ur)
|
|
2058
|
+
})));
|
|
2059
|
+
var t2, o2;
|
|
2060
|
+
}
|
|
2061
|
+
function convertToIso(e2, n2, t2, o2, r2) {
|
|
2062
|
+
n2 = nn(t2 = e2.fields(t2), n2), o2 = refineFields(o2, r2 = e2.fields(r2), []);
|
|
2063
|
+
let i = e2.k(n2, o2);
|
|
2064
|
+
return i = refineFields(i, [...t2, ...r2].sort(), []), e2.F(i);
|
|
2065
|
+
}
|
|
2066
|
+
function refineYear(e2, n2) {
|
|
2067
|
+
const t2 = getCalendarEraOrigins(e2), o2 = ar[e2.id || ""] || {};
|
|
2068
|
+
let { era: r2, eraYear: i, year: a } = n2;
|
|
2069
|
+
if (r2 !== undefined || i !== undefined) {
|
|
2070
|
+
if (r2 === undefined || i === undefined) {
|
|
2071
|
+
throw new TypeError(io);
|
|
2072
|
+
}
|
|
2073
|
+
if (!t2) {
|
|
2074
|
+
throw new RangeError(ro);
|
|
2075
|
+
}
|
|
2076
|
+
const e3 = t2[o2[r2] || r2];
|
|
2077
|
+
if (e3 === undefined) {
|
|
2078
|
+
throw new RangeError(invalidEra(r2));
|
|
2079
|
+
}
|
|
2080
|
+
const n3 = eraYearToYear(i, e3);
|
|
2081
|
+
if (a !== undefined && a !== n3) {
|
|
2082
|
+
throw new RangeError(ao);
|
|
2083
|
+
}
|
|
2084
|
+
a = n3;
|
|
2085
|
+
} else if (a === undefined) {
|
|
2086
|
+
throw new TypeError(missingYear(t2));
|
|
2087
|
+
}
|
|
2088
|
+
return a;
|
|
2089
|
+
}
|
|
2090
|
+
function refineMonth(e2, n2, t2, o2) {
|
|
2091
|
+
let { month: r2, monthCode: i } = n2;
|
|
2092
|
+
if (i !== undefined) {
|
|
2093
|
+
const n3 = ((e3, n4, t3, o3) => {
|
|
2094
|
+
const r3 = e3.L(t3), [i2, a] = parseMonthCode(n4);
|
|
2095
|
+
let s2 = monthCodeNumberToMonth(i2, a, r3);
|
|
2096
|
+
if (a) {
|
|
2097
|
+
const n5 = getCalendarLeapMonthMeta(e3);
|
|
2098
|
+
if (n5 === undefined) {
|
|
2099
|
+
throw new RangeError(uo);
|
|
2100
|
+
}
|
|
2101
|
+
if (n5 > 0) {
|
|
2102
|
+
if (s2 > n5) {
|
|
2103
|
+
throw new RangeError(uo);
|
|
2104
|
+
}
|
|
2105
|
+
if (r3 === undefined) {
|
|
2106
|
+
if (o3 === 1) {
|
|
2107
|
+
throw new RangeError(uo);
|
|
2108
|
+
}
|
|
2109
|
+
s2--;
|
|
2110
|
+
}
|
|
2111
|
+
} else {
|
|
2112
|
+
if (s2 !== -n5) {
|
|
2113
|
+
throw new RangeError(uo);
|
|
2114
|
+
}
|
|
2115
|
+
if (r3 === undefined && o3 === 1) {
|
|
2116
|
+
throw new RangeError(uo);
|
|
2117
|
+
}
|
|
2118
|
+
}
|
|
2119
|
+
}
|
|
2120
|
+
return s2;
|
|
2121
|
+
})(e2, i, t2, o2);
|
|
2122
|
+
if (r2 !== undefined && r2 !== n3) {
|
|
2123
|
+
throw new RangeError(so);
|
|
2124
|
+
}
|
|
2125
|
+
r2 = n3, o2 = 1;
|
|
2126
|
+
} else if (r2 === undefined) {
|
|
2127
|
+
throw new TypeError(co);
|
|
2128
|
+
}
|
|
2129
|
+
return clampEntity("month", r2, 1, e2.B(t2), o2);
|
|
2130
|
+
}
|
|
2131
|
+
function refineDay(e2, n2, t2, o2, r2) {
|
|
2132
|
+
return clampProp(n2, "day", 1, e2.U(o2, t2), r2);
|
|
2133
|
+
}
|
|
2134
|
+
function spliceFields(e2, n2, t2, o2) {
|
|
2135
|
+
let r2 = 0;
|
|
2136
|
+
const i = [];
|
|
2137
|
+
for (const e3 of t2) {
|
|
2138
|
+
n2[e3] !== undefined ? r2 = 1 : i.push(e3);
|
|
2139
|
+
}
|
|
2140
|
+
if (Object.assign(e2, n2), r2) {
|
|
2141
|
+
for (const n3 of o2 || i) {
|
|
2142
|
+
delete e2[n3];
|
|
2143
|
+
}
|
|
2144
|
+
}
|
|
2145
|
+
}
|
|
2146
|
+
function computeDateEssentials(e2) {
|
|
2147
|
+
const n2 = ji(e2.calendar), [t2, o2, r2] = n2.v(e2), [i, a] = n2.q(t2, o2);
|
|
2148
|
+
return {
|
|
2149
|
+
year: t2,
|
|
2150
|
+
monthCode: formatMonthCode(i, a),
|
|
2151
|
+
day: r2
|
|
2152
|
+
};
|
|
2153
|
+
}
|
|
2154
|
+
function qe(e2) {
|
|
2155
|
+
return xe(checkEpochNanoInBounds(bigIntToBigNano(toBigInt(e2))));
|
|
2156
|
+
}
|
|
2157
|
+
function ye(e2, n2, t2, o2, r2 = l) {
|
|
2158
|
+
return _e(checkEpochNanoInBounds(bigIntToBigNano(toBigInt(t2))), n2(o2), e2(r2));
|
|
2159
|
+
}
|
|
2160
|
+
function Zt(n2, t2, o2, r2, i = 0, a = 0, s2 = 0, c = 0, u2 = 0, f2 = 0, d2 = l) {
|
|
2161
|
+
return jt(checkIsoDateTimeInBounds(checkIsoDateTimeFields(e(toInteger, zipProps(Tr, [t2, o2, r2, i, a, s2, c, u2, f2])))), n2(d2));
|
|
2162
|
+
}
|
|
2163
|
+
function ue(n2, t2, o2, r2, i = l) {
|
|
2164
|
+
return W(checkIsoDateInBounds(checkIsoDateFields(e(toInteger, {
|
|
2165
|
+
isoYear: t2,
|
|
2166
|
+
isoMonth: o2,
|
|
2167
|
+
isoDay: r2
|
|
2168
|
+
}))), n2(i));
|
|
2169
|
+
}
|
|
2170
|
+
function Qt(e2, n2, t2, o2 = l, r2 = 1) {
|
|
2171
|
+
const i = toInteger(n2), a = toInteger(t2), s2 = e2(o2);
|
|
2172
|
+
return createPlainYearMonthSlots(checkIsoYearMonthInBounds(checkIsoDateFields({
|
|
2173
|
+
isoYear: i,
|
|
2174
|
+
isoMonth: a,
|
|
2175
|
+
isoDay: toInteger(r2)
|
|
2176
|
+
})), s2);
|
|
2177
|
+
}
|
|
2178
|
+
function kt(e2, n2, t2, o2 = l, r2 = Br) {
|
|
2179
|
+
const i = toInteger(n2), a = toInteger(t2), s2 = e2(o2);
|
|
2180
|
+
return createPlainMonthDaySlots(checkIsoDateInBounds(checkIsoDateFields({
|
|
2181
|
+
isoYear: toInteger(r2),
|
|
2182
|
+
isoMonth: i,
|
|
2183
|
+
isoDay: a
|
|
2184
|
+
})), s2);
|
|
2185
|
+
}
|
|
2186
|
+
function ut(n2 = 0, t2 = 0, o2 = 0, r2 = 0, i = 0, a = 0) {
|
|
2187
|
+
return St(constrainIsoTimeFields(e(toInteger, zipProps(w, [n2, t2, o2, r2, i, a])), 1));
|
|
2188
|
+
}
|
|
2189
|
+
function j(n2 = 0, t2 = 0, o2 = 0, r2 = 0, i = 0, a = 0, s2 = 0, c = 0, u2 = 0, f2 = 0) {
|
|
2190
|
+
return Oe(checkDurationUnits(e(toStrictInteger, zipProps(p, [n2, t2, o2, r2, i, a, s2, c, u2, f2]))));
|
|
2191
|
+
}
|
|
2192
|
+
function Je(e2, n2, t2 = l) {
|
|
2193
|
+
return _e(e2.epochNanoseconds, n2, t2);
|
|
2194
|
+
}
|
|
2195
|
+
function be(e2) {
|
|
2196
|
+
return xe(e2.epochNanoseconds);
|
|
2197
|
+
}
|
|
2198
|
+
function yt(e2, n2) {
|
|
2199
|
+
return jt(he(n2, e2));
|
|
2200
|
+
}
|
|
2201
|
+
function fe(e2, n2) {
|
|
2202
|
+
return W(he(n2, e2));
|
|
2203
|
+
}
|
|
2204
|
+
function dt(e2, n2) {
|
|
2205
|
+
return St(he(n2, e2));
|
|
2206
|
+
}
|
|
2207
|
+
function bt(e2, n2, t2, o2) {
|
|
2208
|
+
const r2 = ((e3, n3, t3, o3) => {
|
|
2209
|
+
const r3 = ((e4) => ei(normalizeOptions(e4)))(o3);
|
|
2210
|
+
return getSingleInstantFor(e3(n3), t3, r3);
|
|
2211
|
+
})(e2, t2, n2, o2);
|
|
2212
|
+
return _e(checkEpochNanoInBounds(r2), t2, n2.calendar);
|
|
2213
|
+
}
|
|
2214
|
+
function ae(e2, n2, t2, o2, r2) {
|
|
2215
|
+
const i = e2(r2.timeZone), a = r2.plainTime, s2 = a !== undefined ? n2(a) : undefined, c = t2(i);
|
|
2216
|
+
let u2;
|
|
2217
|
+
return u2 = s2 ? getSingleInstantFor(c, {
|
|
2218
|
+
...o2,
|
|
2219
|
+
...s2
|
|
2220
|
+
}) : getStartOfDayInstantFor(c, {
|
|
2221
|
+
...o2,
|
|
2222
|
+
...Nt
|
|
2223
|
+
}), _e(u2, i, o2.calendar);
|
|
2224
|
+
}
|
|
2225
|
+
function ie(e2, n2 = Nt) {
|
|
2226
|
+
return jt(checkIsoDateTimeInBounds({
|
|
2227
|
+
...e2,
|
|
2228
|
+
...n2
|
|
2229
|
+
}));
|
|
2230
|
+
}
|
|
2231
|
+
function le(e2, n2, t2) {
|
|
2232
|
+
return ((e3, n3) => {
|
|
2233
|
+
const t3 = refineCalendarFields(e3, n3, Qo);
|
|
2234
|
+
return e3.K(t3, undefined);
|
|
2235
|
+
})(e2(n2.calendar), t2);
|
|
2236
|
+
}
|
|
2237
|
+
function se(e2, n2, t2) {
|
|
2238
|
+
return ((e3, n3) => {
|
|
2239
|
+
const t3 = refineCalendarFields(e3, n3, nr);
|
|
2240
|
+
return e3._(t3);
|
|
2241
|
+
})(e2(n2.calendar), t2);
|
|
2242
|
+
}
|
|
2243
|
+
function Ht(e2, n2, t2, o2) {
|
|
2244
|
+
return ((e3, n3, t3) => convertToIso(e3, n3, Qo, requireObjectLike(t3), Jo))(e2(n2.calendar), t2, o2);
|
|
2245
|
+
}
|
|
2246
|
+
function Vt(e2, n2, t2, o2) {
|
|
2247
|
+
return ((e3, n3, t3) => convertToIso(e3, n3, nr, requireObjectLike(t3), Go))(e2(n2.calendar), t2, o2);
|
|
2248
|
+
}
|
|
2249
|
+
function $e(e2) {
|
|
2250
|
+
return xe(checkEpochNanoInBounds(Ge(toStrictInteger(e2), Qe)));
|
|
2251
|
+
}
|
|
2252
|
+
function He(e2) {
|
|
2253
|
+
return xe(checkEpochNanoInBounds(bigIntToBigNano(toBigInt(e2))));
|
|
2254
|
+
}
|
|
2255
|
+
function createOptionsTransformer(e2, n2, t2) {
|
|
2256
|
+
const o2 = new Set(t2);
|
|
2257
|
+
return (r2, i) => {
|
|
2258
|
+
const a = t2 && hasAnyPropsByName(r2, t2);
|
|
2259
|
+
if (!hasAnyPropsByName(r2 = ((e3, n3) => {
|
|
2260
|
+
const t3 = {};
|
|
2261
|
+
for (const o3 in n3) {
|
|
2262
|
+
e3.has(o3) || (t3[o3] = n3[o3]);
|
|
2263
|
+
}
|
|
2264
|
+
return t3;
|
|
2265
|
+
})(o2, r2), e2)) {
|
|
2266
|
+
if (i && a) {
|
|
2267
|
+
throw new TypeError("Invalid formatting options");
|
|
2268
|
+
}
|
|
2269
|
+
r2 = {
|
|
2270
|
+
...n2,
|
|
2271
|
+
...r2
|
|
2272
|
+
};
|
|
2273
|
+
}
|
|
2274
|
+
return t2 && (r2.timeZone = si, ["full", "long"].includes(r2.J) && (r2.J = "medium")), r2;
|
|
2275
|
+
};
|
|
2276
|
+
}
|
|
2277
|
+
function Q(e2, n2 = an, t2 = 0) {
|
|
2278
|
+
const [o2, , , r2] = e2;
|
|
2279
|
+
return (i, a = Na, ...s2) => {
|
|
2280
|
+
const c = n2(r2 && r2(...s2), i, a, o2, t2), u2 = c.resolvedOptions();
|
|
2281
|
+
return [c, ...toEpochMillis(e2, u2, s2)];
|
|
2282
|
+
};
|
|
2283
|
+
}
|
|
2284
|
+
function an(e2, n2, t2, o2, r2) {
|
|
2285
|
+
if (t2 = o2(t2, r2), e2) {
|
|
2286
|
+
if (t2.timeZone !== undefined) {
|
|
2287
|
+
throw new TypeError(So);
|
|
2288
|
+
}
|
|
2289
|
+
t2.timeZone = e2;
|
|
2290
|
+
}
|
|
2291
|
+
return new en(n2, t2);
|
|
2292
|
+
}
|
|
2293
|
+
function toEpochMillis(e2, n2, t2) {
|
|
2294
|
+
const [, o2, r2] = e2;
|
|
2295
|
+
return t2.map((e3) => (e3.calendar && ((e4, n3, t3) => {
|
|
2296
|
+
if ((t3 || e4 !== l) && e4 !== n3) {
|
|
2297
|
+
throw new RangeError(lo);
|
|
2298
|
+
}
|
|
2299
|
+
})(e3.calendar, n2.calendar, r2), o2(e3, n2)));
|
|
2300
|
+
}
|
|
2301
|
+
function ge(e2, n2, t2) {
|
|
2302
|
+
const o2 = n2.timeZone, r2 = e2(o2), i = {
|
|
2303
|
+
...he(n2, r2),
|
|
2304
|
+
...t2 || Nt
|
|
2305
|
+
};
|
|
2306
|
+
let a;
|
|
2307
|
+
return a = t2 ? getMatchingInstantFor(r2, i, i.offsetNanoseconds, 2) : getStartOfDayInstantFor(r2, i), _e(a, o2, n2.calendar);
|
|
2308
|
+
}
|
|
2309
|
+
function Ot(e2, n2 = Nt) {
|
|
2310
|
+
return jt(checkIsoDateTimeInBounds({
|
|
2311
|
+
...e2,
|
|
2312
|
+
...n2
|
|
2313
|
+
}));
|
|
2314
|
+
}
|
|
2315
|
+
function pt(e2, n2) {
|
|
2316
|
+
return {
|
|
2317
|
+
...e2,
|
|
2318
|
+
calendar: n2
|
|
2319
|
+
};
|
|
2320
|
+
}
|
|
2321
|
+
function Pe(e2, n2) {
|
|
2322
|
+
return {
|
|
2323
|
+
...e2,
|
|
2324
|
+
timeZone: n2
|
|
2325
|
+
};
|
|
2326
|
+
}
|
|
2327
|
+
function tn(e2) {
|
|
2328
|
+
const n2 = Xe();
|
|
2329
|
+
return epochNanoToIso(n2, e2.R(n2));
|
|
2330
|
+
}
|
|
2331
|
+
function Xe() {
|
|
2332
|
+
return Ge(Date.now(), Qe);
|
|
2333
|
+
}
|
|
2334
|
+
function Ue() {
|
|
2335
|
+
return va || (va = new en().resolvedOptions().timeZone);
|
|
2336
|
+
}
|
|
2337
|
+
var expectedInteger = (e2, n2) => `Non-integer ${e2}: ${n2}`;
|
|
2338
|
+
var expectedPositive = (e2, n2) => `Non-positive ${e2}: ${n2}`;
|
|
2339
|
+
var expectedFinite = (e2, n2) => `Non-finite ${e2}: ${n2}`;
|
|
2340
|
+
var forbiddenBigIntToNumber = (e2) => `Cannot convert bigint to ${e2}`;
|
|
2341
|
+
var invalidBigInt = (e2) => `Invalid bigint: ${e2}`;
|
|
2342
|
+
var no = "Cannot convert Symbol to string";
|
|
2343
|
+
var oo = "Invalid object";
|
|
2344
|
+
var numberOutOfRange = (e2, n2, t2, o2, r2) => r2 ? numberOutOfRange(e2, r2[n2], r2[t2], r2[o2]) : invalidEntity(e2, n2) + `; must be between ${t2}-${o2}`;
|
|
2345
|
+
var invalidEntity = (e2, n2) => `Invalid ${e2}: ${n2}`;
|
|
2346
|
+
var missingField = (e2) => `Missing ${e2}`;
|
|
2347
|
+
var forbiddenField = (e2) => `Invalid field ${e2}`;
|
|
2348
|
+
var duplicateFields = (e2) => `Duplicate field ${e2}`;
|
|
2349
|
+
var noValidFields = (e2) => "No valid fields: " + e2.join();
|
|
2350
|
+
var i = "Invalid bag";
|
|
2351
|
+
var invalidChoice = (e2, n2, t2) => invalidEntity(e2, n2) + "; must be " + Object.keys(t2).join();
|
|
2352
|
+
var b = "Cannot use valueOf";
|
|
2353
|
+
var a = "Invalid calling context";
|
|
2354
|
+
var ro = "Forbidden era/eraYear";
|
|
2355
|
+
var io = "Mismatching era/eraYear";
|
|
2356
|
+
var ao = "Mismatching year/eraYear";
|
|
2357
|
+
var invalidEra = (e2) => `Invalid era: ${e2}`;
|
|
2358
|
+
var missingYear = (e2) => "Missing year" + (e2 ? "/era/eraYear" : "");
|
|
2359
|
+
var invalidMonthCode = (e2) => `Invalid monthCode: ${e2}`;
|
|
2360
|
+
var so = "Mismatching month/monthCode";
|
|
2361
|
+
var co = "Missing month/monthCode";
|
|
2362
|
+
var uo = "Invalid leap month";
|
|
2363
|
+
var fo = "Invalid protocol results";
|
|
2364
|
+
var c = (e2) => invalidEntity("Calendar", e2);
|
|
2365
|
+
var lo = "Mismatching Calendars";
|
|
2366
|
+
var F = (e2) => invalidEntity("TimeZone", e2);
|
|
2367
|
+
var mo = "Mismatching TimeZones";
|
|
2368
|
+
var po = "Forbidden ICU TimeZone";
|
|
2369
|
+
var ho = "Out-of-bounds offset";
|
|
2370
|
+
var go = "Out-of-bounds TimeZone gap";
|
|
2371
|
+
var Do = "Invalid TimeZone offset";
|
|
2372
|
+
var To = "Ambiguous offset";
|
|
2373
|
+
var Io = "Out-of-bounds date";
|
|
2374
|
+
var Mo = "Out-of-bounds duration";
|
|
2375
|
+
var No = "Cannot mix duration signs";
|
|
2376
|
+
var yo = "Missing relativeTo";
|
|
2377
|
+
var vo = "Cannot use large units";
|
|
2378
|
+
var Po = "Required smallestUnit or largestUnit";
|
|
2379
|
+
var Eo = "smallestUnit > largestUnit";
|
|
2380
|
+
var failedParse = (e2) => `Cannot parse: ${e2}`;
|
|
2381
|
+
var invalidSubstring = (e2) => `Invalid substring: ${e2}`;
|
|
2382
|
+
var rn = (e2) => `Cannot format ${e2}`;
|
|
2383
|
+
var ln = "Mismatching types for formatting";
|
|
2384
|
+
var So = "Cannot specify TimeZone";
|
|
2385
|
+
var Fo = /* @__PURE__ */ Pt(g, (e2, n2) => n2);
|
|
2386
|
+
var wo = /* @__PURE__ */ Pt(g, (e2, n2, t2) => t2);
|
|
2387
|
+
var bo = /* @__PURE__ */ Pt(padNumber, 2);
|
|
2388
|
+
var Oo = {
|
|
2389
|
+
nanosecond: 0,
|
|
2390
|
+
microsecond: 1,
|
|
2391
|
+
millisecond: 2,
|
|
2392
|
+
second: 3,
|
|
2393
|
+
minute: 4,
|
|
2394
|
+
hour: 5,
|
|
2395
|
+
day: 6,
|
|
2396
|
+
week: 7,
|
|
2397
|
+
month: 8,
|
|
2398
|
+
year: 9
|
|
2399
|
+
};
|
|
2400
|
+
var Bo = /* @__PURE__ */ Object.keys(Oo);
|
|
2401
|
+
var ko = 86400000;
|
|
2402
|
+
var Co = 1000;
|
|
2403
|
+
var Yo = 1000;
|
|
2404
|
+
var Qe = 1e6;
|
|
2405
|
+
var Ro = 1e9;
|
|
2406
|
+
var Zo = 60000000000;
|
|
2407
|
+
var zo = 3600000000000;
|
|
2408
|
+
var Uo = 86400000000000;
|
|
2409
|
+
var Ao = [1, Yo, Qe, Ro, Zo, zo, Uo];
|
|
2410
|
+
var O = /* @__PURE__ */ Bo.slice(0, 6);
|
|
2411
|
+
var qo = /* @__PURE__ */ sortStrings(O);
|
|
2412
|
+
var Wo = ["offset"];
|
|
2413
|
+
var jo = ["timeZone"];
|
|
2414
|
+
var Lo = /* @__PURE__ */ O.concat(Wo);
|
|
2415
|
+
var xo = /* @__PURE__ */ Lo.concat(jo);
|
|
2416
|
+
var $o = ["era", "eraYear"];
|
|
2417
|
+
var Ho = /* @__PURE__ */ $o.concat(["year"]);
|
|
2418
|
+
var Go = ["year"];
|
|
2419
|
+
var Vo = ["monthCode"];
|
|
2420
|
+
var _o = /* @__PURE__ */ ["month"].concat(Vo);
|
|
2421
|
+
var Jo = ["day"];
|
|
2422
|
+
var Ko = /* @__PURE__ */ _o.concat(Go);
|
|
2423
|
+
var Qo = /* @__PURE__ */ Vo.concat(Go);
|
|
2424
|
+
var Xo = /* @__PURE__ */ Jo.concat(Ko);
|
|
2425
|
+
var er = /* @__PURE__ */ Jo.concat(_o);
|
|
2426
|
+
var nr = /* @__PURE__ */ Jo.concat(Vo);
|
|
2427
|
+
var tr = /* @__PURE__ */ wo(O, 0);
|
|
2428
|
+
var l = "iso8601";
|
|
2429
|
+
var or = "gregory";
|
|
2430
|
+
var rr = "japanese";
|
|
2431
|
+
var ir = {
|
|
2432
|
+
[or]: {
|
|
2433
|
+
"gregory-inverse": -1,
|
|
2434
|
+
gregory: 0
|
|
2435
|
+
},
|
|
2436
|
+
[rr]: {
|
|
2437
|
+
"japanese-inverse": -1,
|
|
2438
|
+
japanese: 0,
|
|
2439
|
+
meiji: 1867,
|
|
2440
|
+
taisho: 1911,
|
|
2441
|
+
showa: 1925,
|
|
2442
|
+
heisei: 1988,
|
|
2443
|
+
reiwa: 2018
|
|
2444
|
+
},
|
|
2445
|
+
ethiopic: {
|
|
2446
|
+
ethioaa: 0,
|
|
2447
|
+
ethiopic: 5500
|
|
2448
|
+
},
|
|
2449
|
+
coptic: {
|
|
2450
|
+
"coptic-inverse": -1,
|
|
2451
|
+
coptic: 0
|
|
2452
|
+
},
|
|
2453
|
+
roc: {
|
|
2454
|
+
"roc-inverse": -1,
|
|
2455
|
+
roc: 0
|
|
2456
|
+
},
|
|
2457
|
+
buddhist: {
|
|
2458
|
+
be: 0
|
|
2459
|
+
},
|
|
2460
|
+
islamic: {
|
|
2461
|
+
ah: 0
|
|
2462
|
+
},
|
|
2463
|
+
indian: {
|
|
2464
|
+
saka: 0
|
|
2465
|
+
},
|
|
2466
|
+
persian: {
|
|
2467
|
+
ap: 0
|
|
2468
|
+
}
|
|
2469
|
+
};
|
|
2470
|
+
var ar = {
|
|
2471
|
+
[or]: {
|
|
2472
|
+
bce: "gregory-inverse",
|
|
2473
|
+
ce: "gregory"
|
|
2474
|
+
},
|
|
2475
|
+
[rr]: {
|
|
2476
|
+
bce: "japanese-inverse",
|
|
2477
|
+
ce: "japanese"
|
|
2478
|
+
},
|
|
2479
|
+
ethiopic: {
|
|
2480
|
+
era0: "ethioaa",
|
|
2481
|
+
era1: "ethiopic"
|
|
2482
|
+
},
|
|
2483
|
+
coptic: {
|
|
2484
|
+
era0: "coptic-inverse",
|
|
2485
|
+
era1: "coptic"
|
|
2486
|
+
},
|
|
2487
|
+
roc: {
|
|
2488
|
+
broc: "roc-inverse",
|
|
2489
|
+
minguo: "roc"
|
|
2490
|
+
}
|
|
2491
|
+
};
|
|
2492
|
+
var sr = {
|
|
2493
|
+
chinese: 13,
|
|
2494
|
+
dangi: 13,
|
|
2495
|
+
hebrew: -6
|
|
2496
|
+
};
|
|
2497
|
+
var m = /* @__PURE__ */ Pt(requireType, "string");
|
|
2498
|
+
var D = /* @__PURE__ */ Pt(requireType, "boolean");
|
|
2499
|
+
var cr = /* @__PURE__ */ Pt(requireType, "number");
|
|
2500
|
+
var p = /* @__PURE__ */ Bo.map((e2) => e2 + "s");
|
|
2501
|
+
var ur = /* @__PURE__ */ sortStrings(p);
|
|
2502
|
+
var fr = /* @__PURE__ */ p.slice(0, 6);
|
|
2503
|
+
var lr = /* @__PURE__ */ p.slice(6);
|
|
2504
|
+
var dr = /* @__PURE__ */ lr.slice(1);
|
|
2505
|
+
var mr = /* @__PURE__ */ Fo(p);
|
|
2506
|
+
var pr = /* @__PURE__ */ wo(p, 0);
|
|
2507
|
+
var hr = /* @__PURE__ */ wo(fr, 0);
|
|
2508
|
+
var gr = /* @__PURE__ */ Pt(zeroOutProps, p);
|
|
2509
|
+
var w = ["isoNanosecond", "isoMicrosecond", "isoMillisecond", "isoSecond", "isoMinute", "isoHour"];
|
|
2510
|
+
var Dr = ["isoDay", "isoMonth", "isoYear"];
|
|
2511
|
+
var Tr = /* @__PURE__ */ w.concat(Dr);
|
|
2512
|
+
var Ir = /* @__PURE__ */ sortStrings(Dr);
|
|
2513
|
+
var Mr = /* @__PURE__ */ sortStrings(w);
|
|
2514
|
+
var Nr = /* @__PURE__ */ sortStrings(Tr);
|
|
2515
|
+
var Nt = /* @__PURE__ */ wo(Mr, 0);
|
|
2516
|
+
var yr = /* @__PURE__ */ Pt(zeroOutProps, Tr);
|
|
2517
|
+
var vr = 1e8;
|
|
2518
|
+
var Pr = vr * ko;
|
|
2519
|
+
var Er = [vr, 0];
|
|
2520
|
+
var Sr = [-vr, 0];
|
|
2521
|
+
var Fr = 275760;
|
|
2522
|
+
var wr = -271821;
|
|
2523
|
+
var en = Intl.DateTimeFormat;
|
|
2524
|
+
var br = "en-GB";
|
|
2525
|
+
var Or = 1970;
|
|
2526
|
+
var Br = 1972;
|
|
2527
|
+
var kr = 12;
|
|
2528
|
+
var Cr = /* @__PURE__ */ isoArgsToEpochMilli(1868, 9, 8);
|
|
2529
|
+
var Yr = /* @__PURE__ */ on(computeJapaneseEraParts, WeakMap);
|
|
2530
|
+
var Rr = "smallestUnit";
|
|
2531
|
+
var Zr = "unit";
|
|
2532
|
+
var zr = "roundingIncrement";
|
|
2533
|
+
var Ur = "fractionalSecondDigits";
|
|
2534
|
+
var Ar = "relativeTo";
|
|
2535
|
+
var qr = "direction";
|
|
2536
|
+
var Wr = {
|
|
2537
|
+
constrain: 0,
|
|
2538
|
+
reject: 1
|
|
2539
|
+
};
|
|
2540
|
+
var jr = /* @__PURE__ */ Object.keys(Wr);
|
|
2541
|
+
var Lr = {
|
|
2542
|
+
compatible: 0,
|
|
2543
|
+
reject: 1,
|
|
2544
|
+
earlier: 2,
|
|
2545
|
+
later: 3
|
|
2546
|
+
};
|
|
2547
|
+
var xr = {
|
|
2548
|
+
reject: 0,
|
|
2549
|
+
use: 1,
|
|
2550
|
+
prefer: 2,
|
|
2551
|
+
ignore: 3
|
|
2552
|
+
};
|
|
2553
|
+
var $r = {
|
|
2554
|
+
auto: 0,
|
|
2555
|
+
never: 1,
|
|
2556
|
+
critical: 2,
|
|
2557
|
+
always: 3
|
|
2558
|
+
};
|
|
2559
|
+
var Hr = {
|
|
2560
|
+
auto: 0,
|
|
2561
|
+
never: 1,
|
|
2562
|
+
critical: 2
|
|
2563
|
+
};
|
|
2564
|
+
var Gr = {
|
|
2565
|
+
auto: 0,
|
|
2566
|
+
never: 1
|
|
2567
|
+
};
|
|
2568
|
+
var Vr = {
|
|
2569
|
+
floor: 0,
|
|
2570
|
+
halfFloor: 1,
|
|
2571
|
+
ceil: 2,
|
|
2572
|
+
halfCeil: 3,
|
|
2573
|
+
trunc: 4,
|
|
2574
|
+
halfTrunc: 5,
|
|
2575
|
+
expand: 6,
|
|
2576
|
+
halfExpand: 7,
|
|
2577
|
+
halfEven: 8
|
|
2578
|
+
};
|
|
2579
|
+
var _r = {
|
|
2580
|
+
previous: -1,
|
|
2581
|
+
next: 1
|
|
2582
|
+
};
|
|
2583
|
+
var Jr = /* @__PURE__ */ Pt(refineUnitOption, Rr);
|
|
2584
|
+
var Kr = /* @__PURE__ */ Pt(refineUnitOption, "largestUnit");
|
|
2585
|
+
var Qr = /* @__PURE__ */ Pt(refineUnitOption, Zr);
|
|
2586
|
+
var Xr = /* @__PURE__ */ Pt(refineChoiceOption, "overflow", Wr);
|
|
2587
|
+
var ei = /* @__PURE__ */ Pt(refineChoiceOption, "disambiguation", Lr);
|
|
2588
|
+
var ni = /* @__PURE__ */ Pt(refineChoiceOption, "offset", xr);
|
|
2589
|
+
var ti = /* @__PURE__ */ Pt(refineChoiceOption, "calendarName", $r);
|
|
2590
|
+
var oi = /* @__PURE__ */ Pt(refineChoiceOption, "timeZoneName", Hr);
|
|
2591
|
+
var ri = /* @__PURE__ */ Pt(refineChoiceOption, "offset", Gr);
|
|
2592
|
+
var ii = /* @__PURE__ */ Pt(refineChoiceOption, "roundingMode", Vr);
|
|
2593
|
+
var Ut = "PlainYearMonth";
|
|
2594
|
+
var qt = "PlainMonthDay";
|
|
2595
|
+
var G = "PlainDate";
|
|
2596
|
+
var x = "PlainDateTime";
|
|
2597
|
+
var ft = "PlainTime";
|
|
2598
|
+
var z = "ZonedDateTime";
|
|
2599
|
+
var Re = "Instant";
|
|
2600
|
+
var N = "Duration";
|
|
2601
|
+
var ai = [Math.floor, (e2) => hasHalf(e2) ? Math.floor(e2) : Math.round(e2), Math.ceil, (e2) => hasHalf(e2) ? Math.ceil(e2) : Math.round(e2), Math.trunc, (e2) => hasHalf(e2) ? Math.trunc(e2) || 0 : Math.round(e2), (e2) => e2 < 0 ? Math.floor(e2) : Math.ceil(e2), (e2) => Math.sign(e2) * Math.round(Math.abs(e2)) || 0, (e2) => hasHalf(e2) ? (e2 = Math.trunc(e2) || 0) + e2 % 2 : Math.round(e2)];
|
|
2602
|
+
var si = "UTC";
|
|
2603
|
+
var ci = 5184000;
|
|
2604
|
+
var ui = /* @__PURE__ */ isoArgsToEpochSec(1847);
|
|
2605
|
+
var fi = /* @__PURE__ */ isoArgsToEpochSec(/* @__PURE__ */ (/* @__PURE__ */ new Date()).getUTCFullYear() + 10);
|
|
2606
|
+
var li = /0+$/;
|
|
2607
|
+
var he = /* @__PURE__ */ on(_zonedEpochSlotsToIso, WeakMap);
|
|
2608
|
+
var di = 2 ** 32 - 1;
|
|
2609
|
+
var L = /* @__PURE__ */ on((e2) => {
|
|
2610
|
+
const n2 = getTimeZoneEssence(e2);
|
|
2611
|
+
return typeof n2 == "object" ? new IntlTimeZone(n2) : new FixedTimeZone(n2 || 0);
|
|
2612
|
+
});
|
|
2613
|
+
|
|
2614
|
+
class FixedTimeZone {
|
|
2615
|
+
constructor(e2) {
|
|
2616
|
+
this.$ = e2;
|
|
2617
|
+
}
|
|
2618
|
+
R() {
|
|
2619
|
+
return this.$;
|
|
2620
|
+
}
|
|
2621
|
+
I(e2) {
|
|
2622
|
+
return ((e3) => {
|
|
2623
|
+
const n2 = isoToEpochNano({
|
|
2624
|
+
...e3,
|
|
2625
|
+
...Nt
|
|
2626
|
+
});
|
|
2627
|
+
if (!n2 || Math.abs(n2[0]) > 1e8) {
|
|
2628
|
+
throw new RangeError(Io);
|
|
2629
|
+
}
|
|
2630
|
+
})(e2), [isoToEpochNanoWithOffset(e2, this.$)];
|
|
2631
|
+
}
|
|
2632
|
+
O() {}
|
|
2633
|
+
}
|
|
2634
|
+
|
|
2635
|
+
class IntlTimeZone {
|
|
2636
|
+
constructor(e2) {
|
|
2637
|
+
this.nn = ((e3) => {
|
|
2638
|
+
function getOffsetSec(e4) {
|
|
2639
|
+
const i2 = clampNumber(e4, o2, r2), [a2, s2] = computePeriod(i2), c2 = n2(a2), u2 = n2(s2);
|
|
2640
|
+
return c2 === u2 ? c2 : pinch(t2(a2, s2), c2, u2, e4);
|
|
2641
|
+
}
|
|
2642
|
+
function pinch(n3, t3, o3, r3) {
|
|
2643
|
+
let i2, a2;
|
|
2644
|
+
for (;(r3 === undefined || (i2 = r3 < n3[0] ? t3 : r3 >= n3[1] ? o3 : undefined) === undefined) && (a2 = n3[1] - n3[0]); ) {
|
|
2645
|
+
const t4 = n3[0] + Math.floor(a2 / 2);
|
|
2646
|
+
e3(t4) === o3 ? n3[1] = t4 : n3[0] = t4 + 1;
|
|
2647
|
+
}
|
|
2648
|
+
return i2;
|
|
2649
|
+
}
|
|
2650
|
+
const n2 = on(e3), t2 = on(createSplitTuple);
|
|
2651
|
+
let o2 = ui, r2 = fi;
|
|
2652
|
+
return {
|
|
2653
|
+
tn(e4) {
|
|
2654
|
+
const n3 = getOffsetSec(e4 - 86400), t3 = getOffsetSec(e4 + 86400), o3 = e4 - n3, r3 = e4 - t3;
|
|
2655
|
+
if (n3 === t3) {
|
|
2656
|
+
return [o3];
|
|
2657
|
+
}
|
|
2658
|
+
const i2 = getOffsetSec(o3);
|
|
2659
|
+
return i2 === getOffsetSec(r3) ? [e4 - i2] : n3 > t3 ? [o3, r3] : [];
|
|
2660
|
+
},
|
|
2661
|
+
rn: getOffsetSec,
|
|
2662
|
+
O(e4, i2) {
|
|
2663
|
+
const a2 = clampNumber(e4, o2, r2);
|
|
2664
|
+
let [s2, c2] = computePeriod(a2);
|
|
2665
|
+
const u2 = ci * i2, f2 = i2 < 0 ? () => c2 > o2 || (o2 = a2, 0) : () => s2 < r2 || (r2 = a2, 0);
|
|
2666
|
+
for (;f2(); ) {
|
|
2667
|
+
const o3 = n2(s2), r3 = n2(c2);
|
|
2668
|
+
if (o3 !== r3) {
|
|
2669
|
+
const n3 = t2(s2, c2);
|
|
2670
|
+
pinch(n3, o3, r3);
|
|
2671
|
+
const a3 = n3[0];
|
|
2672
|
+
if ((compareNumbers(a3, e4) || 1) === i2) {
|
|
2673
|
+
return a3;
|
|
2674
|
+
}
|
|
2675
|
+
}
|
|
2676
|
+
s2 += u2, c2 += u2;
|
|
2677
|
+
}
|
|
2678
|
+
}
|
|
2679
|
+
};
|
|
2680
|
+
})(((e3) => (n2) => {
|
|
2681
|
+
const t2 = hashIntlFormatParts(e3, n2 * Co);
|
|
2682
|
+
return isoArgsToEpochSec(parseIntlPartsYear(t2), parseInt(t2.month), parseInt(t2.day), parseInt(t2.hour), parseInt(t2.minute), parseInt(t2.second)) - n2;
|
|
2683
|
+
})(e2));
|
|
2684
|
+
}
|
|
2685
|
+
R(e2) {
|
|
2686
|
+
return this.nn.rn(((e3) => epochNanoToSecMod(e3)[0])(e2)) * Ro;
|
|
2687
|
+
}
|
|
2688
|
+
I(e2) {
|
|
2689
|
+
const [n2, t2] = [isoArgsToEpochSec((o2 = e2).isoYear, o2.isoMonth, o2.isoDay, o2.isoHour, o2.isoMinute, o2.isoSecond), o2.isoMillisecond * Qe + o2.isoMicrosecond * Yo + o2.isoNanosecond];
|
|
2690
|
+
var o2;
|
|
2691
|
+
return this.nn.tn(n2).map((e3) => checkEpochNanoInBounds(moveBigNano(Ge(e3, Ro), t2)));
|
|
2692
|
+
}
|
|
2693
|
+
O(e2, n2) {
|
|
2694
|
+
const [t2, o2] = epochNanoToSecMod(e2), r2 = this.nn.O(t2 + (n2 > 0 || o2 ? 1 : 0), n2);
|
|
2695
|
+
if (r2 !== undefined) {
|
|
2696
|
+
return Ge(r2, Ro);
|
|
2697
|
+
}
|
|
2698
|
+
}
|
|
2699
|
+
}
|
|
2700
|
+
var mi = "([+-])";
|
|
2701
|
+
var pi = "(?:[.,](\\d{1,9}))?";
|
|
2702
|
+
var hi = `(?:(?:${mi}(\\d{6}))|(\\d{4}))-?(\\d{2})`;
|
|
2703
|
+
var gi = "(\\d{2})(?::?(\\d{2})(?::?(\\d{2})" + pi + ")?)?";
|
|
2704
|
+
var Di = mi + gi;
|
|
2705
|
+
var Ti = hi + "-?(\\d{2})(?:[T ]" + gi + "(Z|" + Di + ")?)?";
|
|
2706
|
+
var Ii = "\\[(!?)([^\\]]*)\\]";
|
|
2707
|
+
var Mi = `((?:${Ii}){0,9})`;
|
|
2708
|
+
var Ni = /* @__PURE__ */ createRegExp(hi + Mi);
|
|
2709
|
+
var yi = /* @__PURE__ */ createRegExp("(?:--)?(\\d{2})-?(\\d{2})" + Mi);
|
|
2710
|
+
var vi = /* @__PURE__ */ createRegExp(Ti + Mi);
|
|
2711
|
+
var Pi = /* @__PURE__ */ createRegExp("T?" + gi + "(?:" + Di + ")?" + Mi);
|
|
2712
|
+
var Ei = /* @__PURE__ */ createRegExp(Di);
|
|
2713
|
+
var Si = /* @__PURE__ */ new RegExp(Ii, "g");
|
|
2714
|
+
var Fi = /* @__PURE__ */ createRegExp(`${mi}?P(\\d+Y)?(\\d+M)?(\\d+W)?(\\d+D)?(?:T(?:(\\d+)${pi}H)?(?:(\\d+)${pi}M)?(?:(\\d+)${pi}S)?)?`);
|
|
2715
|
+
var wi = /* @__PURE__ */ on((e2) => new en(br, {
|
|
2716
|
+
timeZone: e2,
|
|
2717
|
+
era: "short",
|
|
2718
|
+
year: "numeric",
|
|
2719
|
+
month: "numeric",
|
|
2720
|
+
day: "numeric",
|
|
2721
|
+
hour: "numeric",
|
|
2722
|
+
minute: "numeric",
|
|
2723
|
+
second: "numeric"
|
|
2724
|
+
}));
|
|
2725
|
+
var bi = /^(AC|AE|AG|AR|AS|BE|BS|CA|CN|CS|CT|EA|EC|IE|IS|JS|MI|NE|NS|PL|PN|PR|PS|SS|VS)T$/;
|
|
2726
|
+
var Oi = /[^\w\/:+-]+/;
|
|
2727
|
+
var Bi = /^M(\d{2})(L?)$/;
|
|
2728
|
+
var ki = /* @__PURE__ */ on(createIntlCalendar);
|
|
2729
|
+
var Ci = /* @__PURE__ */ on((e2) => new en(br, {
|
|
2730
|
+
calendar: e2,
|
|
2731
|
+
timeZone: si,
|
|
2732
|
+
era: "short",
|
|
2733
|
+
year: "numeric",
|
|
2734
|
+
month: "short",
|
|
2735
|
+
day: "numeric"
|
|
2736
|
+
}));
|
|
2737
|
+
var Yi = {
|
|
2738
|
+
P(e2, n2, t2) {
|
|
2739
|
+
const o2 = mt(t2);
|
|
2740
|
+
let r2, { years: i2, months: a2, weeks: s2, days: c2 } = n2;
|
|
2741
|
+
if (c2 += durationFieldsToBigNano(n2, 5)[0], i2 || a2) {
|
|
2742
|
+
r2 = ((e3, n3, t3, o3, r3) => {
|
|
2743
|
+
let [i3, a3, s3] = e3.v(n3);
|
|
2744
|
+
if (t3) {
|
|
2745
|
+
const [n4, o4] = e3.q(i3, a3);
|
|
2746
|
+
i3 += t3, a3 = monthCodeNumberToMonth(n4, o4, e3.L(i3)), a3 = clampEntity("month", a3, 1, e3.B(i3), r3);
|
|
2747
|
+
}
|
|
2748
|
+
return o3 && ([i3, a3] = e3.un(i3, a3, o3)), s3 = clampEntity("day", s3, 1, e3.U(i3, a3), r3), e3.p(i3, a3, s3);
|
|
2749
|
+
})(this, e2, i2, a2, o2);
|
|
2750
|
+
} else {
|
|
2751
|
+
if (!s2 && !c2) {
|
|
2752
|
+
return e2;
|
|
2753
|
+
}
|
|
2754
|
+
r2 = isoToEpochMilli(e2);
|
|
2755
|
+
}
|
|
2756
|
+
if (r2 === undefined) {
|
|
2757
|
+
throw new RangeError(Io);
|
|
2758
|
+
}
|
|
2759
|
+
return r2 += (7 * s2 + c2) * ko, checkIsoDateInBounds(epochMilliToIso(r2));
|
|
2760
|
+
},
|
|
2761
|
+
N(e2, n2, t2) {
|
|
2762
|
+
if (t2 <= 7) {
|
|
2763
|
+
let o3 = 0, r3 = diffDays({
|
|
2764
|
+
...e2,
|
|
2765
|
+
...Nt
|
|
2766
|
+
}, {
|
|
2767
|
+
...n2,
|
|
2768
|
+
...Nt
|
|
2769
|
+
});
|
|
2770
|
+
return t2 === 7 && ([o3, r3] = divModTrunc(r3, 7)), {
|
|
2771
|
+
...pr,
|
|
2772
|
+
weeks: o3,
|
|
2773
|
+
days: r3
|
|
2774
|
+
};
|
|
2775
|
+
}
|
|
2776
|
+
const o2 = this.v(e2), r2 = this.v(n2);
|
|
2777
|
+
let [i2, a2, s2] = ((e3, n3, t3, o3, r3, i3, a3) => {
|
|
2778
|
+
let s3 = r3 - n3, c2 = i3 - t3, u2 = a3 - o3;
|
|
2779
|
+
if (s3 || c2) {
|
|
2780
|
+
const f2 = Math.sign(s3 || c2);
|
|
2781
|
+
let l2 = e3.U(r3, i3), d2 = 0;
|
|
2782
|
+
if (Math.sign(u2) === -f2) {
|
|
2783
|
+
const o4 = l2;
|
|
2784
|
+
[r3, i3] = e3.un(r3, i3, -f2), s3 = r3 - n3, c2 = i3 - t3, l2 = e3.U(r3, i3), d2 = f2 < 0 ? -o4 : l2;
|
|
2785
|
+
}
|
|
2786
|
+
if (u2 = a3 - Math.min(o3, l2) + d2, s3) {
|
|
2787
|
+
const [o4, a4] = e3.q(n3, t3), [u3, l3] = e3.q(r3, i3);
|
|
2788
|
+
if (c2 = u3 - o4 || Number(l3) - Number(a4), Math.sign(c2) === -f2) {
|
|
2789
|
+
const t4 = f2 < 0 && -e3.B(r3);
|
|
2790
|
+
s3 = (r3 -= f2) - n3, c2 = i3 - monthCodeNumberToMonth(o4, a4, e3.L(r3)) + (t4 || e3.B(r3));
|
|
2791
|
+
}
|
|
2792
|
+
}
|
|
2793
|
+
}
|
|
2794
|
+
return [s3, c2, u2];
|
|
2795
|
+
})(this, ...o2, ...r2);
|
|
2796
|
+
return t2 === 8 && (a2 += this.cn(i2, o2[0]), i2 = 0), {
|
|
2797
|
+
...pr,
|
|
2798
|
+
years: i2,
|
|
2799
|
+
months: a2,
|
|
2800
|
+
days: s2
|
|
2801
|
+
};
|
|
2802
|
+
},
|
|
2803
|
+
F(e2, n2) {
|
|
2804
|
+
const t2 = mt(n2), o2 = refineYear(this, e2), r2 = refineMonth(this, e2, o2, t2), i2 = refineDay(this, e2, r2, o2, t2);
|
|
2805
|
+
return W(checkIsoDateInBounds(this.V(o2, r2, i2)), this.id || l);
|
|
2806
|
+
},
|
|
2807
|
+
K(e2, n2) {
|
|
2808
|
+
const t2 = mt(n2), o2 = refineYear(this, e2), r2 = refineMonth(this, e2, o2, t2);
|
|
2809
|
+
return createPlainYearMonthSlots(checkIsoYearMonthInBounds(this.V(o2, r2, 1)), this.id || l);
|
|
2810
|
+
},
|
|
2811
|
+
_(e2, n2) {
|
|
2812
|
+
const t2 = mt(n2);
|
|
2813
|
+
let o2, r2, i2, a2 = e2.eraYear !== undefined || e2.year !== undefined ? refineYear(this, e2) : undefined;
|
|
2814
|
+
const s2 = !this.id;
|
|
2815
|
+
if (a2 === undefined && s2 && (a2 = Br), a2 !== undefined) {
|
|
2816
|
+
const n3 = refineMonth(this, e2, a2, t2);
|
|
2817
|
+
o2 = refineDay(this, e2, n3, a2, t2);
|
|
2818
|
+
const s3 = this.L(a2);
|
|
2819
|
+
r2 = monthToMonthCodeNumber(n3, s3), i2 = n3 === s3;
|
|
2820
|
+
} else {
|
|
2821
|
+
if (e2.monthCode === undefined) {
|
|
2822
|
+
throw new TypeError(co);
|
|
2823
|
+
}
|
|
2824
|
+
if ([r2, i2] = parseMonthCode(e2.monthCode), this.id && this.id !== or && this.id !== rr) {
|
|
2825
|
+
if (this.id && computeCalendarIdBase(this.id) === "coptic" && t2 === 0) {
|
|
2826
|
+
const n3 = i2 || r2 !== 13 ? 30 : 6;
|
|
2827
|
+
o2 = e2.day, o2 = clampNumber(o2, 1, n3);
|
|
2828
|
+
} else if (this.id && computeCalendarIdBase(this.id) === "chinese" && t2 === 0) {
|
|
2829
|
+
const n3 = !i2 || r2 !== 1 && r2 !== 9 && r2 !== 10 && r2 !== 11 && r2 !== 12 ? 30 : 29;
|
|
2830
|
+
o2 = e2.day, o2 = clampNumber(o2, 1, n3);
|
|
2831
|
+
} else {
|
|
2832
|
+
o2 = e2.day;
|
|
2833
|
+
}
|
|
2834
|
+
} else {
|
|
2835
|
+
o2 = refineDay(this, e2, refineMonth(this, e2, Br, t2), Br, t2);
|
|
2836
|
+
}
|
|
2837
|
+
}
|
|
2838
|
+
const c2 = this.G(r2, i2, o2);
|
|
2839
|
+
if (!c2) {
|
|
2840
|
+
throw new RangeError("Cannot guess year");
|
|
2841
|
+
}
|
|
2842
|
+
const [u2, f2] = c2;
|
|
2843
|
+
return createPlainMonthDaySlots(checkIsoDateInBounds(this.V(u2, f2, o2)), this.id || l);
|
|
2844
|
+
},
|
|
2845
|
+
fields(e2) {
|
|
2846
|
+
return getCalendarEraOrigins(this) && e2.includes("year") ? [...e2, ...$o] : e2;
|
|
2847
|
+
},
|
|
2848
|
+
k(e2, n2) {
|
|
2849
|
+
const t2 = Object.assign(Object.create(null), e2);
|
|
2850
|
+
return spliceFields(t2, n2, _o), getCalendarEraOrigins(this) && (spliceFields(t2, n2, Ho), this.id === rr && spliceFields(t2, n2, er, $o)), t2;
|
|
2851
|
+
},
|
|
2852
|
+
inLeapYear(e2) {
|
|
2853
|
+
const [n2] = this.v(e2);
|
|
2854
|
+
return this.sn(n2);
|
|
2855
|
+
},
|
|
2856
|
+
monthsInYear(e2) {
|
|
2857
|
+
const [n2] = this.v(e2);
|
|
2858
|
+
return this.B(n2);
|
|
2859
|
+
},
|
|
2860
|
+
daysInMonth(e2) {
|
|
2861
|
+
const [n2, t2] = this.v(e2);
|
|
2862
|
+
return this.U(n2, t2);
|
|
2863
|
+
},
|
|
2864
|
+
daysInYear(e2) {
|
|
2865
|
+
const [n2] = this.v(e2);
|
|
2866
|
+
return this.fn(n2);
|
|
2867
|
+
},
|
|
2868
|
+
dayOfYear: computeNativeDayOfYear,
|
|
2869
|
+
era(e2) {
|
|
2870
|
+
return this.hn(e2)[0];
|
|
2871
|
+
},
|
|
2872
|
+
eraYear(e2) {
|
|
2873
|
+
return this.hn(e2)[1];
|
|
2874
|
+
},
|
|
2875
|
+
monthCode(e2) {
|
|
2876
|
+
const [n2, t2] = this.v(e2), [o2, r2] = this.q(n2, t2);
|
|
2877
|
+
return formatMonthCode(o2, r2);
|
|
2878
|
+
},
|
|
2879
|
+
dayOfWeek: computeIsoDayOfWeek,
|
|
2880
|
+
daysInWeek() {
|
|
2881
|
+
return 7;
|
|
2882
|
+
}
|
|
2883
|
+
};
|
|
2884
|
+
var Ri = {
|
|
2885
|
+
v: computeIsoDateParts,
|
|
2886
|
+
hn: computeIsoEraParts,
|
|
2887
|
+
q: computeIsoMonthCodeParts
|
|
2888
|
+
};
|
|
2889
|
+
var Zi = {
|
|
2890
|
+
dayOfYear: computeNativeDayOfYear,
|
|
2891
|
+
v: computeIsoDateParts,
|
|
2892
|
+
p: isoArgsToEpochMilli
|
|
2893
|
+
};
|
|
2894
|
+
var zi = /* @__PURE__ */ Object.assign({}, Zi, {
|
|
2895
|
+
weekOfYear: computeNativeWeekOfYear,
|
|
2896
|
+
yearOfWeek: computeNativeYearOfWeek,
|
|
2897
|
+
m(e2) {
|
|
2898
|
+
function computeWeekShift(e3) {
|
|
2899
|
+
return (7 - e3 < n2 ? 7 : 0) - e3;
|
|
2900
|
+
}
|
|
2901
|
+
function computeWeeksInYear(e3) {
|
|
2902
|
+
const n3 = computeIsoDaysInYear(f2 + e3), t3 = e3 || 1, o3 = computeWeekShift(modFloor(a2 + n3 * t3, 7));
|
|
2903
|
+
return c2 = (n3 + (o3 - s2) * t3) / 7;
|
|
2904
|
+
}
|
|
2905
|
+
const n2 = this.id ? 1 : 4, t2 = computeIsoDayOfWeek(e2), o2 = this.dayOfYear(e2), r2 = modFloor(t2 - 1, 7), i2 = o2 - 1, a2 = modFloor(r2 - i2, 7), s2 = computeWeekShift(a2);
|
|
2906
|
+
let c2, u2 = Math.floor((i2 - s2) / 7) + 1, f2 = e2.isoYear;
|
|
2907
|
+
return u2 ? u2 > computeWeeksInYear(0) && (u2 = 1, f2++) : (u2 = computeWeeksInYear(-1), f2--), [u2, f2, c2];
|
|
2908
|
+
}
|
|
2909
|
+
});
|
|
2910
|
+
var Ui = /* @__PURE__ */ Object.assign({}, Yi, zi, {
|
|
2911
|
+
v: computeIsoDateParts,
|
|
2912
|
+
hn: computeIsoEraParts,
|
|
2913
|
+
q: computeIsoMonthCodeParts,
|
|
2914
|
+
G(e2, n2) {
|
|
2915
|
+
if (!n2) {
|
|
2916
|
+
return [Br, e2];
|
|
2917
|
+
}
|
|
2918
|
+
},
|
|
2919
|
+
sn: computeIsoInLeapYear,
|
|
2920
|
+
L() {},
|
|
2921
|
+
B: computeIsoMonthsInYear,
|
|
2922
|
+
cn: (e2) => e2 * kr,
|
|
2923
|
+
U: computeIsoDaysInMonth,
|
|
2924
|
+
fn: computeIsoDaysInYear,
|
|
2925
|
+
V: (e2, n2, t2) => ({
|
|
2926
|
+
isoYear: e2,
|
|
2927
|
+
isoMonth: n2,
|
|
2928
|
+
isoDay: t2
|
|
2929
|
+
}),
|
|
2930
|
+
p: isoArgsToEpochMilli,
|
|
2931
|
+
un: (e2, n2, t2) => (e2 += divTrunc(t2, kr), (n2 += modTrunc(t2, kr)) < 1 ? (e2--, n2 += kr) : n2 > kr && (e2++, n2 -= kr), [e2, n2]),
|
|
2932
|
+
year(e2) {
|
|
2933
|
+
return e2.isoYear;
|
|
2934
|
+
},
|
|
2935
|
+
month(e2) {
|
|
2936
|
+
return e2.isoMonth;
|
|
2937
|
+
},
|
|
2938
|
+
day: (e2) => e2.isoDay
|
|
2939
|
+
});
|
|
2940
|
+
var Ai = {
|
|
2941
|
+
v: computeIntlDateParts,
|
|
2942
|
+
hn: computeIntlEraParts,
|
|
2943
|
+
q: computeIntlMonthCodeParts
|
|
2944
|
+
};
|
|
2945
|
+
var qi = {
|
|
2946
|
+
dayOfYear: computeNativeDayOfYear,
|
|
2947
|
+
v: computeIntlDateParts,
|
|
2948
|
+
p: computeIntlEpochMilli,
|
|
2949
|
+
weekOfYear: computeNativeWeekOfYear,
|
|
2950
|
+
yearOfWeek: computeNativeYearOfWeek,
|
|
2951
|
+
m() {
|
|
2952
|
+
return [];
|
|
2953
|
+
}
|
|
2954
|
+
};
|
|
2955
|
+
var Wi = /* @__PURE__ */ Object.assign({}, Yi, qi, {
|
|
2956
|
+
v: computeIntlDateParts,
|
|
2957
|
+
hn: computeIntlEraParts,
|
|
2958
|
+
q: computeIntlMonthCodeParts,
|
|
2959
|
+
G(e2, n2, t2) {
|
|
2960
|
+
const o2 = this.id && computeCalendarIdBase(this.id) === "chinese" ? ((e3, n3, t3) => {
|
|
2961
|
+
if (n3) {
|
|
2962
|
+
switch (e3) {
|
|
2963
|
+
case 1:
|
|
2964
|
+
return 1651;
|
|
2965
|
+
case 2:
|
|
2966
|
+
return t3 < 30 ? 1947 : 1765;
|
|
2967
|
+
case 3:
|
|
2968
|
+
return t3 < 30 ? 1966 : 1955;
|
|
2969
|
+
case 4:
|
|
2970
|
+
return t3 < 30 ? 1963 : 1944;
|
|
2971
|
+
case 5:
|
|
2972
|
+
return t3 < 30 ? 1971 : 1952;
|
|
2973
|
+
case 6:
|
|
2974
|
+
return t3 < 30 ? 1960 : 1941;
|
|
2975
|
+
case 7:
|
|
2976
|
+
return t3 < 30 ? 1968 : 1938;
|
|
2977
|
+
case 8:
|
|
2978
|
+
return t3 < 30 ? 1957 : 1718;
|
|
2979
|
+
case 9:
|
|
2980
|
+
return 1832;
|
|
2981
|
+
case 10:
|
|
2982
|
+
return 1870;
|
|
2983
|
+
case 11:
|
|
2984
|
+
return 1814;
|
|
2985
|
+
case 12:
|
|
2986
|
+
return 1890;
|
|
2987
|
+
}
|
|
2988
|
+
}
|
|
2989
|
+
return 1972;
|
|
2990
|
+
})(e2, n2, t2) : Br;
|
|
2991
|
+
let [r2, i2, a2] = computeIntlDateParts.call(this, {
|
|
2992
|
+
isoYear: o2,
|
|
2993
|
+
isoMonth: kr,
|
|
2994
|
+
isoDay: 31
|
|
2995
|
+
});
|
|
2996
|
+
const s2 = computeIntlLeapMonth.call(this, r2), c2 = i2 === s2;
|
|
2997
|
+
(compareNumbers(e2, monthToMonthCodeNumber(i2, s2)) || compareNumbers(Number(n2), Number(c2)) || compareNumbers(t2, a2)) === 1 && r2--;
|
|
2998
|
+
for (let o3 = 0;o3 < 100; o3++) {
|
|
2999
|
+
const i3 = r2 - o3, a3 = computeIntlLeapMonth.call(this, i3), s3 = monthCodeNumberToMonth(e2, n2, a3);
|
|
3000
|
+
if (n2 === (s3 === a3) && t2 <= computeIntlDaysInMonth.call(this, i3, s3)) {
|
|
3001
|
+
return [i3, s3];
|
|
3002
|
+
}
|
|
3003
|
+
}
|
|
3004
|
+
},
|
|
3005
|
+
sn(e2) {
|
|
3006
|
+
const n2 = computeIntlDaysInYear.call(this, e2);
|
|
3007
|
+
return n2 > computeIntlDaysInYear.call(this, e2 - 1) && n2 > computeIntlDaysInYear.call(this, e2 + 1);
|
|
3008
|
+
},
|
|
3009
|
+
L: computeIntlLeapMonth,
|
|
3010
|
+
B: computeIntlMonthsInYear,
|
|
3011
|
+
cn(e2, n2) {
|
|
3012
|
+
const t2 = n2 + e2, o2 = Math.sign(e2), r2 = o2 < 0 ? -1 : 0;
|
|
3013
|
+
let i2 = 0;
|
|
3014
|
+
for (let e3 = n2;e3 !== t2; e3 += o2) {
|
|
3015
|
+
i2 += computeIntlMonthsInYear.call(this, e3 + r2);
|
|
3016
|
+
}
|
|
3017
|
+
return i2;
|
|
3018
|
+
},
|
|
3019
|
+
U: computeIntlDaysInMonth,
|
|
3020
|
+
fn: computeIntlDaysInYear,
|
|
3021
|
+
V(e2, n2, t2) {
|
|
3022
|
+
return epochMilliToIso(computeIntlEpochMilli.call(this, e2, n2, t2));
|
|
3023
|
+
},
|
|
3024
|
+
p: computeIntlEpochMilli,
|
|
3025
|
+
un(e2, n2, t2) {
|
|
3026
|
+
if (t2) {
|
|
3027
|
+
if (n2 += t2, !Number.isSafeInteger(n2)) {
|
|
3028
|
+
throw new RangeError(Io);
|
|
3029
|
+
}
|
|
3030
|
+
if (t2 < 0) {
|
|
3031
|
+
for (;n2 < 1; ) {
|
|
3032
|
+
n2 += computeIntlMonthsInYear.call(this, --e2);
|
|
3033
|
+
}
|
|
3034
|
+
} else {
|
|
3035
|
+
let t3;
|
|
3036
|
+
for (;n2 > (t3 = computeIntlMonthsInYear.call(this, e2)); ) {
|
|
3037
|
+
n2 -= t3, e2++;
|
|
3038
|
+
}
|
|
3039
|
+
}
|
|
3040
|
+
}
|
|
3041
|
+
return [e2, n2];
|
|
3042
|
+
},
|
|
3043
|
+
year(e2) {
|
|
3044
|
+
return this.h(e2).year;
|
|
3045
|
+
},
|
|
3046
|
+
month(e2) {
|
|
3047
|
+
const { year: n2, o: t2 } = this.h(e2), { u: o2 } = this.l(n2);
|
|
3048
|
+
return o2[t2] + 1;
|
|
3049
|
+
},
|
|
3050
|
+
day(e2) {
|
|
3051
|
+
return this.h(e2).day;
|
|
3052
|
+
}
|
|
3053
|
+
});
|
|
3054
|
+
var ji = /* @__PURE__ */ createNativeOpsCreator(Ri, Ai);
|
|
3055
|
+
var C = /* @__PURE__ */ createNativeOpsCreator(Ui, Wi);
|
|
3056
|
+
var Li = {
|
|
3057
|
+
...{
|
|
3058
|
+
era: toStringViaPrimitive,
|
|
3059
|
+
eraYear: toInteger,
|
|
3060
|
+
year: toInteger,
|
|
3061
|
+
month: toPositiveInteger,
|
|
3062
|
+
monthCode(e2) {
|
|
3063
|
+
const n2 = toStringViaPrimitive(e2);
|
|
3064
|
+
return parseMonthCode(n2), n2;
|
|
3065
|
+
},
|
|
3066
|
+
day: toPositiveInteger
|
|
3067
|
+
},
|
|
3068
|
+
.../* @__PURE__ */ wo(O, toInteger),
|
|
3069
|
+
.../* @__PURE__ */ wo(p, toStrictInteger),
|
|
3070
|
+
offset(e2) {
|
|
3071
|
+
const n2 = toStringViaPrimitive(e2);
|
|
3072
|
+
return parseOffsetNano(n2), n2;
|
|
3073
|
+
}
|
|
3074
|
+
};
|
|
3075
|
+
var xi = /* @__PURE__ */ Pt(remapProps, O, w);
|
|
3076
|
+
var $i = /* @__PURE__ */ Pt(remapProps, w, O);
|
|
3077
|
+
var Hi = "numeric";
|
|
3078
|
+
var Gi = ["timeZoneName"];
|
|
3079
|
+
var Vi = {
|
|
3080
|
+
month: Hi,
|
|
3081
|
+
day: Hi
|
|
3082
|
+
};
|
|
3083
|
+
var _i = {
|
|
3084
|
+
year: Hi,
|
|
3085
|
+
month: Hi
|
|
3086
|
+
};
|
|
3087
|
+
var Ji = /* @__PURE__ */ Object.assign({}, _i, {
|
|
3088
|
+
day: Hi
|
|
3089
|
+
});
|
|
3090
|
+
var Ki = {
|
|
3091
|
+
hour: Hi,
|
|
3092
|
+
minute: Hi,
|
|
3093
|
+
second: Hi
|
|
3094
|
+
};
|
|
3095
|
+
var Qi = /* @__PURE__ */ Object.assign({}, Ji, Ki);
|
|
3096
|
+
var Xi = /* @__PURE__ */ Object.assign({}, Qi, {
|
|
3097
|
+
timeZoneName: "short"
|
|
3098
|
+
});
|
|
3099
|
+
var ea = /* @__PURE__ */ Object.keys(_i);
|
|
3100
|
+
var na = /* @__PURE__ */ Object.keys(Vi);
|
|
3101
|
+
var ta = /* @__PURE__ */ Object.keys(Ji);
|
|
3102
|
+
var oa = /* @__PURE__ */ Object.keys(Ki);
|
|
3103
|
+
var ra = ["dateStyle"];
|
|
3104
|
+
var ia = /* @__PURE__ */ ea.concat(ra);
|
|
3105
|
+
var aa = /* @__PURE__ */ na.concat(ra);
|
|
3106
|
+
var sa = /* @__PURE__ */ ta.concat(ra, ["weekday"]);
|
|
3107
|
+
var ca = /* @__PURE__ */ oa.concat(["dayPeriod", "timeStyle", "fractionalSecondDigits"]);
|
|
3108
|
+
var ua = /* @__PURE__ */ sa.concat(ca);
|
|
3109
|
+
var fa = /* @__PURE__ */ Gi.concat(ca);
|
|
3110
|
+
var la = /* @__PURE__ */ Gi.concat(sa);
|
|
3111
|
+
var da = /* @__PURE__ */ Gi.concat(["day", "weekday"], ca);
|
|
3112
|
+
var ma = /* @__PURE__ */ Gi.concat(["year", "weekday"], ca);
|
|
3113
|
+
var pa = /* @__PURE__ */ createOptionsTransformer(ua, Qi);
|
|
3114
|
+
var ha = /* @__PURE__ */ createOptionsTransformer(ua, Xi);
|
|
3115
|
+
var ga = /* @__PURE__ */ createOptionsTransformer(ua, Qi, Gi);
|
|
3116
|
+
var Da = /* @__PURE__ */ createOptionsTransformer(sa, Ji, fa);
|
|
3117
|
+
var Ta = /* @__PURE__ */ createOptionsTransformer(ca, Ki, la);
|
|
3118
|
+
var Ia = /* @__PURE__ */ createOptionsTransformer(ia, _i, da);
|
|
3119
|
+
var Ma = /* @__PURE__ */ createOptionsTransformer(aa, Vi, ma);
|
|
3120
|
+
var Na = {};
|
|
3121
|
+
var ya = new en(undefined, {
|
|
3122
|
+
calendar: l
|
|
3123
|
+
}).resolvedOptions().calendar === l;
|
|
3124
|
+
var U = [pa, I];
|
|
3125
|
+
var ot = [ha, I, 0, (e2, n2) => {
|
|
3126
|
+
const t2 = e2.timeZone;
|
|
3127
|
+
if (n2 && n2.timeZone !== t2) {
|
|
3128
|
+
throw new RangeError(mo);
|
|
3129
|
+
}
|
|
3130
|
+
return t2;
|
|
3131
|
+
}];
|
|
3132
|
+
var X = [ga, isoToEpochMilli];
|
|
3133
|
+
var _ = [Da, isoToEpochMilli];
|
|
3134
|
+
var tt = [Ta, (e2) => isoTimeFieldsToNano(e2) / Qe];
|
|
3135
|
+
var et = [Ia, isoToEpochMilli, ya];
|
|
3136
|
+
var nt = [Ma, isoToEpochMilli, ya];
|
|
3137
|
+
var va;
|
|
3138
|
+
|
|
3139
|
+
// node_modules/temporal-polyfill/chunks/classApi.js
|
|
3140
|
+
function createSlotClass(i2, l2, s2, c2, u2) {
|
|
3141
|
+
function Class(...t2) {
|
|
3142
|
+
if (!(this instanceof Class)) {
|
|
3143
|
+
throw new TypeError(a);
|
|
3144
|
+
}
|
|
3145
|
+
un(this, l2(...t2));
|
|
3146
|
+
}
|
|
3147
|
+
function bindMethod(t2, e2) {
|
|
3148
|
+
return Object.defineProperties(function(...e3) {
|
|
3149
|
+
return t2.call(this, getSpecificSlots(this), ...e3);
|
|
3150
|
+
}, r(e2));
|
|
3151
|
+
}
|
|
3152
|
+
function getSpecificSlots(t2) {
|
|
3153
|
+
const e2 = cn(t2);
|
|
3154
|
+
if (!e2 || e2.branding !== i2) {
|
|
3155
|
+
throw new TypeError(a);
|
|
3156
|
+
}
|
|
3157
|
+
return e2;
|
|
3158
|
+
}
|
|
3159
|
+
return Object.defineProperties(Class.prototype, {
|
|
3160
|
+
...t(e(bindMethod, s2)),
|
|
3161
|
+
...n(e(bindMethod, c2)),
|
|
3162
|
+
...o("Temporal." + i2)
|
|
3163
|
+
}), Object.defineProperties(Class, {
|
|
3164
|
+
...n(u2),
|
|
3165
|
+
...r(i2)
|
|
3166
|
+
}), [Class, (t2) => {
|
|
3167
|
+
const e2 = Object.create(Class.prototype);
|
|
3168
|
+
return un(e2, t2), e2;
|
|
3169
|
+
}, getSpecificSlots];
|
|
3170
|
+
}
|
|
3171
|
+
function rejectInvalidBag(t2) {
|
|
3172
|
+
if (cn(t2) || t2.calendar !== undefined || t2.timeZone !== undefined) {
|
|
3173
|
+
throw new TypeError(i);
|
|
3174
|
+
}
|
|
3175
|
+
return t2;
|
|
3176
|
+
}
|
|
3177
|
+
function getCalendarIdFromBag(t2) {
|
|
3178
|
+
return extractCalendarIdFromBag(t2) || l;
|
|
3179
|
+
}
|
|
3180
|
+
function extractCalendarIdFromBag(t2) {
|
|
3181
|
+
const { calendar: e2 } = t2;
|
|
3182
|
+
if (e2 !== undefined) {
|
|
3183
|
+
return refineCalendarArg(e2);
|
|
3184
|
+
}
|
|
3185
|
+
}
|
|
3186
|
+
function refineCalendarArg(t2) {
|
|
3187
|
+
if (s(t2)) {
|
|
3188
|
+
const { calendar: e2 } = cn(t2) || {};
|
|
3189
|
+
if (!e2) {
|
|
3190
|
+
throw new TypeError(c(t2));
|
|
3191
|
+
}
|
|
3192
|
+
return e2;
|
|
3193
|
+
}
|
|
3194
|
+
return ((t3) => u(f(m(t3))))(t2);
|
|
3195
|
+
}
|
|
3196
|
+
function createCalendarGetters(t2) {
|
|
3197
|
+
const e2 = {};
|
|
3198
|
+
for (const n2 in t2) {
|
|
3199
|
+
e2[n2] = (t3) => {
|
|
3200
|
+
const { calendar: e3 } = t3;
|
|
3201
|
+
return C(e3)[n2](t3);
|
|
3202
|
+
};
|
|
3203
|
+
}
|
|
3204
|
+
return e2;
|
|
3205
|
+
}
|
|
3206
|
+
function neverValueOf() {
|
|
3207
|
+
throw new TypeError(b);
|
|
3208
|
+
}
|
|
3209
|
+
function refineTimeZoneArg(t2) {
|
|
3210
|
+
if (s(t2)) {
|
|
3211
|
+
const { timeZone: e2 } = cn(t2) || {};
|
|
3212
|
+
if (!e2) {
|
|
3213
|
+
throw new TypeError(F(t2));
|
|
3214
|
+
}
|
|
3215
|
+
return e2;
|
|
3216
|
+
}
|
|
3217
|
+
return ((t3) => M(Z(m(t3))))(t2);
|
|
3218
|
+
}
|
|
3219
|
+
function toDurationSlots(t2) {
|
|
3220
|
+
if (s(t2)) {
|
|
3221
|
+
const e2 = cn(t2);
|
|
3222
|
+
return e2 && e2.branding === N ? e2 : q(t2);
|
|
3223
|
+
}
|
|
3224
|
+
return R(t2);
|
|
3225
|
+
}
|
|
3226
|
+
function refinePublicRelativeTo(t2) {
|
|
3227
|
+
if (t2 !== undefined) {
|
|
3228
|
+
if (s(t2)) {
|
|
3229
|
+
const e2 = cn(t2) || {};
|
|
3230
|
+
switch (e2.branding) {
|
|
3231
|
+
case z:
|
|
3232
|
+
case G:
|
|
3233
|
+
return e2;
|
|
3234
|
+
case x:
|
|
3235
|
+
return W(e2);
|
|
3236
|
+
}
|
|
3237
|
+
const n2 = getCalendarIdFromBag(t2);
|
|
3238
|
+
return {
|
|
3239
|
+
...$(refineTimeZoneArg, L, C(n2), t2),
|
|
3240
|
+
calendar: n2
|
|
3241
|
+
};
|
|
3242
|
+
}
|
|
3243
|
+
return H(t2);
|
|
3244
|
+
}
|
|
3245
|
+
}
|
|
3246
|
+
function toPlainTimeSlots(t2, e2) {
|
|
3247
|
+
if (s(t2)) {
|
|
3248
|
+
const n3 = cn(t2) || {};
|
|
3249
|
+
switch (n3.branding) {
|
|
3250
|
+
case ft:
|
|
3251
|
+
return mt(e2), n3;
|
|
3252
|
+
case x:
|
|
3253
|
+
return mt(e2), St(n3);
|
|
3254
|
+
case z:
|
|
3255
|
+
return mt(e2), dt(L, n3);
|
|
3256
|
+
}
|
|
3257
|
+
return Tt(t2, e2);
|
|
3258
|
+
}
|
|
3259
|
+
const n2 = ht(t2);
|
|
3260
|
+
return mt(e2), n2;
|
|
3261
|
+
}
|
|
3262
|
+
function optionalToPlainTimeFields(t2) {
|
|
3263
|
+
return t2 === undefined ? undefined : toPlainTimeSlots(t2);
|
|
3264
|
+
}
|
|
3265
|
+
function toPlainDateTimeSlots(t2, e2) {
|
|
3266
|
+
if (s(t2)) {
|
|
3267
|
+
const n3 = cn(t2) || {};
|
|
3268
|
+
switch (n3.branding) {
|
|
3269
|
+
case x:
|
|
3270
|
+
return mt(e2), n3;
|
|
3271
|
+
case G:
|
|
3272
|
+
return mt(e2), jt({
|
|
3273
|
+
...n3,
|
|
3274
|
+
...Nt
|
|
3275
|
+
});
|
|
3276
|
+
case z:
|
|
3277
|
+
return mt(e2), yt(L, n3);
|
|
3278
|
+
}
|
|
3279
|
+
return At(C(getCalendarIdFromBag(t2)), t2, e2);
|
|
3280
|
+
}
|
|
3281
|
+
const n2 = Bt(t2);
|
|
3282
|
+
return mt(e2), n2;
|
|
3283
|
+
}
|
|
3284
|
+
function toPlainMonthDaySlots(t2, e2) {
|
|
3285
|
+
if (s(t2)) {
|
|
3286
|
+
const n3 = cn(t2);
|
|
3287
|
+
if (n3 && n3.branding === qt) {
|
|
3288
|
+
return mt(e2), n3;
|
|
3289
|
+
}
|
|
3290
|
+
const o2 = extractCalendarIdFromBag(t2);
|
|
3291
|
+
return Rt(C(o2 || l), !o2, t2, e2);
|
|
3292
|
+
}
|
|
3293
|
+
const n2 = xt(C, t2);
|
|
3294
|
+
return mt(e2), n2;
|
|
3295
|
+
}
|
|
3296
|
+
function toPlainYearMonthSlots(t2, e2) {
|
|
3297
|
+
if (s(t2)) {
|
|
3298
|
+
const n3 = cn(t2);
|
|
3299
|
+
return n3 && n3.branding === Ut ? (mt(e2), n3) : Xt(C(getCalendarIdFromBag(t2)), t2, e2);
|
|
3300
|
+
}
|
|
3301
|
+
const n2 = _t(C, t2);
|
|
3302
|
+
return mt(e2), n2;
|
|
3303
|
+
}
|
|
3304
|
+
function toPlainDateSlots(t2, e2) {
|
|
3305
|
+
if (s(t2)) {
|
|
3306
|
+
const n3 = cn(t2) || {};
|
|
3307
|
+
switch (n3.branding) {
|
|
3308
|
+
case G:
|
|
3309
|
+
return mt(e2), n3;
|
|
3310
|
+
case x:
|
|
3311
|
+
return mt(e2), W(n3);
|
|
3312
|
+
case z:
|
|
3313
|
+
return mt(e2), fe(L, n3);
|
|
3314
|
+
}
|
|
3315
|
+
return me(C(getCalendarIdFromBag(t2)), t2, e2);
|
|
3316
|
+
}
|
|
3317
|
+
const n2 = de(t2);
|
|
3318
|
+
return mt(e2), n2;
|
|
3319
|
+
}
|
|
3320
|
+
function toZonedDateTimeSlots(t2, e2) {
|
|
3321
|
+
if (s(t2)) {
|
|
3322
|
+
const n2 = cn(t2);
|
|
3323
|
+
if (n2 && n2.branding === z) {
|
|
3324
|
+
return je(e2), n2;
|
|
3325
|
+
}
|
|
3326
|
+
const o2 = getCalendarIdFromBag(t2);
|
|
3327
|
+
return Ne(refineTimeZoneArg, L, C(o2), o2, t2, e2);
|
|
3328
|
+
}
|
|
3329
|
+
return Ae(t2, e2);
|
|
3330
|
+
}
|
|
3331
|
+
function adaptDateMethods(t2) {
|
|
3332
|
+
return e((t3) => (e2) => t3(slotsToIso(e2)), t2);
|
|
3333
|
+
}
|
|
3334
|
+
function slotsToIso(t2) {
|
|
3335
|
+
return he(t2, L);
|
|
3336
|
+
}
|
|
3337
|
+
function toInstantSlots(t2) {
|
|
3338
|
+
if (s(t2)) {
|
|
3339
|
+
const e2 = cn(t2);
|
|
3340
|
+
if (e2) {
|
|
3341
|
+
switch (e2.branding) {
|
|
3342
|
+
case Re:
|
|
3343
|
+
return e2;
|
|
3344
|
+
case z:
|
|
3345
|
+
return xe(e2.epochNanoseconds);
|
|
3346
|
+
}
|
|
3347
|
+
}
|
|
3348
|
+
}
|
|
3349
|
+
return We(t2);
|
|
3350
|
+
}
|
|
3351
|
+
function createDateTimeFormatClass() {
|
|
3352
|
+
function DateTimeFormatFunc(t3, e3) {
|
|
3353
|
+
return new DateTimeFormatNew(t3, e3);
|
|
3354
|
+
}
|
|
3355
|
+
function DateTimeFormatNew(t3, e3 = Object.create(null)) {
|
|
3356
|
+
to.set(this, ((t4, e4) => {
|
|
3357
|
+
const n3 = new en(t4, e4), o2 = n3.resolvedOptions(), r2 = o2.locale, a2 = nn(Object.keys(e4), o2), i2 = on(createFormatPrepperForBranding), prepFormat = (t5, ...e5) => {
|
|
3358
|
+
if (t5) {
|
|
3359
|
+
if (e5.length !== 2) {
|
|
3360
|
+
throw new TypeError(ln);
|
|
3361
|
+
}
|
|
3362
|
+
for (const t6 of e5) {
|
|
3363
|
+
if (t6 === undefined) {
|
|
3364
|
+
throw new TypeError(ln);
|
|
3365
|
+
}
|
|
3366
|
+
}
|
|
3367
|
+
}
|
|
3368
|
+
t5 || e5[0] !== undefined || (e5 = []);
|
|
3369
|
+
const o3 = e5.map((t6) => cn(t6) || Number(t6));
|
|
3370
|
+
let l2, s2 = 0;
|
|
3371
|
+
for (const t6 of o3) {
|
|
3372
|
+
const e6 = typeof t6 == "object" ? t6.branding : undefined;
|
|
3373
|
+
if (s2++ && e6 !== l2) {
|
|
3374
|
+
throw new TypeError(ln);
|
|
3375
|
+
}
|
|
3376
|
+
l2 = e6;
|
|
3377
|
+
}
|
|
3378
|
+
return l2 ? i2(l2)(r2, a2, ...o3) : [n3, ...o3];
|
|
3379
|
+
};
|
|
3380
|
+
return prepFormat.X = n3, prepFormat;
|
|
3381
|
+
})(t3, e3));
|
|
3382
|
+
}
|
|
3383
|
+
const t2 = en.prototype, e2 = Object.getOwnPropertyDescriptors(t2), n2 = Object.getOwnPropertyDescriptors(en);
|
|
3384
|
+
for (const t3 in e2) {
|
|
3385
|
+
const n3 = e2[t3], o2 = t3.startsWith("format") && createFormatMethod(t3);
|
|
3386
|
+
typeof n3.value == "function" ? n3.value = t3 === "constructor" ? DateTimeFormatFunc : o2 || createProxiedMethod(t3) : o2 && (n3.get = function() {
|
|
3387
|
+
if (!to.has(this)) {
|
|
3388
|
+
throw new TypeError(a);
|
|
3389
|
+
}
|
|
3390
|
+
return (...t4) => o2.apply(this, t4);
|
|
3391
|
+
}, Object.defineProperties(n3.get, r(`get ${t3}`)));
|
|
3392
|
+
}
|
|
3393
|
+
return n2.prototype.value = DateTimeFormatNew.prototype = Object.create({}, e2), Object.defineProperties(DateTimeFormatFunc, n2), DateTimeFormatFunc;
|
|
3394
|
+
}
|
|
3395
|
+
function createFormatMethod(t2) {
|
|
3396
|
+
return Object.defineProperties(function(...e2) {
|
|
3397
|
+
const n2 = to.get(this), [o2, ...r2] = n2(t2.includes("Range"), ...e2);
|
|
3398
|
+
return o2[t2](...r2);
|
|
3399
|
+
}, r(t2));
|
|
3400
|
+
}
|
|
3401
|
+
function createProxiedMethod(t2) {
|
|
3402
|
+
return Object.defineProperties(function(...e2) {
|
|
3403
|
+
return to.get(this).X[t2](...e2);
|
|
3404
|
+
}, r(t2));
|
|
3405
|
+
}
|
|
3406
|
+
function createFormatPrepperForBranding(t2) {
|
|
3407
|
+
const e2 = Cn[t2];
|
|
3408
|
+
if (!e2) {
|
|
3409
|
+
throw new TypeError(rn(t2));
|
|
3410
|
+
}
|
|
3411
|
+
return Q(e2, on(an), 1);
|
|
3412
|
+
}
|
|
3413
|
+
var sn = /* @__PURE__ */ new WeakMap;
|
|
3414
|
+
var cn = /* @__PURE__ */ sn.get.bind(sn);
|
|
3415
|
+
var un = /* @__PURE__ */ sn.set.bind(sn);
|
|
3416
|
+
var fn = {
|
|
3417
|
+
era: d,
|
|
3418
|
+
eraYear: S,
|
|
3419
|
+
year: T,
|
|
3420
|
+
month: h,
|
|
3421
|
+
daysInMonth: h,
|
|
3422
|
+
daysInYear: h,
|
|
3423
|
+
inLeapYear: D,
|
|
3424
|
+
monthsInYear: h
|
|
3425
|
+
};
|
|
3426
|
+
var mn = {
|
|
3427
|
+
monthCode: m
|
|
3428
|
+
};
|
|
3429
|
+
var dn = {
|
|
3430
|
+
day: h
|
|
3431
|
+
};
|
|
3432
|
+
var Sn = {
|
|
3433
|
+
dayOfWeek: h,
|
|
3434
|
+
dayOfYear: h,
|
|
3435
|
+
weekOfYear: P,
|
|
3436
|
+
yearOfWeek: S,
|
|
3437
|
+
daysInWeek: h
|
|
3438
|
+
};
|
|
3439
|
+
var Tn = /* @__PURE__ */ createCalendarGetters(/* @__PURE__ */ Object.assign({}, fn, mn, dn, Sn));
|
|
3440
|
+
var hn = /* @__PURE__ */ createCalendarGetters({
|
|
3441
|
+
...fn,
|
|
3442
|
+
...mn
|
|
3443
|
+
});
|
|
3444
|
+
var Dn = /* @__PURE__ */ createCalendarGetters({
|
|
3445
|
+
...mn,
|
|
3446
|
+
...dn
|
|
3447
|
+
});
|
|
3448
|
+
var Pn = {
|
|
3449
|
+
calendarId: (t2) => t2.calendar
|
|
3450
|
+
};
|
|
3451
|
+
var gn = /* @__PURE__ */ g((t2) => (e2) => e2[t2], p.concat("sign"));
|
|
3452
|
+
var pn = /* @__PURE__ */ g((t2, e2) => (t3) => t3[w[e2]], O);
|
|
3453
|
+
var On = {
|
|
3454
|
+
epochMilliseconds: I,
|
|
3455
|
+
epochNanoseconds: v
|
|
3456
|
+
};
|
|
3457
|
+
var [wn, In, vn] = createSlotClass(N, j, {
|
|
3458
|
+
...gn,
|
|
3459
|
+
blank: y
|
|
3460
|
+
}, {
|
|
3461
|
+
with: (t2, e2) => In(A(t2, e2)),
|
|
3462
|
+
negated: (t2) => In(B(t2)),
|
|
3463
|
+
abs: (t2) => In(Y(t2)),
|
|
3464
|
+
add: (t2, e2, n2) => In(E(refinePublicRelativeTo, C, L, 0, t2, toDurationSlots(e2), n2)),
|
|
3465
|
+
subtract: (t2, e2, n2) => In(E(refinePublicRelativeTo, C, L, 1, t2, toDurationSlots(e2), n2)),
|
|
3466
|
+
round: (t2, e2) => In(V(refinePublicRelativeTo, C, L, t2, e2)),
|
|
3467
|
+
total: (t2, e2) => J(refinePublicRelativeTo, C, L, t2, e2),
|
|
3468
|
+
toLocaleString(t2, e2, n2) {
|
|
3469
|
+
return Intl.DurationFormat ? new Intl.DurationFormat(e2, n2).format(this) : k(t2);
|
|
3470
|
+
},
|
|
3471
|
+
toString: k,
|
|
3472
|
+
toJSON: (t2) => k(t2),
|
|
3473
|
+
valueOf: neverValueOf
|
|
3474
|
+
}, {
|
|
3475
|
+
from: (t2) => In(toDurationSlots(t2)),
|
|
3476
|
+
compare: (t2, e2, n2) => K(refinePublicRelativeTo, C, L, toDurationSlots(t2), toDurationSlots(e2), n2)
|
|
3477
|
+
});
|
|
3478
|
+
var Cn = {
|
|
3479
|
+
Instant: U,
|
|
3480
|
+
PlainDateTime: X,
|
|
3481
|
+
PlainDate: _,
|
|
3482
|
+
PlainTime: tt,
|
|
3483
|
+
PlainYearMonth: et,
|
|
3484
|
+
PlainMonthDay: nt
|
|
3485
|
+
};
|
|
3486
|
+
var bn = /* @__PURE__ */ Q(U);
|
|
3487
|
+
var Fn = /* @__PURE__ */ Q(ot);
|
|
3488
|
+
var Mn = /* @__PURE__ */ Q(X);
|
|
3489
|
+
var Zn = /* @__PURE__ */ Q(_);
|
|
3490
|
+
var yn = /* @__PURE__ */ Q(tt);
|
|
3491
|
+
var jn = /* @__PURE__ */ Q(et);
|
|
3492
|
+
var Nn = /* @__PURE__ */ Q(nt);
|
|
3493
|
+
var [An, Bn] = createSlotClass(ft, ut, pn, {
|
|
3494
|
+
with(t2, e2, n2) {
|
|
3495
|
+
return Bn(rt(this, rejectInvalidBag(e2), n2));
|
|
3496
|
+
},
|
|
3497
|
+
add: (t2, e2) => Bn(at(0, t2, toDurationSlots(e2))),
|
|
3498
|
+
subtract: (t2, e2) => Bn(at(1, t2, toDurationSlots(e2))),
|
|
3499
|
+
until: (t2, e2, n2) => In(it(0, t2, toPlainTimeSlots(e2), n2)),
|
|
3500
|
+
since: (t2, e2, n2) => In(it(1, t2, toPlainTimeSlots(e2), n2)),
|
|
3501
|
+
round: (t2, e2) => Bn(lt(t2, e2)),
|
|
3502
|
+
equals: (t2, e2) => st(t2, toPlainTimeSlots(e2)),
|
|
3503
|
+
toLocaleString(t2, e2, n2) {
|
|
3504
|
+
const [o2, r2] = yn(e2, n2, t2);
|
|
3505
|
+
return o2.format(r2);
|
|
3506
|
+
},
|
|
3507
|
+
toString: ct,
|
|
3508
|
+
toJSON: (t2) => ct(t2),
|
|
3509
|
+
valueOf: neverValueOf
|
|
3510
|
+
}, {
|
|
3511
|
+
from: (t2, e2) => Bn(toPlainTimeSlots(t2, e2)),
|
|
3512
|
+
compare: (t2, e2) => Dt(toPlainTimeSlots(t2), toPlainTimeSlots(e2))
|
|
3513
|
+
});
|
|
3514
|
+
var [Yn, En] = createSlotClass(x, Pt(Zt, Mt), {
|
|
3515
|
+
...Pn,
|
|
3516
|
+
...Tn,
|
|
3517
|
+
...pn
|
|
3518
|
+
}, {
|
|
3519
|
+
with: (t2, e2, n2) => En(gt(C, t2, rejectInvalidBag(e2), n2)),
|
|
3520
|
+
withCalendar: (t2, e2) => En(pt(t2, refineCalendarArg(e2))),
|
|
3521
|
+
withPlainTime: (t2, e2) => En(Ot(t2, optionalToPlainTimeFields(e2))),
|
|
3522
|
+
add: (t2, e2, n2) => En(wt(C, 0, t2, toDurationSlots(e2), n2)),
|
|
3523
|
+
subtract: (t2, e2, n2) => En(wt(C, 1, t2, toDurationSlots(e2), n2)),
|
|
3524
|
+
until: (t2, e2, n2) => In(It(C, 0, t2, toPlainDateTimeSlots(e2), n2)),
|
|
3525
|
+
since: (t2, e2, n2) => In(It(C, 1, t2, toPlainDateTimeSlots(e2), n2)),
|
|
3526
|
+
round: (t2, e2) => En(vt(t2, e2)),
|
|
3527
|
+
equals: (t2, e2) => Ct(t2, toPlainDateTimeSlots(e2)),
|
|
3528
|
+
toZonedDateTime: (t2, e2, n2) => $n(bt(L, t2, refineTimeZoneArg(e2), n2)),
|
|
3529
|
+
toPlainDate: (t2) => Wn(W(t2)),
|
|
3530
|
+
toPlainTime: (t2) => Bn(St(t2)),
|
|
3531
|
+
toLocaleString(t2, e2, n2) {
|
|
3532
|
+
const [o2, r2] = Mn(e2, n2, t2);
|
|
3533
|
+
return o2.format(r2);
|
|
3534
|
+
},
|
|
3535
|
+
toString: Ft,
|
|
3536
|
+
toJSON: (t2) => Ft(t2),
|
|
3537
|
+
valueOf: neverValueOf
|
|
3538
|
+
}, {
|
|
3539
|
+
from: (t2, e2) => En(toPlainDateTimeSlots(t2, e2)),
|
|
3540
|
+
compare: (t2, e2) => Yt(toPlainDateTimeSlots(t2), toPlainDateTimeSlots(e2))
|
|
3541
|
+
});
|
|
3542
|
+
var [Ln, Vn, Jn] = createSlotClass(qt, Pt(kt, Mt), {
|
|
3543
|
+
...Pn,
|
|
3544
|
+
...Dn
|
|
3545
|
+
}, {
|
|
3546
|
+
with: (t2, e2, n2) => Vn(Et(C, t2, rejectInvalidBag(e2), n2)),
|
|
3547
|
+
equals: (t2, e2) => Lt(t2, toPlainMonthDaySlots(e2)),
|
|
3548
|
+
toPlainDate(t2, e2) {
|
|
3549
|
+
return Wn(Vt(C, t2, this, e2));
|
|
3550
|
+
},
|
|
3551
|
+
toLocaleString(t2, e2, n2) {
|
|
3552
|
+
const [o2, r2] = Nn(e2, n2, t2);
|
|
3553
|
+
return o2.format(r2);
|
|
3554
|
+
},
|
|
3555
|
+
toString: Jt,
|
|
3556
|
+
toJSON: (t2) => Jt(t2),
|
|
3557
|
+
valueOf: neverValueOf
|
|
3558
|
+
}, {
|
|
3559
|
+
from: (t2, e2) => Vn(toPlainMonthDaySlots(t2, e2))
|
|
3560
|
+
});
|
|
3561
|
+
var [kn, qn, Rn] = createSlotClass(Ut, Pt(Qt, Mt), {
|
|
3562
|
+
...Pn,
|
|
3563
|
+
...hn
|
|
3564
|
+
}, {
|
|
3565
|
+
with: (t2, e2, n2) => qn(Wt(C, t2, rejectInvalidBag(e2), n2)),
|
|
3566
|
+
add: (t2, e2, n2) => qn(Gt(C, 0, t2, toDurationSlots(e2), n2)),
|
|
3567
|
+
subtract: (t2, e2, n2) => qn(Gt(C, 1, t2, toDurationSlots(e2), n2)),
|
|
3568
|
+
until: (t2, e2, n2) => In(zt(C, 0, t2, toPlainYearMonthSlots(e2), n2)),
|
|
3569
|
+
since: (t2, e2, n2) => In(zt(C, 1, t2, toPlainYearMonthSlots(e2), n2)),
|
|
3570
|
+
equals: (t2, e2) => $t(t2, toPlainYearMonthSlots(e2)),
|
|
3571
|
+
toPlainDate(t2, e2) {
|
|
3572
|
+
return Wn(Ht(C, t2, this, e2));
|
|
3573
|
+
},
|
|
3574
|
+
toLocaleString(t2, e2, n2) {
|
|
3575
|
+
const [o2, r2] = jn(e2, n2, t2);
|
|
3576
|
+
return o2.format(r2);
|
|
3577
|
+
},
|
|
3578
|
+
toString: Kt,
|
|
3579
|
+
toJSON: (t2) => Kt(t2),
|
|
3580
|
+
valueOf: neverValueOf
|
|
3581
|
+
}, {
|
|
3582
|
+
from: (t2, e2) => qn(toPlainYearMonthSlots(t2, e2)),
|
|
3583
|
+
compare: (t2, e2) => te(toPlainYearMonthSlots(t2), toPlainYearMonthSlots(e2))
|
|
3584
|
+
});
|
|
3585
|
+
var [xn, Wn, Gn] = createSlotClass(G, Pt(ue, Mt), {
|
|
3586
|
+
...Pn,
|
|
3587
|
+
...Tn
|
|
3588
|
+
}, {
|
|
3589
|
+
with: (t2, e2, n2) => Wn(ee(C, t2, rejectInvalidBag(e2), n2)),
|
|
3590
|
+
withCalendar: (t2, e2) => Wn(pt(t2, refineCalendarArg(e2))),
|
|
3591
|
+
add: (t2, e2, n2) => Wn(ne(C, 0, t2, toDurationSlots(e2), n2)),
|
|
3592
|
+
subtract: (t2, e2, n2) => Wn(ne(C, 1, t2, toDurationSlots(e2), n2)),
|
|
3593
|
+
until: (t2, e2, n2) => In(oe(C, 0, t2, toPlainDateSlots(e2), n2)),
|
|
3594
|
+
since: (t2, e2, n2) => In(oe(C, 1, t2, toPlainDateSlots(e2), n2)),
|
|
3595
|
+
equals: (t2, e2) => re(t2, toPlainDateSlots(e2)),
|
|
3596
|
+
toZonedDateTime(t2, e2) {
|
|
3597
|
+
const n2 = s(e2) ? e2 : {
|
|
3598
|
+
timeZone: e2
|
|
3599
|
+
};
|
|
3600
|
+
return $n(ae(refineTimeZoneArg, toPlainTimeSlots, L, t2, n2));
|
|
3601
|
+
},
|
|
3602
|
+
toPlainDateTime: (t2, e2) => En(ie(t2, optionalToPlainTimeFields(e2))),
|
|
3603
|
+
toPlainYearMonth(t2) {
|
|
3604
|
+
return qn(le(C, t2, this));
|
|
3605
|
+
},
|
|
3606
|
+
toPlainMonthDay(t2) {
|
|
3607
|
+
return Vn(se(C, t2, this));
|
|
3608
|
+
},
|
|
3609
|
+
toLocaleString(t2, e2, n2) {
|
|
3610
|
+
const [o2, r2] = Zn(e2, n2, t2);
|
|
3611
|
+
return o2.format(r2);
|
|
3612
|
+
},
|
|
3613
|
+
toString: ce,
|
|
3614
|
+
toJSON: (t2) => ce(t2),
|
|
3615
|
+
valueOf: neverValueOf
|
|
3616
|
+
}, {
|
|
3617
|
+
from: (t2, e2) => Wn(toPlainDateSlots(t2, e2)),
|
|
3618
|
+
compare: (t2, e2) => te(toPlainDateSlots(t2), toPlainDateSlots(e2))
|
|
3619
|
+
});
|
|
3620
|
+
var [zn, $n] = createSlotClass(z, Pt(ye, Mt, Ze), {
|
|
3621
|
+
...On,
|
|
3622
|
+
...Pn,
|
|
3623
|
+
...adaptDateMethods(Tn),
|
|
3624
|
+
...adaptDateMethods(pn),
|
|
3625
|
+
offset: (t2) => Se(slotsToIso(t2).offsetNanoseconds),
|
|
3626
|
+
offsetNanoseconds: (t2) => slotsToIso(t2).offsetNanoseconds,
|
|
3627
|
+
timeZoneId: (t2) => t2.timeZone,
|
|
3628
|
+
hoursInDay: (t2) => Te(L, t2)
|
|
3629
|
+
}, {
|
|
3630
|
+
with: (t2, e2, n2) => $n(De(C, L, t2, rejectInvalidBag(e2), n2)),
|
|
3631
|
+
withCalendar: (t2, e2) => $n(pt(t2, refineCalendarArg(e2))),
|
|
3632
|
+
withTimeZone: (t2, e2) => $n(Pe(t2, refineTimeZoneArg(e2))),
|
|
3633
|
+
withPlainTime: (t2, e2) => $n(ge(L, t2, optionalToPlainTimeFields(e2))),
|
|
3634
|
+
add: (t2, e2, n2) => $n(pe(C, L, 0, t2, toDurationSlots(e2), n2)),
|
|
3635
|
+
subtract: (t2, e2, n2) => $n(pe(C, L, 1, t2, toDurationSlots(e2), n2)),
|
|
3636
|
+
until: (t2, e2, n2) => In(Oe(we(C, L, 0, t2, toZonedDateTimeSlots(e2), n2))),
|
|
3637
|
+
since: (t2, e2, n2) => In(Oe(we(C, L, 1, t2, toZonedDateTimeSlots(e2), n2))),
|
|
3638
|
+
round: (t2, e2) => $n(Ie(L, t2, e2)),
|
|
3639
|
+
startOfDay: (t2) => $n(ve(L, t2)),
|
|
3640
|
+
equals: (t2, e2) => Ce(t2, toZonedDateTimeSlots(e2)),
|
|
3641
|
+
toInstant: (t2) => Kn(be(t2)),
|
|
3642
|
+
toPlainDateTime: (t2) => En(yt(L, t2)),
|
|
3643
|
+
toPlainDate: (t2) => Wn(fe(L, t2)),
|
|
3644
|
+
toPlainTime: (t2) => Bn(dt(L, t2)),
|
|
3645
|
+
toLocaleString(t2, e2, n2 = {}) {
|
|
3646
|
+
const [o2, r2] = Fn(e2, n2, t2);
|
|
3647
|
+
return o2.format(r2);
|
|
3648
|
+
},
|
|
3649
|
+
toString: (t2, e2) => Fe(L, t2, e2),
|
|
3650
|
+
toJSON: (t2) => Fe(L, t2),
|
|
3651
|
+
valueOf: neverValueOf,
|
|
3652
|
+
getTimeZoneTransition(t2, e2) {
|
|
3653
|
+
const { timeZone: n2, epochNanoseconds: o2 } = t2, r2 = Me(e2), a2 = L(n2).O(o2, r2);
|
|
3654
|
+
return a2 ? $n({
|
|
3655
|
+
...t2,
|
|
3656
|
+
epochNanoseconds: a2
|
|
3657
|
+
}) : null;
|
|
3658
|
+
}
|
|
3659
|
+
}, {
|
|
3660
|
+
from: (t2, e2) => $n(toZonedDateTimeSlots(t2, e2)),
|
|
3661
|
+
compare: (t2, e2) => Be(toZonedDateTimeSlots(t2), toZonedDateTimeSlots(e2))
|
|
3662
|
+
});
|
|
3663
|
+
var [Hn, Kn, Qn] = createSlotClass(Re, qe, On, {
|
|
3664
|
+
add: (t2, e2) => Kn(Ye(0, t2, toDurationSlots(e2))),
|
|
3665
|
+
subtract: (t2, e2) => Kn(Ye(1, t2, toDurationSlots(e2))),
|
|
3666
|
+
until: (t2, e2, n2) => In(Ee(0, t2, toInstantSlots(e2), n2)),
|
|
3667
|
+
since: (t2, e2, n2) => In(Ee(1, t2, toInstantSlots(e2), n2)),
|
|
3668
|
+
round: (t2, e2) => Kn(Le(t2, e2)),
|
|
3669
|
+
equals: (t2, e2) => Ve(t2, toInstantSlots(e2)),
|
|
3670
|
+
toZonedDateTimeISO: (t2, e2) => $n(Je(t2, refineTimeZoneArg(e2))),
|
|
3671
|
+
toLocaleString(t2, e2, n2) {
|
|
3672
|
+
const [o2, r2] = bn(e2, n2, t2);
|
|
3673
|
+
return o2.format(r2);
|
|
3674
|
+
},
|
|
3675
|
+
toString: (t2, e2) => ke(refineTimeZoneArg, L, t2, e2),
|
|
3676
|
+
toJSON: (t2) => ke(refineTimeZoneArg, L, t2),
|
|
3677
|
+
valueOf: neverValueOf
|
|
3678
|
+
}, {
|
|
3679
|
+
from: (t2) => Kn(toInstantSlots(t2)),
|
|
3680
|
+
fromEpochMilliseconds: (t2) => Kn($e(t2)),
|
|
3681
|
+
fromEpochNanoseconds: (t2) => Kn(He(t2)),
|
|
3682
|
+
compare: (t2, e2) => Ke(toInstantSlots(t2), toInstantSlots(e2))
|
|
3683
|
+
});
|
|
3684
|
+
var Un = /* @__PURE__ */ Object.defineProperties({}, {
|
|
3685
|
+
...o("Temporal.Now"),
|
|
3686
|
+
...n({
|
|
3687
|
+
timeZoneId: () => Ue(),
|
|
3688
|
+
instant: () => Kn(xe(Xe())),
|
|
3689
|
+
zonedDateTimeISO: (t2 = Ue()) => $n(_e(Xe(), refineTimeZoneArg(t2), l)),
|
|
3690
|
+
plainDateTimeISO: (t2 = Ue()) => En(jt(tn(L(refineTimeZoneArg(t2))), l)),
|
|
3691
|
+
plainDateISO: (t2 = Ue()) => Wn(W(tn(L(refineTimeZoneArg(t2))), l)),
|
|
3692
|
+
plainTimeISO: (t2 = Ue()) => Bn(St(tn(L(refineTimeZoneArg(t2)))))
|
|
3693
|
+
})
|
|
3694
|
+
});
|
|
3695
|
+
var Xn = /* @__PURE__ */ Object.defineProperties({}, {
|
|
3696
|
+
...o("Temporal"),
|
|
3697
|
+
...n({
|
|
3698
|
+
PlainYearMonth: kn,
|
|
3699
|
+
PlainMonthDay: Ln,
|
|
3700
|
+
PlainDate: xn,
|
|
3701
|
+
PlainTime: An,
|
|
3702
|
+
PlainDateTime: Yn,
|
|
3703
|
+
ZonedDateTime: zn,
|
|
3704
|
+
Instant: Hn,
|
|
3705
|
+
Duration: wn,
|
|
3706
|
+
Now: Un
|
|
3707
|
+
})
|
|
3708
|
+
});
|
|
3709
|
+
var _n = /* @__PURE__ */ createDateTimeFormatClass();
|
|
3710
|
+
var to = /* @__PURE__ */ new WeakMap;
|
|
3711
|
+
var eo = /* @__PURE__ */ Object.defineProperties(Object.create(Intl), n({
|
|
3712
|
+
DateTimeFormat: _n
|
|
3713
|
+
}));
|
|
3714
|
+
// node_modules/@absurd-sqlite/sdk/dist/absurd.js
|
|
8
3715
|
class SuspendTask extends Error {
|
|
9
3716
|
constructor() {
|
|
10
3717
|
super("Task suspended");
|
|
@@ -100,27 +3807,29 @@ class TaskContext {
|
|
|
100
3807
|
}
|
|
101
3808
|
return new TaskContext(log, taskID, con, queueName, task, cache, claimTimeout, leaseTimer);
|
|
102
3809
|
}
|
|
103
|
-
async step(name,
|
|
3810
|
+
async step(name, fn2) {
|
|
104
3811
|
const checkpointName = this.getCheckpointName(name);
|
|
105
3812
|
const state = await this.lookupCheckpoint(checkpointName);
|
|
106
3813
|
if (state !== undefined) {
|
|
107
3814
|
return state;
|
|
108
3815
|
}
|
|
109
|
-
const rv = await
|
|
3816
|
+
const rv = await fn2();
|
|
110
3817
|
await this.persistCheckpoint(checkpointName, rv);
|
|
111
3818
|
return rv;
|
|
112
3819
|
}
|
|
113
3820
|
async sleepFor(stepName, duration) {
|
|
114
|
-
|
|
3821
|
+
const now = Xn.Now.instant();
|
|
3822
|
+
const wakeAt = now.add(duration);
|
|
3823
|
+
return await this.sleepUntil(stepName, wakeAt);
|
|
115
3824
|
}
|
|
116
3825
|
async sleepUntil(stepName, wakeAt) {
|
|
117
3826
|
const checkpointName = this.getCheckpointName(stepName);
|
|
118
3827
|
const state = await this.lookupCheckpoint(checkpointName);
|
|
119
|
-
const actualWakeAt = typeof state === "string" ?
|
|
3828
|
+
const actualWakeAt = typeof state === "string" ? Xn.Instant.from(state) : wakeAt;
|
|
120
3829
|
if (!state) {
|
|
121
|
-
await this.persistCheckpoint(checkpointName, wakeAt.
|
|
3830
|
+
await this.persistCheckpoint(checkpointName, wakeAt.toString());
|
|
122
3831
|
}
|
|
123
|
-
if (
|
|
3832
|
+
if (Xn.Instant.compare(Xn.Now.instant(), actualWakeAt) < 0) {
|
|
124
3833
|
await this.scheduleRun(actualWakeAt);
|
|
125
3834
|
throw new SuspendTask;
|
|
126
3835
|
}
|
|
@@ -166,8 +3875,8 @@ class TaskContext {
|
|
|
166
3875
|
async awaitEvent(eventName, options) {
|
|
167
3876
|
const stepName = options?.stepName || `$awaitEvent:${eventName}`;
|
|
168
3877
|
let timeout = null;
|
|
169
|
-
if (options?.timeout !== undefined
|
|
170
|
-
timeout = Math.floor(options
|
|
3878
|
+
if (options?.timeout !== undefined) {
|
|
3879
|
+
timeout = Math.floor(options.timeout.total("seconds"));
|
|
171
3880
|
}
|
|
172
3881
|
const checkpointName = this.getCheckpointName(stepName);
|
|
173
3882
|
const cached = await this.lookupCheckpoint(checkpointName);
|
|
@@ -567,10 +4276,10 @@ function normalizeCancellation(policy) {
|
|
|
567
4276
|
}
|
|
568
4277
|
const normalized = {};
|
|
569
4278
|
if (policy.maxDuration !== undefined) {
|
|
570
|
-
normalized.max_duration = policy.maxDuration;
|
|
4279
|
+
normalized.max_duration = Math.floor(policy.maxDuration.total("seconds"));
|
|
571
4280
|
}
|
|
572
4281
|
if (policy.maxDelay !== undefined) {
|
|
573
|
-
normalized.max_delay = policy.maxDelay;
|
|
4282
|
+
normalized.max_delay = Math.floor(policy.maxDelay.total("seconds"));
|
|
574
4283
|
}
|
|
575
4284
|
return Object.keys(normalized).length > 0 ? normalized : undefined;
|
|
576
4285
|
}
|
|
@@ -804,8 +4513,8 @@ function decodeColumnValue(args) {
|
|
|
804
4513
|
try {
|
|
805
4514
|
rv = JSON.parse(value);
|
|
806
4515
|
isValidJSON = true;
|
|
807
|
-
} catch (
|
|
808
|
-
verbose?.(`Failed to decode string column ${columnName} as JSON`,
|
|
4516
|
+
} catch (e2) {
|
|
4517
|
+
verbose?.(`Failed to decode string column ${columnName} as JSON`, e2);
|
|
809
4518
|
rv = value;
|
|
810
4519
|
}
|
|
811
4520
|
if (isValidJSON) {
|
|
@@ -820,20 +4529,29 @@ function decodeColumnValue(args) {
|
|
|
820
4529
|
if (columnTypeName === "blob") {
|
|
821
4530
|
try {
|
|
822
4531
|
return JSON.parse(value.toString());
|
|
823
|
-
} catch (
|
|
824
|
-
verbose?.(`Failed to decode BLOB column ${columnName} as JSON`,
|
|
825
|
-
throw
|
|
4532
|
+
} catch (e2) {
|
|
4533
|
+
verbose?.(`Failed to decode BLOB column ${columnName} as JSON`, e2);
|
|
4534
|
+
throw e2;
|
|
826
4535
|
}
|
|
827
4536
|
}
|
|
828
4537
|
if (columnTypeName === "datetime") {
|
|
829
|
-
if (typeof value
|
|
830
|
-
|
|
4538
|
+
if (typeof value === "string") {
|
|
4539
|
+
return Xn.Instant.from(value);
|
|
4540
|
+
}
|
|
4541
|
+
if (typeof value === "number") {
|
|
4542
|
+
return Xn.Instant.fromEpochMilliseconds(value);
|
|
831
4543
|
}
|
|
832
|
-
|
|
4544
|
+
throw new Error(`Expected datetime column ${columnName} to be a string or number, got ${typeof value}`);
|
|
833
4545
|
}
|
|
834
4546
|
return value;
|
|
835
4547
|
}
|
|
836
4548
|
function encodeColumnValue(value) {
|
|
4549
|
+
if (value instanceof Xn.Instant) {
|
|
4550
|
+
return value.toString();
|
|
4551
|
+
}
|
|
4552
|
+
if (value instanceof Xn.Duration) {
|
|
4553
|
+
return value.toString();
|
|
4554
|
+
}
|
|
837
4555
|
if (value instanceof Date) {
|
|
838
4556
|
return value.toISOString();
|
|
839
4557
|
}
|
|
@@ -886,14 +4604,14 @@ function toArr(any) {
|
|
|
886
4604
|
return any == null ? [] : Array.isArray(any) ? any : [any];
|
|
887
4605
|
}
|
|
888
4606
|
function toVal(out, key, val, opts) {
|
|
889
|
-
var
|
|
4607
|
+
var x2, old = out[key], nxt = ~opts.string.indexOf(key) ? val == null || val === true ? "" : String(val) : typeof val === "boolean" ? val : ~opts.boolean.indexOf(key) ? val === "false" ? false : val === "true" || (out._.push((x2 = +val, x2 * 0 === 0) ? x2 : val), !!val) : (x2 = +val, x2 * 0 === 0) ? x2 : val;
|
|
890
4608
|
out[key] = old == null ? nxt : Array.isArray(old) ? old.concat(nxt) : [old, nxt];
|
|
891
4609
|
}
|
|
892
4610
|
function mri2(args, opts) {
|
|
893
4611
|
args = args || [];
|
|
894
4612
|
opts = opts || {};
|
|
895
|
-
var
|
|
896
|
-
var
|
|
4613
|
+
var k2, arr, arg, name, val, out = { _: [] };
|
|
4614
|
+
var i2 = 0, j2 = 0, idx = 0, len = args.length;
|
|
897
4615
|
const alibi = opts.alias !== undefined;
|
|
898
4616
|
const strict = opts.unknown !== undefined;
|
|
899
4617
|
const defaults = opts.default !== undefined;
|
|
@@ -901,89 +4619,89 @@ function mri2(args, opts) {
|
|
|
901
4619
|
opts.string = toArr(opts.string);
|
|
902
4620
|
opts.boolean = toArr(opts.boolean);
|
|
903
4621
|
if (alibi) {
|
|
904
|
-
for (
|
|
905
|
-
arr = opts.alias[
|
|
906
|
-
for (
|
|
907
|
-
(opts.alias[arr[
|
|
4622
|
+
for (k2 in opts.alias) {
|
|
4623
|
+
arr = opts.alias[k2] = toArr(opts.alias[k2]);
|
|
4624
|
+
for (i2 = 0;i2 < arr.length; i2++) {
|
|
4625
|
+
(opts.alias[arr[i2]] = arr.concat(k2)).splice(i2, 1);
|
|
908
4626
|
}
|
|
909
4627
|
}
|
|
910
4628
|
}
|
|
911
|
-
for (
|
|
912
|
-
arr = opts.alias[opts.boolean[
|
|
913
|
-
for (
|
|
914
|
-
opts.boolean.push(arr[
|
|
4629
|
+
for (i2 = opts.boolean.length;i2-- > 0; ) {
|
|
4630
|
+
arr = opts.alias[opts.boolean[i2]] || [];
|
|
4631
|
+
for (j2 = arr.length;j2-- > 0; )
|
|
4632
|
+
opts.boolean.push(arr[j2]);
|
|
915
4633
|
}
|
|
916
|
-
for (
|
|
917
|
-
arr = opts.alias[opts.string[
|
|
918
|
-
for (
|
|
919
|
-
opts.string.push(arr[
|
|
4634
|
+
for (i2 = opts.string.length;i2-- > 0; ) {
|
|
4635
|
+
arr = opts.alias[opts.string[i2]] || [];
|
|
4636
|
+
for (j2 = arr.length;j2-- > 0; )
|
|
4637
|
+
opts.string.push(arr[j2]);
|
|
920
4638
|
}
|
|
921
4639
|
if (defaults) {
|
|
922
|
-
for (
|
|
923
|
-
name = typeof opts.default[
|
|
924
|
-
arr = opts.alias[
|
|
4640
|
+
for (k2 in opts.default) {
|
|
4641
|
+
name = typeof opts.default[k2];
|
|
4642
|
+
arr = opts.alias[k2] = opts.alias[k2] || [];
|
|
925
4643
|
if (opts[name] !== undefined) {
|
|
926
|
-
opts[name].push(
|
|
927
|
-
for (
|
|
928
|
-
opts[name].push(arr[
|
|
4644
|
+
opts[name].push(k2);
|
|
4645
|
+
for (i2 = 0;i2 < arr.length; i2++) {
|
|
4646
|
+
opts[name].push(arr[i2]);
|
|
929
4647
|
}
|
|
930
4648
|
}
|
|
931
4649
|
}
|
|
932
4650
|
}
|
|
933
4651
|
const keys = strict ? Object.keys(opts.alias) : [];
|
|
934
|
-
for (
|
|
935
|
-
arg = args[
|
|
4652
|
+
for (i2 = 0;i2 < len; i2++) {
|
|
4653
|
+
arg = args[i2];
|
|
936
4654
|
if (arg === "--") {
|
|
937
|
-
out._ = out._.concat(args.slice(++
|
|
4655
|
+
out._ = out._.concat(args.slice(++i2));
|
|
938
4656
|
break;
|
|
939
4657
|
}
|
|
940
|
-
for (
|
|
941
|
-
if (arg.charCodeAt(
|
|
4658
|
+
for (j2 = 0;j2 < arg.length; j2++) {
|
|
4659
|
+
if (arg.charCodeAt(j2) !== 45)
|
|
942
4660
|
break;
|
|
943
4661
|
}
|
|
944
|
-
if (
|
|
4662
|
+
if (j2 === 0) {
|
|
945
4663
|
out._.push(arg);
|
|
946
|
-
} else if (arg.substring(
|
|
947
|
-
name = arg.substring(
|
|
4664
|
+
} else if (arg.substring(j2, j2 + 3) === "no-") {
|
|
4665
|
+
name = arg.substring(j2 + 3);
|
|
948
4666
|
if (strict && !~keys.indexOf(name)) {
|
|
949
4667
|
return opts.unknown(arg);
|
|
950
4668
|
}
|
|
951
4669
|
out[name] = false;
|
|
952
4670
|
} else {
|
|
953
|
-
for (idx =
|
|
4671
|
+
for (idx = j2 + 1;idx < arg.length; idx++) {
|
|
954
4672
|
if (arg.charCodeAt(idx) === 61)
|
|
955
4673
|
break;
|
|
956
4674
|
}
|
|
957
|
-
name = arg.substring(
|
|
958
|
-
val = arg.substring(++idx) || (
|
|
959
|
-
arr =
|
|
4675
|
+
name = arg.substring(j2, idx);
|
|
4676
|
+
val = arg.substring(++idx) || (i2 + 1 === len || ("" + args[i2 + 1]).charCodeAt(0) === 45 || args[++i2]);
|
|
4677
|
+
arr = j2 === 2 ? [name] : name;
|
|
960
4678
|
for (idx = 0;idx < arr.length; idx++) {
|
|
961
4679
|
name = arr[idx];
|
|
962
4680
|
if (strict && !~keys.indexOf(name))
|
|
963
|
-
return opts.unknown("-".repeat(
|
|
4681
|
+
return opts.unknown("-".repeat(j2) + name);
|
|
964
4682
|
toVal(out, name, idx + 1 < arr.length || val, opts);
|
|
965
4683
|
}
|
|
966
4684
|
}
|
|
967
4685
|
}
|
|
968
4686
|
if (defaults) {
|
|
969
|
-
for (
|
|
970
|
-
if (out[
|
|
971
|
-
out[
|
|
4687
|
+
for (k2 in opts.default) {
|
|
4688
|
+
if (out[k2] === undefined) {
|
|
4689
|
+
out[k2] = opts.default[k2];
|
|
972
4690
|
}
|
|
973
4691
|
}
|
|
974
4692
|
}
|
|
975
4693
|
if (alibi) {
|
|
976
|
-
for (
|
|
977
|
-
arr = opts.alias[
|
|
4694
|
+
for (k2 in out) {
|
|
4695
|
+
arr = opts.alias[k2] || [];
|
|
978
4696
|
while (arr.length > 0) {
|
|
979
|
-
out[arr.shift()] = out[
|
|
4697
|
+
out[arr.shift()] = out[k2];
|
|
980
4698
|
}
|
|
981
4699
|
}
|
|
982
4700
|
}
|
|
983
4701
|
return out;
|
|
984
4702
|
}
|
|
985
|
-
var removeBrackets = (
|
|
986
|
-
var findAllBrackets = (
|
|
4703
|
+
var removeBrackets = (v2) => v2.replace(/[<[].+/, "").trim();
|
|
4704
|
+
var findAllBrackets = (v2) => {
|
|
987
4705
|
const ANGLED_BRACKET_RE_GLOBAL = /<([^>]+)>/g;
|
|
988
4706
|
const SQUARE_BRACKET_RE_GLOBAL = /\[([^\]]+)\]/g;
|
|
989
4707
|
const res = [];
|
|
@@ -1001,11 +4719,11 @@ var findAllBrackets = (v) => {
|
|
|
1001
4719
|
};
|
|
1002
4720
|
};
|
|
1003
4721
|
let angledMatch;
|
|
1004
|
-
while (angledMatch = ANGLED_BRACKET_RE_GLOBAL.exec(
|
|
4722
|
+
while (angledMatch = ANGLED_BRACKET_RE_GLOBAL.exec(v2)) {
|
|
1005
4723
|
res.push(parse(angledMatch));
|
|
1006
4724
|
}
|
|
1007
4725
|
let squareMatch;
|
|
1008
|
-
while (squareMatch = SQUARE_BRACKET_RE_GLOBAL.exec(
|
|
4726
|
+
while (squareMatch = SQUARE_BRACKET_RE_GLOBAL.exec(v2)) {
|
|
1009
4727
|
res.push(parse(squareMatch));
|
|
1010
4728
|
}
|
|
1011
4729
|
return res;
|
|
@@ -1018,8 +4736,8 @@ var getMriOptions = (options) => {
|
|
|
1018
4736
|
}
|
|
1019
4737
|
if (option.isBoolean) {
|
|
1020
4738
|
if (option.negated) {
|
|
1021
|
-
const hasStringTypeOption = options.some((
|
|
1022
|
-
return
|
|
4739
|
+
const hasStringTypeOption = options.some((o2, i2) => {
|
|
4740
|
+
return i2 !== index && o2.names.some((name) => option.names.includes(name)) && typeof o2.required === "boolean";
|
|
1023
4741
|
});
|
|
1024
4742
|
if (!hasStringTypeOption) {
|
|
1025
4743
|
result.boolean.push(option.names[0]);
|
|
@@ -1032,26 +4750,26 @@ var getMriOptions = (options) => {
|
|
|
1032
4750
|
return result;
|
|
1033
4751
|
};
|
|
1034
4752
|
var findLongest = (arr) => {
|
|
1035
|
-
return arr.sort((
|
|
1036
|
-
return
|
|
4753
|
+
return arr.sort((a2, b2) => {
|
|
4754
|
+
return a2.length > b2.length ? -1 : 1;
|
|
1037
4755
|
})[0];
|
|
1038
4756
|
};
|
|
1039
4757
|
var padRight = (str, length) => {
|
|
1040
4758
|
return str.length >= length ? str : `${str}${" ".repeat(length - str.length)}`;
|
|
1041
4759
|
};
|
|
1042
4760
|
var camelcase = (input) => {
|
|
1043
|
-
return input.replace(/([a-z])-([a-z])/g, (
|
|
4761
|
+
return input.replace(/([a-z])-([a-z])/g, (_2, p1, p2) => {
|
|
1044
4762
|
return p1 + p2.toUpperCase();
|
|
1045
4763
|
});
|
|
1046
4764
|
};
|
|
1047
4765
|
var setDotProp = (obj, keys, val) => {
|
|
1048
|
-
let
|
|
4766
|
+
let i2 = 0;
|
|
1049
4767
|
let length = keys.length;
|
|
1050
|
-
let
|
|
1051
|
-
let
|
|
1052
|
-
for (;
|
|
1053
|
-
|
|
1054
|
-
|
|
4768
|
+
let t2 = obj;
|
|
4769
|
+
let x2;
|
|
4770
|
+
for (;i2 < length; ++i2) {
|
|
4771
|
+
x2 = t2[keys[i2]];
|
|
4772
|
+
t2 = t2[keys[i2]] = i2 === length - 1 ? val : x2 != null ? x2 : !!~keys[i2 + 1].indexOf(".") || !(+keys[i2 + 1] > -1) ? {} : [];
|
|
1055
4773
|
}
|
|
1056
4774
|
};
|
|
1057
4775
|
var setByType = (obj, transforms) => {
|
|
@@ -1066,12 +4784,12 @@ var setByType = (obj, transforms) => {
|
|
|
1066
4784
|
}
|
|
1067
4785
|
};
|
|
1068
4786
|
var getFileName = (input) => {
|
|
1069
|
-
const
|
|
1070
|
-
return
|
|
4787
|
+
const m2 = /([^\\\/]+)$/.exec(input);
|
|
4788
|
+
return m2 ? m2[1] : "";
|
|
1071
4789
|
};
|
|
1072
4790
|
var camelcaseOptionName = (name) => {
|
|
1073
|
-
return name.split(".").map((
|
|
1074
|
-
return
|
|
4791
|
+
return name.split(".").map((v2, i2) => {
|
|
4792
|
+
return i2 === 0 ? camelcase(v2) : v2;
|
|
1075
4793
|
}).join(".");
|
|
1076
4794
|
};
|
|
1077
4795
|
|
|
@@ -1094,14 +4812,14 @@ class Option {
|
|
|
1094
4812
|
this.config = Object.assign({}, config);
|
|
1095
4813
|
rawName = rawName.replace(/\.\*/g, "");
|
|
1096
4814
|
this.negated = false;
|
|
1097
|
-
this.names = removeBrackets(rawName).split(",").map((
|
|
1098
|
-
let name =
|
|
4815
|
+
this.names = removeBrackets(rawName).split(",").map((v2) => {
|
|
4816
|
+
let name = v2.trim().replace(/^-{1,2}/, "");
|
|
1099
4817
|
if (name.startsWith("no-")) {
|
|
1100
4818
|
this.negated = true;
|
|
1101
4819
|
name = name.replace(/^no-/, "");
|
|
1102
4820
|
}
|
|
1103
4821
|
return camelcaseOptionName(name);
|
|
1104
|
-
}).sort((
|
|
4822
|
+
}).sort((a2, b2) => a2.length > b2.length ? 1 : -1);
|
|
1105
4823
|
this.name = this.names[this.names.length - 1];
|
|
1106
4824
|
if (this.negated && this.config.default == null) {
|
|
1107
4825
|
this.config.default = true;
|
|
@@ -1276,7 +4994,7 @@ ${section.body}` : section.body;
|
|
|
1276
4994
|
for (const option of options) {
|
|
1277
4995
|
const value = parsedOptions[option.name.split(".")[0]];
|
|
1278
4996
|
if (option.required) {
|
|
1279
|
-
const hasNegated = options.some((
|
|
4997
|
+
const hasNegated = options.some((o2) => o2.negated && o2.names.includes(option.name));
|
|
1280
4998
|
if (value === true || value === false && !hasNegated) {
|
|
1281
4999
|
throw new CACError(`option \`${option.rawName}\` value is missing`);
|
|
1282
5000
|
}
|
|
@@ -1562,6 +5280,18 @@ function normalizeParamKey(key) {
|
|
|
1562
5280
|
}
|
|
1563
5281
|
function decodeRowValues2(args) {
|
|
1564
5282
|
const decodedRow = {};
|
|
5283
|
+
if (args.columns && args.decodeColumn) {
|
|
5284
|
+
for (const column of args.columns) {
|
|
5285
|
+
const columnName = column.name;
|
|
5286
|
+
const rawValue = args.row[columnName];
|
|
5287
|
+
decodedRow[columnName] = args.decodeColumn({
|
|
5288
|
+
value: rawValue,
|
|
5289
|
+
columnName,
|
|
5290
|
+
columnType: column.type
|
|
5291
|
+
});
|
|
5292
|
+
}
|
|
5293
|
+
return decodedRow;
|
|
5294
|
+
}
|
|
1565
5295
|
for (const [columnName, rawValue] of Object.entries(args.row)) {
|
|
1566
5296
|
decodedRow[columnName] = decodeColumnValue2({
|
|
1567
5297
|
value: rawValue,
|
|
@@ -1572,20 +5302,19 @@ function decodeRowValues2(args) {
|
|
|
1572
5302
|
return decodedRow;
|
|
1573
5303
|
}
|
|
1574
5304
|
function decodeColumnValue2(args) {
|
|
1575
|
-
const { value, columnName } = args;
|
|
5305
|
+
const { value, columnName, columnType } = args;
|
|
1576
5306
|
if (value === null || value === undefined) {
|
|
1577
5307
|
return null;
|
|
1578
5308
|
}
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
return new Date(value);
|
|
1582
|
-
}
|
|
5309
|
+
const isDateTime = columnType === "datetime" || isTimestampColumn(columnName);
|
|
5310
|
+
if (isDateTime) {
|
|
1583
5311
|
if (typeof value === "string") {
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
5312
|
+
return Xn.Instant.from(value);
|
|
5313
|
+
}
|
|
5314
|
+
if (typeof value === "number") {
|
|
5315
|
+
return Xn.Instant.fromEpochMilliseconds(value);
|
|
1588
5316
|
}
|
|
5317
|
+
throw new Error(`Expected datetime column ${columnName} to be a string or number, got ${typeof value}`);
|
|
1589
5318
|
}
|
|
1590
5319
|
if (typeof value === "string") {
|
|
1591
5320
|
return tryDecodeJson(value) ?? value;
|
|
@@ -1605,6 +5334,12 @@ function tryDecodeJson(value) {
|
|
|
1605
5334
|
}
|
|
1606
5335
|
}
|
|
1607
5336
|
function encodeColumnValue2(value) {
|
|
5337
|
+
if (value instanceof Xn.Instant) {
|
|
5338
|
+
return value.toString();
|
|
5339
|
+
}
|
|
5340
|
+
if (value instanceof Xn.Duration) {
|
|
5341
|
+
return value.toString();
|
|
5342
|
+
}
|
|
1608
5343
|
if (value instanceof Date) {
|
|
1609
5344
|
return value.toISOString();
|
|
1610
5345
|
}
|
|
@@ -1708,5 +5443,6 @@ function getDefaultWorkerOptions() {
|
|
|
1708
5443
|
}
|
|
1709
5444
|
export {
|
|
1710
5445
|
downloadExtension,
|
|
1711
|
-
run as default
|
|
5446
|
+
run as default,
|
|
5447
|
+
Xn as Temporal
|
|
1712
5448
|
};
|