@internationalized/date 3.5.3-nightly.4555 → 3.5.3-nightly.4560

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.
Files changed (96) hide show
  1. package/dist/BuddhistCalendar.main.js +54 -0
  2. package/dist/BuddhistCalendar.main.js.map +1 -0
  3. package/dist/BuddhistCalendar.mjs +49 -0
  4. package/dist/BuddhistCalendar.module.js +49 -0
  5. package/dist/BuddhistCalendar.module.js.map +1 -0
  6. package/dist/CalendarDate.main.js +260 -0
  7. package/dist/CalendarDate.main.js.map +1 -0
  8. package/dist/CalendarDate.mjs +252 -0
  9. package/dist/CalendarDate.module.js +252 -0
  10. package/dist/CalendarDate.module.js.map +1 -0
  11. package/dist/DateFormatter.main.js +145 -0
  12. package/dist/DateFormatter.main.js.map +1 -0
  13. package/dist/DateFormatter.mjs +140 -0
  14. package/dist/DateFormatter.module.js +140 -0
  15. package/dist/DateFormatter.module.js.map +1 -0
  16. package/dist/EthiopicCalendar.main.js +170 -0
  17. package/dist/EthiopicCalendar.main.js.map +1 -0
  18. package/dist/EthiopicCalendar.mjs +163 -0
  19. package/dist/EthiopicCalendar.module.js +163 -0
  20. package/dist/EthiopicCalendar.module.js.map +1 -0
  21. package/dist/GregorianCalendar.main.js +143 -0
  22. package/dist/GregorianCalendar.main.js.map +1 -0
  23. package/dist/GregorianCalendar.mjs +134 -0
  24. package/dist/GregorianCalendar.module.js +134 -0
  25. package/dist/GregorianCalendar.module.js.map +1 -0
  26. package/dist/HebrewCalendar.main.js +149 -0
  27. package/dist/HebrewCalendar.main.js.map +1 -0
  28. package/dist/HebrewCalendar.mjs +144 -0
  29. package/dist/HebrewCalendar.module.js +144 -0
  30. package/dist/HebrewCalendar.module.js.map +1 -0
  31. package/dist/IndianCalendar.main.js +107 -0
  32. package/dist/IndianCalendar.main.js.map +1 -0
  33. package/dist/IndianCalendar.mjs +102 -0
  34. package/dist/IndianCalendar.module.js +102 -0
  35. package/dist/IndianCalendar.module.js.map +1 -0
  36. package/dist/IslamicCalendar.main.js +164 -0
  37. package/dist/IslamicCalendar.main.js.map +1 -0
  38. package/dist/IslamicCalendar.mjs +157 -0
  39. package/dist/IslamicCalendar.module.js +157 -0
  40. package/dist/IslamicCalendar.module.js.map +1 -0
  41. package/dist/JapaneseCalendar.main.js +180 -0
  42. package/dist/JapaneseCalendar.main.js.map +1 -0
  43. package/dist/JapaneseCalendar.mjs +175 -0
  44. package/dist/JapaneseCalendar.module.js +175 -0
  45. package/dist/JapaneseCalendar.module.js.map +1 -0
  46. package/dist/PersianCalendar.main.js +81 -0
  47. package/dist/PersianCalendar.main.js.map +1 -0
  48. package/dist/PersianCalendar.mjs +76 -0
  49. package/dist/PersianCalendar.module.js +76 -0
  50. package/dist/PersianCalendar.module.js.map +1 -0
  51. package/dist/TaiwanCalendar.main.js +81 -0
  52. package/dist/TaiwanCalendar.main.js.map +1 -0
  53. package/dist/TaiwanCalendar.mjs +76 -0
  54. package/dist/TaiwanCalendar.module.js +76 -0
  55. package/dist/TaiwanCalendar.module.js.map +1 -0
  56. package/dist/conversion.main.js +236 -0
  57. package/dist/conversion.main.js.map +1 -0
  58. package/dist/conversion.mjs +218 -0
  59. package/dist/conversion.module.js +218 -0
  60. package/dist/conversion.module.js.map +1 -0
  61. package/dist/createCalendar.main.js +69 -0
  62. package/dist/createCalendar.main.js.map +1 -0
  63. package/dist/createCalendar.mjs +64 -0
  64. package/dist/createCalendar.module.js +64 -0
  65. package/dist/createCalendar.module.js.map +1 -0
  66. package/dist/import.mjs +15 -2534
  67. package/dist/main.js +75 -2594
  68. package/dist/main.js.map +1 -1
  69. package/dist/manipulation.main.js +362 -0
  70. package/dist/manipulation.main.js.map +1 -0
  71. package/dist/manipulation.mjs +344 -0
  72. package/dist/manipulation.module.js +344 -0
  73. package/dist/manipulation.module.js.map +1 -0
  74. package/dist/module.js +15 -2534
  75. package/dist/module.js.map +1 -1
  76. package/dist/queries.main.js +287 -0
  77. package/dist/queries.main.js.map +1 -0
  78. package/dist/queries.mjs +256 -0
  79. package/dist/queries.module.js +256 -0
  80. package/dist/queries.module.js.map +1 -0
  81. package/dist/string.main.js +171 -0
  82. package/dist/string.main.js.map +1 -0
  83. package/dist/string.mjs +156 -0
  84. package/dist/string.module.js +156 -0
  85. package/dist/string.module.js.map +1 -0
  86. package/dist/utils.main.js +33 -0
  87. package/dist/utils.main.js.map +1 -0
  88. package/dist/utils.mjs +28 -0
  89. package/dist/utils.module.js +28 -0
  90. package/dist/utils.module.js.map +1 -0
  91. package/dist/weekStartData.main.js +118 -0
  92. package/dist/weekStartData.main.js.map +1 -0
  93. package/dist/weekStartData.mjs +113 -0
  94. package/dist/weekStartData.module.js +113 -0
  95. package/dist/weekStartData.module.js.map +1 -0
  96. package/package.json +2 -2
package/dist/module.js CHANGED
@@ -1,2369 +1,18 @@
1
- import {_ as $cUVuN$_} from "@swc/helpers/_/_class_private_field_init";
2
-
3
- /*
4
- * Copyright 2020 Adobe. All rights reserved.
5
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License. You may obtain a copy
7
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
8
- *
9
- * Unless required by applicable law or agreed to in writing, software distributed under
10
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
11
- * OF ANY KIND, either express or implied. See the License for the specific language
12
- * governing permissions and limitations under the License.
13
- */ /*
14
- * Copyright 2020 Adobe. All rights reserved.
15
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
16
- * you may not use this file except in compliance with the License. You may obtain a copy
17
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
18
- *
19
- * Unless required by applicable law or agreed to in writing, software distributed under
20
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
21
- * OF ANY KIND, either express or implied. See the License for the specific language
22
- * governing permissions and limitations under the License.
23
- */
24
- /*
25
- * Copyright 2020 Adobe. All rights reserved.
26
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
27
- * you may not use this file except in compliance with the License. You may obtain a copy
28
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
29
- *
30
- * Unless required by applicable law or agreed to in writing, software distributed under
31
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
32
- * OF ANY KIND, either express or implied. See the License for the specific language
33
- * governing permissions and limitations under the License.
34
- */ /*
35
- * Copyright 2020 Adobe. All rights reserved.
36
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
37
- * you may not use this file except in compliance with the License. You may obtain a copy
38
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
39
- *
40
- * Unless required by applicable law or agreed to in writing, software distributed under
41
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
42
- * OF ANY KIND, either express or implied. See the License for the specific language
43
- * governing permissions and limitations under the License.
44
- */ // Portions of the code in this file are based on code from the TC39 Temporal proposal.
45
- // Original licensing can be found in the NOTICE file in the root directory of this source tree.
46
-
47
-
48
- /*
49
- * Copyright 2020 Adobe. All rights reserved.
50
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
51
- * you may not use this file except in compliance with the License. You may obtain a copy
52
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
53
- *
54
- * Unless required by applicable law or agreed to in writing, software distributed under
55
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
56
- * OF ANY KIND, either express or implied. See the License for the specific language
57
- * governing permissions and limitations under the License.
58
- */ // Portions of the code in this file are based on code from ICU.
59
- // Original licensing can be found in the NOTICE file in the root directory of this source tree.
60
-
61
- /*
62
- * Copyright 2020 Adobe. All rights reserved.
63
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
64
- * you may not use this file except in compliance with the License. You may obtain a copy
65
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
66
- *
67
- * Unless required by applicable law or agreed to in writing, software distributed under
68
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
69
- * OF ANY KIND, either express or implied. See the License for the specific language
70
- * governing permissions and limitations under the License.
71
- */
72
- function $2b4dce13dd5a17fa$export$842a2cf37af977e1(amount, numerator) {
73
- return amount - numerator * Math.floor(amount / numerator);
74
- }
75
- function $2b4dce13dd5a17fa$export$784d13d8ee351f07(date) {
76
- if (date.era) return new (0, $35ea8db9cb2ccb90$export$99faa760c7908e4f)(date.calendar, date.era, date.year, date.month, date.day);
77
- else return new (0, $35ea8db9cb2ccb90$export$99faa760c7908e4f)(date.calendar, date.year, date.month, date.day);
78
- }
79
- function $2b4dce13dd5a17fa$export$27fa0172ae2644b3(date) {
80
- if (date.era) return new (0, $35ea8db9cb2ccb90$export$ca871e8dbb80966f)(date.calendar, date.era, date.year, date.month, date.day, date.hour, date.minute, date.second, date.millisecond);
81
- else return new (0, $35ea8db9cb2ccb90$export$ca871e8dbb80966f)(date.calendar, date.year, date.month, date.day, date.hour, date.minute, date.second);
82
- }
83
-
84
-
85
- const $3b62074eb05584b2$var$EPOCH = 1721426; // 001/01/03 Julian C.E.
86
- function $3b62074eb05584b2$export$f297eb839006d339(era, year, month, day) {
87
- year = $3b62074eb05584b2$export$c36e0ecb2d4fa69d(era, year);
88
- let y1 = year - 1;
89
- let monthOffset = -2;
90
- if (month <= 2) monthOffset = 0;
91
- else if ($3b62074eb05584b2$export$553d7fa8e3805fc0(year)) monthOffset = -1;
92
- return $3b62074eb05584b2$var$EPOCH - 1 + 365 * y1 + Math.floor(y1 / 4) - Math.floor(y1 / 100) + Math.floor(y1 / 400) + Math.floor((367 * month - 362) / 12 + monthOffset + day);
93
- }
94
- function $3b62074eb05584b2$export$553d7fa8e3805fc0(year) {
95
- return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);
96
- }
97
- function $3b62074eb05584b2$export$c36e0ecb2d4fa69d(era, year) {
98
- return era === "BC" ? 1 - year : year;
99
- }
100
- function $3b62074eb05584b2$export$4475b7e617eb123c(year) {
101
- let era = "AD";
102
- if (year <= 0) {
103
- era = "BC";
104
- year = 1 - year;
105
- }
106
- return [
107
- era,
108
- year
109
- ];
110
- }
111
- const $3b62074eb05584b2$var$daysInMonth = {
112
- standard: [
113
- 31,
114
- 28,
115
- 31,
116
- 30,
117
- 31,
118
- 30,
119
- 31,
120
- 31,
121
- 30,
122
- 31,
123
- 30,
124
- 31
125
- ],
126
- leapyear: [
127
- 31,
128
- 29,
129
- 31,
130
- 30,
131
- 31,
132
- 30,
133
- 31,
134
- 31,
135
- 30,
136
- 31,
137
- 30,
138
- 31
139
- ]
140
- };
141
- class $3b62074eb05584b2$export$80ee6245ec4f29ec {
142
- fromJulianDay(jd) {
143
- let jd0 = jd;
144
- let depoch = jd0 - $3b62074eb05584b2$var$EPOCH;
145
- let quadricent = Math.floor(depoch / 146097);
146
- let dqc = (0, $2b4dce13dd5a17fa$export$842a2cf37af977e1)(depoch, 146097);
147
- let cent = Math.floor(dqc / 36524);
148
- let dcent = (0, $2b4dce13dd5a17fa$export$842a2cf37af977e1)(dqc, 36524);
149
- let quad = Math.floor(dcent / 1461);
150
- let dquad = (0, $2b4dce13dd5a17fa$export$842a2cf37af977e1)(dcent, 1461);
151
- let yindex = Math.floor(dquad / 365);
152
- let extendedYear = quadricent * 400 + cent * 100 + quad * 4 + yindex + (cent !== 4 && yindex !== 4 ? 1 : 0);
153
- let [era, year] = $3b62074eb05584b2$export$4475b7e617eb123c(extendedYear);
154
- let yearDay = jd0 - $3b62074eb05584b2$export$f297eb839006d339(era, year, 1, 1);
155
- let leapAdj = 2;
156
- if (jd0 < $3b62074eb05584b2$export$f297eb839006d339(era, year, 3, 1)) leapAdj = 0;
157
- else if ($3b62074eb05584b2$export$553d7fa8e3805fc0(year)) leapAdj = 1;
158
- let month = Math.floor(((yearDay + leapAdj) * 12 + 373) / 367);
159
- let day = jd0 - $3b62074eb05584b2$export$f297eb839006d339(era, year, month, 1) + 1;
160
- return new (0, $35ea8db9cb2ccb90$export$99faa760c7908e4f)(era, year, month, day);
161
- }
162
- toJulianDay(date) {
163
- return $3b62074eb05584b2$export$f297eb839006d339(date.era, date.year, date.month, date.day);
164
- }
165
- getDaysInMonth(date) {
166
- return $3b62074eb05584b2$var$daysInMonth[$3b62074eb05584b2$export$553d7fa8e3805fc0(date.year) ? "leapyear" : "standard"][date.month - 1];
167
- }
168
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
169
- getMonthsInYear(date) {
170
- return 12;
171
- }
172
- getDaysInYear(date) {
173
- return $3b62074eb05584b2$export$553d7fa8e3805fc0(date.year) ? 366 : 365;
174
- }
175
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
176
- getYearsInEra(date) {
177
- return 9999;
178
- }
179
- getEras() {
180
- return [
181
- "BC",
182
- "AD"
183
- ];
184
- }
185
- isInverseEra(date) {
186
- return date.era === "BC";
187
- }
188
- balanceDate(date) {
189
- if (date.year <= 0) {
190
- date.era = date.era === "BC" ? "AD" : "BC";
191
- date.year = 1 - date.year;
192
- }
193
- }
194
- constructor(){
195
- this.identifier = "gregory";
196
- }
197
- }
198
-
199
-
200
- /*
201
- * Copyright 2020 Adobe. All rights reserved.
202
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
203
- * you may not use this file except in compliance with the License. You may obtain a copy
204
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
205
- *
206
- * Unless required by applicable law or agreed to in writing, software distributed under
207
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
208
- * OF ANY KIND, either express or implied. See the License for the specific language
209
- * governing permissions and limitations under the License.
210
- */
211
- /*
212
- * Copyright 2020 Adobe. All rights reserved.
213
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
214
- * you may not use this file except in compliance with the License. You may obtain a copy
215
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
216
- *
217
- * Unless required by applicable law or agreed to in writing, software distributed under
218
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
219
- * OF ANY KIND, either express or implied. See the License for the specific language
220
- * governing permissions and limitations under the License.
221
- */ // Data from https://github.com/unicode-cldr/cldr-core/blob/master/supplemental/weekData.json
222
- // Locales starting on Sunday have been removed for compression.
223
- const $2fe286d2fb449abb$export$7a5acbd77d414bd9 = {
224
- "001": 1,
225
- AD: 1,
226
- AE: 6,
227
- AF: 6,
228
- AI: 1,
229
- AL: 1,
230
- AM: 1,
231
- AN: 1,
232
- AR: 1,
233
- AT: 1,
234
- AU: 1,
235
- AX: 1,
236
- AZ: 1,
237
- BA: 1,
238
- BE: 1,
239
- BG: 1,
240
- BH: 6,
241
- BM: 1,
242
- BN: 1,
243
- BY: 1,
244
- CH: 1,
245
- CL: 1,
246
- CM: 1,
247
- CN: 1,
248
- CR: 1,
249
- CY: 1,
250
- CZ: 1,
251
- DE: 1,
252
- DJ: 6,
253
- DK: 1,
254
- DZ: 6,
255
- EC: 1,
256
- EE: 1,
257
- EG: 6,
258
- ES: 1,
259
- FI: 1,
260
- FJ: 1,
261
- FO: 1,
262
- FR: 1,
263
- GB: 1,
264
- GE: 1,
265
- GF: 1,
266
- GP: 1,
267
- GR: 1,
268
- HR: 1,
269
- HU: 1,
270
- IE: 1,
271
- IQ: 6,
272
- IR: 6,
273
- IS: 1,
274
- IT: 1,
275
- JO: 6,
276
- KG: 1,
277
- KW: 6,
278
- KZ: 1,
279
- LB: 1,
280
- LI: 1,
281
- LK: 1,
282
- LT: 1,
283
- LU: 1,
284
- LV: 1,
285
- LY: 6,
286
- MC: 1,
287
- MD: 1,
288
- ME: 1,
289
- MK: 1,
290
- MN: 1,
291
- MQ: 1,
292
- MV: 5,
293
- MY: 1,
294
- NL: 1,
295
- NO: 1,
296
- NZ: 1,
297
- OM: 6,
298
- PL: 1,
299
- QA: 6,
300
- RE: 1,
301
- RO: 1,
302
- RS: 1,
303
- RU: 1,
304
- SD: 6,
305
- SE: 1,
306
- SI: 1,
307
- SK: 1,
308
- SM: 1,
309
- SY: 6,
310
- TJ: 1,
311
- TM: 1,
312
- TR: 1,
313
- UA: 1,
314
- UY: 1,
315
- UZ: 1,
316
- VA: 1,
317
- VN: 1,
318
- XK: 1
319
- };
320
-
321
-
322
- function $14e0f24ef4ac5c92$export$ea39ec197993aef0(a, b) {
323
- b = (0, $11d87f3f76e88657$export$b4a036af3fc0b032)(b, a.calendar);
324
- return a.era === b.era && a.year === b.year && a.month === b.month && a.day === b.day;
325
- }
326
- function $14e0f24ef4ac5c92$export$a18c89cbd24170ff(a, b) {
327
- b = (0, $11d87f3f76e88657$export$b4a036af3fc0b032)(b, a.calendar);
328
- // In the Japanese calendar, months can span multiple eras/years, so only compare the first of the month.
329
- a = $14e0f24ef4ac5c92$export$a5a3b454ada2268e(a);
330
- b = $14e0f24ef4ac5c92$export$a5a3b454ada2268e(b);
331
- return a.era === b.era && a.year === b.year && a.month === b.month;
332
- }
333
- function $14e0f24ef4ac5c92$export$5841f9eb9773f25f(a, b) {
334
- b = (0, $11d87f3f76e88657$export$b4a036af3fc0b032)(b, a.calendar);
335
- a = $14e0f24ef4ac5c92$export$f91e89d3d0406102(a);
336
- b = $14e0f24ef4ac5c92$export$f91e89d3d0406102(b);
337
- return a.era === b.era && a.year === b.year;
338
- }
339
- function $14e0f24ef4ac5c92$export$91b62ebf2ba703ee(a, b) {
340
- return a.calendar.identifier === b.calendar.identifier && a.era === b.era && a.year === b.year && a.month === b.month && a.day === b.day;
341
- }
342
- function $14e0f24ef4ac5c92$export$5a8da0c44a3afdf2(a, b) {
343
- a = $14e0f24ef4ac5c92$export$a5a3b454ada2268e(a);
344
- b = $14e0f24ef4ac5c92$export$a5a3b454ada2268e(b);
345
- return a.calendar.identifier === b.calendar.identifier && a.era === b.era && a.year === b.year && a.month === b.month;
346
- }
347
- function $14e0f24ef4ac5c92$export$ea840f5a6dda8147(a, b) {
348
- a = $14e0f24ef4ac5c92$export$f91e89d3d0406102(a);
349
- b = $14e0f24ef4ac5c92$export$f91e89d3d0406102(b);
350
- return a.calendar.identifier === b.calendar.identifier && a.era === b.era && a.year === b.year;
351
- }
352
- function $14e0f24ef4ac5c92$export$629b0a497aa65267(date, timeZone) {
353
- return $14e0f24ef4ac5c92$export$ea39ec197993aef0(date, $14e0f24ef4ac5c92$export$d0bdf45af03a6ea3(timeZone));
354
- }
355
- function $14e0f24ef4ac5c92$export$2061056d06d7cdf7(date, locale) {
356
- let julian = date.calendar.toJulianDay(date);
357
- // If julian is negative, then julian % 7 will be negative, so we adjust
358
- // accordingly. Julian day 0 is Monday.
359
- let dayOfWeek = Math.ceil(julian + 1 - $14e0f24ef4ac5c92$var$getWeekStart(locale)) % 7;
360
- if (dayOfWeek < 0) dayOfWeek += 7;
361
- return dayOfWeek;
362
- }
363
- function $14e0f24ef4ac5c92$export$461939dd4422153(timeZone) {
364
- return (0, $11d87f3f76e88657$export$1b96692a1ba042ac)(Date.now(), timeZone);
365
- }
366
- function $14e0f24ef4ac5c92$export$d0bdf45af03a6ea3(timeZone) {
367
- return (0, $11d87f3f76e88657$export$93522d1a439f3617)($14e0f24ef4ac5c92$export$461939dd4422153(timeZone));
368
- }
369
- function $14e0f24ef4ac5c92$export$68781ddf31c0090f(a, b) {
370
- return a.calendar.toJulianDay(a) - b.calendar.toJulianDay(b);
371
- }
372
- function $14e0f24ef4ac5c92$export$c19a80a9721b80f6(a, b) {
373
- return $14e0f24ef4ac5c92$var$timeToMs(a) - $14e0f24ef4ac5c92$var$timeToMs(b);
374
- }
375
- function $14e0f24ef4ac5c92$var$timeToMs(a) {
376
- return a.hour * 3600000 + a.minute * 60000 + a.second * 1000 + a.millisecond;
377
- }
378
- function $14e0f24ef4ac5c92$export$126c91c941de7e(a, timeZone) {
379
- let ms = (0, $11d87f3f76e88657$export$5107c82f94518f5c)(a, timeZone);
380
- let tomorrow = a.add({
381
- days: 1
382
- });
383
- let tomorrowMs = (0, $11d87f3f76e88657$export$5107c82f94518f5c)(tomorrow, timeZone);
384
- return (tomorrowMs - ms) / 3600000;
385
- }
386
- let $14e0f24ef4ac5c92$var$localTimeZone = null;
387
- function $14e0f24ef4ac5c92$export$aa8b41735afcabd2() {
388
- // TODO: invalidate this somehow?
389
- if ($14e0f24ef4ac5c92$var$localTimeZone == null) $14e0f24ef4ac5c92$var$localTimeZone = new Intl.DateTimeFormat().resolvedOptions().timeZone;
390
- return $14e0f24ef4ac5c92$var$localTimeZone;
391
- }
392
- function $14e0f24ef4ac5c92$export$a5a3b454ada2268e(date) {
393
- // Use `subtract` instead of `set` so we don't get constrained in an era.
394
- return date.subtract({
395
- days: date.day - 1
396
- });
397
- }
398
- function $14e0f24ef4ac5c92$export$a2258d9c4118825c(date) {
399
- return date.add({
400
- days: date.calendar.getDaysInMonth(date) - date.day
401
- });
402
- }
403
- function $14e0f24ef4ac5c92$export$f91e89d3d0406102(date) {
404
- return $14e0f24ef4ac5c92$export$a5a3b454ada2268e(date.subtract({
405
- months: date.month - 1
406
- }));
407
- }
408
- function $14e0f24ef4ac5c92$export$8b7aa55c66d5569e(date) {
409
- return $14e0f24ef4ac5c92$export$a2258d9c4118825c(date.add({
410
- months: date.calendar.getMonthsInYear(date) - date.month
411
- }));
412
- }
413
- function $14e0f24ef4ac5c92$export$5412ac11713b72ad(date) {
414
- if (date.calendar.getMinimumMonthInYear) return date.calendar.getMinimumMonthInYear(date);
415
- return 1;
416
- }
417
- function $14e0f24ef4ac5c92$export$b2f4953d301981d5(date) {
418
- if (date.calendar.getMinimumDayInMonth) return date.calendar.getMinimumDayInMonth(date);
419
- return 1;
420
- }
421
- function $14e0f24ef4ac5c92$export$42c81a444fbfb5d4(date, locale) {
422
- let dayOfWeek = $14e0f24ef4ac5c92$export$2061056d06d7cdf7(date, locale);
423
- return date.subtract({
424
- days: dayOfWeek
425
- });
426
- }
427
- function $14e0f24ef4ac5c92$export$ef8b6d9133084f4e(date, locale) {
428
- return $14e0f24ef4ac5c92$export$42c81a444fbfb5d4(date, locale).add({
429
- days: 6
430
- });
431
- }
432
- const $14e0f24ef4ac5c92$var$cachedRegions = new Map();
433
- function $14e0f24ef4ac5c92$var$getRegion(locale) {
434
- // If the Intl.Locale API is available, use it to get the region for the locale.
435
- // @ts-ignore
436
- if (Intl.Locale) {
437
- // Constructing an Intl.Locale is expensive, so cache the result.
438
- let region = $14e0f24ef4ac5c92$var$cachedRegions.get(locale);
439
- if (!region) {
440
- // @ts-ignore
441
- region = new Intl.Locale(locale).maximize().region;
442
- if (region) $14e0f24ef4ac5c92$var$cachedRegions.set(locale, region);
443
- }
444
- return region;
445
- }
446
- // If not, just try splitting the string.
447
- // If the second part of the locale string is 'u',
448
- // then this is a unicode extension, so ignore it.
449
- // Otherwise, it should be the region.
450
- let part = locale.split("-")[1];
451
- return part === "u" ? undefined : part;
452
- }
453
- function $14e0f24ef4ac5c92$var$getWeekStart(locale) {
454
- // TODO: use Intl.Locale for this once browsers support the weekInfo property
455
- // https://github.com/tc39/proposal-intl-locale-info
456
- let region = $14e0f24ef4ac5c92$var$getRegion(locale);
457
- return region ? (0, $2fe286d2fb449abb$export$7a5acbd77d414bd9)[region] || 0 : 0;
458
- }
459
- function $14e0f24ef4ac5c92$export$ccc1b2479e7dd654(date, locale) {
460
- let days = date.calendar.getDaysInMonth(date);
461
- return Math.ceil(($14e0f24ef4ac5c92$export$2061056d06d7cdf7($14e0f24ef4ac5c92$export$a5a3b454ada2268e(date), locale) + days) / 7);
462
- }
463
- function $14e0f24ef4ac5c92$export$5c333a116e949cdd(a, b) {
464
- if (a && b) return a.compare(b) <= 0 ? a : b;
465
- return a || b;
466
- }
467
- function $14e0f24ef4ac5c92$export$a75f2bff57811055(a, b) {
468
- if (a && b) return a.compare(b) >= 0 ? a : b;
469
- return a || b;
470
- }
471
- const $14e0f24ef4ac5c92$var$WEEKEND_DATA = {
472
- AF: [
473
- 4,
474
- 5
475
- ],
476
- AE: [
477
- 5,
478
- 6
479
- ],
480
- BH: [
481
- 5,
482
- 6
483
- ],
484
- DZ: [
485
- 5,
486
- 6
487
- ],
488
- EG: [
489
- 5,
490
- 6
491
- ],
492
- IL: [
493
- 5,
494
- 6
495
- ],
496
- IQ: [
497
- 5,
498
- 6
499
- ],
500
- IR: [
501
- 5,
502
- 5
503
- ],
504
- JO: [
505
- 5,
506
- 6
507
- ],
508
- KW: [
509
- 5,
510
- 6
511
- ],
512
- LY: [
513
- 5,
514
- 6
515
- ],
516
- OM: [
517
- 5,
518
- 6
519
- ],
520
- QA: [
521
- 5,
522
- 6
523
- ],
524
- SA: [
525
- 5,
526
- 6
527
- ],
528
- SD: [
529
- 5,
530
- 6
531
- ],
532
- SY: [
533
- 5,
534
- 6
535
- ],
536
- YE: [
537
- 5,
538
- 6
539
- ]
540
- };
541
- function $14e0f24ef4ac5c92$export$618d60ea299da42(date, locale) {
542
- let julian = date.calendar.toJulianDay(date);
543
- // If julian is negative, then julian % 7 will be negative, so we adjust
544
- // accordingly. Julian day 0 is Monday.
545
- let dayOfWeek = Math.ceil(julian + 1) % 7;
546
- if (dayOfWeek < 0) dayOfWeek += 7;
547
- let region = $14e0f24ef4ac5c92$var$getRegion(locale);
548
- // Use Intl.Locale for this once weekInfo is supported.
549
- // https://github.com/tc39/proposal-intl-locale-info
550
- let [start, end] = $14e0f24ef4ac5c92$var$WEEKEND_DATA[region] || [
551
- 6,
552
- 0
553
- ];
554
- return dayOfWeek === start || dayOfWeek === end;
555
- }
556
- function $14e0f24ef4ac5c92$export$ee9d87258e1d19ed(date, locale) {
557
- return !$14e0f24ef4ac5c92$export$618d60ea299da42(date, locale);
558
- }
559
-
560
-
561
- function $11d87f3f76e88657$export$bd4fb2bc8bb06fb(date) {
562
- date = $11d87f3f76e88657$export$b4a036af3fc0b032(date, new (0, $3b62074eb05584b2$export$80ee6245ec4f29ec)());
563
- let year = (0, $3b62074eb05584b2$export$c36e0ecb2d4fa69d)(date.era, date.year);
564
- return $11d87f3f76e88657$var$epochFromParts(year, date.month, date.day, date.hour, date.minute, date.second, date.millisecond);
565
- }
566
- function $11d87f3f76e88657$var$epochFromParts(year, month, day, hour, minute, second, millisecond) {
567
- // Note: Date.UTC() interprets one and two-digit years as being in the
568
- // 20th century, so don't use it
569
- let date = new Date();
570
- date.setUTCHours(hour, minute, second, millisecond);
571
- date.setUTCFullYear(year, month - 1, day);
572
- return date.getTime();
573
- }
574
- function $11d87f3f76e88657$export$59c99f3515d3493f(ms, timeZone) {
575
- // Fast path for UTC.
576
- if (timeZone === "UTC") return 0;
577
- // Fast path: for local timezone after 1970, use native Date.
578
- if (ms > 0 && timeZone === (0, $14e0f24ef4ac5c92$export$aa8b41735afcabd2)()) return new Date(ms).getTimezoneOffset() * -60000;
579
- let { year: year, month: month, day: day, hour: hour, minute: minute, second: second } = $11d87f3f76e88657$var$getTimeZoneParts(ms, timeZone);
580
- let utc = $11d87f3f76e88657$var$epochFromParts(year, month, day, hour, minute, second, 0);
581
- return utc - Math.floor(ms / 1000) * 1000;
582
- }
583
- const $11d87f3f76e88657$var$formattersByTimeZone = new Map();
584
- function $11d87f3f76e88657$var$getTimeZoneParts(ms, timeZone) {
585
- let formatter = $11d87f3f76e88657$var$formattersByTimeZone.get(timeZone);
586
- if (!formatter) {
587
- formatter = new Intl.DateTimeFormat("en-US", {
588
- timeZone: timeZone,
589
- hour12: false,
590
- era: "short",
591
- year: "numeric",
592
- month: "numeric",
593
- day: "numeric",
594
- hour: "numeric",
595
- minute: "numeric",
596
- second: "numeric"
597
- });
598
- $11d87f3f76e88657$var$formattersByTimeZone.set(timeZone, formatter);
599
- }
600
- let parts = formatter.formatToParts(new Date(ms));
601
- let namedParts = {};
602
- for (let part of parts)if (part.type !== "literal") namedParts[part.type] = part.value;
603
- return {
604
- // Firefox returns B instead of BC... https://bugzilla.mozilla.org/show_bug.cgi?id=1752253
605
- year: namedParts.era === "BC" || namedParts.era === "B" ? -namedParts.year + 1 : +namedParts.year,
606
- month: +namedParts.month,
607
- day: +namedParts.day,
608
- hour: namedParts.hour === "24" ? 0 : +namedParts.hour,
609
- minute: +namedParts.minute,
610
- second: +namedParts.second
611
- };
612
- }
613
- const $11d87f3f76e88657$var$DAYMILLIS = 86400000;
614
- function $11d87f3f76e88657$export$136f38efe7caf549(date, timeZone) {
615
- let ms = $11d87f3f76e88657$export$bd4fb2bc8bb06fb(date);
616
- let earlier = ms - $11d87f3f76e88657$export$59c99f3515d3493f(ms - $11d87f3f76e88657$var$DAYMILLIS, timeZone);
617
- let later = ms - $11d87f3f76e88657$export$59c99f3515d3493f(ms + $11d87f3f76e88657$var$DAYMILLIS, timeZone);
618
- return $11d87f3f76e88657$var$getValidWallTimes(date, timeZone, earlier, later);
619
- }
620
- function $11d87f3f76e88657$var$getValidWallTimes(date, timeZone, earlier, later) {
621
- let found = earlier === later ? [
622
- earlier
623
- ] : [
624
- earlier,
625
- later
626
- ];
627
- return found.filter((absolute)=>$11d87f3f76e88657$var$isValidWallTime(date, timeZone, absolute));
628
- }
629
- function $11d87f3f76e88657$var$isValidWallTime(date, timeZone, absolute) {
630
- let parts = $11d87f3f76e88657$var$getTimeZoneParts(absolute, timeZone);
631
- return date.year === parts.year && date.month === parts.month && date.day === parts.day && date.hour === parts.hour && date.minute === parts.minute && date.second === parts.second;
632
- }
633
- function $11d87f3f76e88657$export$5107c82f94518f5c(date, timeZone, disambiguation = "compatible") {
634
- let dateTime = $11d87f3f76e88657$export$b21e0b124e224484(date);
635
- // Fast path: if the time zone is UTC, use native Date.
636
- if (timeZone === "UTC") return $11d87f3f76e88657$export$bd4fb2bc8bb06fb(dateTime);
637
- // Fast path: if the time zone is the local timezone and disambiguation is compatible, use native Date.
638
- if (timeZone === (0, $14e0f24ef4ac5c92$export$aa8b41735afcabd2)() && disambiguation === "compatible") {
639
- dateTime = $11d87f3f76e88657$export$b4a036af3fc0b032(dateTime, new (0, $3b62074eb05584b2$export$80ee6245ec4f29ec)());
640
- // Don't use Date constructor here because two-digit years are interpreted in the 20th century.
641
- let date = new Date();
642
- let year = (0, $3b62074eb05584b2$export$c36e0ecb2d4fa69d)(dateTime.era, dateTime.year);
643
- date.setFullYear(year, dateTime.month - 1, dateTime.day);
644
- date.setHours(dateTime.hour, dateTime.minute, dateTime.second, dateTime.millisecond);
645
- return date.getTime();
646
- }
647
- let ms = $11d87f3f76e88657$export$bd4fb2bc8bb06fb(dateTime);
648
- let offsetBefore = $11d87f3f76e88657$export$59c99f3515d3493f(ms - $11d87f3f76e88657$var$DAYMILLIS, timeZone);
649
- let offsetAfter = $11d87f3f76e88657$export$59c99f3515d3493f(ms + $11d87f3f76e88657$var$DAYMILLIS, timeZone);
650
- let valid = $11d87f3f76e88657$var$getValidWallTimes(dateTime, timeZone, ms - offsetBefore, ms - offsetAfter);
651
- if (valid.length === 1) return valid[0];
652
- if (valid.length > 1) switch(disambiguation){
653
- // 'compatible' means 'earlier' for "fall back" transitions
654
- case "compatible":
655
- case "earlier":
656
- return valid[0];
657
- case "later":
658
- return valid[valid.length - 1];
659
- case "reject":
660
- throw new RangeError("Multiple possible absolute times found");
661
- }
662
- switch(disambiguation){
663
- case "earlier":
664
- return Math.min(ms - offsetBefore, ms - offsetAfter);
665
- // 'compatible' means 'later' for "spring forward" transitions
666
- case "compatible":
667
- case "later":
668
- return Math.max(ms - offsetBefore, ms - offsetAfter);
669
- case "reject":
670
- throw new RangeError("No such absolute time found");
671
- }
672
- }
673
- function $11d87f3f76e88657$export$e67a095c620b86fe(dateTime, timeZone, disambiguation = "compatible") {
674
- return new Date($11d87f3f76e88657$export$5107c82f94518f5c(dateTime, timeZone, disambiguation));
675
- }
676
- function $11d87f3f76e88657$export$1b96692a1ba042ac(ms, timeZone) {
677
- let offset = $11d87f3f76e88657$export$59c99f3515d3493f(ms, timeZone);
678
- let date = new Date(ms + offset);
679
- let year = date.getUTCFullYear();
680
- let month = date.getUTCMonth() + 1;
681
- let day = date.getUTCDate();
682
- let hour = date.getUTCHours();
683
- let minute = date.getUTCMinutes();
684
- let second = date.getUTCSeconds();
685
- let millisecond = date.getUTCMilliseconds();
686
- return new (0, $35ea8db9cb2ccb90$export$d3b7288e7994edea)(year, month, day, timeZone, offset, hour, minute, second, millisecond);
687
- }
688
- function $11d87f3f76e88657$export$e57ff100d91bd4b9(date, timeZone) {
689
- return $11d87f3f76e88657$export$1b96692a1ba042ac(date.getTime(), timeZone);
690
- }
691
- function $11d87f3f76e88657$export$d7f92bcd3596b086(date) {
692
- return $11d87f3f76e88657$export$e57ff100d91bd4b9(date, (0, $14e0f24ef4ac5c92$export$aa8b41735afcabd2)());
693
- }
694
- function $11d87f3f76e88657$export$93522d1a439f3617(dateTime) {
695
- return new (0, $35ea8db9cb2ccb90$export$99faa760c7908e4f)(dateTime.calendar, dateTime.era, dateTime.year, dateTime.month, dateTime.day);
696
- }
697
- function $11d87f3f76e88657$export$6f4d78149f3f53ac(date) {
698
- return {
699
- era: date.era,
700
- year: date.year,
701
- month: date.month,
702
- day: date.day
703
- };
704
- }
705
- function $11d87f3f76e88657$export$4d0393e732857be5(date) {
706
- return {
707
- hour: date.hour,
708
- minute: date.minute,
709
- second: date.second,
710
- millisecond: date.millisecond
711
- };
712
- }
713
- function $11d87f3f76e88657$export$b21e0b124e224484(date, time) {
714
- let hour = 0, minute = 0, second = 0, millisecond = 0;
715
- if ("timeZone" in date) ({ hour: hour, minute: minute, second: second, millisecond: millisecond } = date);
716
- else if ("hour" in date && !time) return date;
717
- if (time) ({ hour: hour, minute: minute, second: second, millisecond: millisecond } = time);
718
- return new (0, $35ea8db9cb2ccb90$export$ca871e8dbb80966f)(date.calendar, date.era, date.year, date.month, date.day, hour, minute, second, millisecond);
719
- }
720
- function $11d87f3f76e88657$export$d33f79e3ffc3dc83(dateTime) {
721
- return new (0, $35ea8db9cb2ccb90$export$680ea196effce5f)(dateTime.hour, dateTime.minute, dateTime.second, dateTime.millisecond);
722
- }
723
- function $11d87f3f76e88657$export$b4a036af3fc0b032(date, calendar) {
724
- if (date.calendar.identifier === calendar.identifier) return date;
725
- let calendarDate = calendar.fromJulianDay(date.calendar.toJulianDay(date));
726
- let copy = date.copy();
727
- copy.calendar = calendar;
728
- copy.era = calendarDate.era;
729
- copy.year = calendarDate.year;
730
- copy.month = calendarDate.month;
731
- copy.day = calendarDate.day;
732
- (0, $735220c2d4774dd3$export$c4e2ecac49351ef2)(copy);
733
- return copy;
734
- }
735
- function $11d87f3f76e88657$export$84c95a83c799e074(date, timeZone, disambiguation) {
736
- if (date instanceof (0, $35ea8db9cb2ccb90$export$d3b7288e7994edea)) {
737
- if (date.timeZone === timeZone) return date;
738
- return $11d87f3f76e88657$export$538b00033cc11c75(date, timeZone);
739
- }
740
- let ms = $11d87f3f76e88657$export$5107c82f94518f5c(date, timeZone, disambiguation);
741
- return $11d87f3f76e88657$export$1b96692a1ba042ac(ms, timeZone);
742
- }
743
- function $11d87f3f76e88657$export$83aac07b4c37b25(date) {
744
- let ms = $11d87f3f76e88657$export$bd4fb2bc8bb06fb(date) - date.offset;
745
- return new Date(ms);
746
- }
747
- function $11d87f3f76e88657$export$538b00033cc11c75(date, timeZone) {
748
- let ms = $11d87f3f76e88657$export$bd4fb2bc8bb06fb(date) - date.offset;
749
- return $11d87f3f76e88657$export$b4a036af3fc0b032($11d87f3f76e88657$export$1b96692a1ba042ac(ms, timeZone), date.calendar);
750
- }
751
- function $11d87f3f76e88657$export$d9b67bc93c097491(date) {
752
- return $11d87f3f76e88657$export$538b00033cc11c75(date, (0, $14e0f24ef4ac5c92$export$aa8b41735afcabd2)());
753
- }
754
-
755
-
756
-
757
- const $735220c2d4774dd3$var$ONE_HOUR = 3600000;
758
- function $735220c2d4774dd3$export$e16d8520af44a096(date, duration) {
759
- let mutableDate = date.copy();
760
- let days = "hour" in mutableDate ? $735220c2d4774dd3$var$addTimeFields(mutableDate, duration) : 0;
761
- $735220c2d4774dd3$var$addYears(mutableDate, duration.years || 0);
762
- if (mutableDate.calendar.balanceYearMonth) mutableDate.calendar.balanceYearMonth(mutableDate, date);
763
- mutableDate.month += duration.months || 0;
764
- $735220c2d4774dd3$var$balanceYearMonth(mutableDate);
765
- $735220c2d4774dd3$var$constrainMonthDay(mutableDate);
766
- mutableDate.day += (duration.weeks || 0) * 7;
767
- mutableDate.day += duration.days || 0;
768
- mutableDate.day += days;
769
- $735220c2d4774dd3$var$balanceDay(mutableDate);
770
- if (mutableDate.calendar.balanceDate) mutableDate.calendar.balanceDate(mutableDate);
771
- // Constrain in case adding ended up with a date outside the valid range for the calendar system.
772
- // The behavior here is slightly different than when constraining in the `set` function in that
773
- // we adjust smaller fields to their minimum/maximum values rather than constraining each field
774
- // individually. This matches the general behavior of `add` vs `set` regarding how fields are balanced.
775
- if (mutableDate.year < 1) {
776
- mutableDate.year = 1;
777
- mutableDate.month = 1;
778
- mutableDate.day = 1;
779
- }
780
- let maxYear = mutableDate.calendar.getYearsInEra(mutableDate);
781
- if (mutableDate.year > maxYear) {
782
- var _mutableDate_calendar_isInverseEra, _mutableDate_calendar;
783
- let isInverseEra = (_mutableDate_calendar_isInverseEra = (_mutableDate_calendar = mutableDate.calendar).isInverseEra) === null || _mutableDate_calendar_isInverseEra === void 0 ? void 0 : _mutableDate_calendar_isInverseEra.call(_mutableDate_calendar, mutableDate);
784
- mutableDate.year = maxYear;
785
- mutableDate.month = isInverseEra ? 1 : mutableDate.calendar.getMonthsInYear(mutableDate);
786
- mutableDate.day = isInverseEra ? 1 : mutableDate.calendar.getDaysInMonth(mutableDate);
787
- }
788
- if (mutableDate.month < 1) {
789
- mutableDate.month = 1;
790
- mutableDate.day = 1;
791
- }
792
- let maxMonth = mutableDate.calendar.getMonthsInYear(mutableDate);
793
- if (mutableDate.month > maxMonth) {
794
- mutableDate.month = maxMonth;
795
- mutableDate.day = mutableDate.calendar.getDaysInMonth(mutableDate);
796
- }
797
- mutableDate.day = Math.max(1, Math.min(mutableDate.calendar.getDaysInMonth(mutableDate), mutableDate.day));
798
- return mutableDate;
799
- }
800
- function $735220c2d4774dd3$var$addYears(date, years) {
801
- var _date_calendar_isInverseEra, _date_calendar;
802
- if ((_date_calendar_isInverseEra = (_date_calendar = date.calendar).isInverseEra) === null || _date_calendar_isInverseEra === void 0 ? void 0 : _date_calendar_isInverseEra.call(_date_calendar, date)) years = -years;
803
- date.year += years;
804
- }
805
- function $735220c2d4774dd3$var$balanceYearMonth(date) {
806
- while(date.month < 1){
807
- $735220c2d4774dd3$var$addYears(date, -1);
808
- date.month += date.calendar.getMonthsInYear(date);
809
- }
810
- let monthsInYear = 0;
811
- while(date.month > (monthsInYear = date.calendar.getMonthsInYear(date))){
812
- date.month -= monthsInYear;
813
- $735220c2d4774dd3$var$addYears(date, 1);
814
- }
815
- }
816
- function $735220c2d4774dd3$var$balanceDay(date) {
817
- while(date.day < 1){
818
- date.month--;
819
- $735220c2d4774dd3$var$balanceYearMonth(date);
820
- date.day += date.calendar.getDaysInMonth(date);
821
- }
822
- while(date.day > date.calendar.getDaysInMonth(date)){
823
- date.day -= date.calendar.getDaysInMonth(date);
824
- date.month++;
825
- $735220c2d4774dd3$var$balanceYearMonth(date);
826
- }
827
- }
828
- function $735220c2d4774dd3$var$constrainMonthDay(date) {
829
- date.month = Math.max(1, Math.min(date.calendar.getMonthsInYear(date), date.month));
830
- date.day = Math.max(1, Math.min(date.calendar.getDaysInMonth(date), date.day));
831
- }
832
- function $735220c2d4774dd3$export$c4e2ecac49351ef2(date) {
833
- if (date.calendar.constrainDate) date.calendar.constrainDate(date);
834
- date.year = Math.max(1, Math.min(date.calendar.getYearsInEra(date), date.year));
835
- $735220c2d4774dd3$var$constrainMonthDay(date);
836
- }
837
- function $735220c2d4774dd3$export$3e2544e88a25bff8(duration) {
838
- let inverseDuration = {};
839
- for(let key in duration)if (typeof duration[key] === "number") inverseDuration[key] = -duration[key];
840
- return inverseDuration;
841
- }
842
- function $735220c2d4774dd3$export$4e2d2ead65e5f7e3(date, duration) {
843
- return $735220c2d4774dd3$export$e16d8520af44a096(date, $735220c2d4774dd3$export$3e2544e88a25bff8(duration));
844
- }
845
- function $735220c2d4774dd3$export$adaa4cf7ef1b65be(date, fields) {
846
- let mutableDate = date.copy();
847
- if (fields.era != null) mutableDate.era = fields.era;
848
- if (fields.year != null) mutableDate.year = fields.year;
849
- if (fields.month != null) mutableDate.month = fields.month;
850
- if (fields.day != null) mutableDate.day = fields.day;
851
- $735220c2d4774dd3$export$c4e2ecac49351ef2(mutableDate);
852
- return mutableDate;
853
- }
854
- function $735220c2d4774dd3$export$e5d5e1c1822b6e56(value, fields) {
855
- let mutableValue = value.copy();
856
- if (fields.hour != null) mutableValue.hour = fields.hour;
857
- if (fields.minute != null) mutableValue.minute = fields.minute;
858
- if (fields.second != null) mutableValue.second = fields.second;
859
- if (fields.millisecond != null) mutableValue.millisecond = fields.millisecond;
860
- $735220c2d4774dd3$export$7555de1e070510cb(mutableValue);
861
- return mutableValue;
862
- }
863
- function $735220c2d4774dd3$var$balanceTime(time) {
864
- time.second += Math.floor(time.millisecond / 1000);
865
- time.millisecond = $735220c2d4774dd3$var$nonNegativeMod(time.millisecond, 1000);
866
- time.minute += Math.floor(time.second / 60);
867
- time.second = $735220c2d4774dd3$var$nonNegativeMod(time.second, 60);
868
- time.hour += Math.floor(time.minute / 60);
869
- time.minute = $735220c2d4774dd3$var$nonNegativeMod(time.minute, 60);
870
- let days = Math.floor(time.hour / 24);
871
- time.hour = $735220c2d4774dd3$var$nonNegativeMod(time.hour, 24);
872
- return days;
873
- }
874
- function $735220c2d4774dd3$export$7555de1e070510cb(time) {
875
- time.millisecond = Math.max(0, Math.min(time.millisecond, 1000));
876
- time.second = Math.max(0, Math.min(time.second, 59));
877
- time.minute = Math.max(0, Math.min(time.minute, 59));
878
- time.hour = Math.max(0, Math.min(time.hour, 23));
879
- }
880
- function $735220c2d4774dd3$var$nonNegativeMod(a, b) {
881
- let result = a % b;
882
- if (result < 0) result += b;
883
- return result;
884
- }
885
- function $735220c2d4774dd3$var$addTimeFields(time, duration) {
886
- time.hour += duration.hours || 0;
887
- time.minute += duration.minutes || 0;
888
- time.second += duration.seconds || 0;
889
- time.millisecond += duration.milliseconds || 0;
890
- return $735220c2d4774dd3$var$balanceTime(time);
891
- }
892
- function $735220c2d4774dd3$export$7ed87b6bc2506470(time, duration) {
893
- let res = time.copy();
894
- $735220c2d4774dd3$var$addTimeFields(res, duration);
895
- return res;
896
- }
897
- function $735220c2d4774dd3$export$fe34d3a381cd7501(time, duration) {
898
- return $735220c2d4774dd3$export$7ed87b6bc2506470(time, $735220c2d4774dd3$export$3e2544e88a25bff8(duration));
899
- }
900
- function $735220c2d4774dd3$export$d52ced6badfb9a4c(value, field, amount, options) {
901
- let mutable = value.copy();
902
- switch(field){
903
- case "era":
904
- {
905
- let eras = value.calendar.getEras();
906
- let eraIndex = eras.indexOf(value.era);
907
- if (eraIndex < 0) throw new Error("Invalid era: " + value.era);
908
- eraIndex = $735220c2d4774dd3$var$cycleValue(eraIndex, amount, 0, eras.length - 1, options === null || options === void 0 ? void 0 : options.round);
909
- mutable.era = eras[eraIndex];
910
- // Constrain the year and other fields within the era, so the era doesn't change when we balance below.
911
- $735220c2d4774dd3$export$c4e2ecac49351ef2(mutable);
912
- break;
913
- }
914
- case "year":
915
- var _mutable_calendar_isInverseEra, _mutable_calendar;
916
- if ((_mutable_calendar_isInverseEra = (_mutable_calendar = mutable.calendar).isInverseEra) === null || _mutable_calendar_isInverseEra === void 0 ? void 0 : _mutable_calendar_isInverseEra.call(_mutable_calendar, mutable)) amount = -amount;
917
- // The year field should not cycle within the era as that can cause weird behavior affecting other fields.
918
- // We need to also allow values < 1 so that decrementing goes to the previous era. If we get -Infinity back
919
- // we know we wrapped around after reaching 9999 (the maximum), so set the year back to 1.
920
- mutable.year = $735220c2d4774dd3$var$cycleValue(value.year, amount, -Infinity, 9999, options === null || options === void 0 ? void 0 : options.round);
921
- if (mutable.year === -Infinity) mutable.year = 1;
922
- if (mutable.calendar.balanceYearMonth) mutable.calendar.balanceYearMonth(mutable, value);
923
- break;
924
- case "month":
925
- mutable.month = $735220c2d4774dd3$var$cycleValue(value.month, amount, 1, value.calendar.getMonthsInYear(value), options === null || options === void 0 ? void 0 : options.round);
926
- break;
927
- case "day":
928
- mutable.day = $735220c2d4774dd3$var$cycleValue(value.day, amount, 1, value.calendar.getDaysInMonth(value), options === null || options === void 0 ? void 0 : options.round);
929
- break;
930
- default:
931
- throw new Error("Unsupported field " + field);
932
- }
933
- if (value.calendar.balanceDate) value.calendar.balanceDate(mutable);
934
- $735220c2d4774dd3$export$c4e2ecac49351ef2(mutable);
935
- return mutable;
936
- }
937
- function $735220c2d4774dd3$export$dd02b3e0007dfe28(value, field, amount, options) {
938
- let mutable = value.copy();
939
- switch(field){
940
- case "hour":
941
- {
942
- let hours = value.hour;
943
- let min = 0;
944
- let max = 23;
945
- if ((options === null || options === void 0 ? void 0 : options.hourCycle) === 12) {
946
- let isPM = hours >= 12;
947
- min = isPM ? 12 : 0;
948
- max = isPM ? 23 : 11;
949
- }
950
- mutable.hour = $735220c2d4774dd3$var$cycleValue(hours, amount, min, max, options === null || options === void 0 ? void 0 : options.round);
951
- break;
952
- }
953
- case "minute":
954
- mutable.minute = $735220c2d4774dd3$var$cycleValue(value.minute, amount, 0, 59, options === null || options === void 0 ? void 0 : options.round);
955
- break;
956
- case "second":
957
- mutable.second = $735220c2d4774dd3$var$cycleValue(value.second, amount, 0, 59, options === null || options === void 0 ? void 0 : options.round);
958
- break;
959
- case "millisecond":
960
- mutable.millisecond = $735220c2d4774dd3$var$cycleValue(value.millisecond, amount, 0, 999, options === null || options === void 0 ? void 0 : options.round);
961
- break;
962
- default:
963
- throw new Error("Unsupported field " + field);
964
- }
965
- return mutable;
966
- }
967
- function $735220c2d4774dd3$var$cycleValue(value, amount, min, max, round = false) {
968
- if (round) {
969
- value += Math.sign(amount);
970
- if (value < min) value = max;
971
- let div = Math.abs(amount);
972
- if (amount > 0) value = Math.ceil(value / div) * div;
973
- else value = Math.floor(value / div) * div;
974
- if (value > max) value = min;
975
- } else {
976
- value += amount;
977
- if (value < min) value = max - (min - value - 1);
978
- else if (value > max) value = min + (value - max - 1);
979
- }
980
- return value;
981
- }
982
- function $735220c2d4774dd3$export$96b1d28349274637(dateTime, duration) {
983
- let ms;
984
- if (duration.years != null && duration.years !== 0 || duration.months != null && duration.months !== 0 || duration.weeks != null && duration.weeks !== 0 || duration.days != null && duration.days !== 0) {
985
- let res = $735220c2d4774dd3$export$e16d8520af44a096((0, $11d87f3f76e88657$export$b21e0b124e224484)(dateTime), {
986
- years: duration.years,
987
- months: duration.months,
988
- weeks: duration.weeks,
989
- days: duration.days
990
- });
991
- // Changing the date may change the timezone offset, so we need to recompute
992
- // using the 'compatible' disambiguation.
993
- ms = (0, $11d87f3f76e88657$export$5107c82f94518f5c)(res, dateTime.timeZone);
994
- } else // Otherwise, preserve the offset of the original date.
995
- ms = (0, $11d87f3f76e88657$export$bd4fb2bc8bb06fb)(dateTime) - dateTime.offset;
996
- // Perform time manipulation in milliseconds rather than on the original time fields to account for DST.
997
- // For example, adding one hour during a DST transition may result in the hour field staying the same or
998
- // skipping an hour. This results in the offset field changing value instead of the specified field.
999
- ms += duration.milliseconds || 0;
1000
- ms += (duration.seconds || 0) * 1000;
1001
- ms += (duration.minutes || 0) * 60000;
1002
- ms += (duration.hours || 0) * 3600000;
1003
- let res = (0, $11d87f3f76e88657$export$1b96692a1ba042ac)(ms, dateTime.timeZone);
1004
- return (0, $11d87f3f76e88657$export$b4a036af3fc0b032)(res, dateTime.calendar);
1005
- }
1006
- function $735220c2d4774dd3$export$6814caac34ca03c7(dateTime, duration) {
1007
- return $735220c2d4774dd3$export$96b1d28349274637(dateTime, $735220c2d4774dd3$export$3e2544e88a25bff8(duration));
1008
- }
1009
- function $735220c2d4774dd3$export$9a297d111fc86b79(dateTime, field, amount, options) {
1010
- // For date fields, we want the time to remain consistent and the UTC offset to potentially change to account for DST changes.
1011
- // For time fields, we want the time to change by the amount given. This may result in the hour field staying the same, but the UTC
1012
- // offset changing in the case of a backward DST transition, or skipping an hour in the case of a forward DST transition.
1013
- switch(field){
1014
- case "hour":
1015
- {
1016
- let min = 0;
1017
- let max = 23;
1018
- if ((options === null || options === void 0 ? void 0 : options.hourCycle) === 12) {
1019
- let isPM = dateTime.hour >= 12;
1020
- min = isPM ? 12 : 0;
1021
- max = isPM ? 23 : 11;
1022
- }
1023
- // The minimum and maximum hour may be affected by daylight saving time.
1024
- // For example, it might jump forward at midnight, and skip 1am.
1025
- // Or it might end at midnight and repeat the 11pm hour. To handle this, we get
1026
- // the possible absolute times for the min and max, and find the maximum range
1027
- // that is within the current day.
1028
- let plainDateTime = (0, $11d87f3f76e88657$export$b21e0b124e224484)(dateTime);
1029
- let minDate = (0, $11d87f3f76e88657$export$b4a036af3fc0b032)($735220c2d4774dd3$export$e5d5e1c1822b6e56(plainDateTime, {
1030
- hour: min
1031
- }), new (0, $3b62074eb05584b2$export$80ee6245ec4f29ec)());
1032
- let minAbsolute = [
1033
- (0, $11d87f3f76e88657$export$5107c82f94518f5c)(minDate, dateTime.timeZone, "earlier"),
1034
- (0, $11d87f3f76e88657$export$5107c82f94518f5c)(minDate, dateTime.timeZone, "later")
1035
- ].filter((ms)=>(0, $11d87f3f76e88657$export$1b96692a1ba042ac)(ms, dateTime.timeZone).day === minDate.day)[0];
1036
- let maxDate = (0, $11d87f3f76e88657$export$b4a036af3fc0b032)($735220c2d4774dd3$export$e5d5e1c1822b6e56(plainDateTime, {
1037
- hour: max
1038
- }), new (0, $3b62074eb05584b2$export$80ee6245ec4f29ec)());
1039
- let maxAbsolute = [
1040
- (0, $11d87f3f76e88657$export$5107c82f94518f5c)(maxDate, dateTime.timeZone, "earlier"),
1041
- (0, $11d87f3f76e88657$export$5107c82f94518f5c)(maxDate, dateTime.timeZone, "later")
1042
- ].filter((ms)=>(0, $11d87f3f76e88657$export$1b96692a1ba042ac)(ms, dateTime.timeZone).day === maxDate.day).pop();
1043
- // Since hours may repeat, we need to operate on the absolute time in milliseconds.
1044
- // This is done in hours from the Unix epoch so that cycleValue works correctly,
1045
- // and then converted back to milliseconds.
1046
- let ms = (0, $11d87f3f76e88657$export$bd4fb2bc8bb06fb)(dateTime) - dateTime.offset;
1047
- let hours = Math.floor(ms / $735220c2d4774dd3$var$ONE_HOUR);
1048
- let remainder = ms % $735220c2d4774dd3$var$ONE_HOUR;
1049
- ms = $735220c2d4774dd3$var$cycleValue(hours, amount, Math.floor(minAbsolute / $735220c2d4774dd3$var$ONE_HOUR), Math.floor(maxAbsolute / $735220c2d4774dd3$var$ONE_HOUR), options === null || options === void 0 ? void 0 : options.round) * $735220c2d4774dd3$var$ONE_HOUR + remainder;
1050
- // Now compute the new timezone offset, and convert the absolute time back to local time.
1051
- return (0, $11d87f3f76e88657$export$b4a036af3fc0b032)((0, $11d87f3f76e88657$export$1b96692a1ba042ac)(ms, dateTime.timeZone), dateTime.calendar);
1052
- }
1053
- case "minute":
1054
- case "second":
1055
- case "millisecond":
1056
- // @ts-ignore
1057
- return $735220c2d4774dd3$export$dd02b3e0007dfe28(dateTime, field, amount, options);
1058
- case "era":
1059
- case "year":
1060
- case "month":
1061
- case "day":
1062
- {
1063
- let res = $735220c2d4774dd3$export$d52ced6badfb9a4c((0, $11d87f3f76e88657$export$b21e0b124e224484)(dateTime), field, amount, options);
1064
- let ms = (0, $11d87f3f76e88657$export$5107c82f94518f5c)(res, dateTime.timeZone);
1065
- return (0, $11d87f3f76e88657$export$b4a036af3fc0b032)((0, $11d87f3f76e88657$export$1b96692a1ba042ac)(ms, dateTime.timeZone), dateTime.calendar);
1066
- }
1067
- default:
1068
- throw new Error("Unsupported field " + field);
1069
- }
1070
- }
1071
- function $735220c2d4774dd3$export$31b5430eb18be4f8(dateTime, fields, disambiguation) {
1072
- // Set the date/time fields, and recompute the UTC offset to account for DST changes.
1073
- // We also need to validate by converting back to a local time in case hours are skipped during forward DST transitions.
1074
- let plainDateTime = (0, $11d87f3f76e88657$export$b21e0b124e224484)(dateTime);
1075
- let res = $735220c2d4774dd3$export$e5d5e1c1822b6e56($735220c2d4774dd3$export$adaa4cf7ef1b65be(plainDateTime, fields), fields);
1076
- // If the resulting plain date time values are equal, return the original time.
1077
- // We don't want to change the offset when setting the time to the same value.
1078
- if (res.compare(plainDateTime) === 0) return dateTime;
1079
- let ms = (0, $11d87f3f76e88657$export$5107c82f94518f5c)(res, dateTime.timeZone, disambiguation);
1080
- return (0, $11d87f3f76e88657$export$b4a036af3fc0b032)((0, $11d87f3f76e88657$export$1b96692a1ba042ac)(ms, dateTime.timeZone), dateTime.calendar);
1081
- }
1082
-
1083
-
1084
-
1085
- /*
1086
- * Copyright 2020 Adobe. All rights reserved.
1087
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
1088
- * you may not use this file except in compliance with the License. You may obtain a copy
1089
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
1090
- *
1091
- * Unless required by applicable law or agreed to in writing, software distributed under
1092
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
1093
- * OF ANY KIND, either express or implied. See the License for the specific language
1094
- * governing permissions and limitations under the License.
1095
- */
1096
-
1097
-
1098
-
1099
- const $fae977aafc393c5c$var$TIME_RE = /^(\d{2})(?::(\d{2}))?(?::(\d{2}))?(\.\d+)?$/;
1100
- const $fae977aafc393c5c$var$DATE_RE = /^(\d{4})-(\d{2})-(\d{2})$/;
1101
- const $fae977aafc393c5c$var$DATE_TIME_RE = /^(\d{4})-(\d{2})-(\d{2})(?:T(\d{2}))?(?::(\d{2}))?(?::(\d{2}))?(\.\d+)?$/;
1102
- const $fae977aafc393c5c$var$ZONED_DATE_TIME_RE = /^(\d{4})-(\d{2})-(\d{2})(?:T(\d{2}))?(?::(\d{2}))?(?::(\d{2}))?(\.\d+)?(?:([+-]\d{2})(?::?(\d{2}))?)?\[(.*?)\]$/;
1103
- const $fae977aafc393c5c$var$ABSOLUTE_RE = /^(\d{4})-(\d{2})-(\d{2})(?:T(\d{2}))?(?::(\d{2}))?(?::(\d{2}))?(\.\d+)?(?:(?:([+-]\d{2})(?::?(\d{2}))?)|Z)$/;
1104
- const $fae977aafc393c5c$var$DATE_TIME_DURATION_RE = /^((?<negative>-)|\+)?P((?<years>\d*)Y)?((?<months>\d*)M)?((?<weeks>\d*)W)?((?<days>\d*)D)?((?<time>T)((?<hours>\d*[.,]?\d{1,9})H)?((?<minutes>\d*[.,]?\d{1,9})M)?((?<seconds>\d*[.,]?\d{1,9})S)?)?$/;
1105
- const $fae977aafc393c5c$var$requiredDurationTimeGroups = [
1106
- "hours",
1107
- "minutes",
1108
- "seconds"
1109
- ];
1110
- const $fae977aafc393c5c$var$requiredDurationGroups = [
1111
- "years",
1112
- "months",
1113
- "weeks",
1114
- "days",
1115
- ...$fae977aafc393c5c$var$requiredDurationTimeGroups
1116
- ];
1117
- function $fae977aafc393c5c$export$c9698ec7f05a07e1(value) {
1118
- let m = value.match($fae977aafc393c5c$var$TIME_RE);
1119
- if (!m) throw new Error("Invalid ISO 8601 time string: " + value);
1120
- return new (0, $35ea8db9cb2ccb90$export$680ea196effce5f)($fae977aafc393c5c$var$parseNumber(m[1], 0, 23), m[2] ? $fae977aafc393c5c$var$parseNumber(m[2], 0, 59) : 0, m[3] ? $fae977aafc393c5c$var$parseNumber(m[3], 0, 59) : 0, m[4] ? $fae977aafc393c5c$var$parseNumber(m[4], 0, Infinity) * 1000 : 0);
1121
- }
1122
- function $fae977aafc393c5c$export$6b862160d295c8e(value) {
1123
- let m = value.match($fae977aafc393c5c$var$DATE_RE);
1124
- if (!m) throw new Error("Invalid ISO 8601 date string: " + value);
1125
- let date = new (0, $35ea8db9cb2ccb90$export$99faa760c7908e4f)($fae977aafc393c5c$var$parseNumber(m[1], 0, 9999), $fae977aafc393c5c$var$parseNumber(m[2], 1, 12), 1);
1126
- date.day = $fae977aafc393c5c$var$parseNumber(m[3], 0, date.calendar.getDaysInMonth(date));
1127
- return date;
1128
- }
1129
- function $fae977aafc393c5c$export$588937bcd60ade55(value) {
1130
- let m = value.match($fae977aafc393c5c$var$DATE_TIME_RE);
1131
- if (!m) throw new Error("Invalid ISO 8601 date time string: " + value);
1132
- let date = new (0, $35ea8db9cb2ccb90$export$ca871e8dbb80966f)($fae977aafc393c5c$var$parseNumber(m[1], 1, 9999), $fae977aafc393c5c$var$parseNumber(m[2], 1, 12), 1, m[4] ? $fae977aafc393c5c$var$parseNumber(m[4], 0, 23) : 0, m[5] ? $fae977aafc393c5c$var$parseNumber(m[5], 0, 59) : 0, m[6] ? $fae977aafc393c5c$var$parseNumber(m[6], 0, 59) : 0, m[7] ? $fae977aafc393c5c$var$parseNumber(m[7], 0, Infinity) * 1000 : 0);
1133
- date.day = $fae977aafc393c5c$var$parseNumber(m[3], 0, date.calendar.getDaysInMonth(date));
1134
- return date;
1135
- }
1136
- function $fae977aafc393c5c$export$fd7893f06e92a6a4(value, disambiguation) {
1137
- let m = value.match($fae977aafc393c5c$var$ZONED_DATE_TIME_RE);
1138
- if (!m) throw new Error("Invalid ISO 8601 date time string: " + value);
1139
- let date = new (0, $35ea8db9cb2ccb90$export$d3b7288e7994edea)($fae977aafc393c5c$var$parseNumber(m[1], 1, 9999), $fae977aafc393c5c$var$parseNumber(m[2], 1, 12), 1, m[10], 0, m[4] ? $fae977aafc393c5c$var$parseNumber(m[4], 0, 23) : 0, m[5] ? $fae977aafc393c5c$var$parseNumber(m[5], 0, 59) : 0, m[6] ? $fae977aafc393c5c$var$parseNumber(m[6], 0, 59) : 0, m[7] ? $fae977aafc393c5c$var$parseNumber(m[7], 0, Infinity) * 1000 : 0);
1140
- date.day = $fae977aafc393c5c$var$parseNumber(m[3], 0, date.calendar.getDaysInMonth(date));
1141
- let plainDateTime = (0, $11d87f3f76e88657$export$b21e0b124e224484)(date);
1142
- let ms;
1143
- if (m[8]) {
1144
- var _m_;
1145
- date.offset = $fae977aafc393c5c$var$parseNumber(m[8], -23, 23) * 3600000 + $fae977aafc393c5c$var$parseNumber((_m_ = m[9]) !== null && _m_ !== void 0 ? _m_ : "0", 0, 59) * 60000;
1146
- ms = (0, $11d87f3f76e88657$export$bd4fb2bc8bb06fb)(date) - date.offset;
1147
- // Validate offset against parsed date.
1148
- let absolutes = (0, $11d87f3f76e88657$export$136f38efe7caf549)(plainDateTime, date.timeZone);
1149
- if (!absolutes.includes(ms)) throw new Error(`Offset ${$fae977aafc393c5c$var$offsetToString(date.offset)} is invalid for ${$fae977aafc393c5c$export$4223de14708adc63(date)} in ${date.timeZone}`);
1150
- } else // Convert to absolute and back to fix invalid times due to DST.
1151
- ms = (0, $11d87f3f76e88657$export$5107c82f94518f5c)((0, $11d87f3f76e88657$export$b21e0b124e224484)(plainDateTime), date.timeZone, disambiguation);
1152
- return (0, $11d87f3f76e88657$export$1b96692a1ba042ac)(ms, date.timeZone);
1153
- }
1154
- function $fae977aafc393c5c$export$5adfdab05168c219(value, timeZone) {
1155
- let m = value.match($fae977aafc393c5c$var$ABSOLUTE_RE);
1156
- if (!m) throw new Error("Invalid ISO 8601 date time string: " + value);
1157
- let date = new (0, $35ea8db9cb2ccb90$export$d3b7288e7994edea)($fae977aafc393c5c$var$parseNumber(m[1], 1, 9999), $fae977aafc393c5c$var$parseNumber(m[2], 1, 12), 1, timeZone, 0, m[4] ? $fae977aafc393c5c$var$parseNumber(m[4], 0, 23) : 0, m[5] ? $fae977aafc393c5c$var$parseNumber(m[5], 0, 59) : 0, m[6] ? $fae977aafc393c5c$var$parseNumber(m[6], 0, 59) : 0, m[7] ? $fae977aafc393c5c$var$parseNumber(m[7], 0, Infinity) * 1000 : 0);
1158
- date.day = $fae977aafc393c5c$var$parseNumber(m[3], 0, date.calendar.getDaysInMonth(date));
1159
- var _m_;
1160
- if (m[8]) date.offset = $fae977aafc393c5c$var$parseNumber(m[8], -23, 23) * 3600000 + $fae977aafc393c5c$var$parseNumber((_m_ = m[9]) !== null && _m_ !== void 0 ? _m_ : "0", 0, 59) * 60000;
1161
- return (0, $11d87f3f76e88657$export$538b00033cc11c75)(date, timeZone);
1162
- }
1163
- function $fae977aafc393c5c$export$8e384432362ed0f0(value) {
1164
- return $fae977aafc393c5c$export$5adfdab05168c219(value, (0, $14e0f24ef4ac5c92$export$aa8b41735afcabd2)());
1165
- }
1166
- function $fae977aafc393c5c$var$parseNumber(value, min, max) {
1167
- let val = Number(value);
1168
- if (val < min || val > max) throw new RangeError(`Value out of range: ${min} <= ${val} <= ${max}`);
1169
- return val;
1170
- }
1171
- function $fae977aafc393c5c$export$f59dee82248f5ad4(time) {
1172
- return `${String(time.hour).padStart(2, "0")}:${String(time.minute).padStart(2, "0")}:${String(time.second).padStart(2, "0")}${time.millisecond ? String(time.millisecond / 1000).slice(1) : ""}`;
1173
- }
1174
- function $fae977aafc393c5c$export$60dfd74aa96791bd(date) {
1175
- let gregorianDate = (0, $11d87f3f76e88657$export$b4a036af3fc0b032)(date, new (0, $3b62074eb05584b2$export$80ee6245ec4f29ec)());
1176
- return `${String(gregorianDate.year).padStart(4, "0")}-${String(gregorianDate.month).padStart(2, "0")}-${String(gregorianDate.day).padStart(2, "0")}`;
1177
- }
1178
- function $fae977aafc393c5c$export$4223de14708adc63(date) {
1179
- // @ts-ignore
1180
- return `${$fae977aafc393c5c$export$60dfd74aa96791bd(date)}T${$fae977aafc393c5c$export$f59dee82248f5ad4(date)}`;
1181
- }
1182
- function $fae977aafc393c5c$var$offsetToString(offset) {
1183
- let sign = Math.sign(offset) < 0 ? "-" : "+";
1184
- offset = Math.abs(offset);
1185
- let offsetHours = Math.floor(offset / 3600000);
1186
- let offsetMinutes = offset % 3600000 / 60000;
1187
- return `${sign}${String(offsetHours).padStart(2, "0")}:${String(offsetMinutes).padStart(2, "0")}`;
1188
- }
1189
- function $fae977aafc393c5c$export$bf79f1ebf4b18792(date) {
1190
- return `${$fae977aafc393c5c$export$4223de14708adc63(date)}${$fae977aafc393c5c$var$offsetToString(date.offset)}[${date.timeZone}]`;
1191
- }
1192
- function $fae977aafc393c5c$export$ecae829bb3747ea6(value) {
1193
- var _match_groups, _match_groups1, _match_groups2, _match_groups3, _match_groups4, _match_groups5, _match_groups6, _match_groups7, _match_groups8;
1194
- const match = value.match($fae977aafc393c5c$var$DATE_TIME_DURATION_RE);
1195
- if (!match) throw new Error(`Invalid ISO 8601 Duration string: ${value}`);
1196
- const parseDurationGroup = (group, isNegative, min, max)=>{
1197
- if (!group) return 0;
1198
- try {
1199
- const sign = isNegative ? -1 : 1;
1200
- return sign * $fae977aafc393c5c$var$parseNumber(group.replace(",", "."), min, max);
1201
- } catch {
1202
- throw new Error(`Invalid ISO 8601 Duration string: ${value}`);
1203
- }
1204
- };
1205
- const isNegative = !!((_match_groups = match.groups) === null || _match_groups === void 0 ? void 0 : _match_groups.negative);
1206
- const hasRequiredGroups = $fae977aafc393c5c$var$requiredDurationGroups.some((group)=>{
1207
- var _match_groups;
1208
- return (_match_groups = match.groups) === null || _match_groups === void 0 ? void 0 : _match_groups[group];
1209
- });
1210
- if (!hasRequiredGroups) throw new Error(`Invalid ISO 8601 Duration string: ${value}`);
1211
- const durationStringIncludesTime = (_match_groups1 = match.groups) === null || _match_groups1 === void 0 ? void 0 : _match_groups1.time;
1212
- if (durationStringIncludesTime) {
1213
- const hasRequiredDurationTimeGroups = $fae977aafc393c5c$var$requiredDurationTimeGroups.some((group)=>{
1214
- var _match_groups;
1215
- return (_match_groups = match.groups) === null || _match_groups === void 0 ? void 0 : _match_groups[group];
1216
- });
1217
- if (!hasRequiredDurationTimeGroups) throw new Error(`Invalid ISO 8601 Duration string: ${value}`);
1218
- }
1219
- const duration = {
1220
- years: parseDurationGroup((_match_groups2 = match.groups) === null || _match_groups2 === void 0 ? void 0 : _match_groups2.years, isNegative, 0, 9999),
1221
- months: parseDurationGroup((_match_groups3 = match.groups) === null || _match_groups3 === void 0 ? void 0 : _match_groups3.months, isNegative, 0, 12),
1222
- weeks: parseDurationGroup((_match_groups4 = match.groups) === null || _match_groups4 === void 0 ? void 0 : _match_groups4.weeks, isNegative, 0, Infinity),
1223
- days: parseDurationGroup((_match_groups5 = match.groups) === null || _match_groups5 === void 0 ? void 0 : _match_groups5.days, isNegative, 0, 31),
1224
- hours: parseDurationGroup((_match_groups6 = match.groups) === null || _match_groups6 === void 0 ? void 0 : _match_groups6.hours, isNegative, 0, 23),
1225
- minutes: parseDurationGroup((_match_groups7 = match.groups) === null || _match_groups7 === void 0 ? void 0 : _match_groups7.minutes, isNegative, 0, 59),
1226
- seconds: parseDurationGroup((_match_groups8 = match.groups) === null || _match_groups8 === void 0 ? void 0 : _match_groups8.seconds, isNegative, 0, 59)
1227
- };
1228
- if (duration.hours !== undefined && duration.hours % 1 !== 0 && (duration.minutes || duration.seconds)) throw new Error(`Invalid ISO 8601 Duration string: ${value} - only the smallest unit can be fractional`);
1229
- if (duration.minutes !== undefined && duration.minutes % 1 !== 0 && duration.seconds) throw new Error(`Invalid ISO 8601 Duration string: ${value} - only the smallest unit can be fractional`);
1230
- return duration;
1231
- }
1232
-
1233
-
1234
-
1235
-
1236
- function $35ea8db9cb2ccb90$var$shiftArgs(args) {
1237
- let calendar = typeof args[0] === "object" ? args.shift() : new (0, $3b62074eb05584b2$export$80ee6245ec4f29ec)();
1238
- let era;
1239
- if (typeof args[0] === "string") era = args.shift();
1240
- else {
1241
- let eras = calendar.getEras();
1242
- era = eras[eras.length - 1];
1243
- }
1244
- let year = args.shift();
1245
- let month = args.shift();
1246
- let day = args.shift();
1247
- return [
1248
- calendar,
1249
- era,
1250
- year,
1251
- month,
1252
- day
1253
- ];
1254
- }
1255
- var // This prevents TypeScript from allowing other types with the same fields to match.
1256
- // i.e. a ZonedDateTime should not be be passable to a parameter that expects CalendarDate.
1257
- // If that behavior is desired, use the AnyCalendarDate interface instead.
1258
- // @ts-ignore
1259
- $35ea8db9cb2ccb90$var$_type = /*#__PURE__*/ new WeakMap();
1260
- class $35ea8db9cb2ccb90$export$99faa760c7908e4f {
1261
- /** Returns a copy of this date. */ copy() {
1262
- if (this.era) return new $35ea8db9cb2ccb90$export$99faa760c7908e4f(this.calendar, this.era, this.year, this.month, this.day);
1263
- else return new $35ea8db9cb2ccb90$export$99faa760c7908e4f(this.calendar, this.year, this.month, this.day);
1264
- }
1265
- /** Returns a new `CalendarDate` with the given duration added to it. */ add(duration) {
1266
- return (0, $735220c2d4774dd3$export$e16d8520af44a096)(this, duration);
1267
- }
1268
- /** Returns a new `CalendarDate` with the given duration subtracted from it. */ subtract(duration) {
1269
- return (0, $735220c2d4774dd3$export$4e2d2ead65e5f7e3)(this, duration);
1270
- }
1271
- /** Returns a new `CalendarDate` with the given fields set to the provided values. Other fields will be constrained accordingly. */ set(fields) {
1272
- return (0, $735220c2d4774dd3$export$adaa4cf7ef1b65be)(this, fields);
1273
- }
1274
- /**
1275
- * Returns a new `CalendarDate` with the given field adjusted by a specified amount.
1276
- * When the resulting value reaches the limits of the field, it wraps around.
1277
- */ cycle(field, amount, options) {
1278
- return (0, $735220c2d4774dd3$export$d52ced6badfb9a4c)(this, field, amount, options);
1279
- }
1280
- /** Converts the date to a native JavaScript Date object, with the time set to midnight in the given time zone. */ toDate(timeZone) {
1281
- return (0, $11d87f3f76e88657$export$e67a095c620b86fe)(this, timeZone);
1282
- }
1283
- /** Converts the date to an ISO 8601 formatted string. */ toString() {
1284
- return (0, $fae977aafc393c5c$export$60dfd74aa96791bd)(this);
1285
- }
1286
- /** Compares this date with another. A negative result indicates that this date is before the given one, and a positive date indicates that it is after. */ compare(b) {
1287
- return (0, $14e0f24ef4ac5c92$export$68781ddf31c0090f)(this, b);
1288
- }
1289
- constructor(...args){
1290
- (0, $cUVuN$_)(this, $35ea8db9cb2ccb90$var$_type, {
1291
- writable: true,
1292
- value: void 0
1293
- });
1294
- let [calendar, era, year, month, day] = $35ea8db9cb2ccb90$var$shiftArgs(args);
1295
- this.calendar = calendar;
1296
- this.era = era;
1297
- this.year = year;
1298
- this.month = month;
1299
- this.day = day;
1300
- (0, $735220c2d4774dd3$export$c4e2ecac49351ef2)(this);
1301
- }
1302
- }
1303
- var // This prevents TypeScript from allowing other types with the same fields to match.
1304
- // @ts-ignore
1305
- $35ea8db9cb2ccb90$var$_type1 = /*#__PURE__*/ new WeakMap();
1306
- class $35ea8db9cb2ccb90$export$680ea196effce5f {
1307
- /** Returns a copy of this time. */ copy() {
1308
- return new $35ea8db9cb2ccb90$export$680ea196effce5f(this.hour, this.minute, this.second, this.millisecond);
1309
- }
1310
- /** Returns a new `Time` with the given duration added to it. */ add(duration) {
1311
- return (0, $735220c2d4774dd3$export$7ed87b6bc2506470)(this, duration);
1312
- }
1313
- /** Returns a new `Time` with the given duration subtracted from it. */ subtract(duration) {
1314
- return (0, $735220c2d4774dd3$export$fe34d3a381cd7501)(this, duration);
1315
- }
1316
- /** Returns a new `Time` with the given fields set to the provided values. Other fields will be constrained accordingly. */ set(fields) {
1317
- return (0, $735220c2d4774dd3$export$e5d5e1c1822b6e56)(this, fields);
1318
- }
1319
- /**
1320
- * Returns a new `Time` with the given field adjusted by a specified amount.
1321
- * When the resulting value reaches the limits of the field, it wraps around.
1322
- */ cycle(field, amount, options) {
1323
- return (0, $735220c2d4774dd3$export$dd02b3e0007dfe28)(this, field, amount, options);
1324
- }
1325
- /** Converts the time to an ISO 8601 formatted string. */ toString() {
1326
- return (0, $fae977aafc393c5c$export$f59dee82248f5ad4)(this);
1327
- }
1328
- /** Compares this time with another. A negative result indicates that this time is before the given one, and a positive time indicates that it is after. */ compare(b) {
1329
- return (0, $14e0f24ef4ac5c92$export$c19a80a9721b80f6)(this, b);
1330
- }
1331
- constructor(hour = 0, minute = 0, second = 0, millisecond = 0){
1332
- (0, $cUVuN$_)(this, $35ea8db9cb2ccb90$var$_type1, {
1333
- writable: true,
1334
- value: void 0
1335
- });
1336
- this.hour = hour;
1337
- this.minute = minute;
1338
- this.second = second;
1339
- this.millisecond = millisecond;
1340
- (0, $735220c2d4774dd3$export$7555de1e070510cb)(this);
1341
- }
1342
- }
1343
- var // This prevents TypeScript from allowing other types with the same fields to match.
1344
- // @ts-ignore
1345
- $35ea8db9cb2ccb90$var$_type2 = /*#__PURE__*/ new WeakMap();
1346
- class $35ea8db9cb2ccb90$export$ca871e8dbb80966f {
1347
- /** Returns a copy of this date. */ copy() {
1348
- if (this.era) return new $35ea8db9cb2ccb90$export$ca871e8dbb80966f(this.calendar, this.era, this.year, this.month, this.day, this.hour, this.minute, this.second, this.millisecond);
1349
- else return new $35ea8db9cb2ccb90$export$ca871e8dbb80966f(this.calendar, this.year, this.month, this.day, this.hour, this.minute, this.second, this.millisecond);
1350
- }
1351
- /** Returns a new `CalendarDateTime` with the given duration added to it. */ add(duration) {
1352
- return (0, $735220c2d4774dd3$export$e16d8520af44a096)(this, duration);
1353
- }
1354
- /** Returns a new `CalendarDateTime` with the given duration subtracted from it. */ subtract(duration) {
1355
- return (0, $735220c2d4774dd3$export$4e2d2ead65e5f7e3)(this, duration);
1356
- }
1357
- /** Returns a new `CalendarDateTime` with the given fields set to the provided values. Other fields will be constrained accordingly. */ set(fields) {
1358
- return (0, $735220c2d4774dd3$export$adaa4cf7ef1b65be)((0, $735220c2d4774dd3$export$e5d5e1c1822b6e56)(this, fields), fields);
1359
- }
1360
- /**
1361
- * Returns a new `CalendarDateTime` with the given field adjusted by a specified amount.
1362
- * When the resulting value reaches the limits of the field, it wraps around.
1363
- */ cycle(field, amount, options) {
1364
- switch(field){
1365
- case "era":
1366
- case "year":
1367
- case "month":
1368
- case "day":
1369
- return (0, $735220c2d4774dd3$export$d52ced6badfb9a4c)(this, field, amount, options);
1370
- default:
1371
- return (0, $735220c2d4774dd3$export$dd02b3e0007dfe28)(this, field, amount, options);
1372
- }
1373
- }
1374
- /** Converts the date to a native JavaScript Date object in the given time zone. */ toDate(timeZone, disambiguation) {
1375
- return (0, $11d87f3f76e88657$export$e67a095c620b86fe)(this, timeZone, disambiguation);
1376
- }
1377
- /** Converts the date to an ISO 8601 formatted string. */ toString() {
1378
- return (0, $fae977aafc393c5c$export$4223de14708adc63)(this);
1379
- }
1380
- /** Compares this date with another. A negative result indicates that this date is before the given one, and a positive date indicates that it is after. */ compare(b) {
1381
- let res = (0, $14e0f24ef4ac5c92$export$68781ddf31c0090f)(this, b);
1382
- if (res === 0) return (0, $14e0f24ef4ac5c92$export$c19a80a9721b80f6)(this, (0, $11d87f3f76e88657$export$b21e0b124e224484)(b));
1383
- return res;
1384
- }
1385
- constructor(...args){
1386
- (0, $cUVuN$_)(this, $35ea8db9cb2ccb90$var$_type2, {
1387
- writable: true,
1388
- value: void 0
1389
- });
1390
- let [calendar, era, year, month, day] = $35ea8db9cb2ccb90$var$shiftArgs(args);
1391
- this.calendar = calendar;
1392
- this.era = era;
1393
- this.year = year;
1394
- this.month = month;
1395
- this.day = day;
1396
- this.hour = args.shift() || 0;
1397
- this.minute = args.shift() || 0;
1398
- this.second = args.shift() || 0;
1399
- this.millisecond = args.shift() || 0;
1400
- (0, $735220c2d4774dd3$export$c4e2ecac49351ef2)(this);
1401
- }
1402
- }
1403
- var // This prevents TypeScript from allowing other types with the same fields to match.
1404
- // @ts-ignore
1405
- $35ea8db9cb2ccb90$var$_type3 = /*#__PURE__*/ new WeakMap();
1406
- class $35ea8db9cb2ccb90$export$d3b7288e7994edea {
1407
- /** Returns a copy of this date. */ copy() {
1408
- if (this.era) return new $35ea8db9cb2ccb90$export$d3b7288e7994edea(this.calendar, this.era, this.year, this.month, this.day, this.timeZone, this.offset, this.hour, this.minute, this.second, this.millisecond);
1409
- else return new $35ea8db9cb2ccb90$export$d3b7288e7994edea(this.calendar, this.year, this.month, this.day, this.timeZone, this.offset, this.hour, this.minute, this.second, this.millisecond);
1410
- }
1411
- /** Returns a new `ZonedDateTime` with the given duration added to it. */ add(duration) {
1412
- return (0, $735220c2d4774dd3$export$96b1d28349274637)(this, duration);
1413
- }
1414
- /** Returns a new `ZonedDateTime` with the given duration subtracted from it. */ subtract(duration) {
1415
- return (0, $735220c2d4774dd3$export$6814caac34ca03c7)(this, duration);
1416
- }
1417
- /** Returns a new `ZonedDateTime` with the given fields set to the provided values. Other fields will be constrained accordingly. */ set(fields, disambiguation) {
1418
- return (0, $735220c2d4774dd3$export$31b5430eb18be4f8)(this, fields, disambiguation);
1419
- }
1420
- /**
1421
- * Returns a new `ZonedDateTime` with the given field adjusted by a specified amount.
1422
- * When the resulting value reaches the limits of the field, it wraps around.
1423
- */ cycle(field, amount, options) {
1424
- return (0, $735220c2d4774dd3$export$9a297d111fc86b79)(this, field, amount, options);
1425
- }
1426
- /** Converts the date to a native JavaScript Date object. */ toDate() {
1427
- return (0, $11d87f3f76e88657$export$83aac07b4c37b25)(this);
1428
- }
1429
- /** Converts the date to an ISO 8601 formatted string, including the UTC offset and time zone identifier. */ toString() {
1430
- return (0, $fae977aafc393c5c$export$bf79f1ebf4b18792)(this);
1431
- }
1432
- /** Converts the date to an ISO 8601 formatted string in UTC. */ toAbsoluteString() {
1433
- return this.toDate().toISOString();
1434
- }
1435
- /** Compares this date with another. A negative result indicates that this date is before the given one, and a positive date indicates that it is after. */ compare(b) {
1436
- // TODO: Is this a bad idea??
1437
- return this.toDate().getTime() - (0, $11d87f3f76e88657$export$84c95a83c799e074)(b, this.timeZone).toDate().getTime();
1438
- }
1439
- constructor(...args){
1440
- (0, $cUVuN$_)(this, $35ea8db9cb2ccb90$var$_type3, {
1441
- writable: true,
1442
- value: void 0
1443
- });
1444
- let [calendar, era, year, month, day] = $35ea8db9cb2ccb90$var$shiftArgs(args);
1445
- let timeZone = args.shift();
1446
- let offset = args.shift();
1447
- this.calendar = calendar;
1448
- this.era = era;
1449
- this.year = year;
1450
- this.month = month;
1451
- this.day = day;
1452
- this.timeZone = timeZone;
1453
- this.offset = offset;
1454
- this.hour = args.shift() || 0;
1455
- this.minute = args.shift() || 0;
1456
- this.second = args.shift() || 0;
1457
- this.millisecond = args.shift() || 0;
1458
- (0, $735220c2d4774dd3$export$c4e2ecac49351ef2)(this);
1459
- }
1460
- }
1461
-
1462
-
1463
-
1464
- /*
1465
- * Copyright 2020 Adobe. All rights reserved.
1466
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
1467
- * you may not use this file except in compliance with the License. You may obtain a copy
1468
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
1469
- *
1470
- * Unless required by applicable law or agreed to in writing, software distributed under
1471
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
1472
- * OF ANY KIND, either express or implied. See the License for the specific language
1473
- * governing permissions and limitations under the License.
1474
- */ // Portions of the code in this file are based on code from the TC39 Temporal proposal.
1475
- // Original licensing can be found in the NOTICE file in the root directory of this source tree.
1476
-
1477
-
1478
- const $62225008020f0a13$var$ERA_START_DATES = [
1479
- [
1480
- 1868,
1481
- 9,
1482
- 8
1483
- ],
1484
- [
1485
- 1912,
1486
- 7,
1487
- 30
1488
- ],
1489
- [
1490
- 1926,
1491
- 12,
1492
- 25
1493
- ],
1494
- [
1495
- 1989,
1496
- 1,
1497
- 8
1498
- ],
1499
- [
1500
- 2019,
1501
- 5,
1502
- 1
1503
- ]
1504
- ];
1505
- const $62225008020f0a13$var$ERA_END_DATES = [
1506
- [
1507
- 1912,
1508
- 7,
1509
- 29
1510
- ],
1511
- [
1512
- 1926,
1513
- 12,
1514
- 24
1515
- ],
1516
- [
1517
- 1989,
1518
- 1,
1519
- 7
1520
- ],
1521
- [
1522
- 2019,
1523
- 4,
1524
- 30
1525
- ]
1526
- ];
1527
- const $62225008020f0a13$var$ERA_ADDENDS = [
1528
- 1867,
1529
- 1911,
1530
- 1925,
1531
- 1988,
1532
- 2018
1533
- ];
1534
- const $62225008020f0a13$var$ERA_NAMES = [
1535
- "meiji",
1536
- "taisho",
1537
- "showa",
1538
- "heisei",
1539
- "reiwa"
1540
- ];
1541
- function $62225008020f0a13$var$findEraFromGregorianDate(date) {
1542
- const idx = $62225008020f0a13$var$ERA_START_DATES.findIndex(([year, month, day])=>{
1543
- if (date.year < year) return true;
1544
- if (date.year === year && date.month < month) return true;
1545
- if (date.year === year && date.month === month && date.day < day) return true;
1546
- return false;
1547
- });
1548
- if (idx === -1) return $62225008020f0a13$var$ERA_START_DATES.length - 1;
1549
- if (idx === 0) return 0;
1550
- return idx - 1;
1551
- }
1552
- function $62225008020f0a13$var$toGregorian(date) {
1553
- let eraAddend = $62225008020f0a13$var$ERA_ADDENDS[$62225008020f0a13$var$ERA_NAMES.indexOf(date.era)];
1554
- if (!eraAddend) throw new Error("Unknown era: " + date.era);
1555
- return new (0, $35ea8db9cb2ccb90$export$99faa760c7908e4f)(date.year + eraAddend, date.month, date.day);
1556
- }
1557
- class $62225008020f0a13$export$b746ab2b60cdffbf extends (0, $3b62074eb05584b2$export$80ee6245ec4f29ec) {
1558
- fromJulianDay(jd) {
1559
- let date = super.fromJulianDay(jd);
1560
- let era = $62225008020f0a13$var$findEraFromGregorianDate(date);
1561
- return new (0, $35ea8db9cb2ccb90$export$99faa760c7908e4f)(this, $62225008020f0a13$var$ERA_NAMES[era], date.year - $62225008020f0a13$var$ERA_ADDENDS[era], date.month, date.day);
1562
- }
1563
- toJulianDay(date) {
1564
- return super.toJulianDay($62225008020f0a13$var$toGregorian(date));
1565
- }
1566
- balanceDate(date) {
1567
- let gregorianDate = $62225008020f0a13$var$toGregorian(date);
1568
- let era = $62225008020f0a13$var$findEraFromGregorianDate(gregorianDate);
1569
- if ($62225008020f0a13$var$ERA_NAMES[era] !== date.era) {
1570
- date.era = $62225008020f0a13$var$ERA_NAMES[era];
1571
- date.year = gregorianDate.year - $62225008020f0a13$var$ERA_ADDENDS[era];
1572
- }
1573
- // Constrain in case we went before the first supported era.
1574
- this.constrainDate(date);
1575
- }
1576
- constrainDate(date) {
1577
- let idx = $62225008020f0a13$var$ERA_NAMES.indexOf(date.era);
1578
- let end = $62225008020f0a13$var$ERA_END_DATES[idx];
1579
- if (end != null) {
1580
- let [endYear, endMonth, endDay] = end;
1581
- // Constrain the year to the maximum possible value in the era.
1582
- // Then constrain the month and day fields within that.
1583
- let maxYear = endYear - $62225008020f0a13$var$ERA_ADDENDS[idx];
1584
- date.year = Math.max(1, Math.min(maxYear, date.year));
1585
- if (date.year === maxYear) {
1586
- date.month = Math.min(endMonth, date.month);
1587
- if (date.month === endMonth) date.day = Math.min(endDay, date.day);
1588
- }
1589
- }
1590
- if (date.year === 1 && idx >= 0) {
1591
- let [, startMonth, startDay] = $62225008020f0a13$var$ERA_START_DATES[idx];
1592
- date.month = Math.max(startMonth, date.month);
1593
- if (date.month === startMonth) date.day = Math.max(startDay, date.day);
1594
- }
1595
- }
1596
- getEras() {
1597
- return $62225008020f0a13$var$ERA_NAMES;
1598
- }
1599
- getYearsInEra(date) {
1600
- // Get the number of years in the era, taking into account the date's month and day fields.
1601
- let era = $62225008020f0a13$var$ERA_NAMES.indexOf(date.era);
1602
- let cur = $62225008020f0a13$var$ERA_START_DATES[era];
1603
- let next = $62225008020f0a13$var$ERA_START_DATES[era + 1];
1604
- if (next == null) // 9999 gregorian is the maximum year allowed.
1605
- return 9999 - cur[0] + 1;
1606
- let years = next[0] - cur[0];
1607
- if (date.month < next[1] || date.month === next[1] && date.day < next[2]) years++;
1608
- return years;
1609
- }
1610
- getDaysInMonth(date) {
1611
- return super.getDaysInMonth($62225008020f0a13$var$toGregorian(date));
1612
- }
1613
- getMinimumMonthInYear(date) {
1614
- let start = $62225008020f0a13$var$getMinimums(date);
1615
- return start ? start[1] : 1;
1616
- }
1617
- getMinimumDayInMonth(date) {
1618
- let start = $62225008020f0a13$var$getMinimums(date);
1619
- return start && date.month === start[1] ? start[2] : 1;
1620
- }
1621
- constructor(...args){
1622
- super(...args);
1623
- this.identifier = "japanese";
1624
- }
1625
- }
1626
- function $62225008020f0a13$var$getMinimums(date) {
1627
- if (date.year === 1) {
1628
- let idx = $62225008020f0a13$var$ERA_NAMES.indexOf(date.era);
1629
- return $62225008020f0a13$var$ERA_START_DATES[idx];
1630
- }
1631
- }
1632
-
1633
-
1634
- /*
1635
- * Copyright 2020 Adobe. All rights reserved.
1636
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
1637
- * you may not use this file except in compliance with the License. You may obtain a copy
1638
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
1639
- *
1640
- * Unless required by applicable law or agreed to in writing, software distributed under
1641
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
1642
- * OF ANY KIND, either express or implied. See the License for the specific language
1643
- * governing permissions and limitations under the License.
1644
- */ // Portions of the code in this file are based on code from ICU.
1645
- // Original licensing can be found in the NOTICE file in the root directory of this source tree.
1646
-
1647
-
1648
- const $8d73d47422ca7302$var$BUDDHIST_ERA_START = -543;
1649
- class $8d73d47422ca7302$export$42d20a78301dee44 extends (0, $3b62074eb05584b2$export$80ee6245ec4f29ec) {
1650
- fromJulianDay(jd) {
1651
- let gregorianDate = super.fromJulianDay(jd);
1652
- let year = (0, $3b62074eb05584b2$export$c36e0ecb2d4fa69d)(gregorianDate.era, gregorianDate.year);
1653
- return new (0, $35ea8db9cb2ccb90$export$99faa760c7908e4f)(this, year - $8d73d47422ca7302$var$BUDDHIST_ERA_START, gregorianDate.month, gregorianDate.day);
1654
- }
1655
- toJulianDay(date) {
1656
- return super.toJulianDay($8d73d47422ca7302$var$toGregorian(date));
1657
- }
1658
- getEras() {
1659
- return [
1660
- "BE"
1661
- ];
1662
- }
1663
- getDaysInMonth(date) {
1664
- return super.getDaysInMonth($8d73d47422ca7302$var$toGregorian(date));
1665
- }
1666
- balanceDate() {}
1667
- constructor(...args){
1668
- super(...args);
1669
- this.identifier = "buddhist";
1670
- }
1671
- }
1672
- function $8d73d47422ca7302$var$toGregorian(date) {
1673
- let [era, year] = (0, $3b62074eb05584b2$export$4475b7e617eb123c)(date.year + $8d73d47422ca7302$var$BUDDHIST_ERA_START);
1674
- return new (0, $35ea8db9cb2ccb90$export$99faa760c7908e4f)(era, year, date.month, date.day);
1675
- }
1676
-
1677
-
1678
- /*
1679
- * Copyright 2020 Adobe. All rights reserved.
1680
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
1681
- * you may not use this file except in compliance with the License. You may obtain a copy
1682
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
1683
- *
1684
- * Unless required by applicable law or agreed to in writing, software distributed under
1685
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
1686
- * OF ANY KIND, either express or implied. See the License for the specific language
1687
- * governing permissions and limitations under the License.
1688
- */ // Portions of the code in this file are based on code from ICU.
1689
- // Original licensing can be found in the NOTICE file in the root directory of this source tree.
1690
-
1691
-
1692
- const $5f31bd6f0c8940b2$var$TAIWAN_ERA_START = 1911;
1693
- function $5f31bd6f0c8940b2$var$gregorianYear(date) {
1694
- return date.era === "minguo" ? date.year + $5f31bd6f0c8940b2$var$TAIWAN_ERA_START : 1 - date.year + $5f31bd6f0c8940b2$var$TAIWAN_ERA_START;
1695
- }
1696
- function $5f31bd6f0c8940b2$var$gregorianToTaiwan(year) {
1697
- let y = year - $5f31bd6f0c8940b2$var$TAIWAN_ERA_START;
1698
- if (y > 0) return [
1699
- "minguo",
1700
- y
1701
- ];
1702
- else return [
1703
- "before_minguo",
1704
- 1 - y
1705
- ];
1706
- }
1707
- class $5f31bd6f0c8940b2$export$65e01080afcb0799 extends (0, $3b62074eb05584b2$export$80ee6245ec4f29ec) {
1708
- fromJulianDay(jd) {
1709
- let date = super.fromJulianDay(jd);
1710
- let extendedYear = (0, $3b62074eb05584b2$export$c36e0ecb2d4fa69d)(date.era, date.year);
1711
- let [era, year] = $5f31bd6f0c8940b2$var$gregorianToTaiwan(extendedYear);
1712
- return new (0, $35ea8db9cb2ccb90$export$99faa760c7908e4f)(this, era, year, date.month, date.day);
1713
- }
1714
- toJulianDay(date) {
1715
- return super.toJulianDay($5f31bd6f0c8940b2$var$toGregorian(date));
1716
- }
1717
- getEras() {
1718
- return [
1719
- "before_minguo",
1720
- "minguo"
1721
- ];
1722
- }
1723
- balanceDate(date) {
1724
- let [era, year] = $5f31bd6f0c8940b2$var$gregorianToTaiwan($5f31bd6f0c8940b2$var$gregorianYear(date));
1725
- date.era = era;
1726
- date.year = year;
1727
- }
1728
- isInverseEra(date) {
1729
- return date.era === "before_minguo";
1730
- }
1731
- getDaysInMonth(date) {
1732
- return super.getDaysInMonth($5f31bd6f0c8940b2$var$toGregorian(date));
1733
- }
1734
- getYearsInEra(date) {
1735
- return date.era === "before_minguo" ? 9999 : 9999 - $5f31bd6f0c8940b2$var$TAIWAN_ERA_START;
1736
- }
1737
- constructor(...args){
1738
- super(...args);
1739
- this.identifier = "roc" // Republic of China
1740
- ;
1741
- }
1742
- }
1743
- function $5f31bd6f0c8940b2$var$toGregorian(date) {
1744
- let [era, year] = (0, $3b62074eb05584b2$export$4475b7e617eb123c)($5f31bd6f0c8940b2$var$gregorianYear(date));
1745
- return new (0, $35ea8db9cb2ccb90$export$99faa760c7908e4f)(era, year, date.month, date.day);
1746
- }
1747
-
1748
-
1749
- /*
1750
- * Copyright 2020 Adobe. All rights reserved.
1751
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
1752
- * you may not use this file except in compliance with the License. You may obtain a copy
1753
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
1754
- *
1755
- * Unless required by applicable law or agreed to in writing, software distributed under
1756
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
1757
- * OF ANY KIND, either express or implied. See the License for the specific language
1758
- * governing permissions and limitations under the License.
1759
- */ // Portions of the code in this file are based on code from ICU.
1760
- // Original licensing can be found in the NOTICE file in the root directory of this source tree.
1761
-
1762
-
1763
- const $f3ed2e4472ae7e25$var$PERSIAN_EPOCH = 1948320;
1764
- // Number of days from the start of the year to the start of each month.
1765
- const $f3ed2e4472ae7e25$var$MONTH_START = [
1766
- 0,
1767
- 31,
1768
- 62,
1769
- 93,
1770
- 124,
1771
- 155,
1772
- 186,
1773
- 216,
1774
- 246,
1775
- 276,
1776
- 306,
1777
- 336 // Esfand
1778
- ];
1779
- class $f3ed2e4472ae7e25$export$37fccdbfd14c5939 {
1780
- fromJulianDay(jd) {
1781
- let daysSinceEpoch = jd - $f3ed2e4472ae7e25$var$PERSIAN_EPOCH;
1782
- let year = 1 + Math.floor((33 * daysSinceEpoch + 3) / 12053);
1783
- let farvardin1 = 365 * (year - 1) + Math.floor((8 * year + 21) / 33);
1784
- let dayOfYear = daysSinceEpoch - farvardin1;
1785
- let month = dayOfYear < 216 ? Math.floor(dayOfYear / 31) : Math.floor((dayOfYear - 6) / 30);
1786
- let day = dayOfYear - $f3ed2e4472ae7e25$var$MONTH_START[month] + 1;
1787
- return new (0, $35ea8db9cb2ccb90$export$99faa760c7908e4f)(this, year, month + 1, day);
1788
- }
1789
- toJulianDay(date) {
1790
- let jd = $f3ed2e4472ae7e25$var$PERSIAN_EPOCH - 1 + 365 * (date.year - 1) + Math.floor((8 * date.year + 21) / 33);
1791
- jd += $f3ed2e4472ae7e25$var$MONTH_START[date.month - 1];
1792
- jd += date.day;
1793
- return jd;
1794
- }
1795
- getMonthsInYear() {
1796
- return 12;
1797
- }
1798
- getDaysInMonth(date) {
1799
- if (date.month <= 6) return 31;
1800
- if (date.month <= 11) return 30;
1801
- let isLeapYear = (0, $2b4dce13dd5a17fa$export$842a2cf37af977e1)(25 * date.year + 11, 33) < 8;
1802
- return isLeapYear ? 30 : 29;
1803
- }
1804
- getEras() {
1805
- return [
1806
- "AP"
1807
- ];
1808
- }
1809
- getYearsInEra() {
1810
- // 9378-10-10 persian is 9999-12-31 gregorian.
1811
- // Round down to 9377 to set the maximum full year.
1812
- return 9377;
1813
- }
1814
- constructor(){
1815
- this.identifier = "persian";
1816
- }
1817
- }
1818
-
1819
-
1820
- /*
1821
- * Copyright 2020 Adobe. All rights reserved.
1822
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
1823
- * you may not use this file except in compliance with the License. You may obtain a copy
1824
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
1825
- *
1826
- * Unless required by applicable law or agreed to in writing, software distributed under
1827
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
1828
- * OF ANY KIND, either express or implied. See the License for the specific language
1829
- * governing permissions and limitations under the License.
1830
- */ // Portions of the code in this file are based on code from ICU.
1831
- // Original licensing can be found in the NOTICE file in the root directory of this source tree.
1832
-
1833
-
1834
- // Starts in 78 AD,
1835
- const $82c358003bdda0a8$var$INDIAN_ERA_START = 78;
1836
- // The Indian year starts 80 days later than the Gregorian year.
1837
- const $82c358003bdda0a8$var$INDIAN_YEAR_START = 80;
1838
- class $82c358003bdda0a8$export$39f31c639fa15726 extends (0, $3b62074eb05584b2$export$80ee6245ec4f29ec) {
1839
- fromJulianDay(jd) {
1840
- // Gregorian date for Julian day
1841
- let date = super.fromJulianDay(jd);
1842
- // Year in Saka era
1843
- let indianYear = date.year - $82c358003bdda0a8$var$INDIAN_ERA_START;
1844
- // Day number in Gregorian year (starting from 0)
1845
- let yDay = jd - (0, $3b62074eb05584b2$export$f297eb839006d339)(date.era, date.year, 1, 1);
1846
- let leapMonth;
1847
- if (yDay < $82c358003bdda0a8$var$INDIAN_YEAR_START) {
1848
- // Day is at the end of the preceding Saka year
1849
- indianYear--;
1850
- // Days in leapMonth this year, previous Gregorian year
1851
- leapMonth = (0, $3b62074eb05584b2$export$553d7fa8e3805fc0)(date.year - 1) ? 31 : 30;
1852
- yDay += leapMonth + 155 + 90 + 10;
1853
- } else {
1854
- // Days in leapMonth this year
1855
- leapMonth = (0, $3b62074eb05584b2$export$553d7fa8e3805fc0)(date.year) ? 31 : 30;
1856
- yDay -= $82c358003bdda0a8$var$INDIAN_YEAR_START;
1857
- }
1858
- let indianMonth;
1859
- let indianDay;
1860
- if (yDay < leapMonth) {
1861
- indianMonth = 1;
1862
- indianDay = yDay + 1;
1863
- } else {
1864
- let mDay = yDay - leapMonth;
1865
- if (mDay < 155) {
1866
- indianMonth = Math.floor(mDay / 31) + 2;
1867
- indianDay = mDay % 31 + 1;
1868
- } else {
1869
- mDay -= 155;
1870
- indianMonth = Math.floor(mDay / 30) + 7;
1871
- indianDay = mDay % 30 + 1;
1872
- }
1873
- }
1874
- return new (0, $35ea8db9cb2ccb90$export$99faa760c7908e4f)(this, indianYear, indianMonth, indianDay);
1875
- }
1876
- toJulianDay(date) {
1877
- let extendedYear = date.year + $82c358003bdda0a8$var$INDIAN_ERA_START;
1878
- let [era, year] = (0, $3b62074eb05584b2$export$4475b7e617eb123c)(extendedYear);
1879
- let leapMonth;
1880
- let jd;
1881
- if ((0, $3b62074eb05584b2$export$553d7fa8e3805fc0)(year)) {
1882
- leapMonth = 31;
1883
- jd = (0, $3b62074eb05584b2$export$f297eb839006d339)(era, year, 3, 21);
1884
- } else {
1885
- leapMonth = 30;
1886
- jd = (0, $3b62074eb05584b2$export$f297eb839006d339)(era, year, 3, 22);
1887
- }
1888
- if (date.month === 1) return jd + date.day - 1;
1889
- jd += leapMonth + Math.min(date.month - 2, 5) * 31;
1890
- if (date.month >= 8) jd += (date.month - 7) * 30;
1891
- jd += date.day - 1;
1892
- return jd;
1893
- }
1894
- getDaysInMonth(date) {
1895
- if (date.month === 1 && (0, $3b62074eb05584b2$export$553d7fa8e3805fc0)(date.year + $82c358003bdda0a8$var$INDIAN_ERA_START)) return 31;
1896
- if (date.month >= 2 && date.month <= 6) return 31;
1897
- return 30;
1898
- }
1899
- getYearsInEra() {
1900
- // 9999-12-31 gregorian is 9920-10-10 indian.
1901
- // Round down to 9919 for the last full year.
1902
- return 9919;
1903
- }
1904
- getEras() {
1905
- return [
1906
- "saka"
1907
- ];
1908
- }
1909
- balanceDate() {}
1910
- constructor(...args){
1911
- super(...args);
1912
- this.identifier = "indian";
1913
- }
1914
- }
1915
-
1916
-
1917
- /*
1918
- * Copyright 2020 Adobe. All rights reserved.
1919
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
1920
- * you may not use this file except in compliance with the License. You may obtain a copy
1921
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
1922
- *
1923
- * Unless required by applicable law or agreed to in writing, software distributed under
1924
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
1925
- * OF ANY KIND, either express or implied. See the License for the specific language
1926
- * governing permissions and limitations under the License.
1927
- */ // Portions of the code in this file are based on code from ICU.
1928
- // Original licensing can be found in the NOTICE file in the root directory of this source tree.
1929
-
1930
- const $f2f3e0e3a817edbd$var$CIVIL_EPOC = 1948440; // CE 622 July 16 Friday (Julian calendar) / CE 622 July 19 (Gregorian calendar)
1931
- const $f2f3e0e3a817edbd$var$ASTRONOMICAL_EPOC = 1948439; // CE 622 July 15 Thursday (Julian calendar)
1932
- const $f2f3e0e3a817edbd$var$UMALQURA_YEAR_START = 1300;
1933
- const $f2f3e0e3a817edbd$var$UMALQURA_YEAR_END = 1600;
1934
- const $f2f3e0e3a817edbd$var$UMALQURA_START_DAYS = 460322;
1935
- function $f2f3e0e3a817edbd$var$islamicToJulianDay(epoch, year, month, day) {
1936
- return day + Math.ceil(29.5 * (month - 1)) + (year - 1) * 354 + Math.floor((3 + 11 * year) / 30) + epoch - 1;
1937
- }
1938
- function $f2f3e0e3a817edbd$var$julianDayToIslamic(calendar, epoch, jd) {
1939
- let year = Math.floor((30 * (jd - epoch) + 10646) / 10631);
1940
- let month = Math.min(12, Math.ceil((jd - (29 + $f2f3e0e3a817edbd$var$islamicToJulianDay(epoch, year, 1, 1))) / 29.5) + 1);
1941
- let day = jd - $f2f3e0e3a817edbd$var$islamicToJulianDay(epoch, year, month, 1) + 1;
1942
- return new (0, $35ea8db9cb2ccb90$export$99faa760c7908e4f)(calendar, year, month, day);
1943
- }
1944
- function $f2f3e0e3a817edbd$var$isLeapYear(year) {
1945
- return (14 + 11 * year) % 30 < 11;
1946
- }
1947
- class $f2f3e0e3a817edbd$export$2066795aadd37bfc {
1948
- fromJulianDay(jd) {
1949
- return $f2f3e0e3a817edbd$var$julianDayToIslamic(this, $f2f3e0e3a817edbd$var$CIVIL_EPOC, jd);
1950
- }
1951
- toJulianDay(date) {
1952
- return $f2f3e0e3a817edbd$var$islamicToJulianDay($f2f3e0e3a817edbd$var$CIVIL_EPOC, date.year, date.month, date.day);
1953
- }
1954
- getDaysInMonth(date) {
1955
- let length = 29 + date.month % 2;
1956
- if (date.month === 12 && $f2f3e0e3a817edbd$var$isLeapYear(date.year)) length++;
1957
- return length;
1958
- }
1959
- getMonthsInYear() {
1960
- return 12;
1961
- }
1962
- getDaysInYear(date) {
1963
- return $f2f3e0e3a817edbd$var$isLeapYear(date.year) ? 355 : 354;
1964
- }
1965
- getYearsInEra() {
1966
- // 9999 gregorian
1967
- return 9665;
1968
- }
1969
- getEras() {
1970
- return [
1971
- "AH"
1972
- ];
1973
- }
1974
- constructor(){
1975
- this.identifier = "islamic-civil";
1976
- }
1977
- }
1978
- class $f2f3e0e3a817edbd$export$37f0887f2f9d22f7 extends $f2f3e0e3a817edbd$export$2066795aadd37bfc {
1979
- fromJulianDay(jd) {
1980
- return $f2f3e0e3a817edbd$var$julianDayToIslamic(this, $f2f3e0e3a817edbd$var$ASTRONOMICAL_EPOC, jd);
1981
- }
1982
- toJulianDay(date) {
1983
- return $f2f3e0e3a817edbd$var$islamicToJulianDay($f2f3e0e3a817edbd$var$ASTRONOMICAL_EPOC, date.year, date.month, date.day);
1984
- }
1985
- constructor(...args){
1986
- super(...args);
1987
- this.identifier = "islamic-tbla";
1988
- }
1989
- }
1990
- // Generated by scripts/generate-umalqura.js
1991
- const $f2f3e0e3a817edbd$var$UMALQURA_DATA = "qgpUDckO1AbqBmwDrQpVBakGkgepC9QF2gpcBS0NlQZKB1QLagutBa4ETwoXBYsGpQbVCtYCWwmdBE0KJg2VDawFtgm6AlsKKwWVCsoG6Qr0AnYJtgJWCcoKpAvSC9kF3AJtCU0FpQpSC6ULtAW2CVcFlwJLBaMGUgdlC2oFqworBZUMSg2lDcoF1gpXCasESwmlClILagt1BXYCtwhbBFUFqQW0BdoJ3QRuAjYJqgpUDbIN1QXaAlsJqwRVCkkLZAtxC7QFtQpVCiUNkg7JDtQG6QprCasEkwpJDaQNsg25CroEWworBZUKKgtVC1wFvQQ9Ah0JlQpKC1oLbQW2AjsJmwRVBqkGVAdqC2wFrQpVBSkLkgupC9QF2gpaBasKlQVJB2QHqgu1BbYCVgpNDiULUgtqC60FrgIvCZcESwalBqwG1gpdBZ0ETQoWDZUNqgW1BdoCWwmtBJUFygbkBuoK9QS2AlYJqgpUC9IL2QXqAm0JrQSVCkoLpQuyBbUJ1gSXCkcFkwZJB1ULagVrCisFiwpGDaMNygXWCtsEawJLCaUKUgtpC3UFdgG3CFsCKwVlBbQF2gntBG0BtgimClINqQ3UBdoKWwmrBFMGKQdiB6kLsgW1ClUFJQuSDckO0gbpCmsFqwRVCikNVA2qDbUJugQ7CpsETQqqCtUK2gJdCV4ELgqaDFUNsga5BroEXQotBZUKUguoC7QLuQXaAloJSgukDdEO6AZqC20FNQWVBkoNqA3UDdoGWwWdAisGFQtKC5ULqgWuCi4JjwwnBZUGqgbWCl0FnQI=";
1992
- let $f2f3e0e3a817edbd$var$UMALQURA_MONTHLENGTH;
1993
- let $f2f3e0e3a817edbd$var$UMALQURA_YEAR_START_TABLE;
1994
- function $f2f3e0e3a817edbd$var$umalquraYearStart(year) {
1995
- return $f2f3e0e3a817edbd$var$UMALQURA_START_DAYS + $f2f3e0e3a817edbd$var$UMALQURA_YEAR_START_TABLE[year - $f2f3e0e3a817edbd$var$UMALQURA_YEAR_START];
1996
- }
1997
- function $f2f3e0e3a817edbd$var$umalquraMonthLength(year, month) {
1998
- let idx = year - $f2f3e0e3a817edbd$var$UMALQURA_YEAR_START;
1999
- let mask = 0x01 << 11 - (month - 1);
2000
- if (($f2f3e0e3a817edbd$var$UMALQURA_MONTHLENGTH[idx] & mask) === 0) return 29;
2001
- else return 30;
2002
- }
2003
- function $f2f3e0e3a817edbd$var$umalquraMonthStart(year, month) {
2004
- let day = $f2f3e0e3a817edbd$var$umalquraYearStart(year);
2005
- for(let i = 1; i < month; i++)day += $f2f3e0e3a817edbd$var$umalquraMonthLength(year, i);
2006
- return day;
2007
- }
2008
- function $f2f3e0e3a817edbd$var$umalquraYearLength(year) {
2009
- return $f2f3e0e3a817edbd$var$UMALQURA_YEAR_START_TABLE[year + 1 - $f2f3e0e3a817edbd$var$UMALQURA_YEAR_START] - $f2f3e0e3a817edbd$var$UMALQURA_YEAR_START_TABLE[year - $f2f3e0e3a817edbd$var$UMALQURA_YEAR_START];
2010
- }
2011
- class $f2f3e0e3a817edbd$export$5baab4758c231076 extends $f2f3e0e3a817edbd$export$2066795aadd37bfc {
2012
- fromJulianDay(jd) {
2013
- let days = jd - $f2f3e0e3a817edbd$var$CIVIL_EPOC;
2014
- let startDays = $f2f3e0e3a817edbd$var$umalquraYearStart($f2f3e0e3a817edbd$var$UMALQURA_YEAR_START);
2015
- let endDays = $f2f3e0e3a817edbd$var$umalquraYearStart($f2f3e0e3a817edbd$var$UMALQURA_YEAR_END);
2016
- if (days < startDays || days > endDays) return super.fromJulianDay(jd);
2017
- else {
2018
- let y = $f2f3e0e3a817edbd$var$UMALQURA_YEAR_START - 1;
2019
- let m = 1;
2020
- let d = 1;
2021
- while(d > 0){
2022
- y++;
2023
- d = days - $f2f3e0e3a817edbd$var$umalquraYearStart(y) + 1;
2024
- let yearLength = $f2f3e0e3a817edbd$var$umalquraYearLength(y);
2025
- if (d === yearLength) {
2026
- m = 12;
2027
- break;
2028
- } else if (d < yearLength) {
2029
- let monthLength = $f2f3e0e3a817edbd$var$umalquraMonthLength(y, m);
2030
- m = 1;
2031
- while(d > monthLength){
2032
- d -= monthLength;
2033
- m++;
2034
- monthLength = $f2f3e0e3a817edbd$var$umalquraMonthLength(y, m);
2035
- }
2036
- break;
2037
- }
2038
- }
2039
- return new (0, $35ea8db9cb2ccb90$export$99faa760c7908e4f)(this, y, m, days - $f2f3e0e3a817edbd$var$umalquraMonthStart(y, m) + 1);
2040
- }
2041
- }
2042
- toJulianDay(date) {
2043
- if (date.year < $f2f3e0e3a817edbd$var$UMALQURA_YEAR_START || date.year > $f2f3e0e3a817edbd$var$UMALQURA_YEAR_END) return super.toJulianDay(date);
2044
- return $f2f3e0e3a817edbd$var$CIVIL_EPOC + $f2f3e0e3a817edbd$var$umalquraMonthStart(date.year, date.month) + (date.day - 1);
2045
- }
2046
- getDaysInMonth(date) {
2047
- if (date.year < $f2f3e0e3a817edbd$var$UMALQURA_YEAR_START || date.year > $f2f3e0e3a817edbd$var$UMALQURA_YEAR_END) return super.getDaysInMonth(date);
2048
- return $f2f3e0e3a817edbd$var$umalquraMonthLength(date.year, date.month);
2049
- }
2050
- getDaysInYear(date) {
2051
- if (date.year < $f2f3e0e3a817edbd$var$UMALQURA_YEAR_START || date.year > $f2f3e0e3a817edbd$var$UMALQURA_YEAR_END) return super.getDaysInYear(date);
2052
- return $f2f3e0e3a817edbd$var$umalquraYearLength(date.year);
2053
- }
2054
- constructor(){
2055
- super();
2056
- this.identifier = "islamic-umalqura";
2057
- if (!$f2f3e0e3a817edbd$var$UMALQURA_MONTHLENGTH) $f2f3e0e3a817edbd$var$UMALQURA_MONTHLENGTH = new Uint16Array(Uint8Array.from(atob($f2f3e0e3a817edbd$var$UMALQURA_DATA), (c)=>c.charCodeAt(0)).buffer);
2058
- if (!$f2f3e0e3a817edbd$var$UMALQURA_YEAR_START_TABLE) {
2059
- $f2f3e0e3a817edbd$var$UMALQURA_YEAR_START_TABLE = new Uint32Array($f2f3e0e3a817edbd$var$UMALQURA_YEAR_END - $f2f3e0e3a817edbd$var$UMALQURA_YEAR_START + 1);
2060
- let yearStart = 0;
2061
- for(let year = $f2f3e0e3a817edbd$var$UMALQURA_YEAR_START; year <= $f2f3e0e3a817edbd$var$UMALQURA_YEAR_END; year++){
2062
- $f2f3e0e3a817edbd$var$UMALQURA_YEAR_START_TABLE[year - $f2f3e0e3a817edbd$var$UMALQURA_YEAR_START] = yearStart;
2063
- for(let i = 1; i <= 12; i++)yearStart += $f2f3e0e3a817edbd$var$umalquraMonthLength(year, i);
2064
- }
2065
- }
2066
- }
2067
- }
2068
-
2069
-
2070
- /*
2071
- * Copyright 2020 Adobe. All rights reserved.
2072
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
2073
- * you may not use this file except in compliance with the License. You may obtain a copy
2074
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
2075
- *
2076
- * Unless required by applicable law or agreed to in writing, software distributed under
2077
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
2078
- * OF ANY KIND, either express or implied. See the License for the specific language
2079
- * governing permissions and limitations under the License.
2080
- */ // Portions of the code in this file are based on code from ICU.
2081
- // Original licensing can be found in the NOTICE file in the root directory of this source tree.
2082
-
2083
-
2084
- const $7c5f6fbf42389787$var$HEBREW_EPOCH = 347997;
2085
- // Hebrew date calculations are performed in terms of days, hours, and
2086
- // "parts" (or halakim), which are 1/1080 of an hour, or 3 1/3 seconds.
2087
- const $7c5f6fbf42389787$var$HOUR_PARTS = 1080;
2088
- const $7c5f6fbf42389787$var$DAY_PARTS = 24 * $7c5f6fbf42389787$var$HOUR_PARTS;
2089
- // An approximate value for the length of a lunar month.
2090
- // It is used to calculate the approximate year and month of a given
2091
- // absolute date.
2092
- const $7c5f6fbf42389787$var$MONTH_DAYS = 29;
2093
- const $7c5f6fbf42389787$var$MONTH_FRACT = 12 * $7c5f6fbf42389787$var$HOUR_PARTS + 793;
2094
- const $7c5f6fbf42389787$var$MONTH_PARTS = $7c5f6fbf42389787$var$MONTH_DAYS * $7c5f6fbf42389787$var$DAY_PARTS + $7c5f6fbf42389787$var$MONTH_FRACT;
2095
- function $7c5f6fbf42389787$var$isLeapYear(year) {
2096
- return (0, $2b4dce13dd5a17fa$export$842a2cf37af977e1)(year * 7 + 1, 19) < 7;
2097
- }
2098
- // Test for delay of start of new year and to avoid
2099
- // Sunday, Wednesday, and Friday as start of the new year.
2100
- function $7c5f6fbf42389787$var$hebrewDelay1(year) {
2101
- let months = Math.floor((235 * year - 234) / 19);
2102
- let parts = 12084 + 13753 * months;
2103
- let day = months * 29 + Math.floor(parts / 25920);
2104
- if ((0, $2b4dce13dd5a17fa$export$842a2cf37af977e1)(3 * (day + 1), 7) < 3) day += 1;
2105
- return day;
2106
- }
2107
- // Check for delay in start of new year due to length of adjacent years
2108
- function $7c5f6fbf42389787$var$hebrewDelay2(year) {
2109
- let last = $7c5f6fbf42389787$var$hebrewDelay1(year - 1);
2110
- let present = $7c5f6fbf42389787$var$hebrewDelay1(year);
2111
- let next = $7c5f6fbf42389787$var$hebrewDelay1(year + 1);
2112
- if (next - present === 356) return 2;
2113
- if (present - last === 382) return 1;
2114
- return 0;
2115
- }
2116
- function $7c5f6fbf42389787$var$startOfYear(year) {
2117
- return $7c5f6fbf42389787$var$hebrewDelay1(year) + $7c5f6fbf42389787$var$hebrewDelay2(year);
2118
- }
2119
- function $7c5f6fbf42389787$var$getDaysInYear(year) {
2120
- return $7c5f6fbf42389787$var$startOfYear(year + 1) - $7c5f6fbf42389787$var$startOfYear(year);
2121
- }
2122
- function $7c5f6fbf42389787$var$getYearType(year) {
2123
- let yearLength = $7c5f6fbf42389787$var$getDaysInYear(year);
2124
- if (yearLength > 380) yearLength -= 30; // Subtract length of leap month.
2125
- switch(yearLength){
2126
- case 353:
2127
- return 0; // deficient
2128
- case 354:
2129
- return 1; // normal
2130
- case 355:
2131
- return 2; // complete
2132
- }
2133
- }
2134
- function $7c5f6fbf42389787$var$getDaysInMonth(year, month) {
2135
- // Normalize month numbers from 1 - 13, even on non-leap years
2136
- if (month >= 6 && !$7c5f6fbf42389787$var$isLeapYear(year)) month++;
2137
- // First of all, dispose of fixed-length 29 day months
2138
- if (month === 4 || month === 7 || month === 9 || month === 11 || month === 13) return 29;
2139
- let yearType = $7c5f6fbf42389787$var$getYearType(year);
2140
- // If it's Heshvan, days depend on length of year
2141
- if (month === 2) return yearType === 2 ? 30 : 29;
2142
- // Similarly, Kislev varies with the length of year
2143
- if (month === 3) return yearType === 0 ? 29 : 30;
2144
- // Adar I only exists in leap years
2145
- if (month === 6) return $7c5f6fbf42389787$var$isLeapYear(year) ? 30 : 0;
2146
- return 30;
2147
- }
2148
- class $7c5f6fbf42389787$export$ca405048b8fb5af {
2149
- fromJulianDay(jd) {
2150
- let d = jd - $7c5f6fbf42389787$var$HEBREW_EPOCH;
2151
- let m = d * $7c5f6fbf42389787$var$DAY_PARTS / $7c5f6fbf42389787$var$MONTH_PARTS; // Months (approx)
2152
- let year = Math.floor((19 * m + 234) / 235) + 1; // Years (approx)
2153
- let ys = $7c5f6fbf42389787$var$startOfYear(year); // 1st day of year
2154
- let dayOfYear = Math.floor(d - ys);
2155
- // Because of the postponement rules, it's possible to guess wrong. Fix it.
2156
- while(dayOfYear < 1){
2157
- year--;
2158
- ys = $7c5f6fbf42389787$var$startOfYear(year);
2159
- dayOfYear = Math.floor(d - ys);
2160
- }
2161
- // Now figure out which month we're in, and the date within that month
2162
- let month = 1;
2163
- let monthStart = 0;
2164
- while(monthStart < dayOfYear){
2165
- monthStart += $7c5f6fbf42389787$var$getDaysInMonth(year, month);
2166
- month++;
2167
- }
2168
- month--;
2169
- monthStart -= $7c5f6fbf42389787$var$getDaysInMonth(year, month);
2170
- let day = dayOfYear - monthStart;
2171
- return new (0, $35ea8db9cb2ccb90$export$99faa760c7908e4f)(this, year, month, day);
2172
- }
2173
- toJulianDay(date) {
2174
- let jd = $7c5f6fbf42389787$var$startOfYear(date.year);
2175
- for(let month = 1; month < date.month; month++)jd += $7c5f6fbf42389787$var$getDaysInMonth(date.year, month);
2176
- return jd + date.day + $7c5f6fbf42389787$var$HEBREW_EPOCH;
2177
- }
2178
- getDaysInMonth(date) {
2179
- return $7c5f6fbf42389787$var$getDaysInMonth(date.year, date.month);
2180
- }
2181
- getMonthsInYear(date) {
2182
- return $7c5f6fbf42389787$var$isLeapYear(date.year) ? 13 : 12;
2183
- }
2184
- getDaysInYear(date) {
2185
- return $7c5f6fbf42389787$var$getDaysInYear(date.year);
2186
- }
2187
- getYearsInEra() {
2188
- // 6239 gregorian
2189
- return 9999;
2190
- }
2191
- getEras() {
2192
- return [
2193
- "AM"
2194
- ];
2195
- }
2196
- balanceYearMonth(date, previousDate) {
2197
- // Keep date in the same month when switching between leap years and non leap years
2198
- if (previousDate.year !== date.year) {
2199
- if ($7c5f6fbf42389787$var$isLeapYear(previousDate.year) && !$7c5f6fbf42389787$var$isLeapYear(date.year) && previousDate.month > 6) date.month--;
2200
- else if (!$7c5f6fbf42389787$var$isLeapYear(previousDate.year) && $7c5f6fbf42389787$var$isLeapYear(date.year) && previousDate.month > 6) date.month++;
2201
- }
2202
- }
2203
- constructor(){
2204
- this.identifier = "hebrew";
2205
- }
2206
- }
2207
-
2208
-
2209
- /*
2210
- * Copyright 2020 Adobe. All rights reserved.
2211
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
2212
- * you may not use this file except in compliance with the License. You may obtain a copy
2213
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
2214
- *
2215
- * Unless required by applicable law or agreed to in writing, software distributed under
2216
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
2217
- * OF ANY KIND, either express or implied. See the License for the specific language
2218
- * governing permissions and limitations under the License.
2219
- */ // Portions of the code in this file are based on code from ICU.
2220
- // Original licensing can be found in the NOTICE file in the root directory of this source tree.
2221
-
2222
- const $b956b2d7a6cf451f$var$ETHIOPIC_EPOCH = 1723856;
2223
- const $b956b2d7a6cf451f$var$COPTIC_EPOCH = 1824665;
2224
- // The delta between Amete Alem 1 and Amete Mihret 1
2225
- // AA 5501 = AM 1
2226
- const $b956b2d7a6cf451f$var$AMETE_MIHRET_DELTA = 5500;
2227
- function $b956b2d7a6cf451f$var$ceToJulianDay(epoch, year, month, day) {
2228
- return epoch // difference from Julian epoch to 1,1,1
2229
- + 365 * year // number of days from years
2230
- + Math.floor(year / 4) // extra day of leap year
2231
- + 30 * (month - 1 // number of days from months (1 based)
2232
- ) + day - 1 // number of days for present month (1 based)
2233
- ;
2234
- }
2235
- function $b956b2d7a6cf451f$var$julianDayToCE(epoch, jd) {
2236
- let year = Math.floor(4 * (jd - epoch) / 1461);
2237
- let month = 1 + Math.floor((jd - $b956b2d7a6cf451f$var$ceToJulianDay(epoch, year, 1, 1)) / 30);
2238
- let day = jd + 1 - $b956b2d7a6cf451f$var$ceToJulianDay(epoch, year, month, 1);
2239
- return [
2240
- year,
2241
- month,
2242
- day
2243
- ];
2244
- }
2245
- function $b956b2d7a6cf451f$var$getLeapDay(year) {
2246
- return Math.floor(year % 4 / 3);
2247
- }
2248
- function $b956b2d7a6cf451f$var$getDaysInMonth(year, month) {
2249
- // The Ethiopian and Coptic calendars have 13 months, 12 of 30 days each and
2250
- // an intercalary month at the end of the year of 5 or 6 days, depending whether
2251
- // the year is a leap year or not. The Leap Year follows the same rules as the
2252
- // Julian Calendar so that the extra month always has six days in the year before
2253
- // a Julian Leap Year.
2254
- if (month % 13 !== 0) // not intercalary month
2255
- return 30;
2256
- else // intercalary month 5 days + possible leap day
2257
- return $b956b2d7a6cf451f$var$getLeapDay(year) + 5;
2258
- }
2259
- class $b956b2d7a6cf451f$export$26ba6eab5e20cd7d {
2260
- fromJulianDay(jd) {
2261
- let [year, month, day] = $b956b2d7a6cf451f$var$julianDayToCE($b956b2d7a6cf451f$var$ETHIOPIC_EPOCH, jd);
2262
- let era = "AM";
2263
- if (year <= 0) {
2264
- era = "AA";
2265
- year += $b956b2d7a6cf451f$var$AMETE_MIHRET_DELTA;
2266
- }
2267
- return new (0, $35ea8db9cb2ccb90$export$99faa760c7908e4f)(this, era, year, month, day);
2268
- }
2269
- toJulianDay(date) {
2270
- let year = date.year;
2271
- if (date.era === "AA") year -= $b956b2d7a6cf451f$var$AMETE_MIHRET_DELTA;
2272
- return $b956b2d7a6cf451f$var$ceToJulianDay($b956b2d7a6cf451f$var$ETHIOPIC_EPOCH, year, date.month, date.day);
2273
- }
2274
- getDaysInMonth(date) {
2275
- return $b956b2d7a6cf451f$var$getDaysInMonth(date.year, date.month);
2276
- }
2277
- getMonthsInYear() {
2278
- return 13;
2279
- }
2280
- getDaysInYear(date) {
2281
- return 365 + $b956b2d7a6cf451f$var$getLeapDay(date.year);
2282
- }
2283
- getYearsInEra(date) {
2284
- // 9999-12-31 gregorian is 9992-20-02 ethiopic.
2285
- // Round down to 9991 for the last full year.
2286
- // AA 9999-01-01 ethiopic is 4506-09-30 gregorian.
2287
- return date.era === "AA" ? 9999 : 9991;
2288
- }
2289
- getEras() {
2290
- return [
2291
- "AA",
2292
- "AM"
2293
- ];
2294
- }
2295
- constructor(){
2296
- this.identifier = "ethiopic";
2297
- }
2298
- }
2299
- class $b956b2d7a6cf451f$export$d72e0c37005a4914 extends $b956b2d7a6cf451f$export$26ba6eab5e20cd7d {
2300
- fromJulianDay(jd) {
2301
- let [year, month, day] = $b956b2d7a6cf451f$var$julianDayToCE($b956b2d7a6cf451f$var$ETHIOPIC_EPOCH, jd);
2302
- year += $b956b2d7a6cf451f$var$AMETE_MIHRET_DELTA;
2303
- return new (0, $35ea8db9cb2ccb90$export$99faa760c7908e4f)(this, "AA", year, month, day);
2304
- }
2305
- getEras() {
2306
- return [
2307
- "AA"
2308
- ];
2309
- }
2310
- getYearsInEra() {
2311
- // 9999-13-04 ethioaa is the maximum date, which is equivalent to 4506-09-29 gregorian.
2312
- return 9999;
2313
- }
2314
- constructor(...args){
2315
- super(...args);
2316
- this.identifier = "ethioaa" // also known as 'ethiopic-amete-alem' in ICU
2317
- ;
2318
- }
2319
- }
2320
- class $b956b2d7a6cf451f$export$fe6243cbe1a4b7c1 extends $b956b2d7a6cf451f$export$26ba6eab5e20cd7d {
2321
- fromJulianDay(jd) {
2322
- let [year, month, day] = $b956b2d7a6cf451f$var$julianDayToCE($b956b2d7a6cf451f$var$COPTIC_EPOCH, jd);
2323
- let era = "CE";
2324
- if (year <= 0) {
2325
- era = "BCE";
2326
- year = 1 - year;
2327
- }
2328
- return new (0, $35ea8db9cb2ccb90$export$99faa760c7908e4f)(this, era, year, month, day);
2329
- }
2330
- toJulianDay(date) {
2331
- let year = date.year;
2332
- if (date.era === "BCE") year = 1 - year;
2333
- return $b956b2d7a6cf451f$var$ceToJulianDay($b956b2d7a6cf451f$var$COPTIC_EPOCH, year, date.month, date.day);
2334
- }
2335
- getDaysInMonth(date) {
2336
- let year = date.year;
2337
- if (date.era === "BCE") year = 1 - year;
2338
- return $b956b2d7a6cf451f$var$getDaysInMonth(year, date.month);
2339
- }
2340
- isInverseEra(date) {
2341
- return date.era === "BCE";
2342
- }
2343
- balanceDate(date) {
2344
- if (date.year <= 0) {
2345
- date.era = date.era === "BCE" ? "CE" : "BCE";
2346
- date.year = 1 - date.year;
2347
- }
2348
- }
2349
- getEras() {
2350
- return [
2351
- "BCE",
2352
- "CE"
2353
- ];
2354
- }
2355
- getYearsInEra(date) {
2356
- // 9999-12-30 gregorian is 9716-02-20 coptic.
2357
- // Round down to 9715 for the last full year.
2358
- // BCE 9999-01-01 coptic is BC 9716-06-15 gregorian.
2359
- return date.era === "BCE" ? 9999 : 9715;
2360
- }
2361
- constructor(...args){
2362
- super(...args);
2363
- this.identifier = "coptic";
2364
- }
2365
- }
2366
-
1
+ import {CalendarDate as $35ea8db9cb2ccb90$export$99faa760c7908e4f, CalendarDateTime as $35ea8db9cb2ccb90$export$ca871e8dbb80966f, Time as $35ea8db9cb2ccb90$export$680ea196effce5f, ZonedDateTime as $35ea8db9cb2ccb90$export$d3b7288e7994edea} from "./CalendarDate.module.js";
2
+ import {GregorianCalendar as $3b62074eb05584b2$export$80ee6245ec4f29ec} from "./GregorianCalendar.module.js";
3
+ import {JapaneseCalendar as $62225008020f0a13$export$b746ab2b60cdffbf} from "./JapaneseCalendar.module.js";
4
+ import {BuddhistCalendar as $8d73d47422ca7302$export$42d20a78301dee44} from "./BuddhistCalendar.module.js";
5
+ import {TaiwanCalendar as $5f31bd6f0c8940b2$export$65e01080afcb0799} from "./TaiwanCalendar.module.js";
6
+ import {PersianCalendar as $f3ed2e4472ae7e25$export$37fccdbfd14c5939} from "./PersianCalendar.module.js";
7
+ import {IndianCalendar as $82c358003bdda0a8$export$39f31c639fa15726} from "./IndianCalendar.module.js";
8
+ import {IslamicCivilCalendar as $f2f3e0e3a817edbd$export$2066795aadd37bfc, IslamicTabularCalendar as $f2f3e0e3a817edbd$export$37f0887f2f9d22f7, IslamicUmalquraCalendar as $f2f3e0e3a817edbd$export$5baab4758c231076} from "./IslamicCalendar.module.js";
9
+ import {HebrewCalendar as $7c5f6fbf42389787$export$ca405048b8fb5af} from "./HebrewCalendar.module.js";
10
+ import {CopticCalendar as $b956b2d7a6cf451f$export$fe6243cbe1a4b7c1, EthiopicAmeteAlemCalendar as $b956b2d7a6cf451f$export$d72e0c37005a4914, EthiopicCalendar as $b956b2d7a6cf451f$export$26ba6eab5e20cd7d} from "./EthiopicCalendar.module.js";
11
+ import {createCalendar as $64244302c3013299$export$dd0bbc9b26defe37} from "./createCalendar.module.js";
12
+ import {fromAbsolute as $11d87f3f76e88657$export$1b96692a1ba042ac, fromDate as $11d87f3f76e88657$export$e57ff100d91bd4b9, toCalendar as $11d87f3f76e88657$export$b4a036af3fc0b032, toCalendarDate as $11d87f3f76e88657$export$93522d1a439f3617, toCalendarDateTime as $11d87f3f76e88657$export$b21e0b124e224484, toLocalTimeZone as $11d87f3f76e88657$export$d9b67bc93c097491, toTime as $11d87f3f76e88657$export$d33f79e3ffc3dc83, toTimeZone as $11d87f3f76e88657$export$538b00033cc11c75, toZoned as $11d87f3f76e88657$export$84c95a83c799e074} from "./conversion.module.js";
13
+ import {endOfMonth as $14e0f24ef4ac5c92$export$a2258d9c4118825c, endOfWeek as $14e0f24ef4ac5c92$export$ef8b6d9133084f4e, endOfYear as $14e0f24ef4ac5c92$export$8b7aa55c66d5569e, getDayOfWeek as $14e0f24ef4ac5c92$export$2061056d06d7cdf7, getHoursInDay as $14e0f24ef4ac5c92$export$126c91c941de7e, getLocalTimeZone as $14e0f24ef4ac5c92$export$aa8b41735afcabd2, getMinimumDayInMonth as $14e0f24ef4ac5c92$export$b2f4953d301981d5, getMinimumMonthInYear as $14e0f24ef4ac5c92$export$5412ac11713b72ad, getWeeksInMonth as $14e0f24ef4ac5c92$export$ccc1b2479e7dd654, isEqualDay as $14e0f24ef4ac5c92$export$91b62ebf2ba703ee, isEqualMonth as $14e0f24ef4ac5c92$export$5a8da0c44a3afdf2, isEqualYear as $14e0f24ef4ac5c92$export$ea840f5a6dda8147, isSameDay as $14e0f24ef4ac5c92$export$ea39ec197993aef0, isSameMonth as $14e0f24ef4ac5c92$export$a18c89cbd24170ff, isSameYear as $14e0f24ef4ac5c92$export$5841f9eb9773f25f, isToday as $14e0f24ef4ac5c92$export$629b0a497aa65267, isWeekday as $14e0f24ef4ac5c92$export$ee9d87258e1d19ed, isWeekend as $14e0f24ef4ac5c92$export$618d60ea299da42, maxDate as $14e0f24ef4ac5c92$export$a75f2bff57811055, minDate as $14e0f24ef4ac5c92$export$5c333a116e949cdd, now as $14e0f24ef4ac5c92$export$461939dd4422153, startOfMonth as $14e0f24ef4ac5c92$export$a5a3b454ada2268e, startOfWeek as $14e0f24ef4ac5c92$export$42c81a444fbfb5d4, startOfYear as $14e0f24ef4ac5c92$export$f91e89d3d0406102, today as $14e0f24ef4ac5c92$export$d0bdf45af03a6ea3} from "./queries.module.js";
14
+ import {parseAbsolute as $fae977aafc393c5c$export$5adfdab05168c219, parseAbsoluteToLocal as $fae977aafc393c5c$export$8e384432362ed0f0, parseDate as $fae977aafc393c5c$export$6b862160d295c8e, parseDateTime as $fae977aafc393c5c$export$588937bcd60ade55, parseDuration as $fae977aafc393c5c$export$ecae829bb3747ea6, parseTime as $fae977aafc393c5c$export$c9698ec7f05a07e1, parseZonedDateTime as $fae977aafc393c5c$export$fd7893f06e92a6a4} from "./string.module.js";
15
+ import {DateFormatter as $fb18d541ea1ad717$export$ad991b66133851cf} from "./DateFormatter.module.js";
2367
16
 
2368
17
  /*
2369
18
  * Copyright 2020 Adobe. All rights reserved.
@@ -2384,179 +33,11 @@ class $b956b2d7a6cf451f$export$fe6243cbe1a4b7c1 extends $b956b2d7a6cf451f$export
2384
33
 
2385
34
 
2386
35
 
2387
- function $64244302c3013299$export$dd0bbc9b26defe37(name) {
2388
- switch(name){
2389
- case "buddhist":
2390
- return new (0, $8d73d47422ca7302$export$42d20a78301dee44)();
2391
- case "ethiopic":
2392
- return new (0, $b956b2d7a6cf451f$export$26ba6eab5e20cd7d)();
2393
- case "ethioaa":
2394
- return new (0, $b956b2d7a6cf451f$export$d72e0c37005a4914)();
2395
- case "coptic":
2396
- return new (0, $b956b2d7a6cf451f$export$fe6243cbe1a4b7c1)();
2397
- case "hebrew":
2398
- return new (0, $7c5f6fbf42389787$export$ca405048b8fb5af)();
2399
- case "indian":
2400
- return new (0, $82c358003bdda0a8$export$39f31c639fa15726)();
2401
- case "islamic-civil":
2402
- return new (0, $f2f3e0e3a817edbd$export$2066795aadd37bfc)();
2403
- case "islamic-tbla":
2404
- return new (0, $f2f3e0e3a817edbd$export$37f0887f2f9d22f7)();
2405
- case "islamic-umalqura":
2406
- return new (0, $f2f3e0e3a817edbd$export$5baab4758c231076)();
2407
- case "japanese":
2408
- return new (0, $62225008020f0a13$export$b746ab2b60cdffbf)();
2409
- case "persian":
2410
- return new (0, $f3ed2e4472ae7e25$export$37fccdbfd14c5939)();
2411
- case "roc":
2412
- return new (0, $5f31bd6f0c8940b2$export$65e01080afcb0799)();
2413
- case "gregory":
2414
- default:
2415
- return new (0, $3b62074eb05584b2$export$80ee6245ec4f29ec)();
2416
- }
2417
- }
2418
36
 
2419
37
 
2420
38
 
2421
39
 
2422
40
 
2423
- /*
2424
- * Copyright 2020 Adobe. All rights reserved.
2425
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
2426
- * you may not use this file except in compliance with the License. You may obtain a copy
2427
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
2428
- *
2429
- * Unless required by applicable law or agreed to in writing, software distributed under
2430
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
2431
- * OF ANY KIND, either express or implied. See the License for the specific language
2432
- * governing permissions and limitations under the License.
2433
- */ let $fb18d541ea1ad717$var$formatterCache = new Map();
2434
- class $fb18d541ea1ad717$export$ad991b66133851cf {
2435
- /** Formats a date as a string according to the locale and format options passed to the constructor. */ format(value) {
2436
- return this.formatter.format(value);
2437
- }
2438
- /** Formats a date to an array of parts such as separators, numbers, punctuation, and more. */ formatToParts(value) {
2439
- return this.formatter.formatToParts(value);
2440
- }
2441
- /** Formats a date range as a string. */ formatRange(start, end) {
2442
- // @ts-ignore
2443
- if (typeof this.formatter.formatRange === "function") // @ts-ignore
2444
- return this.formatter.formatRange(start, end);
2445
- if (end < start) throw new RangeError("End date must be >= start date");
2446
- // Very basic fallback for old browsers.
2447
- return `${this.formatter.format(start)} \u{2013} ${this.formatter.format(end)}`;
2448
- }
2449
- /** Formats a date range as an array of parts. */ formatRangeToParts(start, end) {
2450
- // @ts-ignore
2451
- if (typeof this.formatter.formatRangeToParts === "function") // @ts-ignore
2452
- return this.formatter.formatRangeToParts(start, end);
2453
- if (end < start) throw new RangeError("End date must be >= start date");
2454
- let startParts = this.formatter.formatToParts(start);
2455
- let endParts = this.formatter.formatToParts(end);
2456
- return [
2457
- ...startParts.map((p)=>({
2458
- ...p,
2459
- source: "startRange"
2460
- })),
2461
- {
2462
- type: "literal",
2463
- value: " \u2013 ",
2464
- source: "shared"
2465
- },
2466
- ...endParts.map((p)=>({
2467
- ...p,
2468
- source: "endRange"
2469
- }))
2470
- ];
2471
- }
2472
- /** Returns the resolved formatting options based on the values passed to the constructor. */ resolvedOptions() {
2473
- let resolvedOptions = this.formatter.resolvedOptions();
2474
- if ($fb18d541ea1ad717$var$hasBuggyResolvedHourCycle()) {
2475
- if (!this.resolvedHourCycle) this.resolvedHourCycle = $fb18d541ea1ad717$var$getResolvedHourCycle(resolvedOptions.locale, this.options);
2476
- resolvedOptions.hourCycle = this.resolvedHourCycle;
2477
- resolvedOptions.hour12 = this.resolvedHourCycle === "h11" || this.resolvedHourCycle === "h12";
2478
- }
2479
- // Safari uses a different name for the Ethiopic (Amete Alem) calendar.
2480
- // https://bugs.webkit.org/show_bug.cgi?id=241564
2481
- if (resolvedOptions.calendar === "ethiopic-amete-alem") resolvedOptions.calendar = "ethioaa";
2482
- return resolvedOptions;
2483
- }
2484
- constructor(locale, options = {}){
2485
- this.formatter = $fb18d541ea1ad717$var$getCachedDateFormatter(locale, options);
2486
- this.options = options;
2487
- }
2488
- }
2489
- // There are multiple bugs involving the hour12 and hourCycle options in various browser engines.
2490
- // - Chrome [1] (and the ECMA 402 spec [2]) resolve hour12: false in English and other locales to h24 (24:00 - 23:59)
2491
- // rather than h23 (00:00 - 23:59). Same can happen with hour12: true in French, which Chrome resolves to h11 (00:00 - 11:59)
2492
- // rather than h12 (12:00 - 11:59).
2493
- // - WebKit returns an incorrect hourCycle resolved option in the French locale due to incorrect parsing of 'h' literal
2494
- // in the resolved pattern. It also formats incorrectly when specifying the hourCycle option for the same reason. [3]
2495
- // [1] https://bugs.chromium.org/p/chromium/issues/detail?id=1045791
2496
- // [2] https://github.com/tc39/ecma402/issues/402
2497
- // [3] https://bugs.webkit.org/show_bug.cgi?id=229313
2498
- // https://github.com/unicode-org/cldr/blob/018b55eff7ceb389c7e3fc44e2f657eae3b10b38/common/supplemental/supplementalData.xml#L4774-L4802
2499
- const $fb18d541ea1ad717$var$hour12Preferences = {
2500
- true: {
2501
- // Only Japanese uses the h11 style for 12 hour time. All others use h12.
2502
- ja: "h11"
2503
- },
2504
- false: {
2505
- }
2506
- };
2507
- function $fb18d541ea1ad717$var$getCachedDateFormatter(locale, options = {}) {
2508
- // Work around buggy hour12 behavior in Chrome / ECMA 402 spec by using hourCycle instead.
2509
- // Only apply the workaround if the issue is detected, because the hourCycle option is buggy in Safari.
2510
- if (typeof options.hour12 === "boolean" && $fb18d541ea1ad717$var$hasBuggyHour12Behavior()) {
2511
- options = {
2512
- ...options
2513
- };
2514
- let pref = $fb18d541ea1ad717$var$hour12Preferences[String(options.hour12)][locale.split("-")[0]];
2515
- let defaultHourCycle = options.hour12 ? "h12" : "h23";
2516
- options.hourCycle = pref !== null && pref !== void 0 ? pref : defaultHourCycle;
2517
- delete options.hour12;
2518
- }
2519
- let cacheKey = locale + (options ? Object.entries(options).sort((a, b)=>a[0] < b[0] ? -1 : 1).join() : "");
2520
- if ($fb18d541ea1ad717$var$formatterCache.has(cacheKey)) return $fb18d541ea1ad717$var$formatterCache.get(cacheKey);
2521
- let numberFormatter = new Intl.DateTimeFormat(locale, options);
2522
- $fb18d541ea1ad717$var$formatterCache.set(cacheKey, numberFormatter);
2523
- return numberFormatter;
2524
- }
2525
- let $fb18d541ea1ad717$var$_hasBuggyHour12Behavior = null;
2526
- function $fb18d541ea1ad717$var$hasBuggyHour12Behavior() {
2527
- if ($fb18d541ea1ad717$var$_hasBuggyHour12Behavior == null) $fb18d541ea1ad717$var$_hasBuggyHour12Behavior = new Intl.DateTimeFormat("en-US", {
2528
- hour: "numeric",
2529
- hour12: false
2530
- }).format(new Date(2020, 2, 3, 0)) === "24";
2531
- return $fb18d541ea1ad717$var$_hasBuggyHour12Behavior;
2532
- }
2533
- let $fb18d541ea1ad717$var$_hasBuggyResolvedHourCycle = null;
2534
- function $fb18d541ea1ad717$var$hasBuggyResolvedHourCycle() {
2535
- if ($fb18d541ea1ad717$var$_hasBuggyResolvedHourCycle == null) $fb18d541ea1ad717$var$_hasBuggyResolvedHourCycle = new Intl.DateTimeFormat("fr", {
2536
- hour: "numeric",
2537
- hour12: false
2538
- }).resolvedOptions().hourCycle === "h12";
2539
- return $fb18d541ea1ad717$var$_hasBuggyResolvedHourCycle;
2540
- }
2541
- function $fb18d541ea1ad717$var$getResolvedHourCycle(locale, options) {
2542
- if (!options.timeStyle && !options.hour) return undefined;
2543
- // Work around buggy results in resolved hourCycle and hour12 options in WebKit.
2544
- // Format the minimum possible hour and maximum possible hour in a day and parse the results.
2545
- locale = locale.replace(/(-u-)?-nu-[a-zA-Z0-9]+/, "");
2546
- locale += (locale.includes("-u-") ? "" : "-u") + "-nu-latn";
2547
- let formatter = $fb18d541ea1ad717$var$getCachedDateFormatter(locale, {
2548
- ...options,
2549
- timeZone: undefined // use local timezone
2550
- });
2551
- let min = parseInt(formatter.formatToParts(new Date(2020, 2, 3, 0)).find((p)=>p.type === "hour").value, 10);
2552
- let max = parseInt(formatter.formatToParts(new Date(2020, 2, 3, 23)).find((p)=>p.type === "hour").value, 10);
2553
- if (min === 0 && max === 23) return "h23";
2554
- if (min === 24 && max === 23) return "h24";
2555
- if (min === 0 && max === 11) return "h11";
2556
- if (min === 12 && max === 11) return "h12";
2557
- throw new Error("Unexpected hour cycle result");
2558
- }
2559
-
2560
41
 
2561
42
 
2562
43