@formatjs/intl-datetimeformat-calendar-hebrew 1.1.6 → 1.1.7

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/index.js CHANGED
@@ -1,542 +1,3 @@
1
- // node_modules/.aspect_rules_js/temporal-utils@1.0.3/node_modules/temporal-utils/dist/errorMessages.js
2
- const expectedPositive = (entityName, num) => `Non-positive ${entityName}: ${num}`;
3
- const expectedFinite = (entityName, num) => `Non-finite ${entityName}: ${num}`;
4
- const forbiddenBigIntToNumber = (entityName) => `Cannot convert bigint to ${entityName}`;
5
- const numberOutOfRange = (entityName, val, min, max) => invalidEntity$1(entityName, val) + `; must be between ${min}-${max}`;
6
- const invalidEntity$1 = (fieldName, val) => `Invalid ${fieldName}: ${val}`;
7
- function toFiniteNumber(arg, entityName = "number") {
8
- if (typeof arg === "bigint") throw new TypeError(forbiddenBigIntToNumber(entityName));
9
- arg = Number(arg);
10
- if (!Number.isFinite(arg)) throw new RangeError(expectedFinite(entityName, arg));
11
- return arg;
12
- }
13
- function toIntegerWithTrunc(arg, entityName) {
14
- return Math.trunc(toFiniteNumber(arg, entityName)) || 0;
15
- }
16
- function toPositiveIntegerWithTruncation(arg, entityName) {
17
- return requireNumberIsPositive(toIntegerWithTrunc(arg, entityName), entityName);
18
- }
19
- function requireNumberIsPositive(num, entityName = "number") {
20
- if (num <= 0) throw new RangeError(expectedPositive(entityName, num));
21
- return num;
22
- }
23
- function constrainToRange$1(num, min, max) {
24
- return Math.min(Math.max(num, min), max);
25
- }
26
- function isObjectLike(arg) {
27
- return arg !== null && (typeof arg === "object" || typeof arg === "function");
28
- }
29
- // node_modules/.aspect_rules_js/temporal-polyfill@1.0.6/node_modules/temporal-polyfill/chunks/internal.js
30
- const invalidEntity = invalidEntity$1;
31
- const missingField = (fieldName) => `Missing ${fieldName}`;
32
- const forbiddenValueOf$1 = "Cannot use valueOf";
33
- const invalidCallingContext = "Invalid calling context";
34
- const exoticCalendarRequired = (calendarId, remedy) => `Unknown calendar ${calendarId}; might need ${remedy}`;
35
- const constrainToRange = constrainToRange$1;
36
- function throwRangeError(message) {
37
- throw new RangeError(message);
38
- }
39
- function throwTypeError(message) {
40
- throw new TypeError(message);
41
- }
42
- function clampProp(props, propName, min, max, overflow) {
43
- return clampEntity(propName, ((props, propName) => {
44
- const propVal = props[propName];
45
- return void 0 === propVal && throwTypeError(missingField(propName)), propVal;
46
- })(props, propName), min, max, overflow);
47
- }
48
- function clampEntity(entityName, num, min, max, overflow, choices) {
49
- const clamped = constrainToRange(num, min, max);
50
- return overflow && num !== clamped && throwRangeError(((entityName, val, min, max, choices) => choices ? numberOutOfRange(entityName, choices[val], choices[min], choices[max]) : numberOutOfRange(entityName, val, min, max))(entityName, num, min, max, choices)), clamped;
51
- }
52
- function memoize(generator, MapClass = Map) {
53
- const map = new MapClass();
54
- return (key, ...otherArgs) => {
55
- if (map.has(key)) return map.get(key);
56
- const val = generator(key, ...otherArgs);
57
- return map.set(key, val), val;
58
- };
59
- }
60
- const createNameDescriptors = (name) => createPropDescriptors({ name }, 1);
61
- const createPropDescriptors = (propVals, readonly) => mapProps((value) => ({
62
- value,
63
- configurable: 1,
64
- writable: !readonly
65
- }), propVals);
66
- const createStringTagDescriptors = (value) => ({ [Symbol.toStringTag]: {
67
- value,
68
- configurable: 1
69
- } });
70
- function mapProps(transformer, props) {
71
- const res = {};
72
- for (const propName in props) res[propName] = transformer(props[propName], propName);
73
- return res;
74
- }
75
- function zipPropsConst(propNames, propVal) {
76
- const res = {};
77
- for (const propName of propNames) res[propName] = propVal;
78
- return res;
79
- }
80
- function createPropGetters(propNames) {
81
- const getters = {};
82
- for (const propName of propNames) getters[propName] = (slots) => slots[propName];
83
- return getters;
84
- }
85
- function pluckProps(propNames, props, dest = Object.create(null)) {
86
- for (const propName of propNames) dest[propName] = props[propName];
87
- return dest;
88
- }
89
- function bindArgs(f, ...boundArgs) {
90
- return (...dynamicArgs) => f(...boundArgs, ...dynamicArgs);
91
- }
92
- function noop() {}
93
- function padNumber(digits, num) {
94
- return String(num).padStart(digits, "0");
95
- }
96
- const padNumber2 = /*@__PURE__*/ bindArgs(padNumber, 2);
97
- function compareNumbers(a, b) {
98
- return Math.sign(a - b);
99
- }
100
- function modFloor(num, divisor) {
101
- return (num % divisor + divisor) % divisor;
102
- }
103
- function divTrunc(num, divisor) {
104
- return Math.trunc(num / divisor) || 0;
105
- }
106
- function getCalendarSlotId(calendar) {
107
- return calendar === void 0 ? "iso8601" : 0 === calendar ? "gregory" : calendar.id;
108
- }
109
- function formatMonthCode(monthCodeNumber, isLeapMonth) {
110
- return "M" + padNumber2(monthCodeNumber) + (isLeapMonth ? "L" : "");
111
- }
112
- function monthCodeNumberToMonth(monthCodeNumber, isLeapMonth, leapMonth) {
113
- return monthCodeNumber + (isLeapMonth || leapMonth && monthCodeNumber >= leapMonth ? 1 : 0);
114
- }
115
- function monthToMonthCodeNumber(month, leapMonth) {
116
- return month - (leapMonth && month >= leapMonth ? 1 : 0);
117
- }
118
- const unitNamesAsc = /*@__PURE__*/ Object.keys({
119
- nanosecond: 0,
120
- microsecond: 1,
121
- millisecond: 2,
122
- second: 3,
123
- minute: 4,
124
- hour: 5,
125
- day: 6,
126
- week: 7,
127
- month: 8,
128
- year: 9
129
- });
130
- const milliInUtcDay = 864e5;
131
- const bigNanoInUtcDay = /*@__PURE__*/ BigInt(864e11);
132
- const timeFieldNamesAsc = /*@__PURE__*/ unitNamesAsc.slice(0, 6);
133
- const calendarDateFieldNamesAsc = [
134
- "day",
135
- "month",
136
- "year"
137
- ];
138
- function isoDateToEpochNano(isoDate) {
139
- return BigInt(isoDateToEpochDays(isoDate)) * bigNanoInUtcDay;
140
- }
141
- function isoDateToEpochDays(isoDate) {
142
- return isoPartsToEpochDays(isoDate.year, isoDate.month, isoDate.day);
143
- }
144
- function isoPartsToEpochDays(isoYear, isoMonth = 1, isoDay = 1) {
145
- const monthIndex = isoMonth - 1;
146
- return isoYear += Math.floor(monthIndex / 12), isoMonth = modFloor(monthIndex, 12), Date.UTC(isoYear % 400 - 400, isoMonth, 0) / 864e5 + 146097 * (divTrunc(isoYear, 400) + 1) + isoDay;
147
- }
148
- function epochDaysToIsoDate(epochDays) {
149
- const legacyDate = /* @__PURE__ */ new Date(864e5 * modFloor(epochDays, 146097));
150
- return {
151
- year: legacyDate.getUTCFullYear() + 400 * Math.floor(epochDays / 146097),
152
- month: legacyDate.getUTCMonth() + 1,
153
- day: legacyDate.getUTCDate()
154
- };
155
- }
156
- function computeIsoMonthCodeParts(month) {
157
- return [month, 0];
158
- }
159
- function computeIsoDaysInMonth(year, month) {
160
- switch (month) {
161
- case 2: return computeIsoInLeapYear(year) ? 29 : 28;
162
- case 4:
163
- case 6:
164
- case 9:
165
- case 11: return 30;
166
- }
167
- return 31;
168
- }
169
- function computeIsoInLeapYear(year) {
170
- return year % 4 == 0 && (year % 100 != 0 || year % 400 == 0);
171
- }
172
- function computeGregoryEraFields({ year }) {
173
- return year < 1 ? {
174
- era: "bce",
175
- eraYear: 1 - year
176
- } : {
177
- era: "ce",
178
- eraYear: year
179
- };
180
- }
181
- function validateIsoDateFields(isoInternals) {
182
- return constrainIsoDateFields(isoInternals, 1), isoInternals;
183
- }
184
- function constrainIsoDateFields(isoDate, overflow) {
185
- const { year } = isoDate;
186
- const month = clampProp(isoDate, "month", 1, 12, overflow);
187
- return {
188
- year,
189
- month,
190
- day: clampProp(isoDate, "day", 1, computeIsoDaysInMonth(year, month), overflow)
191
- };
192
- }
193
- function computeCalendarDateFields(calendar, isoDate) {
194
- return calendar ? calendar.de(isoDate) : isoDate;
195
- }
196
- function computeCalendarMonthCodeParts(calendar, year, month) {
197
- return calendar ? calendar.N(year, month) : computeIsoMonthCodeParts(month);
198
- }
199
- function computeCalendarEraFields(calendar, isoDate) {
200
- return 0 === calendar ? computeGregoryEraFields(isoDate) : calendar && calendar.h?.(isoDate) || {};
201
- }
202
- function computeCalendarMonthCode(calendar, isoDate) {
203
- const { year, month } = computeCalendarDateFields(calendar, isoDate);
204
- const [monthCodeNumber, isLeapMonth] = computeCalendarMonthCodeParts(calendar, year, month);
205
- return formatMonthCode(monthCodeNumber, isLeapMonth);
206
- }
207
- function computeCalendarInLeapYear(calendar, isoDate) {
208
- const { year } = computeCalendarDateFields(calendar, isoDate);
209
- return calendar ? calendar.q(year) : computeIsoInLeapYear(year);
210
- }
211
- const requireString = /*@__PURE__*/ bindArgs(requireType, "string");
212
- function requireType(typeName, arg, entityName = typeName) {
213
- return typeof arg !== typeName && throwTypeError(invalidEntity(entityName, arg)), arg;
214
- }
215
- function toString(arg) {
216
- return "symbol" == typeof arg && throwTypeError("Cannot convert Symbol to string"), String(arg);
217
- }
218
- function toPrimitiveWithStringHint(arg) {
219
- if (!isObjectLike(arg)) return arg;
220
- const exoticToPrimitive = arg[Symbol.toPrimitive];
221
- if (null != exoticToPrimitive) {
222
- "function" != typeof exoticToPrimitive && throwTypeError();
223
- const primitive = Reflect.apply(exoticToPrimitive, arg, ["string"]);
224
- return isObjectLike(primitive) && throwTypeError(), primitive;
225
- }
226
- return Date.prototype[Symbol.toPrimitive].call(arg, "string");
227
- }
228
- const epochNanoMax = /*@__PURE__*/ BigInt(1e8) * bigNanoInUtcDay;
229
- const epochNanoMin = /*@__PURE__*/ BigInt(-1e8) * bigNanoInUtcDay;
230
- const plainDateEpochNanoMin = epochNanoMin - bigNanoInUtcDay;
231
- function checkIsoDateInBounds(isoDate, allowPlainDateLowerEdge = 1) {
232
- const epochNano = isoDateToEpochNano(isoDate);
233
- return (epochNano < (allowPlainDateLowerEdge ? plainDateEpochNanoMin : epochNanoMin) || epochNano > epochNanoMax) && throwRangeError("Out-of-bounds date"), isoDate;
234
- }
235
- function createDateSlots(isoDate, calendar) {
236
- return pluckProps(calendarDateFieldNamesAsc, isoDate, { calendar });
237
- }
238
- ({ .../* @__PURE__ */ Object.assign({}, {
239
- era: toString,
240
- month: toPositiveIntegerWithTruncation,
241
- monthCode(monthCode, fieldName) {
242
- return requireString(toPrimitiveWithStringHint(monthCode), fieldName);
243
- },
244
- day: toPositiveIntegerWithTruncation
245
- }, /* @__PURE__ */ zipPropsConst(timeFieldNamesAsc, toIntegerWithTrunc)) });
246
- Intl.DateTimeFormat;
247
- function formatDateIsoAuto(plainDateSlots) {
248
- return formatIsoDateFields(plainDateSlots) + (plainDateSlots.calendar === void 0 ? "" : formatCalendarId(getCalendarSlotId(plainDateSlots.calendar), 0));
249
- }
250
- function formatIsoDateFields(isoDate) {
251
- return formatIsoYearMonthFields(isoDate) + "-" + padNumber2(isoDate.day);
252
- }
253
- function formatIsoYearMonthFields(isoDate) {
254
- const { year } = isoDate;
255
- return (year < 0 || year > 9999 ? getSignStr(year) + padNumber(6, Math.abs(year)) : padNumber(4, year)) + "-" + padNumber2(isoDate.month);
256
- }
257
- function formatCalendarId(calendarId, isCritical) {
258
- return "[" + (isCritical ? "!" : "") + "u-ca=" + calendarId + "]";
259
- }
260
- function getSignStr(num) {
261
- return num < 0 ? "-" : "+";
262
- }
263
- function timeRegExpStr(separatorIndex) {
264
- return `(\\d{2})(?:(:?)(\\d{2})(?:\\${separatorIndex}(\\d{2})(?:[.,](\\d{1,9}))?)?)?`;
265
- }
266
- "" + timeRegExpStr(8) + timeRegExpStr(15);
267
- "" + timeRegExpStr(2) + `(([+-])${timeRegExpStr(9)})?((?:\\[(!?)([^\\]]*)\\]){0,9})`;
268
- ({ .../* @__PURE__ */ Object.assign({}, {
269
- year: "numeric",
270
- month: "numeric",
271
- day: "numeric"
272
- }, {
273
- hour: "numeric",
274
- minute: "numeric",
275
- second: "numeric"
276
- }) });
277
- // node_modules/.aspect_rules_js/temporal-polyfill@1.0.6/node_modules/temporal-polyfill/chunks/exoticCalendars-utils.js
278
- function createArithmeticCalendar(ops) {
279
- const monthDayReferenceDate = ops.J(2441683);
280
- const fromIsoDate = memoize((isoDate) => ops.J(isoDateToEpochDays(isoDate) + 2440588), WeakMap);
281
- function computeDefaultMonthCodeParts(year, month) {
282
- const leapMonth = ops.p?.(year);
283
- return [monthToMonthCodeNumber(month, leapMonth), month === leapMonth];
284
- }
285
- return {
286
- k: ops.k,
287
- l: ops.l,
288
- V: ops.V,
289
- U: ops.U,
290
- re: ops.re,
291
- _: ops._,
292
- ge: ops.ge,
293
- de: fromIsoDate,
294
- fe(year, month, day) {
295
- return epochDaysToIsoDate(ops.L(year, month, day) - 2440588);
296
- },
297
- pe(year, month = 1, day = 1) {
298
- return (ops.L(year, month, day) - 2440588) * milliInUtcDay;
299
- },
300
- N(year, month) {
301
- return (ops.N || computeDefaultMonthCodeParts)(year, month);
302
- },
303
- u(monthCodeNumber, isLeapMonth, day) {
304
- return ops.u?.(monthCodeNumber, isLeapMonth, day) || ((monthCodeNumber, isLeapMonth, day) => {
305
- isLeapMonth = Boolean(isLeapMonth);
306
- let referenceYear = ops.re || monthDayReferenceDate.year;
307
- const [referenceMonthCodeNumber, referenceIsLeapMonth] = computeDefaultMonthCodeParts(monthDayReferenceDate.year, monthDayReferenceDate.month);
308
- 1 === (compareNumbers(monthCodeNumber, referenceMonthCodeNumber) || compareNumbers(Number(isLeapMonth), Number(referenceIsLeapMonth)) || compareNumbers(day, monthDayReferenceDate.day)) && referenceYear--;
309
- for (let yearDelta = 0; yearDelta < 100; yearDelta++) for (const year of [referenceYear - yearDelta, referenceYear + yearDelta]) {
310
- const leapMonth = ops.p?.(year);
311
- const month = monthCodeNumberToMonth(monthCodeNumber, isLeapMonth, leapMonth);
312
- if (month <= ops.j(year) && isLeapMonth === (month === leapMonth) && day <= ops.o(year, month)) return {
313
- year,
314
- month
315
- };
316
- }
317
- })(monthCodeNumber, isLeapMonth, day);
318
- },
319
- q: ops.q,
320
- j: ops.j,
321
- o: ops.o,
322
- i: ops.i,
323
- p: ops.p || noop,
324
- h(isoDate) {
325
- const parts = fromIsoDate(isoDate);
326
- return ops.h ? ops.h(parts) : {
327
- era: parts.era,
328
- eraYear: parts.eraYear
329
- };
330
- },
331
- ae(year, month, monthDelta) {
332
- return ((computeMonthsInYear, year, month, monthDelta) => {
333
- if (monthDelta) {
334
- if (Number.isSafeInteger(month += monthDelta) || throwRangeError("Out-of-bounds date"), monthDelta < 0) for (; month < 1;) month += computeMonthsInYear(--year);
335
- else {
336
- let monthsInYear;
337
- for (; month > (monthsInYear = computeMonthsInYear(year));) month -= monthsInYear, year++;
338
- }
339
- }
340
- return {
341
- year,
342
- month
343
- };
344
- })(ops.j, year, month, monthDelta);
345
- },
346
- ee(year0, month0, year1, month1) {
347
- return diffArithmeticMonthSlots(ops.j, year0, month0, year1, month1);
348
- }
349
- };
350
- }
351
- function diffArithmeticMonthSlots(computeMonthsInYear, year0, month0, year1, month1) {
352
- const cmp = compareNumbers(year0, year1) || compareNumbers(month0, month1);
353
- if (!cmp) return 0;
354
- if (year0 === year1) return month1 - month0;
355
- if (cmp < 0) {
356
- let months = computeMonthsInYear(year0) - month0 + month1;
357
- for (let year = year0 + 1; year < year1; year++) months += computeMonthsInYear(year);
358
- return months;
359
- }
360
- return -diffArithmeticMonthSlots(computeMonthsInYear, year1, month1, year0, month0);
361
- }
362
- // node_modules/.aspect_rules_js/temporal-polyfill@1.0.6/node_modules/temporal-polyfill/chunks/exoticCalendars.js
363
- const hebrewEraOrigins = { "am": 0 };
364
- function hebrewIsLeapYear(year) {
365
- return modFloor(7 * year + 1, 19) < 7;
366
- }
367
- function hebrewDelay1(year) {
368
- const months = Math.floor((235 * year - 234) / 19);
369
- let day = 29 * months + Math.floor((12084 + 13753 * months) / 25920);
370
- return modFloor(3 * (day + 1), 7) < 3 && (day += 1), day;
371
- }
372
- function hebrewStartOfYear(year) {
373
- return hebrewDelay1(year) + ((year) => {
374
- const last = hebrewDelay1(year - 1);
375
- const present = hebrewDelay1(year);
376
- return hebrewDelay1(year + 1) - present === 356 ? 2 : present - last === 382 ? 1 : 0;
377
- })(year);
378
- }
379
- function hebrewDaysInYear(year) {
380
- return hebrewStartOfYear(year + 1) - hebrewStartOfYear(year);
381
- }
382
- function hebrewDaysInMonth(year, month) {
383
- const normalizedMonth = month >= 6 && !hebrewIsLeapYear(year) ? month + 1 : month;
384
- if (4 === normalizedMonth || 7 === normalizedMonth || 9 === normalizedMonth || 11 === normalizedMonth || 13 === normalizedMonth) return 29;
385
- const yearType = ((year) => {
386
- let yearLength = hebrewDaysInYear(year);
387
- return yearLength > 380 && (yearLength -= 30), 353 === yearLength ? 0 : 354 === yearLength ? 1 : 2;
388
- })(year);
389
- return 2 === normalizedMonth ? 2 === yearType ? 30 : 29 : 3 === normalizedMonth ? 0 === yearType ? 29 : 30 : 6 === normalizedMonth ? hebrewIsLeapYear(year) ? 30 : 0 : 30;
390
- }
391
- const hebrewMeta = ["hebrew", () => createArithmeticCalendar({
392
- k: hebrewEraOrigins,
393
- l: -6,
394
- J(julianDay) {
395
- const day = julianDay - 347997;
396
- let year = Math.floor((25920 * day / 765433 * 19 + 234) / 235) + 1;
397
- let yearStart = hebrewStartOfYear(year);
398
- let dayOfYear = Math.floor(day - yearStart);
399
- for (; dayOfYear < 1;) year--, yearStart = hebrewStartOfYear(year), dayOfYear = Math.floor(day - yearStart);
400
- let month = 1;
401
- let monthStart = 0;
402
- for (; monthStart < dayOfYear;) monthStart += hebrewDaysInMonth(year, month), month++;
403
- return month--, monthStart -= hebrewDaysInMonth(year, month), {
404
- year,
405
- month,
406
- day: dayOfYear - monthStart
407
- };
408
- },
409
- L(year, month, day) {
410
- let julianDay = hebrewStartOfYear(year);
411
- for (let i = 1; i < month; i++) julianDay += hebrewDaysInMonth(year, i);
412
- return julianDay + day + 347997;
413
- },
414
- o: hebrewDaysInMonth,
415
- i: hebrewDaysInYear,
416
- j(year) {
417
- return hebrewIsLeapYear(year) ? 13 : 12;
418
- },
419
- q: hebrewIsLeapYear,
420
- p(year) {
421
- return hebrewIsLeapYear(year) ? 6 : void 0;
422
- },
423
- N(year, month) {
424
- return hebrewIsLeapYear(year) && 6 === month ? [5, 1] : [month - (hebrewIsLeapYear(year) && month > 6 ? 1 : 0), 0];
425
- },
426
- u(monthCodeNumber, isLeapMonth, day) {
427
- return isLeapMonth && 5 === monthCodeNumber && day <= 30 ? {
428
- year: 5730,
429
- month: 6
430
- } : void 0;
431
- },
432
- h({ year }) {
433
- return {
434
- era: "am",
435
- eraYear: year
436
- };
437
- }
438
- })];
439
- const getOrCreateExoticCalendar = /*@__PURE__*/ memoize((canonicalId, createExoticCalendar) => {
440
- const calendar = createExoticCalendar(canonicalId);
441
- return calendar.id = canonicalId, calendar;
442
- });
443
- function createExoticCalendarGetter(meta) {
444
- return () => getOrCreateExoticCalendar(...meta);
445
- }
446
- // node_modules/.aspect_rules_js/temporal-polyfill@1.0.6/node_modules/temporal-polyfill/chunks/apiHelpers.js
447
- const PlainDateBranding = "PlainDate";
448
- const CalendarBranding = "Calendar";
449
- function defineTemporalClass(branding, cls, getSlots, ...getterMaps) {
450
- return Object.defineProperties(cls, createNameDescriptors(branding)), Object.defineProperties(cls.prototype, createStringTagDescriptors("Temporal." + branding)), Object.defineProperties(cls.prototype, mapProps((getter) => ({
451
- get() {
452
- return getter(getSlots(this));
453
- },
454
- configurable: 1
455
- }), Object.assign({}, ...getterMaps))), cls;
456
- }
457
- const attachDebugString = "noop" === noop.name ? (instance) => {
458
- Object.defineProperty(instance, "_str_", { value: instance.toJSON() });
459
- } : noop;
460
- function invalidRecordType() {
461
- throwTypeError(invalidCallingContext);
462
- }
463
- function forbiddenValueOf() {
464
- throwTypeError(forbiddenValueOf$1);
465
- }
466
- const dateFieldGetters$1 = {
467
- era(slots) {
468
- return computeCalendarEraFields(slots.calendar, slots).era;
469
- },
470
- eraYear(slots) {
471
- return computeCalendarEraFields(slots.calendar, slots).eraYear;
472
- },
473
- year(slots) {
474
- return computeCalendarDateFields(slots.calendar, slots).year;
475
- },
476
- month(slots) {
477
- return computeCalendarDateFields(slots.calendar, slots).month;
478
- },
479
- monthCode(slots) {
480
- return computeCalendarMonthCode(slots.calendar, slots);
481
- },
482
- day(slots) {
483
- return computeCalendarDateFields(slots.calendar, slots).day;
484
- }
485
- };
486
- function createNativeGetters(shimGetters) {
487
- return createPropGetters(Object.keys(shimGetters));
488
- }
489
- const dateFieldGetters = /*@__PURE__*/ createNativeGetters(dateFieldGetters$1);
490
- // node_modules/.aspect_rules_js/temporal-polyfill@1.0.6/node_modules/temporal-polyfill/chunks/funcApi.js
491
- const PlainDateRecordBranding = `${PlainDateBranding}Record`;
492
- const CalendarRecordBranding = `${CalendarBranding}Record`;
493
- const calendarMap = /*@__PURE__*/ new WeakMap();
494
- const plainDateMap = /*@__PURE__*/ new WeakMap();
495
- function getCalendarSlots(record) {
496
- return getCalendarSlotsIfPresent(record) || invalidRecordType();
497
- }
498
- function getCalendarSlotsIfPresent(record) {
499
- return calendarMap.get(record);
500
- }
501
- function getPlainDateSlots(record) {
502
- return getPlainDateSlotsIfPresent(record) || invalidRecordType();
503
- }
504
- function getPlainDateSlotsIfPresent(record) {
505
- return plainDateMap.get(record);
506
- }
507
- function setPlainDateSlots(instance, slots) {
508
- plainDateMap.set(instance, slots);
509
- }
510
- const CalendarRecord = /*@__PURE__*/ defineTemporalClass(CalendarRecordBranding, class {
511
- toJSON() {
512
- return getCalendarRecordId(this);
513
- }
514
- valueOf() {
515
- return getCalendarRecordId(this);
516
- }
517
- });
518
- function createCalendarRecord(id, getImpl) {
519
- const instance = Object.create(CalendarRecord.prototype);
520
- return ((instance, slots) => {
521
- calendarMap.set(instance, slots);
522
- })(instance, {
523
- id,
524
- xe: getImpl
525
- }), attachDebugString(instance), instance;
526
- }
527
- function getCalendarRecordId(record) {
528
- return getCalendarSlots(record).id;
529
- }
530
- function getCalendarRecordImplCreator(record) {
531
- const getImpl = getCalendarSlots(record).xe;
532
- return getImpl || throwRangeError(exoticCalendarRequired(getCalendarRecordId(record), "getExotic or getAny")), getImpl;
533
- }
534
- // node_modules/.aspect_rules_js/temporal-polyfill@1.0.6/node_modules/temporal-polyfill/fns/Calendar.js
535
- const getHebrew = /*@__PURE__*/ createCanonicalGetter(hebrewMeta);
536
- const getOrCreateFoundRecord = /*@__PURE__*/ memoize((rawCalendarId, meta) => createCalendarRecord(rawCalendarId, createExoticCalendarGetter(meta)));
537
- function createCanonicalGetter(meta) {
538
- return () => getOrCreateFoundRecord(meta[0], meta);
539
- }
540
1
  // packages/ecma262-abstract/DateOperations.js
541
2
  const MS_PER_DAY = 864e5;
542
3
  function Day(t) {
@@ -600,75 +61,223 @@ function DateFromTime(t) {
600
61
  if (mft === 11) return dwy - 333 - leap;
601
62
  throw new Error("Invalid time");
602
63
  }
603
- // node_modules/.aspect_rules_js/temporal-polyfill@1.0.6/node_modules/temporal-polyfill/chunks/root.js
604
- const NativeTemporal = globalThis.Temporal;
605
- // node_modules/.aspect_rules_js/temporal-polyfill@1.0.6/node_modules/temporal-polyfill/chunks/funcApi-native.js
606
- function refineNativeCalendarArgMaybe(calendarRecord) {
607
- if (void 0 !== calendarRecord) return getValidatedCalendarId(calendarRecord);
608
- }
609
- function getValidatedCalendarId(record) {
610
- return getCalendarRecordImplCreator(record), getCalendarRecordId(record);
611
- }
612
- const getNativePlainDate = getPlainDateSlots;
613
- const NativePlainDateRecord = /*@__PURE__*/ defineTemporalClass(PlainDateRecordBranding, class {
614
- get calendarId() {
615
- return getNativePlainDate(this).calendarId;
64
+ // packages/ecma402-abstract/Calendar/Arithmetic.js
65
+ const monthStarts = [
66
+ 0,
67
+ 31,
68
+ 59,
69
+ 90,
70
+ 120,
71
+ 151,
72
+ 181,
73
+ 212,
74
+ 243,
75
+ 273,
76
+ 304,
77
+ 334
78
+ ];
79
+ const mod = (value, divisor) => value - Math.floor(value / divisor) * divisor;
80
+ function integer(value) {
81
+ if (!Number.isSafeInteger(value)) throw new RangeError("Expected safe integer");
82
+ return value;
83
+ }
84
+ function HebrewLeapYear(year) {
85
+ return mod(7 * year + 1, 19) < 7;
86
+ }
87
+ function HebrewElapsedMonths(year) {
88
+ return Math.floor((235 * year - 234) / 19);
89
+ }
90
+ function hebrewDelay(year) {
91
+ const months = HebrewElapsedMonths(year);
92
+ const day = 29 * months + Math.floor((12084 + 13753 * months) / 25920);
93
+ return day + Number(mod(3 * (day + 1), 7) < 3);
94
+ }
95
+ function IsISOCalendar(calendar) {
96
+ return [
97
+ "iso8601",
98
+ "gregory",
99
+ "buddhist",
100
+ "japanese",
101
+ "roc"
102
+ ].includes(calendar);
103
+ }
104
+ function CalendarISOYear(calendar, year) {
105
+ return year + (calendar === "buddhist" ? -543 : calendar === "roc" ? 1911 : 0);
106
+ }
107
+ function ArithmeticCalendarStartOfYear(calendar, year) {
108
+ if (IsISOCalendar(calendar)) return DayFromYear(CalendarISOYear(calendar, year));
109
+ switch (calendar) {
110
+ case "coptic": return -615923 + 365 * year + Math.floor(year / 4);
111
+ case "ethiopic": return -716732 + 365 * year + Math.floor(year / 4);
112
+ case "ethioaa": {
113
+ const value = year - 5500;
114
+ return -716732 + 365 * value + Math.floor(value / 4);
115
+ }
116
+ case "indian": return DayFromYear(year + 78) + 80;
117
+ case "islamic-civil":
118
+ case "islamic-tbla": return -492148 - Number(calendar === "islamic-tbla") + 354 * (year - 1) + Math.floor((3 + 11 * year) / 30);
119
+ case "persian": return -492268 + 365 * (year - 1) + Math.floor((8 * year + 21) / 33);
616
120
  }
617
- toJSON() {
618
- return getNativePlainDate(this).toJSON();
121
+ const present = hebrewDelay(year);
122
+ return -2092590 + present + (hebrewDelay(year + 1) - present === 356 ? 2 : present - hebrewDelay(year - 1) === 382 ? 1 : 0);
123
+ }
124
+ function ArithmeticCalendarMonthsInYear(calendar, year) {
125
+ return [
126
+ "coptic",
127
+ "ethiopic",
128
+ "ethioaa"
129
+ ].includes(calendar) || calendar === "hebrew" && HebrewLeapYear(year) ? 13 : 12;
130
+ }
131
+ function ArithmeticCalendarDaysInMonth(calendar, year, month) {
132
+ const count = ArithmeticCalendarMonthsInYear(calendar, year);
133
+ if (integer(month) < 1 || month > count) throw new RangeError("Invalid calendar month");
134
+ if (IsISOCalendar(calendar)) return month === 12 ? 31 : monthStarts[month] - monthStarts[month - 1] + Number(month === 2 && DaysInYear(CalendarISOYear(calendar, year)) === 366);
135
+ const length = ArithmeticCalendarStartOfYear(calendar, year + 1) - ArithmeticCalendarStartOfYear(calendar, year);
136
+ if ([
137
+ "coptic",
138
+ "ethiopic",
139
+ "ethioaa"
140
+ ].includes(calendar)) return month === 13 ? length - 360 : 30;
141
+ if (calendar === "indian") return month === 1 ? 30 + Number(DaysInYear(year + 78) === 366) : month <= 6 ? 31 : 30;
142
+ if (calendar === "islamic-civil" || calendar === "islamic-tbla") return month % 2 === 1 || month === 12 && length === 355 ? 30 : 29;
143
+ if (calendar === "persian") return month <= 6 ? 31 : month < 12 ? 30 : length - 336;
144
+ const code = month + Number(!HebrewLeapYear(year) && month >= 6);
145
+ if ([
146
+ 4,
147
+ 7,
148
+ 9,
149
+ 11,
150
+ 13
151
+ ].includes(code)) return 29;
152
+ if (code === 2) return length % 10 === 5 ? 30 : 29;
153
+ if (code === 3) return length % 10 === 3 ? 29 : 30;
154
+ return 30;
155
+ }
156
+ function ArithmeticCalendarMonthCode(calendar, year, month) {
157
+ const leap = calendar === "hebrew" && HebrewLeapYear(year);
158
+ if (leap && month === 6) return "M05L";
159
+ const code = month - Number(leap && month > 6);
160
+ return "M" + (code < 10 ? "0" : "") + code;
161
+ }
162
+ function ArithmeticCalendarFromEpochDay(calendar, epoch) {
163
+ const t = epoch * 864e5, civilYear = YearFromTime(t);
164
+ if (IsISOCalendar(calendar)) {
165
+ const year = civilYear - (calendar === "buddhist" ? -543 : calendar === "roc" ? 1911 : 0), month = MonthFromTime(t) + 1;
166
+ return {
167
+ year,
168
+ month,
169
+ monthCode: ArithmeticCalendarMonthCode(calendar, year, month),
170
+ day: DateFromTime(t)
171
+ };
619
172
  }
620
- valueOf() {
621
- return getNativePlainDate(this).valueOf();
173
+ const jd = epoch + 2440588;
174
+ let year;
175
+ switch (calendar) {
176
+ case "coptic":
177
+ year = Math.floor((4 * (jd - 1824665) + 3) / 1461);
178
+ break;
179
+ case "ethiopic":
180
+ case "ethioaa":
181
+ year = Math.floor((4 * (jd - 1723856) + 3) / 1461) + (calendar === "ethioaa" ? 5500 : 0);
182
+ break;
183
+ case "islamic-civil":
184
+ case "islamic-tbla":
185
+ year = Math.floor((30 * (jd - 1948440 + Number(calendar === "islamic-tbla")) + 10646) / 10631);
186
+ break;
187
+ case "persian":
188
+ year = 1 + Math.floor((33 * (jd - 1948320) + 3) / 12053);
189
+ break;
190
+ case "indian":
191
+ year = civilYear - 78;
192
+ break;
193
+ default: year = Math.floor((epoch + 2092590) * 492480 / 179876755) + 1;
622
194
  }
623
- }, getNativePlainDate, dateFieldGetters);
624
- function createNativePlainDateRecord(native) {
625
- const instance = Object.create(NativePlainDateRecord.prototype);
626
- return setPlainDateSlots(instance, native), attachDebugString(instance), instance;
627
- }
628
- function create$2$1(isoYear, isoMonth, isoDay, calendar) {
629
- return createNativePlainDateRecord(new NativeTemporal.PlainDate(isoYear, isoMonth, isoDay, refineNativeCalendarArgMaybe(calendar)));
630
- }
631
- function inLeapYear$1$1(record) {
632
- return getNativePlainDate(record).inLeapYear;
633
- }
634
- // node_modules/.aspect_rules_js/temporal-polyfill@1.0.6/node_modules/temporal-polyfill/chunks/funcApi-shim.js
635
- function refineShimCalendarArgMaybe(calendarRecord) {
636
- return void 0 === calendarRecord ? void 0 : getCalendarRecordImpl(calendarRecord);
637
- }
638
- function getCalendarRecordImpl(record) {
639
- return getCalendarRecordImplCreator(record)();
195
+ while (ArithmeticCalendarStartOfYear(calendar, year) > epoch) year--;
196
+ while (ArithmeticCalendarStartOfYear(calendar, year + 1) <= epoch) year++;
197
+ let month = 1, remaining = epoch - ArithmeticCalendarStartOfYear(calendar, year);
198
+ while (remaining >= ArithmeticCalendarDaysInMonth(calendar, year, month)) remaining -= ArithmeticCalendarDaysInMonth(calendar, year, month++);
199
+ return {
200
+ year,
201
+ month,
202
+ monthCode: ArithmeticCalendarMonthCode(calendar, year, month),
203
+ day: remaining + 1
204
+ };
640
205
  }
641
- const getShimPlainDateSlots = getPlainDateSlots;
642
- const ShimPlainDateRecord = /*@__PURE__*/ defineTemporalClass(PlainDateRecordBranding, class {
643
- get calendarId() {
644
- return getCalendarSlotId(getShimPlainDateSlots(this).calendar);
645
- }
646
- toJSON() {
647
- return formatDateIsoAuto(getShimPlainDateSlots(this));
648
- }
649
- valueOf() {
650
- return forbiddenValueOf();
206
+ const JapaneseEras = [
207
+ [
208
+ 18017,
209
+ "reiwa",
210
+ 2018
211
+ ],
212
+ [
213
+ 6947,
214
+ "heisei",
215
+ 1988
216
+ ],
217
+ [
218
+ -15713,
219
+ "showa",
220
+ 1925
221
+ ],
222
+ [
223
+ -20974,
224
+ "taisho",
225
+ 1911
226
+ ],
227
+ [
228
+ -35428,
229
+ "meiji",
230
+ 1867
231
+ ]
232
+ ];
233
+ function ArithmeticCalendarEra(calendar, epoch, year) {
234
+ switch (calendar) {
235
+ case "iso8601": return;
236
+ case "buddhist": return {
237
+ era: "be",
238
+ eraYear: year
239
+ };
240
+ case "coptic":
241
+ case "hebrew": return {
242
+ era: "am",
243
+ eraYear: year
244
+ };
245
+ case "ethiopic": return {
246
+ era: year > 0 ? "am" : "aa",
247
+ eraYear: year > 0 ? year : year + 5500
248
+ };
249
+ case "ethioaa": return {
250
+ era: "aa",
251
+ eraYear: year
252
+ };
253
+ case "indian": return {
254
+ era: "shaka",
255
+ eraYear: year
256
+ };
257
+ case "persian": return {
258
+ era: "ap",
259
+ eraYear: year
260
+ };
261
+ case "roc": return {
262
+ era: year > 0 ? "roc" : "broc",
263
+ eraYear: year > 0 ? year : 1 - year
264
+ };
265
+ case "islamic-civil":
266
+ case "islamic-tbla": return {
267
+ era: year > 0 ? "ah" : "bh",
268
+ eraYear: year > 0 ? year : 1 - year
269
+ };
270
+ case "japanese": for (const [start, era, offset] of JapaneseEras) if (epoch >= start) return {
271
+ era,
272
+ eraYear: year - offset
273
+ };
651
274
  }
652
- }, getShimPlainDateSlots, dateFieldGetters$1);
653
- function createShimPlainDateRecord(slots) {
654
- const instance = Object.create(ShimPlainDateRecord.prototype);
655
- return setPlainDateSlots(instance, slots), attachDebugString(instance), instance;
656
- }
657
- function create$2(isoYear, isoMonth, isoDay, calendar) {
658
- return createShimPlainDateRecord(createDateSlots(checkIsoDateInBounds(validateIsoDateFields(mapProps(toIntegerWithTrunc, {
659
- year: isoYear,
660
- month: isoMonth,
661
- day: isoDay
662
- }))), refineShimCalendarArgMaybe(calendar)));
663
- }
664
- function inLeapYear$1(record) {
665
- const slots = getShimPlainDateSlots(record);
666
- return computeCalendarInLeapYear(slots.calendar, slots);
275
+ return {
276
+ era: year > 0 ? "ce" : "bce",
277
+ eraYear: year > 0 ? year : 1 - year
278
+ };
667
279
  }
668
- // node_modules/.aspect_rules_js/temporal-polyfill@1.0.6/node_modules/temporal-polyfill/fns/PlainDate.js
669
- const create = NativeTemporal ? create$2$1 : create$2;
670
- const inLeapYear = NativeTemporal ? inLeapYear$1$1 : inLeapYear$1;
671
- // packages/intl-datetimeformat/calendars/temporal.js
280
+ // packages/intl-datetimeformat/calendars/arithmetic.js
672
281
  const eras = {
673
282
  be: "0",
674
283
  am: "1",
@@ -688,19 +297,21 @@ const eras = {
688
297
  ap: "0"
689
298
  };
690
299
  /**
691
- * Adapt Temporal calendar fields to CLDR era keys and month-name indices.
300
+ * Adapt shared calendar fields to CLDR era keys and month-name indices.
692
301
  * This is an implementation helper for ECMA-402 ToLocalTime, not a spec AO.
693
302
  * https://tc39.es/ecma402/#sec-tolocaltime
694
303
  * https://unicode.org/reports/tr35/tr35-dates.html#Calendar_Elements
695
304
  */
696
- function temporalCalendar(calendar, getCalendar, hebrew = false) {
305
+ function arithmeticCalendar(calendar, hebrew = false) {
697
306
  return {
698
307
  calendar,
699
308
  dateFromTime(t) {
700
- const date = create(YearFromTime(t), MonthFromTime(t) + 1, DateFromTime(t), getCalendar());
309
+ const epochDay = Math.floor(t / 864e5);
310
+ if (!Number.isFinite(t) || epochDay < -100000001 || epochDay > 1e8) throw new RangeError("Calendar date out of range");
311
+ const date = ArithmeticCalendarFromEpochDay(calendar, epochDay);
701
312
  if (hebrew) {
702
313
  const monthCode = Number(date.monthCode.slice(1, 3));
703
- const monthNameIndex = date.monthCode === "M05L" ? 5 : monthCode === 6 && inLeapYear(date) ? 13 : monthCode >= 6 ? monthCode : monthCode - 1;
314
+ const monthNameIndex = date.monthCode === "M05L" ? 5 : monthCode === 6 && ArithmeticCalendarMonthsInYear(calendar, date.year) === 13 ? 13 : monthCode >= 6 ? monthCode : monthCode - 1;
704
315
  return {
705
316
  era: "0",
706
317
  year: date.year,
@@ -709,9 +320,10 @@ function temporalCalendar(calendar, getCalendar, hebrew = false) {
709
320
  day: date.day
710
321
  };
711
322
  }
323
+ const era = ArithmeticCalendarEra(calendar, epochDay, date.year);
712
324
  return {
713
- era: eras[date.era],
714
- year: date.eraYear ?? date.year,
325
+ era: eras[era.era],
326
+ year: era?.eraYear ?? date.year,
715
327
  month: date.month - 1,
716
328
  day: date.day
717
329
  };
@@ -719,7 +331,7 @@ function temporalCalendar(calendar, getCalendar, hebrew = false) {
719
331
  };
720
332
  }
721
333
  // packages/intl-datetimeformat/calendars/implementations/hebrew.js
722
- const data = temporalCalendar("hebrew", getHebrew, true);
334
+ const data = arithmeticCalendar("hebrew", true);
723
335
  // packages/intl-datetimeformat/register-calendar-data.ts
724
336
  /** Register after installation, or queue until the polyfill is installed. */
725
337
  function registerCalendarData(...data) {