react-semaphor 0.1.301 → 0.1.303

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 (66) hide show
  1. package/dist/appearance/index.cjs +1 -0
  2. package/dist/appearance/index.js +9 -0
  3. package/dist/brand-studio/index.cjs +21 -0
  4. package/dist/brand-studio/index.js +1461 -0
  5. package/dist/chunks/dashboard-controls-BCJZOzrL.js +2226 -0
  6. package/dist/chunks/dashboard-controls-CVFoOPti.js +47 -0
  7. package/dist/chunks/dashboard-filter-controls-button-C-e7230k.js +11 -0
  8. package/dist/chunks/{dashboard-filter-controls-button-DjALRkvg.js → dashboard-filter-controls-button-Cfbac4Jw.js} +205 -216
  9. package/dist/chunks/dashboard-json-BM5ywMgp.js +1 -0
  10. package/dist/chunks/{dashboard-json-D-zIG46N.js → dashboard-json-BzvLPhGM.js} +14 -12
  11. package/dist/chunks/dashboard-summary-settings-dialog-BdxKl1UF.js +1 -0
  12. package/dist/chunks/{dashboard-summary-settings-dialog-D-F1eEJI.js → dashboard-summary-settings-dialog-ChK3344r.js} +64 -63
  13. package/dist/chunks/date-formatter-D9Bvw5Qk.js +1 -0
  14. package/dist/chunks/date-formatter-DyIOb6uC.js +333 -0
  15. package/dist/chunks/{edit-dashboard-visual-BjflrL8w.js → edit-dashboard-visual-D725CWD5.js} +6690 -6679
  16. package/dist/chunks/edit-dashboard-visual-nNaZ2IK1.js +183 -0
  17. package/dist/chunks/index-BWjB_9uz.js +1356 -0
  18. package/dist/chunks/index-CJdxSyQq.js +2578 -0
  19. package/dist/chunks/{index-DDA12yqV.js → index-CYWgnME0.js} +48994 -66425
  20. package/dist/chunks/index-D7KJindZ.js +1 -0
  21. package/dist/chunks/index-DFOb_6HB.js +1657 -0
  22. package/dist/chunks/index-DRlMUglg.js +4 -0
  23. package/dist/chunks/palette-B9DJXMGo.js +11 -0
  24. package/dist/chunks/palette-DGOzbtsn.js +43 -0
  25. package/dist/chunks/{resource-management-panel-B2558XA1.js → resource-management-panel-CE0-NcLL.js} +116 -115
  26. package/dist/chunks/resource-management-panel-mJmc5dMT.js +6 -0
  27. package/dist/chunks/rotate-ccw-Bs7YJn10.js +6 -0
  28. package/dist/chunks/rotate-ccw-YsjQwpKm.js +14 -0
  29. package/dist/chunks/save-Bj1y1rug.js +6 -0
  30. package/dist/chunks/save-CUrexoNl.js +21 -0
  31. package/dist/chunks/switch-CiEX68py.js +163 -0
  32. package/dist/chunks/switch-oojO-gal.js +19730 -0
  33. package/dist/chunks/{use-create-flow-overlay-state-BUw_JtLs.js → use-create-flow-overlay-state-BHDKxe7I.js} +396 -412
  34. package/dist/chunks/use-create-flow-overlay-state-D2I2wNey.js +16 -0
  35. package/dist/chunks/{use-visual-utils-C45OxsOf.js → use-visual-utils-CjFzlR0P.js} +54 -53
  36. package/dist/chunks/use-visual-utils-DYDXMl5v.js +1 -0
  37. package/dist/dashboard/index.cjs +1 -1
  38. package/dist/dashboard/index.js +1 -1
  39. package/dist/format-utils/index.cjs +1 -1
  40. package/dist/format-utils/index.js +2 -2
  41. package/dist/index.cjs +1 -1
  42. package/dist/index.js +210 -207
  43. package/dist/style.css +1 -1
  44. package/dist/surfboard/index.cjs +1 -1
  45. package/dist/surfboard/index.js +2 -2
  46. package/dist/types/appearance.d.ts +176 -0
  47. package/dist/types/brand-studio.d.ts +245 -0
  48. package/dist/types/dashboard.d.ts +134 -0
  49. package/dist/types/main.d.ts +142 -1
  50. package/dist/types/surfboard.d.ts +134 -0
  51. package/dist/types/types.d.ts +139 -0
  52. package/package.json +13 -1
  53. package/dist/chunks/braces-Bhqo4iW1.js +0 -23
  54. package/dist/chunks/braces-BwK7fWd_.js +0 -6
  55. package/dist/chunks/dashboard-controls-BIRiWCUK.js +0 -47
  56. package/dist/chunks/dashboard-controls-DIlnYo96.js +0 -2219
  57. package/dist/chunks/dashboard-filter-controls-button-CK1-mKQh.js +0 -11
  58. package/dist/chunks/dashboard-json-DK4mQ1gS.js +0 -1
  59. package/dist/chunks/dashboard-summary-settings-dialog-DSxNqxFI.js +0 -1
  60. package/dist/chunks/date-formatter-CqXdM6JO.js +0 -1
  61. package/dist/chunks/date-formatter-vkCj9Ct-.js +0 -1982
  62. package/dist/chunks/edit-dashboard-visual-DCsrtJr_.js +0 -193
  63. package/dist/chunks/index-8GnvL1_L.js +0 -1523
  64. package/dist/chunks/resource-management-panel-CKp4_aem.js +0 -6
  65. package/dist/chunks/use-create-flow-overlay-state-CWcCdPbC.js +0 -21
  66. package/dist/chunks/use-visual-utils-DyaThRzf.js +0 -1
@@ -1,1982 +0,0 @@
1
- const Pe = {
2
- lessThanXSeconds: {
3
- one: "less than a second",
4
- other: "less than {{count}} seconds"
5
- },
6
- xSeconds: {
7
- one: "1 second",
8
- other: "{{count}} seconds"
9
- },
10
- halfAMinute: "half a minute",
11
- lessThanXMinutes: {
12
- one: "less than a minute",
13
- other: "less than {{count}} minutes"
14
- },
15
- xMinutes: {
16
- one: "1 minute",
17
- other: "{{count}} minutes"
18
- },
19
- aboutXHours: {
20
- one: "about 1 hour",
21
- other: "about {{count}} hours"
22
- },
23
- xHours: {
24
- one: "1 hour",
25
- other: "{{count}} hours"
26
- },
27
- xDays: {
28
- one: "1 day",
29
- other: "{{count}} days"
30
- },
31
- aboutXWeeks: {
32
- one: "about 1 week",
33
- other: "about {{count}} weeks"
34
- },
35
- xWeeks: {
36
- one: "1 week",
37
- other: "{{count}} weeks"
38
- },
39
- aboutXMonths: {
40
- one: "about 1 month",
41
- other: "about {{count}} months"
42
- },
43
- xMonths: {
44
- one: "1 month",
45
- other: "{{count}} months"
46
- },
47
- aboutXYears: {
48
- one: "about 1 year",
49
- other: "about {{count}} years"
50
- },
51
- xYears: {
52
- one: "1 year",
53
- other: "{{count}} years"
54
- },
55
- overXYears: {
56
- one: "over 1 year",
57
- other: "over {{count}} years"
58
- },
59
- almostXYears: {
60
- one: "almost 1 year",
61
- other: "almost {{count}} years"
62
- }
63
- }, Ie = (t, e, n) => {
64
- let r;
65
- const a = Pe[t];
66
- return typeof a == "string" ? r = a : e === 1 ? r = a.one : r = a.other.replace("{{count}}", e.toString()), n != null && n.addSuffix ? n.comparison && n.comparison > 0 ? "in " + r : r + " ago" : r;
67
- };
68
- function X(t) {
69
- return (e = {}) => {
70
- const n = e.width ? String(e.width) : t.defaultWidth;
71
- return t.formats[n] || t.formats[t.defaultWidth];
72
- };
73
- }
74
- const ke = {
75
- full: "EEEE, MMMM do, y",
76
- long: "MMMM do, y",
77
- medium: "MMM d, y",
78
- short: "MM/dd/yyyy"
79
- }, Se = {
80
- full: "h:mm:ss a zzzz",
81
- long: "h:mm:ss a z",
82
- medium: "h:mm:ss a",
83
- short: "h:mm a"
84
- }, We = {
85
- full: "{{date}} 'at' {{time}}",
86
- long: "{{date}} 'at' {{time}}",
87
- medium: "{{date}}, {{time}}",
88
- short: "{{date}}, {{time}}"
89
- }, ve = {
90
- date: X({
91
- formats: ke,
92
- defaultWidth: "full"
93
- }),
94
- time: X({
95
- formats: Se,
96
- defaultWidth: "full"
97
- }),
98
- dateTime: X({
99
- formats: We,
100
- defaultWidth: "full"
101
- })
102
- }, Ce = {
103
- lastWeek: "'last' eeee 'at' p",
104
- yesterday: "'yesterday at' p",
105
- today: "'today at' p",
106
- tomorrow: "'tomorrow at' p",
107
- nextWeek: "eeee 'at' p",
108
- other: "P"
109
- }, Ee = (t, e, n, r) => Ce[t];
110
- function k(t) {
111
- return (e, n) => {
112
- const r = n != null && n.context ? String(n.context) : "standalone";
113
- let a;
114
- if (r === "formatting" && t.formattingValues) {
115
- const c = t.defaultFormattingWidth || t.defaultWidth, u = n != null && n.width ? String(n.width) : c;
116
- a = t.formattingValues[u] || t.formattingValues[c];
117
- } else {
118
- const c = t.defaultWidth, u = n != null && n.width ? String(n.width) : t.defaultWidth;
119
- a = t.values[u] || t.values[c];
120
- }
121
- const i = t.argumentCallback ? t.argumentCallback(e) : e;
122
- return a[i];
123
- };
124
- }
125
- const $e = {
126
- narrow: ["B", "A"],
127
- abbreviated: ["BC", "AD"],
128
- wide: ["Before Christ", "Anno Domini"]
129
- }, Fe = {
130
- narrow: ["1", "2", "3", "4"],
131
- abbreviated: ["Q1", "Q2", "Q3", "Q4"],
132
- wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"]
133
- }, He = {
134
- narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
135
- abbreviated: [
136
- "Jan",
137
- "Feb",
138
- "Mar",
139
- "Apr",
140
- "May",
141
- "Jun",
142
- "Jul",
143
- "Aug",
144
- "Sep",
145
- "Oct",
146
- "Nov",
147
- "Dec"
148
- ],
149
- wide: [
150
- "January",
151
- "February",
152
- "March",
153
- "April",
154
- "May",
155
- "June",
156
- "July",
157
- "August",
158
- "September",
159
- "October",
160
- "November",
161
- "December"
162
- ]
163
- }, Le = {
164
- narrow: ["S", "M", "T", "W", "T", "F", "S"],
165
- short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
166
- abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
167
- wide: [
168
- "Sunday",
169
- "Monday",
170
- "Tuesday",
171
- "Wednesday",
172
- "Thursday",
173
- "Friday",
174
- "Saturday"
175
- ]
176
- }, _e = {
177
- narrow: {
178
- am: "a",
179
- pm: "p",
180
- midnight: "mi",
181
- noon: "n",
182
- morning: "morning",
183
- afternoon: "afternoon",
184
- evening: "evening",
185
- night: "night"
186
- },
187
- abbreviated: {
188
- am: "AM",
189
- pm: "PM",
190
- midnight: "midnight",
191
- noon: "noon",
192
- morning: "morning",
193
- afternoon: "afternoon",
194
- evening: "evening",
195
- night: "night"
196
- },
197
- wide: {
198
- am: "a.m.",
199
- pm: "p.m.",
200
- midnight: "midnight",
201
- noon: "noon",
202
- morning: "morning",
203
- afternoon: "afternoon",
204
- evening: "evening",
205
- night: "night"
206
- }
207
- }, Xe = {
208
- narrow: {
209
- am: "a",
210
- pm: "p",
211
- midnight: "mi",
212
- noon: "n",
213
- morning: "in the morning",
214
- afternoon: "in the afternoon",
215
- evening: "in the evening",
216
- night: "at night"
217
- },
218
- abbreviated: {
219
- am: "AM",
220
- pm: "PM",
221
- midnight: "midnight",
222
- noon: "noon",
223
- morning: "in the morning",
224
- afternoon: "in the afternoon",
225
- evening: "in the evening",
226
- night: "at night"
227
- },
228
- wide: {
229
- am: "a.m.",
230
- pm: "p.m.",
231
- midnight: "midnight",
232
- noon: "noon",
233
- morning: "in the morning",
234
- afternoon: "in the afternoon",
235
- evening: "in the evening",
236
- night: "at night"
237
- }
238
- }, Ue = (t, e) => {
239
- const n = Number(t), r = n % 100;
240
- if (r > 20 || r < 10)
241
- switch (r % 10) {
242
- case 1:
243
- return n + "st";
244
- case 2:
245
- return n + "nd";
246
- case 3:
247
- return n + "rd";
248
- }
249
- return n + "th";
250
- }, Ze = {
251
- ordinalNumber: Ue,
252
- era: k({
253
- values: $e,
254
- defaultWidth: "wide"
255
- }),
256
- quarter: k({
257
- values: Fe,
258
- defaultWidth: "wide",
259
- argumentCallback: (t) => t - 1
260
- }),
261
- month: k({
262
- values: He,
263
- defaultWidth: "wide"
264
- }),
265
- day: k({
266
- values: Le,
267
- defaultWidth: "wide"
268
- }),
269
- dayPeriod: k({
270
- values: _e,
271
- defaultWidth: "wide",
272
- formattingValues: Xe,
273
- defaultFormattingWidth: "wide"
274
- })
275
- };
276
- function S(t) {
277
- return (e, n = {}) => {
278
- const r = n.width, a = r && t.matchPatterns[r] || t.matchPatterns[t.defaultMatchWidth], i = e.match(a);
279
- if (!i)
280
- return null;
281
- const c = i[0], u = r && t.parsePatterns[r] || t.parsePatterns[t.defaultParseWidth], s = Array.isArray(u) ? Ae(u, (D) => D.test(c)) : (
282
- // eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type
283
- Ge(u, (D) => D.test(c))
284
- );
285
- let f;
286
- f = t.valueCallback ? t.valueCallback(s) : s, f = n.valueCallback ? (
287
- // eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type
288
- n.valueCallback(f)
289
- ) : f;
290
- const d = e.slice(c.length);
291
- return { value: f, rest: d };
292
- };
293
- }
294
- function Ge(t, e) {
295
- for (const n in t)
296
- if (Object.prototype.hasOwnProperty.call(t, n) && e(t[n]))
297
- return n;
298
- }
299
- function Ae(t, e) {
300
- for (let n = 0; n < t.length; n++)
301
- if (e(t[n]))
302
- return n;
303
- }
304
- function qe(t) {
305
- return (e, n = {}) => {
306
- const r = e.match(t.matchPattern);
307
- if (!r) return null;
308
- const a = r[0], i = e.match(t.parsePattern);
309
- if (!i) return null;
310
- let c = t.valueCallback ? t.valueCallback(i[0]) : i[0];
311
- c = n.valueCallback ? n.valueCallback(c) : c;
312
- const u = e.slice(a.length);
313
- return { value: c, rest: u };
314
- };
315
- }
316
- const Re = /^(\d+)(th|st|nd|rd)?/i, je = /\d+/i, ze = {
317
- narrow: /^(b|a)/i,
318
- abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
319
- wide: /^(before christ|before common era|anno domini|common era)/i
320
- }, Be = {
321
- any: [/^b/i, /^(a|c)/i]
322
- }, Qe = {
323
- narrow: /^[1234]/i,
324
- abbreviated: /^q[1234]/i,
325
- wide: /^[1234](th|st|nd|rd)? quarter/i
326
- }, Ve = {
327
- any: [/1/i, /2/i, /3/i, /4/i]
328
- }, Je = {
329
- narrow: /^[jfmasond]/i,
330
- abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
331
- wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
332
- }, Ke = {
333
- narrow: [
334
- /^j/i,
335
- /^f/i,
336
- /^m/i,
337
- /^a/i,
338
- /^m/i,
339
- /^j/i,
340
- /^j/i,
341
- /^a/i,
342
- /^s/i,
343
- /^o/i,
344
- /^n/i,
345
- /^d/i
346
- ],
347
- any: [
348
- /^ja/i,
349
- /^f/i,
350
- /^mar/i,
351
- /^ap/i,
352
- /^may/i,
353
- /^jun/i,
354
- /^jul/i,
355
- /^au/i,
356
- /^s/i,
357
- /^o/i,
358
- /^n/i,
359
- /^d/i
360
- ]
361
- }, pe = {
362
- narrow: /^[smtwf]/i,
363
- short: /^(su|mo|tu|we|th|fr|sa)/i,
364
- abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
365
- wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
366
- }, et = {
367
- narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
368
- any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
369
- }, tt = {
370
- narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
371
- any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
372
- }, nt = {
373
- any: {
374
- am: /^a/i,
375
- pm: /^p/i,
376
- midnight: /^mi/i,
377
- noon: /^no/i,
378
- morning: /morning/i,
379
- afternoon: /afternoon/i,
380
- evening: /evening/i,
381
- night: /night/i
382
- }
383
- }, rt = {
384
- ordinalNumber: qe({
385
- matchPattern: Re,
386
- parsePattern: je,
387
- valueCallback: (t) => parseInt(t, 10)
388
- }),
389
- era: S({
390
- matchPatterns: ze,
391
- defaultMatchWidth: "wide",
392
- parsePatterns: Be,
393
- defaultParseWidth: "any"
394
- }),
395
- quarter: S({
396
- matchPatterns: Qe,
397
- defaultMatchWidth: "wide",
398
- parsePatterns: Ve,
399
- defaultParseWidth: "any",
400
- valueCallback: (t) => t + 1
401
- }),
402
- month: S({
403
- matchPatterns: Je,
404
- defaultMatchWidth: "wide",
405
- parsePatterns: Ke,
406
- defaultParseWidth: "any"
407
- }),
408
- day: S({
409
- matchPatterns: pe,
410
- defaultMatchWidth: "wide",
411
- parsePatterns: et,
412
- defaultParseWidth: "any"
413
- }),
414
- dayPeriod: S({
415
- matchPatterns: tt,
416
- defaultMatchWidth: "any",
417
- parsePatterns: nt,
418
- defaultParseWidth: "any"
419
- })
420
- }, ge = {
421
- code: "en-US",
422
- formatDistance: Ie,
423
- formatLong: ve,
424
- formatRelative: Ee,
425
- localize: Ze,
426
- match: rt,
427
- options: {
428
- weekStartsOn: 0,
429
- firstWeekContainsDate: 1
430
- }
431
- };
432
- let at = {};
433
- function P() {
434
- return at;
435
- }
436
- const we = 6048e5, it = 864e5, On = 6e4, Nn = 36e5, v = 43200, V = 1440;
437
- function l(t) {
438
- const e = Object.prototype.toString.call(t);
439
- return t instanceof Date || typeof t == "object" && e === "[object Date]" ? new t.constructor(+t) : typeof t == "number" || e === "[object Number]" || typeof t == "string" || e === "[object String]" ? new Date(t) : /* @__PURE__ */ new Date(NaN);
440
- }
441
- function J(t) {
442
- const e = l(t);
443
- return e.setHours(0, 0, 0, 0), e;
444
- }
445
- function E(t) {
446
- const e = l(t), n = new Date(
447
- Date.UTC(
448
- e.getFullYear(),
449
- e.getMonth(),
450
- e.getDate(),
451
- e.getHours(),
452
- e.getMinutes(),
453
- e.getSeconds(),
454
- e.getMilliseconds()
455
- )
456
- );
457
- return n.setUTCFullYear(e.getFullYear()), +t - +n;
458
- }
459
- function ct(t, e) {
460
- const n = J(t), r = J(e), a = +n - E(n), i = +r - E(r);
461
- return Math.round((a - i) / it);
462
- }
463
- function T(t, e) {
464
- return t instanceof Date ? new t.constructor(e) : new Date(e);
465
- }
466
- function ut(t) {
467
- const e = l(t), n = T(t, 0);
468
- return n.setFullYear(e.getFullYear(), 0, 1), n.setHours(0, 0, 0, 0), n;
469
- }
470
- function st(t) {
471
- const e = l(t);
472
- return ct(e, ut(e)) + 1;
473
- }
474
- function W(t, e) {
475
- var u, s, f, d;
476
- const n = P(), r = (e == null ? void 0 : e.weekStartsOn) ?? ((s = (u = e == null ? void 0 : e.locale) == null ? void 0 : u.options) == null ? void 0 : s.weekStartsOn) ?? n.weekStartsOn ?? ((d = (f = n.locale) == null ? void 0 : f.options) == null ? void 0 : d.weekStartsOn) ?? 0, a = l(t), i = a.getDay(), c = (i < r ? 7 : 0) + i - r;
477
- return a.setDate(a.getDate() - c), a.setHours(0, 0, 0, 0), a;
478
- }
479
- function $(t) {
480
- return W(t, { weekStartsOn: 1 });
481
- }
482
- function De(t) {
483
- const e = l(t), n = e.getFullYear(), r = T(t, 0);
484
- r.setFullYear(n + 1, 0, 4), r.setHours(0, 0, 0, 0);
485
- const a = $(r), i = T(t, 0);
486
- i.setFullYear(n, 0, 4), i.setHours(0, 0, 0, 0);
487
- const c = $(i);
488
- return e.getTime() >= a.getTime() ? n + 1 : e.getTime() >= c.getTime() ? n : n - 1;
489
- }
490
- function ft(t) {
491
- const e = De(t), n = T(t, 0);
492
- return n.setFullYear(e, 0, 4), n.setHours(0, 0, 0, 0), $(n);
493
- }
494
- function ot(t) {
495
- const e = l(t), n = +$(e) - +ft(e);
496
- return Math.round(n / we) + 1;
497
- }
498
- function ye(t, e) {
499
- var d, D, m, y;
500
- const n = l(t), r = n.getFullYear(), a = P(), i = (e == null ? void 0 : e.firstWeekContainsDate) ?? ((D = (d = e == null ? void 0 : e.locale) == null ? void 0 : d.options) == null ? void 0 : D.firstWeekContainsDate) ?? a.firstWeekContainsDate ?? ((y = (m = a.locale) == null ? void 0 : m.options) == null ? void 0 : y.firstWeekContainsDate) ?? 1, c = T(t, 0);
501
- c.setFullYear(r + 1, 0, i), c.setHours(0, 0, 0, 0);
502
- const u = W(c, e), s = T(t, 0);
503
- s.setFullYear(r, 0, i), s.setHours(0, 0, 0, 0);
504
- const f = W(s, e);
505
- return n.getTime() >= u.getTime() ? r + 1 : n.getTime() >= f.getTime() ? r : r - 1;
506
- }
507
- function lt(t, e) {
508
- var u, s, f, d;
509
- const n = P(), r = (e == null ? void 0 : e.firstWeekContainsDate) ?? ((s = (u = e == null ? void 0 : e.locale) == null ? void 0 : u.options) == null ? void 0 : s.firstWeekContainsDate) ?? n.firstWeekContainsDate ?? ((d = (f = n.locale) == null ? void 0 : f.options) == null ? void 0 : d.firstWeekContainsDate) ?? 1, a = ye(t, e), i = T(t, 0);
510
- return i.setFullYear(a, 0, r), i.setHours(0, 0, 0, 0), W(i, e);
511
- }
512
- function dt(t, e) {
513
- const n = l(t), r = +W(n, e) - +lt(n, e);
514
- return Math.round(r / we) + 1;
515
- }
516
- function o(t, e) {
517
- const n = t < 0 ? "-" : "", r = Math.abs(t).toString().padStart(e, "0");
518
- return n + r;
519
- }
520
- const x = {
521
- // Year
522
- y(t, e) {
523
- const n = t.getFullYear(), r = n > 0 ? n : 1 - n;
524
- return o(e === "yy" ? r % 100 : r, e.length);
525
- },
526
- // Month
527
- M(t, e) {
528
- const n = t.getMonth();
529
- return e === "M" ? String(n + 1) : o(n + 1, 2);
530
- },
531
- // Day of the month
532
- d(t, e) {
533
- return o(t.getDate(), e.length);
534
- },
535
- // AM or PM
536
- a(t, e) {
537
- const n = t.getHours() / 12 >= 1 ? "pm" : "am";
538
- switch (e) {
539
- case "a":
540
- case "aa":
541
- return n.toUpperCase();
542
- case "aaa":
543
- return n;
544
- case "aaaaa":
545
- return n[0];
546
- case "aaaa":
547
- default:
548
- return n === "am" ? "a.m." : "p.m.";
549
- }
550
- },
551
- // Hour [1-12]
552
- h(t, e) {
553
- return o(t.getHours() % 12 || 12, e.length);
554
- },
555
- // Hour [0-23]
556
- H(t, e) {
557
- return o(t.getHours(), e.length);
558
- },
559
- // Minute
560
- m(t, e) {
561
- return o(t.getMinutes(), e.length);
562
- },
563
- // Second
564
- s(t, e) {
565
- return o(t.getSeconds(), e.length);
566
- },
567
- // Fraction of second
568
- S(t, e) {
569
- const n = e.length, r = t.getMilliseconds(), a = Math.trunc(
570
- r * Math.pow(10, n - 3)
571
- );
572
- return o(a, e.length);
573
- }
574
- }, b = {
575
- midnight: "midnight",
576
- noon: "noon",
577
- morning: "morning",
578
- afternoon: "afternoon",
579
- evening: "evening",
580
- night: "night"
581
- }, K = {
582
- // Era
583
- G: function(t, e, n) {
584
- const r = t.getFullYear() > 0 ? 1 : 0;
585
- switch (e) {
586
- case "G":
587
- case "GG":
588
- case "GGG":
589
- return n.era(r, { width: "abbreviated" });
590
- case "GGGGG":
591
- return n.era(r, { width: "narrow" });
592
- case "GGGG":
593
- default:
594
- return n.era(r, { width: "wide" });
595
- }
596
- },
597
- // Year
598
- y: function(t, e, n) {
599
- if (e === "yo") {
600
- const r = t.getFullYear(), a = r > 0 ? r : 1 - r;
601
- return n.ordinalNumber(a, { unit: "year" });
602
- }
603
- return x.y(t, e);
604
- },
605
- // Local week-numbering year
606
- Y: function(t, e, n, r) {
607
- const a = ye(t, r), i = a > 0 ? a : 1 - a;
608
- if (e === "YY") {
609
- const c = i % 100;
610
- return o(c, 2);
611
- }
612
- return e === "Yo" ? n.ordinalNumber(i, { unit: "year" }) : o(i, e.length);
613
- },
614
- // ISO week-numbering year
615
- R: function(t, e) {
616
- const n = De(t);
617
- return o(n, e.length);
618
- },
619
- // Extended year. This is a single number designating the year of this calendar system.
620
- // The main difference between `y` and `u` localizers are B.C. years:
621
- // | Year | `y` | `u` |
622
- // |------|-----|-----|
623
- // | AC 1 | 1 | 1 |
624
- // | BC 1 | 1 | 0 |
625
- // | BC 2 | 2 | -1 |
626
- // Also `yy` always returns the last two digits of a year,
627
- // while `uu` pads single digit years to 2 characters and returns other years unchanged.
628
- u: function(t, e) {
629
- const n = t.getFullYear();
630
- return o(n, e.length);
631
- },
632
- // Quarter
633
- Q: function(t, e, n) {
634
- const r = Math.ceil((t.getMonth() + 1) / 3);
635
- switch (e) {
636
- case "Q":
637
- return String(r);
638
- case "QQ":
639
- return o(r, 2);
640
- case "Qo":
641
- return n.ordinalNumber(r, { unit: "quarter" });
642
- case "QQQ":
643
- return n.quarter(r, {
644
- width: "abbreviated",
645
- context: "formatting"
646
- });
647
- case "QQQQQ":
648
- return n.quarter(r, {
649
- width: "narrow",
650
- context: "formatting"
651
- });
652
- case "QQQQ":
653
- default:
654
- return n.quarter(r, {
655
- width: "wide",
656
- context: "formatting"
657
- });
658
- }
659
- },
660
- // Stand-alone quarter
661
- q: function(t, e, n) {
662
- const r = Math.ceil((t.getMonth() + 1) / 3);
663
- switch (e) {
664
- case "q":
665
- return String(r);
666
- case "qq":
667
- return o(r, 2);
668
- case "qo":
669
- return n.ordinalNumber(r, { unit: "quarter" });
670
- case "qqq":
671
- return n.quarter(r, {
672
- width: "abbreviated",
673
- context: "standalone"
674
- });
675
- case "qqqqq":
676
- return n.quarter(r, {
677
- width: "narrow",
678
- context: "standalone"
679
- });
680
- case "qqqq":
681
- default:
682
- return n.quarter(r, {
683
- width: "wide",
684
- context: "standalone"
685
- });
686
- }
687
- },
688
- // Month
689
- M: function(t, e, n) {
690
- const r = t.getMonth();
691
- switch (e) {
692
- case "M":
693
- case "MM":
694
- return x.M(t, e);
695
- case "Mo":
696
- return n.ordinalNumber(r + 1, { unit: "month" });
697
- case "MMM":
698
- return n.month(r, {
699
- width: "abbreviated",
700
- context: "formatting"
701
- });
702
- case "MMMMM":
703
- return n.month(r, {
704
- width: "narrow",
705
- context: "formatting"
706
- });
707
- case "MMMM":
708
- default:
709
- return n.month(r, { width: "wide", context: "formatting" });
710
- }
711
- },
712
- // Stand-alone month
713
- L: function(t, e, n) {
714
- const r = t.getMonth();
715
- switch (e) {
716
- case "L":
717
- return String(r + 1);
718
- case "LL":
719
- return o(r + 1, 2);
720
- case "Lo":
721
- return n.ordinalNumber(r + 1, { unit: "month" });
722
- case "LLL":
723
- return n.month(r, {
724
- width: "abbreviated",
725
- context: "standalone"
726
- });
727
- case "LLLLL":
728
- return n.month(r, {
729
- width: "narrow",
730
- context: "standalone"
731
- });
732
- case "LLLL":
733
- default:
734
- return n.month(r, { width: "wide", context: "standalone" });
735
- }
736
- },
737
- // Local week of year
738
- w: function(t, e, n, r) {
739
- const a = dt(t, r);
740
- return e === "wo" ? n.ordinalNumber(a, { unit: "week" }) : o(a, e.length);
741
- },
742
- // ISO week of year
743
- I: function(t, e, n) {
744
- const r = ot(t);
745
- return e === "Io" ? n.ordinalNumber(r, { unit: "week" }) : o(r, e.length);
746
- },
747
- // Day of the month
748
- d: function(t, e, n) {
749
- return e === "do" ? n.ordinalNumber(t.getDate(), { unit: "date" }) : x.d(t, e);
750
- },
751
- // Day of year
752
- D: function(t, e, n) {
753
- const r = st(t);
754
- return e === "Do" ? n.ordinalNumber(r, { unit: "dayOfYear" }) : o(r, e.length);
755
- },
756
- // Day of week
757
- E: function(t, e, n) {
758
- const r = t.getDay();
759
- switch (e) {
760
- case "E":
761
- case "EE":
762
- case "EEE":
763
- return n.day(r, {
764
- width: "abbreviated",
765
- context: "formatting"
766
- });
767
- case "EEEEE":
768
- return n.day(r, {
769
- width: "narrow",
770
- context: "formatting"
771
- });
772
- case "EEEEEE":
773
- return n.day(r, {
774
- width: "short",
775
- context: "formatting"
776
- });
777
- case "EEEE":
778
- default:
779
- return n.day(r, {
780
- width: "wide",
781
- context: "formatting"
782
- });
783
- }
784
- },
785
- // Local day of week
786
- e: function(t, e, n, r) {
787
- const a = t.getDay(), i = (a - r.weekStartsOn + 8) % 7 || 7;
788
- switch (e) {
789
- case "e":
790
- return String(i);
791
- case "ee":
792
- return o(i, 2);
793
- case "eo":
794
- return n.ordinalNumber(i, { unit: "day" });
795
- case "eee":
796
- return n.day(a, {
797
- width: "abbreviated",
798
- context: "formatting"
799
- });
800
- case "eeeee":
801
- return n.day(a, {
802
- width: "narrow",
803
- context: "formatting"
804
- });
805
- case "eeeeee":
806
- return n.day(a, {
807
- width: "short",
808
- context: "formatting"
809
- });
810
- case "eeee":
811
- default:
812
- return n.day(a, {
813
- width: "wide",
814
- context: "formatting"
815
- });
816
- }
817
- },
818
- // Stand-alone local day of week
819
- c: function(t, e, n, r) {
820
- const a = t.getDay(), i = (a - r.weekStartsOn + 8) % 7 || 7;
821
- switch (e) {
822
- case "c":
823
- return String(i);
824
- case "cc":
825
- return o(i, e.length);
826
- case "co":
827
- return n.ordinalNumber(i, { unit: "day" });
828
- case "ccc":
829
- return n.day(a, {
830
- width: "abbreviated",
831
- context: "standalone"
832
- });
833
- case "ccccc":
834
- return n.day(a, {
835
- width: "narrow",
836
- context: "standalone"
837
- });
838
- case "cccccc":
839
- return n.day(a, {
840
- width: "short",
841
- context: "standalone"
842
- });
843
- case "cccc":
844
- default:
845
- return n.day(a, {
846
- width: "wide",
847
- context: "standalone"
848
- });
849
- }
850
- },
851
- // ISO day of week
852
- i: function(t, e, n) {
853
- const r = t.getDay(), a = r === 0 ? 7 : r;
854
- switch (e) {
855
- case "i":
856
- return String(a);
857
- case "ii":
858
- return o(a, e.length);
859
- case "io":
860
- return n.ordinalNumber(a, { unit: "day" });
861
- case "iii":
862
- return n.day(r, {
863
- width: "abbreviated",
864
- context: "formatting"
865
- });
866
- case "iiiii":
867
- return n.day(r, {
868
- width: "narrow",
869
- context: "formatting"
870
- });
871
- case "iiiiii":
872
- return n.day(r, {
873
- width: "short",
874
- context: "formatting"
875
- });
876
- case "iiii":
877
- default:
878
- return n.day(r, {
879
- width: "wide",
880
- context: "formatting"
881
- });
882
- }
883
- },
884
- // AM or PM
885
- a: function(t, e, n) {
886
- const a = t.getHours() / 12 >= 1 ? "pm" : "am";
887
- switch (e) {
888
- case "a":
889
- case "aa":
890
- return n.dayPeriod(a, {
891
- width: "abbreviated",
892
- context: "formatting"
893
- });
894
- case "aaa":
895
- return n.dayPeriod(a, {
896
- width: "abbreviated",
897
- context: "formatting"
898
- }).toLowerCase();
899
- case "aaaaa":
900
- return n.dayPeriod(a, {
901
- width: "narrow",
902
- context: "formatting"
903
- });
904
- case "aaaa":
905
- default:
906
- return n.dayPeriod(a, {
907
- width: "wide",
908
- context: "formatting"
909
- });
910
- }
911
- },
912
- // AM, PM, midnight, noon
913
- b: function(t, e, n) {
914
- const r = t.getHours();
915
- let a;
916
- switch (r === 12 ? a = b.noon : r === 0 ? a = b.midnight : a = r / 12 >= 1 ? "pm" : "am", e) {
917
- case "b":
918
- case "bb":
919
- return n.dayPeriod(a, {
920
- width: "abbreviated",
921
- context: "formatting"
922
- });
923
- case "bbb":
924
- return n.dayPeriod(a, {
925
- width: "abbreviated",
926
- context: "formatting"
927
- }).toLowerCase();
928
- case "bbbbb":
929
- return n.dayPeriod(a, {
930
- width: "narrow",
931
- context: "formatting"
932
- });
933
- case "bbbb":
934
- default:
935
- return n.dayPeriod(a, {
936
- width: "wide",
937
- context: "formatting"
938
- });
939
- }
940
- },
941
- // in the morning, in the afternoon, in the evening, at night
942
- B: function(t, e, n) {
943
- const r = t.getHours();
944
- let a;
945
- switch (r >= 17 ? a = b.evening : r >= 12 ? a = b.afternoon : r >= 4 ? a = b.morning : a = b.night, e) {
946
- case "B":
947
- case "BB":
948
- case "BBB":
949
- return n.dayPeriod(a, {
950
- width: "abbreviated",
951
- context: "formatting"
952
- });
953
- case "BBBBB":
954
- return n.dayPeriod(a, {
955
- width: "narrow",
956
- context: "formatting"
957
- });
958
- case "BBBB":
959
- default:
960
- return n.dayPeriod(a, {
961
- width: "wide",
962
- context: "formatting"
963
- });
964
- }
965
- },
966
- // Hour [1-12]
967
- h: function(t, e, n) {
968
- if (e === "ho") {
969
- let r = t.getHours() % 12;
970
- return r === 0 && (r = 12), n.ordinalNumber(r, { unit: "hour" });
971
- }
972
- return x.h(t, e);
973
- },
974
- // Hour [0-23]
975
- H: function(t, e, n) {
976
- return e === "Ho" ? n.ordinalNumber(t.getHours(), { unit: "hour" }) : x.H(t, e);
977
- },
978
- // Hour [0-11]
979
- K: function(t, e, n) {
980
- const r = t.getHours() % 12;
981
- return e === "Ko" ? n.ordinalNumber(r, { unit: "hour" }) : o(r, e.length);
982
- },
983
- // Hour [1-24]
984
- k: function(t, e, n) {
985
- let r = t.getHours();
986
- return r === 0 && (r = 24), e === "ko" ? n.ordinalNumber(r, { unit: "hour" }) : o(r, e.length);
987
- },
988
- // Minute
989
- m: function(t, e, n) {
990
- return e === "mo" ? n.ordinalNumber(t.getMinutes(), { unit: "minute" }) : x.m(t, e);
991
- },
992
- // Second
993
- s: function(t, e, n) {
994
- return e === "so" ? n.ordinalNumber(t.getSeconds(), { unit: "second" }) : x.s(t, e);
995
- },
996
- // Fraction of second
997
- S: function(t, e) {
998
- return x.S(t, e);
999
- },
1000
- // Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
1001
- X: function(t, e, n) {
1002
- const r = t.getTimezoneOffset();
1003
- if (r === 0)
1004
- return "Z";
1005
- switch (e) {
1006
- case "X":
1007
- return ee(r);
1008
- case "XXXX":
1009
- case "XX":
1010
- return O(r);
1011
- case "XXXXX":
1012
- case "XXX":
1013
- default:
1014
- return O(r, ":");
1015
- }
1016
- },
1017
- // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
1018
- x: function(t, e, n) {
1019
- const r = t.getTimezoneOffset();
1020
- switch (e) {
1021
- case "x":
1022
- return ee(r);
1023
- case "xxxx":
1024
- case "xx":
1025
- return O(r);
1026
- case "xxxxx":
1027
- case "xxx":
1028
- default:
1029
- return O(r, ":");
1030
- }
1031
- },
1032
- // Timezone (GMT)
1033
- O: function(t, e, n) {
1034
- const r = t.getTimezoneOffset();
1035
- switch (e) {
1036
- case "O":
1037
- case "OO":
1038
- case "OOO":
1039
- return "GMT" + p(r, ":");
1040
- case "OOOO":
1041
- default:
1042
- return "GMT" + O(r, ":");
1043
- }
1044
- },
1045
- // Timezone (specific non-location)
1046
- z: function(t, e, n) {
1047
- const r = t.getTimezoneOffset();
1048
- switch (e) {
1049
- case "z":
1050
- case "zz":
1051
- case "zzz":
1052
- return "GMT" + p(r, ":");
1053
- case "zzzz":
1054
- default:
1055
- return "GMT" + O(r, ":");
1056
- }
1057
- },
1058
- // Seconds timestamp
1059
- t: function(t, e, n) {
1060
- const r = Math.trunc(t.getTime() / 1e3);
1061
- return o(r, e.length);
1062
- },
1063
- // Milliseconds timestamp
1064
- T: function(t, e, n) {
1065
- const r = t.getTime();
1066
- return o(r, e.length);
1067
- }
1068
- };
1069
- function p(t, e = "") {
1070
- const n = t > 0 ? "-" : "+", r = Math.abs(t), a = Math.trunc(r / 60), i = r % 60;
1071
- return i === 0 ? n + String(a) : n + String(a) + e + o(i, 2);
1072
- }
1073
- function ee(t, e) {
1074
- return t % 60 === 0 ? (t > 0 ? "-" : "+") + o(Math.abs(t) / 60, 2) : O(t, e);
1075
- }
1076
- function O(t, e = "") {
1077
- const n = t > 0 ? "-" : "+", r = Math.abs(t), a = o(Math.trunc(r / 60), 2), i = o(r % 60, 2);
1078
- return n + a + e + i;
1079
- }
1080
- const te = (t, e) => {
1081
- switch (t) {
1082
- case "P":
1083
- return e.date({ width: "short" });
1084
- case "PP":
1085
- return e.date({ width: "medium" });
1086
- case "PPP":
1087
- return e.date({ width: "long" });
1088
- case "PPPP":
1089
- default:
1090
- return e.date({ width: "full" });
1091
- }
1092
- }, Me = (t, e) => {
1093
- switch (t) {
1094
- case "p":
1095
- return e.time({ width: "short" });
1096
- case "pp":
1097
- return e.time({ width: "medium" });
1098
- case "ppp":
1099
- return e.time({ width: "long" });
1100
- case "pppp":
1101
- default:
1102
- return e.time({ width: "full" });
1103
- }
1104
- }, mt = (t, e) => {
1105
- const n = t.match(/(P+)(p+)?/) || [], r = n[1], a = n[2];
1106
- if (!a)
1107
- return te(t, e);
1108
- let i;
1109
- switch (r) {
1110
- case "P":
1111
- i = e.dateTime({ width: "short" });
1112
- break;
1113
- case "PP":
1114
- i = e.dateTime({ width: "medium" });
1115
- break;
1116
- case "PPP":
1117
- i = e.dateTime({ width: "long" });
1118
- break;
1119
- case "PPPP":
1120
- default:
1121
- i = e.dateTime({ width: "full" });
1122
- break;
1123
- }
1124
- return i.replace("{{date}}", te(r, e)).replace("{{time}}", Me(a, e));
1125
- }, ht = {
1126
- p: Me,
1127
- P: mt
1128
- }, gt = /^D+$/, wt = /^Y+$/, Dt = ["D", "DD", "YY", "YYYY"];
1129
- function yt(t) {
1130
- return gt.test(t);
1131
- }
1132
- function Mt(t) {
1133
- return wt.test(t);
1134
- }
1135
- function xt(t, e, n) {
1136
- const r = Tt(t, e, n);
1137
- if (console.warn(r), Dt.includes(t)) throw new RangeError(r);
1138
- }
1139
- function Tt(t, e, n) {
1140
- const r = t[0] === "Y" ? "years" : "days of the month";
1141
- return `Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${e}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`;
1142
- }
1143
- function Ot(t) {
1144
- return t instanceof Date || typeof t == "object" && Object.prototype.toString.call(t) === "[object Date]";
1145
- }
1146
- function Nt(t) {
1147
- if (!Ot(t) && typeof t != "number")
1148
- return !1;
1149
- const e = l(t);
1150
- return !isNaN(Number(e));
1151
- }
1152
- const bt = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, Yt = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, Pt = /^'([^]*?)'?$/, It = /''/g, kt = /[a-zA-Z]/;
1153
- function xe(t, e, n) {
1154
- var d, D, m, y, M, N, B, Q;
1155
- const r = P(), a = (n == null ? void 0 : n.locale) ?? r.locale ?? ge, i = (n == null ? void 0 : n.firstWeekContainsDate) ?? ((D = (d = n == null ? void 0 : n.locale) == null ? void 0 : d.options) == null ? void 0 : D.firstWeekContainsDate) ?? r.firstWeekContainsDate ?? ((y = (m = r.locale) == null ? void 0 : m.options) == null ? void 0 : y.firstWeekContainsDate) ?? 1, c = (n == null ? void 0 : n.weekStartsOn) ?? ((N = (M = n == null ? void 0 : n.locale) == null ? void 0 : M.options) == null ? void 0 : N.weekStartsOn) ?? r.weekStartsOn ?? ((Q = (B = r.locale) == null ? void 0 : B.options) == null ? void 0 : Q.weekStartsOn) ?? 0, u = l(t);
1156
- if (!Nt(u))
1157
- throw new RangeError("Invalid time value");
1158
- let s = e.match(Yt).map((w) => {
1159
- const g = w[0];
1160
- if (g === "p" || g === "P") {
1161
- const _ = ht[g];
1162
- return _(w, a.formatLong);
1163
- }
1164
- return w;
1165
- }).join("").match(bt).map((w) => {
1166
- if (w === "''")
1167
- return { isToken: !1, value: "'" };
1168
- const g = w[0];
1169
- if (g === "'")
1170
- return { isToken: !1, value: St(w) };
1171
- if (K[g])
1172
- return { isToken: !0, value: w };
1173
- if (g.match(kt))
1174
- throw new RangeError(
1175
- "Format string contains an unescaped latin alphabet character `" + g + "`"
1176
- );
1177
- return { isToken: !1, value: w };
1178
- });
1179
- a.localize.preprocessor && (s = a.localize.preprocessor(u, s));
1180
- const f = {
1181
- firstWeekContainsDate: i,
1182
- weekStartsOn: c,
1183
- locale: a
1184
- };
1185
- return s.map((w) => {
1186
- if (!w.isToken) return w.value;
1187
- const g = w.value;
1188
- (!(n != null && n.useAdditionalWeekYearTokens) && Mt(g) || !(n != null && n.useAdditionalDayOfYearTokens) && yt(g)) && xt(g, e, String(t));
1189
- const _ = K[g[0]];
1190
- return _(u, g, a.localize, f);
1191
- }).join("");
1192
- }
1193
- function St(t) {
1194
- const e = t.match(Pt);
1195
- return e ? e[1].replace(It, "'") : t;
1196
- }
1197
- function C(t, e) {
1198
- const n = l(t), r = l(e), a = n.getTime() - r.getTime();
1199
- return a < 0 ? -1 : a > 0 ? 1 : a;
1200
- }
1201
- function Wt(t) {
1202
- return T(t, Date.now());
1203
- }
1204
- function vt(t, e) {
1205
- const n = l(t), r = l(e), a = n.getFullYear() - r.getFullYear(), i = n.getMonth() - r.getMonth();
1206
- return a * 12 + i;
1207
- }
1208
- function Ct(t) {
1209
- return (e) => {
1210
- const r = (t ? Math[t] : Math.trunc)(e);
1211
- return r === 0 ? 0 : r;
1212
- };
1213
- }
1214
- function Et(t, e) {
1215
- return +l(t) - +l(e);
1216
- }
1217
- function $t(t) {
1218
- const e = l(t);
1219
- return e.setHours(23, 59, 59, 999), e;
1220
- }
1221
- function Ft(t) {
1222
- const e = l(t), n = e.getMonth();
1223
- return e.setFullYear(e.getFullYear(), n + 1, 0), e.setHours(23, 59, 59, 999), e;
1224
- }
1225
- function Ht(t) {
1226
- const e = l(t);
1227
- return +$t(e) == +Ft(e);
1228
- }
1229
- function Lt(t, e) {
1230
- const n = l(t), r = l(e), a = C(n, r), i = Math.abs(
1231
- vt(n, r)
1232
- );
1233
- let c;
1234
- if (i < 1)
1235
- c = 0;
1236
- else {
1237
- n.getMonth() === 1 && n.getDate() > 27 && n.setDate(30), n.setMonth(n.getMonth() - a * i);
1238
- let u = C(n, r) === -a;
1239
- Ht(l(t)) && i === 1 && C(t, r) === 1 && (u = !1), c = a * (i - Number(u));
1240
- }
1241
- return c === 0 ? 0 : c;
1242
- }
1243
- function _t(t, e, n) {
1244
- const r = Et(t, e) / 1e3;
1245
- return Ct(n == null ? void 0 : n.roundingMethod)(r);
1246
- }
1247
- function Xt(t, e, n) {
1248
- const r = P(), a = (n == null ? void 0 : n.locale) ?? r.locale ?? ge, i = 2520, c = C(t, e);
1249
- if (isNaN(c))
1250
- throw new RangeError("Invalid time value");
1251
- const u = Object.assign({}, n, {
1252
- addSuffix: n == null ? void 0 : n.addSuffix,
1253
- comparison: c
1254
- });
1255
- let s, f;
1256
- c > 0 ? (s = l(e), f = l(t)) : (s = l(t), f = l(e));
1257
- const d = _t(f, s), D = (E(f) - E(s)) / 1e3, m = Math.round((d - D) / 60);
1258
- let y;
1259
- if (m < 2)
1260
- return n != null && n.includeSeconds ? d < 5 ? a.formatDistance("lessThanXSeconds", 5, u) : d < 10 ? a.formatDistance("lessThanXSeconds", 10, u) : d < 20 ? a.formatDistance("lessThanXSeconds", 20, u) : d < 40 ? a.formatDistance("halfAMinute", 0, u) : d < 60 ? a.formatDistance("lessThanXMinutes", 1, u) : a.formatDistance("xMinutes", 1, u) : m === 0 ? a.formatDistance("lessThanXMinutes", 1, u) : a.formatDistance("xMinutes", m, u);
1261
- if (m < 45)
1262
- return a.formatDistance("xMinutes", m, u);
1263
- if (m < 90)
1264
- return a.formatDistance("aboutXHours", 1, u);
1265
- if (m < V) {
1266
- const M = Math.round(m / 60);
1267
- return a.formatDistance("aboutXHours", M, u);
1268
- } else {
1269
- if (m < i)
1270
- return a.formatDistance("xDays", 1, u);
1271
- if (m < v) {
1272
- const M = Math.round(m / V);
1273
- return a.formatDistance("xDays", M, u);
1274
- } else if (m < v * 2)
1275
- return y = Math.round(m / v), a.formatDistance("aboutXMonths", y, u);
1276
- }
1277
- if (y = Lt(f, s), y < 12) {
1278
- const M = Math.round(m / v);
1279
- return a.formatDistance("xMonths", M, u);
1280
- } else {
1281
- const M = y % 12, N = Math.trunc(y / 12);
1282
- return M < 3 ? a.formatDistance("aboutXYears", N, u) : M < 9 ? a.formatDistance("overXYears", N, u) : a.formatDistance("almostXYears", N + 1, u);
1283
- }
1284
- }
1285
- function Ut(t, e) {
1286
- return Xt(t, Wt(t), e);
1287
- }
1288
- function Zt() {
1289
- return Object.assign({}, P());
1290
- }
1291
- function ne(t, e, n) {
1292
- const r = Zt(), a = qt(t, n.timeZone, n.locale ?? r.locale);
1293
- return "formatToParts" in a ? Gt(a, e) : At(a, e);
1294
- }
1295
- function Gt(t, e) {
1296
- const n = t.formatToParts(e);
1297
- for (let r = n.length - 1; r >= 0; --r)
1298
- if (n[r].type === "timeZoneName")
1299
- return n[r].value;
1300
- }
1301
- function At(t, e) {
1302
- const n = t.format(e).replace(/\u200E/g, ""), r = / [\w-+ ]+$/.exec(n);
1303
- return r ? r[0].substr(1) : "";
1304
- }
1305
- function qt(t, e, n) {
1306
- return new Intl.DateTimeFormat(n ? [n.code, "en-US"] : void 0, {
1307
- timeZone: e,
1308
- timeZoneName: t
1309
- });
1310
- }
1311
- function Rt(t, e) {
1312
- const n = Vt(e);
1313
- return "formatToParts" in n ? zt(n, t) : Bt(n, t);
1314
- }
1315
- const jt = {
1316
- year: 0,
1317
- month: 1,
1318
- day: 2,
1319
- hour: 3,
1320
- minute: 4,
1321
- second: 5
1322
- };
1323
- function zt(t, e) {
1324
- try {
1325
- const n = t.formatToParts(e), r = [];
1326
- for (let a = 0; a < n.length; a++) {
1327
- const i = jt[n[a].type];
1328
- i !== void 0 && (r[i] = parseInt(n[a].value, 10));
1329
- }
1330
- return r;
1331
- } catch (n) {
1332
- if (n instanceof RangeError)
1333
- return [NaN];
1334
- throw n;
1335
- }
1336
- }
1337
- function Bt(t, e) {
1338
- const n = t.format(e), r = /(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(n);
1339
- return [
1340
- parseInt(r[3], 10),
1341
- parseInt(r[1], 10),
1342
- parseInt(r[2], 10),
1343
- parseInt(r[4], 10),
1344
- parseInt(r[5], 10),
1345
- parseInt(r[6], 10)
1346
- ];
1347
- }
1348
- const U = {}, re = new Intl.DateTimeFormat("en-US", {
1349
- hourCycle: "h23",
1350
- timeZone: "America/New_York",
1351
- year: "numeric",
1352
- month: "2-digit",
1353
- day: "2-digit",
1354
- hour: "2-digit",
1355
- minute: "2-digit",
1356
- second: "2-digit"
1357
- }).format(/* @__PURE__ */ new Date("2014-06-25T04:00:00.123Z")), Qt = re === "06/25/2014, 00:00:00" || re === "‎06‎/‎25‎/‎2014‎ ‎00‎:‎00‎:‎00";
1358
- function Vt(t) {
1359
- return U[t] || (U[t] = Qt ? new Intl.DateTimeFormat("en-US", {
1360
- hourCycle: "h23",
1361
- timeZone: t,
1362
- year: "numeric",
1363
- month: "numeric",
1364
- day: "2-digit",
1365
- hour: "2-digit",
1366
- minute: "2-digit",
1367
- second: "2-digit"
1368
- }) : new Intl.DateTimeFormat("en-US", {
1369
- hour12: !1,
1370
- timeZone: t,
1371
- year: "numeric",
1372
- month: "numeric",
1373
- day: "2-digit",
1374
- hour: "2-digit",
1375
- minute: "2-digit",
1376
- second: "2-digit"
1377
- })), U[t];
1378
- }
1379
- function z(t, e, n, r, a, i, c) {
1380
- const u = /* @__PURE__ */ new Date(0);
1381
- return u.setUTCFullYear(t, e, n), u.setUTCHours(r, a, i, c), u;
1382
- }
1383
- const ae = 36e5, Jt = 6e4, Z = {
1384
- timezoneZ: /^(Z)$/,
1385
- timezoneHH: /^([+-]\d{2})$/,
1386
- timezoneHHMM: /^([+-])(\d{2}):?(\d{2})$/
1387
- };
1388
- function L(t, e, n) {
1389
- if (!t)
1390
- return 0;
1391
- let r = Z.timezoneZ.exec(t);
1392
- if (r)
1393
- return 0;
1394
- let a, i;
1395
- if (r = Z.timezoneHH.exec(t), r)
1396
- return a = parseInt(r[1], 10), ie(a) ? -(a * ae) : NaN;
1397
- if (r = Z.timezoneHHMM.exec(t), r) {
1398
- a = parseInt(r[2], 10);
1399
- const c = parseInt(r[3], 10);
1400
- return ie(a, c) ? (i = Math.abs(a) * ae + c * Jt, r[1] === "+" ? -i : i) : NaN;
1401
- }
1402
- if (en(t)) {
1403
- e = new Date(e || Date.now());
1404
- const c = n ? e : Kt(e), u = R(c, t);
1405
- return -(n ? u : pt(e, u, t));
1406
- }
1407
- return NaN;
1408
- }
1409
- function Kt(t) {
1410
- return z(t.getFullYear(), t.getMonth(), t.getDate(), t.getHours(), t.getMinutes(), t.getSeconds(), t.getMilliseconds());
1411
- }
1412
- function R(t, e) {
1413
- const n = Rt(t, e), r = z(n[0], n[1] - 1, n[2], n[3] % 24, n[4], n[5], 0).getTime();
1414
- let a = t.getTime();
1415
- const i = a % 1e3;
1416
- return a -= i >= 0 ? i : 1e3 + i, r - a;
1417
- }
1418
- function pt(t, e, n) {
1419
- let a = t.getTime() - e;
1420
- const i = R(new Date(a), n);
1421
- if (e === i)
1422
- return e;
1423
- a -= i - e;
1424
- const c = R(new Date(a), n);
1425
- return i === c ? i : Math.max(i, c);
1426
- }
1427
- function ie(t, e) {
1428
- return -23 <= t && t <= 23 && (e == null || 0 <= e && e <= 59);
1429
- }
1430
- const ce = {};
1431
- function en(t) {
1432
- if (ce[t])
1433
- return !0;
1434
- try {
1435
- return new Intl.DateTimeFormat(void 0, { timeZone: t }), ce[t] = !0, !0;
1436
- } catch {
1437
- return !1;
1438
- }
1439
- }
1440
- const tn = 60 * 1e3, nn = {
1441
- // Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
1442
- X: function(t, e, n) {
1443
- const r = G(n.timeZone, t);
1444
- if (r === 0)
1445
- return "Z";
1446
- switch (e) {
1447
- case "X":
1448
- return ue(r);
1449
- case "XXXX":
1450
- case "XX":
1451
- return Y(r);
1452
- case "XXXXX":
1453
- case "XXX":
1454
- default:
1455
- return Y(r, ":");
1456
- }
1457
- },
1458
- // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
1459
- x: function(t, e, n) {
1460
- const r = G(n.timeZone, t);
1461
- switch (e) {
1462
- case "x":
1463
- return ue(r);
1464
- case "xxxx":
1465
- case "xx":
1466
- return Y(r);
1467
- case "xxxxx":
1468
- case "xxx":
1469
- default:
1470
- return Y(r, ":");
1471
- }
1472
- },
1473
- // Timezone (GMT)
1474
- O: function(t, e, n) {
1475
- const r = G(n.timeZone, t);
1476
- switch (e) {
1477
- case "O":
1478
- case "OO":
1479
- case "OOO":
1480
- return "GMT" + rn(r, ":");
1481
- case "OOOO":
1482
- default:
1483
- return "GMT" + Y(r, ":");
1484
- }
1485
- },
1486
- // Timezone (specific non-location)
1487
- z: function(t, e, n) {
1488
- switch (e) {
1489
- case "z":
1490
- case "zz":
1491
- case "zzz":
1492
- return ne("short", t, n);
1493
- case "zzzz":
1494
- default:
1495
- return ne("long", t, n);
1496
- }
1497
- }
1498
- };
1499
- function G(t, e) {
1500
- const n = t ? L(t, e, !0) / tn : (e == null ? void 0 : e.getTimezoneOffset()) ?? 0;
1501
- if (Number.isNaN(n))
1502
- throw new RangeError("Invalid time zone specified: " + t);
1503
- return n;
1504
- }
1505
- function F(t, e) {
1506
- const n = t < 0 ? "-" : "";
1507
- let r = Math.abs(t).toString();
1508
- for (; r.length < e; )
1509
- r = "0" + r;
1510
- return n + r;
1511
- }
1512
- function Y(t, e = "") {
1513
- const n = t > 0 ? "-" : "+", r = Math.abs(t), a = F(Math.floor(r / 60), 2), i = F(Math.floor(r % 60), 2);
1514
- return n + a + e + i;
1515
- }
1516
- function ue(t, e) {
1517
- return t % 60 === 0 ? (t > 0 ? "-" : "+") + F(Math.abs(t) / 60, 2) : Y(t, e);
1518
- }
1519
- function rn(t, e = "") {
1520
- const n = t > 0 ? "-" : "+", r = Math.abs(t), a = Math.floor(r / 60), i = r % 60;
1521
- return i === 0 ? n + String(a) : n + String(a) + e + F(i, 2);
1522
- }
1523
- function se(t) {
1524
- const e = new Date(Date.UTC(t.getFullYear(), t.getMonth(), t.getDate(), t.getHours(), t.getMinutes(), t.getSeconds(), t.getMilliseconds()));
1525
- return e.setUTCFullYear(t.getFullYear()), +t - +e;
1526
- }
1527
- const Te = /(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/, A = 36e5, fe = 6e4, an = 2, h = {
1528
- dateTimePattern: /^([0-9W+-]+)(T| )(.*)/,
1529
- datePattern: /^([0-9W+-]+)(.*)/,
1530
- // year tokens
1531
- YY: /^(\d{2})$/,
1532
- YYY: [
1533
- /^([+-]\d{2})$/,
1534
- // 0 additional digits
1535
- /^([+-]\d{3})$/,
1536
- // 1 additional digit
1537
- /^([+-]\d{4})$/
1538
- // 2 additional digits
1539
- ],
1540
- YYYY: /^(\d{4})/,
1541
- YYYYY: [
1542
- /^([+-]\d{4})/,
1543
- // 0 additional digits
1544
- /^([+-]\d{5})/,
1545
- // 1 additional digit
1546
- /^([+-]\d{6})/
1547
- // 2 additional digits
1548
- ],
1549
- // date tokens
1550
- MM: /^-(\d{2})$/,
1551
- DDD: /^-?(\d{3})$/,
1552
- MMDD: /^-?(\d{2})-?(\d{2})$/,
1553
- Www: /^-?W(\d{2})$/,
1554
- WwwD: /^-?W(\d{2})-?(\d{1})$/,
1555
- HH: /^(\d{2}([.,]\d*)?)$/,
1556
- HHMM: /^(\d{2}):?(\d{2}([.,]\d*)?)$/,
1557
- HHMMSS: /^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,
1558
- // time zone tokens (to identify the presence of a tz)
1559
- timeZone: Te
1560
- };
1561
- function H(t, e = {}) {
1562
- if (arguments.length < 1)
1563
- throw new TypeError("1 argument required, but only " + arguments.length + " present");
1564
- if (t === null)
1565
- return /* @__PURE__ */ new Date(NaN);
1566
- const n = e.additionalDigits == null ? an : Number(e.additionalDigits);
1567
- if (n !== 2 && n !== 1 && n !== 0)
1568
- throw new RangeError("additionalDigits must be 0, 1 or 2");
1569
- if (t instanceof Date || typeof t == "object" && Object.prototype.toString.call(t) === "[object Date]")
1570
- return new Date(t.getTime());
1571
- if (typeof t == "number" || Object.prototype.toString.call(t) === "[object Number]")
1572
- return new Date(t);
1573
- if (Object.prototype.toString.call(t) !== "[object String]")
1574
- return /* @__PURE__ */ new Date(NaN);
1575
- const r = cn(t), { year: a, restDateString: i } = un(r.date, n), c = sn(i, a);
1576
- if (c === null || isNaN(c.getTime()))
1577
- return /* @__PURE__ */ new Date(NaN);
1578
- if (c) {
1579
- const u = c.getTime();
1580
- let s = 0, f;
1581
- if (r.time && (s = fn(r.time), s === null || isNaN(s)))
1582
- return /* @__PURE__ */ new Date(NaN);
1583
- if (r.timeZone || e.timeZone) {
1584
- if (f = L(r.timeZone || e.timeZone, new Date(u + s)), isNaN(f))
1585
- return /* @__PURE__ */ new Date(NaN);
1586
- } else
1587
- f = se(new Date(u + s)), f = se(new Date(u + s + f));
1588
- return new Date(u + s + f);
1589
- } else
1590
- return /* @__PURE__ */ new Date(NaN);
1591
- }
1592
- function cn(t) {
1593
- const e = {};
1594
- let n = h.dateTimePattern.exec(t), r;
1595
- if (n ? (e.date = n[1], r = n[3]) : (n = h.datePattern.exec(t), n ? (e.date = n[1], r = n[2]) : (e.date = null, r = t)), r) {
1596
- const a = h.timeZone.exec(r);
1597
- a ? (e.time = r.replace(a[1], ""), e.timeZone = a[1].trim()) : e.time = r;
1598
- }
1599
- return e;
1600
- }
1601
- function un(t, e) {
1602
- if (t) {
1603
- const n = h.YYY[e], r = h.YYYYY[e];
1604
- let a = h.YYYY.exec(t) || r.exec(t);
1605
- if (a) {
1606
- const i = a[1];
1607
- return {
1608
- year: parseInt(i, 10),
1609
- restDateString: t.slice(i.length)
1610
- };
1611
- }
1612
- if (a = h.YY.exec(t) || n.exec(t), a) {
1613
- const i = a[1];
1614
- return {
1615
- year: parseInt(i, 10) * 100,
1616
- restDateString: t.slice(i.length)
1617
- };
1618
- }
1619
- }
1620
- return {
1621
- year: null
1622
- };
1623
- }
1624
- function sn(t, e) {
1625
- if (e === null)
1626
- return null;
1627
- let n, r, a;
1628
- if (!t || !t.length)
1629
- return n = /* @__PURE__ */ new Date(0), n.setUTCFullYear(e), n;
1630
- let i = h.MM.exec(t);
1631
- if (i)
1632
- return n = /* @__PURE__ */ new Date(0), r = parseInt(i[1], 10) - 1, le(e, r) ? (n.setUTCFullYear(e, r), n) : /* @__PURE__ */ new Date(NaN);
1633
- if (i = h.DDD.exec(t), i) {
1634
- n = /* @__PURE__ */ new Date(0);
1635
- const c = parseInt(i[1], 10);
1636
- return dn(e, c) ? (n.setUTCFullYear(e, 0, c), n) : /* @__PURE__ */ new Date(NaN);
1637
- }
1638
- if (i = h.MMDD.exec(t), i) {
1639
- n = /* @__PURE__ */ new Date(0), r = parseInt(i[1], 10) - 1;
1640
- const c = parseInt(i[2], 10);
1641
- return le(e, r, c) ? (n.setUTCFullYear(e, r, c), n) : /* @__PURE__ */ new Date(NaN);
1642
- }
1643
- if (i = h.Www.exec(t), i)
1644
- return a = parseInt(i[1], 10) - 1, de(a) ? oe(e, a) : /* @__PURE__ */ new Date(NaN);
1645
- if (i = h.WwwD.exec(t), i) {
1646
- a = parseInt(i[1], 10) - 1;
1647
- const c = parseInt(i[2], 10) - 1;
1648
- return de(a, c) ? oe(e, a, c) : /* @__PURE__ */ new Date(NaN);
1649
- }
1650
- return null;
1651
- }
1652
- function fn(t) {
1653
- let e, n, r = h.HH.exec(t);
1654
- if (r)
1655
- return e = parseFloat(r[1].replace(",", ".")), q(e) ? e % 24 * A : NaN;
1656
- if (r = h.HHMM.exec(t), r)
1657
- return e = parseInt(r[1], 10), n = parseFloat(r[2].replace(",", ".")), q(e, n) ? e % 24 * A + n * fe : NaN;
1658
- if (r = h.HHMMSS.exec(t), r) {
1659
- e = parseInt(r[1], 10), n = parseInt(r[2], 10);
1660
- const a = parseFloat(r[3].replace(",", "."));
1661
- return q(e, n, a) ? e % 24 * A + n * fe + a * 1e3 : NaN;
1662
- }
1663
- return null;
1664
- }
1665
- function oe(t, e, n) {
1666
- e = e || 0, n = n || 0;
1667
- const r = /* @__PURE__ */ new Date(0);
1668
- r.setUTCFullYear(t, 0, 4);
1669
- const a = r.getUTCDay() || 7, i = e * 7 + n + 1 - a;
1670
- return r.setUTCDate(r.getUTCDate() + i), r;
1671
- }
1672
- const on = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], ln = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
1673
- function Oe(t) {
1674
- return t % 400 === 0 || t % 4 === 0 && t % 100 !== 0;
1675
- }
1676
- function le(t, e, n) {
1677
- if (e < 0 || e > 11)
1678
- return !1;
1679
- if (n != null) {
1680
- if (n < 1)
1681
- return !1;
1682
- const r = Oe(t);
1683
- if (r && n > ln[e] || !r && n > on[e])
1684
- return !1;
1685
- }
1686
- return !0;
1687
- }
1688
- function dn(t, e) {
1689
- if (e < 1)
1690
- return !1;
1691
- const n = Oe(t);
1692
- return !(n && e > 366 || !n && e > 365);
1693
- }
1694
- function de(t, e) {
1695
- return !(t < 0 || t > 52 || e != null && (e < 0 || e > 6));
1696
- }
1697
- function q(t, e, n) {
1698
- return !(t < 0 || t >= 25 || e != null && (e < 0 || e >= 60) || n != null && (n < 0 || n >= 60));
1699
- }
1700
- const mn = /([xXOz]+)|''|'(''|[^'])+('|$)/g;
1701
- function hn(t, e, n = {}) {
1702
- e = String(e);
1703
- const r = e.match(mn);
1704
- if (r) {
1705
- const a = H(n.originalDate || t, n);
1706
- e = r.reduce(function(i, c) {
1707
- if (c[0] === "'")
1708
- return i;
1709
- const u = i.indexOf(c), s = i[u - 1] === "'", f = i.replace(c, "'" + nn[c[0]](a, c, n) + "'");
1710
- return s ? f.substring(0, u - 1) + f.substring(u + 1) : f;
1711
- }, e);
1712
- }
1713
- return xe(t, e, n);
1714
- }
1715
- function gn(t, e, n) {
1716
- t = H(t, n);
1717
- const r = L(e, t, !0), a = new Date(t.getTime() - r), i = /* @__PURE__ */ new Date(0);
1718
- return i.setFullYear(a.getUTCFullYear(), a.getUTCMonth(), a.getUTCDate()), i.setHours(a.getUTCHours(), a.getUTCMinutes(), a.getUTCSeconds(), a.getUTCMilliseconds()), i;
1719
- }
1720
- function wn(t, e, n, r) {
1721
- return r = {
1722
- ...r,
1723
- timeZone: e,
1724
- originalDate: t
1725
- }, hn(gn(t, e, { timeZone: r.timeZone }), n, r);
1726
- }
1727
- function Dn(t, e, n) {
1728
- if (typeof t == "string" && !t.match(Te))
1729
- return H(t, { ...n, timeZone: e });
1730
- t = H(t, n);
1731
- const r = z(t.getFullYear(), t.getMonth(), t.getDate(), t.getHours(), t.getMinutes(), t.getSeconds(), t.getMilliseconds()).getTime(), a = L(e, new Date(r));
1732
- return new Date(r + a);
1733
- }
1734
- function me(t) {
1735
- if (!t) return !1;
1736
- const e = t.toLowerCase().replace("_", "-");
1737
- return e === "en-in" || e.startsWith("en-in-");
1738
- }
1739
- function he(t, e) {
1740
- const n = Math.abs(t);
1741
- return n >= 1e12 ? { divisor: 1e12, suffix: "T" } : n >= 1e9 ? { divisor: 1e9, suffix: "B" } : me(e) && n >= 1e7 ? { divisor: 1e7, suffix: "Cr" } : n >= 1e6 ? { divisor: 1e6, suffix: "M" } : me(e) && n >= 1e5 ? { divisor: 1e5, suffix: "L" } : n >= 1e3 ? { divisor: 1e3, suffix: "K" } : { divisor: 1, suffix: "" };
1742
- }
1743
- function j(t, e) {
1744
- try {
1745
- const n = I(e);
1746
- return he(t, n);
1747
- } catch {
1748
- return he(t, "en-US");
1749
- }
1750
- }
1751
- function yn(t) {
1752
- try {
1753
- return new Intl.NumberFormat(t), !0;
1754
- } catch {
1755
- return !1;
1756
- }
1757
- }
1758
- function I(t) {
1759
- return t && yn(t) ? t : "en-US";
1760
- }
1761
- function Ne(t, e) {
1762
- if (t == null || isNaN(t))
1763
- return "";
1764
- const n = I(e == null ? void 0 : e.locale);
1765
- let r = t;
1766
- if (e != null && e.multiplyBy && (r *= e.multiplyBy), e != null && e.useSuffix) {
1767
- const { divisor: i, suffix: c } = j(r, n);
1768
- r = r / i;
1769
- const u = new Intl.NumberFormat(n, {
1770
- minimumFractionDigits: (e == null ? void 0 : e.minimumFractionDigits) ?? 0,
1771
- maximumFractionDigits: (e == null ? void 0 : e.maximumFractionDigits) ?? 2,
1772
- useGrouping: (e == null ? void 0 : e.useGrouping) ?? !0
1773
- }).format(r);
1774
- return `${(e == null ? void 0 : e.prefix) ?? ""}${u}${c}${(e == null ? void 0 : e.suffix) ?? ""}`;
1775
- }
1776
- const a = new Intl.NumberFormat(n, {
1777
- minimumFractionDigits: (e == null ? void 0 : e.minimumFractionDigits) ?? 0,
1778
- maximumFractionDigits: (e == null ? void 0 : e.maximumFractionDigits) ?? 2,
1779
- useGrouping: (e == null ? void 0 : e.useGrouping) ?? !0
1780
- }).format(r);
1781
- if (e != null && e.negativeInParentheses && r < 0) {
1782
- const i = a.replace("-", "");
1783
- return `(${(e == null ? void 0 : e.prefix) ?? ""}${i}${(e == null ? void 0 : e.suffix) ?? ""})`;
1784
- }
1785
- return `${(e == null ? void 0 : e.prefix) ?? ""}${a}${(e == null ? void 0 : e.suffix) ?? ""}`;
1786
- }
1787
- function Mn(t, e) {
1788
- if (t == null || isNaN(t))
1789
- return "";
1790
- const n = I(e == null ? void 0 : e.locale), r = (e == null ? void 0 : e.currency) || "USD", a = t < 0, i = !!(e != null && e.negativeInParentheses && a), c = i ? Math.abs(t) : t;
1791
- try {
1792
- if (e != null && e.useSuffix) {
1793
- const { divisor: s, suffix: f } = j(c, n), d = c / s, m = `${new Intl.NumberFormat(n, {
1794
- style: "currency",
1795
- currency: r,
1796
- minimumFractionDigits: (e == null ? void 0 : e.minimumFractionDigits) ?? 0,
1797
- maximumFractionDigits: (e == null ? void 0 : e.maximumFractionDigits) ?? 2,
1798
- useGrouping: (e == null ? void 0 : e.useGrouping) ?? !0
1799
- }).format(d)}${f}`;
1800
- return i ? `(${m})` : m;
1801
- }
1802
- const u = new Intl.NumberFormat(n, {
1803
- style: "currency",
1804
- currency: r,
1805
- minimumFractionDigits: (e == null ? void 0 : e.minimumFractionDigits) ?? 0,
1806
- maximumFractionDigits: (e == null ? void 0 : e.maximumFractionDigits) ?? 2,
1807
- useGrouping: (e == null ? void 0 : e.useGrouping) ?? !0
1808
- }).format(c);
1809
- return i ? `(${u})` : u;
1810
- } catch {
1811
- const u = Math.abs(t), s = e != null && e.useSuffix ? j(u, n) : { divisor: 1, suffix: "" }, f = Ne(
1812
- u / s.divisor,
1813
- {
1814
- locale: n,
1815
- minimumFractionDigits: (e == null ? void 0 : e.minimumFractionDigits) ?? 0,
1816
- maximumFractionDigits: (e == null ? void 0 : e.maximumFractionDigits) ?? 2,
1817
- useGrouping: (e == null ? void 0 : e.useGrouping) ?? !0
1818
- }
1819
- ), d = `${r} ${f}${s.suffix}`;
1820
- return a ? e != null && e.negativeInParentheses ? `(${d})` : `-${d}` : d;
1821
- }
1822
- }
1823
- function xn(t, e) {
1824
- if (t == null || isNaN(t))
1825
- return "";
1826
- const n = I(e == null ? void 0 : e.locale), a = (e == null ? void 0 : e.alreadyPercent) ?? (e == null ? void 0 : e.percentValueMode) === "whole" ? t / 100 : t;
1827
- return new Intl.NumberFormat(n, {
1828
- style: "percent",
1829
- minimumFractionDigits: (e == null ? void 0 : e.minimumFractionDigits) ?? 0,
1830
- maximumFractionDigits: (e == null ? void 0 : e.maximumFractionDigits) ?? 2,
1831
- useGrouping: (e == null ? void 0 : e.useGrouping) ?? !0
1832
- }).format(a);
1833
- }
1834
- function be(t, e) {
1835
- if (t == null || isNaN(t))
1836
- return "";
1837
- const n = I(e == null ? void 0 : e.locale);
1838
- return new Intl.NumberFormat(n, {
1839
- notation: "scientific",
1840
- minimumFractionDigits: (e == null ? void 0 : e.minimumFractionDigits) ?? 0,
1841
- maximumFractionDigits: (e == null ? void 0 : e.maximumFractionDigits) ?? 2
1842
- }).format(t);
1843
- }
1844
- function bn(t, e, n = "en-US") {
1845
- if (t == null || isNaN(t))
1846
- return "";
1847
- const r = I((e == null ? void 0 : e.locale) || n), a = (e == null ? void 0 : e.style) || "decimal";
1848
- if (a === "percent") {
1849
- const c = ((e == null ? void 0 : e.percentValueMode) ?? "whole") === "whole" ? t / 100 : t;
1850
- return new Intl.NumberFormat(r, {
1851
- style: "percent",
1852
- minimumFractionDigits: (e == null ? void 0 : e.minimumFractionDigits) ?? 0,
1853
- maximumFractionDigits: (e == null ? void 0 : e.maximumFractionDigits) ?? 2,
1854
- useGrouping: (e == null ? void 0 : e.useGrouping) ?? !0
1855
- }).format(c);
1856
- }
1857
- return a === "currency" ? new Intl.NumberFormat(r, {
1858
- style: "currency",
1859
- currency: (e == null ? void 0 : e.currency) || "USD",
1860
- minimumFractionDigits: (e == null ? void 0 : e.minimumFractionDigits) ?? 0,
1861
- maximumFractionDigits: (e == null ? void 0 : e.maximumFractionDigits) ?? 2,
1862
- useGrouping: (e == null ? void 0 : e.useGrouping) ?? !0
1863
- }).format(t) : a === "scientific" ? be(t, {
1864
- locale: r,
1865
- minimumFractionDigits: (e == null ? void 0 : e.minimumFractionDigits) ?? 0,
1866
- maximumFractionDigits: (e == null ? void 0 : e.maximumFractionDigits) ?? 2
1867
- }) : new Intl.NumberFormat(r, {
1868
- minimumFractionDigits: (e == null ? void 0 : e.minimumFractionDigits) ?? 0,
1869
- maximumFractionDigits: (e == null ? void 0 : e.maximumFractionDigits) ?? 2,
1870
- useGrouping: (e == null ? void 0 : e.useGrouping) ?? !0
1871
- }).format(t);
1872
- }
1873
- function Yn(t, e, n) {
1874
- const r = {
1875
- style: e === "currency" ? "currency" : e === "percent" ? "percent" : "decimal",
1876
- locale: n == null ? void 0 : n.locale,
1877
- currency: n == null ? void 0 : n.currency,
1878
- minimumFractionDigits: n == null ? void 0 : n.decimalPlaces,
1879
- maximumFractionDigits: n == null ? void 0 : n.decimalPlaces,
1880
- useSuffix: n == null ? void 0 : n.useSuffix,
1881
- prefix: n == null ? void 0 : n.prefix,
1882
- suffix: n == null ? void 0 : n.suffix,
1883
- negativeInParentheses: n == null ? void 0 : n.negativeInParentheses,
1884
- multiplyBy: n == null ? void 0 : n.multiplyBy
1885
- };
1886
- switch (e) {
1887
- case "currency":
1888
- return Mn(t, r);
1889
- case "percent":
1890
- return xn(t, r);
1891
- case "scientific":
1892
- return be(t, r);
1893
- default:
1894
- return Ne(t, r);
1895
- }
1896
- }
1897
- function Pn(t, e) {
1898
- return t && t !== "auto" ? t : e;
1899
- }
1900
- function In(t, e = /* @__PURE__ */ new Date()) {
1901
- try {
1902
- const n = {
1903
- timeZone: t,
1904
- timeZoneName: "short"
1905
- }, a = new Intl.DateTimeFormat("en-US", n).formatToParts(e).find((i) => i.type === "timeZoneName");
1906
- return (a == null ? void 0 : a.value) || t;
1907
- } catch {
1908
- return t;
1909
- }
1910
- }
1911
- function kn(t) {
1912
- try {
1913
- const e = {
1914
- timeZone: t,
1915
- timeZoneName: "long"
1916
- }, r = new Intl.DateTimeFormat("en-US", e).formatToParts(
1917
- /* @__PURE__ */ new Date()
1918
- ).find((a) => a.type === "timeZoneName");
1919
- return (r == null ? void 0 : r.value) || t;
1920
- } catch {
1921
- return t;
1922
- }
1923
- }
1924
- function Ye(t, e = "auto") {
1925
- if (!t)
1926
- return /* @__PURE__ */ new Date(NaN);
1927
- const n = t.endsWith("Z"), r = /[+-]\d{2}:?\d{2}$/.test(t), a = /\([A-Z]{3,4}\)$/.test(t);
1928
- if (e === "auto")
1929
- return n || r || a ? new Date(t) : /* @__PURE__ */ new Date(t + "Z");
1930
- if (e === "local") {
1931
- if (n || r) {
1932
- const i = t.replace(/Z$/, "").replace(/[+-]\d{2}:?\d{2}$/, "");
1933
- return new Date(i);
1934
- }
1935
- return new Date(t);
1936
- } else return e === "UTC" ? n ? new Date(t) : r ? new Date(t) : /* @__PURE__ */ new Date(t + "Z") : n || r || a ? new Date(t) : Dn(t, e);
1937
- }
1938
- const Tn = "MM/dd/yyyy", Sn = (t, e, n, r = "auto") => {
1939
- if (!t)
1940
- return "";
1941
- try {
1942
- const a = Ye(t, r);
1943
- if (isNaN(a.getTime()))
1944
- return t;
1945
- const c = (e && e.trim() ? e : Tn).replace(/LLLL/g, "MMMM").replace(/LLL/g, "MMM");
1946
- return n && n !== "auto" ? wn(a, n, c) : xe(a, c);
1947
- } catch (a) {
1948
- return console.error("Date formatting error:", a), t;
1949
- }
1950
- }, Wn = (t, e = "auto") => {
1951
- if (!t)
1952
- return "";
1953
- try {
1954
- const n = Ye(t, e);
1955
- return isNaN(n.getTime()) ? t : Ut(n, { addSuffix: !0 });
1956
- } catch (n) {
1957
- return console.error("Relative time formatting error:", n), t;
1958
- }
1959
- };
1960
- export {
1961
- Wn as a,
1962
- Sn as b,
1963
- Ne as c,
1964
- Mn as d,
1965
- xn as e,
1966
- bn as f,
1967
- be as g,
1968
- Yn as h,
1969
- In as i,
1970
- kn as j,
1971
- Ut as k,
1972
- xe as l,
1973
- T as m,
1974
- Nn as n,
1975
- On as o,
1976
- Ye as p,
1977
- wn as q,
1978
- Pn as r,
1979
- Dn as s,
1980
- l as t,
1981
- gn as u
1982
- };