@epam/statgpt-sdmx-toolkit 0.3.2 → 0.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.mjs CHANGED
@@ -3,7 +3,7 @@ const K = (t) => {
3
3
  const e = t.split("=");
4
4
  return e.length === 1 ? t : e[1];
5
5
  }
6
- }, H = (t) => {
6
+ }, U = (t) => {
7
7
  if (t == null)
8
8
  return {};
9
9
  const e = K(t), n = {
@@ -13,7 +13,7 @@ const K = (t) => {
13
13
  };
14
14
  return e && (e.includes(":") && (n.agency = e.split(":")[0], n.id = e.split(":")[1].split("(")[0]), e.includes("(") && e.includes(")") && (n.version = e.split("(")[1]?.split(")")[0])), n;
15
15
  }, Pt = (t) => {
16
- const [e, n] = t.split(")."), { agency: r, id: s, version: a } = H(e + ")");
16
+ const [e, n] = t.split(")."), { agency: r, id: s, version: a } = U(e + ")");
17
17
  return { childId: n, agency: r, id: s, version: a };
18
18
  }, Mt = (t, e, n) => {
19
19
  const r = e === "" ? "" : `(${e})`;
@@ -62,7 +62,7 @@ class La {
62
62
  this.client = e;
63
63
  }
64
64
  async getConstraints(e, n) {
65
- const { agency: r, id: s, version: a } = H(e), o = {
65
+ const { agency: r, id: s, version: a } = U(e), o = {
66
66
  filters: n || [],
67
67
  mode: Ze.AVAILABLE,
68
68
  references: ue.NONE
@@ -82,48 +82,59 @@ class La {
82
82
  );
83
83
  }
84
84
  }
85
- var X = /* @__PURE__ */ ((t) => (t.CSV = "csv", t.JSON = "json", t.XML = "xml", t))(X || {}), _t = /* @__PURE__ */ ((t) => (t.ID = "id", t.NAME = "name", t.ID_NAME = "both", t))(_t || {}), It = /* @__PURE__ */ ((t) => (t.FULL_DATASET = "full", t.DATA_IN_TABLE = "query", t))(It || {});
85
+ var C = /* @__PURE__ */ ((t) => (t.CSV = "csv", t.JSON = "json", t.XML = "xml", t))(C || {}), _t = /* @__PURE__ */ ((t) => (t.ID = "id", t.NAME = "name", t.ID_NAME = "both", t))(_t || {}), It = /* @__PURE__ */ ((t) => (t.FULL_DATASET = "full", t.DATA_IN_TABLE = "query", t))(It || {});
86
86
  const Yt = (t, e) => {
87
87
  switch (t) {
88
- case X.CSV:
89
- return B(
88
+ case C.CSV:
89
+ return G(
90
90
  "application/vnd.sdmx.data+csv;version=2.0.0",
91
91
  e
92
92
  );
93
- case X.XML:
94
- return B(
93
+ case C.XML:
94
+ return G(
95
95
  "application/vnd.sdmx.data+xml;version=3.0.0",
96
96
  e
97
97
  );
98
- case X.JSON:
99
- return B(`application/${t}`, e);
98
+ case C.JSON:
99
+ return G(`application/${t}`, e);
100
100
  default:
101
- return B(
101
+ return G(
102
102
  "application/vnd.sdmx.data+csv;version=2.0.0",
103
103
  e
104
104
  );
105
105
  }
106
- }, B = (t, e) => `${t}; labels=${e}`;
106
+ }, Ct = (t) => {
107
+ switch (t) {
108
+ case C.CSV:
109
+ return "text/csv; charset=utf-8";
110
+ case C.XML:
111
+ return "application/xml; charset=utf-8";
112
+ case C.JSON:
113
+ return "application/json; charset=utf-8";
114
+ default:
115
+ return "text/csv; charset=utf-8";
116
+ }
117
+ }, G = (t, e) => `${t}; labels=${e}`;
107
118
  var et = /* @__PURE__ */ ((t) => (t.REFERENCE_PARTIAL = "referencepartial", t.FULL = "full", t))(et || {});
108
- const Ct = "all", Lt = "sdmx/3.0/data/dataflow", tt = "&", Re = ":", St = "=", Wt = "+", Sa = ",", $t = "*", _e = (t, e, n) => {
109
- const { filterKey: r, timeFilter: s } = n, { agency: a, id: o, version: i } = H(t), c = [s || "", e].filter((d) => !!d).join(tt);
110
- return `${`${Lt}/${a}/${o}/${i}`}/${r || $t}?${c}`;
111
- }, qt = (t = "", e = "", n = "", r = ue.DESCENDANTS) => `sdmx/3.0/structure/dataflow/${t}/${e}/${n}?references=${r}&detail=${et.REFERENCE_PARTIAL}`;
112
- class Wa {
119
+ const St = "all", Lt = "sdmx/3.0/data/dataflow", tt = "&", Re = ":", Wt = "=", $t = "+", Wa = ",", qt = "*", _e = (t, e, n) => {
120
+ const { filterKey: r, timeFilter: s } = n, { agency: a, id: o, version: i } = U(t), c = [s || "", e].filter((d) => !!d).join(tt);
121
+ return `${`${Lt}/${a}/${o}/${i}`}/${r || qt}?${c}`;
122
+ }, Qt = (t = "", e = "", n = "", r = ue.DESCENDANTS) => `sdmx/3.0/structure/dataflow/${t}/${e}/${n}?references=${r}&detail=${et.REFERENCE_PARTIAL}`;
123
+ class $a {
113
124
  constructor(e) {
114
125
  this.client = e;
115
126
  }
116
127
  async getDataSet(e, n) {
117
- const { agency: r, id: s, version: a } = H(e);
128
+ const { agency: r, id: s, version: a } = U(e);
118
129
  return await this.client.getRequest(
119
- qt(r, s, a, n)
130
+ Qt(r, s, a, n)
120
131
  );
121
132
  }
122
133
  async getDatasetData(e, n) {
123
134
  const r = new URLSearchParams({
124
135
  includeHistory: "false",
125
136
  limit: "1000",
126
- attributes: Ct,
137
+ attributes: St,
127
138
  dimensionAtObservation: "TIME_PERIOD"
128
139
  // TODO: use time dimensions
129
140
  }).toString(), s = _e(e, r, n);
@@ -145,17 +156,18 @@ class Wa {
145
156
  "Accept-language": r
146
157
  }
147
158
  },
148
- o
159
+ o,
160
+ Ct(n)
149
161
  );
150
162
  }
151
163
  }
152
- const Qt = (t, e) => t.error || t.message || `${e.status} ${e.statusText}`, Ft = "application/json", Ht = "Content-Type", ee = "Api-Key", Ut = "X-CONVERSATION-ID", j = "Ocp-Apim-Subscription-Key";
164
+ const Ft = (t, e) => t.error || t.message || `${e.status} ${e.statusText}`, Ht = "application/json", Ut = "Content-Type", ee = "Api-Key", Bt = "X-CONVERSATION-ID", j = "Ocp-Apim-Subscription-Key";
153
165
  class Ie extends Error {
154
166
  constructor(e) {
155
167
  super(e.message), this.isHttpError = !0, this.name = "HttpError", this.code = e.code, this.status = e.status, this.details = e.details, this.displayMessage = e.displayMessage;
156
168
  }
157
169
  }
158
- const nt = 6048e5, Bt = 864e5, de = 6e4, le = 36e5, Gt = 1e3, Ye = /* @__PURE__ */ Symbol.for("constructDateFrom");
170
+ const nt = 6048e5, Gt = 864e5, de = 6e4, le = 36e5, Vt = 1e3, Ye = /* @__PURE__ */ Symbol.for("constructDateFrom");
159
171
  function E(t, e) {
160
172
  return typeof t == "function" ? t(e) : t && typeof t == "object" && Ye in t ? t[Ye](e) : t instanceof Date ? new t.constructor(e) : new Date(e);
161
173
  }
@@ -166,16 +178,16 @@ function rt(t, e, n) {
166
178
  const r = y(t, n?.in);
167
179
  return isNaN(e) ? E(n?.in || t, NaN) : (e && r.setDate(r.getDate() + e), r);
168
180
  }
169
- let Vt = {};
170
- function S() {
171
- return Vt;
181
+ let Xt = {};
182
+ function W() {
183
+ return Xt;
172
184
  }
173
- function _(t, e) {
174
- const n = S(), r = e?.weekStartsOn ?? e?.locale?.options?.weekStartsOn ?? n.weekStartsOn ?? n.locale?.options?.weekStartsOn ?? 0, s = y(t, e?.in), a = s.getDay(), o = (a < r ? 7 : 0) + a - r;
185
+ function I(t, e) {
186
+ const n = W(), r = e?.weekStartsOn ?? e?.locale?.options?.weekStartsOn ?? n.weekStartsOn ?? n.locale?.options?.weekStartsOn ?? 0, s = y(t, e?.in), a = s.getDay(), o = (a < r ? 7 : 0) + a - r;
175
187
  return s.setDate(s.getDate() - o), s.setHours(0, 0, 0, 0), s;
176
188
  }
177
189
  function L(t, e) {
178
- return _(t, { ...e, weekStartsOn: 1 });
190
+ return I(t, { ...e, weekStartsOn: 1 });
179
191
  }
180
192
  function st(t, e) {
181
193
  const n = y(t, e?.in), r = n.getFullYear(), s = E(n, 0);
@@ -199,7 +211,7 @@ function z(t) {
199
211
  );
200
212
  return n.setUTCFullYear(e.getFullYear()), +t - +n;
201
213
  }
202
- function Xt(t, ...e) {
214
+ function jt(t, ...e) {
203
215
  const n = E.bind(
204
216
  null,
205
217
  e.find((r) => typeof r == "object")
@@ -210,29 +222,29 @@ function Ce(t, e) {
210
222
  const n = y(t, e?.in);
211
223
  return n.setHours(0, 0, 0, 0), n;
212
224
  }
213
- function jt(t, e, n) {
214
- const [r, s] = Xt(
225
+ function Kt(t, e, n) {
226
+ const [r, s] = jt(
215
227
  n?.in,
216
228
  t,
217
229
  e
218
230
  ), a = Ce(r), o = Ce(s), i = +a - z(a), c = +o - z(o);
219
- return Math.round((i - c) / Bt);
231
+ return Math.round((i - c) / Gt);
220
232
  }
221
- function Kt(t, e) {
233
+ function zt(t, e) {
222
234
  const n = st(t, e), r = E(t, 0);
223
235
  return r.setFullYear(n, 0, 4), r.setHours(0, 0, 0, 0), L(r);
224
236
  }
225
- function zt(t) {
237
+ function Jt(t) {
226
238
  return t instanceof Date || typeof t == "object" && Object.prototype.toString.call(t) === "[object Date]";
227
239
  }
228
240
  function re(t) {
229
- return !(!zt(t) && typeof t != "number" || isNaN(+y(t)));
241
+ return !(!Jt(t) && typeof t != "number" || isNaN(+y(t)));
230
242
  }
231
- function Jt(t, e) {
243
+ function Zt(t, e) {
232
244
  const n = y(t, e?.in);
233
245
  return n.setFullYear(n.getFullYear(), 0, 1), n.setHours(0, 0, 0, 0), n;
234
246
  }
235
- const Zt = {
247
+ const en = {
236
248
  lessThanXSeconds: {
237
249
  one: "less than a second",
238
250
  other: "less than {{count}} seconds"
@@ -294,9 +306,9 @@ const Zt = {
294
306
  one: "almost 1 year",
295
307
  other: "almost {{count}} years"
296
308
  }
297
- }, en = (t, e, n) => {
309
+ }, tn = (t, e, n) => {
298
310
  let r;
299
- const s = Zt[t];
311
+ const s = en[t];
300
312
  return typeof s == "string" ? r = s : e === 1 ? r = s.one : r = s.other.replace("{{count}}", e.toString()), n?.addSuffix ? n.comparison && n.comparison > 0 ? "in " + r : r + " ago" : r;
301
313
  };
302
314
  function te(t) {
@@ -305,43 +317,43 @@ function te(t) {
305
317
  return t.formats[n] || t.formats[t.defaultWidth];
306
318
  };
307
319
  }
308
- const tn = {
320
+ const nn = {
309
321
  full: "EEEE, MMMM do, y",
310
322
  long: "MMMM do, y",
311
323
  medium: "MMM d, y",
312
324
  short: "MM/dd/yyyy"
313
- }, nn = {
325
+ }, rn = {
314
326
  full: "h:mm:ss a zzzz",
315
327
  long: "h:mm:ss a z",
316
328
  medium: "h:mm:ss a",
317
329
  short: "h:mm a"
318
- }, rn = {
330
+ }, sn = {
319
331
  full: "{{date}} 'at' {{time}}",
320
332
  long: "{{date}} 'at' {{time}}",
321
333
  medium: "{{date}}, {{time}}",
322
334
  short: "{{date}}, {{time}}"
323
- }, sn = {
335
+ }, an = {
324
336
  date: te({
325
- formats: tn,
337
+ formats: nn,
326
338
  defaultWidth: "full"
327
339
  }),
328
340
  time: te({
329
- formats: nn,
341
+ formats: rn,
330
342
  defaultWidth: "full"
331
343
  }),
332
344
  dateTime: te({
333
- formats: rn,
345
+ formats: sn,
334
346
  defaultWidth: "full"
335
347
  })
336
- }, an = {
348
+ }, on = {
337
349
  lastWeek: "'last' eeee 'at' p",
338
350
  yesterday: "'yesterday at' p",
339
351
  today: "'today at' p",
340
352
  tomorrow: "'tomorrow at' p",
341
353
  nextWeek: "eeee 'at' p",
342
354
  other: "P"
343
- }, on = (t, e, n, r) => an[t];
344
- function q(t) {
355
+ }, cn = (t, e, n, r) => on[t];
356
+ function Q(t) {
345
357
  return (e, n) => {
346
358
  const r = n?.context ? String(n.context) : "standalone";
347
359
  let s;
@@ -356,15 +368,15 @@ function q(t) {
356
368
  return s[a];
357
369
  };
358
370
  }
359
- const cn = {
371
+ const un = {
360
372
  narrow: ["B", "A"],
361
373
  abbreviated: ["BC", "AD"],
362
374
  wide: ["Before Christ", "Anno Domini"]
363
- }, un = {
375
+ }, dn = {
364
376
  narrow: ["1", "2", "3", "4"],
365
377
  abbreviated: ["Q1", "Q2", "Q3", "Q4"],
366
378
  wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"]
367
- }, dn = {
379
+ }, ln = {
368
380
  narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
369
381
  abbreviated: [
370
382
  "Jan",
@@ -394,7 +406,7 @@ const cn = {
394
406
  "November",
395
407
  "December"
396
408
  ]
397
- }, ln = {
409
+ }, fn = {
398
410
  narrow: ["S", "M", "T", "W", "T", "F", "S"],
399
411
  short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
400
412
  abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
@@ -407,7 +419,7 @@ const cn = {
407
419
  "Friday",
408
420
  "Saturday"
409
421
  ]
410
- }, fn = {
422
+ }, mn = {
411
423
  narrow: {
412
424
  am: "a",
413
425
  pm: "p",
@@ -438,7 +450,7 @@ const cn = {
438
450
  evening: "evening",
439
451
  night: "night"
440
452
  }
441
- }, mn = {
453
+ }, hn = {
442
454
  narrow: {
443
455
  am: "a",
444
456
  pm: "p",
@@ -469,7 +481,7 @@ const cn = {
469
481
  evening: "in the evening",
470
482
  night: "at night"
471
483
  }
472
- }, hn = (t, e) => {
484
+ }, wn = (t, e) => {
473
485
  const n = Number(t), r = n % 100;
474
486
  if (r > 20 || r < 10)
475
487
  switch (r % 10) {
@@ -481,40 +493,40 @@ const cn = {
481
493
  return n + "rd";
482
494
  }
483
495
  return n + "th";
484
- }, wn = {
485
- ordinalNumber: hn,
486
- era: q({
487
- values: cn,
496
+ }, gn = {
497
+ ordinalNumber: wn,
498
+ era: Q({
499
+ values: un,
488
500
  defaultWidth: "wide"
489
501
  }),
490
- quarter: q({
491
- values: un,
502
+ quarter: Q({
503
+ values: dn,
492
504
  defaultWidth: "wide",
493
505
  argumentCallback: (t) => t - 1
494
506
  }),
495
- month: q({
496
- values: dn,
497
- defaultWidth: "wide"
498
- }),
499
- day: q({
507
+ month: Q({
500
508
  values: ln,
501
509
  defaultWidth: "wide"
502
510
  }),
503
- dayPeriod: q({
511
+ day: Q({
504
512
  values: fn,
513
+ defaultWidth: "wide"
514
+ }),
515
+ dayPeriod: Q({
516
+ values: mn,
505
517
  defaultWidth: "wide",
506
- formattingValues: mn,
518
+ formattingValues: hn,
507
519
  defaultFormattingWidth: "wide"
508
520
  })
509
521
  };
510
- function Q(t) {
522
+ function F(t) {
511
523
  return (e, n = {}) => {
512
524
  const r = n.width, s = r && t.matchPatterns[r] || t.matchPatterns[t.defaultMatchWidth], a = e.match(s);
513
525
  if (!a)
514
526
  return null;
515
- const o = a[0], i = r && t.parsePatterns[r] || t.parsePatterns[t.defaultParseWidth], c = Array.isArray(i) ? pn(i, (l) => l.test(o)) : (
527
+ const o = a[0], i = r && t.parsePatterns[r] || t.parsePatterns[t.defaultParseWidth], c = Array.isArray(i) ? yn(i, (l) => l.test(o)) : (
516
528
  // [TODO] -- I challenge you to fix the type
517
- gn(i, (l) => l.test(o))
529
+ pn(i, (l) => l.test(o))
518
530
  );
519
531
  let u;
520
532
  u = t.valueCallback ? t.valueCallback(c) : c, u = n.valueCallback ? (
@@ -525,17 +537,17 @@ function Q(t) {
525
537
  return { value: u, rest: d };
526
538
  };
527
539
  }
528
- function gn(t, e) {
540
+ function pn(t, e) {
529
541
  for (const n in t)
530
542
  if (Object.prototype.hasOwnProperty.call(t, n) && e(t[n]))
531
543
  return n;
532
544
  }
533
- function pn(t, e) {
545
+ function yn(t, e) {
534
546
  for (let n = 0; n < t.length; n++)
535
547
  if (e(t[n]))
536
548
  return n;
537
549
  }
538
- function yn(t) {
550
+ function bn(t) {
539
551
  return (e, n = {}) => {
540
552
  const r = e.match(t.matchPattern);
541
553
  if (!r) return null;
@@ -547,23 +559,23 @@ function yn(t) {
547
559
  return { value: o, rest: i };
548
560
  };
549
561
  }
550
- const bn = /^(\d+)(th|st|nd|rd)?/i, Dn = /\d+/i, Tn = {
562
+ const Dn = /^(\d+)(th|st|nd|rd)?/i, Tn = /\d+/i, En = {
551
563
  narrow: /^(b|a)/i,
552
564
  abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
553
565
  wide: /^(before christ|before common era|anno domini|common era)/i
554
- }, En = {
555
- any: [/^b/i, /^(a|c)/i]
556
566
  }, xn = {
567
+ any: [/^b/i, /^(a|c)/i]
568
+ }, Pn = {
557
569
  narrow: /^[1234]/i,
558
570
  abbreviated: /^q[1234]/i,
559
571
  wide: /^[1234](th|st|nd|rd)? quarter/i
560
- }, Pn = {
561
- any: [/1/i, /2/i, /3/i, /4/i]
562
572
  }, Mn = {
573
+ any: [/1/i, /2/i, /3/i, /4/i]
574
+ }, vn = {
563
575
  narrow: /^[jfmasond]/i,
564
576
  abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
565
577
  wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
566
- }, vn = {
578
+ }, On = {
567
579
  narrow: [
568
580
  /^j/i,
569
581
  /^f/i,
@@ -592,18 +604,18 @@ const bn = /^(\d+)(th|st|nd|rd)?/i, Dn = /\d+/i, Tn = {
592
604
  /^n/i,
593
605
  /^d/i
594
606
  ]
595
- }, On = {
607
+ }, An = {
596
608
  narrow: /^[smtwf]/i,
597
609
  short: /^(su|mo|tu|we|th|fr|sa)/i,
598
610
  abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
599
611
  wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
600
- }, An = {
612
+ }, Nn = {
601
613
  narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
602
614
  any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
603
- }, Nn = {
615
+ }, kn = {
604
616
  narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
605
617
  any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
606
- }, kn = {
618
+ }, Rn = {
607
619
  any: {
608
620
  am: /^a/i,
609
621
  pm: /^p/i,
@@ -614,84 +626,84 @@ const bn = /^(\d+)(th|st|nd|rd)?/i, Dn = /\d+/i, Tn = {
614
626
  evening: /evening/i,
615
627
  night: /night/i
616
628
  }
617
- }, Rn = {
618
- ordinalNumber: yn({
619
- matchPattern: bn,
620
- parsePattern: Dn,
629
+ }, _n = {
630
+ ordinalNumber: bn({
631
+ matchPattern: Dn,
632
+ parsePattern: Tn,
621
633
  valueCallback: (t) => parseInt(t, 10)
622
634
  }),
623
- era: Q({
624
- matchPatterns: Tn,
635
+ era: F({
636
+ matchPatterns: En,
625
637
  defaultMatchWidth: "wide",
626
- parsePatterns: En,
638
+ parsePatterns: xn,
627
639
  defaultParseWidth: "any"
628
640
  }),
629
- quarter: Q({
630
- matchPatterns: xn,
641
+ quarter: F({
642
+ matchPatterns: Pn,
631
643
  defaultMatchWidth: "wide",
632
- parsePatterns: Pn,
644
+ parsePatterns: Mn,
633
645
  defaultParseWidth: "any",
634
646
  valueCallback: (t) => t + 1
635
647
  }),
636
- month: Q({
637
- matchPatterns: Mn,
648
+ month: F({
649
+ matchPatterns: vn,
638
650
  defaultMatchWidth: "wide",
639
- parsePatterns: vn,
651
+ parsePatterns: On,
640
652
  defaultParseWidth: "any"
641
653
  }),
642
- day: Q({
643
- matchPatterns: On,
654
+ day: F({
655
+ matchPatterns: An,
644
656
  defaultMatchWidth: "wide",
645
- parsePatterns: An,
657
+ parsePatterns: Nn,
646
658
  defaultParseWidth: "any"
647
659
  }),
648
- dayPeriod: Q({
649
- matchPatterns: Nn,
660
+ dayPeriod: F({
661
+ matchPatterns: kn,
650
662
  defaultMatchWidth: "any",
651
- parsePatterns: kn,
663
+ parsePatterns: Rn,
652
664
  defaultParseWidth: "any"
653
665
  })
654
666
  }, at = {
655
667
  code: "en-US",
656
- formatDistance: en,
657
- formatLong: sn,
658
- formatRelative: on,
659
- localize: wn,
660
- match: Rn,
668
+ formatDistance: tn,
669
+ formatLong: an,
670
+ formatRelative: cn,
671
+ localize: gn,
672
+ match: _n,
661
673
  options: {
662
674
  weekStartsOn: 0,
663
675
  firstWeekContainsDate: 1
664
676
  }
665
677
  };
666
- function _n(t, e) {
678
+ function In(t, e) {
667
679
  const n = y(t, e?.in);
668
- return jt(n, Jt(n)) + 1;
680
+ return Kt(n, Zt(n)) + 1;
669
681
  }
670
682
  function ot(t, e) {
671
- const n = y(t, e?.in), r = +L(n) - +Kt(n);
683
+ const n = y(t, e?.in), r = +L(n) - +zt(n);
672
684
  return Math.round(r / nt) + 1;
673
685
  }
674
686
  function fe(t, e) {
675
- const n = y(t, e?.in), r = n.getFullYear(), s = S(), a = e?.firstWeekContainsDate ?? e?.locale?.options?.firstWeekContainsDate ?? s.firstWeekContainsDate ?? s.locale?.options?.firstWeekContainsDate ?? 1, o = E(e?.in || t, 0);
687
+ const n = y(t, e?.in), r = n.getFullYear(), s = W(), a = e?.firstWeekContainsDate ?? e?.locale?.options?.firstWeekContainsDate ?? s.firstWeekContainsDate ?? s.locale?.options?.firstWeekContainsDate ?? 1, o = E(e?.in || t, 0);
676
688
  o.setFullYear(r + 1, 0, a), o.setHours(0, 0, 0, 0);
677
- const i = _(o, e), c = E(e?.in || t, 0);
689
+ const i = I(o, e), c = E(e?.in || t, 0);
678
690
  c.setFullYear(r, 0, a), c.setHours(0, 0, 0, 0);
679
- const u = _(c, e);
691
+ const u = I(c, e);
680
692
  return +n >= +i ? r + 1 : +n >= +u ? r : r - 1;
681
693
  }
682
- function In(t, e) {
683
- const n = S(), r = e?.firstWeekContainsDate ?? e?.locale?.options?.firstWeekContainsDate ?? n.firstWeekContainsDate ?? n.locale?.options?.firstWeekContainsDate ?? 1, s = fe(t, e), a = E(e?.in || t, 0);
684
- return a.setFullYear(s, 0, r), a.setHours(0, 0, 0, 0), _(a, e);
694
+ function Yn(t, e) {
695
+ const n = W(), r = e?.firstWeekContainsDate ?? e?.locale?.options?.firstWeekContainsDate ?? n.firstWeekContainsDate ?? n.locale?.options?.firstWeekContainsDate ?? 1, s = fe(t, e), a = E(e?.in || t, 0);
696
+ return a.setFullYear(s, 0, r), a.setHours(0, 0, 0, 0), I(a, e);
685
697
  }
686
698
  function it(t, e) {
687
- const n = y(t, e?.in), r = +_(n, e) - +In(n, e);
699
+ const n = y(t, e?.in), r = +I(n, e) - +Yn(n, e);
688
700
  return Math.round(r / nt) + 1;
689
701
  }
690
702
  function h(t, e) {
691
703
  const n = t < 0 ? "-" : "", r = Math.abs(t).toString().padStart(e, "0");
692
704
  return n + r;
693
705
  }
694
- const N = {
706
+ const k = {
695
707
  // Year
696
708
  y(t, e) {
697
709
  const n = t.getFullYear(), r = n > 0 ? n : 1 - n;
@@ -744,14 +756,14 @@ const N = {
744
756
  );
745
757
  return h(s, e.length);
746
758
  }
747
- }, C = {
759
+ }, S = {
748
760
  midnight: "midnight",
749
761
  noon: "noon",
750
762
  morning: "morning",
751
763
  afternoon: "afternoon",
752
764
  evening: "evening",
753
765
  night: "night"
754
- }, Le = {
766
+ }, Se = {
755
767
  // Era
756
768
  G: function(t, e, n) {
757
769
  const r = t.getFullYear() > 0 ? 1 : 0;
@@ -774,7 +786,7 @@ const N = {
774
786
  const r = t.getFullYear(), s = r > 0 ? r : 1 - r;
775
787
  return n.ordinalNumber(s, { unit: "year" });
776
788
  }
777
- return N.y(t, e);
789
+ return k.y(t, e);
778
790
  },
779
791
  // Local week-numbering year
780
792
  Y: function(t, e, n, r) {
@@ -873,7 +885,7 @@ const N = {
873
885
  switch (e) {
874
886
  case "M":
875
887
  case "MM":
876
- return N.M(t, e);
888
+ return k.M(t, e);
877
889
  // 1st, 2nd, ..., 12th
878
890
  case "Mo":
879
891
  return n.ordinalNumber(r + 1, { unit: "month" });
@@ -934,11 +946,11 @@ const N = {
934
946
  },
935
947
  // Day of the month
936
948
  d: function(t, e, n) {
937
- return e === "do" ? n.ordinalNumber(t.getDate(), { unit: "date" }) : N.d(t, e);
949
+ return e === "do" ? n.ordinalNumber(t.getDate(), { unit: "date" }) : k.d(t, e);
938
950
  },
939
951
  // Day of year
940
952
  D: function(t, e, n) {
941
- const r = _n(t);
953
+ const r = In(t);
942
954
  return e === "Do" ? n.ordinalNumber(r, { unit: "dayOfYear" }) : h(r, e.length);
943
955
  },
944
956
  // Day of week
@@ -1115,7 +1127,7 @@ const N = {
1115
1127
  b: function(t, e, n) {
1116
1128
  const r = t.getHours();
1117
1129
  let s;
1118
- switch (r === 12 ? s = C.noon : r === 0 ? s = C.midnight : s = r / 12 >= 1 ? "pm" : "am", e) {
1130
+ switch (r === 12 ? s = S.noon : r === 0 ? s = S.midnight : s = r / 12 >= 1 ? "pm" : "am", e) {
1119
1131
  case "b":
1120
1132
  case "bb":
1121
1133
  return n.dayPeriod(s, {
@@ -1143,7 +1155,7 @@ const N = {
1143
1155
  B: function(t, e, n) {
1144
1156
  const r = t.getHours();
1145
1157
  let s;
1146
- switch (r >= 17 ? s = C.evening : r >= 12 ? s = C.afternoon : r >= 4 ? s = C.morning : s = C.night, e) {
1158
+ switch (r >= 17 ? s = S.evening : r >= 12 ? s = S.afternoon : r >= 4 ? s = S.morning : s = S.night, e) {
1147
1159
  case "B":
1148
1160
  case "BB":
1149
1161
  case "BBB":
@@ -1169,11 +1181,11 @@ const N = {
1169
1181
  let r = t.getHours() % 12;
1170
1182
  return r === 0 && (r = 12), n.ordinalNumber(r, { unit: "hour" });
1171
1183
  }
1172
- return N.h(t, e);
1184
+ return k.h(t, e);
1173
1185
  },
1174
1186
  // Hour [0-23]
1175
1187
  H: function(t, e, n) {
1176
- return e === "Ho" ? n.ordinalNumber(t.getHours(), { unit: "hour" }) : N.H(t, e);
1188
+ return e === "Ho" ? n.ordinalNumber(t.getHours(), { unit: "hour" }) : k.H(t, e);
1177
1189
  },
1178
1190
  // Hour [0-11]
1179
1191
  K: function(t, e, n) {
@@ -1187,15 +1199,15 @@ const N = {
1187
1199
  },
1188
1200
  // Minute
1189
1201
  m: function(t, e, n) {
1190
- return e === "mo" ? n.ordinalNumber(t.getMinutes(), { unit: "minute" }) : N.m(t, e);
1202
+ return e === "mo" ? n.ordinalNumber(t.getMinutes(), { unit: "minute" }) : k.m(t, e);
1191
1203
  },
1192
1204
  // Second
1193
1205
  s: function(t, e, n) {
1194
- return e === "so" ? n.ordinalNumber(t.getSeconds(), { unit: "second" }) : N.s(t, e);
1206
+ return e === "so" ? n.ordinalNumber(t.getSeconds(), { unit: "second" }) : k.s(t, e);
1195
1207
  },
1196
1208
  // Fraction of second
1197
1209
  S: function(t, e) {
1198
- return N.S(t, e);
1210
+ return k.S(t, e);
1199
1211
  },
1200
1212
  // Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
1201
1213
  X: function(t, e, n) {
@@ -1211,10 +1223,10 @@ const N = {
1211
1223
  // so this token always has the same output as `XX`
1212
1224
  case "XXXX":
1213
1225
  case "XX":
1214
- return I(r);
1226
+ return Y(r);
1215
1227
  // Hours and minutes with `:` delimiter
1216
1228
  default:
1217
- return I(r, ":");
1229
+ return Y(r, ":");
1218
1230
  }
1219
1231
  },
1220
1232
  // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
@@ -1229,10 +1241,10 @@ const N = {
1229
1241
  // so this token always has the same output as `xx`
1230
1242
  case "xxxx":
1231
1243
  case "xx":
1232
- return I(r);
1244
+ return Y(r);
1233
1245
  // Hours and minutes with `:` delimiter
1234
1246
  default:
1235
- return I(r, ":");
1247
+ return Y(r, ":");
1236
1248
  }
1237
1249
  },
1238
1250
  // Timezone (GMT)
@@ -1243,9 +1255,9 @@ const N = {
1243
1255
  case "O":
1244
1256
  case "OO":
1245
1257
  case "OOO":
1246
- return "GMT" + Se(r, ":");
1258
+ return "GMT" + Le(r, ":");
1247
1259
  default:
1248
- return "GMT" + I(r, ":");
1260
+ return "GMT" + Y(r, ":");
1249
1261
  }
1250
1262
  },
1251
1263
  // Timezone (specific non-location)
@@ -1256,9 +1268,9 @@ const N = {
1256
1268
  case "z":
1257
1269
  case "zz":
1258
1270
  case "zzz":
1259
- return "GMT" + Se(r, ":");
1271
+ return "GMT" + Le(r, ":");
1260
1272
  default:
1261
- return "GMT" + I(r, ":");
1273
+ return "GMT" + Y(r, ":");
1262
1274
  }
1263
1275
  },
1264
1276
  // Seconds timestamp
@@ -1271,14 +1283,14 @@ const N = {
1271
1283
  return h(+t, e.length);
1272
1284
  }
1273
1285
  };
1274
- function Se(t, e = "") {
1286
+ function Le(t, e = "") {
1275
1287
  const n = t > 0 ? "-" : "+", r = Math.abs(t), s = Math.trunc(r / 60), a = r % 60;
1276
1288
  return a === 0 ? n + String(s) : n + String(s) + e + h(a, 2);
1277
1289
  }
1278
1290
  function We(t, e) {
1279
- return t % 60 === 0 ? (t > 0 ? "-" : "+") + h(Math.abs(t) / 60, 2) : I(t, e);
1291
+ return t % 60 === 0 ? (t > 0 ? "-" : "+") + h(Math.abs(t) / 60, 2) : Y(t, e);
1280
1292
  }
1281
- function I(t, e = "") {
1293
+ function Y(t, e = "") {
1282
1294
  const n = t > 0 ? "-" : "+", r = Math.abs(t), s = h(Math.trunc(r / 60), 2), a = h(r % 60, 2);
1283
1295
  return n + s + e + a;
1284
1296
  }
@@ -1304,7 +1316,7 @@ const $e = (t, e) => {
1304
1316
  default:
1305
1317
  return e.time({ width: "full" });
1306
1318
  }
1307
- }, Yn = (t, e) => {
1319
+ }, Cn = (t, e) => {
1308
1320
  const n = t.match(/(P+)(p+)?/) || [], r = n[1], s = n[2];
1309
1321
  if (!s)
1310
1322
  return $e(t, e);
@@ -1326,43 +1338,43 @@ const $e = (t, e) => {
1326
1338
  return a.replace("{{date}}", $e(r, e)).replace("{{time}}", ct(s, e));
1327
1339
  }, se = {
1328
1340
  p: ct,
1329
- P: Yn
1330
- }, Cn = /^D+$/, Ln = /^Y+$/, Sn = ["D", "DD", "YY", "YYYY"];
1341
+ P: Cn
1342
+ }, Sn = /^D+$/, Ln = /^Y+$/, Wn = ["D", "DD", "YY", "YYYY"];
1331
1343
  function ut(t) {
1332
- return Cn.test(t);
1344
+ return Sn.test(t);
1333
1345
  }
1334
1346
  function dt(t) {
1335
1347
  return Ln.test(t);
1336
1348
  }
1337
1349
  function ae(t, e, n) {
1338
- const r = Wn(t, e, n);
1339
- if (console.warn(r), Sn.includes(t)) throw new RangeError(r);
1350
+ const r = $n(t, e, n);
1351
+ if (console.warn(r), Wn.includes(t)) throw new RangeError(r);
1340
1352
  }
1341
- function Wn(t, e, n) {
1353
+ function $n(t, e, n) {
1342
1354
  const r = t[0] === "Y" ? "years" : "days of the month";
1343
1355
  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`;
1344
1356
  }
1345
- const $n = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, qn = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, Qn = /^'([^]*?)'?$/, Fn = /''/g, Hn = /[a-zA-Z]/;
1346
- function Un(t, e, n) {
1347
- const r = S(), s = r.locale ?? at, a = r.firstWeekContainsDate ?? r.locale?.options?.firstWeekContainsDate ?? 1, o = r.weekStartsOn ?? r.locale?.options?.weekStartsOn ?? 0, i = y(t, n?.in);
1357
+ const qn = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, Qn = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, Fn = /^'([^]*?)'?$/, Hn = /''/g, Un = /[a-zA-Z]/;
1358
+ function Bn(t, e, n) {
1359
+ const r = W(), s = r.locale ?? at, a = r.firstWeekContainsDate ?? r.locale?.options?.firstWeekContainsDate ?? 1, o = r.weekStartsOn ?? r.locale?.options?.weekStartsOn ?? 0, i = y(t, n?.in);
1348
1360
  if (!re(i))
1349
1361
  throw new RangeError("Invalid time value");
1350
- let c = e.match(qn).map((d) => {
1362
+ let c = e.match(Qn).map((d) => {
1351
1363
  const l = d[0];
1352
1364
  if (l === "p" || l === "P") {
1353
1365
  const g = se[l];
1354
1366
  return g(d, s.formatLong);
1355
1367
  }
1356
1368
  return d;
1357
- }).join("").match($n).map((d) => {
1369
+ }).join("").match(qn).map((d) => {
1358
1370
  if (d === "''")
1359
1371
  return { isToken: !1, value: "'" };
1360
1372
  const l = d[0];
1361
1373
  if (l === "'")
1362
- return { isToken: !1, value: Bn(d) };
1363
- if (Le[l])
1374
+ return { isToken: !1, value: Gn(d) };
1375
+ if (Se[l])
1364
1376
  return { isToken: !0, value: d };
1365
- if (l.match(Hn))
1377
+ if (l.match(Un))
1366
1378
  throw new RangeError(
1367
1379
  "Format string contains an unescaped latin alphabet character `" + l + "`"
1368
1380
  );
@@ -1378,23 +1390,23 @@ function Un(t, e, n) {
1378
1390
  if (!d.isToken) return d.value;
1379
1391
  const l = d.value;
1380
1392
  (dt(l) || ut(l)) && ae(l, e, String(t));
1381
- const g = Le[l[0]];
1393
+ const g = Se[l[0]];
1382
1394
  return g(i, l, s.localize, u);
1383
1395
  }).join("");
1384
1396
  }
1385
- function Bn(t) {
1386
- const e = t.match(Qn);
1387
- return e ? e[1].replace(Fn, "'") : t;
1397
+ function Gn(t) {
1398
+ const e = t.match(Fn);
1399
+ return e ? e[1].replace(Hn, "'") : t;
1388
1400
  }
1389
- function Gn() {
1390
- return Object.assign({}, S());
1401
+ function Vn() {
1402
+ return Object.assign({}, W());
1391
1403
  }
1392
- function Vn(t, e) {
1404
+ function Xn(t, e) {
1393
1405
  const n = y(t, e?.in).getDay();
1394
1406
  return n === 0 ? 7 : n;
1395
1407
  }
1396
- function Xn(t, e) {
1397
- const n = jn(e) ? new e(0) : E(e, 0);
1408
+ function jn(t, e) {
1409
+ const n = Kn(e) ? new e(0) : E(e, 0);
1398
1410
  return n.setFullYear(t.getFullYear(), t.getMonth(), t.getDate()), n.setHours(
1399
1411
  t.getHours(),
1400
1412
  t.getMinutes(),
@@ -1402,17 +1414,17 @@ function Xn(t, e) {
1402
1414
  t.getMilliseconds()
1403
1415
  ), n;
1404
1416
  }
1405
- function jn(t) {
1417
+ function Kn(t) {
1406
1418
  return typeof t == "function" && t.prototype?.constructor === t;
1407
1419
  }
1408
- const Kn = 10;
1420
+ const zn = 10;
1409
1421
  class lt {
1410
1422
  subPriority = 0;
1411
1423
  validate(e, n) {
1412
1424
  return !0;
1413
1425
  }
1414
1426
  }
1415
- class zn extends lt {
1427
+ class Jn extends lt {
1416
1428
  constructor(e, n, r, s, a) {
1417
1429
  super(), this.value = e, this.validateValue = n, this.setValue = r, this.priority = s, a && (this.subPriority = a);
1418
1430
  }
@@ -1423,21 +1435,21 @@ class zn extends lt {
1423
1435
  return this.setValue(e, n, this.value, r);
1424
1436
  }
1425
1437
  }
1426
- class Jn extends lt {
1427
- priority = Kn;
1438
+ class Zn extends lt {
1439
+ priority = zn;
1428
1440
  subPriority = -1;
1429
1441
  constructor(e, n) {
1430
1442
  super(), this.context = e || ((r) => E(n, r));
1431
1443
  }
1432
1444
  set(e, n) {
1433
- return n.timestampIsSet ? e : E(e, Xn(e, this.context));
1445
+ return n.timestampIsSet ? e : E(e, jn(e, this.context));
1434
1446
  }
1435
1447
  }
1436
1448
  class m {
1437
1449
  run(e, n, r, s) {
1438
1450
  const a = this.parse(e, n, r, s);
1439
1451
  return a ? {
1440
- setter: new zn(
1452
+ setter: new Jn(
1441
1453
  a.value,
1442
1454
  this.validate,
1443
1455
  this.set,
@@ -1451,7 +1463,7 @@ class m {
1451
1463
  return !0;
1452
1464
  }
1453
1465
  }
1454
- class Zn extends m {
1466
+ class er extends m {
1455
1467
  priority = 140;
1456
1468
  parse(e, n, r) {
1457
1469
  switch (n) {
@@ -1541,7 +1553,7 @@ function A(t, e) {
1541
1553
  };
1542
1554
  const r = n[1] === "+" ? 1 : -1, s = n[2] ? parseInt(n[2], 10) : 0, a = n[3] ? parseInt(n[3], 10) : 0, o = n[5] ? parseInt(n[5], 10) : 0;
1543
1555
  return {
1544
- value: r * (s * le + a * de + o * Gt),
1556
+ value: r * (s * le + a * de + o * Vt),
1545
1557
  rest: e.slice(n[0].length)
1546
1558
  };
1547
1559
  }
@@ -1604,7 +1616,7 @@ function mt(t, e) {
1604
1616
  function ht(t) {
1605
1617
  return t % 400 === 0 || t % 4 === 0 && t % 100 !== 0;
1606
1618
  }
1607
- class er extends m {
1619
+ class tr extends m {
1608
1620
  priority = 130;
1609
1621
  incompatibleTokens = ["Y", "R", "u", "w", "I", "i", "e", "c", "t", "T"];
1610
1622
  parse(e, n, r) {
@@ -1642,7 +1654,7 @@ class er extends m {
1642
1654
  return e.setFullYear(a, 0, 1), e.setHours(0, 0, 0, 0), e;
1643
1655
  }
1644
1656
  }
1645
- class tr extends m {
1657
+ class nr extends m {
1646
1658
  priority = 130;
1647
1659
  parse(e, n, r) {
1648
1660
  const s = (a) => ({
@@ -1677,10 +1689,10 @@ class tr extends m {
1677
1689
  i,
1678
1690
  0,
1679
1691
  s.firstWeekContainsDate
1680
- ), e.setHours(0, 0, 0, 0), _(e, s);
1692
+ ), e.setHours(0, 0, 0, 0), I(e, s);
1681
1693
  }
1682
1694
  const o = !("era" in n) || n.era === 1 ? r.year : 1 - r.year;
1683
- return e.setFullYear(o, 0, s.firstWeekContainsDate), e.setHours(0, 0, 0, 0), _(e, s);
1695
+ return e.setFullYear(o, 0, s.firstWeekContainsDate), e.setHours(0, 0, 0, 0), I(e, s);
1684
1696
  }
1685
1697
  incompatibleTokens = [
1686
1698
  "y",
@@ -1698,7 +1710,7 @@ class tr extends m {
1698
1710
  "T"
1699
1711
  ];
1700
1712
  }
1701
- class nr extends m {
1713
+ class rr extends m {
1702
1714
  priority = 130;
1703
1715
  parse(e, n) {
1704
1716
  return J(n === "R" ? 4 : n.length, e);
@@ -1725,7 +1737,7 @@ class nr extends m {
1725
1737
  "T"
1726
1738
  ];
1727
1739
  }
1728
- class rr extends m {
1740
+ class sr extends m {
1729
1741
  priority = 130;
1730
1742
  parse(e, n) {
1731
1743
  return J(n === "u" ? 4 : n.length, e);
@@ -1735,7 +1747,7 @@ class rr extends m {
1735
1747
  }
1736
1748
  incompatibleTokens = ["G", "y", "Y", "R", "w", "I", "i", "e", "c", "t", "T"];
1737
1749
  }
1738
- class sr extends m {
1750
+ class ar extends m {
1739
1751
  priority = 120;
1740
1752
  parse(e, n, r) {
1741
1753
  switch (n) {
@@ -1797,7 +1809,7 @@ class sr extends m {
1797
1809
  "T"
1798
1810
  ];
1799
1811
  }
1800
- class ar extends m {
1812
+ class or extends m {
1801
1813
  priority = 120;
1802
1814
  parse(e, n, r) {
1803
1815
  switch (n) {
@@ -1859,7 +1871,7 @@ class ar extends m {
1859
1871
  "T"
1860
1872
  ];
1861
1873
  }
1862
- class or extends m {
1874
+ class ir extends m {
1863
1875
  incompatibleTokens = [
1864
1876
  "Y",
1865
1877
  "R",
@@ -1922,7 +1934,7 @@ class or extends m {
1922
1934
  return e.setMonth(r, 1), e.setHours(0, 0, 0, 0), e;
1923
1935
  }
1924
1936
  }
1925
- class ir extends m {
1937
+ class cr extends m {
1926
1938
  priority = 110;
1927
1939
  parse(e, n, r) {
1928
1940
  const s = (a) => a - 1;
@@ -1985,11 +1997,11 @@ class ir extends m {
1985
1997
  "T"
1986
1998
  ];
1987
1999
  }
1988
- function cr(t, e, n) {
2000
+ function ur(t, e, n) {
1989
2001
  const r = y(t, n?.in), s = it(r, n) - e;
1990
2002
  return r.setDate(r.getDate() - s * 7), y(r, n?.in);
1991
2003
  }
1992
- class ur extends m {
2004
+ class dr extends m {
1993
2005
  priority = 100;
1994
2006
  parse(e, n, r) {
1995
2007
  switch (n) {
@@ -2005,7 +2017,7 @@ class ur extends m {
2005
2017
  return n >= 1 && n <= 53;
2006
2018
  }
2007
2019
  set(e, n, r, s) {
2008
- return _(cr(e, r, s), s);
2020
+ return I(ur(e, r, s), s);
2009
2021
  }
2010
2022
  incompatibleTokens = [
2011
2023
  "y",
@@ -2023,11 +2035,11 @@ class ur extends m {
2023
2035
  "T"
2024
2036
  ];
2025
2037
  }
2026
- function dr(t, e, n) {
2038
+ function lr(t, e, n) {
2027
2039
  const r = y(t, n?.in), s = ot(r, n) - e;
2028
2040
  return r.setDate(r.getDate() - s * 7), r;
2029
2041
  }
2030
- class lr extends m {
2042
+ class fr extends m {
2031
2043
  priority = 100;
2032
2044
  parse(e, n, r) {
2033
2045
  switch (n) {
@@ -2043,7 +2055,7 @@ class lr extends m {
2043
2055
  return n >= 1 && n <= 53;
2044
2056
  }
2045
2057
  set(e, n, r) {
2046
- return L(dr(e, r));
2058
+ return L(lr(e, r));
2047
2059
  }
2048
2060
  incompatibleTokens = [
2049
2061
  "y",
@@ -2062,7 +2074,7 @@ class lr extends m {
2062
2074
  "T"
2063
2075
  ];
2064
2076
  }
2065
- const fr = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], mr = [
2077
+ const mr = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], hr = [
2066
2078
  31,
2067
2079
  29,
2068
2080
  31,
@@ -2076,7 +2088,7 @@ const fr = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], mr = [
2076
2088
  30,
2077
2089
  31
2078
2090
  ];
2079
- class hr extends m {
2091
+ class wr extends m {
2080
2092
  priority = 90;
2081
2093
  subPriority = 1;
2082
2094
  parse(e, n, r) {
@@ -2091,7 +2103,7 @@ class hr extends m {
2091
2103
  }
2092
2104
  validate(e, n) {
2093
2105
  const r = e.getFullYear(), s = ht(r), a = e.getMonth();
2094
- return s ? n >= 1 && n <= mr[a] : n >= 1 && n <= fr[a];
2106
+ return s ? n >= 1 && n <= hr[a] : n >= 1 && n <= mr[a];
2095
2107
  }
2096
2108
  set(e, n, r) {
2097
2109
  return e.setDate(r), e.setHours(0, 0, 0, 0), e;
@@ -2111,7 +2123,7 @@ class hr extends m {
2111
2123
  "T"
2112
2124
  ];
2113
2125
  }
2114
- class wr extends m {
2126
+ class gr extends m {
2115
2127
  priority = 90;
2116
2128
  subpriority = 1;
2117
2129
  parse(e, n, r) {
@@ -2151,10 +2163,10 @@ class wr extends m {
2151
2163
  ];
2152
2164
  }
2153
2165
  function he(t, e, n) {
2154
- const r = S(), s = n?.weekStartsOn ?? n?.locale?.options?.weekStartsOn ?? r.weekStartsOn ?? r.locale?.options?.weekStartsOn ?? 0, a = y(t, n?.in), o = a.getDay(), c = (e % 7 + 7) % 7, u = 7 - s, d = e < 0 || e > 6 ? e - (o + u) % 7 : (c + u) % 7 - (o + u) % 7;
2166
+ const r = W(), s = n?.weekStartsOn ?? n?.locale?.options?.weekStartsOn ?? r.weekStartsOn ?? r.locale?.options?.weekStartsOn ?? 0, a = y(t, n?.in), o = a.getDay(), c = (e % 7 + 7) % 7, u = 7 - s, d = e < 0 || e > 6 ? e - (o + u) % 7 : (c + u) % 7 - (o + u) % 7;
2155
2167
  return rt(a, d, n);
2156
2168
  }
2157
- class gr extends m {
2169
+ class pr extends m {
2158
2170
  priority = 90;
2159
2171
  parse(e, n, r) {
2160
2172
  switch (n) {
@@ -2190,7 +2202,7 @@ class gr extends m {
2190
2202
  }
2191
2203
  incompatibleTokens = ["D", "i", "e", "c", "t", "T"];
2192
2204
  }
2193
- class pr extends m {
2205
+ class yr extends m {
2194
2206
  priority = 90;
2195
2207
  parse(e, n, r, s) {
2196
2208
  const a = (o) => {
@@ -2256,7 +2268,7 @@ class pr extends m {
2256
2268
  "T"
2257
2269
  ];
2258
2270
  }
2259
- class yr extends m {
2271
+ class br extends m {
2260
2272
  priority = 90;
2261
2273
  parse(e, n, r, s) {
2262
2274
  const a = (o) => {
@@ -2322,11 +2334,11 @@ class yr extends m {
2322
2334
  "T"
2323
2335
  ];
2324
2336
  }
2325
- function br(t, e, n) {
2326
- const r = y(t, n?.in), s = Vn(r, n), a = e - s;
2337
+ function Dr(t, e, n) {
2338
+ const r = y(t, n?.in), s = Xn(r, n), a = e - s;
2327
2339
  return rt(r, a, n);
2328
2340
  }
2329
- class Dr extends m {
2341
+ class Tr extends m {
2330
2342
  priority = 90;
2331
2343
  parse(e, n, r) {
2332
2344
  const s = (a) => a === 0 ? 7 : a;
@@ -2397,7 +2409,7 @@ class Dr extends m {
2397
2409
  return n >= 1 && n <= 7;
2398
2410
  }
2399
2411
  set(e, n, r) {
2400
- return e = br(e, r), e.setHours(0, 0, 0, 0), e;
2412
+ return e = Dr(e, r), e.setHours(0, 0, 0, 0), e;
2401
2413
  }
2402
2414
  incompatibleTokens = [
2403
2415
  "y",
@@ -2417,7 +2429,7 @@ class Dr extends m {
2417
2429
  "T"
2418
2430
  ];
2419
2431
  }
2420
- class Tr extends m {
2432
+ class Er extends m {
2421
2433
  priority = 80;
2422
2434
  parse(e, n, r) {
2423
2435
  switch (n) {
@@ -2454,7 +2466,7 @@ class Tr extends m {
2454
2466
  }
2455
2467
  incompatibleTokens = ["b", "B", "H", "k", "t", "T"];
2456
2468
  }
2457
- class Er extends m {
2469
+ class xr extends m {
2458
2470
  priority = 80;
2459
2471
  parse(e, n, r) {
2460
2472
  switch (n) {
@@ -2491,7 +2503,7 @@ class Er extends m {
2491
2503
  }
2492
2504
  incompatibleTokens = ["a", "B", "H", "k", "t", "T"];
2493
2505
  }
2494
- class xr extends m {
2506
+ class Pr extends m {
2495
2507
  priority = 80;
2496
2508
  parse(e, n, r) {
2497
2509
  switch (n) {
@@ -2528,7 +2540,7 @@ class xr extends m {
2528
2540
  }
2529
2541
  incompatibleTokens = ["a", "b", "t", "T"];
2530
2542
  }
2531
- class Pr extends m {
2543
+ class Mr extends m {
2532
2544
  priority = 70;
2533
2545
  parse(e, n, r) {
2534
2546
  switch (n) {
@@ -2549,7 +2561,7 @@ class Pr extends m {
2549
2561
  }
2550
2562
  incompatibleTokens = ["H", "K", "k", "t", "T"];
2551
2563
  }
2552
- class Mr extends m {
2564
+ class vr extends m {
2553
2565
  priority = 70;
2554
2566
  parse(e, n, r) {
2555
2567
  switch (n) {
@@ -2569,7 +2581,7 @@ class Mr extends m {
2569
2581
  }
2570
2582
  incompatibleTokens = ["a", "b", "h", "K", "k", "t", "T"];
2571
2583
  }
2572
- class vr extends m {
2584
+ class Or extends m {
2573
2585
  priority = 70;
2574
2586
  parse(e, n, r) {
2575
2587
  switch (n) {
@@ -2589,7 +2601,7 @@ class vr extends m {
2589
2601
  }
2590
2602
  incompatibleTokens = ["h", "H", "k", "t", "T"];
2591
2603
  }
2592
- class Or extends m {
2604
+ class Ar extends m {
2593
2605
  priority = 70;
2594
2606
  parse(e, n, r) {
2595
2607
  switch (n) {
@@ -2610,7 +2622,7 @@ class Or extends m {
2610
2622
  }
2611
2623
  incompatibleTokens = ["a", "b", "h", "H", "K", "t", "T"];
2612
2624
  }
2613
- class Ar extends m {
2625
+ class Nr extends m {
2614
2626
  priority = 60;
2615
2627
  parse(e, n, r) {
2616
2628
  switch (n) {
@@ -2630,7 +2642,7 @@ class Ar extends m {
2630
2642
  }
2631
2643
  incompatibleTokens = ["t", "T"];
2632
2644
  }
2633
- class Nr extends m {
2645
+ class kr extends m {
2634
2646
  priority = 50;
2635
2647
  parse(e, n, r) {
2636
2648
  switch (n) {
@@ -2650,7 +2662,7 @@ class Nr extends m {
2650
2662
  }
2651
2663
  incompatibleTokens = ["t", "T"];
2652
2664
  }
2653
- class kr extends m {
2665
+ class Rr extends m {
2654
2666
  priority = 30;
2655
2667
  parse(e, n) {
2656
2668
  const r = (s) => Math.trunc(s * Math.pow(10, -n.length + 3));
@@ -2661,7 +2673,7 @@ class kr extends m {
2661
2673
  }
2662
2674
  incompatibleTokens = ["t", "T"];
2663
2675
  }
2664
- class Rr extends m {
2676
+ class _r extends m {
2665
2677
  priority = 10;
2666
2678
  parse(e, n) {
2667
2679
  switch (n) {
@@ -2694,7 +2706,7 @@ class Rr extends m {
2694
2706
  }
2695
2707
  incompatibleTokens = ["t", "T", "x"];
2696
2708
  }
2697
- class _r extends m {
2709
+ class Ir extends m {
2698
2710
  priority = 10;
2699
2711
  parse(e, n) {
2700
2712
  switch (n) {
@@ -2727,7 +2739,7 @@ class _r extends m {
2727
2739
  }
2728
2740
  incompatibleTokens = ["t", "T", "X"];
2729
2741
  }
2730
- class Ir extends m {
2742
+ class Yr extends m {
2731
2743
  priority = 40;
2732
2744
  parse(e) {
2733
2745
  return ft(e);
@@ -2737,7 +2749,7 @@ class Ir extends m {
2737
2749
  }
2738
2750
  incompatibleTokens = "*";
2739
2751
  }
2740
- class Yr extends m {
2752
+ class Cr extends m {
2741
2753
  priority = 20;
2742
2754
  parse(e) {
2743
2755
  return ft(e);
@@ -2747,126 +2759,126 @@ class Yr extends m {
2747
2759
  }
2748
2760
  incompatibleTokens = "*";
2749
2761
  }
2750
- const Cr = {
2751
- G: new Zn(),
2752
- y: new er(),
2753
- Y: new tr(),
2754
- R: new nr(),
2755
- u: new rr(),
2756
- Q: new sr(),
2757
- q: new ar(),
2758
- M: new or(),
2759
- L: new ir(),
2760
- w: new ur(),
2761
- I: new lr(),
2762
- d: new hr(),
2763
- D: new wr(),
2764
- E: new gr(),
2765
- e: new pr(),
2766
- c: new yr(),
2767
- i: new Dr(),
2768
- a: new Tr(),
2769
- b: new Er(),
2770
- B: new xr(),
2771
- h: new Pr(),
2772
- H: new Mr(),
2773
- K: new vr(),
2774
- k: new Or(),
2775
- m: new Ar(),
2776
- s: new Nr(),
2777
- S: new kr(),
2778
- X: new Rr(),
2779
- x: new _r(),
2780
- t: new Ir(),
2781
- T: new Yr()
2782
- }, Lr = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, Sr = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, Wr = /^'([^]*?)'?$/, $r = /''/g, qr = /\S/, Qr = /[a-zA-Z]/;
2783
- function Fr(t, e, n, r) {
2784
- const s = () => E(n, NaN), a = Gn(), o = a.locale ?? at, i = a.firstWeekContainsDate ?? a.locale?.options?.firstWeekContainsDate ?? 1, c = a.weekStartsOn ?? a.locale?.options?.weekStartsOn ?? 0;
2762
+ const Sr = {
2763
+ G: new er(),
2764
+ y: new tr(),
2765
+ Y: new nr(),
2766
+ R: new rr(),
2767
+ u: new sr(),
2768
+ Q: new ar(),
2769
+ q: new or(),
2770
+ M: new ir(),
2771
+ L: new cr(),
2772
+ w: new dr(),
2773
+ I: new fr(),
2774
+ d: new wr(),
2775
+ D: new gr(),
2776
+ E: new pr(),
2777
+ e: new yr(),
2778
+ c: new br(),
2779
+ i: new Tr(),
2780
+ a: new Er(),
2781
+ b: new xr(),
2782
+ B: new Pr(),
2783
+ h: new Mr(),
2784
+ H: new vr(),
2785
+ K: new Or(),
2786
+ k: new Ar(),
2787
+ m: new Nr(),
2788
+ s: new kr(),
2789
+ S: new Rr(),
2790
+ X: new _r(),
2791
+ x: new Ir(),
2792
+ t: new Yr(),
2793
+ T: new Cr()
2794
+ }, Lr = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, Wr = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, $r = /^'([^]*?)'?$/, qr = /''/g, Qr = /\S/, Fr = /[a-zA-Z]/;
2795
+ function Hr(t, e, n, r) {
2796
+ const s = () => E(n, NaN), a = Vn(), o = a.locale ?? at, i = a.firstWeekContainsDate ?? a.locale?.options?.firstWeekContainsDate ?? 1, c = a.weekStartsOn ?? a.locale?.options?.weekStartsOn ?? 0;
2785
2797
  if (!e)
2786
2798
  return t ? s() : y(n, r?.in);
2787
2799
  const u = {
2788
2800
  firstWeekContainsDate: i,
2789
2801
  weekStartsOn: c,
2790
2802
  locale: o
2791
- }, d = [new Jn(r?.in, n)], l = e.match(Sr).map((f) => {
2803
+ }, d = [new Zn(r?.in, n)], l = e.match(Wr).map((f) => {
2792
2804
  const w = f[0];
2793
2805
  if (w in se) {
2794
- const M = se[w];
2795
- return M(f, o.formatLong);
2806
+ const P = se[w];
2807
+ return P(f, o.formatLong);
2796
2808
  }
2797
2809
  return f;
2798
2810
  }).join("").match(Lr), g = [];
2799
2811
  for (let f of l) {
2800
2812
  dt(f) && ae(f, e, t), ut(f) && ae(f, e, t);
2801
- const w = f[0], M = Cr[w];
2802
- if (M) {
2803
- const { incompatibleTokens: v } = M;
2813
+ const w = f[0], P = Sr[w];
2814
+ if (P) {
2815
+ const { incompatibleTokens: v } = P;
2804
2816
  if (Array.isArray(v)) {
2805
- const $ = g.find(
2806
- (U) => v.includes(U.token) || U.token === w
2817
+ const q = g.find(
2818
+ (B) => v.includes(B.token) || B.token === w
2807
2819
  );
2808
- if ($)
2820
+ if (q)
2809
2821
  throw new RangeError(
2810
- `The format string mustn't contain \`${$.fullToken}\` and \`${f}\` at the same time`
2822
+ `The format string mustn't contain \`${q.fullToken}\` and \`${f}\` at the same time`
2811
2823
  );
2812
- } else if (M.incompatibleTokens === "*" && g.length > 0)
2824
+ } else if (P.incompatibleTokens === "*" && g.length > 0)
2813
2825
  throw new RangeError(
2814
2826
  `The format string mustn't contain \`${f}\` and any other token at the same time`
2815
2827
  );
2816
2828
  g.push({ token: w, fullToken: f });
2817
- const W = M.run(
2829
+ const $ = P.run(
2818
2830
  t,
2819
2831
  f,
2820
2832
  o.match,
2821
2833
  u
2822
2834
  );
2823
- if (!W)
2835
+ if (!$)
2824
2836
  return s();
2825
- d.push(W.setter), t = W.rest;
2837
+ d.push($.setter), t = $.rest;
2826
2838
  } else {
2827
- if (w.match(Qr))
2839
+ if (w.match(Fr))
2828
2840
  throw new RangeError(
2829
2841
  "Format string contains an unescaped latin alphabet character `" + w + "`"
2830
2842
  );
2831
- if (f === "''" ? f = "'" : w === "'" && (f = Hr(f)), t.indexOf(f) === 0)
2843
+ if (f === "''" ? f = "'" : w === "'" && (f = Ur(f)), t.indexOf(f) === 0)
2832
2844
  t = t.slice(f.length);
2833
2845
  else
2834
2846
  return s();
2835
2847
  }
2836
2848
  }
2837
- if (t.length > 0 && qr.test(t))
2849
+ if (t.length > 0 && Qr.test(t))
2838
2850
  return s();
2839
- const x = d.map((f) => f.priority).sort((f, w) => w - f).filter((f, w, M) => M.indexOf(f) === w).map(
2840
- (f) => d.filter((w) => w.priority === f).sort((w, M) => M.subPriority - w.subPriority)
2851
+ const M = d.map((f) => f.priority).sort((f, w) => w - f).filter((f, w, P) => P.indexOf(f) === w).map(
2852
+ (f) => d.filter((w) => w.priority === f).sort((w, P) => P.subPriority - w.subPriority)
2841
2853
  ).map((f) => f[0]);
2842
- let P = y(n, r?.in);
2843
- if (isNaN(+P)) return s();
2844
- const Y = {};
2845
- for (const f of x) {
2846
- if (!f.validate(P, u))
2854
+ let x = y(n, r?.in);
2855
+ if (isNaN(+x)) return s();
2856
+ const N = {};
2857
+ for (const f of M) {
2858
+ if (!f.validate(x, u))
2847
2859
  return s();
2848
- const w = f.set(P, Y, u);
2849
- Array.isArray(w) ? (P = w[0], Object.assign(Y, w[1])) : P = w;
2860
+ const w = f.set(x, N, u);
2861
+ Array.isArray(w) ? (x = w[0], Object.assign(N, w[1])) : x = w;
2850
2862
  }
2851
- return P;
2863
+ return x;
2852
2864
  }
2853
- function Hr(t) {
2854
- return t.match(Wr)[1].replace($r, "'");
2865
+ function Ur(t) {
2866
+ return t.match($r)[1].replace(qr, "'");
2855
2867
  }
2856
- function Ur(t, e) {
2857
- const n = () => E(e?.in, NaN), s = Xr(t);
2868
+ function Br(t, e) {
2869
+ const n = () => E(e?.in, NaN), s = jr(t);
2858
2870
  let a;
2859
2871
  if (s.date) {
2860
- const u = jr(s.date, 2);
2861
- a = Kr(u.restDateString, u.year);
2872
+ const u = Kr(s.date, 2);
2873
+ a = zr(u.restDateString, u.year);
2862
2874
  }
2863
2875
  if (!a || isNaN(+a)) return n();
2864
2876
  const o = +a;
2865
2877
  let i = 0, c;
2866
- if (s.time && (i = zr(s.time), isNaN(i)))
2878
+ if (s.time && (i = Jr(s.time), isNaN(i)))
2867
2879
  return n();
2868
2880
  if (s.timezone) {
2869
- if (c = Jr(s.timezone), isNaN(c)) return n();
2881
+ if (c = Zr(s.timezone), isNaN(c)) return n();
2870
2882
  } else {
2871
2883
  const u = new Date(o + i), d = y(0, e?.in);
2872
2884
  return d.setFullYear(
@@ -2882,26 +2894,26 @@ function Ur(t, e) {
2882
2894
  }
2883
2895
  return y(o + i + c, e?.in);
2884
2896
  }
2885
- const G = {
2897
+ const V = {
2886
2898
  dateTimeDelimiter: /[T ]/,
2887
2899
  timeZoneDelimiter: /[Z ]/i,
2888
2900
  timezone: /([Z+-].*)$/
2889
- }, Br = /^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/, Gr = /^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/, Vr = /^([+-])(\d{2})(?::?(\d{2}))?$/;
2890
- function Xr(t) {
2891
- const e = {}, n = t.split(G.dateTimeDelimiter);
2901
+ }, Gr = /^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/, Vr = /^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/, Xr = /^([+-])(\d{2})(?::?(\d{2}))?$/;
2902
+ function jr(t) {
2903
+ const e = {}, n = t.split(V.dateTimeDelimiter);
2892
2904
  let r;
2893
2905
  if (n.length > 2)
2894
2906
  return e;
2895
- if (/:/.test(n[0]) ? r = n[0] : (e.date = n[0], r = n[1], G.timeZoneDelimiter.test(e.date) && (e.date = t.split(G.timeZoneDelimiter)[0], r = t.substr(
2907
+ if (/:/.test(n[0]) ? r = n[0] : (e.date = n[0], r = n[1], V.timeZoneDelimiter.test(e.date) && (e.date = t.split(V.timeZoneDelimiter)[0], r = t.substr(
2896
2908
  e.date.length,
2897
2909
  t.length
2898
2910
  ))), r) {
2899
- const s = G.timezone.exec(r);
2911
+ const s = V.timezone.exec(r);
2900
2912
  s ? (e.time = r.replace(s[1], ""), e.timezone = s[1]) : e.time = r;
2901
2913
  }
2902
2914
  return e;
2903
2915
  }
2904
- function jr(t, e) {
2916
+ function Kr(t, e) {
2905
2917
  const n = new RegExp(
2906
2918
  "^(?:(\\d{4}|[+-]\\d{" + (4 + e) + "})|(\\d{2}|[+-]\\d{" + (2 + e) + "})$)"
2907
2919
  ), r = t.match(n);
@@ -2912,84 +2924,84 @@ function jr(t, e) {
2912
2924
  restDateString: t.slice((r[1] || r[2]).length)
2913
2925
  };
2914
2926
  }
2915
- function Kr(t, e) {
2927
+ function zr(t, e) {
2916
2928
  if (e === null) return /* @__PURE__ */ new Date(NaN);
2917
- const n = t.match(Br);
2929
+ const n = t.match(Gr);
2918
2930
  if (!n) return /* @__PURE__ */ new Date(NaN);
2919
- const r = !!n[4], s = F(n[1]), a = F(n[2]) - 1, o = F(n[3]), i = F(n[4]), c = F(n[5]) - 1;
2931
+ const r = !!n[4], s = H(n[1]), a = H(n[2]) - 1, o = H(n[3]), i = H(n[4]), c = H(n[5]) - 1;
2920
2932
  if (r)
2921
- return rs(e, i, c) ? Zr(e, i, c) : /* @__PURE__ */ new Date(NaN);
2933
+ return ss(e, i, c) ? es(e, i, c) : /* @__PURE__ */ new Date(NaN);
2922
2934
  {
2923
2935
  const u = /* @__PURE__ */ new Date(0);
2924
- return !ts(e, a, o) || !ns(e, s) ? /* @__PURE__ */ new Date(NaN) : (u.setUTCFullYear(e, a, Math.max(s, o)), u);
2936
+ return !ns(e, a, o) || !rs(e, s) ? /* @__PURE__ */ new Date(NaN) : (u.setUTCFullYear(e, a, Math.max(s, o)), u);
2925
2937
  }
2926
2938
  }
2927
- function F(t) {
2939
+ function H(t) {
2928
2940
  return t ? parseInt(t) : 1;
2929
2941
  }
2930
- function zr(t) {
2931
- const e = t.match(Gr);
2942
+ function Jr(t) {
2943
+ const e = t.match(Vr);
2932
2944
  if (!e) return NaN;
2933
2945
  const n = ne(e[1]), r = ne(e[2]), s = ne(e[3]);
2934
- return ss(n, r, s) ? n * le + r * de + s * 1e3 : NaN;
2946
+ return as(n, r, s) ? n * le + r * de + s * 1e3 : NaN;
2935
2947
  }
2936
2948
  function ne(t) {
2937
2949
  return t && parseFloat(t.replace(",", ".")) || 0;
2938
2950
  }
2939
- function Jr(t) {
2951
+ function Zr(t) {
2940
2952
  if (t === "Z") return 0;
2941
- const e = t.match(Vr);
2953
+ const e = t.match(Xr);
2942
2954
  if (!e) return 0;
2943
2955
  const n = e[1] === "+" ? -1 : 1, r = parseInt(e[2]), s = e[3] && parseInt(e[3]) || 0;
2944
- return as(r, s) ? n * (r * le + s * de) : NaN;
2956
+ return os(r, s) ? n * (r * le + s * de) : NaN;
2945
2957
  }
2946
- function Zr(t, e, n) {
2958
+ function es(t, e, n) {
2947
2959
  const r = /* @__PURE__ */ new Date(0);
2948
2960
  r.setUTCFullYear(t, 0, 4);
2949
2961
  const s = r.getUTCDay() || 7, a = (e - 1) * 7 + n + 1 - s;
2950
2962
  return r.setUTCDate(r.getUTCDate() + a), r;
2951
2963
  }
2952
- const es = [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
2964
+ const ts = [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
2953
2965
  function wt(t) {
2954
2966
  return t % 400 === 0 || t % 4 === 0 && t % 100 !== 0;
2955
2967
  }
2956
- function ts(t, e, n) {
2957
- return e >= 0 && e <= 11 && n >= 1 && n <= (es[e] || (wt(t) ? 29 : 28));
2968
+ function ns(t, e, n) {
2969
+ return e >= 0 && e <= 11 && n >= 1 && n <= (ts[e] || (wt(t) ? 29 : 28));
2958
2970
  }
2959
- function ns(t, e) {
2971
+ function rs(t, e) {
2960
2972
  return e >= 1 && e <= (wt(t) ? 366 : 365);
2961
2973
  }
2962
- function rs(t, e, n) {
2974
+ function ss(t, e, n) {
2963
2975
  return e >= 1 && e <= 53 && n >= 0 && n <= 6;
2964
2976
  }
2965
- function ss(t, e, n) {
2977
+ function as(t, e, n) {
2966
2978
  return t === 24 ? e === 0 && n === 0 : n >= 0 && n < 60 && e >= 0 && e < 60 && t >= 0 && t < 25;
2967
2979
  }
2968
- function as(t, e) {
2980
+ function os(t, e) {
2969
2981
  return e >= 0 && e <= 59;
2970
2982
  }
2971
- const V = (t) => {
2983
+ const X = (t) => {
2972
2984
  if (!t.includes("T")) {
2973
- for (const n of os) {
2974
- const r = Fr(t, n, /* @__PURE__ */ new Date());
2985
+ for (const n of is) {
2986
+ const r = Hr(t, n, /* @__PURE__ */ new Date());
2975
2987
  if (re(r))
2976
2988
  return r;
2977
2989
  }
2978
2990
  return null;
2979
2991
  }
2980
- const e = Ur(t);
2992
+ const e = Br(t);
2981
2993
  return re(e) ? e : null;
2982
- }, os = ["yyyy-MM-dd", "MM-dd-yyyy"], oe = (t, e, n) => {
2994
+ }, is = ["yyyy-MM-dd", "MM-dd-yyyy"], oe = (t, e, n) => {
2983
2995
  const r = {};
2984
- return e?.contentType !== null && (r[Ht] = e?.contentType || Ft), e?.jwt && (r.Authorization = `Bearer ${e.jwt}`), e?.chatReference && (r[Ut] = e.chatReference), { ...r, ...n };
2985
- }, is = (t) => {
2996
+ return e?.contentType !== null && (r[Ut] = e?.contentType || Ht), e?.jwt && (r.Authorization = `Bearer ${e.jwt}`), e?.chatReference && (r[Bt] = e.chatReference), { ...r, ...n };
2997
+ }, cs = (t) => {
2986
2998
  const e = { ...t };
2987
2999
  return e[ee] && (e[ee] = e[ee].substring(0, 8) + "...[REDACTED]"), e.Authorization && (e.Authorization = "Bearer [REDACTED]"), e[j] && (e[j] = e[j].substring(0, 8) + "...[REDACTED]"), e;
2988
3000
  }, qe = async (t, e, n) => await fetch(t, {
2989
3001
  method: n.method || "GET",
2990
3002
  headers: e,
2991
3003
  body: n.body ? JSON.stringify(n.body) : void 0
2992
- }), cs = async (t, e, n) => {
3004
+ }), us = async (t, e, n) => {
2993
3005
  const r = n?.body === void 0 ? void 0 : n?.isFormData ? n.body : JSON.stringify(n.body);
2994
3006
  return await fetch(t, {
2995
3007
  method: n.method,
@@ -2998,7 +3010,7 @@ const V = (t) => {
2998
3010
  signal: n?.signal
2999
3011
  });
3000
3012
  };
3001
- class us {
3013
+ class ds {
3002
3014
  constructor() {
3003
3015
  this.decoder = new TextDecoder();
3004
3016
  }
@@ -3019,7 +3031,7 @@ class us {
3019
3031
  async initializeStreamRequest(e, n, r, s) {
3020
3032
  const a = oe(void 0, {
3021
3033
  jwt: s
3022
- }), o = await cs(
3034
+ }), o = await us(
3023
3035
  e,
3024
3036
  {
3025
3037
  Accept: "text/event-stream",
@@ -3094,8 +3106,8 @@ class us {
3094
3106
  }
3095
3107
  }
3096
3108
  }
3097
- new us();
3098
- class $a {
3109
+ new ds();
3110
+ class qa {
3099
3111
  constructor(e) {
3100
3112
  this.config = e, console.info("SdmxApiClient initialized", {
3101
3113
  apiUrl: e.apiUrl || "NOT SET"
@@ -3107,41 +3119,42 @@ class $a {
3107
3119
  async postRequest(e, n, r) {
3108
3120
  return this.request(e, { ...n, method: "POST" }, r);
3109
3121
  }
3110
- async streamRequest(e, n, r) {
3111
- const s = `${this.config.apiUrl}/${e}`, a = {
3122
+ async streamRequest(e, n, r, s) {
3123
+ const a = `${this.config.apiUrl}/${e}`, o = {
3112
3124
  ...oe(void 0, {
3113
3125
  jwt: this.config.jwt
3114
3126
  }),
3115
3127
  ...n.headers
3116
3128
  };
3117
- this.config.apiKey != null && (a[j] = this.config.apiKey);
3118
- const o = new ReadableStream({
3119
- async start(c) {
3129
+ this.config.apiKey != null && (o[j] = this.config.apiKey);
3130
+ const i = new ReadableStream({
3131
+ async start(u) {
3120
3132
  try {
3121
- const u = await qe(s, a, n);
3122
- if (!u.ok) {
3123
- const x = await u.text();
3133
+ const d = await qe(a, o, n);
3134
+ if (!d.ok) {
3135
+ const x = await d.text();
3124
3136
  throw console.error(
3125
- `Fetch failed! Status: ${u.status}, Body: ${x}`
3126
- ), new Error(`Fetch failed with status ${u.status}`);
3137
+ `Fetch failed! Status: ${d.status}, Body: ${x}`
3138
+ ), new Error(`Fetch failed with status ${d.status}`);
3127
3139
  }
3128
- const d = u.body?.getReader();
3129
- if (!d) throw new Error("Failed to create stream reader");
3130
- const l = new Uint8Array([239, 187, 191]);
3131
- c.enqueue(l);
3132
- const g = async () => {
3133
- const { done: x, value: P } = await d.read();
3134
- x ? c.close() : (c.enqueue(P), await g());
3140
+ const l = d.body?.getReader();
3141
+ if (!l) throw new Error("Failed to create stream reader");
3142
+ const g = new Uint8Array([239, 187, 191]);
3143
+ u.enqueue(g);
3144
+ const M = async () => {
3145
+ const { done: x, value: N } = await l.read();
3146
+ x ? u.close() : (u.enqueue(N), await M());
3135
3147
  };
3136
- g();
3137
- } catch (u) {
3138
- c.error(u);
3148
+ M();
3149
+ } catch (d) {
3150
+ u.error(d);
3139
3151
  }
3140
3152
  }
3141
- }), i = new Headers({
3142
- "Content-Disposition": `attachment; filename=${encodeURIComponent(r)}`
3153
+ }), c = new Headers({
3154
+ "Content-Disposition": `attachment; filename=${encodeURIComponent(r)}`,
3155
+ ...s ? { "Content-Type": s } : {}
3143
3156
  });
3144
- return new Response(o, { headers: i });
3157
+ return new Response(i, { headers: c });
3145
3158
  }
3146
3159
  async request(e, n, r) {
3147
3160
  const s = Date.now(), a = `${r || this.config.apiUrl}/${e}`, o = {
@@ -3172,7 +3185,7 @@ class $a {
3172
3185
  }
3173
3186
  if (!i.ok) {
3174
3187
  this.addErrorRequestLog(a, n, i, c, u);
3175
- const l = Qt(u, i);
3188
+ const l = Ft(u, i);
3176
3189
  throw new Error(`API request failed: ${l}`);
3177
3190
  }
3178
3191
  return u;
@@ -3190,7 +3203,7 @@ class $a {
3190
3203
  const a = {
3191
3204
  method: r.method || "GET",
3192
3205
  url: n,
3193
- headers: is(s)
3206
+ headers: cs(s)
3194
3207
  };
3195
3208
  r.body && (a.body = r.body), console.info(e, a);
3196
3209
  }
@@ -3216,9 +3229,9 @@ class $a {
3216
3229
  });
3217
3230
  }
3218
3231
  }
3219
- const qa = ["FREQ", "FREQUENCY"], ds = "TIME_PERIOD", ls = "time_period_start", fs = "time_period_end";
3220
- var ms = /* @__PURE__ */ ((t) => (t.CONDITIONAL = "Conditional", t.MANDATORY = "Mandatory", t))(ms || {}), we = /* @__PURE__ */ ((t) => (t.DIMENSION = "Dimension", t.MEASURE_DIMENSION = "MeasureDimension", t.TIME_DIMENSION = "TimeDimension", t))(we || {}), hs = /* @__PURE__ */ ((t) => (t.UNBOUNDED = "unbounded", t))(hs || {});
3221
- const ws = (t, e) => {
3232
+ const Qa = ["FREQ", "FREQUENCY"], ls = "TIME_PERIOD", fs = "time_period_start", ms = "time_period_end";
3233
+ var hs = /* @__PURE__ */ ((t) => (t.CONDITIONAL = "Conditional", t.MANDATORY = "Mandatory", t))(hs || {}), we = /* @__PURE__ */ ((t) => (t.DIMENSION = "Dimension", t.MEASURE_DIMENSION = "MeasureDimension", t.TIME_DIMENSION = "TimeDimension", t))(we || {}), ws = /* @__PURE__ */ ((t) => (t.UNBOUNDED = "unbounded", t))(ws || {});
3234
+ const gs = (t, e) => {
3222
3235
  const n = t?.data?.dataSets?.[0], s = t?.data?.structures?.[0]?.attributes?.dimensionGroup || [], a = n?.dimensionGroupAttributes, o = {};
3223
3236
  for (const i of s) {
3224
3237
  const c = i.relationship.dimensions, { codedSeriesKey: u, decodedSeriesKey: d } = gt(
@@ -3247,7 +3260,7 @@ const ws = (t, e) => {
3247
3260
  codedSeriesKey: a.join(":"),
3248
3261
  decodedSeriesKey: o.join(":")
3249
3262
  };
3250
- }, Qa = (t, e, n) => {
3263
+ }, Fa = (t, e, n) => {
3251
3264
  const r = t?.data?.dataSets?.[0], s = t?.data?.structures?.[0], a = (s?.attributes?.dimensionGroup || []).filter(
3252
3265
  (l) => l.relationship.dimensions?.length === 1 && l.relationship.dimensions.includes(e || "")
3253
3266
  ), o = r?.dimensionGroupAttributes, i = [
@@ -3257,34 +3270,34 @@ const ws = (t, e) => {
3257
3270
  u[c] = n || "";
3258
3271
  const d = {};
3259
3272
  for (const l of a) {
3260
- const g = l.relationship.dimensions, { codedSeriesKey: x, decodedSeriesKey: P } = gt(
3273
+ const g = l.relationship.dimensions, { codedSeriesKey: M, decodedSeriesKey: x } = gt(
3261
3274
  t,
3262
3275
  u,
3263
3276
  g
3264
3277
  );
3265
3278
  d[l.id] = {
3266
- values: o?.[x] || [],
3267
- decodedSeriesKey: P,
3268
- codedSeriesKey: x
3279
+ values: o?.[M] || [],
3280
+ decodedSeriesKey: x,
3281
+ codedSeriesKey: M
3269
3282
  };
3270
3283
  }
3271
3284
  return d;
3272
- }, gs = (t, e) => {
3285
+ }, ps = (t, e) => {
3273
3286
  if (e == null)
3274
3287
  return;
3275
3288
  const n = t.values?.[e];
3276
3289
  return n ?? (e instanceof Array ? { values: e } : { value: e.toString() });
3277
- }, ps = "Observation", Fa = (t) => {
3290
+ }, ys = "Observation", Ha = (t) => {
3278
3291
  const e = t?.data?.dataSets, n = t?.data?.structures?.[0];
3279
3292
  if (!e || !n)
3280
3293
  return [];
3281
3294
  const r = n.attributes, s = n.dimensions, a = r?.dimensionGroup || [], o = e[0].series || e[0].observations, i = s.series?.length ? s.series : s.observation, c = [];
3282
3295
  for (const u in o) {
3283
- const d = [], { name: l, parsedTimeSeriesValue: g } = ys(
3296
+ const d = [], { name: l, parsedTimeSeriesValue: g } = bs(
3284
3297
  u,
3285
3298
  i
3286
- ), x = o[u], P = x.attributes || [];
3287
- if (Object.keys(x).length === 0) {
3299
+ ), M = o[u], x = M.attributes || [];
3300
+ if (Object.keys(M).length === 0) {
3288
3301
  c.push({
3289
3302
  name: l,
3290
3303
  parsedTimeSeriesValue: g,
@@ -3295,39 +3308,39 @@ const ws = (t, e) => {
3295
3308
  continue;
3296
3309
  }
3297
3310
  d.push(
3298
- ...Es(x, n)
3311
+ ...xs(M, n)
3299
3312
  );
3300
- const Y = ie(
3313
+ const N = ie(
3301
3314
  r?.series || [],
3302
- (v) => P[v]
3303
- ), f = xs(
3315
+ (v) => x[v]
3316
+ ), f = Ps(
3304
3317
  n.attributes?.dataSet || [],
3305
3318
  e[0].attributes?.filter((v) => v != null) || []
3306
- ), w = ws(
3319
+ ), w = gs(
3307
3320
  t,
3308
3321
  g
3309
- ), M = a.map((v, W) => {
3310
- const $ = w[v.id], U = gs(
3322
+ ), P = a.map((v, $) => {
3323
+ const q = w[v.id], B = ps(
3311
3324
  v,
3312
- $.values[W]
3325
+ q.values[$]
3313
3326
  );
3314
3327
  return {
3315
3328
  attribute: v,
3316
- dimensionGroupValue: U,
3317
- dimensionGroupData: $
3329
+ dimensionGroupValue: B,
3330
+ dimensionGroupData: q
3318
3331
  };
3319
3332
  });
3320
3333
  c.push({
3321
3334
  name: l,
3322
3335
  parsedTimeSeriesValue: g,
3323
3336
  values: d,
3324
- attributes: Y,
3337
+ attributes: N,
3325
3338
  dataSetAttrs: f,
3326
- dimensionGroupAttributes: M
3339
+ dimensionGroupAttributes: P
3327
3340
  });
3328
3341
  }
3329
3342
  return c;
3330
- }, ys = (t, e) => {
3343
+ }, bs = (t, e) => {
3331
3344
  const n = t.split(new RegExp("(?<!\\|):(?!\\||$)")), r = [];
3332
3345
  for (let s = 0; s < n.length; s++) {
3333
3346
  const a = e?.[s], o = Number(n[s]);
@@ -3341,23 +3354,23 @@ const ws = (t, e) => {
3341
3354
  r.push(i?.id || i?.value || "");
3342
3355
  }
3343
3356
  return {
3344
- name: Ds(r),
3357
+ name: Ts(r),
3345
3358
  parsedTimeSeriesValue: r
3346
3359
  };
3347
3360
  }, ie = (t, e) => {
3348
3361
  const n = [];
3349
3362
  for (let r = 0; r < t.length; r++) {
3350
- const s = t[r], a = e(r), o = a != null && s.values != null ? bs(a, s) : void 0;
3363
+ const s = t[r], a = e(r), o = a != null && s.values != null ? Ds(a, s) : void 0;
3351
3364
  n.push({
3352
3365
  name: s.id,
3353
3366
  value: o
3354
3367
  });
3355
3368
  }
3356
3369
  return n;
3357
- }, bs = (t, e) => {
3370
+ }, Ds = (t, e) => {
3358
3371
  const n = e.values[t];
3359
3372
  return n == null ? typeof t == "object" ? t : t.toString() : n?.id || n?.value || n?.ids || n?.values;
3360
- }, Ds = (t) => t.map((e) => e ? Ts(e) : "").join("."), Ts = (t) => t.replace(/\./g, "|.").replace(/:/g, "|:"), Es = (t, e) => {
3373
+ }, Ts = (t) => t.map((e) => e ? Es(e) : "").join("."), Es = (t) => t.replace(/\./g, "|.").replace(/:/g, "|:"), xs = (t, e) => {
3361
3374
  const n = e.measures?.observation?.length;
3362
3375
  if (t.observations == null)
3363
3376
  return [
@@ -3367,7 +3380,7 @@ const ws = (t, e) => {
3367
3380
  e.attributes?.observation || [],
3368
3381
  (o) => t[o + n]
3369
3382
  ),
3370
- dimensionAtObservation: ps
3383
+ dimensionAtObservation: ys
3371
3384
  }
3372
3385
  ];
3373
3386
  const r = t.observations, s = e.dimensions.observation?.[0], a = [];
@@ -3386,19 +3399,19 @@ const ws = (t, e) => {
3386
3399
  });
3387
3400
  }
3388
3401
  return a;
3389
- }, Qe = (t, e) => e?.observation?.map((n, r) => ({ name: n.id, value: t[r] })) || [], xs = (t, e) => t.reduce(
3402
+ }, Qe = (t, e) => e?.observation?.map((n, r) => ({ name: n.id, value: t[r] })) || [], Ps = (t, e) => t.reduce(
3390
3403
  (n, r, s) => {
3391
3404
  const a = e[s];
3392
- return Ps(n, r, a, ""), n;
3405
+ return Ms(n, r, a, ""), n;
3393
3406
  },
3394
3407
  []
3395
- ), Ps = (t, e, n, r) => {
3408
+ ), Ms = (t, e, n, r) => {
3396
3409
  const s = n != null ? e?.values?.length > 0 ? e.values[n]?.id || e.values[n]?.value : String(n) : r;
3397
3410
  t.push({
3398
3411
  name: e.id,
3399
3412
  value: s || ""
3400
3413
  });
3401
- }, Ms = /^[0-9][0-9][0-9][0-9]-Q[1-4]$/, vs = /^[0-9][0-9][0-9][0-9]-W[0-9][0-9]?$/, Os = /^[0-9][0-9][0-9][0-9]-S[1-2]$/, As = /^[0-9][0-9][0-9][0-9]$/, Ns = /^[0-9][0-9][0-9][0-9]-(0[1-9]|1[0-2])-[0-9][0-9]$/, ks = /^[0-9][0-9][0-9][0-9]-M(0[1-9]|(1[0-2]))$/, ge = (t) => As.exec(t), pe = (t) => !!ge(t), Rs = (t) => Os.exec(t), ye = (t) => !!Rs(t), be = (t) => ks.exec(t), De = (t) => !!be(t), Te = (t) => Ms.exec(t), Ee = (t) => !!Te(t), _s = (t) => Ns.exec(t), Is = (t) => !!_s(t), Ys = (t) => vs.exec(t), xe = (t) => !!Ys(t), Pe = 1440 * 60 * 1e3, Me = 7 * Pe;
3414
+ }, vs = /^[0-9][0-9][0-9][0-9]-Q[1-4]$/, Os = /^[0-9][0-9][0-9][0-9]-W[0-9][0-9]?$/, As = /^[0-9][0-9][0-9][0-9]-S[1-2]$/, Ns = /^[0-9][0-9][0-9][0-9]$/, ks = /^[0-9][0-9][0-9][0-9]-(0[1-9]|1[0-2])-[0-9][0-9]$/, Rs = /^[0-9][0-9][0-9][0-9]-M(0[1-9]|(1[0-2]))$/, ge = (t) => Ns.exec(t), pe = (t) => !!ge(t), _s = (t) => As.exec(t), ye = (t) => !!_s(t), be = (t) => Rs.exec(t), De = (t) => !!be(t), Te = (t) => vs.exec(t), Ee = (t) => !!Te(t), Is = (t) => ks.exec(t), Ys = (t) => !!Is(t), Cs = (t) => Os.exec(t), xe = (t) => !!Cs(t), Pe = 1440 * 60 * 1e3, Me = 7 * Pe;
3402
3415
  function ve(t) {
3403
3416
  const e = `${t}-01-01`, n = new Date(e);
3404
3417
  if (n.getDay() !== 4) {
@@ -3407,7 +3420,7 @@ function ve(t) {
3407
3420
  }
3408
3421
  return n;
3409
3422
  }
3410
- function Cs(t) {
3423
+ function Ss(t) {
3411
3424
  const e = new Date(t), r = -((e.getDay() + 6) % 7) + 3;
3412
3425
  return e.setDate(e.getDate() + r), new Date(e.valueOf());
3413
3426
  }
@@ -3422,7 +3435,7 @@ function pt(t, e, n = "W") {
3422
3435
  return `${t}-${n}${e < 10 ? "0" + e : e}`;
3423
3436
  }
3424
3437
  function Z(t, e = "W") {
3425
- const n = Cs(t), r = n.getFullYear(), s = ve(r), a = 1 + Math.ceil(
3438
+ const n = Ss(t), r = n.getFullYear(), s = ve(r), a = 1 + Math.ceil(
3426
3439
  (n.getTime() - s.getTime()) / Me
3427
3440
  );
3428
3441
  return {
@@ -3435,27 +3448,27 @@ function Ls(t) {
3435
3448
  const [e, n] = t.split("-W"), s = ve(+e).getTime() + (+n - 1) * Me - 3 * Pe;
3436
3449
  return new Date(s);
3437
3450
  }
3438
- function Ss(t) {
3451
+ function Ws(t) {
3439
3452
  const [e, n] = t.split("-W"), s = ve(+e).getTime() + (+n - 1) * Me + 3 * Pe;
3440
3453
  return new Date(s);
3441
3454
  }
3442
3455
  function yt(t) {
3443
- return pe(t) ? Ws(t) : ye(t) ? qs(t) : Ee(t) ? Fs(t) : De(t) ? Us(t) : xe(t) ? Ls(t) : Gs(t);
3456
+ return pe(t) ? $s(t) : ye(t) ? Qs(t) : Ee(t) ? Hs(t) : De(t) ? Bs(t) : xe(t) ? Ls(t) : Vs(t);
3444
3457
  }
3445
3458
  function bt(t) {
3446
- return pe(t) ? $s(t) : ye(t) ? Qs(t) : Ee(t) ? Hs(t) : De(t) ? Bs(t) : xe(t) ? Ss(t) : Vs(t);
3459
+ return pe(t) ? qs(t) : ye(t) ? Fs(t) : Ee(t) ? Us(t) : De(t) ? Gs(t) : xe(t) ? Ws(t) : Xs(t);
3447
3460
  }
3448
- function Ws(t) {
3461
+ function $s(t) {
3449
3462
  const e = ge(t);
3450
3463
  if (e)
3451
3464
  return new Date(Number(e[0]), 0, 1);
3452
3465
  }
3453
- function $s(t) {
3466
+ function qs(t) {
3454
3467
  const e = ge(t);
3455
3468
  if (e)
3456
3469
  return new Date(Number(e[0]) + 1, 0, 1);
3457
3470
  }
3458
- function qs(t) {
3471
+ function Qs(t) {
3459
3472
  const [e, n] = t.split("-S");
3460
3473
  switch (+n) {
3461
3474
  case 1:
@@ -3464,7 +3477,7 @@ function qs(t) {
3464
3477
  return new Date(+e, 6, 1);
3465
3478
  }
3466
3479
  }
3467
- function Qs(t) {
3480
+ function Fs(t) {
3468
3481
  const [e, n] = t.split("-S");
3469
3482
  switch (+n) {
3470
3483
  case 1:
@@ -3473,7 +3486,7 @@ function Qs(t) {
3473
3486
  return new Date(+e + 1, 0, 1);
3474
3487
  }
3475
3488
  }
3476
- function Fs(t) {
3489
+ function Hs(t) {
3477
3490
  const e = Te(t);
3478
3491
  if (!e)
3479
3492
  return;
@@ -3489,7 +3502,7 @@ function Fs(t) {
3489
3502
  return new Date(+n, 9, 1);
3490
3503
  }
3491
3504
  }
3492
- function Hs(t) {
3505
+ function Us(t) {
3493
3506
  const e = Te(t);
3494
3507
  if (!e)
3495
3508
  return;
@@ -3505,45 +3518,45 @@ function Hs(t) {
3505
3518
  return new Date(+n + 1, 0, 1);
3506
3519
  }
3507
3520
  }
3508
- function Us(t) {
3521
+ function Bs(t) {
3509
3522
  const e = be(t);
3510
3523
  if (!e)
3511
3524
  return;
3512
3525
  const [n, r] = e[0].split("-M");
3513
3526
  return new Date(+n, +r - 1, 1);
3514
3527
  }
3515
- function Bs(t) {
3528
+ function Gs(t) {
3516
3529
  const e = be(t);
3517
3530
  if (!e)
3518
3531
  return;
3519
3532
  const [n, r] = e[0].split("-M");
3520
3533
  return new Date(+n, +r, 1);
3521
3534
  }
3522
- const Gs = (t) => /* @__PURE__ */ new Date(`${t}T00:00:00`), Vs = (t) => {
3535
+ const Vs = (t) => /* @__PURE__ */ new Date(`${t}T00:00:00`), Xs = (t) => {
3523
3536
  const e = /* @__PURE__ */ new Date(`${t}T23:59:00`);
3524
3537
  return e.setMinutes(e.getMinutes() + 1), e;
3525
- }, Xs = 1, js = (t, e, n, r = !0, s = "Q") => {
3526
- const a = [], o = e && e > 3 ? na(e, r) : 1, i = n ? Math.floor((n - 1) / 3) : 4;
3538
+ }, js = 1, Ks = (t, e, n, r = !0, s = "Q") => {
3539
+ const a = [], o = e && e > 3 ? ra(e, r) : 1, i = n ? Math.floor((n - 1) / 3) : 4;
3527
3540
  for (let c = o; c <= i; c++)
3528
3541
  a.push(`${t}-${s}${c}`);
3529
3542
  return a;
3530
- }, Ks = (t, e, n, r = "S") => {
3543
+ }, zs = (t, e, n, r = "S") => {
3531
3544
  const s = [];
3532
3545
  return (e || 1) < 7 && (n || 12) > 6 && s.push(`${t}-${r}1`), n == null && s.push(`${t}-${r}2`), s;
3533
- }, Ha = (t) => Math.ceil(t / 3), Dt = (t, e, n = "M") => `${t}-${n}${e.toString().padStart(2, "0")}`, zs = (t, e, n = "M") => {
3546
+ }, Ua = (t) => Math.ceil(t / 3), Dt = (t, e, n = "M") => `${t}-${n}${e.toString().padStart(2, "0")}`, Js = (t, e, n = "M") => {
3534
3547
  const r = [];
3535
3548
  for (let s = e; s <= 12; s++)
3536
3549
  r.push(Dt(t, s, n));
3537
3550
  return r;
3538
- }, Js = (t, e, n, r = "M") => {
3551
+ }, Zs = (t, e, n, r = "M") => {
3539
3552
  const s = [];
3540
3553
  for (let a = e; a < n; a++)
3541
3554
  s.push(Dt(t, a, r));
3542
3555
  return s;
3543
- }, Zs = (t, e, n, r = "M") => {
3556
+ }, ea = (t, e, n, r = "M") => {
3544
3557
  const s = e || 1, a = n == null, o = n || 12;
3545
- return a ? zs(t, s, r) : Js(t, s, o, r);
3546
- }, Ua = (t, e, n = "M") => {
3558
+ return a ? Js(t, s, r) : Zs(t, s, o, r);
3559
+ }, Ba = (t, e, n = "M") => {
3547
3560
  switch (e) {
3548
3561
  case 0:
3549
3562
  return [
@@ -3572,25 +3585,25 @@ const Gs = (t) => /* @__PURE__ */ new Date(`${t}T00:00:00`), Vs = (t) => {
3572
3585
  default:
3573
3586
  return [];
3574
3587
  }
3575
- }, ea = (t, e) => {
3576
- const n = k(e, !0), r = k(t), s = n.getFullYear(), a = r.getFullYear(), o = n.getTime() <= r.getTime() ? a + Xs - s : 0;
3588
+ }, ta = (t, e) => {
3589
+ const n = R(e, !0), r = R(t), s = n.getFullYear(), a = r.getFullYear(), o = n.getTime() <= r.getTime() ? a + js - s : 0;
3577
3590
  return Array.from({ length: o }, (c, u) => s + u);
3578
- }, k = (t, e = !1) => {
3579
- const n = ta(t, e);
3591
+ }, R = (t, e = !1) => {
3592
+ const n = na(t, e);
3580
3593
  return n ? (n.getTimezoneOffset() > 0 && n.setMinutes(n.getMinutes() + n.getTimezoneOffset()), n) : /* @__PURE__ */ new Date();
3581
- }, ta = (t, e = !1) => {
3594
+ }, na = (t, e = !1) => {
3582
3595
  const n = Number(t);
3583
3596
  return t.toString().length !== 13 ? e ? yt(t) : bt(t) : isNaN(n) ? /* @__PURE__ */ new Date(`${t}T00:00:00.000Z`) : new Date(n);
3584
- }, na = (t, e) => e ? Math.floor((t + 1) / 3) : Math.ceil((t + 1) / 3), Ba = (t, e) => {
3597
+ }, ra = (t, e) => e ? Math.floor((t + 1) / 3) : Math.ceil((t + 1) / 3), Ga = (t, e) => {
3585
3598
  const n = Ue(t) - Ue(e);
3586
3599
  if (n === 0 && t !== e) {
3587
3600
  const r = He(t), s = He(e);
3588
3601
  return r - s;
3589
3602
  }
3590
3603
  return n;
3591
- }, He = (t) => pe(t) ? 6 : ye(t) ? 5 : Ee(t) ? 4 : De(t) ? 3 : xe(t) ? 2 : Is(t) ? 1 : 0, Ue = (t, e = !1) => (e ? yt(t) : bt(t))?.getTime() || 0;
3592
- var Oe = /* @__PURE__ */ ((t) => (t.LAST_UPDATE_AT = "lastUpdatedAt", t.SERIES_COUNT = "series_count", t))(Oe || {}), ra = /* @__PURE__ */ ((t) => (t.C = "c", t))(ra || {}), R = /* @__PURE__ */ ((t) => (t.EQUALS = "eq", t.NOT_EQUALS = "ne", t.LESS = "lt", t.LESS_OR_EQUAL = "le", t.GREATER = "gt", t.GREATER_OR_EQUAL = "ge", t.CONTAINS = "co", t.NOT_CONTAINS = "nc", t.STARTS = "sw", t.ENDS = "ew", t))(R || {}), sa = /* @__PURE__ */ ((t) => (t.BOOLEAN = "Boolean", t.DATE_TIME = "DateTime", t.DECIMAL = "Decimal", t.INTEGER = "Integer", t.OBSERVATION_TIME_PERIOD = "ObservationalTimePeriod", t.STRING = "String", t.TIME = "Time", t.TIME_RANGE = "TimeRange", t.URI = "URI", t))(sa || {}), aa = /* @__PURE__ */ ((t) => (t.ANNUAL = "A", t.QUARTERLY = "Q", t.MONTHLY = "M", t))(aa || {});
3593
- function Ga(t) {
3604
+ }, He = (t) => pe(t) ? 6 : ye(t) ? 5 : Ee(t) ? 4 : De(t) ? 3 : xe(t) ? 2 : Ys(t) ? 1 : 0, Ue = (t, e = !1) => (e ? yt(t) : bt(t))?.getTime() || 0;
3605
+ var Oe = /* @__PURE__ */ ((t) => (t.LAST_UPDATE_AT = "lastUpdatedAt", t.SERIES_COUNT = "series_count", t))(Oe || {}), sa = /* @__PURE__ */ ((t) => (t.C = "c", t))(sa || {}), _ = /* @__PURE__ */ ((t) => (t.EQUALS = "eq", t.NOT_EQUALS = "ne", t.LESS = "lt", t.LESS_OR_EQUAL = "le", t.GREATER = "gt", t.GREATER_OR_EQUAL = "ge", t.CONTAINS = "co", t.NOT_CONTAINS = "nc", t.STARTS = "sw", t.ENDS = "ew", t))(_ || {}), aa = /* @__PURE__ */ ((t) => (t.BOOLEAN = "Boolean", t.DATE_TIME = "DateTime", t.DECIMAL = "Decimal", t.INTEGER = "Integer", t.OBSERVATION_TIME_PERIOD = "ObservationalTimePeriod", t.STRING = "String", t.TIME = "Time", t.TIME_RANGE = "TimeRange", t.URI = "URI", t))(aa || {}), oa = /* @__PURE__ */ ((t) => (t.ANNUAL = "A", t.QUARTERLY = "Q", t.MONTHLY = "M", t))(oa || {});
3606
+ function Va(t) {
3594
3607
  return t?.annotations?.find((e) => {
3595
3608
  if (e.id === Oe.LAST_UPDATE_AT)
3596
3609
  return e;
@@ -3601,28 +3614,28 @@ const Ae = (t, e) => t?.names && t?.names[e] || t?.name, Tt = (t, e, n) => {
3601
3614
  const r = n?.get(t?.parent);
3602
3615
  Tt(r, e, n);
3603
3616
  }
3604
- }, oa = (t, e) => {
3617
+ }, ia = (t, e) => {
3605
3618
  const n = /* @__PURE__ */ new Map(), r = new Map(t?.map((s) => [s.id, s]));
3606
3619
  return e?.forEach((s) => {
3607
3620
  Tt(s, n, r);
3608
3621
  }), Array.from(n?.values());
3609
- }, Va = (t) => {
3622
+ }, Xa = (t) => {
3610
3623
  const e = t?.find(
3611
- (a) => a.id === ls
3612
- ), n = t?.find(
3613
3624
  (a) => a.id === fs
3625
+ ), n = t?.find(
3626
+ (a) => a.id === ms
3614
3627
  ), r = n?.title ? new Date(n?.title) : null;
3615
3628
  return {
3616
3629
  startPeriod: e?.title ? new Date(e?.title) : null,
3617
3630
  endPeriod: r
3618
3631
  };
3619
- }, ia = (t, e) => t.id.localeCompare(e.id), ca = (t, e) => t.memberValue.localeCompare(e.memberValue), ua = (t, e) => {
3632
+ }, ca = (t, e) => t.id.localeCompare(e.id), ua = (t, e) => t.memberValue.localeCompare(e.memberValue), da = (t, e) => {
3620
3633
  const n = new Array(t.length), r = t.map((o, i) => [o, i]);
3621
3634
  r.sort(
3622
- (o, i) => ia(o[0], i[0])
3635
+ (o, i) => ca(o[0], i[0])
3623
3636
  );
3624
3637
  const s = [...e];
3625
- s.sort(ca);
3638
+ s.sort(ua);
3626
3639
  let a = 0;
3627
3640
  for (const o of r) {
3628
3641
  const i = o[0];
@@ -3631,9 +3644,9 @@ const Ae = (t, e) => t?.names && t?.names[e] || t?.name, Tt = (t, e, n) => {
3631
3644
  a < s.length && s[a].memberValue === i.id && (n[o[1]] = o[0]);
3632
3645
  }
3633
3646
  return n.filter((o) => o != null);
3634
- }, da = (t) => !!t?.some((e) => e.parent), Xa = (t, e, n, r, s = []) => {
3647
+ }, la = (t) => !!t?.some((e) => e.parent), ja = (t, e, n, r, s = []) => {
3635
3648
  let a = t || [];
3636
- if (la(n || [], e || "")) {
3649
+ if (fa(n || [], e || "")) {
3637
3650
  const o = (n || [])[0].cubeRegions?.find(
3638
3651
  ({ isIncluded: i }) => i
3639
3652
  );
@@ -3644,55 +3657,55 @@ const Ae = (t, e) => t?.names && t?.names[e] || t?.name, Tt = (t, e, n) => {
3644
3657
  i ? a = a.length === 0 ? (i.selectionValues || []).map(({ memberValue: c }) => ({
3645
3658
  id: c,
3646
3659
  name: c
3647
- })) : ua(a, i.selectionValues) : a = [];
3660
+ })) : da(a, i.selectionValues) : a = [];
3648
3661
  }
3649
3662
  } else s.length !== 0 && (a = a.filter(({ id: o }) => s.includes(o)));
3650
- return da(t) && (a = oa(t, a)), a?.map((o) => ({
3663
+ return la(t) && (a = ia(t, a)), a?.map((o) => ({
3651
3664
  ...o,
3652
3665
  name: r ? Ae(o, r) : o?.name
3653
3666
  }));
3654
- }, la = (t, e) => t != null && t.length > 0 && e != null, fa = (t) => {
3667
+ }, fa = (t, e) => t != null && t.length > 0 && e != null, ma = (t) => {
3655
3668
  const e = [];
3656
3669
  return t?.filters?.forEach((n) => {
3657
- n.componentCode !== ds && e.push({
3670
+ n.componentCode !== ls && e.push({
3658
3671
  componentCode: n.componentCode,
3659
- operator: R.EQUALS,
3672
+ operator: _.EQUALS,
3660
3673
  value: n.values.join(",")
3661
3674
  });
3662
3675
  }), e;
3663
- }, ja = (t) => {
3676
+ }, Ka = (t) => {
3664
3677
  const e = /* @__PURE__ */ new Map();
3665
3678
  return t?.forEach((n) => {
3666
- e.set(n.urn, fa(n));
3679
+ e.set(n.urn, ma(n));
3667
3680
  }), e;
3668
- }, ma = /^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i, Be = (t) => {
3681
+ }, ha = /^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i, Be = (t) => {
3669
3682
  if (typeof t != "string")
3670
3683
  throw new TypeError("Invalid argument expected string");
3671
- const e = t.match(ma);
3684
+ const e = t.match(ha);
3672
3685
  if (!e)
3673
3686
  throw new Error(`Invalid argument not valid semver ('${t}' received)`);
3674
3687
  return e.shift(), e;
3675
3688
  }, Ge = (t) => t === "*" || t === "x" || t === "X", Ve = (t) => {
3676
3689
  const e = parseInt(t, 10);
3677
3690
  return isNaN(e) ? t : e;
3678
- }, ha = (t, e) => typeof t != typeof e ? [String(t), String(e)] : [t, e], wa = (t, e) => {
3691
+ }, wa = (t, e) => typeof t != typeof e ? [String(t), String(e)] : [t, e], ga = (t, e) => {
3679
3692
  if (Ge(t) || Ge(e))
3680
3693
  return 0;
3681
- const [n, r] = ha(Ve(t), Ve(e));
3694
+ const [n, r] = wa(Ve(t), Ve(e));
3682
3695
  return n > r ? 1 : n < r ? -1 : 0;
3683
3696
  }, Xe = (t, e) => {
3684
3697
  for (let n = 0; n < Math.max(t.length, e.length); n++) {
3685
- const r = wa(t[n] || "0", e[n] || "0");
3698
+ const r = ga(t[n] || "0", e[n] || "0");
3686
3699
  if (r !== 0)
3687
3700
  return r;
3688
3701
  }
3689
3702
  return 0;
3690
- }, ga = (t, e) => {
3703
+ }, pa = (t, e) => {
3691
3704
  const n = Be(t), r = Be(e), s = n.pop(), a = r.pop(), o = Xe(n, r);
3692
3705
  return o !== 0 ? o : s && a ? Xe(s.split("."), a.split(".")) : s || a ? s ? -1 : 1 : 0;
3693
- }, pa = (t, e, n) => {
3694
- ya(n);
3695
- const r = ga(t, e);
3706
+ }, ya = (t, e, n) => {
3707
+ ba(n);
3708
+ const r = pa(t, e);
3696
3709
  return Et[n].includes(r);
3697
3710
  }, Et = {
3698
3711
  ">": [1],
@@ -3701,11 +3714,11 @@ const Ae = (t, e) => t?.names && t?.names[e] || t?.name, Tt = (t, e, n) => {
3701
3714
  "<=": [-1, 0],
3702
3715
  "<": [-1],
3703
3716
  "!=": [-1, 1]
3704
- }, je = Object.keys(Et), ya = (t) => {
3717
+ }, je = Object.keys(Et), ba = (t) => {
3705
3718
  if (je.indexOf(t) === -1)
3706
3719
  throw new Error(`Invalid operator, expected one of ${je.join("|")}`);
3707
3720
  }, ce = "+", Ne = (t, e) => {
3708
- const { agency: n, id: r, version: s } = H(t), a = e.filter(
3721
+ const { agency: n, id: r, version: s } = U(t), a = e.filter(
3709
3722
  (c) => c.agencyID === n && c.id === r && !c?.version?.includes(ce)
3710
3723
  );
3711
3724
  if (a.length === 1)
@@ -3714,28 +3727,28 @@ const Ae = (t, e) => t?.names && t?.names[e] || t?.name, Tt = (t, e, n) => {
3714
3727
  return a.find((c) => c.version === s);
3715
3728
  const o = a.map(
3716
3729
  (c) => c.version
3717
- ), i = ba(s, o);
3730
+ ), i = Da(s, o);
3718
3731
  return a.find(
3719
3732
  (c) => c.version === i[0]
3720
3733
  );
3721
- }, ba = (t, e) => {
3722
- const n = Da(t, e);
3723
- return n.length > 0 ? [n[0]] : [];
3724
3734
  }, Da = (t, e) => {
3735
+ const n = Ta(t, e);
3736
+ return n.length > 0 ? [n[0]] : [];
3737
+ }, Ta = (t, e) => {
3725
3738
  const n = [];
3726
3739
  return e.forEach((r) => {
3727
- Ea(t, r) && n.push(r);
3740
+ xa(t, r) && n.push(r);
3728
3741
  }), n;
3729
- }, Ta = (t) => {
3742
+ }, Ea = (t) => {
3730
3743
  const e = t.trim().replace(/\d+\+/, "*"), [n] = e.split("*");
3731
3744
  return new RegExp(`^${n}`);
3732
- }, Ea = (t, e) => {
3745
+ }, xa = (t, e) => {
3733
3746
  const n = t.trim().replace(/\+/, "");
3734
- return Ta(t).test(e) && pa(e, n, ">=");
3747
+ return Ea(t).test(e) && ya(e, n, ">=");
3735
3748
  }, ke = (t, e) => {
3736
- const { concept: n } = xa(t, e);
3749
+ const { concept: n } = Pa(t, e);
3737
3750
  return n;
3738
- }, xa = (t, e) => {
3751
+ }, Pa = (t, e) => {
3739
3752
  if (t == null)
3740
3753
  return {
3741
3754
  concept: void 0,
@@ -3753,7 +3766,7 @@ const Ae = (t, e) => t?.names && t?.names[e] || t?.name, Tt = (t, e, n) => {
3753
3766
  };
3754
3767
  }
3755
3768
  for (const o of e)
3756
- if (Pa(o, s, r, a))
3769
+ if (Ma(o, s, r, a))
3757
3770
  return {
3758
3771
  concept: Ke(o?.concepts || [], n),
3759
3772
  scheme: o
@@ -3762,7 +3775,7 @@ const Ae = (t, e) => t?.names && t?.names[e] || t?.name, Tt = (t, e, n) => {
3762
3775
  concept: void 0,
3763
3776
  scheme: void 0
3764
3777
  };
3765
- }, Ke = (t, e) => t?.find((n) => n.id === e), Pa = (t, e, n, r) => t.id === e && t.agencyID === n && t.version === r, Ka = (t = [], e = [], n) => {
3778
+ }, Ke = (t, e) => t?.find((n) => n.id === e), Ma = (t, e, n, r) => t.id === e && t.agencyID === n && t.version === r, za = (t = [], e = [], n) => {
3766
3779
  const r = n?.conceptIdentity || "", s = ke(r, e), a = K(
3767
3780
  n?.localRepresentation?.enumeration
3768
3781
  ), o = K(
@@ -3770,7 +3783,7 @@ const Ae = (t, e) => t?.names && t?.names[e] || t?.name, Tt = (t, e, n) => {
3770
3783
  ), i = a || o;
3771
3784
  if (i != null)
3772
3785
  return Ne(i, t);
3773
- }, za = (t, e, n, r) => {
3786
+ }, Ja = (t, e, n, r) => {
3774
3787
  const s = e?.find(
3775
3788
  (a) => a?.id === t?.id
3776
3789
  )?.values;
@@ -3778,7 +3791,7 @@ const Ae = (t, e) => t?.names && t?.names[e] || t?.name, Tt = (t, e, n) => {
3778
3791
  ...a,
3779
3792
  name: r ? Ae(a, r) : a?.name
3780
3793
  })) || [];
3781
- }, Ma = (t, e) => {
3794
+ }, va = (t, e) => {
3782
3795
  const n = e?.dataStructureComponents?.attributeList, r = t?.metadataStructureComponents?.metadataAttributeList;
3783
3796
  return n?.metadataAttributeUsages?.map((s) => {
3784
3797
  const a = r?.metadataAttributes?.find(
@@ -3790,30 +3803,30 @@ const Ae = (t, e) => t?.names && t?.names[e] || t?.name, Tt = (t, e, n) => {
3790
3803
  isMandatory: Number(a?.minOccurs) > 0
3791
3804
  };
3792
3805
  });
3793
- }, Ja = (t = [], e, n) => {
3806
+ }, Za = (t = [], e, n) => {
3794
3807
  const r = K(e?.conceptIdentity) || "", s = ke(r, t);
3795
3808
  return n ? Ae(s, n) : s?.name ?? s?.id ?? e?.id;
3796
3809
  };
3797
3810
  function ze(t) {
3798
3811
  return t?.dataStructures?.[0]?.dataStructureComponents?.dimensionList;
3799
3812
  }
3800
- function Za(t) {
3813
+ function eo(t) {
3801
3814
  return t?.data?.structures?.[0]?.dimensions?.series || [];
3802
3815
  }
3803
- function eo(t) {
3816
+ function to(t) {
3804
3817
  return t?.data?.structures?.[0]?.dimensions?.observation?.[0].values.map((e) => e.value).filter((e) => e != null) || [];
3805
3818
  }
3806
- function to(t) {
3819
+ function no(t) {
3807
3820
  return t.find(
3808
3821
  (e) => e.type === we.TIME_DIMENSION
3809
3822
  );
3810
3823
  }
3811
- const no = (t) => {
3824
+ const ro = (t) => {
3812
3825
  const e = /* @__PURE__ */ new Map(), n = t?.dataStructures?.[0], r = t?.metadataStructures?.[0], s = t?.conceptSchemes || [], a = t?.codelists || [];
3813
3826
  return t && [
3814
3827
  ...ze(t)?.dimensions || [],
3815
3828
  ...ze(t)?.timeDimensions || [],
3816
- ...Ma(r, n),
3829
+ ...va(r, n),
3817
3830
  ...n?.dataStructureComponents?.attributeList?.attributes || []
3818
3831
  ].forEach(
3819
3832
  (i) => {
@@ -3835,9 +3848,9 @@ const no = (t) => {
3835
3848
  }));
3836
3849
  }
3837
3850
  ), e;
3838
- }, ro = (t) => t?.find(
3851
+ }, so = (t) => t?.find(
3839
3852
  (e) => e.id === Oe.SERIES_COUNT
3840
- )?.title || "", va = "/api/download", so = (t, e, n, r, s, a, o) => {
3853
+ )?.title || "", Oa = "/api/download", ao = (t, e, n, r, s, a, o) => {
3841
3854
  const i = new URLSearchParams({
3842
3855
  urn: t,
3843
3856
  format: e,
@@ -3847,35 +3860,35 @@ const no = (t) => {
3847
3860
  attribute: r,
3848
3861
  language: n,
3849
3862
  isMetadata: o ? "true" : "none"
3850
- }).toString(), c = `${va}?${i}`;
3863
+ }).toString(), c = `${Oa}?${i}`;
3851
3864
  window.open(c, "_blank");
3852
- }, ao = (t, e) => {
3865
+ }, oo = (t, e) => {
3853
3866
  const n = [];
3854
3867
  for (const r of t) {
3855
3868
  if (r.type !== we.DIMENSION)
3856
3869
  continue;
3857
3870
  const s = e.find((a) => a.componentCode === r.id);
3858
- s != null && s.values?.length > 0 ? n.push(s.values?.join(Wt)) : n.push("*");
3871
+ s != null && s.values?.length > 0 ? n.push(s.values?.join($t)) : n.push("*");
3859
3872
  }
3860
3873
  return n.join(".");
3861
- }, Oa = (t, e) => {
3874
+ }, Aa = (t, e) => {
3862
3875
  if (!t || !t.startPeriod && !t.endPeriod)
3863
3876
  return null;
3864
3877
  const n = [], { startPeriod: r, endPeriod: s } = t;
3865
3878
  if (r && n.push(
3866
- `${R.GREATER_OR_EQUAL}${Re}${Je(r)}`
3879
+ `${_.GREATER_OR_EQUAL}${Re}${Je(r)}`
3867
3880
  ), s && n.push(
3868
- `${R.LESS_OR_EQUAL}${Re}${Je(s)}`
3881
+ `${_.LESS_OR_EQUAL}${Re}${Je(s)}`
3869
3882
  ), n.length === 0)
3870
3883
  return null;
3871
3884
  const a = e;
3872
3885
  return n.map(
3873
- (o) => `${encodeURIComponent(`c[${a}]`)}${St}${encodeURIComponent(o)}`
3886
+ (o) => `${encodeURIComponent(`c[${a}]`)}${Wt}${encodeURIComponent(o)}`
3874
3887
  ).join(tt);
3875
- }, Je = (t) => Un(t, "yyyy-MM-dd"), oo = (t, e) => {
3876
- const n = Aa(t, e) || null;
3877
- return n ? Oa(n, e?.id) : null;
3878
- }, Aa = (t, e) => {
3888
+ }, Je = (t) => Bn(t, "yyyy-MM-dd"), io = (t, e) => {
3889
+ const n = Na(t, e) || null;
3890
+ return n ? Aa(n, e?.id) : null;
3891
+ }, Na = (t, e) => {
3879
3892
  const n = e.id, r = t?.filters?.find(
3880
3893
  (c) => c.componentCode === n
3881
3894
  );
@@ -3885,19 +3898,19 @@ const no = (t) => {
3885
3898
  if (!s.length)
3886
3899
  return null;
3887
3900
  const a = r.operator;
3888
- if (a === R.LESS_OR_EQUAL || a === R.LESS)
3889
- return { startPeriod: null, endPeriod: V(s[0]) };
3890
- if (a === R.GREATER_OR_EQUAL || a === R.GREATER)
3891
- return { startPeriod: V(s[0]), endPeriod: null };
3892
- const o = V(s[0]), i = V(s[1]);
3901
+ if (a === _.LESS_OR_EQUAL || a === _.LESS)
3902
+ return { startPeriod: null, endPeriod: X(s[0]) };
3903
+ if (a === _.GREATER_OR_EQUAL || a === _.GREATER)
3904
+ return { startPeriod: X(s[0]), endPeriod: null };
3905
+ const o = X(s[0]), i = X(s[1]);
3893
3906
  return { startPeriod: o, endPeriod: i };
3894
3907
  }, xt = (t, e, n) => {
3895
- const r = k(e, !0), s = k(n), a = k(t, !0), o = k(t), i = r.getTime() > a.getTime() ? r : a, c = s.getTime() < o.getTime() ? s : o;
3908
+ const r = R(e, !0), s = R(n), a = R(t, !0), o = R(t), i = r.getTime() > a.getTime() ? r : a, c = s.getTime() < o.getTime() ? s : o;
3896
3909
  return {
3897
3910
  start: i,
3898
3911
  end: c
3899
3912
  };
3900
- }, Na = (t, e, n, r = "W") => {
3913
+ }, ka = (t, e, n, r = "W") => {
3901
3914
  const s = +t, { start: a, end: o } = xt(t, e, n);
3902
3915
  if (a.getTime() > o.getTime())
3903
3916
  return [];
@@ -3906,10 +3919,10 @@ const no = (t) => {
3906
3919
  for (let g = c; g <= d; g++)
3907
3920
  l.push(pt(s, g, r));
3908
3921
  return l;
3909
- }, ka = (t) => {
3922
+ }, Ra = (t) => {
3910
3923
  const e = new Date(t);
3911
3924
  return e.setMinutes(e.getMinutes() - e.getTimezoneOffset()), e.toISOString().slice(0, 10);
3912
- }, Ra = (t, e, n) => {
3925
+ }, _a = (t, e, n) => {
3913
3926
  const { start: r, end: s } = xt(t, e, n);
3914
3927
  if (r.getTime() > s.getTime())
3915
3928
  return [];
@@ -3919,11 +3932,11 @@ const no = (t) => {
3919
3932
  r.getDate()
3920
3933
  ), i = new Date(s.getFullYear(), s.getMonth(), s.getDate());
3921
3934
  for (; o.getTime() < i.getTime(); ) {
3922
- const c = ka(o);
3935
+ const c = Ra(o);
3923
3936
  a.push(c), o.setDate(o.getDate() + 1);
3924
3937
  }
3925
3938
  return a;
3926
- }, _a = (t) => ({
3939
+ }, Ia = (t) => ({
3927
3940
  isDailyExist: !!t?.some(({ memberValue: e }) => e === "D"),
3928
3941
  isWeeklyExist: !!t?.some(({ memberValue: e }) => e === "W"),
3929
3942
  isMonthlyExist: !!t?.some(({ memberValue: e }) => e === "M"),
@@ -3932,158 +3945,159 @@ const no = (t) => {
3932
3945
  isYearlyExist: !!t?.some(
3933
3946
  ({ memberValue: e }) => e === "A" || e === "Y"
3934
3947
  )
3935
- }), Ia = (t, e, n, r) => {
3936
- const s = r === 0 ? k(e.toString(), !0)?.getMonth() + 1 : void 0, a = r === t.length - 1 ? k(n.toString())?.getMonth() + 1 || 1 : void 0;
3948
+ }), Ya = (t, e, n, r) => {
3949
+ const s = r === 0 ? R(e.toString(), !0)?.getMonth() + 1 : void 0, a = r === t.length - 1 ? R(n.toString())?.getMonth() + 1 || 1 : void 0;
3937
3950
  return { startMonth: s, endMonth: a };
3938
- }, Ya = ["FREQUENCY", "FREQ"], io = (t, e) => {
3951
+ }, Ca = ["FREQUENCY", "FREQ"], co = (t, e) => {
3939
3952
  const n = t?.[0]?.cubeRegions?.[0]?.memberSelection?.find(
3940
- (c) => Ya.includes(c.componentId)
3941
- )?.selectionValues, r = _a(n || []), s = e?.startPeriod?.getTime() || 1, a = e?.endPeriod?.getTime() || 1, o = ea(a, s), i = [];
3953
+ (c) => Ca.includes(c.componentId)
3954
+ )?.selectionValues, r = Ia(n || []), s = e?.startPeriod?.getTime() || 1, a = e?.endPeriod?.getTime() || 1, o = ta(a, s), i = [];
3942
3955
  return o.forEach((c, u) => {
3943
- const d = [], { startMonth: l, endMonth: g } = Ia(
3956
+ const d = [], { startMonth: l, endMonth: g } = Ya(
3944
3957
  o,
3945
3958
  new Date(s),
3946
3959
  new Date(a),
3947
3960
  u
3948
3961
  ), {
3949
- isDailyExist: x,
3950
- isWeeklyExist: P,
3951
- isMonthlyExist: Y,
3962
+ isDailyExist: M,
3963
+ isWeeklyExist: x,
3964
+ isMonthlyExist: N,
3952
3965
  isQuarterlyExist: f,
3953
3966
  isSemiAnnualExist: w,
3954
- isYearlyExist: M
3967
+ isYearlyExist: P
3955
3968
  } = r;
3956
- M && d.push(c.toString()), w && d.push(...Ks(c, l, g)), f && d.push(
3957
- ...js(c, l, g, !1)
3958
- ), Y && d.push(...Zs(c, l, g)), P && d.push(
3959
- ...Na(c, s.toString(), a.toString())
3960
- ), x && d.push(
3961
- ...Ra(c, s.toString(), a.toString())
3969
+ P && d.push(c.toString()), w && d.push(...zs(c, l, g)), f && d.push(
3970
+ ...Ks(c, l, g, !1)
3971
+ ), N && d.push(...ea(c, l, g)), x && d.push(
3972
+ ...ka(c, s.toString(), a.toString())
3973
+ ), M && d.push(
3974
+ ..._a(c, s.toString(), a.toString())
3962
3975
  ), i.push(...d);
3963
3976
  }), i;
3964
3977
  };
3965
- function Ca(t) {
3978
+ function Sa(t) {
3966
3979
  const { urn: e } = t.details;
3967
3980
  return Mt(e.resourceId, e.version, e.agencyId);
3968
3981
  }
3969
- function co(t) {
3982
+ function uo(t) {
3970
3983
  const e = {};
3971
3984
  for (const n of t.datasets) {
3972
- const r = n.dataset, s = Ca(r);
3985
+ const r = n.dataset, s = Sa(r);
3973
3986
  e[s] = r.details.dimensions;
3974
3987
  }
3975
3988
  return e;
3976
3989
  }
3977
3990
  export {
3978
3991
  Oe as Annotations,
3979
- ms as AssignmentStatus,
3992
+ hs as AssignmentStatus,
3980
3993
  La as AvailabilityApi,
3981
3994
  Lt as DATASET_DATA_URL,
3982
- Wa as DatasetApi,
3995
+ $a as DatasetApi,
3983
3996
  we as DimensionType,
3984
3997
  It as DownloadType,
3985
- qa as FREQUENCY_DIMENSION_ID,
3986
- Ya as FREQUENCY_DIM_ID,
3998
+ Qa as FREQUENCY_DIMENSION_ID,
3999
+ Ca as FREQUENCY_DIM_ID,
3987
4000
  _t as FileColumnsAttribute,
3988
- $t as GET_v3_FILTER_ALL,
3989
- Sa as GET_v3_FILTER_AND,
3990
- Wt as GET_v3_FILTER_OR,
3991
- ps as OBSERVATION_KEY,
3992
- hs as OccurrenceType,
3993
- aa as Periods,
3994
- sa as RepresentationTextType,
3995
- ra as SDMX_DATA_QUERY_PARAMS,
4001
+ qt as GET_v3_FILTER_ALL,
4002
+ Wa as GET_v3_FILTER_AND,
4003
+ $t as GET_v3_FILTER_OR,
4004
+ ys as OBSERVATION_KEY,
4005
+ ws as OccurrenceType,
4006
+ oa as Periods,
4007
+ aa as RepresentationTextType,
4008
+ sa as SDMX_DATA_QUERY_PARAMS,
3996
4009
  ce as SINGLE_WILDCARD_SYMBOL,
3997
- $a as SdmxApiClient,
4010
+ qa as SdmxApiClient,
3998
4011
  Ze as SdmxAvailabilityMode,
3999
- X as SdmxDataFormat,
4012
+ C as SdmxDataFormat,
4000
4013
  et as SdmxDetails,
4001
4014
  ue as SdmxReferences,
4002
- R as SeriesFilterOperator,
4003
- ds as TIME_PERIOD,
4004
- fs as TIME_PERIOD_END_ANNOTATION_KEY,
4005
- ls as TIME_PERIOD_START_ANNOTATION_KEY,
4006
- co as buildDatasetDimensionsMetadataMap,
4007
- Ns as dailyPattern,
4008
- Ts as decodeDimensionId,
4009
- Ka as findCodelistByDimension,
4015
+ _ as SeriesFilterOperator,
4016
+ ls as TIME_PERIOD,
4017
+ ms as TIME_PERIOD_END_ANNOTATION_KEY,
4018
+ fs as TIME_PERIOD_START_ANNOTATION_KEY,
4019
+ uo as buildDatasetDimensionsMetadataMap,
4020
+ ks as dailyPattern,
4021
+ Es as decodeDimensionId,
4022
+ za as findCodelistByDimension,
4010
4023
  _e as generateDatasetDataRequest,
4011
4024
  Mt as generateShortUrn,
4012
- io as getAdditionalColumns,
4013
- Va as getAnnotationPeriod,
4025
+ co as getAdditionalColumns,
4026
+ Xa as getAnnotationPeriod,
4014
4027
  Ne as getArtifactByUrnWithWildCard,
4015
- Qa as getAttachedDimensionsSeriesByDimension,
4016
- ws as getAttachedDimensionsSeriesByTsId,
4028
+ Fa as getAttachedDimensionsSeriesByDimension,
4029
+ gs as getAttachedDimensionsSeriesByTsId,
4017
4030
  gt as getAttachedDimensionsSeriesKey,
4018
- gs as getAttributeValueFromDataQueryResponse,
4019
- za as getAvailableCodes,
4020
- Xa as getAvailableCodesFromConstrains,
4031
+ ps as getAttributeValueFromDataQueryResponse,
4032
+ Ja as getAvailableCodes,
4033
+ ja as getAvailableCodesFromConstrains,
4021
4034
  Pt as getChildParsedUrn,
4022
4035
  ke as getConcept,
4023
4036
  Ke as getConceptByUrn,
4024
- xa as getConceptWithScheme,
4025
- Ma as getConvertedMetaAttributes,
4026
- _s as getDailyRegExp,
4027
- Ra as getDaysColumns,
4028
- Ja as getDimensionTitle,
4037
+ Pa as getConceptWithScheme,
4038
+ va as getConvertedMetaAttributes,
4039
+ Is as getDailyRegExp,
4040
+ _a as getDaysColumns,
4041
+ Za as getDimensionTitle,
4029
4042
  ze as getDimensions,
4030
- oa as getFilteredItemsWithParents,
4031
- fa as getFiltersDtoFromDataQuery,
4032
- ja as getFiltersDtoMapFromDataQuery,
4043
+ ia as getFilteredItemsWithParents,
4044
+ ma as getFiltersDtoFromDataQuery,
4045
+ Ka as getFiltersDtoMapFromDataQuery,
4033
4046
  Z as getISOWeek,
4034
4047
  K as getKeyFromUrn,
4035
- Ga as getLastUpdatedTime,
4048
+ Va as getLastUpdatedTime,
4036
4049
  Fe as getLastWeekNumberOfYear,
4037
4050
  Ae as getLocalizedName,
4038
- Zs as getMonthlyData,
4039
- Ua as getMonthlyDataByQuarter,
4051
+ ea as getMonthlyData,
4052
+ Ba as getMonthlyDataByQuarter,
4040
4053
  be as getMonthlyRegExp,
4041
4054
  bt as getParsedEndPeriodDate,
4042
- Fa as getParsedResponse,
4055
+ Ha as getParsedResponse,
4043
4056
  yt as getParsedStartPeriodDate,
4044
- k as getPeriodDate,
4045
- _a as getPeriods,
4046
- Ha as getQuarterByMonth,
4057
+ R as getPeriodDate,
4058
+ Ia as getPeriods,
4059
+ Ua as getQuarterByMonth,
4047
4060
  Te as getQuarterlyRegExp,
4048
- js as getQuartersData,
4049
- Oa as getQueryTimePeriodFilters,
4061
+ Ks as getQuartersData,
4062
+ Aa as getQueryTimePeriodFilters,
4050
4063
  Yt as getRequestAcceptHeader,
4051
- ba as getResolvedVersionBySingleWildcard,
4052
- Ks as getSemiAnnualData,
4053
- Rs as getSemiAnnuallyRegExp,
4064
+ Da as getResolvedVersionBySingleWildcard,
4065
+ Ct as getResponseContentType,
4066
+ zs as getSemiAnnualData,
4067
+ _s as getSemiAnnuallyRegExp,
4054
4068
  ie as getSeriesAttributes,
4055
- ys as getSeriesName,
4056
- no as getStructureComponentsMap,
4057
- Za as getStructureDimensions,
4058
- to as getTimeDimension,
4059
- eo as getTimePeriods,
4060
- oo as getTimeQueryFilter,
4061
- Aa as getTimeRangeFromAttachment,
4062
- ro as getTimeSeriesCount,
4063
- ao as getTimeSeriesFilterKey,
4064
- Ds as getTimeSeriesId,
4069
+ bs as getSeriesName,
4070
+ ro as getStructureComponentsMap,
4071
+ eo as getStructureDimensions,
4072
+ no as getTimeDimension,
4073
+ to as getTimePeriods,
4074
+ io as getTimeQueryFilter,
4075
+ Na as getTimeRangeFromAttachment,
4076
+ so as getTimeSeriesCount,
4077
+ oo as getTimeSeriesFilterKey,
4078
+ Ts as getTimeSeriesId,
4065
4079
  pt as getWeekCode,
4066
- Ss as getWeeklyPeriodEndDate,
4080
+ Ws as getWeeklyPeriodEndDate,
4067
4081
  Ls as getWeeklyPeriodStartDate,
4068
- Ys as getWeeklyRegExp,
4069
- Na as getWeeksColumns,
4070
- Ta as getWildCardRegexp,
4082
+ Cs as getWeeklyRegExp,
4083
+ ka as getWeeksColumns,
4084
+ Ea as getWildCardRegexp,
4071
4085
  xt as getYearPeriod,
4072
4086
  ge as getYearlyRegExp,
4073
- ea as getYears,
4074
- Is as isDaily,
4087
+ ta as getYears,
4088
+ Ys as isDaily,
4075
4089
  De as isMonthly,
4076
4090
  Ee as isQuarterly,
4077
4091
  ye as isSemiAnnually,
4078
4092
  xe as isWeekly,
4079
- Ea as isWildCardVersionCorrect,
4093
+ xa as isWildCardVersionCorrect,
4080
4094
  pe as isYearly,
4081
- ks as monthlyPattern,
4082
- so as openDownloadWindow,
4083
- Ms as quarterPattern,
4084
- Os as semiAnnuallyPattern,
4085
- Ba as sortPeriods,
4086
- H as splitUrn,
4087
- vs as weeklyPattern,
4088
- As as yearlyPattern
4095
+ Rs as monthlyPattern,
4096
+ ao as openDownloadWindow,
4097
+ vs as quarterPattern,
4098
+ As as semiAnnuallyPattern,
4099
+ Ga as sortPeriods,
4100
+ U as splitUrn,
4101
+ Os as weeklyPattern,
4102
+ Ns as yearlyPattern
4089
4103
  };