@epam/statgpt-sdmx-toolkit 0.4.0-rc.49 → 0.4.0-rc.50

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
@@ -12,39 +12,39 @@ const z = (t) => {
12
12
  version: ""
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
- }, tt = (t) => {
15
+ }, nt = (t) => {
16
16
  const [e, n] = t.split(")."), { agency: r, id: s, version: a } = C(e + ")");
17
17
  return { childId: n, agency: r, id: s, version: a };
18
18
  }, ue = (t, e, n) => {
19
19
  const r = e === "" ? "" : `(${e})`;
20
20
  return `${n}:${t}${r}`;
21
21
  };
22
- var de = /* @__PURE__ */ ((t) => (t.DESCENDANTS = "descendants", t.NONE = "none", t.ALL = "all", t))(de || {}), nt = /* @__PURE__ */ ((t) => (t.EXACT = "exact", t.AVAILABLE = "available", t))(nt || {});
23
- function At(t) {
22
+ var de = /* @__PURE__ */ ((t) => (t.DESCENDANTS = "descendants", t.NONE = "none", t.ALL = "all", t))(de || {}), rt = /* @__PURE__ */ ((t) => (t.EXACT = "exact", t.AVAILABLE = "available", t))(rt || {});
23
+ function Nt(t) {
24
24
  return {
25
25
  data: {
26
26
  codelists: t.data.codelists,
27
27
  conceptSchemes: t.data.conceptSchemes,
28
- dataConstraints: t.data.dataConstraints?.map(Nt),
28
+ dataConstraints: t.data.dataConstraints?.map(Rt),
29
29
  dataflows: t.data.dataflows,
30
30
  dataStructures: t.data.dataStructures,
31
31
  metadataStructures: t.data.metadataStructures
32
32
  }
33
33
  };
34
34
  }
35
- function Nt(t) {
35
+ function Rt(t) {
36
36
  return {
37
37
  ...t,
38
- cubeRegions: t.cubeRegions?.map(Rt)
38
+ cubeRegions: t.cubeRegions?.map(kt)
39
39
  };
40
40
  }
41
- function Rt(t) {
41
+ function kt(t) {
42
42
  return {
43
43
  isIncluded: t.include,
44
- memberSelection: t.keyValues.map(kt)
44
+ memberSelection: t.keyValues.map(_t)
45
45
  };
46
46
  }
47
- function kt(t) {
47
+ function _t(t) {
48
48
  return {
49
49
  included: t.include,
50
50
  componentId: t.id,
@@ -56,39 +56,39 @@ function It(t) {
56
56
  memberValue: t.value
57
57
  };
58
58
  }
59
- const _t = (t = "", e = "", n = "") => `sdmx/3.0/availability/dataflow/${t}/${e}/${n}`;
60
- class qa {
59
+ const Yt = (t = "", e = "", n = "") => `sdmx/3.0/availability/dataflow/${t}/${e}/${n}`;
60
+ class Ua {
61
61
  constructor(e) {
62
62
  this.client = e;
63
63
  }
64
64
  async getConstraints(e, n, r) {
65
- const { agency: s, id: a, version: o } = C(e), i = {
65
+ const { agency: s, id: a, version: o } = C(e), c = {
66
66
  filters: n || [],
67
- mode: nt.AVAILABLE,
67
+ mode: rt.AVAILABLE,
68
68
  references: de.NONE
69
- }, c = _t(s, a, o), u = !!this.client.config.sdmxProxyUrl, d = u || this.client.config.isDialProxyMode, l = u ? this.client.config.sdmxProxyUrl : this.client.config.constrainsApiUrl || this.client.config.apiUrl;
69
+ }, i = Yt(s, a, o), u = !!this.client.config.sdmxProxyUrl, d = u || this.client.config.isDialProxyMode, l = u ? this.client.config.sdmxProxyUrl : this.client.config.constrainsApiUrl || this.client.config.apiUrl;
70
70
  if (d) {
71
71
  const m = await this.client.postRequest(
72
- c,
73
- { body: i },
72
+ i,
73
+ { body: c },
74
74
  l,
75
75
  r
76
76
  );
77
- return At(m);
77
+ return Nt(m);
78
78
  }
79
79
  return await this.client.postRequest(
80
- c,
81
- { body: i },
80
+ i,
81
+ { body: c },
82
82
  l,
83
83
  r
84
84
  );
85
85
  }
86
86
  }
87
- var G = /* @__PURE__ */ ((t) => (t.CSV = "csv", t.JSON = "json", t.XML = "xml", t))(G || {}), Yt = /* @__PURE__ */ ((t) => (t.ID = "id", t.NAME = "name", t.ID_NAME = "both", t))(Yt || {}), Ct = /* @__PURE__ */ ((t) => (t.FULL_DATASET = "full", t.DATA_IN_TABLE = "query", t))(Ct || {});
87
+ var G = /* @__PURE__ */ ((t) => (t.CSV = "csv", t.JSON = "json", t.XML = "xml", t))(G || {}), Ct = /* @__PURE__ */ ((t) => (t.ID = "id", t.NAME = "name", t.ID_NAME = "both", t))(Ct || {}), St = /* @__PURE__ */ ((t) => (t.FULL_DATASET = "full", t.DATA_IN_TABLE = "query", t))(St || {});
88
88
  const Lt = (t, e) => {
89
89
  switch (t) {
90
90
  case G.CSV:
91
- return Ie(
91
+ return _e(
92
92
  "application/vnd.sdmx.data+csv;version=2.0.0",
93
93
  e
94
94
  );
@@ -97,25 +97,25 @@ const Lt = (t, e) => {
97
97
  case G.JSON:
98
98
  return "application/vnd.sdmx.data+json;version=2.1";
99
99
  default:
100
- return Ie(
100
+ return _e(
101
101
  "application/vnd.sdmx.data+csv;version=2.0.0",
102
102
  e
103
103
  );
104
104
  }
105
- }, Ie = (t, e) => `${t}; labels=${e}`;
106
- var rt = /* @__PURE__ */ ((t) => (t.REFERENCE_PARTIAL = "referencepartial", t.FULL = "full", t))(rt || {});
107
- const St = "all", $t = "sdmx/3.0/data/dataflow", st = "&", _e = ":", Wt = "=", qt = "+", Ua = ",", Ut = "*", Ye = (t, e, n) => {
108
- const { filterKey: r, timeFilter: s } = n, { agency: a, id: o, version: i } = C(t), c = [s || "", e].filter((d) => !!d).join(st);
109
- return `${`${$t}/${a}/${o}/${i}`}/${r || Ut}?${c}`;
110
- }, Ht = (t = "", e = "", n = "", r = de.DESCENDANTS) => `sdmx/3.0/structure/dataflow/${t}/${e}/${n}?references=${r}&detail=${rt.REFERENCE_PARTIAL}`;
111
- class Ha {
105
+ }, _e = (t, e) => `${t}; labels=${e}`;
106
+ var st = /* @__PURE__ */ ((t) => (t.REFERENCE_PARTIAL = "referencepartial", t.FULL = "full", t))(st || {});
107
+ const $t = "all", Wt = "sdmx/3.0/data/dataflow", at = "&", Ie = ":", qt = "=", Ut = "+", Ha = ",", Ht = "*", Ye = (t, e, n) => {
108
+ const { filterKey: r, timeFilter: s } = n, { agency: a, id: o, version: c } = C(t), i = [s || "", e].filter((d) => !!d).join(at);
109
+ return `${`${Wt}/${a}/${o}/${c}`}/${r || Ht}?${i}`;
110
+ }, Ft = (t = "", e = "", n = "", r = de.DESCENDANTS) => `sdmx/3.0/structure/dataflow/${t}/${e}/${n}?references=${r}&detail=${st.REFERENCE_PARTIAL}`;
111
+ class Fa {
112
112
  constructor(e) {
113
113
  this.client = e;
114
114
  }
115
115
  async getDataSet(e, n, r) {
116
116
  const { agency: s, id: a, version: o } = C(e);
117
117
  return await this.client.getRequest(
118
- Ht(s, a, o, n),
118
+ Ft(s, a, o, n),
119
119
  void 0,
120
120
  r
121
121
  );
@@ -124,7 +124,7 @@ class Ha {
124
124
  const s = new URLSearchParams({
125
125
  includeHistory: "false",
126
126
  limit: "1000",
127
- attributes: St,
127
+ attributes: $t,
128
128
  dimensionAtObservation: "TIME_PERIOD"
129
129
  // TODO: use time dimensions
130
130
  }).toString(), a = Ye(e, s, n);
@@ -134,10 +134,10 @@ class Ha {
134
134
  r
135
135
  );
136
136
  }
137
- async downloadDataSet(e, n, r, s, a, o, i = !1, c) {
137
+ async downloadDataSet(e, n, r, s, a, o, c = !1, i) {
138
138
  const u = new URLSearchParams({
139
139
  compress: "false",
140
- attributes: i ? "all" : "none",
140
+ attributes: c ? "all" : "none",
141
141
  limit: "1000"
142
142
  }).toString(), d = Ye(e, u, a);
143
143
  return this.client.streamRequest(
@@ -150,45 +150,45 @@ class Ha {
150
150
  }
151
151
  },
152
152
  o,
153
- c
153
+ i
154
154
  );
155
155
  }
156
156
  }
157
- const Ft = (t, e) => t.error || t.message || `${e.status} ${e.statusText}`, Qt = "application/json", Bt = "Content-Type", j = "Api-Key", Vt = "X-CONVERSATION-ID", X = "Ocp-Apim-Subscription-Key";
158
- class Ce extends Error {
157
+ const Qt = (t, e) => t.error || t.message || `${e.status} ${e.statusText}`, Bt = "application/json", Vt = "Content-Type", X = "Api-Key", Gt = "X-CONVERSATION-ID", j = "Ocp-Apim-Subscription-Key", Ce = "X-Source-Artefact-Urn";
158
+ class Se extends Error {
159
159
  constructor(e) {
160
160
  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;
161
161
  }
162
162
  }
163
- const at = 6048e5, Gt = 864e5, le = 6e4, fe = 36e5, jt = 1e3, Le = /* @__PURE__ */ Symbol.for("constructDateFrom");
163
+ const ot = 6048e5, Xt = 864e5, le = 6e4, fe = 36e5, jt = 1e3, Le = /* @__PURE__ */ Symbol.for("constructDateFrom");
164
164
  function E(t, e) {
165
165
  return typeof t == "function" ? t(e) : t && typeof t == "object" && Le in t ? t[Le](e) : t instanceof Date ? new t.constructor(e) : new Date(e);
166
166
  }
167
167
  function p(t, e) {
168
168
  return E(e || t, t);
169
169
  }
170
- function ot(t, e, n) {
170
+ function it(t, e, n) {
171
171
  const r = p(t, n?.in);
172
172
  return isNaN(e) ? E(n?.in || t, NaN) : (e && r.setDate(r.getDate() + e), r);
173
173
  }
174
- let Xt = {};
174
+ let zt = {};
175
175
  function $() {
176
- return Xt;
176
+ return zt;
177
177
  }
178
- function _(t, e) {
178
+ function I(t, e) {
179
179
  const n = $(), r = e?.weekStartsOn ?? e?.locale?.options?.weekStartsOn ?? n.weekStartsOn ?? n.locale?.options?.weekStartsOn ?? 0, s = p(t, e?.in), a = s.getDay(), o = (a < r ? 7 : 0) + a - r;
180
180
  return s.setDate(s.getDate() - o), s.setHours(0, 0, 0, 0), s;
181
181
  }
182
- function S(t, e) {
183
- return _(t, { ...e, weekStartsOn: 1 });
182
+ function L(t, e) {
183
+ return I(t, { ...e, weekStartsOn: 1 });
184
184
  }
185
- function it(t, e) {
185
+ function ct(t, e) {
186
186
  const n = p(t, e?.in), r = n.getFullYear(), s = E(n, 0);
187
187
  s.setFullYear(r + 1, 0, 4), s.setHours(0, 0, 0, 0);
188
- const a = S(s), o = E(n, 0);
188
+ const a = L(s), o = E(n, 0);
189
189
  o.setFullYear(r, 0, 4), o.setHours(0, 0, 0, 0);
190
- const i = S(o);
191
- return n.getTime() >= a.getTime() ? r + 1 : n.getTime() >= i.getTime() ? r : r - 1;
190
+ const c = L(o);
191
+ return n.getTime() >= a.getTime() ? r + 1 : n.getTime() >= c.getTime() ? r : r - 1;
192
192
  }
193
193
  function K(t) {
194
194
  const e = p(t), n = new Date(
@@ -204,40 +204,40 @@ function K(t) {
204
204
  );
205
205
  return n.setUTCFullYear(e.getFullYear()), +t - +n;
206
206
  }
207
- function zt(t, ...e) {
207
+ function Kt(t, ...e) {
208
208
  const n = E.bind(
209
209
  null,
210
210
  e.find((r) => typeof r == "object")
211
211
  );
212
212
  return e.map(n);
213
213
  }
214
- function Se(t, e) {
214
+ function $e(t, e) {
215
215
  const n = p(t, e?.in);
216
216
  return n.setHours(0, 0, 0, 0), n;
217
217
  }
218
- function Kt(t, e, n) {
219
- const [r, s] = zt(
218
+ function Jt(t, e, n) {
219
+ const [r, s] = Kt(
220
220
  n?.in,
221
221
  t,
222
222
  e
223
- ), a = Se(r), o = Se(s), i = +a - K(a), c = +o - K(o);
224
- return Math.round((i - c) / Gt);
223
+ ), a = $e(r), o = $e(s), c = +a - K(a), i = +o - K(o);
224
+ return Math.round((c - i) / Xt);
225
225
  }
226
- function Jt(t, e) {
227
- const n = it(t, e), r = E(t, 0);
228
- return r.setFullYear(n, 0, 4), r.setHours(0, 0, 0, 0), S(r);
226
+ function Zt(t, e) {
227
+ const n = ct(t, e), r = E(t, 0);
228
+ return r.setFullYear(n, 0, 4), r.setHours(0, 0, 0, 0), L(r);
229
229
  }
230
- function Zt(t) {
230
+ function en(t) {
231
231
  return t instanceof Date || typeof t == "object" && Object.prototype.toString.call(t) === "[object Date]";
232
232
  }
233
233
  function ne(t) {
234
- return !(!Zt(t) && typeof t != "number" || isNaN(+p(t)));
234
+ return !(!en(t) && typeof t != "number" || isNaN(+p(t)));
235
235
  }
236
- function en(t, e) {
236
+ function tn(t, e) {
237
237
  const n = p(t, e?.in);
238
238
  return n.setFullYear(n.getFullYear(), 0, 1), n.setHours(0, 0, 0, 0), n;
239
239
  }
240
- const tn = {
240
+ const nn = {
241
241
  lessThanXSeconds: {
242
242
  one: "less than a second",
243
243
  other: "less than {{count}} seconds"
@@ -299,9 +299,9 @@ const tn = {
299
299
  one: "almost 1 year",
300
300
  other: "almost {{count}} years"
301
301
  }
302
- }, nn = (t, e, n) => {
302
+ }, rn = (t, e, n) => {
303
303
  let r;
304
- const s = tn[t];
304
+ const s = nn[t];
305
305
  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;
306
306
  };
307
307
  function ee(t) {
@@ -310,66 +310,66 @@ function ee(t) {
310
310
  return t.formats[n] || t.formats[t.defaultWidth];
311
311
  };
312
312
  }
313
- const rn = {
313
+ const sn = {
314
314
  full: "EEEE, MMMM do, y",
315
315
  long: "MMMM do, y",
316
316
  medium: "MMM d, y",
317
317
  short: "MM/dd/yyyy"
318
- }, sn = {
318
+ }, an = {
319
319
  full: "h:mm:ss a zzzz",
320
320
  long: "h:mm:ss a z",
321
321
  medium: "h:mm:ss a",
322
322
  short: "h:mm a"
323
- }, an = {
323
+ }, on = {
324
324
  full: "{{date}} 'at' {{time}}",
325
325
  long: "{{date}} 'at' {{time}}",
326
326
  medium: "{{date}}, {{time}}",
327
327
  short: "{{date}}, {{time}}"
328
- }, on = {
328
+ }, cn = {
329
329
  date: ee({
330
- formats: rn,
330
+ formats: sn,
331
331
  defaultWidth: "full"
332
332
  }),
333
333
  time: ee({
334
- formats: sn,
334
+ formats: an,
335
335
  defaultWidth: "full"
336
336
  }),
337
337
  dateTime: ee({
338
- formats: an,
338
+ formats: on,
339
339
  defaultWidth: "full"
340
340
  })
341
- }, cn = {
341
+ }, un = {
342
342
  lastWeek: "'last' eeee 'at' p",
343
343
  yesterday: "'yesterday at' p",
344
344
  today: "'today at' p",
345
345
  tomorrow: "'tomorrow at' p",
346
346
  nextWeek: "eeee 'at' p",
347
347
  other: "P"
348
- }, un = (t, e, n, r) => cn[t];
348
+ }, dn = (t, e, n, r) => un[t];
349
349
  function U(t) {
350
350
  return (e, n) => {
351
351
  const r = n?.context ? String(n.context) : "standalone";
352
352
  let s;
353
353
  if (r === "formatting" && t.formattingValues) {
354
- const o = t.defaultFormattingWidth || t.defaultWidth, i = n?.width ? String(n.width) : o;
355
- s = t.formattingValues[i] || t.formattingValues[o];
354
+ const o = t.defaultFormattingWidth || t.defaultWidth, c = n?.width ? String(n.width) : o;
355
+ s = t.formattingValues[c] || t.formattingValues[o];
356
356
  } else {
357
- const o = t.defaultWidth, i = n?.width ? String(n.width) : t.defaultWidth;
358
- s = t.values[i] || t.values[o];
357
+ const o = t.defaultWidth, c = n?.width ? String(n.width) : t.defaultWidth;
358
+ s = t.values[c] || t.values[o];
359
359
  }
360
360
  const a = t.argumentCallback ? t.argumentCallback(e) : e;
361
361
  return s[a];
362
362
  };
363
363
  }
364
- const dn = {
364
+ const ln = {
365
365
  narrow: ["B", "A"],
366
366
  abbreviated: ["BC", "AD"],
367
367
  wide: ["Before Christ", "Anno Domini"]
368
- }, ln = {
368
+ }, fn = {
369
369
  narrow: ["1", "2", "3", "4"],
370
370
  abbreviated: ["Q1", "Q2", "Q3", "Q4"],
371
371
  wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"]
372
- }, fn = {
372
+ }, mn = {
373
373
  narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
374
374
  abbreviated: [
375
375
  "Jan",
@@ -399,7 +399,7 @@ const dn = {
399
399
  "November",
400
400
  "December"
401
401
  ]
402
- }, mn = {
402
+ }, hn = {
403
403
  narrow: ["S", "M", "T", "W", "T", "F", "S"],
404
404
  short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
405
405
  abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
@@ -412,7 +412,7 @@ const dn = {
412
412
  "Friday",
413
413
  "Saturday"
414
414
  ]
415
- }, hn = {
415
+ }, gn = {
416
416
  narrow: {
417
417
  am: "a",
418
418
  pm: "p",
@@ -443,7 +443,7 @@ const dn = {
443
443
  evening: "evening",
444
444
  night: "night"
445
445
  }
446
- }, gn = {
446
+ }, wn = {
447
447
  narrow: {
448
448
  am: "a",
449
449
  pm: "p",
@@ -474,7 +474,7 @@ const dn = {
474
474
  evening: "in the evening",
475
475
  night: "at night"
476
476
  }
477
- }, wn = (t, e) => {
477
+ }, yn = (t, e) => {
478
478
  const n = Number(t), r = n % 100;
479
479
  if (r > 20 || r < 10)
480
480
  switch (r % 10) {
@@ -486,29 +486,29 @@ const dn = {
486
486
  return n + "rd";
487
487
  }
488
488
  return n + "th";
489
- }, yn = {
490
- ordinalNumber: wn,
489
+ }, pn = {
490
+ ordinalNumber: yn,
491
491
  era: U({
492
- values: dn,
492
+ values: ln,
493
493
  defaultWidth: "wide"
494
494
  }),
495
495
  quarter: U({
496
- values: ln,
496
+ values: fn,
497
497
  defaultWidth: "wide",
498
498
  argumentCallback: (t) => t - 1
499
499
  }),
500
500
  month: U({
501
- values: fn,
501
+ values: mn,
502
502
  defaultWidth: "wide"
503
503
  }),
504
504
  day: U({
505
- values: mn,
505
+ values: hn,
506
506
  defaultWidth: "wide"
507
507
  }),
508
508
  dayPeriod: U({
509
- values: hn,
509
+ values: gn,
510
510
  defaultWidth: "wide",
511
- formattingValues: gn,
511
+ formattingValues: wn,
512
512
  defaultFormattingWidth: "wide"
513
513
  })
514
514
  };
@@ -517,12 +517,12 @@ function H(t) {
517
517
  const r = n.width, s = r && t.matchPatterns[r] || t.matchPatterns[t.defaultMatchWidth], a = e.match(s);
518
518
  if (!a)
519
519
  return null;
520
- const o = a[0], i = r && t.parsePatterns[r] || t.parsePatterns[t.defaultParseWidth], c = Array.isArray(i) ? bn(i, (l) => l.test(o)) : (
520
+ const o = a[0], c = r && t.parsePatterns[r] || t.parsePatterns[t.defaultParseWidth], i = Array.isArray(c) ? Dn(c, (l) => l.test(o)) : (
521
521
  // [TODO] -- I challenge you to fix the type
522
- pn(i, (l) => l.test(o))
522
+ bn(c, (l) => l.test(o))
523
523
  );
524
524
  let u;
525
- u = t.valueCallback ? t.valueCallback(c) : c, u = n.valueCallback ? (
525
+ u = t.valueCallback ? t.valueCallback(i) : i, u = n.valueCallback ? (
526
526
  // [TODO] -- I challenge you to fix the type
527
527
  n.valueCallback(u)
528
528
  ) : u;
@@ -530,17 +530,17 @@ function H(t) {
530
530
  return { value: u, rest: d };
531
531
  };
532
532
  }
533
- function pn(t, e) {
533
+ function bn(t, e) {
534
534
  for (const n in t)
535
535
  if (Object.prototype.hasOwnProperty.call(t, n) && e(t[n]))
536
536
  return n;
537
537
  }
538
- function bn(t, e) {
538
+ function Dn(t, e) {
539
539
  for (let n = 0; n < t.length; n++)
540
540
  if (e(t[n]))
541
541
  return n;
542
542
  }
543
- function Dn(t) {
543
+ function Tn(t) {
544
544
  return (e, n = {}) => {
545
545
  const r = e.match(t.matchPattern);
546
546
  if (!r) return null;
@@ -548,27 +548,27 @@ function Dn(t) {
548
548
  if (!a) return null;
549
549
  let o = t.valueCallback ? t.valueCallback(a[0]) : a[0];
550
550
  o = n.valueCallback ? n.valueCallback(o) : o;
551
- const i = e.slice(s.length);
552
- return { value: o, rest: i };
551
+ const c = e.slice(s.length);
552
+ return { value: o, rest: c };
553
553
  };
554
554
  }
555
- const Tn = /^(\d+)(th|st|nd|rd)?/i, En = /\d+/i, xn = {
555
+ const En = /^(\d+)(th|st|nd|rd)?/i, xn = /\d+/i, Pn = {
556
556
  narrow: /^(b|a)/i,
557
557
  abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
558
558
  wide: /^(before christ|before common era|anno domini|common era)/i
559
- }, Pn = {
560
- any: [/^b/i, /^(a|c)/i]
561
559
  }, vn = {
560
+ any: [/^b/i, /^(a|c)/i]
561
+ }, Mn = {
562
562
  narrow: /^[1234]/i,
563
563
  abbreviated: /^q[1234]/i,
564
564
  wide: /^[1234](th|st|nd|rd)? quarter/i
565
- }, Mn = {
566
- any: [/1/i, /2/i, /3/i, /4/i]
567
565
  }, On = {
566
+ any: [/1/i, /2/i, /3/i, /4/i]
567
+ }, An = {
568
568
  narrow: /^[jfmasond]/i,
569
569
  abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
570
570
  wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
571
- }, An = {
571
+ }, Nn = {
572
572
  narrow: [
573
573
  /^j/i,
574
574
  /^f/i,
@@ -597,15 +597,15 @@ const Tn = /^(\d+)(th|st|nd|rd)?/i, En = /\d+/i, xn = {
597
597
  /^n/i,
598
598
  /^d/i
599
599
  ]
600
- }, Nn = {
600
+ }, Rn = {
601
601
  narrow: /^[smtwf]/i,
602
602
  short: /^(su|mo|tu|we|th|fr|sa)/i,
603
603
  abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
604
604
  wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
605
- }, Rn = {
605
+ }, kn = {
606
606
  narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
607
607
  any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
608
- }, kn = {
608
+ }, _n = {
609
609
  narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
610
610
  any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
611
611
  }, In = {
@@ -619,78 +619,78 @@ const Tn = /^(\d+)(th|st|nd|rd)?/i, En = /\d+/i, xn = {
619
619
  evening: /evening/i,
620
620
  night: /night/i
621
621
  }
622
- }, _n = {
623
- ordinalNumber: Dn({
624
- matchPattern: Tn,
625
- parsePattern: En,
622
+ }, Yn = {
623
+ ordinalNumber: Tn({
624
+ matchPattern: En,
625
+ parsePattern: xn,
626
626
  valueCallback: (t) => parseInt(t, 10)
627
627
  }),
628
628
  era: H({
629
- matchPatterns: xn,
629
+ matchPatterns: Pn,
630
630
  defaultMatchWidth: "wide",
631
- parsePatterns: Pn,
631
+ parsePatterns: vn,
632
632
  defaultParseWidth: "any"
633
633
  }),
634
634
  quarter: H({
635
- matchPatterns: vn,
635
+ matchPatterns: Mn,
636
636
  defaultMatchWidth: "wide",
637
- parsePatterns: Mn,
637
+ parsePatterns: On,
638
638
  defaultParseWidth: "any",
639
639
  valueCallback: (t) => t + 1
640
640
  }),
641
641
  month: H({
642
- matchPatterns: On,
642
+ matchPatterns: An,
643
643
  defaultMatchWidth: "wide",
644
- parsePatterns: An,
644
+ parsePatterns: Nn,
645
645
  defaultParseWidth: "any"
646
646
  }),
647
647
  day: H({
648
- matchPatterns: Nn,
648
+ matchPatterns: Rn,
649
649
  defaultMatchWidth: "wide",
650
- parsePatterns: Rn,
650
+ parsePatterns: kn,
651
651
  defaultParseWidth: "any"
652
652
  }),
653
653
  dayPeriod: H({
654
- matchPatterns: kn,
654
+ matchPatterns: _n,
655
655
  defaultMatchWidth: "any",
656
656
  parsePatterns: In,
657
657
  defaultParseWidth: "any"
658
658
  })
659
- }, ct = {
659
+ }, ut = {
660
660
  code: "en-US",
661
- formatDistance: nn,
662
- formatLong: on,
663
- formatRelative: un,
664
- localize: yn,
665
- match: _n,
661
+ formatDistance: rn,
662
+ formatLong: cn,
663
+ formatRelative: dn,
664
+ localize: pn,
665
+ match: Yn,
666
666
  options: {
667
667
  weekStartsOn: 0,
668
668
  firstWeekContainsDate: 1
669
669
  }
670
670
  };
671
- function Yn(t, e) {
671
+ function Cn(t, e) {
672
672
  const n = p(t, e?.in);
673
- return Kt(n, en(n)) + 1;
673
+ return Jt(n, tn(n)) + 1;
674
674
  }
675
- function ut(t, e) {
676
- const n = p(t, e?.in), r = +S(n) - +Jt(n);
677
- return Math.round(r / at) + 1;
675
+ function dt(t, e) {
676
+ const n = p(t, e?.in), r = +L(n) - +Zt(n);
677
+ return Math.round(r / ot) + 1;
678
678
  }
679
679
  function me(t, e) {
680
680
  const n = p(t, e?.in), r = n.getFullYear(), s = $(), a = e?.firstWeekContainsDate ?? e?.locale?.options?.firstWeekContainsDate ?? s.firstWeekContainsDate ?? s.locale?.options?.firstWeekContainsDate ?? 1, o = E(e?.in || t, 0);
681
681
  o.setFullYear(r + 1, 0, a), o.setHours(0, 0, 0, 0);
682
- const i = _(o, e), c = E(e?.in || t, 0);
683
- c.setFullYear(r, 0, a), c.setHours(0, 0, 0, 0);
684
- const u = _(c, e);
685
- return +n >= +i ? r + 1 : +n >= +u ? r : r - 1;
682
+ const c = I(o, e), i = E(e?.in || t, 0);
683
+ i.setFullYear(r, 0, a), i.setHours(0, 0, 0, 0);
684
+ const u = I(i, e);
685
+ return +n >= +c ? r + 1 : +n >= +u ? r : r - 1;
686
686
  }
687
- function Cn(t, e) {
687
+ function Sn(t, e) {
688
688
  const n = $(), r = e?.firstWeekContainsDate ?? e?.locale?.options?.firstWeekContainsDate ?? n.firstWeekContainsDate ?? n.locale?.options?.firstWeekContainsDate ?? 1, s = me(t, e), a = E(e?.in || t, 0);
689
- return a.setFullYear(s, 0, r), a.setHours(0, 0, 0, 0), _(a, e);
689
+ return a.setFullYear(s, 0, r), a.setHours(0, 0, 0, 0), I(a, e);
690
690
  }
691
- function dt(t, e) {
692
- const n = p(t, e?.in), r = +_(n, e) - +Cn(n, e);
693
- return Math.round(r / at) + 1;
691
+ function lt(t, e) {
692
+ const n = p(t, e?.in), r = +I(n, e) - +Sn(n, e);
693
+ return Math.round(r / ot) + 1;
694
694
  }
695
695
  function g(t, e) {
696
696
  const n = t < 0 ? "-" : "", r = Math.abs(t).toString().padStart(e, "0");
@@ -749,14 +749,14 @@ const R = {
749
749
  );
750
750
  return g(s, e.length);
751
751
  }
752
- }, L = {
752
+ }, S = {
753
753
  midnight: "midnight",
754
754
  noon: "noon",
755
755
  morning: "morning",
756
756
  afternoon: "afternoon",
757
757
  evening: "evening",
758
758
  night: "night"
759
- }, $e = {
759
+ }, We = {
760
760
  // Era
761
761
  G: function(t, e, n) {
762
762
  const r = t.getFullYear() > 0 ? 1 : 0;
@@ -792,7 +792,7 @@ const R = {
792
792
  },
793
793
  // ISO week-numbering year
794
794
  R: function(t, e) {
795
- const n = it(t);
795
+ const n = ct(t);
796
796
  return g(n, e.length);
797
797
  },
798
798
  // Extended year. This is a single number designating the year of this calendar system.
@@ -929,12 +929,12 @@ const R = {
929
929
  },
930
930
  // Local week of year
931
931
  w: function(t, e, n, r) {
932
- const s = dt(t, r);
932
+ const s = lt(t, r);
933
933
  return e === "wo" ? n.ordinalNumber(s, { unit: "week" }) : g(s, e.length);
934
934
  },
935
935
  // ISO week of year
936
936
  I: function(t, e, n) {
937
- const r = ut(t);
937
+ const r = dt(t);
938
938
  return e === "Io" ? n.ordinalNumber(r, { unit: "week" }) : g(r, e.length);
939
939
  },
940
940
  // Day of the month
@@ -943,7 +943,7 @@ const R = {
943
943
  },
944
944
  // Day of year
945
945
  D: function(t, e, n) {
946
- const r = Yn(t);
946
+ const r = Cn(t);
947
947
  return e === "Do" ? n.ordinalNumber(r, { unit: "dayOfYear" }) : g(r, e.length);
948
948
  },
949
949
  // Day of week
@@ -1120,7 +1120,7 @@ const R = {
1120
1120
  b: function(t, e, n) {
1121
1121
  const r = t.getHours();
1122
1122
  let s;
1123
- switch (r === 12 ? s = L.noon : r === 0 ? s = L.midnight : s = r / 12 >= 1 ? "pm" : "am", e) {
1123
+ switch (r === 12 ? s = S.noon : r === 0 ? s = S.midnight : s = r / 12 >= 1 ? "pm" : "am", e) {
1124
1124
  case "b":
1125
1125
  case "bb":
1126
1126
  return n.dayPeriod(s, {
@@ -1148,7 +1148,7 @@ const R = {
1148
1148
  B: function(t, e, n) {
1149
1149
  const r = t.getHours();
1150
1150
  let s;
1151
- switch (r >= 17 ? s = L.evening : r >= 12 ? s = L.afternoon : r >= 4 ? s = L.morning : s = L.night, e) {
1151
+ switch (r >= 17 ? s = S.evening : r >= 12 ? s = S.afternoon : r >= 4 ? s = S.morning : s = S.night, e) {
1152
1152
  case "B":
1153
1153
  case "BB":
1154
1154
  case "BBB":
@@ -1210,7 +1210,7 @@ const R = {
1210
1210
  switch (e) {
1211
1211
  // Hours and optional minutes
1212
1212
  case "X":
1213
- return qe(r);
1213
+ return Ue(r);
1214
1214
  // Hours, minutes and optional seconds without `:` delimiter
1215
1215
  // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
1216
1216
  // so this token always has the same output as `XX`
@@ -1228,7 +1228,7 @@ const R = {
1228
1228
  switch (e) {
1229
1229
  // Hours and optional minutes
1230
1230
  case "x":
1231
- return qe(r);
1231
+ return Ue(r);
1232
1232
  // Hours, minutes and optional seconds without `:` delimiter
1233
1233
  // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
1234
1234
  // so this token always has the same output as `xx`
@@ -1248,7 +1248,7 @@ const R = {
1248
1248
  case "O":
1249
1249
  case "OO":
1250
1250
  case "OOO":
1251
- return "GMT" + We(r, ":");
1251
+ return "GMT" + qe(r, ":");
1252
1252
  default:
1253
1253
  return "GMT" + Y(r, ":");
1254
1254
  }
@@ -1261,7 +1261,7 @@ const R = {
1261
1261
  case "z":
1262
1262
  case "zz":
1263
1263
  case "zzz":
1264
- return "GMT" + We(r, ":");
1264
+ return "GMT" + qe(r, ":");
1265
1265
  default:
1266
1266
  return "GMT" + Y(r, ":");
1267
1267
  }
@@ -1276,18 +1276,18 @@ const R = {
1276
1276
  return g(+t, e.length);
1277
1277
  }
1278
1278
  };
1279
- function We(t, e = "") {
1279
+ function qe(t, e = "") {
1280
1280
  const n = t > 0 ? "-" : "+", r = Math.abs(t), s = Math.trunc(r / 60), a = r % 60;
1281
1281
  return a === 0 ? n + String(s) : n + String(s) + e + g(a, 2);
1282
1282
  }
1283
- function qe(t, e) {
1283
+ function Ue(t, e) {
1284
1284
  return t % 60 === 0 ? (t > 0 ? "-" : "+") + g(Math.abs(t) / 60, 2) : Y(t, e);
1285
1285
  }
1286
1286
  function Y(t, e = "") {
1287
1287
  const n = t > 0 ? "-" : "+", r = Math.abs(t), s = g(Math.trunc(r / 60), 2), a = g(r % 60, 2);
1288
1288
  return n + s + e + a;
1289
1289
  }
1290
- const Ue = (t, e) => {
1290
+ const He = (t, e) => {
1291
1291
  switch (t) {
1292
1292
  case "P":
1293
1293
  return e.date({ width: "short" });
@@ -1298,7 +1298,7 @@ const Ue = (t, e) => {
1298
1298
  default:
1299
1299
  return e.date({ width: "full" });
1300
1300
  }
1301
- }, lt = (t, e) => {
1301
+ }, ft = (t, e) => {
1302
1302
  switch (t) {
1303
1303
  case "p":
1304
1304
  return e.time({ width: "short" });
@@ -1312,7 +1312,7 @@ const Ue = (t, e) => {
1312
1312
  }, Ln = (t, e) => {
1313
1313
  const n = t.match(/(P+)(p+)?/) || [], r = n[1], s = n[2];
1314
1314
  if (!s)
1315
- return Ue(t, e);
1315
+ return He(t, e);
1316
1316
  let a;
1317
1317
  switch (r) {
1318
1318
  case "P":
@@ -1328,78 +1328,78 @@ const Ue = (t, e) => {
1328
1328
  a = e.dateTime({ width: "full" });
1329
1329
  break;
1330
1330
  }
1331
- return a.replace("{{date}}", Ue(r, e)).replace("{{time}}", lt(s, e));
1331
+ return a.replace("{{date}}", He(r, e)).replace("{{time}}", ft(s, e));
1332
1332
  }, re = {
1333
- p: lt,
1333
+ p: ft,
1334
1334
  P: Ln
1335
- }, Sn = /^D+$/, $n = /^Y+$/, Wn = ["D", "DD", "YY", "YYYY"];
1336
- function ft(t) {
1337
- return Sn.test(t);
1338
- }
1335
+ }, $n = /^D+$/, Wn = /^Y+$/, qn = ["D", "DD", "YY", "YYYY"];
1339
1336
  function mt(t) {
1340
1337
  return $n.test(t);
1341
1338
  }
1339
+ function ht(t) {
1340
+ return Wn.test(t);
1341
+ }
1342
1342
  function se(t, e, n) {
1343
- const r = qn(t, e, n);
1344
- if (console.warn(r), Wn.includes(t)) throw new RangeError(r);
1343
+ const r = Un(t, e, n);
1344
+ if (console.warn(r), qn.includes(t)) throw new RangeError(r);
1345
1345
  }
1346
- function qn(t, e, n) {
1346
+ function Un(t, e, n) {
1347
1347
  const r = t[0] === "Y" ? "years" : "days of the month";
1348
1348
  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`;
1349
1349
  }
1350
- const Un = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, Hn = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, Fn = /^'([^]*?)'?$/, Qn = /''/g, Bn = /[a-zA-Z]/;
1351
- function Vn(t, e, n) {
1352
- const r = $(), s = r.locale ?? ct, a = r.firstWeekContainsDate ?? r.locale?.options?.firstWeekContainsDate ?? 1, o = r.weekStartsOn ?? r.locale?.options?.weekStartsOn ?? 0, i = p(t, n?.in);
1353
- if (!ne(i))
1350
+ const Hn = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, Fn = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, Qn = /^'([^]*?)'?$/, Bn = /''/g, Vn = /[a-zA-Z]/;
1351
+ function Gn(t, e, n) {
1352
+ const r = $(), s = r.locale ?? ut, a = r.firstWeekContainsDate ?? r.locale?.options?.firstWeekContainsDate ?? 1, o = r.weekStartsOn ?? r.locale?.options?.weekStartsOn ?? 0, c = p(t, n?.in);
1353
+ if (!ne(c))
1354
1354
  throw new RangeError("Invalid time value");
1355
- let c = e.match(Hn).map((d) => {
1355
+ let i = e.match(Fn).map((d) => {
1356
1356
  const l = d[0];
1357
1357
  if (l === "p" || l === "P") {
1358
1358
  const m = re[l];
1359
1359
  return m(d, s.formatLong);
1360
1360
  }
1361
1361
  return d;
1362
- }).join("").match(Un).map((d) => {
1362
+ }).join("").match(Hn).map((d) => {
1363
1363
  if (d === "''")
1364
1364
  return { isToken: !1, value: "'" };
1365
1365
  const l = d[0];
1366
1366
  if (l === "'")
1367
- return { isToken: !1, value: Gn(d) };
1368
- if ($e[l])
1367
+ return { isToken: !1, value: Xn(d) };
1368
+ if (We[l])
1369
1369
  return { isToken: !0, value: d };
1370
- if (l.match(Bn))
1370
+ if (l.match(Vn))
1371
1371
  throw new RangeError(
1372
1372
  "Format string contains an unescaped latin alphabet character `" + l + "`"
1373
1373
  );
1374
1374
  return { isToken: !1, value: d };
1375
1375
  });
1376
- s.localize.preprocessor && (c = s.localize.preprocessor(i, c));
1376
+ s.localize.preprocessor && (i = s.localize.preprocessor(c, i));
1377
1377
  const u = {
1378
1378
  firstWeekContainsDate: a,
1379
1379
  weekStartsOn: o,
1380
1380
  locale: s
1381
1381
  };
1382
- return c.map((d) => {
1382
+ return i.map((d) => {
1383
1383
  if (!d.isToken) return d.value;
1384
1384
  const l = d.value;
1385
- (mt(l) || ft(l)) && se(l, e, String(t));
1386
- const m = $e[l[0]];
1387
- return m(i, l, s.localize, u);
1385
+ (ht(l) || mt(l)) && se(l, e, String(t));
1386
+ const m = We[l[0]];
1387
+ return m(c, l, s.localize, u);
1388
1388
  }).join("");
1389
1389
  }
1390
- function Gn(t) {
1391
- const e = t.match(Fn);
1392
- return e ? e[1].replace(Qn, "'") : t;
1390
+ function Xn(t) {
1391
+ const e = t.match(Qn);
1392
+ return e ? e[1].replace(Bn, "'") : t;
1393
1393
  }
1394
1394
  function jn() {
1395
1395
  return Object.assign({}, $());
1396
1396
  }
1397
- function Xn(t, e) {
1397
+ function zn(t, e) {
1398
1398
  const n = p(t, e?.in).getDay();
1399
1399
  return n === 0 ? 7 : n;
1400
1400
  }
1401
- function zn(t, e) {
1402
- const n = Kn(e) ? new e(0) : E(e, 0);
1401
+ function Kn(t, e) {
1402
+ const n = Jn(e) ? new e(0) : E(e, 0);
1403
1403
  return n.setFullYear(t.getFullYear(), t.getMonth(), t.getDate()), n.setHours(
1404
1404
  t.getHours(),
1405
1405
  t.getMinutes(),
@@ -1407,17 +1407,17 @@ function zn(t, e) {
1407
1407
  t.getMilliseconds()
1408
1408
  ), n;
1409
1409
  }
1410
- function Kn(t) {
1410
+ function Jn(t) {
1411
1411
  return typeof t == "function" && t.prototype?.constructor === t;
1412
1412
  }
1413
- const Jn = 10;
1414
- class ht {
1413
+ const Zn = 10;
1414
+ class gt {
1415
1415
  subPriority = 0;
1416
1416
  validate(e, n) {
1417
1417
  return !0;
1418
1418
  }
1419
1419
  }
1420
- class Zn extends ht {
1420
+ class er extends gt {
1421
1421
  constructor(e, n, r, s, a) {
1422
1422
  super(), this.value = e, this.validateValue = n, this.setValue = r, this.priority = s, a && (this.subPriority = a);
1423
1423
  }
@@ -1428,21 +1428,21 @@ class Zn extends ht {
1428
1428
  return this.setValue(e, n, this.value, r);
1429
1429
  }
1430
1430
  }
1431
- class er extends ht {
1432
- priority = Jn;
1431
+ class tr extends gt {
1432
+ priority = Zn;
1433
1433
  subPriority = -1;
1434
1434
  constructor(e, n) {
1435
1435
  super(), this.context = e || ((r) => E(n, r));
1436
1436
  }
1437
1437
  set(e, n) {
1438
- return n.timestampIsSet ? e : E(e, zn(e, this.context));
1438
+ return n.timestampIsSet ? e : E(e, Kn(e, this.context));
1439
1439
  }
1440
1440
  }
1441
1441
  class h {
1442
1442
  run(e, n, r, s) {
1443
1443
  const a = this.parse(e, n, r, s);
1444
1444
  return a ? {
1445
- setter: new Zn(
1445
+ setter: new er(
1446
1446
  a.value,
1447
1447
  this.validate,
1448
1448
  this.set,
@@ -1456,7 +1456,7 @@ class h {
1456
1456
  return !0;
1457
1457
  }
1458
1458
  }
1459
- class tr extends h {
1459
+ class nr extends h {
1460
1460
  priority = 140;
1461
1461
  parse(e, n, r) {
1462
1462
  switch (n) {
@@ -1550,7 +1550,7 @@ function A(t, e) {
1550
1550
  rest: e.slice(n[0].length)
1551
1551
  };
1552
1552
  }
1553
- function gt(t) {
1553
+ function wt(t) {
1554
1554
  return y(D.anyDigitsSigned, t);
1555
1555
  }
1556
1556
  function b(t, e) {
@@ -1595,21 +1595,21 @@ function he(t) {
1595
1595
  return 0;
1596
1596
  }
1597
1597
  }
1598
- function wt(t, e) {
1598
+ function yt(t, e) {
1599
1599
  const n = e > 0, r = n ? e : 1 - e;
1600
1600
  let s;
1601
1601
  if (r <= 50)
1602
1602
  s = t || 100;
1603
1603
  else {
1604
- const a = r + 50, o = Math.trunc(a / 100) * 100, i = t >= a % 100;
1605
- s = t + o - (i ? 100 : 0);
1604
+ const a = r + 50, o = Math.trunc(a / 100) * 100, c = t >= a % 100;
1605
+ s = t + o - (c ? 100 : 0);
1606
1606
  }
1607
1607
  return n ? s : 1 - s;
1608
1608
  }
1609
- function yt(t) {
1609
+ function pt(t) {
1610
1610
  return t % 400 === 0 || t % 4 === 0 && t % 100 !== 0;
1611
1611
  }
1612
- class nr extends h {
1612
+ class rr extends h {
1613
1613
  priority = 130;
1614
1614
  incompatibleTokens = ["Y", "R", "u", "w", "I", "i", "e", "c", "t", "T"];
1615
1615
  parse(e, n, r) {
@@ -1637,7 +1637,7 @@ class nr extends h {
1637
1637
  set(e, n, r) {
1638
1638
  const s = e.getFullYear();
1639
1639
  if (r.isTwoDigitYear) {
1640
- const o = wt(
1640
+ const o = yt(
1641
1641
  r.year,
1642
1642
  s
1643
1643
  );
@@ -1647,7 +1647,7 @@ class nr extends h {
1647
1647
  return e.setFullYear(a, 0, 1), e.setHours(0, 0, 0, 0), e;
1648
1648
  }
1649
1649
  }
1650
- class rr extends h {
1650
+ class sr extends h {
1651
1651
  priority = 130;
1652
1652
  parse(e, n, r) {
1653
1653
  const s = (a) => ({
@@ -1674,18 +1674,18 @@ class rr extends h {
1674
1674
  set(e, n, r, s) {
1675
1675
  const a = me(e, s);
1676
1676
  if (r.isTwoDigitYear) {
1677
- const i = wt(
1677
+ const c = yt(
1678
1678
  r.year,
1679
1679
  a
1680
1680
  );
1681
1681
  return e.setFullYear(
1682
- i,
1682
+ c,
1683
1683
  0,
1684
1684
  s.firstWeekContainsDate
1685
- ), e.setHours(0, 0, 0, 0), _(e, s);
1685
+ ), e.setHours(0, 0, 0, 0), I(e, s);
1686
1686
  }
1687
1687
  const o = !("era" in n) || n.era === 1 ? r.year : 1 - r.year;
1688
- return e.setFullYear(o, 0, s.firstWeekContainsDate), e.setHours(0, 0, 0, 0), _(e, s);
1688
+ return e.setFullYear(o, 0, s.firstWeekContainsDate), e.setHours(0, 0, 0, 0), I(e, s);
1689
1689
  }
1690
1690
  incompatibleTokens = [
1691
1691
  "y",
@@ -1703,14 +1703,14 @@ class rr extends h {
1703
1703
  "T"
1704
1704
  ];
1705
1705
  }
1706
- class sr extends h {
1706
+ class ar extends h {
1707
1707
  priority = 130;
1708
1708
  parse(e, n) {
1709
1709
  return J(n === "R" ? 4 : n.length, e);
1710
1710
  }
1711
1711
  set(e, n, r) {
1712
1712
  const s = E(e, 0);
1713
- return s.setFullYear(r, 0, 4), s.setHours(0, 0, 0, 0), S(s);
1713
+ return s.setFullYear(r, 0, 4), s.setHours(0, 0, 0, 0), L(s);
1714
1714
  }
1715
1715
  incompatibleTokens = [
1716
1716
  "G",
@@ -1730,7 +1730,7 @@ class sr extends h {
1730
1730
  "T"
1731
1731
  ];
1732
1732
  }
1733
- class ar extends h {
1733
+ class or extends h {
1734
1734
  priority = 130;
1735
1735
  parse(e, n) {
1736
1736
  return J(n === "u" ? 4 : n.length, e);
@@ -1740,7 +1740,7 @@ class ar extends h {
1740
1740
  }
1741
1741
  incompatibleTokens = ["G", "y", "Y", "R", "w", "I", "i", "e", "c", "t", "T"];
1742
1742
  }
1743
- class or extends h {
1743
+ class ir extends h {
1744
1744
  priority = 120;
1745
1745
  parse(e, n, r) {
1746
1746
  switch (n) {
@@ -1802,7 +1802,7 @@ class or extends h {
1802
1802
  "T"
1803
1803
  ];
1804
1804
  }
1805
- class ir extends h {
1805
+ class cr extends h {
1806
1806
  priority = 120;
1807
1807
  parse(e, n, r) {
1808
1808
  switch (n) {
@@ -1864,7 +1864,7 @@ class ir extends h {
1864
1864
  "T"
1865
1865
  ];
1866
1866
  }
1867
- class cr extends h {
1867
+ class ur extends h {
1868
1868
  incompatibleTokens = [
1869
1869
  "Y",
1870
1870
  "R",
@@ -1927,7 +1927,7 @@ class cr extends h {
1927
1927
  return e.setMonth(r, 1), e.setHours(0, 0, 0, 0), e;
1928
1928
  }
1929
1929
  }
1930
- class ur extends h {
1930
+ class dr extends h {
1931
1931
  priority = 110;
1932
1932
  parse(e, n, r) {
1933
1933
  const s = (a) => a - 1;
@@ -1990,11 +1990,11 @@ class ur extends h {
1990
1990
  "T"
1991
1991
  ];
1992
1992
  }
1993
- function dr(t, e, n) {
1994
- const r = p(t, n?.in), s = dt(r, n) - e;
1993
+ function lr(t, e, n) {
1994
+ const r = p(t, n?.in), s = lt(r, n) - e;
1995
1995
  return r.setDate(r.getDate() - s * 7), p(r, n?.in);
1996
1996
  }
1997
- class lr extends h {
1997
+ class fr extends h {
1998
1998
  priority = 100;
1999
1999
  parse(e, n, r) {
2000
2000
  switch (n) {
@@ -2010,7 +2010,7 @@ class lr extends h {
2010
2010
  return n >= 1 && n <= 53;
2011
2011
  }
2012
2012
  set(e, n, r, s) {
2013
- return _(dr(e, r, s), s);
2013
+ return I(lr(e, r, s), s);
2014
2014
  }
2015
2015
  incompatibleTokens = [
2016
2016
  "y",
@@ -2028,11 +2028,11 @@ class lr extends h {
2028
2028
  "T"
2029
2029
  ];
2030
2030
  }
2031
- function fr(t, e, n) {
2032
- const r = p(t, n?.in), s = ut(r, n) - e;
2031
+ function mr(t, e, n) {
2032
+ const r = p(t, n?.in), s = dt(r, n) - e;
2033
2033
  return r.setDate(r.getDate() - s * 7), r;
2034
2034
  }
2035
- class mr extends h {
2035
+ class hr extends h {
2036
2036
  priority = 100;
2037
2037
  parse(e, n, r) {
2038
2038
  switch (n) {
@@ -2048,7 +2048,7 @@ class mr extends h {
2048
2048
  return n >= 1 && n <= 53;
2049
2049
  }
2050
2050
  set(e, n, r) {
2051
- return S(fr(e, r));
2051
+ return L(mr(e, r));
2052
2052
  }
2053
2053
  incompatibleTokens = [
2054
2054
  "y",
@@ -2067,7 +2067,7 @@ class mr extends h {
2067
2067
  "T"
2068
2068
  ];
2069
2069
  }
2070
- const hr = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], gr = [
2070
+ const gr = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], wr = [
2071
2071
  31,
2072
2072
  29,
2073
2073
  31,
@@ -2081,7 +2081,7 @@ const hr = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], gr = [
2081
2081
  30,
2082
2082
  31
2083
2083
  ];
2084
- class wr extends h {
2084
+ class yr extends h {
2085
2085
  priority = 90;
2086
2086
  subPriority = 1;
2087
2087
  parse(e, n, r) {
@@ -2095,8 +2095,8 @@ class wr extends h {
2095
2095
  }
2096
2096
  }
2097
2097
  validate(e, n) {
2098
- const r = e.getFullYear(), s = yt(r), a = e.getMonth();
2099
- return s ? n >= 1 && n <= gr[a] : n >= 1 && n <= hr[a];
2098
+ const r = e.getFullYear(), s = pt(r), a = e.getMonth();
2099
+ return s ? n >= 1 && n <= wr[a] : n >= 1 && n <= gr[a];
2100
2100
  }
2101
2101
  set(e, n, r) {
2102
2102
  return e.setDate(r), e.setHours(0, 0, 0, 0), e;
@@ -2116,7 +2116,7 @@ class wr extends h {
2116
2116
  "T"
2117
2117
  ];
2118
2118
  }
2119
- class yr extends h {
2119
+ class pr extends h {
2120
2120
  priority = 90;
2121
2121
  subpriority = 1;
2122
2122
  parse(e, n, r) {
@@ -2132,7 +2132,7 @@ class yr extends h {
2132
2132
  }
2133
2133
  validate(e, n) {
2134
2134
  const r = e.getFullYear();
2135
- return yt(r) ? n >= 1 && n <= 366 : n >= 1 && n <= 365;
2135
+ return pt(r) ? n >= 1 && n <= 366 : n >= 1 && n <= 365;
2136
2136
  }
2137
2137
  set(e, n, r) {
2138
2138
  return e.setMonth(0, r), e.setHours(0, 0, 0, 0), e;
@@ -2156,10 +2156,10 @@ class yr extends h {
2156
2156
  ];
2157
2157
  }
2158
2158
  function ge(t, e, n) {
2159
- const r = $(), s = n?.weekStartsOn ?? n?.locale?.options?.weekStartsOn ?? r.weekStartsOn ?? r.locale?.options?.weekStartsOn ?? 0, a = p(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;
2160
- return ot(a, d, n);
2159
+ const r = $(), s = n?.weekStartsOn ?? n?.locale?.options?.weekStartsOn ?? r.weekStartsOn ?? r.locale?.options?.weekStartsOn ?? 0, a = p(t, n?.in), o = a.getDay(), i = (e % 7 + 7) % 7, u = 7 - s, d = e < 0 || e > 6 ? e - (o + u) % 7 : (i + u) % 7 - (o + u) % 7;
2160
+ return it(a, d, n);
2161
2161
  }
2162
- class pr extends h {
2162
+ class br extends h {
2163
2163
  priority = 90;
2164
2164
  parse(e, n, r) {
2165
2165
  switch (n) {
@@ -2195,12 +2195,12 @@ class pr extends h {
2195
2195
  }
2196
2196
  incompatibleTokens = ["D", "i", "e", "c", "t", "T"];
2197
2197
  }
2198
- class br extends h {
2198
+ class Dr extends h {
2199
2199
  priority = 90;
2200
2200
  parse(e, n, r, s) {
2201
2201
  const a = (o) => {
2202
- const i = Math.floor((o - 1) / 7) * 7;
2203
- return (o + s.weekStartsOn + 6) % 7 + i;
2202
+ const c = Math.floor((o - 1) / 7) * 7;
2203
+ return (o + s.weekStartsOn + 6) % 7 + c;
2204
2204
  };
2205
2205
  switch (n) {
2206
2206
  // 3
@@ -2261,12 +2261,12 @@ class br extends h {
2261
2261
  "T"
2262
2262
  ];
2263
2263
  }
2264
- class Dr extends h {
2264
+ class Tr extends h {
2265
2265
  priority = 90;
2266
2266
  parse(e, n, r, s) {
2267
2267
  const a = (o) => {
2268
- const i = Math.floor((o - 1) / 7) * 7;
2269
- return (o + s.weekStartsOn + 6) % 7 + i;
2268
+ const c = Math.floor((o - 1) / 7) * 7;
2269
+ return (o + s.weekStartsOn + 6) % 7 + c;
2270
2270
  };
2271
2271
  switch (n) {
2272
2272
  // 3
@@ -2327,11 +2327,11 @@ class Dr extends h {
2327
2327
  "T"
2328
2328
  ];
2329
2329
  }
2330
- function Tr(t, e, n) {
2331
- const r = p(t, n?.in), s = Xn(r, n), a = e - s;
2332
- return ot(r, a, n);
2330
+ function Er(t, e, n) {
2331
+ const r = p(t, n?.in), s = zn(r, n), a = e - s;
2332
+ return it(r, a, n);
2333
2333
  }
2334
- class Er extends h {
2334
+ class xr extends h {
2335
2335
  priority = 90;
2336
2336
  parse(e, n, r) {
2337
2337
  const s = (a) => a === 0 ? 7 : a;
@@ -2402,7 +2402,7 @@ class Er extends h {
2402
2402
  return n >= 1 && n <= 7;
2403
2403
  }
2404
2404
  set(e, n, r) {
2405
- return e = Tr(e, r), e.setHours(0, 0, 0, 0), e;
2405
+ return e = Er(e, r), e.setHours(0, 0, 0, 0), e;
2406
2406
  }
2407
2407
  incompatibleTokens = [
2408
2408
  "y",
@@ -2422,7 +2422,7 @@ class Er extends h {
2422
2422
  "T"
2423
2423
  ];
2424
2424
  }
2425
- class xr extends h {
2425
+ class Pr extends h {
2426
2426
  priority = 80;
2427
2427
  parse(e, n, r) {
2428
2428
  switch (n) {
@@ -2459,7 +2459,7 @@ class xr extends h {
2459
2459
  }
2460
2460
  incompatibleTokens = ["b", "B", "H", "k", "t", "T"];
2461
2461
  }
2462
- class Pr extends h {
2462
+ class vr extends h {
2463
2463
  priority = 80;
2464
2464
  parse(e, n, r) {
2465
2465
  switch (n) {
@@ -2496,7 +2496,7 @@ class Pr extends h {
2496
2496
  }
2497
2497
  incompatibleTokens = ["a", "B", "H", "k", "t", "T"];
2498
2498
  }
2499
- class vr extends h {
2499
+ class Mr extends h {
2500
2500
  priority = 80;
2501
2501
  parse(e, n, r) {
2502
2502
  switch (n) {
@@ -2533,7 +2533,7 @@ class vr extends h {
2533
2533
  }
2534
2534
  incompatibleTokens = ["a", "b", "t", "T"];
2535
2535
  }
2536
- class Mr extends h {
2536
+ class Or extends h {
2537
2537
  priority = 70;
2538
2538
  parse(e, n, r) {
2539
2539
  switch (n) {
@@ -2554,7 +2554,7 @@ class Mr extends h {
2554
2554
  }
2555
2555
  incompatibleTokens = ["H", "K", "k", "t", "T"];
2556
2556
  }
2557
- class Or extends h {
2557
+ class Ar extends h {
2558
2558
  priority = 70;
2559
2559
  parse(e, n, r) {
2560
2560
  switch (n) {
@@ -2574,7 +2574,7 @@ class Or extends h {
2574
2574
  }
2575
2575
  incompatibleTokens = ["a", "b", "h", "K", "k", "t", "T"];
2576
2576
  }
2577
- class Ar extends h {
2577
+ class Nr extends h {
2578
2578
  priority = 70;
2579
2579
  parse(e, n, r) {
2580
2580
  switch (n) {
@@ -2594,7 +2594,7 @@ class Ar extends h {
2594
2594
  }
2595
2595
  incompatibleTokens = ["h", "H", "k", "t", "T"];
2596
2596
  }
2597
- class Nr extends h {
2597
+ class Rr extends h {
2598
2598
  priority = 70;
2599
2599
  parse(e, n, r) {
2600
2600
  switch (n) {
@@ -2615,7 +2615,7 @@ class Nr extends h {
2615
2615
  }
2616
2616
  incompatibleTokens = ["a", "b", "h", "H", "K", "t", "T"];
2617
2617
  }
2618
- class Rr extends h {
2618
+ class kr extends h {
2619
2619
  priority = 60;
2620
2620
  parse(e, n, r) {
2621
2621
  switch (n) {
@@ -2635,7 +2635,7 @@ class Rr extends h {
2635
2635
  }
2636
2636
  incompatibleTokens = ["t", "T"];
2637
2637
  }
2638
- class kr extends h {
2638
+ class _r extends h {
2639
2639
  priority = 50;
2640
2640
  parse(e, n, r) {
2641
2641
  switch (n) {
@@ -2666,7 +2666,7 @@ class Ir extends h {
2666
2666
  }
2667
2667
  incompatibleTokens = ["t", "T"];
2668
2668
  }
2669
- class _r extends h {
2669
+ class Yr extends h {
2670
2670
  priority = 10;
2671
2671
  parse(e, n) {
2672
2672
  switch (n) {
@@ -2699,7 +2699,7 @@ class _r extends h {
2699
2699
  }
2700
2700
  incompatibleTokens = ["t", "T", "x"];
2701
2701
  }
2702
- class Yr extends h {
2702
+ class Cr extends h {
2703
2703
  priority = 10;
2704
2704
  parse(e, n) {
2705
2705
  switch (n) {
@@ -2732,10 +2732,10 @@ class Yr extends h {
2732
2732
  }
2733
2733
  incompatibleTokens = ["t", "T", "X"];
2734
2734
  }
2735
- class Cr extends h {
2735
+ class Sr extends h {
2736
2736
  priority = 40;
2737
2737
  parse(e) {
2738
- return gt(e);
2738
+ return wt(e);
2739
2739
  }
2740
2740
  set(e, n, r) {
2741
2741
  return [E(e, r * 1e3), { timestampIsSet: !0 }];
@@ -2745,65 +2745,65 @@ class Cr extends h {
2745
2745
  class Lr extends h {
2746
2746
  priority = 20;
2747
2747
  parse(e) {
2748
- return gt(e);
2748
+ return wt(e);
2749
2749
  }
2750
2750
  set(e, n, r) {
2751
2751
  return [E(e, r), { timestampIsSet: !0 }];
2752
2752
  }
2753
2753
  incompatibleTokens = "*";
2754
2754
  }
2755
- const Sr = {
2756
- G: new tr(),
2757
- y: new nr(),
2758
- Y: new rr(),
2759
- R: new sr(),
2760
- u: new ar(),
2761
- Q: new or(),
2762
- q: new ir(),
2763
- M: new cr(),
2764
- L: new ur(),
2765
- w: new lr(),
2766
- I: new mr(),
2767
- d: new wr(),
2768
- D: new yr(),
2769
- E: new pr(),
2770
- e: new br(),
2771
- c: new Dr(),
2772
- i: new Er(),
2773
- a: new xr(),
2774
- b: new Pr(),
2775
- B: new vr(),
2776
- h: new Mr(),
2777
- H: new Or(),
2778
- K: new Ar(),
2779
- k: new Nr(),
2780
- m: new Rr(),
2781
- s: new kr(),
2755
+ const $r = {
2756
+ G: new nr(),
2757
+ y: new rr(),
2758
+ Y: new sr(),
2759
+ R: new ar(),
2760
+ u: new or(),
2761
+ Q: new ir(),
2762
+ q: new cr(),
2763
+ M: new ur(),
2764
+ L: new dr(),
2765
+ w: new fr(),
2766
+ I: new hr(),
2767
+ d: new yr(),
2768
+ D: new pr(),
2769
+ E: new br(),
2770
+ e: new Dr(),
2771
+ c: new Tr(),
2772
+ i: new xr(),
2773
+ a: new Pr(),
2774
+ b: new vr(),
2775
+ B: new Mr(),
2776
+ h: new Or(),
2777
+ H: new Ar(),
2778
+ K: new Nr(),
2779
+ k: new Rr(),
2780
+ m: new kr(),
2781
+ s: new _r(),
2782
2782
  S: new Ir(),
2783
- X: new _r(),
2784
- x: new Yr(),
2785
- t: new Cr(),
2783
+ X: new Yr(),
2784
+ x: new Cr(),
2785
+ t: new Sr(),
2786
2786
  T: new Lr()
2787
- }, $r = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, Wr = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, qr = /^'([^]*?)'?$/, Ur = /''/g, Hr = /\S/, Fr = /[a-zA-Z]/;
2788
- function Qr(t, e, n, r) {
2789
- const s = () => E(n, NaN), a = jn(), o = a.locale ?? ct, i = a.firstWeekContainsDate ?? a.locale?.options?.firstWeekContainsDate ?? 1, c = a.weekStartsOn ?? a.locale?.options?.weekStartsOn ?? 0;
2787
+ }, Wr = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, qr = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, Ur = /^'([^]*?)'?$/, Hr = /''/g, Fr = /\S/, Qr = /[a-zA-Z]/;
2788
+ function Br(t, e, n, r) {
2789
+ const s = () => E(n, NaN), a = jn(), o = a.locale ?? ut, c = a.firstWeekContainsDate ?? a.locale?.options?.firstWeekContainsDate ?? 1, i = a.weekStartsOn ?? a.locale?.options?.weekStartsOn ?? 0;
2790
2790
  if (!e)
2791
2791
  return t ? s() : p(n, r?.in);
2792
2792
  const u = {
2793
- firstWeekContainsDate: i,
2794
- weekStartsOn: c,
2793
+ firstWeekContainsDate: c,
2794
+ weekStartsOn: i,
2795
2795
  locale: o
2796
- }, d = [new er(r?.in, n)], l = e.match(Wr).map((f) => {
2796
+ }, d = [new tr(r?.in, n)], l = e.match(qr).map((f) => {
2797
2797
  const w = f[0];
2798
2798
  if (w in re) {
2799
2799
  const v = re[w];
2800
2800
  return v(f, o.formatLong);
2801
2801
  }
2802
2802
  return f;
2803
- }).join("").match($r), m = [];
2803
+ }).join("").match(Wr), m = [];
2804
2804
  for (let f of l) {
2805
- mt(f) && se(f, e, t), ft(f) && se(f, e, t);
2806
- const w = f[0], v = Sr[w];
2805
+ ht(f) && se(f, e, t), mt(f) && se(f, e, t);
2806
+ const w = f[0], v = $r[w];
2807
2807
  if (v) {
2808
2808
  const { incompatibleTokens: M } = v;
2809
2809
  if (Array.isArray(M)) {
@@ -2829,17 +2829,17 @@ function Qr(t, e, n, r) {
2829
2829
  return s();
2830
2830
  d.push(W.setter), t = W.rest;
2831
2831
  } else {
2832
- if (w.match(Fr))
2832
+ if (w.match(Qr))
2833
2833
  throw new RangeError(
2834
2834
  "Format string contains an unescaped latin alphabet character `" + w + "`"
2835
2835
  );
2836
- if (f === "''" ? f = "'" : w === "'" && (f = Br(f)), t.indexOf(f) === 0)
2836
+ if (f === "''" ? f = "'" : w === "'" && (f = Vr(f)), t.indexOf(f) === 0)
2837
2837
  t = t.slice(f.length);
2838
2838
  else
2839
2839
  return s();
2840
2840
  }
2841
2841
  }
2842
- if (t.length > 0 && Hr.test(t))
2842
+ if (t.length > 0 && Fr.test(t))
2843
2843
  return s();
2844
2844
  const x = d.map((f) => f.priority).sort((f, w) => w - f).filter((f, w, v) => v.indexOf(f) === w).map(
2845
2845
  (f) => d.filter((w) => w.priority === f).sort((w, v) => v.subPriority - w.subPriority)
@@ -2855,25 +2855,25 @@ function Qr(t, e, n, r) {
2855
2855
  }
2856
2856
  return P;
2857
2857
  }
2858
- function Br(t) {
2859
- return t.match(qr)[1].replace(Ur, "'");
2858
+ function Vr(t) {
2859
+ return t.match(Ur)[1].replace(Hr, "'");
2860
2860
  }
2861
- function Vr(t, e) {
2862
- const n = () => E(e?.in, NaN), s = zr(t);
2861
+ function Gr(t, e) {
2862
+ const n = () => E(e?.in, NaN), s = Kr(t);
2863
2863
  let a;
2864
2864
  if (s.date) {
2865
- const u = Kr(s.date, 2);
2866
- a = Jr(u.restDateString, u.year);
2865
+ const u = Jr(s.date, 2);
2866
+ a = Zr(u.restDateString, u.year);
2867
2867
  }
2868
2868
  if (!a || isNaN(+a)) return n();
2869
2869
  const o = +a;
2870
- let i = 0, c;
2871
- if (s.time && (i = Zr(s.time), isNaN(i)))
2870
+ let c = 0, i;
2871
+ if (s.time && (c = es(s.time), isNaN(c)))
2872
2872
  return n();
2873
2873
  if (s.timezone) {
2874
- if (c = es(s.timezone), isNaN(c)) return n();
2874
+ if (i = ts(s.timezone), isNaN(i)) return n();
2875
2875
  } else {
2876
- const u = new Date(o + i), d = p(0, e?.in);
2876
+ const u = new Date(o + c), d = p(0, e?.in);
2877
2877
  return d.setFullYear(
2878
2878
  u.getUTCFullYear(),
2879
2879
  u.getUTCMonth(),
@@ -2885,14 +2885,14 @@ function Vr(t, e) {
2885
2885
  u.getUTCMilliseconds()
2886
2886
  ), d;
2887
2887
  }
2888
- return p(o + i + c, e?.in);
2888
+ return p(o + c + i, e?.in);
2889
2889
  }
2890
2890
  const B = {
2891
2891
  dateTimeDelimiter: /[T ]/,
2892
2892
  timeZoneDelimiter: /[Z ]/i,
2893
2893
  timezone: /([Z+-].*)$/
2894
- }, Gr = /^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/, jr = /^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/, Xr = /^([+-])(\d{2})(?::?(\d{2}))?$/;
2895
- function zr(t) {
2894
+ }, Xr = /^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/, jr = /^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/, zr = /^([+-])(\d{2})(?::?(\d{2}))?$/;
2895
+ function Kr(t) {
2896
2896
  const e = {}, n = t.split(B.dateTimeDelimiter);
2897
2897
  let r;
2898
2898
  if (n.length > 2)
@@ -2906,7 +2906,7 @@ function zr(t) {
2906
2906
  }
2907
2907
  return e;
2908
2908
  }
2909
- function Kr(t, e) {
2909
+ function Jr(t, e) {
2910
2910
  const n = new RegExp(
2911
2911
  "^(?:(\\d{4}|[+-]\\d{" + (4 + e) + "})|(\\d{2}|[+-]\\d{" + (2 + e) + "})$)"
2912
2912
  ), r = t.match(n);
@@ -2917,84 +2917,84 @@ function Kr(t, e) {
2917
2917
  restDateString: t.slice((r[1] || r[2]).length)
2918
2918
  };
2919
2919
  }
2920
- function Jr(t, e) {
2920
+ function Zr(t, e) {
2921
2921
  if (e === null) return /* @__PURE__ */ new Date(NaN);
2922
- const n = t.match(Gr);
2922
+ const n = t.match(Xr);
2923
2923
  if (!n) return /* @__PURE__ */ new Date(NaN);
2924
- 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;
2924
+ const r = !!n[4], s = F(n[1]), a = F(n[2]) - 1, o = F(n[3]), c = F(n[4]), i = F(n[5]) - 1;
2925
2925
  if (r)
2926
- return as(e, i, c) ? ts(e, i, c) : /* @__PURE__ */ new Date(NaN);
2926
+ return os(e, c, i) ? ns(e, c, i) : /* @__PURE__ */ new Date(NaN);
2927
2927
  {
2928
2928
  const u = /* @__PURE__ */ new Date(0);
2929
- return !rs(e, a, o) || !ss(e, s) ? /* @__PURE__ */ new Date(NaN) : (u.setUTCFullYear(e, a, Math.max(s, o)), u);
2929
+ return !ss(e, a, o) || !as(e, s) ? /* @__PURE__ */ new Date(NaN) : (u.setUTCFullYear(e, a, Math.max(s, o)), u);
2930
2930
  }
2931
2931
  }
2932
2932
  function F(t) {
2933
2933
  return t ? parseInt(t) : 1;
2934
2934
  }
2935
- function Zr(t) {
2935
+ function es(t) {
2936
2936
  const e = t.match(jr);
2937
2937
  if (!e) return NaN;
2938
2938
  const n = te(e[1]), r = te(e[2]), s = te(e[3]);
2939
- return os(n, r, s) ? n * fe + r * le + s * 1e3 : NaN;
2939
+ return is(n, r, s) ? n * fe + r * le + s * 1e3 : NaN;
2940
2940
  }
2941
2941
  function te(t) {
2942
2942
  return t && parseFloat(t.replace(",", ".")) || 0;
2943
2943
  }
2944
- function es(t) {
2944
+ function ts(t) {
2945
2945
  if (t === "Z") return 0;
2946
- const e = t.match(Xr);
2946
+ const e = t.match(zr);
2947
2947
  if (!e) return 0;
2948
2948
  const n = e[1] === "+" ? -1 : 1, r = parseInt(e[2]), s = e[3] && parseInt(e[3]) || 0;
2949
- return is(r, s) ? n * (r * fe + s * le) : NaN;
2949
+ return cs(r, s) ? n * (r * fe + s * le) : NaN;
2950
2950
  }
2951
- function ts(t, e, n) {
2951
+ function ns(t, e, n) {
2952
2952
  const r = /* @__PURE__ */ new Date(0);
2953
2953
  r.setUTCFullYear(t, 0, 4);
2954
2954
  const s = r.getUTCDay() || 7, a = (e - 1) * 7 + n + 1 - s;
2955
2955
  return r.setUTCDate(r.getUTCDate() + a), r;
2956
2956
  }
2957
- const ns = [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
2958
- function pt(t) {
2957
+ const rs = [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
2958
+ function bt(t) {
2959
2959
  return t % 400 === 0 || t % 4 === 0 && t % 100 !== 0;
2960
2960
  }
2961
- function rs(t, e, n) {
2962
- return e >= 0 && e <= 11 && n >= 1 && n <= (ns[e] || (pt(t) ? 29 : 28));
2961
+ function ss(t, e, n) {
2962
+ return e >= 0 && e <= 11 && n >= 1 && n <= (rs[e] || (bt(t) ? 29 : 28));
2963
2963
  }
2964
- function ss(t, e) {
2965
- return e >= 1 && e <= (pt(t) ? 366 : 365);
2964
+ function as(t, e) {
2965
+ return e >= 1 && e <= (bt(t) ? 366 : 365);
2966
2966
  }
2967
- function as(t, e, n) {
2967
+ function os(t, e, n) {
2968
2968
  return e >= 1 && e <= 53 && n >= 0 && n <= 6;
2969
2969
  }
2970
- function os(t, e, n) {
2970
+ function is(t, e, n) {
2971
2971
  return t === 24 ? e === 0 && n === 0 : n >= 0 && n < 60 && e >= 0 && e < 60 && t >= 0 && t < 25;
2972
2972
  }
2973
- function is(t, e) {
2973
+ function cs(t, e) {
2974
2974
  return e >= 0 && e <= 59;
2975
2975
  }
2976
2976
  const V = (t) => {
2977
2977
  if (!t.includes("T")) {
2978
- for (const n of cs) {
2979
- const r = Qr(t, n, /* @__PURE__ */ new Date());
2978
+ for (const n of us) {
2979
+ const r = Br(t, n, /* @__PURE__ */ new Date());
2980
2980
  if (ne(r))
2981
2981
  return r;
2982
2982
  }
2983
2983
  return null;
2984
2984
  }
2985
- const e = Vr(t);
2985
+ const e = Gr(t);
2986
2986
  return ne(e) ? e : null;
2987
- }, cs = ["yyyy-MM-dd", "MM-dd-yyyy"], ae = (t, e, n) => {
2987
+ }, us = ["yyyy-MM-dd", "MM-dd-yyyy"], ae = (t, e, n) => {
2988
2988
  const r = {};
2989
- return e?.contentType !== null && (r[Bt] = e?.contentType || Qt), e?.jwt ? r.Authorization = `Bearer ${e.jwt}` : t && (r[j] = t), e?.chatReference && (r[Vt] = e.chatReference), { ...r, ...n };
2990
- }, us = (t) => {
2989
+ return e?.contentType !== null && (r[Vt] = e?.contentType || Bt), e?.jwt ? r.Authorization = `Bearer ${e.jwt}` : t && (r[X] = t), e?.chatReference && (r[Gt] = e.chatReference), { ...r, ...n };
2990
+ }, ds = (t) => {
2991
2991
  const e = { ...t };
2992
- return e[j] && (e[j] = e[j].substring(0, 8) + "...[REDACTED]"), e.Authorization && (e.Authorization = "Bearer [REDACTED]"), e[X] && (e[X] = e[X].substring(0, 8) + "...[REDACTED]"), e;
2993
- }, He = async (t, e, n) => await fetch(t, {
2992
+ return e[X] && (e[X] = e[X].substring(0, 8) + "...[REDACTED]"), e.Authorization && (e.Authorization = "Bearer [REDACTED]"), e[j] && (e[j] = e[j].substring(0, 8) + "...[REDACTED]"), e;
2993
+ }, Fe = async (t, e, n) => await fetch(t, {
2994
2994
  method: n.method || "GET",
2995
2995
  headers: e,
2996
2996
  body: n.body ? JSON.stringify(n.body) : void 0
2997
- }), ds = async (t, e, n) => {
2997
+ }), ls = async (t, e, n) => {
2998
2998
  const r = n?.body === void 0 ? void 0 : n?.isFormData ? n.body : JSON.stringify(n.body);
2999
2999
  return await fetch(t, {
3000
3000
  method: n.method,
@@ -3003,20 +3003,20 @@ const V = (t) => {
3003
3003
  signal: n?.signal
3004
3004
  });
3005
3005
  };
3006
- class ls {
3006
+ class fs {
3007
3007
  constructor() {
3008
3008
  this.decoder = new TextDecoder();
3009
3009
  }
3010
3010
  async streamChat(e, n, r = {}, s) {
3011
- const { onMessage: a, onError: o, onComplete: i, signal: c } = r;
3011
+ const { onMessage: a, onError: o, onComplete: c, signal: i } = r;
3012
3012
  try {
3013
3013
  const u = await this.initializeStreamRequest(
3014
3014
  e,
3015
3015
  n,
3016
- c,
3016
+ i,
3017
3017
  s
3018
3018
  );
3019
- await this.processStreamData(u, a), i?.();
3019
+ await this.processStreamData(u, a), c?.();
3020
3020
  } catch (u) {
3021
3021
  this.handleStreamError(u, o);
3022
3022
  }
@@ -3024,7 +3024,7 @@ class ls {
3024
3024
  async initializeStreamRequest(e, n, r, s) {
3025
3025
  const a = ae(void 0, {
3026
3026
  jwt: s
3027
- }), o = await ds(
3027
+ }), o = await ls(
3028
3028
  e,
3029
3029
  {
3030
3030
  Accept: "text/event-stream",
@@ -3037,20 +3037,20 @@ class ls {
3037
3037
  }
3038
3038
  );
3039
3039
  if (!o.ok) {
3040
- const i = await o.text();
3041
- let c = {};
3040
+ const c = await o.text();
3041
+ let i = {};
3042
3042
  try {
3043
- c = JSON.parse(i);
3043
+ i = JSON.parse(c);
3044
3044
  } catch {
3045
- c.error = "Failed to parse error body";
3045
+ i.error = "Failed to parse error body";
3046
3046
  }
3047
- throw new Ce({
3047
+ throw new Se({
3048
3048
  status: o.status,
3049
- message: c.error ?? "No response body"
3049
+ message: i.error ?? "No response body"
3050
3050
  });
3051
3051
  }
3052
3052
  if (!o.body)
3053
- throw new Ce({
3053
+ throw new Se({
3054
3054
  message: "No response body",
3055
3055
  status: o.status
3056
3056
  });
@@ -3067,11 +3067,11 @@ class ls {
3067
3067
  }
3068
3068
  const o = this.decoder.decode(a, { stream: !0 });
3069
3069
  r += o;
3070
- const i = r.split(`
3070
+ const c = r.split(`
3071
3071
  `);
3072
- r = i.pop() || "";
3073
- for (const c of i)
3074
- this.parseSSEDataLine(c, n);
3072
+ r = c.pop() || "";
3073
+ for (const i of c)
3074
+ this.parseSSEDataLine(i, n);
3075
3075
  }
3076
3076
  } finally {
3077
3077
  e.releaseLock();
@@ -3099,8 +3099,8 @@ class ls {
3099
3099
  }
3100
3100
  }
3101
3101
  }
3102
- new ls();
3103
- class Fa {
3102
+ new fs();
3103
+ class Qa {
3104
3104
  constructor(e) {
3105
3105
  this.config = e, console.info("SdmxApiClient initialized", {
3106
3106
  apiUrl: e.apiUrl || "NOT SET"
@@ -3123,10 +3123,10 @@ class Fa {
3123
3123
  );
3124
3124
  }
3125
3125
  async streamRequest(e, n, r, s) {
3126
- const a = `${this.config.apiUrl}/${e}`, o = this.buildHeaders(s, n.headers), i = new ReadableStream({
3126
+ const a = `${this.config.apiUrl}/${e}`, o = this.buildHeaders(s, n.headers), c = new ReadableStream({
3127
3127
  async start(u) {
3128
3128
  try {
3129
- const d = await He(a, o, n);
3129
+ const d = await Fe(a, o, n);
3130
3130
  if (!d.ok) {
3131
3131
  const P = await d.text();
3132
3132
  throw console.error(
@@ -3146,47 +3146,47 @@ class Fa {
3146
3146
  u.error(d);
3147
3147
  }
3148
3148
  }
3149
- }), c = new Headers({
3149
+ }), i = new Headers({
3150
3150
  "Content-Disposition": `attachment; filename=${encodeURIComponent(r)}`
3151
3151
  });
3152
- return new Response(i, { headers: c });
3152
+ return new Response(c, { headers: i });
3153
3153
  }
3154
3154
  async request(e, n, r, s) {
3155
- const a = Date.now(), o = `${r || this.config.apiUrl}/${e}`, i = this.buildHeaders(s, n.headers);
3156
- this.addInfoRequestLog("API Request", o, n, i);
3155
+ const a = Date.now(), o = `${r || this.config.apiUrl}/${e}`, c = this.buildHeaders(s, n.headers);
3156
+ this.addInfoRequestLog("API Request", o, n, c);
3157
3157
  try {
3158
- const c = await He(o, i, n), u = Date.now() - a;
3158
+ const i = await Fe(o, c, n), u = Date.now() - a;
3159
3159
  let d;
3160
- const l = await c.text();
3160
+ const l = await i.text();
3161
3161
  try {
3162
3162
  d = l ? JSON.parse(l) : {};
3163
3163
  } catch {
3164
3164
  if (this.addErrorRequestParsing(
3165
3165
  o,
3166
3166
  n,
3167
- c,
3167
+ i,
3168
3168
  u,
3169
3169
  l
3170
- ), !c.ok)
3170
+ ), !i.ok)
3171
3171
  throw new Error(
3172
- `API request failed: ${c.status} ${c.statusText} - ${l.substring(0, 100)}`
3172
+ `API request failed: ${i.status} ${i.statusText} - ${l.substring(0, 100)}`
3173
3173
  );
3174
3174
  d = { data: l };
3175
3175
  }
3176
- if (!c.ok) {
3177
- this.addErrorRequestLog(o, n, c, u, d);
3178
- const m = Ft(d, c);
3176
+ if (!i.ok) {
3177
+ this.addErrorRequestLog(o, n, i, u, d);
3178
+ const m = Qt(d, i);
3179
3179
  throw new Error(`API request failed: ${m}`);
3180
3180
  }
3181
3181
  return d;
3182
- } catch (c) {
3182
+ } catch (i) {
3183
3183
  const u = Date.now() - a;
3184
3184
  throw console.error("API Request Exception", {
3185
3185
  method: n.method,
3186
3186
  url: o,
3187
3187
  duration: `${u}ms`,
3188
- error: c instanceof Error ? c.message : String(c)
3189
- }), c;
3188
+ error: i instanceof Error ? i.message : String(i)
3189
+ }), i;
3190
3190
  }
3191
3191
  }
3192
3192
  buildHeaders(e, n) {
@@ -3199,13 +3199,13 @@ class Fa {
3199
3199
  ...ae(void 0, { jwt: this.config.jwt }),
3200
3200
  ...n
3201
3201
  };
3202
- return this.config.apiKey != null && (r[X] = this.config.apiKey), r;
3202
+ return this.config.apiKey != null && (r[j] = this.config.apiKey), r;
3203
3203
  }
3204
3204
  addInfoRequestLog(e, n, r, s) {
3205
3205
  const a = {
3206
3206
  method: r.method || "GET",
3207
3207
  url: n,
3208
- headers: us(s)
3208
+ headers: ds(s)
3209
3209
  };
3210
3210
  r.body && (a.body = r.body), console.info(e, a);
3211
3211
  }
@@ -3232,73 +3232,73 @@ class Fa {
3232
3232
  }
3233
3233
  }
3234
3234
  var we = /* @__PURE__ */ ((t) => (t.LAST_UPDATE_AT = "lastUpdatedAt", t.SERIES_COUNT = "series_count", t))(we || {});
3235
- function Qa(t) {
3235
+ function Ba(t) {
3236
3236
  return t?.annotations?.find((e) => {
3237
3237
  if (e.id === we.LAST_UPDATE_AT)
3238
3238
  return e;
3239
3239
  })?.value;
3240
3240
  }
3241
- const ye = (t, e) => t?.names && t?.names[e] || t?.name, bt = (t, e, n) => {
3241
+ const ye = (t, e) => t?.names && t?.names[e] || t?.name, Dt = (t, e, n) => {
3242
3242
  if (!(!t || e?.has(t?.id)) && (e?.set(t?.id, t), t?.parent)) {
3243
3243
  const r = n?.get(t?.parent);
3244
- bt(r, e, n);
3244
+ Dt(r, e, n);
3245
3245
  }
3246
- }, fs = (t, e) => {
3246
+ }, ms = (t, e) => {
3247
3247
  const n = /* @__PURE__ */ new Map(), r = new Map(t?.map((s) => [s.id, s]));
3248
3248
  return e?.forEach((s) => {
3249
- bt(s, n, r);
3249
+ Dt(s, n, r);
3250
3250
  }), Array.from(n?.values());
3251
3251
  };
3252
- var ms = /* @__PURE__ */ ((t) => (t.C = "c", t))(ms || {}), k = /* @__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))(k || {}), hs = /* @__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))(hs || {}), gs = /* @__PURE__ */ ((t) => (t.ANNUAL = "A", t.QUARTERLY = "Q", t.MONTHLY = "M", t))(gs || {});
3253
- const Ba = ["FREQ", "FREQUENCY"], ws = "TIME_PERIOD", ys = "time_period_start", ps = "time_period_end", Va = (t) => {
3252
+ var hs = /* @__PURE__ */ ((t) => (t.C = "c", t))(hs || {}), k = /* @__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))(k || {}), gs = /* @__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))(gs || {}), ws = /* @__PURE__ */ ((t) => (t.ANNUAL = "A", t.QUARTERLY = "Q", t.MONTHLY = "M", t))(ws || {});
3253
+ const Va = ["FREQ", "FREQUENCY"], ys = "TIME_PERIOD", ps = "time_period_start", bs = "time_period_end", Ga = (t) => {
3254
3254
  const e = t?.find(
3255
- (a) => a.id === ys
3256
- ), n = t?.find(
3257
3255
  (a) => a.id === ps
3256
+ ), n = t?.find(
3257
+ (a) => a.id === bs
3258
3258
  ), r = n?.title ? new Date(n?.title) : null;
3259
3259
  return {
3260
3260
  startPeriod: e?.title ? new Date(e?.title) : null,
3261
3261
  endPeriod: r
3262
3262
  };
3263
- }, bs = (t, e) => t.id.localeCompare(e.id), Ds = (t, e) => t.memberValue.localeCompare(e.memberValue), Ts = (t, e) => {
3264
- const n = new Array(t.length), r = t.map((o, i) => [o, i]);
3263
+ }, Ds = (t, e) => t.id.localeCompare(e.id), Ts = (t, e) => t.memberValue.localeCompare(e.memberValue), Es = (t, e) => {
3264
+ const n = new Array(t.length), r = t.map((o, c) => [o, c]);
3265
3265
  r.sort(
3266
- (o, i) => bs(o[0], i[0])
3266
+ (o, c) => Ds(o[0], c[0])
3267
3267
  );
3268
3268
  const s = [...e];
3269
- s.sort(Ds);
3269
+ s.sort(Ts);
3270
3270
  let a = 0;
3271
3271
  for (const o of r) {
3272
- const i = o[0];
3273
- for (; a < s.length && s[a].memberValue.localeCompare(i.id) < 0; )
3272
+ const c = o[0];
3273
+ for (; a < s.length && s[a].memberValue.localeCompare(c.id) < 0; )
3274
3274
  a += 1;
3275
- a < s.length && s[a].memberValue === i.id && (n[o[1]] = o[0]);
3275
+ a < s.length && s[a].memberValue === c.id && (n[o[1]] = o[0]);
3276
3276
  }
3277
3277
  return n.filter((o) => o != null);
3278
- }, Es = (t) => !!t?.some((e) => e.parent), Ga = (t, e, n, r, s = []) => {
3278
+ }, xs = (t) => !!t?.some((e) => e.parent), Xa = (t, e, n, r, s = []) => {
3279
3279
  let a = t || [];
3280
- if (xs(n || [], e || "")) {
3280
+ if (Ps(n || [], e || "")) {
3281
3281
  const o = (n || [])[0].cubeRegions?.find(
3282
- ({ isIncluded: i }) => i
3282
+ ({ isIncluded: c }) => c
3283
3283
  );
3284
3284
  if (o) {
3285
- const i = o.memberSelection?.find(
3286
- ({ componentId: c }) => c === e
3285
+ const c = o.memberSelection?.find(
3286
+ ({ componentId: i }) => i === e
3287
3287
  );
3288
- i ? a = a.length === 0 ? (i.selectionValues || []).map(({ memberValue: c }) => ({
3289
- id: c,
3290
- name: c
3291
- })) : Ts(a, i.selectionValues) : a = [];
3288
+ c ? a = a.length === 0 ? (c.selectionValues || []).map(({ memberValue: i }) => ({
3289
+ id: i,
3290
+ name: i
3291
+ })) : Es(a, c.selectionValues) : a = [];
3292
3292
  }
3293
3293
  } else s.length !== 0 && (a = a.filter(({ id: o }) => s.includes(o)));
3294
- return Es(t) && (a = fs(t, a)), a?.map((o) => ({
3294
+ return xs(t) && (a = ms(t, a)), a?.map((o) => ({
3295
3295
  ...o,
3296
3296
  name: r ? ye(o, r) : o?.name
3297
3297
  }));
3298
- }, xs = (t, e) => t != null && t.length > 0 && e != null, Ps = (t) => {
3298
+ }, Ps = (t, e) => t != null && t.length > 0 && e != null, vs = (t) => {
3299
3299
  const e = [];
3300
3300
  return t?.filters?.forEach((n) => {
3301
- n.componentCode !== ws && e.push({
3301
+ n.componentCode !== ys && e.push({
3302
3302
  componentCode: n.componentCode,
3303
3303
  operator: k.EQUALS,
3304
3304
  value: n.values.join(",")
@@ -3307,89 +3307,89 @@ const Ba = ["FREQ", "FREQUENCY"], ws = "TIME_PERIOD", ys = "time_period_start",
3307
3307
  }, ja = (t) => {
3308
3308
  const e = /* @__PURE__ */ new Map();
3309
3309
  return t?.forEach((n) => {
3310
- e.set(n.urn, Ps(n));
3310
+ e.set(n.urn, vs(n));
3311
3311
  }), e;
3312
- }, vs = /^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i, Fe = (t) => {
3312
+ }, Ms = /^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i, Qe = (t) => {
3313
3313
  if (typeof t != "string")
3314
3314
  throw new TypeError("Invalid argument expected string");
3315
- const e = t.match(vs);
3315
+ const e = t.match(Ms);
3316
3316
  if (!e)
3317
3317
  throw new Error(`Invalid argument not valid semver ('${t}' received)`);
3318
3318
  return e.shift(), e;
3319
- }, Qe = (t) => t === "*" || t === "x" || t === "X", Be = (t) => {
3319
+ }, Be = (t) => t === "*" || t === "x" || t === "X", Ve = (t) => {
3320
3320
  const e = parseInt(t, 10);
3321
3321
  return isNaN(e) ? t : e;
3322
- }, Ms = (t, e) => typeof t != typeof e ? [String(t), String(e)] : [t, e], Os = (t, e) => {
3323
- if (Qe(t) || Qe(e))
3322
+ }, Os = (t, e) => typeof t != typeof e ? [String(t), String(e)] : [t, e], As = (t, e) => {
3323
+ if (Be(t) || Be(e))
3324
3324
  return 0;
3325
- const [n, r] = Ms(Be(t), Be(e));
3325
+ const [n, r] = Os(Ve(t), Ve(e));
3326
3326
  return n > r ? 1 : n < r ? -1 : 0;
3327
- }, Ve = (t, e) => {
3327
+ }, Ge = (t, e) => {
3328
3328
  for (let n = 0; n < Math.max(t.length, e.length); n++) {
3329
- const r = Os(t[n] || "0", e[n] || "0");
3329
+ const r = As(t[n] || "0", e[n] || "0");
3330
3330
  if (r !== 0)
3331
3331
  return r;
3332
3332
  }
3333
3333
  return 0;
3334
- }, As = (t, e) => {
3335
- const n = Fe(t), r = Fe(e), s = n.pop(), a = r.pop(), o = Ve(n, r);
3336
- return o !== 0 ? o : s && a ? Ve(s.split("."), a.split(".")) : s || a ? s ? -1 : 1 : 0;
3337
- }, Ns = (t, e, n) => {
3338
- Rs(n);
3339
- const r = As(t, e);
3340
- return Dt[n].includes(r);
3341
- }, Dt = {
3334
+ }, Ns = (t, e) => {
3335
+ const n = Qe(t), r = Qe(e), s = n.pop(), a = r.pop(), o = Ge(n, r);
3336
+ return o !== 0 ? o : s && a ? Ge(s.split("."), a.split(".")) : s || a ? s ? -1 : 1 : 0;
3337
+ }, Rs = (t, e, n) => {
3338
+ ks(n);
3339
+ const r = Ns(t, e);
3340
+ return Tt[n].includes(r);
3341
+ }, Tt = {
3342
3342
  ">": [1],
3343
3343
  ">=": [0, 1],
3344
3344
  "=": [0],
3345
3345
  "<=": [-1, 0],
3346
3346
  "<": [-1],
3347
3347
  "!=": [-1, 1]
3348
- }, Ge = Object.keys(Dt), Rs = (t) => {
3349
- if (Ge.indexOf(t) === -1)
3350
- throw new Error(`Invalid operator, expected one of ${Ge.join("|")}`);
3348
+ }, Xe = Object.keys(Tt), ks = (t) => {
3349
+ if (Xe.indexOf(t) === -1)
3350
+ throw new Error(`Invalid operator, expected one of ${Xe.join("|")}`);
3351
3351
  }, oe = "+", pe = (t, e) => {
3352
3352
  const { agency: n, id: r, version: s } = C(t), a = e.filter(
3353
- (c) => c.agencyID === n && c.id === r && !c?.version?.includes(oe)
3353
+ (i) => i.agencyID === n && i.id === r && !i?.version?.includes(oe)
3354
3354
  );
3355
3355
  if (a.length === 1)
3356
3356
  return a[0];
3357
3357
  if (!s?.includes(oe))
3358
- return a.find((c) => c.version === s);
3358
+ return a.find((i) => i.version === s);
3359
3359
  const o = a.map(
3360
- (c) => c.version
3361
- ), i = ks(s, o);
3360
+ (i) => i.version
3361
+ ), c = _s(s, o);
3362
3362
  return a.find(
3363
- (c) => c.version === i[0]
3363
+ (i) => i.version === c[0]
3364
3364
  );
3365
- }, ks = (t, e) => {
3365
+ }, _s = (t, e) => {
3366
3366
  const n = Is(t, e);
3367
3367
  return n.length > 0 ? [n[0]] : [];
3368
3368
  }, Is = (t, e) => {
3369
3369
  const n = [];
3370
3370
  return e.forEach((r) => {
3371
- Ys(t, r) && n.push(r);
3371
+ Cs(t, r) && n.push(r);
3372
3372
  }), n;
3373
- }, _s = (t) => {
3373
+ }, Ys = (t) => {
3374
3374
  const e = t.trim(), n = e.indexOf("+");
3375
3375
  if (n <= 0) return "";
3376
3376
  let r = n;
3377
3377
  for (; r > 0 && e[r - 1] >= "0" && e[r - 1] <= "9"; )
3378
3378
  r--;
3379
3379
  return r > 0 ? e.slice(0, r) : "";
3380
- }, Ys = (t, e) => {
3381
- const n = t.trim().replace(/\+/, ""), r = _s(t);
3382
- return e.startsWith(r) && Ns(e, n, ">=");
3380
+ }, Cs = (t, e) => {
3381
+ const n = t.trim().replace(/\+/, ""), r = Ys(t);
3382
+ return e.startsWith(r) && Rs(e, n, ">=");
3383
3383
  }, be = (t, e) => {
3384
- const { concept: n } = Cs(t, e);
3384
+ const { concept: n } = Ss(t, e);
3385
3385
  return n;
3386
- }, Cs = (t, e) => {
3386
+ }, Ss = (t, e) => {
3387
3387
  if (t == null)
3388
3388
  return {
3389
3389
  concept: void 0,
3390
3390
  scheme: void 0
3391
3391
  };
3392
- const { childId: n, agency: r, id: s, version: a } = tt(t);
3392
+ const { childId: n, agency: r, id: s, version: a } = nt(t);
3393
3393
  if (a?.includes(oe)) {
3394
3394
  const o = pe(
3395
3395
  t,
@@ -3410,54 +3410,54 @@ const Ba = ["FREQ", "FREQUENCY"], ws = "TIME_PERIOD", ys = "time_period_start",
3410
3410
  concept: void 0,
3411
3411
  scheme: void 0
3412
3412
  };
3413
- }, je = (t, e) => t?.find((n) => n.id === e), Ls = (t, e, n, r) => t.id === e && t.agencyID === n && t.version === r, Xa = (t = [], e = [], n) => {
3413
+ }, je = (t, e) => t?.find((n) => n.id === e), Ls = (t, e, n, r) => t.id === e && t.agencyID === n && t.version === r, za = (t = [], e = [], n) => {
3414
3414
  const r = n?.conceptIdentity || "", s = be(r, e), a = z(
3415
3415
  n?.localRepresentation?.enumeration
3416
3416
  ), o = z(
3417
3417
  s?.coreRepresentation?.enumeration
3418
- ), i = a || o;
3419
- if (i != null)
3420
- return pe(i, t);
3421
- }, Ss = (t, e) => {
3418
+ ), c = a || o;
3419
+ if (c != null)
3420
+ return pe(c, t);
3421
+ }, $s = (t, e) => {
3422
3422
  const n = t?.data?.dataSets?.[0], s = t?.data?.structures?.[0]?.attributes?.dimensionGroup || [], a = n?.dimensionGroupAttributes, o = {};
3423
- for (const i of s) {
3424
- const c = i.relationship.dimensions, { codedSeriesKey: u, decodedSeriesKey: d } = Tt(
3423
+ for (const c of s) {
3424
+ const i = c.relationship.dimensions, { codedSeriesKey: u, decodedSeriesKey: d } = Et(
3425
3425
  t,
3426
3426
  e,
3427
- c
3427
+ i
3428
3428
  );
3429
- o[i.id] = {
3429
+ o[c.id] = {
3430
3430
  values: a?.[u] || [],
3431
3431
  decodedSeriesKey: d,
3432
3432
  codedSeriesKey: u
3433
3433
  };
3434
3434
  }
3435
3435
  return o;
3436
- }, Tt = (t, e, n) => {
3436
+ }, Et = (t, e, n) => {
3437
3437
  const r = t?.data?.structures?.[0], s = [
3438
3438
  ...r?.dimensions.series || [],
3439
3439
  ...r?.dimensions.observation || []
3440
3440
  ], a = new Array(s?.length), o = new Array(s?.length);
3441
- return n?.forEach((i) => {
3442
- const c = s?.findIndex((l) => l.id === i) || 0, u = e[c], d = s[c].values.findIndex(
3441
+ return n?.forEach((c) => {
3442
+ const i = s?.findIndex((l) => l.id === c) || 0, u = e[i], d = s[i].values.findIndex(
3443
3443
  (l) => l.id === u || l.value === u
3444
3444
  ) || 0;
3445
- a[c] = d >= 0 ? d : u, o[c] = u;
3445
+ a[i] = d >= 0 ? d : u, o[i] = u;
3446
3446
  }), {
3447
3447
  codedSeriesKey: a.join(":"),
3448
3448
  decodedSeriesKey: o.join(":")
3449
3449
  };
3450
- }, za = (t, e, n) => {
3450
+ }, Ka = (t, e, n) => {
3451
3451
  const r = t?.data?.dataSets?.[0], s = t?.data?.structures?.[0], a = (s?.attributes?.dimensionGroup || []).filter(
3452
3452
  (l) => l.relationship.dimensions?.length === 1 && l.relationship.dimensions.includes(e || "")
3453
- ), o = r?.dimensionGroupAttributes, i = [
3453
+ ), o = r?.dimensionGroupAttributes, c = [
3454
3454
  ...s?.dimensions.series || [],
3455
3455
  ...s?.dimensions.observation || []
3456
- ], c = i?.findIndex((l) => l.id === e), u = new Array(i?.length);
3457
- u[c] = n || "";
3456
+ ], i = c?.findIndex((l) => l.id === e), u = new Array(c?.length);
3457
+ u[i] = n || "";
3458
3458
  const d = {};
3459
3459
  for (const l of a) {
3460
- const m = l.relationship.dimensions, { codedSeriesKey: x, decodedSeriesKey: P } = Tt(
3460
+ const m = l.relationship.dimensions, { codedSeriesKey: x, decodedSeriesKey: P } = Et(
3461
3461
  t,
3462
3462
  u,
3463
3463
  m
@@ -3469,12 +3469,12 @@ const Ba = ["FREQ", "FREQUENCY"], ws = "TIME_PERIOD", ys = "time_period_start",
3469
3469
  };
3470
3470
  }
3471
3471
  return d;
3472
- }, $s = (t, e) => {
3472
+ }, Ws = (t, e) => {
3473
3473
  if (e == null)
3474
3474
  return;
3475
3475
  const n = t.values?.[e];
3476
3476
  return n ?? (e instanceof Array ? { values: e } : { value: e.toString() });
3477
- }, Ka = (t, e, n, r) => {
3477
+ }, Ja = (t, e, n, r) => {
3478
3478
  const s = e?.find(
3479
3479
  (a) => a?.id === t?.id
3480
3480
  )?.values;
@@ -3482,7 +3482,7 @@ const Ba = ["FREQ", "FREQUENCY"], ws = "TIME_PERIOD", ys = "time_period_start",
3482
3482
  ...a,
3483
3483
  name: r ? ye(a, r) : a?.name
3484
3484
  })) || [];
3485
- }, Ws = (t, e) => {
3485
+ }, qs = (t, e) => {
3486
3486
  const n = e?.dataStructureComponents?.attributeList, r = t?.metadataStructureComponents?.metadataAttributeList;
3487
3487
  return n?.metadataAttributeUsages?.map((s) => {
3488
3488
  const a = r?.metadataAttributes?.find(
@@ -3494,53 +3494,53 @@ const Ba = ["FREQ", "FREQUENCY"], ws = "TIME_PERIOD", ys = "time_period_start",
3494
3494
  isMandatory: Number(a?.minOccurs) > 0
3495
3495
  };
3496
3496
  });
3497
- }, Ja = (t = [], e, n) => {
3497
+ }, Za = (t = [], e, n) => {
3498
3498
  const r = z(e?.conceptIdentity) || "", s = be(r, t);
3499
3499
  return n ? ye(s, n) : s?.name ?? s?.id ?? e?.id;
3500
3500
  };
3501
- var qs = /* @__PURE__ */ ((t) => (t.CONDITIONAL = "Conditional", t.MANDATORY = "Mandatory", t))(qs || {}), De = /* @__PURE__ */ ((t) => (t.DIMENSION = "Dimension", t.MEASURE_DIMENSION = "MeasureDimension", t.TIME_DIMENSION = "TimeDimension", t))(De || {}), Us = /* @__PURE__ */ ((t) => (t.UNBOUNDED = "unbounded", t))(Us || {});
3502
- function Xe(t) {
3501
+ var Us = /* @__PURE__ */ ((t) => (t.CONDITIONAL = "Conditional", t.MANDATORY = "Mandatory", t))(Us || {}), De = /* @__PURE__ */ ((t) => (t.DIMENSION = "Dimension", t.MEASURE_DIMENSION = "MeasureDimension", t.TIME_DIMENSION = "TimeDimension", t))(De || {}), Hs = /* @__PURE__ */ ((t) => (t.UNBOUNDED = "unbounded", t))(Hs || {});
3502
+ function ze(t) {
3503
3503
  return t?.dataStructures?.[0]?.dataStructureComponents?.dimensionList;
3504
3504
  }
3505
- function Za(t) {
3505
+ function eo(t) {
3506
3506
  return t?.data?.structures?.[0]?.dimensions?.series || [];
3507
3507
  }
3508
- function eo(t) {
3508
+ function to(t) {
3509
3509
  return t?.data?.structures?.[0]?.dimensions?.observation?.[0].values.map((e) => e.value ? e.value : e.id).filter((e) => e != null) || [];
3510
3510
  }
3511
- function to(t) {
3511
+ function no(t) {
3512
3512
  return t.find(
3513
3513
  (e) => e.type === De.TIME_DIMENSION
3514
3514
  );
3515
3515
  }
3516
- const no = (t) => {
3516
+ const ro = (t) => {
3517
3517
  const e = /* @__PURE__ */ new Map(), n = t?.dataStructures?.[0], r = t?.metadataStructures?.[0], s = t?.conceptSchemes || [], a = t?.codelists || [];
3518
3518
  return t && [
3519
- ...Xe(t)?.dimensions || [],
3520
- ...Xe(t)?.timeDimensions || [],
3521
- ...Ws(r, n),
3519
+ ...ze(t)?.dimensions || [],
3520
+ ...ze(t)?.timeDimensions || [],
3521
+ ...qs(r, n),
3522
3522
  ...n?.dataStructureComponents?.attributeList?.attributes || []
3523
3523
  ].forEach(
3524
- (i) => {
3525
- const c = be(
3526
- i?.conceptIdentity,
3524
+ (c) => {
3525
+ const i = be(
3526
+ c?.conceptIdentity,
3527
3527
  s
3528
- ), u = i?.localRepresentation?.enumeration || c?.coreRepresentation?.enumeration, d = pe(
3528
+ ), u = c?.localRepresentation?.enumeration || i?.coreRepresentation?.enumeration, d = pe(
3529
3529
  u,
3530
3530
  a
3531
3531
  );
3532
- i?.id && (u ? e.set(i?.id, {
3532
+ c?.id && (u ? e.set(c?.id, {
3533
3533
  ...d,
3534
- name: c?.name,
3535
- names: c?.names
3536
- }) : e.set(i?.id, {
3537
- id: i?.id,
3538
- name: c?.name,
3539
- names: c?.names
3534
+ name: i?.name,
3535
+ names: i?.names
3536
+ }) : e.set(c?.id, {
3537
+ id: c?.id,
3538
+ name: i?.name,
3539
+ names: i?.names
3540
3540
  }));
3541
3541
  }
3542
3542
  ), e;
3543
- }, ro = (t) => t?.find(
3543
+ }, so = (t) => t?.find(
3544
3544
  (e) => e.id === we.SERIES_COUNT
3545
3545
  )?.title || "", Te = 1440 * 60 * 1e3, Ee = 7 * Te;
3546
3546
  function xe(t) {
@@ -3551,40 +3551,40 @@ function xe(t) {
3551
3551
  }
3552
3552
  return n;
3553
3553
  }
3554
- function Hs(t) {
3554
+ function Fs(t) {
3555
3555
  const e = new Date(t), r = -((e.getDay() + 6) % 7) + 3;
3556
3556
  return e.setDate(e.getDate() + r), new Date(e.valueOf());
3557
3557
  }
3558
- function ze(t, e = "W") {
3558
+ function Ke(t, e = "W") {
3559
3559
  const n = `${t}-12-31`, r = Z(new Date(n), e);
3560
3560
  if (r.weekYear === t)
3561
3561
  return r.weekNumber;
3562
3562
  const s = `${t}-12-24`;
3563
3563
  return Z(new Date(s), e).weekNumber;
3564
3564
  }
3565
- function Et(t, e, n = "W") {
3565
+ function xt(t, e, n = "W") {
3566
3566
  return `${t}-${n}${e < 10 ? "0" + e : e}`;
3567
3567
  }
3568
3568
  function Z(t, e = "W") {
3569
- const n = Hs(t), r = n.getFullYear(), s = xe(r), a = 1 + Math.ceil(
3569
+ const n = Fs(t), r = n.getFullYear(), s = xe(r), a = 1 + Math.ceil(
3570
3570
  (n.getTime() - s.getTime()) / Ee
3571
3571
  );
3572
3572
  return {
3573
- code: Et(r, a, e),
3573
+ code: xt(r, a, e),
3574
3574
  weekNumber: a,
3575
3575
  weekYear: r
3576
3576
  };
3577
3577
  }
3578
- function Fs(t) {
3578
+ function Qs(t) {
3579
3579
  const [e, n] = t.split("-W"), s = xe(+e).getTime() + (+n - 1) * Ee - 3 * Te;
3580
3580
  return new Date(s);
3581
3581
  }
3582
- function Qs(t) {
3582
+ function Bs(t) {
3583
3583
  const [e, n] = t.split("-W"), s = xe(+e).getTime() + (+n - 1) * Ee + 3 * Te;
3584
3584
  return new Date(s);
3585
3585
  }
3586
- const Bs = "/api/download", Vs = 6e4, so = async (t, e, n, r, s, a, o) => {
3587
- const i = new URLSearchParams({
3586
+ const Vs = "/api/download", Gs = 6e4, ao = async (t, e, n, r, s, a, o) => {
3587
+ const c = new URLSearchParams({
3588
3588
  urn: t,
3589
3589
  format: e,
3590
3590
  compress: "false",
@@ -3593,7 +3593,7 @@ const Bs = "/api/download", Vs = 6e4, so = async (t, e, n, r, s, a, o) => {
3593
3593
  attribute: r,
3594
3594
  language: n,
3595
3595
  isMetadata: o ? "true" : "none"
3596
- }).toString(), c = `${Bs}?${i}`, u = await fetch(c, {
3596
+ }).toString(), i = `${Vs}?${c}`, u = await fetch(i, {
3597
3597
  method: "GET",
3598
3598
  credentials: "same-origin"
3599
3599
  });
@@ -3606,41 +3606,41 @@ const Bs = "/api/download", Vs = 6e4, so = async (t, e, n, r, s, a, o) => {
3606
3606
  const d = await u.blob(), l = URL.createObjectURL(d), m = document.createElement("a");
3607
3607
  m.href = l, m.download = a, m.style.display = "none", document.body.appendChild(m), m.click(), document.body.removeChild(m), window.setTimeout(
3608
3608
  () => URL.revokeObjectURL(l),
3609
- Vs
3609
+ Gs
3610
3610
  );
3611
- }, ao = (t, e) => {
3611
+ }, oo = (t, e) => {
3612
3612
  const n = [];
3613
3613
  for (const r of t) {
3614
3614
  if (r.type !== De.DIMENSION)
3615
3615
  continue;
3616
3616
  const s = e.find((a) => a.componentCode === r.id);
3617
- s != null && s.values?.length > 0 ? n.push(s.values?.join(qt)) : n.push("*");
3617
+ s != null && s.values?.length > 0 ? n.push(s.values?.join(Ut)) : n.push("*");
3618
3618
  }
3619
3619
  return n.join(".");
3620
- }, Gs = (t, e) => {
3620
+ }, Xs = (t, e) => {
3621
3621
  if (!t || !t.startPeriod && !t.endPeriod)
3622
3622
  return null;
3623
3623
  const n = [], { startPeriod: r, endPeriod: s } = t;
3624
3624
  if (r && n.push(
3625
- `${k.GREATER_OR_EQUAL}${_e}${Ke(r)}`
3625
+ `${k.GREATER_OR_EQUAL}${Ie}${Je(r)}`
3626
3626
  ), s && n.push(
3627
- `${k.LESS_OR_EQUAL}${_e}${Ke(s)}`
3627
+ `${k.LESS_OR_EQUAL}${Ie}${Je(s)}`
3628
3628
  ), n.length === 0)
3629
3629
  return null;
3630
3630
  const a = e;
3631
3631
  return n.map(
3632
- (o) => `${encodeURIComponent(`c[${a}]`)}${Wt}${encodeURIComponent(o)}`
3633
- ).join(st);
3634
- }, Ke = (t) => Vn(t, "yyyy-MM-dd"), oo = (t, e) => {
3632
+ (o) => `${encodeURIComponent(`c[${a}]`)}${qt}${encodeURIComponent(o)}`
3633
+ ).join(at);
3634
+ }, Je = (t) => Gn(t, "yyyy-MM-dd"), io = (t, e) => {
3635
3635
  const n = js(t, e) || null;
3636
- return n ? Gs(n, e?.id) : null;
3636
+ return n ? Xs(n, e?.id) : null;
3637
3637
  }, js = (t, e) => {
3638
3638
  const n = e.id, r = t?.filters?.find(
3639
- (c) => c.componentCode === n
3639
+ (i) => i.componentCode === n
3640
3640
  );
3641
3641
  if (!r || !r.values)
3642
3642
  return null;
3643
- const s = r.values?.filter((c) => !!c);
3643
+ const s = r.values?.filter((i) => !!i);
3644
3644
  if (!s.length)
3645
3645
  return null;
3646
3646
  const a = r.operator;
@@ -3648,20 +3648,20 @@ const Bs = "/api/download", Vs = 6e4, so = async (t, e, n, r, s, a, o) => {
3648
3648
  return { startPeriod: null, endPeriod: V(s[0]) };
3649
3649
  if (a === k.GREATER_OR_EQUAL || a === k.GREATER)
3650
3650
  return { startPeriod: V(s[0]), endPeriod: null };
3651
- const o = V(s[0]), i = V(s[1]);
3652
- return { startPeriod: o, endPeriod: i };
3653
- }, Xs = "Observation", io = (t) => {
3651
+ const o = V(s[0]), c = V(s[1]);
3652
+ return { startPeriod: o, endPeriod: c };
3653
+ }, zs = "Observation", co = (t) => {
3654
3654
  const e = t?.data?.dataSets, n = t?.data?.structures?.[0];
3655
3655
  if (!e || !n)
3656
3656
  return [];
3657
- 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 = [];
3657
+ const r = n.attributes, s = n.dimensions, a = r?.dimensionGroup || [], o = e[0].series || e[0].observations, c = s.series?.length ? s.series : s.observation, i = [];
3658
3658
  for (const u in o) {
3659
- const d = [], { name: l, parsedTimeSeriesValue: m } = zs(
3659
+ const d = [], { name: l, parsedTimeSeriesValue: m } = Ks(
3660
3660
  u,
3661
- i
3661
+ c
3662
3662
  ), x = o[u], P = x.attributes || [];
3663
3663
  if (Object.keys(x).length === 0) {
3664
- c.push({
3664
+ i.push({
3665
3665
  name: l,
3666
3666
  parsedTimeSeriesValue: m,
3667
3667
  values: d,
@@ -3671,19 +3671,19 @@ const Bs = "/api/download", Vs = 6e4, so = async (t, e, n, r, s, a, o) => {
3671
3671
  continue;
3672
3672
  }
3673
3673
  d.push(
3674
- ...ea(x, n)
3674
+ ...ta(x, n)
3675
3675
  );
3676
3676
  const N = ie(
3677
3677
  r?.series || [],
3678
3678
  (M) => P[M]
3679
- ), f = ta(
3679
+ ), f = na(
3680
3680
  n.attributes?.dataSet || [],
3681
3681
  e[0].attributes?.filter((M) => M != null) || []
3682
- ), w = Ss(
3682
+ ), w = $s(
3683
3683
  t,
3684
3684
  m
3685
3685
  ), v = a.map((M, W) => {
3686
- const q = w[M.id], Q = $s(
3686
+ const q = w[M.id], Q = Ws(
3687
3687
  M,
3688
3688
  q.values[W]
3689
3689
  );
@@ -3693,7 +3693,7 @@ const Bs = "/api/download", Vs = 6e4, so = async (t, e, n, r, s, a, o) => {
3693
3693
  dimensionGroupData: q
3694
3694
  };
3695
3695
  });
3696
- c.push({
3696
+ i.push({
3697
3697
  name: l,
3698
3698
  parsedTimeSeriesValue: m,
3699
3699
  values: d,
@@ -3702,96 +3702,96 @@ const Bs = "/api/download", Vs = 6e4, so = async (t, e, n, r, s, a, o) => {
3702
3702
  dimensionGroupAttributes: v
3703
3703
  });
3704
3704
  }
3705
- return c;
3706
- }, zs = (t, e) => {
3705
+ return i;
3706
+ }, Ks = (t, e) => {
3707
3707
  const n = t.split(new RegExp("(?<!\\|):(?!\\||$)")), r = [];
3708
3708
  for (let s = 0; s < n.length; s++) {
3709
3709
  const a = e?.[s], o = Number(n[s]);
3710
3710
  if (o < 0 || a == null)
3711
3711
  continue;
3712
- const i = a.values[o];
3713
- if (i == null) {
3712
+ const c = a.values[o];
3713
+ if (c == null) {
3714
3714
  r.push(n[s].replace("|:", ":"));
3715
3715
  continue;
3716
3716
  }
3717
- r.push(i?.id || i?.value || "");
3717
+ r.push(c?.id || c?.value || "");
3718
3718
  }
3719
3719
  return {
3720
- name: Js(r),
3720
+ name: Zs(r),
3721
3721
  parsedTimeSeriesValue: r
3722
3722
  };
3723
3723
  }, ie = (t, e) => {
3724
3724
  const n = [];
3725
3725
  for (let r = 0; r < t.length; r++) {
3726
- const s = t[r], a = e(r), o = a != null && s.values != null ? Ks(a, s) : void 0;
3726
+ const s = t[r], a = e(r), o = a != null && s.values != null ? Js(a, s) : void 0;
3727
3727
  n.push({
3728
3728
  name: s.id,
3729
3729
  value: o
3730
3730
  });
3731
3731
  }
3732
3732
  return n;
3733
- }, Ks = (t, e) => {
3733
+ }, Js = (t, e) => {
3734
3734
  const n = e.values[t];
3735
3735
  return n == null ? typeof t == "object" ? t : t.toString() : n?.id || n?.value || n?.ids || n?.values;
3736
- }, Js = (t) => t.map((e) => e ? Zs(e) : "").join("."), Zs = (t) => t.replace(/\./g, "|.").replace(/:/g, "|:"), ea = (t, e) => {
3736
+ }, Zs = (t) => t.map((e) => e ? ea(e) : "").join("."), ea = (t) => t.replace(/\./g, "|.").replace(/:/g, "|:"), ta = (t, e) => {
3737
3737
  const n = e.measures?.observation?.length;
3738
3738
  if (t.observations == null)
3739
3739
  return [
3740
3740
  {
3741
- values: Je(t, e.measures),
3741
+ values: Ze(t, e.measures),
3742
3742
  obsAttributes: ie(
3743
3743
  e.attributes?.observation || [],
3744
3744
  (o) => t[o + n]
3745
3745
  ),
3746
- dimensionAtObservation: Xs
3746
+ dimensionAtObservation: zs
3747
3747
  }
3748
3748
  ];
3749
3749
  const r = t.observations, s = e.dimensions.observation?.[0], a = [];
3750
3750
  for (const o in r) {
3751
- const i = s?.values[o];
3751
+ const c = s?.values[o];
3752
3752
  a.push({
3753
- dimensionAtObservation: i?.value || i?.id,
3754
- values: Je(
3753
+ dimensionAtObservation: c?.value || c?.id,
3754
+ values: Ze(
3755
3755
  r[o],
3756
3756
  e.measures
3757
3757
  ),
3758
3758
  obsAttributes: ie(
3759
3759
  e.attributes?.observation || [],
3760
- (c) => r[o][c + n]
3760
+ (i) => r[o][i + n]
3761
3761
  )
3762
3762
  });
3763
3763
  }
3764
3764
  return a;
3765
- }, Je = (t, e) => e?.observation?.map((n, r) => ({ name: n.id, value: t[r] })) || [], ta = (t, e) => t.reduce(
3765
+ }, Ze = (t, e) => e?.observation?.map((n, r) => ({ name: n.id, value: t[r] })) || [], na = (t, e) => t.reduce(
3766
3766
  (n, r, s) => {
3767
3767
  const a = e[s];
3768
- return na(n, r, a, ""), n;
3768
+ return ra(n, r, a, ""), n;
3769
3769
  },
3770
3770
  []
3771
- ), na = (t, e, n, r) => {
3771
+ ), ra = (t, e, n, r) => {
3772
3772
  const s = n != null ? e?.values?.length > 0 ? e.values[n]?.id || e.values[n]?.value : String(n) : r;
3773
3773
  t.push({
3774
3774
  name: e.id,
3775
3775
  value: s || ""
3776
3776
  });
3777
- }, ra = /^[0-9][0-9][0-9][0-9]-Q[1-4]$/, sa = /^[0-9][0-9][0-9][0-9]-W(0[1-9]|[1-4][0-9]|5[0-3])$/, aa = /^[0-9][0-9][0-9][0-9]-S[1-2]$/, oa = /^[0-9][0-9][0-9][0-9]$/, ia = /^[0-9][0-9][0-9][0-9]-(0[1-9]|1[0-2])-[0-9][0-9]$/, ca = /^[0-9][0-9][0-9][0-9]-M(0[1-9]|(1[0-2]))$/, Pe = (t) => oa.exec(t), ve = (t) => !!Pe(t), ua = (t) => aa.exec(t), Me = (t) => !!ua(t), Oe = (t) => ca.exec(t), Ae = (t) => !!Oe(t), Ne = (t) => ra.exec(t), Re = (t) => !!Ne(t), da = (t) => ia.exec(t), la = (t) => !!da(t), fa = (t) => sa.exec(t), ke = (t) => !!fa(t);
3778
- function xt(t) {
3779
- return ve(t) ? ma(t) : Me(t) ? ga(t) : Re(t) ? ya(t) : Ae(t) ? ba(t) : ke(t) ? Fs(t) : Ta(t);
3780
- }
3777
+ }, sa = /^[0-9][0-9][0-9][0-9]-Q[1-4]$/, aa = /^[0-9][0-9][0-9][0-9]-W(0[1-9]|[1-4][0-9]|5[0-3])$/, oa = /^[0-9][0-9][0-9][0-9]-S[1-2]$/, ia = /^[0-9][0-9][0-9][0-9]$/, ca = /^[0-9][0-9][0-9][0-9]-(0[1-9]|1[0-2])-[0-9][0-9]$/, ua = /^[0-9][0-9][0-9][0-9]-M(0[1-9]|(1[0-2]))$/, Pe = (t) => ia.exec(t), ve = (t) => !!Pe(t), da = (t) => oa.exec(t), Me = (t) => !!da(t), Oe = (t) => ua.exec(t), Ae = (t) => !!Oe(t), Ne = (t) => sa.exec(t), Re = (t) => !!Ne(t), la = (t) => ca.exec(t), fa = (t) => !!la(t), ma = (t) => aa.exec(t), ke = (t) => !!ma(t);
3781
3778
  function Pt(t) {
3782
3779
  return ve(t) ? ha(t) : Me(t) ? wa(t) : Re(t) ? pa(t) : Ae(t) ? Da(t) : ke(t) ? Qs(t) : Ea(t);
3783
3780
  }
3784
- function ma(t) {
3781
+ function vt(t) {
3782
+ return ve(t) ? ga(t) : Me(t) ? ya(t) : Re(t) ? ba(t) : Ae(t) ? Ta(t) : ke(t) ? Bs(t) : xa(t);
3783
+ }
3784
+ function ha(t) {
3785
3785
  const e = Pe(t);
3786
3786
  if (e)
3787
3787
  return new Date(Number(e[0]), 0, 1);
3788
3788
  }
3789
- function ha(t) {
3789
+ function ga(t) {
3790
3790
  const e = Pe(t);
3791
3791
  if (e)
3792
3792
  return new Date(Number(e[0]) + 1, 0, 1);
3793
3793
  }
3794
- function ga(t) {
3794
+ function wa(t) {
3795
3795
  const [e, n] = t.split("-S");
3796
3796
  switch (+n) {
3797
3797
  case 1:
@@ -3800,7 +3800,7 @@ function ga(t) {
3800
3800
  return new Date(+e, 6, 1);
3801
3801
  }
3802
3802
  }
3803
- function wa(t) {
3803
+ function ya(t) {
3804
3804
  const [e, n] = t.split("-S");
3805
3805
  switch (+n) {
3806
3806
  case 1:
@@ -3809,7 +3809,7 @@ function wa(t) {
3809
3809
  return new Date(+e + 1, 0, 1);
3810
3810
  }
3811
3811
  }
3812
- function ya(t) {
3812
+ function pa(t) {
3813
3813
  const e = Ne(t);
3814
3814
  if (!e)
3815
3815
  return;
@@ -3825,7 +3825,7 @@ function ya(t) {
3825
3825
  return new Date(+n, 9, 1);
3826
3826
  }
3827
3827
  }
3828
- function pa(t) {
3828
+ function ba(t) {
3829
3829
  const e = Ne(t);
3830
3830
  if (!e)
3831
3831
  return;
@@ -3841,45 +3841,45 @@ function pa(t) {
3841
3841
  return new Date(+n + 1, 0, 1);
3842
3842
  }
3843
3843
  }
3844
- function ba(t) {
3844
+ function Da(t) {
3845
3845
  const e = Oe(t);
3846
3846
  if (!e)
3847
3847
  return;
3848
3848
  const [n, r] = e[0].split("-M");
3849
3849
  return new Date(+n, +r - 1, 1);
3850
3850
  }
3851
- function Da(t) {
3851
+ function Ta(t) {
3852
3852
  const e = Oe(t);
3853
3853
  if (!e)
3854
3854
  return;
3855
3855
  const [n, r] = e[0].split("-M");
3856
3856
  return new Date(+n, +r, 1);
3857
3857
  }
3858
- const Ta = (t) => /* @__PURE__ */ new Date(`${t}T00:00:00`), Ea = (t) => {
3858
+ const Ea = (t) => /* @__PURE__ */ new Date(`${t}T00:00:00`), xa = (t) => {
3859
3859
  const e = /* @__PURE__ */ new Date(`${t}T23:59:00`);
3860
3860
  return e.setMinutes(e.getMinutes() + 1), e;
3861
- }, xa = 1, Pa = (t, e, n, r = !0, s = "Q") => {
3862
- const a = [], o = e && e > 3 ? ka(e, r) : 1, i = n ? Math.floor((n - 1) / 3) : 4;
3863
- for (let c = o; c <= i; c++)
3864
- a.push(`${t}-${s}${c}`);
3861
+ }, Pa = 1, va = (t, e, n, r = !0, s = "Q") => {
3862
+ const a = [], o = e && e > 3 ? _a(e, r) : 1, c = n ? Math.floor((n - 1) / 3) : 4;
3863
+ for (let i = o; i <= c; i++)
3864
+ a.push(`${t}-${s}${i}`);
3865
3865
  return a;
3866
- }, va = (t, e, n, r = "S") => {
3866
+ }, Ma = (t, e, n, r = "S") => {
3867
3867
  const s = [];
3868
3868
  return (e || 1) < 7 && (n || 12) > 6 && s.push(`${t}-${r}1`), n == null && s.push(`${t}-${r}2`), s;
3869
- }, co = (t) => Math.ceil(t / 3), vt = (t, e, n = "M") => `${t}-${n}${e.toString().padStart(2, "0")}`, Ma = (t, e, n = "M") => {
3869
+ }, uo = (t) => Math.ceil(t / 3), Mt = (t, e, n = "M") => `${t}-${n}${e.toString().padStart(2, "0")}`, Oa = (t, e, n = "M") => {
3870
3870
  const r = [];
3871
3871
  for (let s = e; s <= 12; s++)
3872
- r.push(vt(t, s, n));
3872
+ r.push(Mt(t, s, n));
3873
3873
  return r;
3874
- }, Oa = (t, e, n, r = "M") => {
3874
+ }, Aa = (t, e, n, r = "M") => {
3875
3875
  const s = [];
3876
3876
  for (let a = e; a < n; a++)
3877
- s.push(vt(t, a, r));
3877
+ s.push(Mt(t, a, r));
3878
3878
  return s;
3879
- }, Aa = (t, e, n, r = "M") => {
3879
+ }, Na = (t, e, n, r = "M") => {
3880
3880
  const s = e || 1, a = n == null, o = n || 12;
3881
- return a ? Ma(t, s, r) : Oa(t, s, o, r);
3882
- }, uo = (t, e, n = "M") => {
3881
+ return a ? Oa(t, s, r) : Aa(t, s, o, r);
3882
+ }, lo = (t, e, n = "M") => {
3883
3883
  switch (e) {
3884
3884
  case 0:
3885
3885
  return [
@@ -3908,55 +3908,55 @@ const Ta = (t) => /* @__PURE__ */ new Date(`${t}T00:00:00`), Ea = (t) => {
3908
3908
  default:
3909
3909
  return [];
3910
3910
  }
3911
- }, Na = (t, e) => {
3912
- const n = I(e, !0), r = I(t), s = n.getFullYear(), a = r.getFullYear(), o = n.getTime() <= r.getTime() ? a + xa - s : 0;
3913
- return Array.from({ length: o }, (c, u) => s + u);
3914
- }, I = (t, e = !1) => {
3915
- const n = Ra(t, e);
3911
+ }, Ra = (t, e) => {
3912
+ const n = _(e, !0), r = _(t), s = n.getFullYear(), a = r.getFullYear(), o = n.getTime() <= r.getTime() ? a + Pa - s : 0;
3913
+ return Array.from({ length: o }, (i, u) => s + u);
3914
+ }, _ = (t, e = !1) => {
3915
+ const n = ka(t, e);
3916
3916
  return n ? (n.getTimezoneOffset() > 0 && n.setMinutes(n.getMinutes() + n.getTimezoneOffset()), n) : /* @__PURE__ */ new Date();
3917
- }, Ra = (t, e = !1) => {
3917
+ }, ka = (t, e = !1) => {
3918
3918
  const n = Number(t);
3919
- return t.toString().length !== 13 ? e ? xt(t) : Pt(t) : isNaN(n) ? /* @__PURE__ */ new Date(`${t}T00:00:00.000Z`) : new Date(n);
3920
- }, ka = (t, e) => e ? Math.floor((t + 1) / 3) : Math.ceil((t + 1) / 3), lo = (t, e) => {
3921
- const n = et(t) - et(e);
3919
+ return t.toString().length !== 13 ? e ? Pt(t) : vt(t) : isNaN(n) ? /* @__PURE__ */ new Date(`${t}T00:00:00.000Z`) : new Date(n);
3920
+ }, _a = (t, e) => e ? Math.floor((t + 1) / 3) : Math.ceil((t + 1) / 3), fo = (t, e) => {
3921
+ const n = tt(t) - tt(e);
3922
3922
  if (n === 0 && t !== e) {
3923
- const r = Ze(t), s = Ze(e);
3923
+ const r = et(t), s = et(e);
3924
3924
  return r - s;
3925
3925
  }
3926
3926
  return n;
3927
- }, Ze = (t) => ve(t) ? 6 : Me(t) ? 5 : Re(t) ? 4 : Ae(t) ? 3 : ke(t) ? 2 : la(t) ? 1 : 0, et = (t, e = !1) => (e ? xt(t) : Pt(t))?.getTime() || 0, Mt = (t, e, n) => {
3928
- const r = I(e, !0), s = I(n), a = I(t, !0), o = I(t), i = r.getTime() > a.getTime() ? r : a, c = s.getTime() < o.getTime() ? s : o;
3927
+ }, et = (t) => ve(t) ? 6 : Me(t) ? 5 : Re(t) ? 4 : Ae(t) ? 3 : ke(t) ? 2 : fa(t) ? 1 : 0, tt = (t, e = !1) => (e ? Pt(t) : vt(t))?.getTime() || 0, Ot = (t, e, n) => {
3928
+ const r = _(e, !0), s = _(n), a = _(t, !0), o = _(t), c = r.getTime() > a.getTime() ? r : a, i = s.getTime() < o.getTime() ? s : o;
3929
3929
  return {
3930
- start: i,
3931
- end: c
3930
+ start: c,
3931
+ end: i
3932
3932
  };
3933
3933
  }, Ia = (t, e, n, r = "W") => {
3934
- const s = +t, { start: a, end: o } = Mt(t, e, n);
3934
+ const s = +t, { start: a, end: o } = Ot(t, e, n);
3935
3935
  if (a.getTime() > o.getTime())
3936
3936
  return [];
3937
- const i = Z(a, r), c = i.weekYear === s ? i.weekNumber : i.weekYear < s ? 1 : ze(s, r), u = Z(o, r), d = u.weekYear === s ? u.weekNumber : u.weekYear > s ? ze(s, r) : 1, l = [];
3938
- if (c < d)
3939
- for (let m = c; m <= d; m++)
3940
- l.push(Et(s, m, r));
3937
+ const c = Z(a, r), i = c.weekYear === s ? c.weekNumber : c.weekYear < s ? 1 : Ke(s, r), u = Z(o, r), d = u.weekYear === s ? u.weekNumber : u.weekYear > s ? Ke(s, r) : 1, l = [];
3938
+ if (i < d)
3939
+ for (let m = i; m <= d; m++)
3940
+ l.push(xt(s, m, r));
3941
3941
  return l;
3942
- }, _a = (t) => {
3942
+ }, Ya = (t) => {
3943
3943
  const e = new Date(t);
3944
3944
  return e.setMinutes(e.getMinutes() - e.getTimezoneOffset()), e.toISOString().slice(0, 10);
3945
- }, Ya = (t, e, n) => {
3946
- const { start: r, end: s } = Mt(t, e, n);
3945
+ }, Ca = (t, e, n) => {
3946
+ const { start: r, end: s } = Ot(t, e, n);
3947
3947
  if (r.getTime() > s.getTime())
3948
3948
  return [];
3949
3949
  const a = [], o = new Date(
3950
3950
  r.getFullYear(),
3951
3951
  r.getMonth(),
3952
3952
  r.getDate()
3953
- ), i = new Date(s.getFullYear(), s.getMonth(), s.getDate());
3954
- for (; o.getTime() < i.getTime(); ) {
3955
- const c = _a(o);
3956
- a.push(c), o.setDate(o.getDate() + 1);
3953
+ ), c = new Date(s.getFullYear(), s.getMonth(), s.getDate());
3954
+ for (; o.getTime() < c.getTime(); ) {
3955
+ const i = Ya(o);
3956
+ a.push(i), o.setDate(o.getDate() + 1);
3957
3957
  }
3958
3958
  return a;
3959
- }, Ca = (t) => ({
3959
+ }, Sa = (t) => ({
3960
3960
  isDailyExist: !!t?.some(({ memberValue: e }) => e === "D"),
3961
3961
  isWeeklyExist: !!t?.some(({ memberValue: e }) => e === "W"),
3962
3962
  isMonthlyExist: !!t?.some(({ memberValue: e }) => e === "M"),
@@ -3966,13 +3966,13 @@ const Ta = (t) => /* @__PURE__ */ new Date(`${t}T00:00:00`), Ea = (t) => {
3966
3966
  ({ memberValue: e }) => e === "A" || e === "Y"
3967
3967
  )
3968
3968
  }), La = (t, e, n, r) => {
3969
- const s = r === 0 ? I(e.toString(), !0)?.getMonth() + 1 : void 0, a = r === t.length - 1 ? I(n.toString())?.getMonth() + 1 || 1 : void 0;
3969
+ const s = r === 0 ? _(e.toString(), !0)?.getMonth() + 1 : void 0, a = r === t.length - 1 ? _(n.toString())?.getMonth() + 1 || 1 : void 0;
3970
3970
  return { startMonth: s, endMonth: a };
3971
- }, Sa = ["FREQUENCY", "FREQ"], fo = (t, e) => {
3971
+ }, $a = ["FREQUENCY", "FREQ"], mo = (t, e) => {
3972
3972
  const n = t?.[0]?.cubeRegions?.[0]?.memberSelection?.find(
3973
- (c) => Sa.includes(c.componentId)
3974
- )?.selectionValues, r = Ca(n || []), s = e?.startPeriod?.getTime() || 1, a = e?.endPeriod?.getTime() || 1, o = Na(a, s), i = [];
3975
- return o.forEach((c, u) => {
3973
+ (i) => $a.includes(i.componentId)
3974
+ )?.selectionValues, r = Sa(n || []), s = e?.startPeriod?.getTime() || 1, a = e?.endPeriod?.getTime() || 1, o = Ra(a, s), c = [];
3975
+ return o.forEach((i, u) => {
3976
3976
  const d = [], { startMonth: l, endMonth: m } = La(
3977
3977
  o,
3978
3978
  new Date(s),
@@ -3986,28 +3986,28 @@ const Ta = (t) => /* @__PURE__ */ new Date(`${t}T00:00:00`), Ea = (t) => {
3986
3986
  isSemiAnnualExist: w,
3987
3987
  isYearlyExist: v
3988
3988
  } = r;
3989
- v && d.push(c.toString()), w && d.push(...va(c, l, m)), f && d.push(
3990
- ...Pa(c, l, m, !1)
3991
- ), N && d.push(...Aa(c, l, m)), P && d.push(
3992
- ...Ia(c, s.toString(), a.toString())
3989
+ v && d.push(i.toString()), w && d.push(...Ma(i, l, m)), f && d.push(
3990
+ ...va(i, l, m, !1)
3991
+ ), N && d.push(...Na(i, l, m)), P && d.push(
3992
+ ...Ia(i, s.toString(), a.toString())
3993
3993
  ), x && d.push(
3994
- ...Ya(c, s.toString(), a.toString())
3995
- ), i.push(...d);
3996
- }), i;
3994
+ ...Ca(i, s.toString(), a.toString())
3995
+ ), c.push(...d);
3996
+ }), c;
3997
3997
  };
3998
- function $a(t) {
3998
+ function Wa(t) {
3999
3999
  const { urn: e } = t.details;
4000
4000
  return ue(e.resourceId, e.version, e.agencyId);
4001
4001
  }
4002
- function mo(t) {
4002
+ function ho(t) {
4003
4003
  const e = {};
4004
4004
  for (const n of t.datasets) {
4005
- const r = n.dataset, s = $a(r);
4005
+ const r = n.dataset, s = Wa(r);
4006
4006
  e[s] = r.details.dimensions;
4007
4007
  }
4008
4008
  return e;
4009
4009
  }
4010
- function ho(t) {
4010
+ function go(t) {
4011
4011
  return t?.codelists?.length ? t.codelists.map((e) => ({
4012
4012
  id: e.id,
4013
4013
  agencyID: e.agencyID ?? "",
@@ -4030,7 +4030,7 @@ function ho(t) {
4030
4030
  }))
4031
4031
  }));
4032
4032
  }
4033
- function Wa(t, e) {
4033
+ function qa(t, e) {
4034
4034
  const n = (r) => {
4035
4035
  const s = r.indexOf("(");
4036
4036
  if (s === -1) return r;
@@ -4046,32 +4046,32 @@ function ce(t) {
4046
4046
  t.agencyID ?? ""
4047
4047
  );
4048
4048
  }
4049
- function Ot(t, e, n) {
4049
+ function At(t, e, n) {
4050
4050
  e?.forEach((r) => {
4051
- const { childId: s, agency: a, id: o, version: i } = tt(r.code), c = ue(o, i, a), u = n?.find(
4052
- (l) => Wa(c, ce(l))
4051
+ const { childId: s, agency: a, id: o, version: c } = nt(r.code), i = ue(o, c, a), u = n?.find(
4052
+ (l) => qa(i, ce(l))
4053
4053
  ), d = u?.codes?.find((l) => l.id === s);
4054
4054
  if (d != null) {
4055
4055
  const l = r.code.replace(
4056
- c,
4056
+ i,
4057
4057
  ce(u)
4058
4058
  );
4059
4059
  t.push({ ...d, code: l });
4060
4060
  }
4061
- Ot(t, r.hierarchicalCodes, n);
4061
+ At(t, r.hierarchicalCodes, n);
4062
4062
  });
4063
4063
  }
4064
- function go(t, e) {
4064
+ function wo(t, e) {
4065
4065
  const n = [];
4066
- return Ot(n, t?.hierarchicalCodes, e), n;
4066
+ return At(n, t?.hierarchicalCodes, e), n;
4067
4067
  }
4068
- function wo(t) {
4068
+ function yo(t) {
4069
4069
  const e = {};
4070
4070
  return t?.forEach((n) => {
4071
4071
  e[ce(n)] = n.codes;
4072
4072
  }), e;
4073
4073
  }
4074
- function yo(t, e, n) {
4074
+ function po(t, e, n) {
4075
4075
  if (!n || n.length === 0 || !e)
4076
4076
  return t;
4077
4077
  const r = n[0].cubeRegions?.find(
@@ -4085,24 +4085,24 @@ function yo(t, e, n) {
4085
4085
  const a = new Set(s.selectionValues.map((o) => o.memberValue));
4086
4086
  return t.filter((o) => a.has(o.id));
4087
4087
  }
4088
- class po {
4088
+ class bo {
4089
4089
  constructor(e) {
4090
4090
  this.client = e;
4091
4091
  }
4092
- async getAvailableHierarchies(e, n) {
4093
- const { agency: r, id: s, version: a } = C(e), i = `${this.client.config.sdmxProxyUrl ? this.client.config.sdmxProxyUrl : this.client.config.apiUrl}/sdmx/3.0/structure/codelist`;
4092
+ async getAvailableHierarchies(e, n, r) {
4093
+ const { agency: s, id: a, version: o } = C(e), i = `${this.client.config.sdmxProxyUrl ? this.client.config.sdmxProxyUrl : this.client.config.apiUrl}/sdmx/3.0/structure/codelist`, u = r ? { [Ce]: r } : void 0;
4094
4094
  return this.client.request(
4095
- `${r}/${s}/${a}?references=hierarchy&detail=allcompletestubs`,
4096
- { method: "GET" },
4095
+ `${s}/${a}/${o}?references=hierarchy&detail=allcompletestubs`,
4096
+ { method: "GET", headers: u },
4097
4097
  i,
4098
4098
  n
4099
4099
  );
4100
4100
  }
4101
- async getHierarchy(e, n) {
4102
- const { agency: r, id: s, version: a } = C(e), i = `${this.client.config.sdmxProxyUrl ? this.client.config.sdmxProxyUrl : this.client.config.apiUrl}/sdmx/3.0/structure/hierarchy`;
4101
+ async getHierarchy(e, n, r) {
4102
+ const { agency: s, id: a, version: o } = C(e), i = `${this.client.config.sdmxProxyUrl ? this.client.config.sdmxProxyUrl : this.client.config.apiUrl}/sdmx/3.0/structure/hierarchy`, u = r ? { [Ce]: r } : void 0;
4103
4103
  return this.client.request(
4104
- `${r}/${s}/${a}?references=descendants&detail=full`,
4105
- { method: "GET" },
4104
+ `${s}/${a}/${o}?references=descendants&detail=full`,
4105
+ { method: "GET", headers: u },
4106
4106
  i,
4107
4107
  n
4108
4108
  );
@@ -4110,120 +4110,120 @@ class po {
4110
4110
  }
4111
4111
  export {
4112
4112
  we as Annotations,
4113
- qs as AssignmentStatus,
4114
- qa as AvailabilityApi,
4115
- $t as DATASET_DATA_URL,
4116
- Ha as DatasetApi,
4113
+ Us as AssignmentStatus,
4114
+ Ua as AvailabilityApi,
4115
+ Wt as DATASET_DATA_URL,
4116
+ Fa as DatasetApi,
4117
4117
  De as DimensionType,
4118
- Ct as DownloadType,
4119
- Ba as FREQUENCY_DIMENSION_ID,
4120
- Sa as FREQUENCY_DIM_ID,
4121
- Yt as FileColumnsAttribute,
4122
- Ut as GET_v3_FILTER_ALL,
4123
- Ua as GET_v3_FILTER_AND,
4124
- qt as GET_v3_FILTER_OR,
4125
- po as HierarchyApi,
4126
- Xs as OBSERVATION_KEY,
4127
- Us as OccurrenceType,
4128
- gs as Periods,
4129
- hs as RepresentationTextType,
4130
- ms as SDMX_DATA_QUERY_PARAMS,
4118
+ St as DownloadType,
4119
+ Va as FREQUENCY_DIMENSION_ID,
4120
+ $a as FREQUENCY_DIM_ID,
4121
+ Ct as FileColumnsAttribute,
4122
+ Ht as GET_v3_FILTER_ALL,
4123
+ Ha as GET_v3_FILTER_AND,
4124
+ Ut as GET_v3_FILTER_OR,
4125
+ bo as HierarchyApi,
4126
+ zs as OBSERVATION_KEY,
4127
+ Hs as OccurrenceType,
4128
+ ws as Periods,
4129
+ gs as RepresentationTextType,
4130
+ hs as SDMX_DATA_QUERY_PARAMS,
4131
4131
  oe as SINGLE_WILDCARD_SYMBOL,
4132
- Fa as SdmxApiClient,
4133
- nt as SdmxAvailabilityMode,
4132
+ Qa as SdmxApiClient,
4133
+ rt as SdmxAvailabilityMode,
4134
4134
  G as SdmxDataFormat,
4135
- rt as SdmxDetails,
4135
+ st as SdmxDetails,
4136
4136
  de as SdmxReferences,
4137
4137
  k as SeriesFilterOperator,
4138
- ws as TIME_PERIOD,
4139
- ps as TIME_PERIOD_END_ANNOTATION_KEY,
4140
- ys as TIME_PERIOD_START_ANNOTATION_KEY,
4141
- mo as buildDatasetDimensionsMetadataMap,
4142
- ia as dailyPattern,
4143
- Zs as decodeDimensionId,
4144
- Xa as findCodelistByDimension,
4138
+ ys as TIME_PERIOD,
4139
+ bs as TIME_PERIOD_END_ANNOTATION_KEY,
4140
+ ps as TIME_PERIOD_START_ANNOTATION_KEY,
4141
+ ho as buildDatasetDimensionsMetadataMap,
4142
+ ca as dailyPattern,
4143
+ ea as decodeDimensionId,
4144
+ za as findCodelistByDimension,
4145
4145
  Ye as generateDatasetDataRequest,
4146
4146
  ue as generateShortUrn,
4147
- fo as getAdditionalColumns,
4148
- Va as getAnnotationPeriod,
4147
+ mo as getAdditionalColumns,
4148
+ Ga as getAnnotationPeriod,
4149
4149
  pe as getArtifactByUrnWithWildCard,
4150
- za as getAttachedDimensionsSeriesByDimension,
4151
- Ss as getAttachedDimensionsSeriesByTsId,
4152
- Tt as getAttachedDimensionsSeriesKey,
4153
- $s as getAttributeValueFromDataQueryResponse,
4154
- Ka as getAvailableCodes,
4155
- Ga as getAvailableCodesFromConstrains,
4156
- tt as getChildParsedUrn,
4157
- wo as getCodeListsData,
4150
+ Ka as getAttachedDimensionsSeriesByDimension,
4151
+ $s as getAttachedDimensionsSeriesByTsId,
4152
+ Et as getAttachedDimensionsSeriesKey,
4153
+ Ws as getAttributeValueFromDataQueryResponse,
4154
+ Ja as getAvailableCodes,
4155
+ Xa as getAvailableCodesFromConstrains,
4156
+ nt as getChildParsedUrn,
4157
+ yo as getCodeListsData,
4158
4158
  be as getConcept,
4159
4159
  je as getConceptByUrn,
4160
- Cs as getConceptWithScheme,
4161
- Ws as getConvertedMetaAttributes,
4162
- da as getDailyRegExp,
4163
- Ya as getDaysColumns,
4164
- Ja as getDimensionTitle,
4165
- Xe as getDimensions,
4166
- fs as getFilteredItemsWithParents,
4167
- Ps as getFiltersDtoFromDataQuery,
4160
+ Ss as getConceptWithScheme,
4161
+ qs as getConvertedMetaAttributes,
4162
+ la as getDailyRegExp,
4163
+ Ca as getDaysColumns,
4164
+ Za as getDimensionTitle,
4165
+ ze as getDimensions,
4166
+ ms as getFilteredItemsWithParents,
4167
+ vs as getFiltersDtoFromDataQuery,
4168
4168
  ja as getFiltersDtoMapFromDataQuery,
4169
- yo as getHierarchyAvailableCodes,
4170
- go as getHierarchyCodes,
4169
+ po as getHierarchyAvailableCodes,
4170
+ wo as getHierarchyCodes,
4171
4171
  Z as getISOWeek,
4172
4172
  z as getKeyFromUrn,
4173
- Qa as getLastUpdatedTime,
4174
- ze as getLastWeekNumberOfYear,
4173
+ Ba as getLastUpdatedTime,
4174
+ Ke as getLastWeekNumberOfYear,
4175
4175
  ye as getLocalizedName,
4176
- Aa as getMonthlyData,
4177
- uo as getMonthlyDataByQuarter,
4176
+ Na as getMonthlyData,
4177
+ lo as getMonthlyDataByQuarter,
4178
4178
  Oe as getMonthlyRegExp,
4179
- Pt as getParsedEndPeriodDate,
4180
- io as getParsedResponse,
4181
- xt as getParsedStartPeriodDate,
4182
- I as getPeriodDate,
4183
- Ca as getPeriods,
4184
- co as getQuarterByMonth,
4179
+ vt as getParsedEndPeriodDate,
4180
+ co as getParsedResponse,
4181
+ Pt as getParsedStartPeriodDate,
4182
+ _ as getPeriodDate,
4183
+ Sa as getPeriods,
4184
+ uo as getQuarterByMonth,
4185
4185
  Ne as getQuarterlyRegExp,
4186
- Pa as getQuartersData,
4187
- Gs as getQueryTimePeriodFilters,
4186
+ va as getQuartersData,
4187
+ Xs as getQueryTimePeriodFilters,
4188
4188
  Lt as getRequestAcceptHeader,
4189
- ks as getResolvedVersionBySingleWildcard,
4190
- va as getSemiAnnualData,
4191
- ua as getSemiAnnuallyRegExp,
4189
+ _s as getResolvedVersionBySingleWildcard,
4190
+ Ma as getSemiAnnualData,
4191
+ da as getSemiAnnuallyRegExp,
4192
4192
  ie as getSeriesAttributes,
4193
- zs as getSeriesName,
4194
- no as getStructureComponentsMap,
4195
- Za as getStructureDimensions,
4196
- to as getTimeDimension,
4197
- eo as getTimePeriods,
4198
- oo as getTimeQueryFilter,
4193
+ Ks as getSeriesName,
4194
+ ro as getStructureComponentsMap,
4195
+ eo as getStructureDimensions,
4196
+ no as getTimeDimension,
4197
+ to as getTimePeriods,
4198
+ io as getTimeQueryFilter,
4199
4199
  js as getTimeRangeFromAttachment,
4200
- ro as getTimeSeriesCount,
4201
- ao as getTimeSeriesFilterKey,
4202
- Js as getTimeSeriesId,
4203
- Et as getWeekCode,
4204
- Qs as getWeeklyPeriodEndDate,
4205
- Fs as getWeeklyPeriodStartDate,
4206
- fa as getWeeklyRegExp,
4200
+ so as getTimeSeriesCount,
4201
+ oo as getTimeSeriesFilterKey,
4202
+ Zs as getTimeSeriesId,
4203
+ xt as getWeekCode,
4204
+ Bs as getWeeklyPeriodEndDate,
4205
+ Qs as getWeeklyPeriodStartDate,
4206
+ ma as getWeeklyRegExp,
4207
4207
  Ia as getWeeksColumns,
4208
- _s as getWildCardPrefix,
4209
- Mt as getYearPeriod,
4208
+ Ys as getWildCardPrefix,
4209
+ Ot as getYearPeriod,
4210
4210
  Pe as getYearlyRegExp,
4211
- Na as getYears,
4212
- la as isDaily,
4211
+ Ra as getYears,
4212
+ fa as isDaily,
4213
4213
  Ae as isMonthly,
4214
4214
  Re as isQuarterly,
4215
4215
  Me as isSemiAnnually,
4216
4216
  ke as isWeekly,
4217
- Ys as isWildCardVersionCorrect,
4217
+ Cs as isWildCardVersionCorrect,
4218
4218
  ve as isYearly,
4219
- ca as monthlyPattern,
4220
- so as openDownloadWindow,
4221
- ra as quarterPattern,
4222
- ho as resolveCodelistsFromResponse,
4223
- aa as semiAnnuallyPattern,
4224
- lo as sortPeriods,
4219
+ ua as monthlyPattern,
4220
+ ao as openDownloadWindow,
4221
+ sa as quarterPattern,
4222
+ go as resolveCodelistsFromResponse,
4223
+ oa as semiAnnuallyPattern,
4224
+ fo as sortPeriods,
4225
4225
  C as splitUrn,
4226
- Wa as urnMatchesIgnoreVersion,
4227
- sa as weeklyPattern,
4228
- oa as yearlyPattern
4226
+ qa as urnMatchesIgnoreVersion,
4227
+ aa as weeklyPattern,
4228
+ ia as yearlyPattern
4229
4229
  };