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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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 +193 -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 +290 -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-BOXfsJCN.js +1373 -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 +209 -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 +208 -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 +368 -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 +58 -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 +597 -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 +106 -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 +687 -0
  77. package/differenceInMinutes-CDpgJIgL.js +19 -0
  78. package/format-qHhIvnY8.js +1164 -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 +147 -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 +386 -0
@@ -0,0 +1,1164 @@
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) return null;
338
+ const a = r[0], i = e.match(t.parsePattern);
339
+ if (!i) return null;
340
+ let s = t.valueCallback ? t.valueCallback(i[0]) : i[0];
341
+ s = n.valueCallback ? n.valueCallback(s) : s;
342
+ const u = e.slice(a.length);
343
+ return { value: s, rest: u };
344
+ };
345
+ }
346
+ const st = /^(\d+)(th|st|nd|rd)?/i, ut = /\d+/i, ct = {
347
+ narrow: /^(b|a)/i,
348
+ abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
349
+ wide: /^(before christ|before common era|anno domini|common era)/i
350
+ }, dt = {
351
+ any: [/^b/i, /^(a|c)/i]
352
+ }, ht = {
353
+ narrow: /^[1234]/i,
354
+ abbreviated: /^q[1234]/i,
355
+ wide: /^[1234](th|st|nd|rd)? quarter/i
356
+ }, ft = {
357
+ any: [/1/i, /2/i, /3/i, /4/i]
358
+ }, mt = {
359
+ narrow: /^[jfmasond]/i,
360
+ abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
361
+ wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
362
+ }, lt = {
363
+ narrow: [
364
+ /^j/i,
365
+ /^f/i,
366
+ /^m/i,
367
+ /^a/i,
368
+ /^m/i,
369
+ /^j/i,
370
+ /^j/i,
371
+ /^a/i,
372
+ /^s/i,
373
+ /^o/i,
374
+ /^n/i,
375
+ /^d/i
376
+ ],
377
+ any: [
378
+ /^ja/i,
379
+ /^f/i,
380
+ /^mar/i,
381
+ /^ap/i,
382
+ /^may/i,
383
+ /^jun/i,
384
+ /^jul/i,
385
+ /^au/i,
386
+ /^s/i,
387
+ /^o/i,
388
+ /^n/i,
389
+ /^d/i
390
+ ]
391
+ }, gt = {
392
+ narrow: /^[smtwf]/i,
393
+ short: /^(su|mo|tu|we|th|fr|sa)/i,
394
+ abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
395
+ wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
396
+ }, wt = {
397
+ narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
398
+ any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
399
+ }, yt = {
400
+ narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
401
+ any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
402
+ }, bt = {
403
+ any: {
404
+ am: /^a/i,
405
+ pm: /^p/i,
406
+ midnight: /^mi/i,
407
+ noon: /^no/i,
408
+ morning: /morning/i,
409
+ afternoon: /afternoon/i,
410
+ evening: /evening/i,
411
+ night: /night/i
412
+ }
413
+ }, Pt = {
414
+ ordinalNumber: ot({
415
+ matchPattern: st,
416
+ parsePattern: ut,
417
+ valueCallback: (t) => parseInt(t, 10)
418
+ }),
419
+ era: k({
420
+ matchPatterns: ct,
421
+ defaultMatchWidth: "wide",
422
+ parsePatterns: dt,
423
+ defaultParseWidth: "any"
424
+ }),
425
+ quarter: k({
426
+ matchPatterns: ht,
427
+ defaultMatchWidth: "wide",
428
+ parsePatterns: ft,
429
+ defaultParseWidth: "any",
430
+ valueCallback: (t) => t + 1
431
+ }),
432
+ month: k({
433
+ matchPatterns: mt,
434
+ defaultMatchWidth: "wide",
435
+ parsePatterns: lt,
436
+ defaultParseWidth: "any"
437
+ }),
438
+ day: k({
439
+ matchPatterns: gt,
440
+ defaultMatchWidth: "wide",
441
+ parsePatterns: wt,
442
+ defaultParseWidth: "any"
443
+ }),
444
+ dayPeriod: k({
445
+ matchPatterns: yt,
446
+ defaultMatchWidth: "any",
447
+ parsePatterns: bt,
448
+ defaultParseWidth: "any"
449
+ })
450
+ }, Mt = {
451
+ code: "en-US",
452
+ formatDistance: R,
453
+ formatLong: I,
454
+ formatRelative: $,
455
+ localize: rt,
456
+ match: Pt,
457
+ options: {
458
+ weekStartsOn: 0,
459
+ firstWeekContainsDate: 1
460
+ }
461
+ };
462
+ function Ot(t) {
463
+ const e = w(t);
464
+ return Q(e, _(e)) + 1;
465
+ }
466
+ function vt(t) {
467
+ const e = w(t), n = +W(e) - +G(e);
468
+ return Math.round(n / q) + 1;
469
+ }
470
+ function N(t, e) {
471
+ var f, l, M, O;
472
+ 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);
473
+ s.setFullYear(r + 1, 0, i), s.setHours(0, 0, 0, 0);
474
+ const u = x(s, e), c = b(t, 0);
475
+ c.setFullYear(r, 0, i), c.setHours(0, 0, 0, 0);
476
+ const d = x(c, e);
477
+ return n.getTime() >= u.getTime() ? r + 1 : n.getTime() >= d.getTime() ? r : r - 1;
478
+ }
479
+ function kt(t, e) {
480
+ var u, c, d, f;
481
+ 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);
482
+ return i.setFullYear(a, 0, r), i.setHours(0, 0, 0, 0), x(i, e);
483
+ }
484
+ function xt(t, e) {
485
+ const n = w(t), r = +x(n, e) - +kt(n, e);
486
+ return Math.round(r / q) + 1;
487
+ }
488
+ function o(t, e) {
489
+ const n = t < 0 ? "-" : "", r = Math.abs(t).toString().padStart(e, "0");
490
+ return n + r;
491
+ }
492
+ const g = {
493
+ // Year
494
+ y(t, e) {
495
+ const n = t.getFullYear(), r = n > 0 ? n : 1 - n;
496
+ return o(e === "yy" ? r % 100 : r, e.length);
497
+ },
498
+ // Month
499
+ M(t, e) {
500
+ const n = t.getMonth();
501
+ return e === "M" ? String(n + 1) : o(n + 1, 2);
502
+ },
503
+ // Day of the month
504
+ d(t, e) {
505
+ return o(t.getDate(), e.length);
506
+ },
507
+ // AM or PM
508
+ a(t, e) {
509
+ const n = t.getHours() / 12 >= 1 ? "pm" : "am";
510
+ switch (e) {
511
+ case "a":
512
+ case "aa":
513
+ return n.toUpperCase();
514
+ case "aaa":
515
+ return n;
516
+ case "aaaaa":
517
+ return n[0];
518
+ case "aaaa":
519
+ default:
520
+ return n === "am" ? "a.m." : "p.m.";
521
+ }
522
+ },
523
+ // Hour [1-12]
524
+ h(t, e) {
525
+ return o(t.getHours() % 12 || 12, e.length);
526
+ },
527
+ // Hour [0-23]
528
+ H(t, e) {
529
+ return o(t.getHours(), e.length);
530
+ },
531
+ // Minute
532
+ m(t, e) {
533
+ return o(t.getMinutes(), e.length);
534
+ },
535
+ // Second
536
+ s(t, e) {
537
+ return o(t.getSeconds(), e.length);
538
+ },
539
+ // Fraction of second
540
+ S(t, e) {
541
+ const n = e.length, r = t.getMilliseconds(), a = Math.trunc(
542
+ r * Math.pow(10, n - 3)
543
+ );
544
+ return o(a, e.length);
545
+ }
546
+ }, P = {
547
+ am: "am",
548
+ pm: "pm",
549
+ midnight: "midnight",
550
+ noon: "noon",
551
+ morning: "morning",
552
+ afternoon: "afternoon",
553
+ evening: "evening",
554
+ night: "night"
555
+ }, T = {
556
+ // Era
557
+ G: function(t, e, n) {
558
+ const r = t.getFullYear() > 0 ? 1 : 0;
559
+ switch (e) {
560
+ case "G":
561
+ case "GG":
562
+ case "GGG":
563
+ return n.era(r, { width: "abbreviated" });
564
+ case "GGGGG":
565
+ return n.era(r, { width: "narrow" });
566
+ case "GGGG":
567
+ default:
568
+ return n.era(r, { width: "wide" });
569
+ }
570
+ },
571
+ // Year
572
+ y: function(t, e, n) {
573
+ if (e === "yo") {
574
+ const r = t.getFullYear(), a = r > 0 ? r : 1 - r;
575
+ return n.ordinalNumber(a, { unit: "year" });
576
+ }
577
+ return g.y(t, e);
578
+ },
579
+ // Local week-numbering year
580
+ Y: function(t, e, n, r) {
581
+ const a = N(t, r), i = a > 0 ? a : 1 - a;
582
+ if (e === "YY") {
583
+ const s = i % 100;
584
+ return o(s, 2);
585
+ }
586
+ return e === "Yo" ? n.ordinalNumber(i, { unit: "year" }) : o(i, e.length);
587
+ },
588
+ // ISO week-numbering year
589
+ R: function(t, e) {
590
+ const n = C(t);
591
+ return o(n, e.length);
592
+ },
593
+ // Extended year. This is a single number designating the year of this calendar system.
594
+ // The main difference between `y` and `u` localizers are B.C. years:
595
+ // | Year | `y` | `u` |
596
+ // |------|-----|-----|
597
+ // | AC 1 | 1 | 1 |
598
+ // | BC 1 | 1 | 0 |
599
+ // | BC 2 | 2 | -1 |
600
+ // Also `yy` always returns the last two digits of a year,
601
+ // while `uu` pads single digit years to 2 characters and returns other years unchanged.
602
+ u: function(t, e) {
603
+ const n = t.getFullYear();
604
+ return o(n, e.length);
605
+ },
606
+ // Quarter
607
+ Q: function(t, e, n) {
608
+ const r = Math.ceil((t.getMonth() + 1) / 3);
609
+ switch (e) {
610
+ case "Q":
611
+ return String(r);
612
+ case "QQ":
613
+ return o(r, 2);
614
+ case "Qo":
615
+ return n.ordinalNumber(r, { unit: "quarter" });
616
+ case "QQQ":
617
+ return n.quarter(r, {
618
+ width: "abbreviated",
619
+ context: "formatting"
620
+ });
621
+ case "QQQQQ":
622
+ return n.quarter(r, {
623
+ width: "narrow",
624
+ context: "formatting"
625
+ });
626
+ case "QQQQ":
627
+ default:
628
+ return n.quarter(r, {
629
+ width: "wide",
630
+ context: "formatting"
631
+ });
632
+ }
633
+ },
634
+ // Stand-alone quarter
635
+ q: function(t, e, n) {
636
+ const r = Math.ceil((t.getMonth() + 1) / 3);
637
+ switch (e) {
638
+ case "q":
639
+ return String(r);
640
+ case "qq":
641
+ return o(r, 2);
642
+ case "qo":
643
+ return n.ordinalNumber(r, { unit: "quarter" });
644
+ case "qqq":
645
+ return n.quarter(r, {
646
+ width: "abbreviated",
647
+ context: "standalone"
648
+ });
649
+ case "qqqqq":
650
+ return n.quarter(r, {
651
+ width: "narrow",
652
+ context: "standalone"
653
+ });
654
+ case "qqqq":
655
+ default:
656
+ return n.quarter(r, {
657
+ width: "wide",
658
+ context: "standalone"
659
+ });
660
+ }
661
+ },
662
+ // Month
663
+ M: function(t, e, n) {
664
+ const r = t.getMonth();
665
+ switch (e) {
666
+ case "M":
667
+ case "MM":
668
+ return g.M(t, e);
669
+ case "Mo":
670
+ return n.ordinalNumber(r + 1, { unit: "month" });
671
+ case "MMM":
672
+ return n.month(r, {
673
+ width: "abbreviated",
674
+ context: "formatting"
675
+ });
676
+ case "MMMMM":
677
+ return n.month(r, {
678
+ width: "narrow",
679
+ context: "formatting"
680
+ });
681
+ case "MMMM":
682
+ default:
683
+ return n.month(r, { width: "wide", context: "formatting" });
684
+ }
685
+ },
686
+ // Stand-alone month
687
+ L: function(t, e, n) {
688
+ const r = t.getMonth();
689
+ switch (e) {
690
+ case "L":
691
+ return String(r + 1);
692
+ case "LL":
693
+ return o(r + 1, 2);
694
+ case "Lo":
695
+ return n.ordinalNumber(r + 1, { unit: "month" });
696
+ case "LLL":
697
+ return n.month(r, {
698
+ width: "abbreviated",
699
+ context: "standalone"
700
+ });
701
+ case "LLLLL":
702
+ return n.month(r, {
703
+ width: "narrow",
704
+ context: "standalone"
705
+ });
706
+ case "LLLL":
707
+ default:
708
+ return n.month(r, { width: "wide", context: "standalone" });
709
+ }
710
+ },
711
+ // Local week of year
712
+ w: function(t, e, n, r) {
713
+ const a = xt(t, r);
714
+ return e === "wo" ? n.ordinalNumber(a, { unit: "week" }) : o(a, e.length);
715
+ },
716
+ // ISO week of year
717
+ I: function(t, e, n) {
718
+ const r = vt(t);
719
+ return e === "Io" ? n.ordinalNumber(r, { unit: "week" }) : o(r, e.length);
720
+ },
721
+ // Day of the month
722
+ d: function(t, e, n) {
723
+ return e === "do" ? n.ordinalNumber(t.getDate(), { unit: "date" }) : g.d(t, e);
724
+ },
725
+ // Day of year
726
+ D: function(t, e, n) {
727
+ const r = Ot(t);
728
+ return e === "Do" ? n.ordinalNumber(r, { unit: "dayOfYear" }) : o(r, e.length);
729
+ },
730
+ // Day of week
731
+ E: function(t, e, n) {
732
+ const r = t.getDay();
733
+ switch (e) {
734
+ case "E":
735
+ case "EE":
736
+ case "EEE":
737
+ return n.day(r, {
738
+ width: "abbreviated",
739
+ context: "formatting"
740
+ });
741
+ case "EEEEE":
742
+ return n.day(r, {
743
+ width: "narrow",
744
+ context: "formatting"
745
+ });
746
+ case "EEEEEE":
747
+ return n.day(r, {
748
+ width: "short",
749
+ context: "formatting"
750
+ });
751
+ case "EEEE":
752
+ default:
753
+ return n.day(r, {
754
+ width: "wide",
755
+ context: "formatting"
756
+ });
757
+ }
758
+ },
759
+ // Local day of week
760
+ e: function(t, e, n, r) {
761
+ const a = t.getDay(), i = (a - r.weekStartsOn + 8) % 7 || 7;
762
+ switch (e) {
763
+ case "e":
764
+ return String(i);
765
+ case "ee":
766
+ return o(i, 2);
767
+ case "eo":
768
+ return n.ordinalNumber(i, { unit: "day" });
769
+ case "eee":
770
+ return n.day(a, {
771
+ width: "abbreviated",
772
+ context: "formatting"
773
+ });
774
+ case "eeeee":
775
+ return n.day(a, {
776
+ width: "narrow",
777
+ context: "formatting"
778
+ });
779
+ case "eeeeee":
780
+ return n.day(a, {
781
+ width: "short",
782
+ context: "formatting"
783
+ });
784
+ case "eeee":
785
+ default:
786
+ return n.day(a, {
787
+ width: "wide",
788
+ context: "formatting"
789
+ });
790
+ }
791
+ },
792
+ // Stand-alone local day of week
793
+ c: function(t, e, n, r) {
794
+ const a = t.getDay(), i = (a - r.weekStartsOn + 8) % 7 || 7;
795
+ switch (e) {
796
+ case "c":
797
+ return String(i);
798
+ case "cc":
799
+ return o(i, e.length);
800
+ case "co":
801
+ return n.ordinalNumber(i, { unit: "day" });
802
+ case "ccc":
803
+ return n.day(a, {
804
+ width: "abbreviated",
805
+ context: "standalone"
806
+ });
807
+ case "ccccc":
808
+ return n.day(a, {
809
+ width: "narrow",
810
+ context: "standalone"
811
+ });
812
+ case "cccccc":
813
+ return n.day(a, {
814
+ width: "short",
815
+ context: "standalone"
816
+ });
817
+ case "cccc":
818
+ default:
819
+ return n.day(a, {
820
+ width: "wide",
821
+ context: "standalone"
822
+ });
823
+ }
824
+ },
825
+ // ISO day of week
826
+ i: function(t, e, n) {
827
+ const r = t.getDay(), a = r === 0 ? 7 : r;
828
+ switch (e) {
829
+ case "i":
830
+ return String(a);
831
+ case "ii":
832
+ return o(a, e.length);
833
+ case "io":
834
+ return n.ordinalNumber(a, { unit: "day" });
835
+ case "iii":
836
+ return n.day(r, {
837
+ width: "abbreviated",
838
+ context: "formatting"
839
+ });
840
+ case "iiiii":
841
+ return n.day(r, {
842
+ width: "narrow",
843
+ context: "formatting"
844
+ });
845
+ case "iiiiii":
846
+ return n.day(r, {
847
+ width: "short",
848
+ context: "formatting"
849
+ });
850
+ case "iiii":
851
+ default:
852
+ return n.day(r, {
853
+ width: "wide",
854
+ context: "formatting"
855
+ });
856
+ }
857
+ },
858
+ // AM or PM
859
+ a: function(t, e, n) {
860
+ const a = t.getHours() / 12 >= 1 ? "pm" : "am";
861
+ switch (e) {
862
+ case "a":
863
+ case "aa":
864
+ return n.dayPeriod(a, {
865
+ width: "abbreviated",
866
+ context: "formatting"
867
+ });
868
+ case "aaa":
869
+ return n.dayPeriod(a, {
870
+ width: "abbreviated",
871
+ context: "formatting"
872
+ }).toLowerCase();
873
+ case "aaaaa":
874
+ return n.dayPeriod(a, {
875
+ width: "narrow",
876
+ context: "formatting"
877
+ });
878
+ case "aaaa":
879
+ default:
880
+ return n.dayPeriod(a, {
881
+ width: "wide",
882
+ context: "formatting"
883
+ });
884
+ }
885
+ },
886
+ // AM, PM, midnight, noon
887
+ b: function(t, e, n) {
888
+ const r = t.getHours();
889
+ let a;
890
+ switch (r === 12 ? a = P.noon : r === 0 ? a = P.midnight : a = r / 12 >= 1 ? "pm" : "am", e) {
891
+ case "b":
892
+ case "bb":
893
+ return n.dayPeriod(a, {
894
+ width: "abbreviated",
895
+ context: "formatting"
896
+ });
897
+ case "bbb":
898
+ return n.dayPeriod(a, {
899
+ width: "abbreviated",
900
+ context: "formatting"
901
+ }).toLowerCase();
902
+ case "bbbbb":
903
+ return n.dayPeriod(a, {
904
+ width: "narrow",
905
+ context: "formatting"
906
+ });
907
+ case "bbbb":
908
+ default:
909
+ return n.dayPeriod(a, {
910
+ width: "wide",
911
+ context: "formatting"
912
+ });
913
+ }
914
+ },
915
+ // in the morning, in the afternoon, in the evening, at night
916
+ B: function(t, e, n) {
917
+ const r = t.getHours();
918
+ let a;
919
+ switch (r >= 17 ? a = P.evening : r >= 12 ? a = P.afternoon : r >= 4 ? a = P.morning : a = P.night, e) {
920
+ case "B":
921
+ case "BB":
922
+ case "BBB":
923
+ return n.dayPeriod(a, {
924
+ width: "abbreviated",
925
+ context: "formatting"
926
+ });
927
+ case "BBBBB":
928
+ return n.dayPeriod(a, {
929
+ width: "narrow",
930
+ context: "formatting"
931
+ });
932
+ case "BBBB":
933
+ default:
934
+ return n.dayPeriod(a, {
935
+ width: "wide",
936
+ context: "formatting"
937
+ });
938
+ }
939
+ },
940
+ // Hour [1-12]
941
+ h: function(t, e, n) {
942
+ if (e === "ho") {
943
+ let r = t.getHours() % 12;
944
+ return r === 0 && (r = 12), n.ordinalNumber(r, { unit: "hour" });
945
+ }
946
+ return g.h(t, e);
947
+ },
948
+ // Hour [0-23]
949
+ H: function(t, e, n) {
950
+ return e === "Ho" ? n.ordinalNumber(t.getHours(), { unit: "hour" }) : g.H(t, e);
951
+ },
952
+ // Hour [0-11]
953
+ K: function(t, e, n) {
954
+ const r = t.getHours() % 12;
955
+ return e === "Ko" ? n.ordinalNumber(r, { unit: "hour" }) : o(r, e.length);
956
+ },
957
+ // Hour [1-24]
958
+ k: function(t, e, n) {
959
+ let r = t.getHours();
960
+ return r === 0 && (r = 24), e === "ko" ? n.ordinalNumber(r, { unit: "hour" }) : o(r, e.length);
961
+ },
962
+ // Minute
963
+ m: function(t, e, n) {
964
+ return e === "mo" ? n.ordinalNumber(t.getMinutes(), { unit: "minute" }) : g.m(t, e);
965
+ },
966
+ // Second
967
+ s: function(t, e, n) {
968
+ return e === "so" ? n.ordinalNumber(t.getSeconds(), { unit: "second" }) : g.s(t, e);
969
+ },
970
+ // Fraction of second
971
+ S: function(t, e) {
972
+ return g.S(t, e);
973
+ },
974
+ // Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
975
+ X: function(t, e, n) {
976
+ const r = t.getTimezoneOffset();
977
+ if (r === 0)
978
+ return "Z";
979
+ switch (e) {
980
+ case "X":
981
+ return E(r);
982
+ case "XXXX":
983
+ case "XX":
984
+ return y(r);
985
+ case "XXXXX":
986
+ case "XXX":
987
+ default:
988
+ return y(r, ":");
989
+ }
990
+ },
991
+ // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
992
+ x: function(t, e, n) {
993
+ const r = t.getTimezoneOffset();
994
+ switch (e) {
995
+ case "x":
996
+ return E(r);
997
+ case "xxxx":
998
+ case "xx":
999
+ return y(r);
1000
+ case "xxxxx":
1001
+ case "xxx":
1002
+ default:
1003
+ return y(r, ":");
1004
+ }
1005
+ },
1006
+ // Timezone (GMT)
1007
+ O: function(t, e, n) {
1008
+ const r = t.getTimezoneOffset();
1009
+ switch (e) {
1010
+ case "O":
1011
+ case "OO":
1012
+ case "OOO":
1013
+ return "GMT" + D(r, ":");
1014
+ case "OOOO":
1015
+ default:
1016
+ return "GMT" + y(r, ":");
1017
+ }
1018
+ },
1019
+ // Timezone (specific non-location)
1020
+ z: function(t, e, n) {
1021
+ const r = t.getTimezoneOffset();
1022
+ switch (e) {
1023
+ case "z":
1024
+ case "zz":
1025
+ case "zzz":
1026
+ return "GMT" + D(r, ":");
1027
+ case "zzzz":
1028
+ default:
1029
+ return "GMT" + y(r, ":");
1030
+ }
1031
+ },
1032
+ // Seconds timestamp
1033
+ t: function(t, e, n) {
1034
+ const r = Math.trunc(t.getTime() / 1e3);
1035
+ return o(r, e.length);
1036
+ },
1037
+ // Milliseconds timestamp
1038
+ T: function(t, e, n) {
1039
+ const r = t.getTime();
1040
+ return o(r, e.length);
1041
+ }
1042
+ };
1043
+ function D(t, e = "") {
1044
+ const n = t > 0 ? "-" : "+", r = Math.abs(t), a = Math.trunc(r / 60), i = r % 60;
1045
+ return i === 0 ? n + String(a) : n + String(a) + e + o(i, 2);
1046
+ }
1047
+ function E(t, e) {
1048
+ return t % 60 === 0 ? (t > 0 ? "-" : "+") + o(Math.abs(t) / 60, 2) : y(t, e);
1049
+ }
1050
+ function y(t, e = "") {
1051
+ const n = t > 0 ? "-" : "+", r = Math.abs(t), a = o(Math.trunc(r / 60), 2), i = o(r % 60, 2);
1052
+ return n + a + e + i;
1053
+ }
1054
+ const F = (t, e) => {
1055
+ switch (t) {
1056
+ case "P":
1057
+ return e.date({ width: "short" });
1058
+ case "PP":
1059
+ return e.date({ width: "medium" });
1060
+ case "PPP":
1061
+ return e.date({ width: "long" });
1062
+ case "PPPP":
1063
+ default:
1064
+ return e.date({ width: "full" });
1065
+ }
1066
+ }, H = (t, e) => {
1067
+ switch (t) {
1068
+ case "p":
1069
+ return e.time({ width: "short" });
1070
+ case "pp":
1071
+ return e.time({ width: "medium" });
1072
+ case "ppp":
1073
+ return e.time({ width: "long" });
1074
+ case "pppp":
1075
+ default:
1076
+ return e.time({ width: "full" });
1077
+ }
1078
+ }, Wt = (t, e) => {
1079
+ const n = t.match(/(P+)(p+)?/) || [], r = n[1], a = n[2];
1080
+ if (!a)
1081
+ return F(t, e);
1082
+ let i;
1083
+ switch (r) {
1084
+ case "P":
1085
+ i = e.dateTime({ width: "short" });
1086
+ break;
1087
+ case "PP":
1088
+ i = e.dateTime({ width: "medium" });
1089
+ break;
1090
+ case "PPP":
1091
+ i = e.dateTime({ width: "long" });
1092
+ break;
1093
+ case "PPPP":
1094
+ default:
1095
+ i = e.dateTime({ width: "full" });
1096
+ break;
1097
+ }
1098
+ return i.replace("{{date}}", F(r, e)).replace("{{time}}", H(a, e));
1099
+ }, pt = {
1100
+ p: H,
1101
+ P: Wt
1102
+ }, St = /^D+$/, Yt = /^Y+$/, Tt = ["D", "DD", "YY", "YYYY"];
1103
+ function Dt(t) {
1104
+ return St.test(t);
1105
+ }
1106
+ function Et(t) {
1107
+ return Yt.test(t);
1108
+ }
1109
+ function Ft(t, e, n) {
1110
+ const r = qt(t, e, n);
1111
+ if (console.warn(r), Tt.includes(t)) throw new RangeError(r);
1112
+ }
1113
+ function qt(t, e, n) {
1114
+ const r = t[0] === "Y" ? "years" : "days of the month";
1115
+ 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`;
1116
+ }
1117
+ const Ct = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, Nt = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, Ht = /^'([^]*?)'?$/, Qt = /''/g, Xt = /[a-zA-Z]/;
1118
+ function Bt(t, e, n) {
1119
+ var f, l, M, O;
1120
+ 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);
1121
+ if (!X(u))
1122
+ throw new RangeError("Invalid time value");
1123
+ let c = e.match(Nt).map((m) => {
1124
+ const h = m[0];
1125
+ if (h === "p" || h === "P") {
1126
+ const S = pt[h];
1127
+ return S(m, a.formatLong);
1128
+ }
1129
+ return m;
1130
+ }).join("").match(Ct).map((m) => {
1131
+ if (m === "''")
1132
+ return { isToken: !1, value: "'" };
1133
+ const h = m[0];
1134
+ if (h === "'")
1135
+ return { isToken: !1, value: Lt(m) };
1136
+ if (T[h])
1137
+ return { isToken: !0, value: m };
1138
+ if (h.match(Xt))
1139
+ throw new RangeError(
1140
+ "Format string contains an unescaped latin alphabet character `" + h + "`"
1141
+ );
1142
+ return { isToken: !1, value: m };
1143
+ });
1144
+ a.localize.preprocessor && (c = a.localize.preprocessor(u, c));
1145
+ const d = {
1146
+ firstWeekContainsDate: i,
1147
+ weekStartsOn: s,
1148
+ locale: a
1149
+ };
1150
+ return c.map((m) => {
1151
+ if (!m.isToken) return m.value;
1152
+ const h = m.value;
1153
+ (Et(h) || Dt(h)) && Ft(h, e, String(t));
1154
+ const S = T[h[0]];
1155
+ return S(u, h, a.localize, d);
1156
+ }).join("");
1157
+ }
1158
+ function Lt(t) {
1159
+ const e = t.match(Ht);
1160
+ return e ? e[1].replace(Qt, "'") : t;
1161
+ }
1162
+ export {
1163
+ Bt as f
1164
+ };