@sbb-esta/lyne-elements-experimental 0.0.0 → 0.52.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (123) hide show
  1. package/README.md +55 -0
  2. package/constants-ClrwyPF-.js +12 -0
  3. package/core/datetime/date-helper.d.ts +27 -0
  4. package/core/datetime/date-helper.d.ts.map +1 -0
  5. package/core/datetime.d.ts +2 -0
  6. package/core/datetime.d.ts.map +1 -0
  7. package/core/datetime.js +199 -0
  8. package/core/timetable/access-leg-helper.d.ts +26 -0
  9. package/core/timetable/access-leg-helper.d.ts.map +1 -0
  10. package/core/timetable/timetable-helper.d.ts +9 -0
  11. package/core/timetable/timetable-helper.d.ts.map +1 -0
  12. package/core/timetable/timetable-properties.d.ts +308 -0
  13. package/core/timetable/timetable-properties.d.ts.map +1 -0
  14. package/core/timetable.d.ts +4 -0
  15. package/core/timetable.d.ts.map +1 -0
  16. package/core/timetable.js +123 -0
  17. package/custom-elements.json +1606 -0
  18. package/development/constants-D72r1E-c.js +22 -0
  19. package/development/core/datetime/date-helper.d.ts +27 -0
  20. package/development/core/datetime/date-helper.d.ts.map +1 -0
  21. package/development/core/datetime.d.ts +2 -0
  22. package/development/core/datetime.d.ts.map +1 -0
  23. package/development/core/datetime.js +297 -0
  24. package/development/core/timetable/access-leg-helper.d.ts +26 -0
  25. package/development/core/timetable/access-leg-helper.d.ts.map +1 -0
  26. package/development/core/timetable/timetable-helper.d.ts +9 -0
  27. package/development/core/timetable/timetable-helper.d.ts.map +1 -0
  28. package/development/core/timetable/timetable-properties.d.ts +308 -0
  29. package/development/core/timetable/timetable-properties.d.ts.map +1 -0
  30. package/development/core/timetable.d.ts +4 -0
  31. package/development/core/timetable.d.ts.map +1 -0
  32. package/development/core/timetable.js +164 -0
  33. package/development/differenceInMinutes-D47vcSvy.js +21 -0
  34. package/development/format-WI2gcVKN.js +1379 -0
  35. package/development/isValid-YTpbhEHG.js +52 -0
  36. package/development/journey-summary/journey-summary.d.ts +57 -0
  37. package/development/journey-summary/journey-summary.d.ts.map +1 -0
  38. package/development/journey-summary.d.ts +2 -0
  39. package/development/journey-summary.d.ts.map +1 -0
  40. package/development/journey-summary.js +210 -0
  41. package/development/pearl-chain/pearl-chain.d.ts +41 -0
  42. package/development/pearl-chain/pearl-chain.d.ts.map +1 -0
  43. package/development/pearl-chain/pearl-chain.sample-data.d.ts +121 -0
  44. package/development/pearl-chain/pearl-chain.sample-data.d.ts.map +1 -0
  45. package/development/pearl-chain-time/pearl-chain-time.d.ts +44 -0
  46. package/development/pearl-chain-time/pearl-chain-time.d.ts.map +1 -0
  47. package/development/pearl-chain-time.d.ts +2 -0
  48. package/development/pearl-chain-time.d.ts.map +1 -0
  49. package/development/pearl-chain-time.js +209 -0
  50. package/development/pearl-chain-vertical/pearl-chain-vertical.d.ts +17 -0
  51. package/development/pearl-chain-vertical/pearl-chain-vertical.d.ts.map +1 -0
  52. package/development/pearl-chain-vertical-item/pearl-chain-vertical-item.d.ts +35 -0
  53. package/development/pearl-chain-vertical-item/pearl-chain-vertical-item.d.ts.map +1 -0
  54. package/development/pearl-chain-vertical-item.d.ts +2 -0
  55. package/development/pearl-chain-vertical-item.d.ts.map +1 -0
  56. package/development/pearl-chain-vertical-item.js +369 -0
  57. package/development/pearl-chain-vertical.d.ts +2 -0
  58. package/development/pearl-chain-vertical.d.ts.map +1 -0
  59. package/development/pearl-chain-vertical.js +59 -0
  60. package/development/pearl-chain.d.ts +2 -0
  61. package/development/pearl-chain.d.ts.map +1 -0
  62. package/development/pearl-chain.js +599 -0
  63. package/development/timetable-duration/timetable-duration.d.ts +23 -0
  64. package/development/timetable-duration/timetable-duration.d.ts.map +1 -0
  65. package/development/timetable-duration/timetable-duration.sample-data.d.ts +6 -0
  66. package/development/timetable-duration/timetable-duration.sample-data.d.ts.map +1 -0
  67. package/development/timetable-duration.d.ts +2 -0
  68. package/development/timetable-duration.d.ts.map +1 -0
  69. package/development/timetable-duration.js +107 -0
  70. package/development/timetable-row/timetable-row.d.ts +79 -0
  71. package/development/timetable-row/timetable-row.d.ts.map +1 -0
  72. package/development/timetable-row/timetable-row.sample-data.d.ts +24 -0
  73. package/development/timetable-row/timetable-row.sample-data.d.ts.map +1 -0
  74. package/development/timetable-row.d.ts +2 -0
  75. package/development/timetable-row.d.ts.map +1 -0
  76. package/development/timetable-row.js +696 -0
  77. package/differenceInMinutes-CDpgJIgL.js +19 -0
  78. package/format-CEz7IGRJ.js +1168 -0
  79. package/index.d.ts +19 -0
  80. package/index.js +17 -0
  81. package/isValid-Df_caLp4.js +40 -0
  82. package/journey-summary/journey-summary.d.ts +57 -0
  83. package/journey-summary/journey-summary.d.ts.map +1 -0
  84. package/journey-summary.d.ts +2 -0
  85. package/journey-summary.d.ts.map +1 -0
  86. package/journey-summary.js +130 -0
  87. package/package.json +79 -2
  88. package/pearl-chain/pearl-chain.d.ts +41 -0
  89. package/pearl-chain/pearl-chain.d.ts.map +1 -0
  90. package/pearl-chain/pearl-chain.sample-data.d.ts +121 -0
  91. package/pearl-chain/pearl-chain.sample-data.d.ts.map +1 -0
  92. package/pearl-chain-time/pearl-chain-time.d.ts +44 -0
  93. package/pearl-chain-time/pearl-chain-time.d.ts.map +1 -0
  94. package/pearl-chain-time.d.ts +2 -0
  95. package/pearl-chain-time.d.ts.map +1 -0
  96. package/pearl-chain-time.js +90 -0
  97. package/pearl-chain-vertical/pearl-chain-vertical.d.ts +17 -0
  98. package/pearl-chain-vertical/pearl-chain-vertical.d.ts.map +1 -0
  99. package/pearl-chain-vertical-item/pearl-chain-vertical-item.d.ts +35 -0
  100. package/pearl-chain-vertical-item/pearl-chain-vertical-item.d.ts.map +1 -0
  101. package/pearl-chain-vertical-item.d.ts +2 -0
  102. package/pearl-chain-vertical-item.d.ts.map +1 -0
  103. package/pearl-chain-vertical-item.js +48 -0
  104. package/pearl-chain-vertical.d.ts +2 -0
  105. package/pearl-chain-vertical.d.ts.map +1 -0
  106. package/pearl-chain-vertical.js +24 -0
  107. package/pearl-chain.d.ts +2 -0
  108. package/pearl-chain.d.ts.map +1 -0
  109. package/pearl-chain.js +148 -0
  110. package/timetable-duration/timetable-duration.d.ts +23 -0
  111. package/timetable-duration/timetable-duration.d.ts.map +1 -0
  112. package/timetable-duration/timetable-duration.sample-data.d.ts +6 -0
  113. package/timetable-duration/timetable-duration.sample-data.d.ts.map +1 -0
  114. package/timetable-duration.d.ts +2 -0
  115. package/timetable-duration.d.ts.map +1 -0
  116. package/timetable-duration.js +37 -0
  117. package/timetable-row/timetable-row.d.ts +79 -0
  118. package/timetable-row/timetable-row.d.ts.map +1 -0
  119. package/timetable-row/timetable-row.sample-data.d.ts +24 -0
  120. package/timetable-row/timetable-row.sample-data.d.ts.map +1 -0
  121. package/timetable-row.d.ts +2 -0
  122. package/timetable-row.d.ts.map +1 -0
  123. package/timetable-row.js +392 -0
@@ -0,0 +1,1168 @@
1
+ import { c as b, d as Q, i as X } from "./isValid-Df_caLp4.js";
2
+ import { t as w, m as q } from "./constants-ClrwyPF-.js";
3
+ let L = {};
4
+ function p() {
5
+ return L;
6
+ }
7
+ function x(t, e) {
8
+ var u, c, d, f;
9
+ const n = p(), r = (e == null ? void 0 : e.weekStartsOn) ?? ((c = (u = e == null ? void 0 : e.locale) == null ? void 0 : u.options) == null ? void 0 : c.weekStartsOn) ?? n.weekStartsOn ?? ((f = (d = n.locale) == null ? void 0 : d.options) == null ? void 0 : f.weekStartsOn) ?? 0, a = w(t), i = a.getDay(), s = (i < r ? 7 : 0) + i - r;
10
+ return a.setDate(a.getDate() - s), a.setHours(0, 0, 0, 0), a;
11
+ }
12
+ function W(t) {
13
+ return x(t, { weekStartsOn: 1 });
14
+ }
15
+ function C(t) {
16
+ const e = w(t), n = e.getFullYear(), r = b(t, 0);
17
+ r.setFullYear(n + 1, 0, 4), r.setHours(0, 0, 0, 0);
18
+ const a = W(r), i = b(t, 0);
19
+ i.setFullYear(n, 0, 4), i.setHours(0, 0, 0, 0);
20
+ const s = W(i);
21
+ return e.getTime() >= a.getTime() ? n + 1 : e.getTime() >= s.getTime() ? n : n - 1;
22
+ }
23
+ function G(t) {
24
+ const e = C(t), n = b(t, 0);
25
+ return n.setFullYear(e, 0, 4), n.setHours(0, 0, 0, 0), W(n);
26
+ }
27
+ function _(t) {
28
+ const e = w(t), n = b(t, 0);
29
+ return n.setFullYear(e.getFullYear(), 0, 1), n.setHours(0, 0, 0, 0), n;
30
+ }
31
+ const B = {
32
+ lessThanXSeconds: {
33
+ one: "less than a second",
34
+ other: "less than {{count}} seconds"
35
+ },
36
+ xSeconds: {
37
+ one: "1 second",
38
+ other: "{{count}} seconds"
39
+ },
40
+ halfAMinute: "half a minute",
41
+ lessThanXMinutes: {
42
+ one: "less than a minute",
43
+ other: "less than {{count}} minutes"
44
+ },
45
+ xMinutes: {
46
+ one: "1 minute",
47
+ other: "{{count}} minutes"
48
+ },
49
+ aboutXHours: {
50
+ one: "about 1 hour",
51
+ other: "about {{count}} hours"
52
+ },
53
+ xHours: {
54
+ one: "1 hour",
55
+ other: "{{count}} hours"
56
+ },
57
+ xDays: {
58
+ one: "1 day",
59
+ other: "{{count}} days"
60
+ },
61
+ aboutXWeeks: {
62
+ one: "about 1 week",
63
+ other: "about {{count}} weeks"
64
+ },
65
+ xWeeks: {
66
+ one: "1 week",
67
+ other: "{{count}} weeks"
68
+ },
69
+ aboutXMonths: {
70
+ one: "about 1 month",
71
+ other: "about {{count}} months"
72
+ },
73
+ xMonths: {
74
+ one: "1 month",
75
+ other: "{{count}} months"
76
+ },
77
+ aboutXYears: {
78
+ one: "about 1 year",
79
+ other: "about {{count}} years"
80
+ },
81
+ xYears: {
82
+ one: "1 year",
83
+ other: "{{count}} years"
84
+ },
85
+ overXYears: {
86
+ one: "over 1 year",
87
+ other: "over {{count}} years"
88
+ },
89
+ almostXYears: {
90
+ one: "almost 1 year",
91
+ other: "almost {{count}} years"
92
+ }
93
+ }, R = (t, e, n) => {
94
+ let r;
95
+ const a = B[t];
96
+ 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;
97
+ };
98
+ function Y(t) {
99
+ return (e = {}) => {
100
+ const n = e.width ? String(e.width) : t.defaultWidth;
101
+ return t.formats[n] || t.formats[t.defaultWidth];
102
+ };
103
+ }
104
+ const A = {
105
+ full: "EEEE, MMMM do, y",
106
+ long: "MMMM do, y",
107
+ medium: "MMM d, y",
108
+ short: "MM/dd/yyyy"
109
+ }, V = {
110
+ full: "h:mm:ss a zzzz",
111
+ long: "h:mm:ss a z",
112
+ medium: "h:mm:ss a",
113
+ short: "h:mm a"
114
+ }, j = {
115
+ full: "{{date}} 'at' {{time}}",
116
+ long: "{{date}} 'at' {{time}}",
117
+ medium: "{{date}}, {{time}}",
118
+ short: "{{date}}, {{time}}"
119
+ }, I = {
120
+ date: Y({
121
+ formats: A,
122
+ defaultWidth: "full"
123
+ }),
124
+ time: Y({
125
+ formats: V,
126
+ defaultWidth: "full"
127
+ }),
128
+ dateTime: Y({
129
+ formats: j,
130
+ defaultWidth: "full"
131
+ })
132
+ }, J = {
133
+ lastWeek: "'last' eeee 'at' p",
134
+ yesterday: "'yesterday at' p",
135
+ today: "'today at' p",
136
+ tomorrow: "'tomorrow at' p",
137
+ nextWeek: "eeee 'at' p",
138
+ other: "P"
139
+ }, $ = (t, e, n, r) => J[t];
140
+ function v(t) {
141
+ return (e, n) => {
142
+ const r = n != null && n.context ? String(n.context) : "standalone";
143
+ let a;
144
+ if (r === "formatting" && t.formattingValues) {
145
+ const s = t.defaultFormattingWidth || t.defaultWidth, u = n != null && n.width ? String(n.width) : s;
146
+ a = t.formattingValues[u] || t.formattingValues[s];
147
+ } else {
148
+ const s = t.defaultWidth, u = n != null && n.width ? String(n.width) : t.defaultWidth;
149
+ a = t.values[u] || t.values[s];
150
+ }
151
+ const i = t.argumentCallback ? t.argumentCallback(e) : e;
152
+ return a[i];
153
+ };
154
+ }
155
+ const K = {
156
+ narrow: ["B", "A"],
157
+ abbreviated: ["BC", "AD"],
158
+ wide: ["Before Christ", "Anno Domini"]
159
+ }, U = {
160
+ narrow: ["1", "2", "3", "4"],
161
+ abbreviated: ["Q1", "Q2", "Q3", "Q4"],
162
+ wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"]
163
+ }, z = {
164
+ narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
165
+ abbreviated: [
166
+ "Jan",
167
+ "Feb",
168
+ "Mar",
169
+ "Apr",
170
+ "May",
171
+ "Jun",
172
+ "Jul",
173
+ "Aug",
174
+ "Sep",
175
+ "Oct",
176
+ "Nov",
177
+ "Dec"
178
+ ],
179
+ wide: [
180
+ "January",
181
+ "February",
182
+ "March",
183
+ "April",
184
+ "May",
185
+ "June",
186
+ "July",
187
+ "August",
188
+ "September",
189
+ "October",
190
+ "November",
191
+ "December"
192
+ ]
193
+ }, Z = {
194
+ narrow: ["S", "M", "T", "W", "T", "F", "S"],
195
+ short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
196
+ abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
197
+ wide: [
198
+ "Sunday",
199
+ "Monday",
200
+ "Tuesday",
201
+ "Wednesday",
202
+ "Thursday",
203
+ "Friday",
204
+ "Saturday"
205
+ ]
206
+ }, tt = {
207
+ narrow: {
208
+ am: "a",
209
+ pm: "p",
210
+ midnight: "mi",
211
+ noon: "n",
212
+ morning: "morning",
213
+ afternoon: "afternoon",
214
+ evening: "evening",
215
+ night: "night"
216
+ },
217
+ abbreviated: {
218
+ am: "AM",
219
+ pm: "PM",
220
+ midnight: "midnight",
221
+ noon: "noon",
222
+ morning: "morning",
223
+ afternoon: "afternoon",
224
+ evening: "evening",
225
+ night: "night"
226
+ },
227
+ wide: {
228
+ am: "a.m.",
229
+ pm: "p.m.",
230
+ midnight: "midnight",
231
+ noon: "noon",
232
+ morning: "morning",
233
+ afternoon: "afternoon",
234
+ evening: "evening",
235
+ night: "night"
236
+ }
237
+ }, et = {
238
+ narrow: {
239
+ am: "a",
240
+ pm: "p",
241
+ midnight: "mi",
242
+ noon: "n",
243
+ morning: "in the morning",
244
+ afternoon: "in the afternoon",
245
+ evening: "in the evening",
246
+ night: "at night"
247
+ },
248
+ abbreviated: {
249
+ am: "AM",
250
+ pm: "PM",
251
+ midnight: "midnight",
252
+ noon: "noon",
253
+ morning: "in the morning",
254
+ afternoon: "in the afternoon",
255
+ evening: "in the evening",
256
+ night: "at night"
257
+ },
258
+ wide: {
259
+ am: "a.m.",
260
+ pm: "p.m.",
261
+ midnight: "midnight",
262
+ noon: "noon",
263
+ morning: "in the morning",
264
+ afternoon: "in the afternoon",
265
+ evening: "in the evening",
266
+ night: "at night"
267
+ }
268
+ }, nt = (t, e) => {
269
+ const n = Number(t), r = n % 100;
270
+ if (r > 20 || r < 10)
271
+ switch (r % 10) {
272
+ case 1:
273
+ return n + "st";
274
+ case 2:
275
+ return n + "nd";
276
+ case 3:
277
+ return n + "rd";
278
+ }
279
+ return n + "th";
280
+ }, rt = {
281
+ ordinalNumber: nt,
282
+ era: v({
283
+ values: K,
284
+ defaultWidth: "wide"
285
+ }),
286
+ quarter: v({
287
+ values: U,
288
+ defaultWidth: "wide",
289
+ argumentCallback: (t) => t - 1
290
+ }),
291
+ month: v({
292
+ values: z,
293
+ defaultWidth: "wide"
294
+ }),
295
+ day: v({
296
+ values: Z,
297
+ defaultWidth: "wide"
298
+ }),
299
+ dayPeriod: v({
300
+ values: tt,
301
+ defaultWidth: "wide",
302
+ formattingValues: et,
303
+ defaultFormattingWidth: "wide"
304
+ })
305
+ };
306
+ function k(t) {
307
+ return (e, n = {}) => {
308
+ const r = n.width, a = r && t.matchPatterns[r] || t.matchPatterns[t.defaultMatchWidth], i = e.match(a);
309
+ if (!i)
310
+ return null;
311
+ const s = i[0], u = r && t.parsePatterns[r] || t.parsePatterns[t.defaultParseWidth], c = Array.isArray(u) ? it(u, (l) => l.test(s)) : (
312
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type
313
+ at(u, (l) => l.test(s))
314
+ );
315
+ let d;
316
+ d = t.valueCallback ? t.valueCallback(c) : c, d = n.valueCallback ? (
317
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type
318
+ n.valueCallback(d)
319
+ ) : d;
320
+ const f = e.slice(s.length);
321
+ return { value: d, rest: f };
322
+ };
323
+ }
324
+ function at(t, e) {
325
+ for (const n in t)
326
+ if (Object.prototype.hasOwnProperty.call(t, n) && e(t[n]))
327
+ return n;
328
+ }
329
+ function it(t, e) {
330
+ for (let n = 0; n < t.length; n++)
331
+ if (e(t[n]))
332
+ return n;
333
+ }
334
+ function ot(t) {
335
+ return (e, n = {}) => {
336
+ const r = e.match(t.matchPattern);
337
+ if (!r)
338
+ return null;
339
+ const a = r[0], i = e.match(t.parsePattern);
340
+ if (!i)
341
+ return null;
342
+ let s = t.valueCallback ? t.valueCallback(i[0]) : i[0];
343
+ s = n.valueCallback ? n.valueCallback(s) : s;
344
+ const u = e.slice(a.length);
345
+ return { value: s, rest: u };
346
+ };
347
+ }
348
+ const st = /^(\d+)(th|st|nd|rd)?/i, ut = /\d+/i, ct = {
349
+ narrow: /^(b|a)/i,
350
+ abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
351
+ wide: /^(before christ|before common era|anno domini|common era)/i
352
+ }, dt = {
353
+ any: [/^b/i, /^(a|c)/i]
354
+ }, ht = {
355
+ narrow: /^[1234]/i,
356
+ abbreviated: /^q[1234]/i,
357
+ wide: /^[1234](th|st|nd|rd)? quarter/i
358
+ }, ft = {
359
+ any: [/1/i, /2/i, /3/i, /4/i]
360
+ }, mt = {
361
+ narrow: /^[jfmasond]/i,
362
+ abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
363
+ wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
364
+ }, lt = {
365
+ narrow: [
366
+ /^j/i,
367
+ /^f/i,
368
+ /^m/i,
369
+ /^a/i,
370
+ /^m/i,
371
+ /^j/i,
372
+ /^j/i,
373
+ /^a/i,
374
+ /^s/i,
375
+ /^o/i,
376
+ /^n/i,
377
+ /^d/i
378
+ ],
379
+ any: [
380
+ /^ja/i,
381
+ /^f/i,
382
+ /^mar/i,
383
+ /^ap/i,
384
+ /^may/i,
385
+ /^jun/i,
386
+ /^jul/i,
387
+ /^au/i,
388
+ /^s/i,
389
+ /^o/i,
390
+ /^n/i,
391
+ /^d/i
392
+ ]
393
+ }, gt = {
394
+ narrow: /^[smtwf]/i,
395
+ short: /^(su|mo|tu|we|th|fr|sa)/i,
396
+ abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
397
+ wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
398
+ }, wt = {
399
+ narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
400
+ any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
401
+ }, yt = {
402
+ narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
403
+ any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
404
+ }, bt = {
405
+ any: {
406
+ am: /^a/i,
407
+ pm: /^p/i,
408
+ midnight: /^mi/i,
409
+ noon: /^no/i,
410
+ morning: /morning/i,
411
+ afternoon: /afternoon/i,
412
+ evening: /evening/i,
413
+ night: /night/i
414
+ }
415
+ }, Pt = {
416
+ ordinalNumber: ot({
417
+ matchPattern: st,
418
+ parsePattern: ut,
419
+ valueCallback: (t) => parseInt(t, 10)
420
+ }),
421
+ era: k({
422
+ matchPatterns: ct,
423
+ defaultMatchWidth: "wide",
424
+ parsePatterns: dt,
425
+ defaultParseWidth: "any"
426
+ }),
427
+ quarter: k({
428
+ matchPatterns: ht,
429
+ defaultMatchWidth: "wide",
430
+ parsePatterns: ft,
431
+ defaultParseWidth: "any",
432
+ valueCallback: (t) => t + 1
433
+ }),
434
+ month: k({
435
+ matchPatterns: mt,
436
+ defaultMatchWidth: "wide",
437
+ parsePatterns: lt,
438
+ defaultParseWidth: "any"
439
+ }),
440
+ day: k({
441
+ matchPatterns: gt,
442
+ defaultMatchWidth: "wide",
443
+ parsePatterns: wt,
444
+ defaultParseWidth: "any"
445
+ }),
446
+ dayPeriod: k({
447
+ matchPatterns: yt,
448
+ defaultMatchWidth: "any",
449
+ parsePatterns: bt,
450
+ defaultParseWidth: "any"
451
+ })
452
+ }, Mt = {
453
+ code: "en-US",
454
+ formatDistance: R,
455
+ formatLong: I,
456
+ formatRelative: $,
457
+ localize: rt,
458
+ match: Pt,
459
+ options: {
460
+ weekStartsOn: 0,
461
+ firstWeekContainsDate: 1
462
+ }
463
+ };
464
+ function Ot(t) {
465
+ const e = w(t);
466
+ return Q(e, _(e)) + 1;
467
+ }
468
+ function vt(t) {
469
+ const e = w(t), n = +W(e) - +G(e);
470
+ return Math.round(n / q) + 1;
471
+ }
472
+ function N(t, e) {
473
+ var f, l, M, O;
474
+ const n = w(t), r = n.getFullYear(), a = p(), i = (e == null ? void 0 : e.firstWeekContainsDate) ?? ((l = (f = e == null ? void 0 : e.locale) == null ? void 0 : f.options) == null ? void 0 : l.firstWeekContainsDate) ?? a.firstWeekContainsDate ?? ((O = (M = a.locale) == null ? void 0 : M.options) == null ? void 0 : O.firstWeekContainsDate) ?? 1, s = b(t, 0);
475
+ s.setFullYear(r + 1, 0, i), s.setHours(0, 0, 0, 0);
476
+ const u = x(s, e), c = b(t, 0);
477
+ c.setFullYear(r, 0, i), c.setHours(0, 0, 0, 0);
478
+ const d = x(c, e);
479
+ return n.getTime() >= u.getTime() ? r + 1 : n.getTime() >= d.getTime() ? r : r - 1;
480
+ }
481
+ function kt(t, e) {
482
+ var u, c, d, f;
483
+ const n = p(), r = (e == null ? void 0 : e.firstWeekContainsDate) ?? ((c = (u = e == null ? void 0 : e.locale) == null ? void 0 : u.options) == null ? void 0 : c.firstWeekContainsDate) ?? n.firstWeekContainsDate ?? ((f = (d = n.locale) == null ? void 0 : d.options) == null ? void 0 : f.firstWeekContainsDate) ?? 1, a = N(t, e), i = b(t, 0);
484
+ return i.setFullYear(a, 0, r), i.setHours(0, 0, 0, 0), x(i, e);
485
+ }
486
+ function xt(t, e) {
487
+ const n = w(t), r = +x(n, e) - +kt(n, e);
488
+ return Math.round(r / q) + 1;
489
+ }
490
+ function o(t, e) {
491
+ const n = t < 0 ? "-" : "", r = Math.abs(t).toString().padStart(e, "0");
492
+ return n + r;
493
+ }
494
+ const g = {
495
+ // Year
496
+ y(t, e) {
497
+ const n = t.getFullYear(), r = n > 0 ? n : 1 - n;
498
+ return o(e === "yy" ? r % 100 : r, e.length);
499
+ },
500
+ // Month
501
+ M(t, e) {
502
+ const n = t.getMonth();
503
+ return e === "M" ? String(n + 1) : o(n + 1, 2);
504
+ },
505
+ // Day of the month
506
+ d(t, e) {
507
+ return o(t.getDate(), e.length);
508
+ },
509
+ // AM or PM
510
+ a(t, e) {
511
+ const n = t.getHours() / 12 >= 1 ? "pm" : "am";
512
+ switch (e) {
513
+ case "a":
514
+ case "aa":
515
+ return n.toUpperCase();
516
+ case "aaa":
517
+ return n;
518
+ case "aaaaa":
519
+ return n[0];
520
+ case "aaaa":
521
+ default:
522
+ return n === "am" ? "a.m." : "p.m.";
523
+ }
524
+ },
525
+ // Hour [1-12]
526
+ h(t, e) {
527
+ return o(t.getHours() % 12 || 12, e.length);
528
+ },
529
+ // Hour [0-23]
530
+ H(t, e) {
531
+ return o(t.getHours(), e.length);
532
+ },
533
+ // Minute
534
+ m(t, e) {
535
+ return o(t.getMinutes(), e.length);
536
+ },
537
+ // Second
538
+ s(t, e) {
539
+ return o(t.getSeconds(), e.length);
540
+ },
541
+ // Fraction of second
542
+ S(t, e) {
543
+ const n = e.length, r = t.getMilliseconds(), a = Math.trunc(
544
+ r * Math.pow(10, n - 3)
545
+ );
546
+ return o(a, e.length);
547
+ }
548
+ }, P = {
549
+ am: "am",
550
+ pm: "pm",
551
+ midnight: "midnight",
552
+ noon: "noon",
553
+ morning: "morning",
554
+ afternoon: "afternoon",
555
+ evening: "evening",
556
+ night: "night"
557
+ }, T = {
558
+ // Era
559
+ G: function(t, e, n) {
560
+ const r = t.getFullYear() > 0 ? 1 : 0;
561
+ switch (e) {
562
+ case "G":
563
+ case "GG":
564
+ case "GGG":
565
+ return n.era(r, { width: "abbreviated" });
566
+ case "GGGGG":
567
+ return n.era(r, { width: "narrow" });
568
+ case "GGGG":
569
+ default:
570
+ return n.era(r, { width: "wide" });
571
+ }
572
+ },
573
+ // Year
574
+ y: function(t, e, n) {
575
+ if (e === "yo") {
576
+ const r = t.getFullYear(), a = r > 0 ? r : 1 - r;
577
+ return n.ordinalNumber(a, { unit: "year" });
578
+ }
579
+ return g.y(t, e);
580
+ },
581
+ // Local week-numbering year
582
+ Y: function(t, e, n, r) {
583
+ const a = N(t, r), i = a > 0 ? a : 1 - a;
584
+ if (e === "YY") {
585
+ const s = i % 100;
586
+ return o(s, 2);
587
+ }
588
+ return e === "Yo" ? n.ordinalNumber(i, { unit: "year" }) : o(i, e.length);
589
+ },
590
+ // ISO week-numbering year
591
+ R: function(t, e) {
592
+ const n = C(t);
593
+ return o(n, e.length);
594
+ },
595
+ // Extended year. This is a single number designating the year of this calendar system.
596
+ // The main difference between `y` and `u` localizers are B.C. years:
597
+ // | Year | `y` | `u` |
598
+ // |------|-----|-----|
599
+ // | AC 1 | 1 | 1 |
600
+ // | BC 1 | 1 | 0 |
601
+ // | BC 2 | 2 | -1 |
602
+ // Also `yy` always returns the last two digits of a year,
603
+ // while `uu` pads single digit years to 2 characters and returns other years unchanged.
604
+ u: function(t, e) {
605
+ const n = t.getFullYear();
606
+ return o(n, e.length);
607
+ },
608
+ // Quarter
609
+ Q: function(t, e, n) {
610
+ const r = Math.ceil((t.getMonth() + 1) / 3);
611
+ switch (e) {
612
+ case "Q":
613
+ return String(r);
614
+ case "QQ":
615
+ return o(r, 2);
616
+ case "Qo":
617
+ return n.ordinalNumber(r, { unit: "quarter" });
618
+ case "QQQ":
619
+ return n.quarter(r, {
620
+ width: "abbreviated",
621
+ context: "formatting"
622
+ });
623
+ case "QQQQQ":
624
+ return n.quarter(r, {
625
+ width: "narrow",
626
+ context: "formatting"
627
+ });
628
+ case "QQQQ":
629
+ default:
630
+ return n.quarter(r, {
631
+ width: "wide",
632
+ context: "formatting"
633
+ });
634
+ }
635
+ },
636
+ // Stand-alone quarter
637
+ q: function(t, e, n) {
638
+ const r = Math.ceil((t.getMonth() + 1) / 3);
639
+ switch (e) {
640
+ case "q":
641
+ return String(r);
642
+ case "qq":
643
+ return o(r, 2);
644
+ case "qo":
645
+ return n.ordinalNumber(r, { unit: "quarter" });
646
+ case "qqq":
647
+ return n.quarter(r, {
648
+ width: "abbreviated",
649
+ context: "standalone"
650
+ });
651
+ case "qqqqq":
652
+ return n.quarter(r, {
653
+ width: "narrow",
654
+ context: "standalone"
655
+ });
656
+ case "qqqq":
657
+ default:
658
+ return n.quarter(r, {
659
+ width: "wide",
660
+ context: "standalone"
661
+ });
662
+ }
663
+ },
664
+ // Month
665
+ M: function(t, e, n) {
666
+ const r = t.getMonth();
667
+ switch (e) {
668
+ case "M":
669
+ case "MM":
670
+ return g.M(t, e);
671
+ case "Mo":
672
+ return n.ordinalNumber(r + 1, { unit: "month" });
673
+ case "MMM":
674
+ return n.month(r, {
675
+ width: "abbreviated",
676
+ context: "formatting"
677
+ });
678
+ case "MMMMM":
679
+ return n.month(r, {
680
+ width: "narrow",
681
+ context: "formatting"
682
+ });
683
+ case "MMMM":
684
+ default:
685
+ return n.month(r, { width: "wide", context: "formatting" });
686
+ }
687
+ },
688
+ // Stand-alone month
689
+ L: function(t, e, n) {
690
+ const r = t.getMonth();
691
+ switch (e) {
692
+ case "L":
693
+ return String(r + 1);
694
+ case "LL":
695
+ return o(r + 1, 2);
696
+ case "Lo":
697
+ return n.ordinalNumber(r + 1, { unit: "month" });
698
+ case "LLL":
699
+ return n.month(r, {
700
+ width: "abbreviated",
701
+ context: "standalone"
702
+ });
703
+ case "LLLLL":
704
+ return n.month(r, {
705
+ width: "narrow",
706
+ context: "standalone"
707
+ });
708
+ case "LLLL":
709
+ default:
710
+ return n.month(r, { width: "wide", context: "standalone" });
711
+ }
712
+ },
713
+ // Local week of year
714
+ w: function(t, e, n, r) {
715
+ const a = xt(t, r);
716
+ return e === "wo" ? n.ordinalNumber(a, { unit: "week" }) : o(a, e.length);
717
+ },
718
+ // ISO week of year
719
+ I: function(t, e, n) {
720
+ const r = vt(t);
721
+ return e === "Io" ? n.ordinalNumber(r, { unit: "week" }) : o(r, e.length);
722
+ },
723
+ // Day of the month
724
+ d: function(t, e, n) {
725
+ return e === "do" ? n.ordinalNumber(t.getDate(), { unit: "date" }) : g.d(t, e);
726
+ },
727
+ // Day of year
728
+ D: function(t, e, n) {
729
+ const r = Ot(t);
730
+ return e === "Do" ? n.ordinalNumber(r, { unit: "dayOfYear" }) : o(r, e.length);
731
+ },
732
+ // Day of week
733
+ E: function(t, e, n) {
734
+ const r = t.getDay();
735
+ switch (e) {
736
+ case "E":
737
+ case "EE":
738
+ case "EEE":
739
+ return n.day(r, {
740
+ width: "abbreviated",
741
+ context: "formatting"
742
+ });
743
+ case "EEEEE":
744
+ return n.day(r, {
745
+ width: "narrow",
746
+ context: "formatting"
747
+ });
748
+ case "EEEEEE":
749
+ return n.day(r, {
750
+ width: "short",
751
+ context: "formatting"
752
+ });
753
+ case "EEEE":
754
+ default:
755
+ return n.day(r, {
756
+ width: "wide",
757
+ context: "formatting"
758
+ });
759
+ }
760
+ },
761
+ // Local day of week
762
+ e: function(t, e, n, r) {
763
+ const a = t.getDay(), i = (a - r.weekStartsOn + 8) % 7 || 7;
764
+ switch (e) {
765
+ case "e":
766
+ return String(i);
767
+ case "ee":
768
+ return o(i, 2);
769
+ case "eo":
770
+ return n.ordinalNumber(i, { unit: "day" });
771
+ case "eee":
772
+ return n.day(a, {
773
+ width: "abbreviated",
774
+ context: "formatting"
775
+ });
776
+ case "eeeee":
777
+ return n.day(a, {
778
+ width: "narrow",
779
+ context: "formatting"
780
+ });
781
+ case "eeeeee":
782
+ return n.day(a, {
783
+ width: "short",
784
+ context: "formatting"
785
+ });
786
+ case "eeee":
787
+ default:
788
+ return n.day(a, {
789
+ width: "wide",
790
+ context: "formatting"
791
+ });
792
+ }
793
+ },
794
+ // Stand-alone local day of week
795
+ c: function(t, e, n, r) {
796
+ const a = t.getDay(), i = (a - r.weekStartsOn + 8) % 7 || 7;
797
+ switch (e) {
798
+ case "c":
799
+ return String(i);
800
+ case "cc":
801
+ return o(i, e.length);
802
+ case "co":
803
+ return n.ordinalNumber(i, { unit: "day" });
804
+ case "ccc":
805
+ return n.day(a, {
806
+ width: "abbreviated",
807
+ context: "standalone"
808
+ });
809
+ case "ccccc":
810
+ return n.day(a, {
811
+ width: "narrow",
812
+ context: "standalone"
813
+ });
814
+ case "cccccc":
815
+ return n.day(a, {
816
+ width: "short",
817
+ context: "standalone"
818
+ });
819
+ case "cccc":
820
+ default:
821
+ return n.day(a, {
822
+ width: "wide",
823
+ context: "standalone"
824
+ });
825
+ }
826
+ },
827
+ // ISO day of week
828
+ i: function(t, e, n) {
829
+ const r = t.getDay(), a = r === 0 ? 7 : r;
830
+ switch (e) {
831
+ case "i":
832
+ return String(a);
833
+ case "ii":
834
+ return o(a, e.length);
835
+ case "io":
836
+ return n.ordinalNumber(a, { unit: "day" });
837
+ case "iii":
838
+ return n.day(r, {
839
+ width: "abbreviated",
840
+ context: "formatting"
841
+ });
842
+ case "iiiii":
843
+ return n.day(r, {
844
+ width: "narrow",
845
+ context: "formatting"
846
+ });
847
+ case "iiiiii":
848
+ return n.day(r, {
849
+ width: "short",
850
+ context: "formatting"
851
+ });
852
+ case "iiii":
853
+ default:
854
+ return n.day(r, {
855
+ width: "wide",
856
+ context: "formatting"
857
+ });
858
+ }
859
+ },
860
+ // AM or PM
861
+ a: function(t, e, n) {
862
+ const a = t.getHours() / 12 >= 1 ? "pm" : "am";
863
+ switch (e) {
864
+ case "a":
865
+ case "aa":
866
+ return n.dayPeriod(a, {
867
+ width: "abbreviated",
868
+ context: "formatting"
869
+ });
870
+ case "aaa":
871
+ return n.dayPeriod(a, {
872
+ width: "abbreviated",
873
+ context: "formatting"
874
+ }).toLowerCase();
875
+ case "aaaaa":
876
+ return n.dayPeriod(a, {
877
+ width: "narrow",
878
+ context: "formatting"
879
+ });
880
+ case "aaaa":
881
+ default:
882
+ return n.dayPeriod(a, {
883
+ width: "wide",
884
+ context: "formatting"
885
+ });
886
+ }
887
+ },
888
+ // AM, PM, midnight, noon
889
+ b: function(t, e, n) {
890
+ const r = t.getHours();
891
+ let a;
892
+ switch (r === 12 ? a = P.noon : r === 0 ? a = P.midnight : a = r / 12 >= 1 ? "pm" : "am", e) {
893
+ case "b":
894
+ case "bb":
895
+ return n.dayPeriod(a, {
896
+ width: "abbreviated",
897
+ context: "formatting"
898
+ });
899
+ case "bbb":
900
+ return n.dayPeriod(a, {
901
+ width: "abbreviated",
902
+ context: "formatting"
903
+ }).toLowerCase();
904
+ case "bbbbb":
905
+ return n.dayPeriod(a, {
906
+ width: "narrow",
907
+ context: "formatting"
908
+ });
909
+ case "bbbb":
910
+ default:
911
+ return n.dayPeriod(a, {
912
+ width: "wide",
913
+ context: "formatting"
914
+ });
915
+ }
916
+ },
917
+ // in the morning, in the afternoon, in the evening, at night
918
+ B: function(t, e, n) {
919
+ const r = t.getHours();
920
+ let a;
921
+ switch (r >= 17 ? a = P.evening : r >= 12 ? a = P.afternoon : r >= 4 ? a = P.morning : a = P.night, e) {
922
+ case "B":
923
+ case "BB":
924
+ case "BBB":
925
+ return n.dayPeriod(a, {
926
+ width: "abbreviated",
927
+ context: "formatting"
928
+ });
929
+ case "BBBBB":
930
+ return n.dayPeriod(a, {
931
+ width: "narrow",
932
+ context: "formatting"
933
+ });
934
+ case "BBBB":
935
+ default:
936
+ return n.dayPeriod(a, {
937
+ width: "wide",
938
+ context: "formatting"
939
+ });
940
+ }
941
+ },
942
+ // Hour [1-12]
943
+ h: function(t, e, n) {
944
+ if (e === "ho") {
945
+ let r = t.getHours() % 12;
946
+ return r === 0 && (r = 12), n.ordinalNumber(r, { unit: "hour" });
947
+ }
948
+ return g.h(t, e);
949
+ },
950
+ // Hour [0-23]
951
+ H: function(t, e, n) {
952
+ return e === "Ho" ? n.ordinalNumber(t.getHours(), { unit: "hour" }) : g.H(t, e);
953
+ },
954
+ // Hour [0-11]
955
+ K: function(t, e, n) {
956
+ const r = t.getHours() % 12;
957
+ return e === "Ko" ? n.ordinalNumber(r, { unit: "hour" }) : o(r, e.length);
958
+ },
959
+ // Hour [1-24]
960
+ k: function(t, e, n) {
961
+ let r = t.getHours();
962
+ return r === 0 && (r = 24), e === "ko" ? n.ordinalNumber(r, { unit: "hour" }) : o(r, e.length);
963
+ },
964
+ // Minute
965
+ m: function(t, e, n) {
966
+ return e === "mo" ? n.ordinalNumber(t.getMinutes(), { unit: "minute" }) : g.m(t, e);
967
+ },
968
+ // Second
969
+ s: function(t, e, n) {
970
+ return e === "so" ? n.ordinalNumber(t.getSeconds(), { unit: "second" }) : g.s(t, e);
971
+ },
972
+ // Fraction of second
973
+ S: function(t, e) {
974
+ return g.S(t, e);
975
+ },
976
+ // Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
977
+ X: function(t, e, n) {
978
+ const r = t.getTimezoneOffset();
979
+ if (r === 0)
980
+ return "Z";
981
+ switch (e) {
982
+ case "X":
983
+ return E(r);
984
+ case "XXXX":
985
+ case "XX":
986
+ return y(r);
987
+ case "XXXXX":
988
+ case "XXX":
989
+ default:
990
+ return y(r, ":");
991
+ }
992
+ },
993
+ // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
994
+ x: function(t, e, n) {
995
+ const r = t.getTimezoneOffset();
996
+ switch (e) {
997
+ case "x":
998
+ return E(r);
999
+ case "xxxx":
1000
+ case "xx":
1001
+ return y(r);
1002
+ case "xxxxx":
1003
+ case "xxx":
1004
+ default:
1005
+ return y(r, ":");
1006
+ }
1007
+ },
1008
+ // Timezone (GMT)
1009
+ O: function(t, e, n) {
1010
+ const r = t.getTimezoneOffset();
1011
+ switch (e) {
1012
+ case "O":
1013
+ case "OO":
1014
+ case "OOO":
1015
+ return "GMT" + D(r, ":");
1016
+ case "OOOO":
1017
+ default:
1018
+ return "GMT" + y(r, ":");
1019
+ }
1020
+ },
1021
+ // Timezone (specific non-location)
1022
+ z: function(t, e, n) {
1023
+ const r = t.getTimezoneOffset();
1024
+ switch (e) {
1025
+ case "z":
1026
+ case "zz":
1027
+ case "zzz":
1028
+ return "GMT" + D(r, ":");
1029
+ case "zzzz":
1030
+ default:
1031
+ return "GMT" + y(r, ":");
1032
+ }
1033
+ },
1034
+ // Seconds timestamp
1035
+ t: function(t, e, n) {
1036
+ const r = Math.trunc(t.getTime() / 1e3);
1037
+ return o(r, e.length);
1038
+ },
1039
+ // Milliseconds timestamp
1040
+ T: function(t, e, n) {
1041
+ const r = t.getTime();
1042
+ return o(r, e.length);
1043
+ }
1044
+ };
1045
+ function D(t, e = "") {
1046
+ const n = t > 0 ? "-" : "+", r = Math.abs(t), a = Math.trunc(r / 60), i = r % 60;
1047
+ return i === 0 ? n + String(a) : n + String(a) + e + o(i, 2);
1048
+ }
1049
+ function E(t, e) {
1050
+ return t % 60 === 0 ? (t > 0 ? "-" : "+") + o(Math.abs(t) / 60, 2) : y(t, e);
1051
+ }
1052
+ function y(t, e = "") {
1053
+ const n = t > 0 ? "-" : "+", r = Math.abs(t), a = o(Math.trunc(r / 60), 2), i = o(r % 60, 2);
1054
+ return n + a + e + i;
1055
+ }
1056
+ const F = (t, e) => {
1057
+ switch (t) {
1058
+ case "P":
1059
+ return e.date({ width: "short" });
1060
+ case "PP":
1061
+ return e.date({ width: "medium" });
1062
+ case "PPP":
1063
+ return e.date({ width: "long" });
1064
+ case "PPPP":
1065
+ default:
1066
+ return e.date({ width: "full" });
1067
+ }
1068
+ }, H = (t, e) => {
1069
+ switch (t) {
1070
+ case "p":
1071
+ return e.time({ width: "short" });
1072
+ case "pp":
1073
+ return e.time({ width: "medium" });
1074
+ case "ppp":
1075
+ return e.time({ width: "long" });
1076
+ case "pppp":
1077
+ default:
1078
+ return e.time({ width: "full" });
1079
+ }
1080
+ }, Wt = (t, e) => {
1081
+ const n = t.match(/(P+)(p+)?/) || [], r = n[1], a = n[2];
1082
+ if (!a)
1083
+ return F(t, e);
1084
+ let i;
1085
+ switch (r) {
1086
+ case "P":
1087
+ i = e.dateTime({ width: "short" });
1088
+ break;
1089
+ case "PP":
1090
+ i = e.dateTime({ width: "medium" });
1091
+ break;
1092
+ case "PPP":
1093
+ i = e.dateTime({ width: "long" });
1094
+ break;
1095
+ case "PPPP":
1096
+ default:
1097
+ i = e.dateTime({ width: "full" });
1098
+ break;
1099
+ }
1100
+ return i.replace("{{date}}", F(r, e)).replace("{{time}}", H(a, e));
1101
+ }, pt = {
1102
+ p: H,
1103
+ P: Wt
1104
+ }, St = /^D+$/, Yt = /^Y+$/, Tt = ["D", "DD", "YY", "YYYY"];
1105
+ function Dt(t) {
1106
+ return St.test(t);
1107
+ }
1108
+ function Et(t) {
1109
+ return Yt.test(t);
1110
+ }
1111
+ function Ft(t, e, n) {
1112
+ const r = qt(t, e, n);
1113
+ if (console.warn(r), Tt.includes(t))
1114
+ throw new RangeError(r);
1115
+ }
1116
+ function qt(t, e, n) {
1117
+ const r = t[0] === "Y" ? "years" : "days of the month";
1118
+ 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`;
1119
+ }
1120
+ const Ct = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, Nt = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, Ht = /^'([^]*?)'?$/, Qt = /''/g, Xt = /[a-zA-Z]/;
1121
+ function Bt(t, e, n) {
1122
+ var f, l, M, O;
1123
+ const r = p(), a = r.locale ?? Mt, i = r.firstWeekContainsDate ?? ((l = (f = r.locale) == null ? void 0 : f.options) == null ? void 0 : l.firstWeekContainsDate) ?? 1, s = r.weekStartsOn ?? ((O = (M = r.locale) == null ? void 0 : M.options) == null ? void 0 : O.weekStartsOn) ?? 0, u = w(t);
1124
+ if (!X(u))
1125
+ throw new RangeError("Invalid time value");
1126
+ let c = e.match(Nt).map((m) => {
1127
+ const h = m[0];
1128
+ if (h === "p" || h === "P") {
1129
+ const S = pt[h];
1130
+ return S(m, a.formatLong);
1131
+ }
1132
+ return m;
1133
+ }).join("").match(Ct).map((m) => {
1134
+ if (m === "''")
1135
+ return { isToken: !1, value: "'" };
1136
+ const h = m[0];
1137
+ if (h === "'")
1138
+ return { isToken: !1, value: Lt(m) };
1139
+ if (T[h])
1140
+ return { isToken: !0, value: m };
1141
+ if (h.match(Xt))
1142
+ throw new RangeError(
1143
+ "Format string contains an unescaped latin alphabet character `" + h + "`"
1144
+ );
1145
+ return { isToken: !1, value: m };
1146
+ });
1147
+ a.localize.preprocessor && (c = a.localize.preprocessor(u, c));
1148
+ const d = {
1149
+ firstWeekContainsDate: i,
1150
+ weekStartsOn: s,
1151
+ locale: a
1152
+ };
1153
+ return c.map((m) => {
1154
+ if (!m.isToken)
1155
+ return m.value;
1156
+ const h = m.value;
1157
+ (Et(h) || Dt(h)) && Ft(h, e, String(t));
1158
+ const S = T[h[0]];
1159
+ return S(u, h, a.localize, d);
1160
+ }).join("");
1161
+ }
1162
+ function Lt(t) {
1163
+ const e = t.match(Ht);
1164
+ return e ? e[1].replace(Qt, "'") : t;
1165
+ }
1166
+ export {
1167
+ Bt as f
1168
+ };