@epam/statgpt-sdmx-toolkit 0.2.0-rc.8 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.mjs CHANGED
@@ -1,151 +1,199 @@
1
- const I = (e) => {
1
+ const v = (e) => {
2
2
  if (e != null) {
3
3
  const t = e.split("=");
4
4
  return t.length === 1 ? e : t[1];
5
5
  }
6
- }, p = (e) => {
7
- var r;
8
- const t = {
6
+ }, D = (e) => {
7
+ if (e == null)
8
+ return {};
9
+ const t = v(e), n = {
9
10
  agency: "",
10
11
  id: "",
11
12
  version: ""
12
13
  };
13
- if (e == null)
14
- return t;
15
- const n = I(e);
16
- if (n && (n.includes(":") && (t.agency = n.split(":")[0], t.id = n.split(":")[1].split("(")[0]), n.includes("("))) {
17
- const s = n.split("(");
18
- t.version = (r = s[1]) == null ? void 0 : r.split(")")[0], t.id || (t.id = s[0]);
19
- }
20
- return t;
21
- }, Pe = (e) => {
22
- const [t, n] = e.split(")."), { agency: r, id: s, version: o } = p(t + ")");
23
- return { childId: n, agency: r, id: s, version: o };
24
- }, Sn = (e, t, n) => {
25
- const r = t === "" ? "" : `(${t})`;
26
- return `${n}:${e}${r}`;
14
+ return t && (t.includes(":") && (n.agency = t.split(":")[0], n.id = t.split(":")[1].split("(")[0]), t.includes("(") && t.includes(")") && (n.version = t.split("(")[1]?.split(")")[0])), n;
15
+ }, we = (e) => {
16
+ const [t, n] = e.split(")."), { agency: s, id: r, version: o } = D(t + ")");
17
+ return { childId: n, agency: s, id: r, version: o };
18
+ }, Ie = (e, t, n) => {
19
+ const s = t === "" ? "" : `(${t})`;
20
+ return `${n}:${e}${s}`;
27
21
  };
28
- var q = /* @__PURE__ */ ((e) => (e.DESCENDANTS = "descendants", e.NONE = "none", e.ALL = "all", e))(q || {}), De = /* @__PURE__ */ ((e) => (e.EXACT = "exact", e.AVAILABLE = "available", e))(De || {});
22
+ var L = /* @__PURE__ */ ((e) => (e.DESCENDANTS = "descendants", e.NONE = "none", e.ALL = "all", e))(L || {}), me = /* @__PURE__ */ ((e) => (e.EXACT = "exact", e.AVAILABLE = "available", e))(me || {});
23
+ function Ne(e) {
24
+ return {
25
+ data: {
26
+ codelists: e.data.codelists,
27
+ conceptSchemes: e.data.conceptSchemes,
28
+ dataConstraints: e.data.dataConstraints?.map($e),
29
+ dataflows: e.data.dataflows,
30
+ dataStructures: e.data.dataStructures,
31
+ metadataStructures: e.data.metadataStructures
32
+ }
33
+ };
34
+ }
35
+ function $e(e) {
36
+ return {
37
+ ...e,
38
+ cubeRegions: e.cubeRegions?.map(Pe)
39
+ };
40
+ }
41
+ function Pe(e) {
42
+ return {
43
+ isIncluded: e.include,
44
+ memberSelection: e.keyValues.map(be)
45
+ };
46
+ }
47
+ function be(e) {
48
+ return {
49
+ included: e.include,
50
+ componentId: e.id,
51
+ selectionValues: e.values.map(_e)
52
+ };
53
+ }
54
+ function _e(e) {
55
+ return {
56
+ memberValue: e.value
57
+ };
58
+ }
29
59
  const Oe = (e = "", t = "", n = "") => `sdmx/3.0/availability/dataflow/${e}/${t}/${n}`;
30
- class Tn {
60
+ class yn {
31
61
  constructor(t) {
32
62
  this.client = t;
33
63
  }
34
64
  async getConstraints(t, n) {
35
- const { agency: r, id: s, version: o } = p(t), i = {
65
+ const { agency: s, id: r, version: o } = D(t), i = {
36
66
  filters: n || [],
37
- mode: De.AVAILABLE,
38
- references: q.NONE
39
- }, c = Oe(r, s, o);
40
- return await this.client.postRequest(c, { body: i });
67
+ mode: me.AVAILABLE,
68
+ references: L.NONE
69
+ }, a = Oe(s, r, o);
70
+ if (this.client.config.sdmxProxyUrl) {
71
+ const c = await this.client.postRequest(
72
+ a,
73
+ { body: i },
74
+ this.client.config.sdmxProxyUrl
75
+ );
76
+ return Ne(c);
77
+ }
78
+ return await this.client.postRequest(
79
+ a,
80
+ { body: i },
81
+ this.client.config.constrainsApiUrl || this.client.config.apiUrl
82
+ );
41
83
  }
42
84
  }
43
- var $ = /* @__PURE__ */ ((e) => (e.CSV = "csv", e.JSON = "json", e.XML = "xml", e))($ || {}), Le = /* @__PURE__ */ ((e) => (e.ID = "id", e.NAME = "name", e.ID_NAME = "both", e))(Le || {}), be = /* @__PURE__ */ ((e) => (e.FULL_DATASET = "full", e.DATA_IN_TABLE = "query", e))(be || {});
44
- const Ue = (e, t) => {
85
+ var y = /* @__PURE__ */ ((e) => (e.CSV = "csv", e.JSON = "json", e.XML = "xml", e))(y || {}), Le = /* @__PURE__ */ ((e) => (e.ID = "id", e.NAME = "name", e.ID_NAME = "both", e))(Le || {}), Me = /* @__PURE__ */ ((e) => (e.FULL_DATASET = "full", e.DATA_IN_TABLE = "query", e))(Me || {});
86
+ const Ce = (e, t) => {
45
87
  switch (e) {
46
- case $.CSV:
47
- return m(
88
+ case y.CSV:
89
+ return A(
48
90
  "application/vnd.sdmx.data+csv;version=2.0.0",
49
91
  t
50
92
  );
51
- case $.XML:
52
- return m(
93
+ case y.XML:
94
+ return A(
53
95
  "application/vnd.sdmx.data+xml;version=3.0.0",
54
96
  t
55
97
  );
56
- case $.JSON:
57
- return m(`application/${e}`, t);
98
+ case y.JSON:
99
+ return A(`application/${e}`, t);
58
100
  default:
59
- return m(
101
+ return A(
60
102
  "application/vnd.sdmx.data+csv;version=2.0.0",
61
103
  t
62
104
  );
63
105
  }
64
- }, m = (e, t) => `${e}; labels=${t}`;
65
- var ye = /* @__PURE__ */ ((e) => (e.REFERENCE_PARTIAL = "referencepartial", e.FULL = "full", e))(ye || {});
66
- const xe = "all", Ye = "sdmx/3.0/data/dataflow", Se = "&", re = ":", Ce = "=", We = "+", Rn = ",", qe = "*", se = (e, t, n) => {
67
- const { filterKey: r, timeFilter: s } = n, { agency: o, id: i, version: c } = p(e), a = [s || "", t].filter((l) => !!l).join(Se);
68
- return `${`${Ye}/${o}/${i}/${c}`}/${r || qe}?${a}`;
69
- }, Me = (e = "", t = "", n = "", r = q.DESCENDANTS) => `sdmx/3.0/structure/dataflow/${e}/${t}/${n}?references=${r}&detail=${ye.REFERENCE_PARTIAL}`;
70
- class wn {
106
+ }, A = (e, t) => `${e}; labels=${t}`;
107
+ var fe = /* @__PURE__ */ ((e) => (e.REFERENCE_PARTIAL = "referencepartial", e.FULL = "full", e))(fe || {});
108
+ const Ue = "all", xe = "sdmx/3.0/data/dataflow", ge = "&", J = ":", Ye = "=", We = "+", Tn = ",", Ve = "*", X = (e, t, n) => {
109
+ const { filterKey: s, timeFilter: r } = n, { agency: o, id: i, version: a } = D(e), c = [r || "", t].filter((d) => !!d).join(ge);
110
+ return `${`${xe}/${o}/${i}/${a}`}/${s || Ve}?${c}`;
111
+ }, ke = (e = "", t = "", n = "", s = L.DESCENDANTS) => `sdmx/3.0/structure/dataflow/${e}/${t}/${n}?references=${s}&detail=${fe.REFERENCE_PARTIAL}`;
112
+ class vn {
71
113
  constructor(t) {
72
114
  this.client = t;
73
115
  }
74
116
  async getDataSet(t, n) {
75
- const { agency: r, id: s, version: o } = p(t);
117
+ const { agency: s, id: r, version: o } = D(t);
76
118
  return await this.client.getRequest(
77
- Me(r, s, o, n)
119
+ ke(s, r, o, n)
78
120
  );
79
121
  }
80
122
  async getDatasetData(t, n) {
81
- const r = new URLSearchParams({
123
+ const s = new URLSearchParams({
82
124
  includeHistory: "false",
83
125
  limit: "1000",
84
- attributes: xe,
126
+ attributes: Ue,
85
127
  dimensionAtObservation: "TIME_PERIOD"
86
128
  // TODO: use time dimensions
87
- }).toString(), s = se(t, r, n);
88
- return await this.client.getRequest(s);
129
+ }).toString(), r = X(t, s, n);
130
+ return await this.client.getRequest(r);
89
131
  }
90
- async downloadDataSet(t, n, r, s, o, i, c = !1) {
91
- const a = new URLSearchParams({
132
+ async downloadDataSet(t, n, s, r, o, i, a = !1) {
133
+ const c = new URLSearchParams({
92
134
  format: n,
93
135
  compress: "false",
94
- attributes: c ? "all" : "none",
136
+ attributes: a ? "all" : "none",
95
137
  limit: "1000"
96
- }).toString(), u = se(t, a, o);
138
+ }).toString(), u = X(t, c, o);
97
139
  return this.client.streamRequest(
98
140
  u,
99
141
  {
100
142
  method: "GET",
101
143
  headers: {
102
- Accept: Ue(n, s),
103
- "Accept-language": r
144
+ Accept: Ce(n, r),
145
+ "Accept-language": s
104
146
  }
105
147
  },
106
148
  i
107
149
  );
108
150
  }
109
151
  }
110
- const ke = (e, t) => e.error || e.message || `${t.status} ${t.statusText}`, Qe = "application/json", Be = "Content-Type", x = "Api-Key", Ve = "X-CONVERSATION-ID", N = "Ocp-Apim-Subscription-Key", v = (e) => isNaN(Date.parse(e)) ? null : new Date(e), Y = (e, t, n) => {
111
- const r = {
112
- [Be]: (t == null ? void 0 : t.contentType) || Qe
152
+ const qe = (e, t) => e.error || e.message || `${t.status} ${t.statusText}`, Qe = "application/json", Be = "Content-Type", P = "Api-Key", Fe = "X-CONVERSATION-ID", T = "Ocp-Apim-Subscription-Key";
153
+ class Z extends Error {
154
+ constructor(t) {
155
+ super(t.message), this.isHttpError = !0, this.name = "HttpError", this.code = t.code, this.status = t.status, this.details = t.details, this.displayMessage = t.displayMessage;
156
+ }
157
+ }
158
+ const S = (e) => isNaN(Date.parse(e)) ? null : new Date(e), b = (e, t, n) => {
159
+ const s = {
160
+ [Be]: t?.contentType || Qe
113
161
  };
114
- return t != null && t.jwt && (r.Authorization = `Bearer ${t.jwt}`), t != null && t.chatReference && (r[Ve] = t.chatReference), { ...r, ...n };
115
- }, Fe = (e) => {
162
+ return t?.jwt && (s.Authorization = `Bearer ${t.jwt}`), t?.chatReference && (s[Fe] = t.chatReference), { ...s, ...n };
163
+ }, Ge = (e) => {
116
164
  const t = { ...e };
117
- return t[x] && (t[x] = t[x].substring(0, 8) + "...[REDACTED]"), t.Authorization && (t.Authorization = "Bearer [REDACTED]"), t[N] && (t[N] = t[N].substring(0, 8) + "...[REDACTED]"), t;
118
- }, oe = async (e, t, n) => await fetch(e, {
165
+ return t[P] && (t[P] = t[P].substring(0, 8) + "...[REDACTED]"), t.Authorization && (t.Authorization = "Bearer [REDACTED]"), t[T] && (t[T] = t[T].substring(0, 8) + "...[REDACTED]"), t;
166
+ }, ee = async (e, t, n) => await fetch(e, {
119
167
  method: n.method || "GET",
120
168
  headers: t,
121
169
  body: n.body ? JSON.stringify(n.body) : void 0
122
170
  }), Ke = async (e, t, n) => await fetch(e, {
123
171
  method: n.method,
124
172
  headers: t,
125
- body: n != null && n.isFormData && typeof (n == null ? void 0 : n.body) == "string" ? n.body : JSON.stringify(n.body),
126
- signal: n == null ? void 0 : n.signal
173
+ body: n?.isFormData && typeof n?.body == "string" ? n.body : JSON.stringify(n.body),
174
+ signal: n?.signal
127
175
  });
128
- class Ge {
176
+ class je {
129
177
  constructor() {
130
178
  this.decoder = new TextDecoder();
131
179
  }
132
- async streamChat(t, n, r = {}, s) {
133
- const { onMessage: o, onError: i, onComplete: c, signal: a } = r;
180
+ async streamChat(t, n, s = {}, r) {
181
+ const { onMessage: o, onError: i, onComplete: a, signal: c } = s;
134
182
  try {
135
183
  const u = await this.initializeStreamRequest(
136
184
  t,
137
185
  n,
138
- a,
139
- s
186
+ c,
187
+ r
140
188
  );
141
- await this.processStreamData(u, o), c == null || c();
189
+ await this.processStreamData(u, o), a?.();
142
190
  } catch (u) {
143
191
  this.handleStreamError(u, i);
144
192
  }
145
193
  }
146
- async initializeStreamRequest(t, n, r, s) {
147
- const o = Y(void 0, {
148
- jwt: s
194
+ async initializeStreamRequest(t, n, s, r) {
195
+ const o = b(void 0, {
196
+ jwt: r
149
197
  }), i = await Ke(
150
198
  t,
151
199
  {
@@ -155,63 +203,74 @@ class Ge {
155
203
  {
156
204
  method: "POST",
157
205
  body: n,
158
- signal: r
206
+ signal: s
159
207
  }
160
208
  );
161
209
  if (!i.ok) {
162
- const c = await i.text();
163
- throw new Error(
164
- JSON.stringify({ status: i.status, message: c })
165
- );
210
+ const a = await i.text();
211
+ let c = {};
212
+ try {
213
+ c = JSON.parse(a);
214
+ } catch {
215
+ c.error = "Failed to parse error body";
216
+ }
217
+ throw new Z({
218
+ status: i.status,
219
+ message: c.error ?? "No response body"
220
+ });
166
221
  }
167
222
  if (!i.body)
168
- throw new Error("No response body");
223
+ throw new Z({
224
+ message: "No response body",
225
+ status: i.status
226
+ });
169
227
  return i.body.getReader();
170
228
  }
171
229
  async processStreamData(t, n) {
172
- let r = "";
230
+ let s = "";
173
231
  try {
174
232
  for (; ; ) {
175
- const { done: s, value: o } = await t.read();
176
- if (s) {
177
- r.trim() && this.parseSSEDataLine(r, n);
233
+ const { done: r, value: o } = await t.read();
234
+ if (r) {
235
+ s.trim() && this.parseSSEDataLine(s, n);
178
236
  break;
179
237
  }
180
238
  const i = this.decoder.decode(o, { stream: !0 });
181
- r += i;
182
- const c = r.split(`
239
+ s += i;
240
+ const a = s.split(`
183
241
  `);
184
- r = c.pop() || "";
185
- for (const a of c)
186
- this.parseSSEDataLine(a, n);
242
+ s = a.pop() || "";
243
+ for (const c of a)
244
+ this.parseSSEDataLine(c, n);
187
245
  }
188
246
  } finally {
189
247
  t.releaseLock();
190
248
  }
191
249
  }
192
250
  handleStreamError(t, n) {
193
- const r = t instanceof Error ? t : new Error(String(t));
194
- throw n == null || n(r), r;
251
+ const s = t instanceof Error ? t : new Error(String(t));
252
+ throw n?.(s), s;
195
253
  }
196
254
  parseSSEDataLine(t, n) {
197
- const r = t.trim();
198
- if (!(!r || r.startsWith(":")) && r.startsWith("data: ")) {
199
- const s = r.slice(6);
200
- if (s === "[DONE]") {
255
+ const s = t.trim();
256
+ if (!(!s || s.startsWith(":")) && s.startsWith("data: ")) {
257
+ const r = s.slice(6);
258
+ if (r === "[DONE]") {
201
259
  console.info("SSE: Stream completed");
202
260
  return;
203
261
  }
262
+ let o;
204
263
  try {
205
- const o = JSON.parse(s);
206
- n == null || n(o);
207
- } catch (o) {
208
- console.error(`Failed to parse SSE data: ${s} ${o}`);
264
+ o = JSON.parse(r);
265
+ } catch (i) {
266
+ console.error(`Failed to parse SSE data: ${r} ${i}`);
209
267
  }
268
+ n?.(o);
210
269
  }
211
270
  }
212
271
  }
213
- new Ge();
214
- class pn {
272
+ new je();
273
+ class Rn {
215
274
  constructor(t) {
216
275
  this.config = t, console.info("SdmxApiClient initialized", {
217
276
  apiUrl: t.apiUrl || "NOT SET"
@@ -220,372 +279,358 @@ class pn {
220
279
  async getRequest(t, n) {
221
280
  return this.request(t, { ...n, method: "GET" });
222
281
  }
223
- async postRequest(t, n) {
224
- return this.request(t, { ...n, method: "POST" });
282
+ async postRequest(t, n, s) {
283
+ return this.request(t, { ...n, method: "POST" }, s);
225
284
  }
226
- async streamRequest(t, n, r) {
227
- const s = `${this.config.apiUrl}/${t}`, o = {
228
- ...Y(void 0, {
285
+ async streamRequest(t, n, s) {
286
+ const r = `${this.config.apiUrl}/${t}`, o = {
287
+ ...b(void 0, {
229
288
  jwt: this.config.jwt
230
289
  }),
231
290
  ...n.headers
232
291
  };
233
- this.config.apiKey != null && (o[N] = this.config.apiKey);
292
+ this.config.apiKey != null && (o[T] = this.config.apiKey);
234
293
  const i = new ReadableStream({
235
- async start(a) {
236
- var u;
294
+ async start(c) {
237
295
  try {
238
- const l = await oe(s, o, n);
239
- if (!l.ok) {
240
- const g = await l.text();
296
+ const u = await ee(r, o, n);
297
+ if (!u.ok) {
298
+ const f = await u.text();
241
299
  throw console.error(
242
- `Fetch failed! Status: ${l.status}, Body: ${g}`
243
- ), new Error(`Fetch failed with status ${l.status}`);
300
+ `Fetch failed! Status: ${u.status}, Body: ${f}`
301
+ ), new Error(`Fetch failed with status ${u.status}`);
244
302
  }
245
- const f = (u = l.body) == null ? void 0 : u.getReader();
246
- if (!f) throw new Error("Failed to create stream reader");
247
- const E = new Uint8Array([239, 187, 191]);
248
- a.enqueue(E);
249
- const d = async () => {
250
- const { done: g, value: h } = await f.read();
251
- g ? a.close() : (a.enqueue(h), await d());
303
+ const d = u.body?.getReader();
304
+ if (!d) throw new Error("Failed to create stream reader");
305
+ const l = new Uint8Array([239, 187, 191]);
306
+ c.enqueue(l);
307
+ const m = async () => {
308
+ const { done: f, value: p } = await d.read();
309
+ f ? c.close() : (c.enqueue(p), await m());
252
310
  };
253
- d();
254
- } catch (l) {
255
- a.error(l);
311
+ m();
312
+ } catch (u) {
313
+ c.error(u);
256
314
  }
257
315
  }
258
- }), c = new Headers({
259
- "Content-Disposition": `attachment; filename=${encodeURIComponent(r)}`
316
+ }), a = new Headers({
317
+ "Content-Disposition": `attachment; filename=${encodeURIComponent(s)}`
260
318
  });
261
- return new Response(i, { headers: c });
319
+ return new Response(i, { headers: a });
262
320
  }
263
- async request(t, n) {
264
- const r = Date.now(), s = t.includes("availability") && this.config.constrainsApiUrl ? `${this.config.constrainsApiUrl}/${t}` : `${this.config.apiUrl}/${t}`, o = {
265
- ...Y(void 0, {
321
+ async request(t, n, s) {
322
+ const r = Date.now(), o = `${s || this.config.apiUrl}/${t}`, i = {
323
+ ...b(void 0, {
266
324
  jwt: this.config.jwt
267
325
  }),
268
326
  ...n.headers
269
327
  };
270
- this.config.apiKey != null && (o["Ocp-Apim-Subscription-Key"] = this.config.apiKey), this.addInfoRequestLog("API Request", s, n, o);
328
+ this.config.apiKey != null && (i["Ocp-Apim-Subscription-Key"] = this.config.apiKey), this.addInfoRequestLog("API Request", o, n, i);
271
329
  try {
272
- const i = await oe(s, o, n), c = Date.now() - r;
273
- let a;
274
- const u = await i.text();
330
+ const a = await ee(o, i, n), c = Date.now() - r;
331
+ let u;
332
+ const d = await a.text();
275
333
  try {
276
- a = u ? JSON.parse(u) : {};
334
+ u = d ? JSON.parse(d) : {};
277
335
  } catch {
278
336
  if (this.addErrorRequestParsing(
279
- s,
337
+ o,
280
338
  n,
281
- i,
339
+ a,
282
340
  c,
283
- u
284
- ), !i.ok)
341
+ d
342
+ ), !a.ok)
285
343
  throw new Error(
286
- `API request failed: ${i.status} ${i.statusText} - ${u.substring(0, 100)}`
344
+ `API request failed: ${a.status} ${a.statusText} - ${d.substring(0, 100)}`
287
345
  );
288
- a = { data: u };
346
+ u = { data: d };
289
347
  }
290
- if (!i.ok) {
291
- this.addErrorRequestLog(s, n, i, c, a);
292
- const l = ke(a, i);
348
+ if (!a.ok) {
349
+ this.addErrorRequestLog(o, n, a, c, u);
350
+ const l = qe(u, a);
293
351
  throw new Error(`API request failed: ${l}`);
294
352
  }
295
- return a;
296
- } catch (i) {
353
+ return u;
354
+ } catch (a) {
297
355
  const c = Date.now() - r;
298
356
  throw console.error("API Request Exception", {
299
357
  method: n.method,
300
- url: s,
358
+ url: o,
301
359
  duration: `${c}ms`,
302
- error: i instanceof Error ? i.message : String(i)
303
- }), i;
360
+ error: a instanceof Error ? a.message : String(a)
361
+ }), a;
304
362
  }
305
363
  }
306
- addInfoRequestLog(t, n, r, s) {
364
+ addInfoRequestLog(t, n, s, r) {
307
365
  const o = {
308
- method: r.method || "GET",
366
+ method: s.method || "GET",
309
367
  url: n,
310
- headers: Fe(s)
368
+ headers: Ge(r)
311
369
  };
312
- r.body && (o.body = r.body), console.info(t, o);
370
+ s.body && (o.body = s.body), console.info(t, o);
313
371
  }
314
- addErrorRequestLog(t, n, r, s, o) {
372
+ addErrorRequestLog(t, n, s, r, o) {
315
373
  console.error("API Request Failed", {
316
374
  method: n.method,
317
375
  url: t,
318
- status: r.status,
319
- statusText: r.statusText,
320
- duration: `${s}ms`,
376
+ status: s.status,
377
+ statusText: s.statusText,
378
+ duration: `${r}ms`,
321
379
  response: o
322
380
  });
323
381
  }
324
- addErrorRequestParsing(t, n, r, s, o) {
382
+ addErrorRequestParsing(t, n, s, r, o) {
325
383
  console.error("API Response Parse Error", {
326
384
  method: n.method,
327
385
  url: t,
328
- status: r.status,
329
- statusText: r.statusText,
330
- duration: `${s}ms`,
386
+ status: s.status,
387
+ statusText: s.statusText,
388
+ duration: `${r}ms`,
331
389
  responseText: o.substring(0, 200),
332
390
  error: "Response is not valid JSON"
333
391
  });
334
392
  }
335
393
  }
336
- const mn = ["FREQ", "FREQUENCY"];
337
- var je = /* @__PURE__ */ ((e) => (e.CONDITIONAL = "Conditional", e.MANDATORY = "Mandatory", e))(je || {}), M = /* @__PURE__ */ ((e) => (e.DIMENSION = "Dimension", e.MEASURE_DIMENSION = "MeasureDimension", e.TIME_DIMENSION = "TimeDimension", e))(M || {}), ze = /* @__PURE__ */ ((e) => (e.UNBOUNDED = "unbounded", e))(ze || {});
338
- const He = (e, t) => {
339
- var c, a, u, l, f;
340
- const n = (a = (c = e == null ? void 0 : e.data) == null ? void 0 : c.dataSets) == null ? void 0 : a[0], r = (l = (u = e == null ? void 0 : e.data) == null ? void 0 : u.structures) == null ? void 0 : l[0], s = ((f = r == null ? void 0 : r.attributes) == null ? void 0 : f.dimensionGroup) || [], o = n == null ? void 0 : n.dimensionGroupAttributes, i = {};
341
- for (const E of s) {
342
- const d = E.relationship.dimensions, { codedSeriesKey: g, decodedSeriesKey: h } = Te(
394
+ const wn = ["FREQ", "FREQUENCY"];
395
+ var He = /* @__PURE__ */ ((e) => (e.CONDITIONAL = "Conditional", e.MANDATORY = "Mandatory", e))(He || {}), M = /* @__PURE__ */ ((e) => (e.DIMENSION = "Dimension", e.MEASURE_DIMENSION = "MeasureDimension", e.TIME_DIMENSION = "TimeDimension", e))(M || {}), ze = /* @__PURE__ */ ((e) => (e.UNBOUNDED = "unbounded", e))(ze || {});
396
+ const Je = (e, t) => {
397
+ const n = e?.data?.dataSets?.[0], r = e?.data?.structures?.[0]?.attributes?.dimensionGroup || [], o = n?.dimensionGroupAttributes, i = {};
398
+ for (const a of r) {
399
+ const c = a.relationship.dimensions, { codedSeriesKey: u, decodedSeriesKey: d } = he(
343
400
  e,
344
401
  t,
345
- d
402
+ c
346
403
  );
347
- i[E.id] = {
348
- values: (o == null ? void 0 : o[g]) || [],
349
- decodedSeriesKey: h,
350
- codedSeriesKey: g
404
+ i[a.id] = {
405
+ values: o?.[u] || [],
406
+ decodedSeriesKey: d,
407
+ codedSeriesKey: u
351
408
  };
352
409
  }
353
410
  return i;
354
- }, Te = (e, t, n) => {
355
- var c, a;
356
- const r = (a = (c = e == null ? void 0 : e.data) == null ? void 0 : c.structures) == null ? void 0 : a[0], s = [
357
- ...(r == null ? void 0 : r.dimensions.series) || [],
358
- ...(r == null ? void 0 : r.dimensions.observation) || []
359
- ], o = new Array(s == null ? void 0 : s.length), i = new Array(s == null ? void 0 : s.length);
360
- return n == null || n.forEach((u) => {
361
- const l = (s == null ? void 0 : s.findIndex((d) => d.id === u)) || 0, f = t[l], E = s[l].values.findIndex(
362
- (d) => d.id === f || d.value === f
411
+ }, he = (e, t, n) => {
412
+ const s = e?.data?.structures?.[0], r = [
413
+ ...s?.dimensions.series || [],
414
+ ...s?.dimensions.observation || []
415
+ ], o = new Array(r?.length), i = new Array(r?.length);
416
+ return n?.forEach((a) => {
417
+ const c = r?.findIndex((l) => l.id === a) || 0, u = t[c], d = r[c].values.findIndex(
418
+ (l) => l.id === u || l.value === u
363
419
  ) || 0;
364
- o[l] = E >= 0 ? E : f, i[l] = f;
420
+ o[c] = d >= 0 ? d : u, i[c] = u;
365
421
  }), {
366
422
  codedSeriesKey: o.join(":"),
367
423
  decodedSeriesKey: i.join(":")
368
424
  };
369
- }, vn = (e, t, n) => {
370
- var f, E, d, g, h;
371
- const r = (E = (f = e == null ? void 0 : e.data) == null ? void 0 : f.dataSets) == null ? void 0 : E[0], s = (g = (d = e == null ? void 0 : e.data) == null ? void 0 : d.structures) == null ? void 0 : g[0], o = (((h = s == null ? void 0 : s.attributes) == null ? void 0 : h.dimensionGroup) || []).filter(
372
- (D) => {
373
- var A;
374
- return ((A = D.relationship.dimensions) == null ? void 0 : A.length) === 1 && D.relationship.dimensions.includes(t || "");
375
- }
376
- ), i = r == null ? void 0 : r.dimensionGroupAttributes, c = [
377
- ...(s == null ? void 0 : s.dimensions.series) || [],
378
- ...(s == null ? void 0 : s.dimensions.observation) || []
379
- ], a = c == null ? void 0 : c.findIndex((D) => D.id === t), u = new Array(c == null ? void 0 : c.length);
380
- u[a] = n || "";
381
- const l = {};
382
- for (const D of o) {
383
- const A = D.relationship.dimensions, { codedSeriesKey: y, decodedSeriesKey: S } = Te(
425
+ }, In = (e, t, n) => {
426
+ const s = e?.data?.dataSets?.[0], r = e?.data?.structures?.[0], o = (r?.attributes?.dimensionGroup || []).filter(
427
+ (l) => l.relationship.dimensions?.length === 1 && l.relationship.dimensions.includes(t || "")
428
+ ), i = s?.dimensionGroupAttributes, a = [
429
+ ...r?.dimensions.series || [],
430
+ ...r?.dimensions.observation || []
431
+ ], c = a?.findIndex((l) => l.id === t), u = new Array(a?.length);
432
+ u[c] = n || "";
433
+ const d = {};
434
+ for (const l of o) {
435
+ const m = l.relationship.dimensions, { codedSeriesKey: f, decodedSeriesKey: p } = he(
384
436
  e,
385
437
  u,
386
- A
438
+ m
387
439
  );
388
- l[D.id] = {
389
- values: (i == null ? void 0 : i[y]) || [],
390
- decodedSeriesKey: S,
391
- codedSeriesKey: y
440
+ d[l.id] = {
441
+ values: i?.[f] || [],
442
+ decodedSeriesKey: p,
443
+ codedSeriesKey: f
392
444
  };
393
445
  }
394
- return l;
395
- }, Je = (e, t) => {
396
- var r;
446
+ return d;
447
+ }, Xe = (e, t) => {
397
448
  if (t == null)
398
449
  return;
399
- const n = (r = e.values) == null ? void 0 : r[t];
450
+ const n = e.values?.[t];
400
451
  return n ?? (t instanceof Array ? { values: t } : { value: t.toString() });
401
- }, Xe = "Observation", $n = (e) => {
402
- var u, l, f, E, d, g;
403
- const t = (u = e == null ? void 0 : e.data) == null ? void 0 : u.dataSets, n = (f = (l = e == null ? void 0 : e.data) == null ? void 0 : l.structures) == null ? void 0 : f[0];
452
+ }, Ze = "Observation", Nn = (e) => {
453
+ const t = e?.data?.dataSets, n = e?.data?.structures?.[0];
404
454
  if (!t || !n)
405
455
  return [];
406
- const r = n.attributes, s = n.dimensions, o = (r == null ? void 0 : r.dimensionGroup) || [], i = t[0].series || t[0].observations, c = (E = s.series) != null && E.length ? s.series : s.observation, a = [];
407
- for (const h in i) {
408
- const D = [], { name: A, parsedTimeSeriesValue: y } = Ze(
409
- h,
410
- c
411
- ), S = i[h], P = S.attributes || [];
412
- if (Object.keys(S).length === 0) {
413
- a.push({
414
- name: A,
415
- parsedTimeSeriesValue: y,
416
- values: D,
456
+ const s = n.attributes, r = n.dimensions, o = s?.dimensionGroup || [], i = t[0].series || t[0].observations, a = r.series?.length ? r.series : r.observation, c = [];
457
+ for (const u in i) {
458
+ const d = [], { name: l, parsedTimeSeriesValue: m } = et(
459
+ u,
460
+ a
461
+ ), f = i[u], p = f.attributes || [];
462
+ if (Object.keys(f).length === 0) {
463
+ c.push({
464
+ name: l,
465
+ parsedTimeSeriesValue: m,
466
+ values: d,
417
467
  attributes: [],
418
468
  dataSetAttrs: []
419
469
  });
420
470
  continue;
421
471
  }
422
- D.push(
423
- ...rt(S, n)
472
+ d.push(
473
+ ...rt(f, n)
424
474
  );
425
- const O = C(
426
- (r == null ? void 0 : r.series) || [],
427
- (T) => P[T]
428
- ), L = st(
429
- ((d = n.attributes) == null ? void 0 : d.dataSet) || [],
430
- ((g = t[0].attributes) == null ? void 0 : g.filter((T) => T != null)) || []
431
- ), b = He(
475
+ const w = _(
476
+ s?.series || [],
477
+ (E) => p[E]
478
+ ), I = ot(
479
+ n.attributes?.dataSet || [],
480
+ t[0].attributes?.filter((E) => E != null) || []
481
+ ), N = Je(
432
482
  e,
433
- y
434
- ), U = o.map((T, Ie) => {
435
- const ne = b[T.id], _e = Je(
436
- T,
437
- ne.values[Ie]
483
+ m
484
+ ), $ = o.map((E, ve) => {
485
+ const z = N[E.id], Re = Xe(
486
+ E,
487
+ z.values[ve]
438
488
  );
439
489
  return {
440
- attribute: T,
441
- dimensionGroupValue: _e,
442
- dimensionGroupData: ne
490
+ attribute: E,
491
+ dimensionGroupValue: Re,
492
+ dimensionGroupData: z
443
493
  };
444
494
  });
445
- a.push({
446
- name: A,
447
- parsedTimeSeriesValue: y,
448
- values: D,
449
- attributes: O,
450
- dataSetAttrs: L,
451
- dimensionGroupAttributes: U
495
+ c.push({
496
+ name: l,
497
+ parsedTimeSeriesValue: m,
498
+ values: d,
499
+ attributes: w,
500
+ dataSetAttrs: I,
501
+ dimensionGroupAttributes: $
452
502
  });
453
503
  }
454
- return a;
455
- }, Ze = (e, t) => {
456
- const n = e.split(new RegExp("(?<!\\|):(?!\\||$)")), r = [];
457
- for (let s = 0; s < n.length; s++) {
458
- const o = t == null ? void 0 : t[s], i = Number(n[s]);
504
+ return c;
505
+ }, et = (e, t) => {
506
+ const n = e.split(new RegExp("(?<!\\|):(?!\\||$)")), s = [];
507
+ for (let r = 0; r < n.length; r++) {
508
+ const o = t?.[r], i = Number(n[r]);
459
509
  if (i < 0 || o == null)
460
510
  continue;
461
- const c = o.values[i];
462
- if (c == null) {
463
- r.push(n[s].replace("|:", ":"));
511
+ const a = o.values[i];
512
+ if (a == null) {
513
+ s.push(n[r].replace("|:", ":"));
464
514
  continue;
465
515
  }
466
- r.push((c == null ? void 0 : c.id) || (c == null ? void 0 : c.value) || "");
516
+ s.push(a?.id || a?.value || "");
467
517
  }
468
518
  return {
469
- name: tt(r),
470
- parsedTimeSeriesValue: r
519
+ name: nt(s),
520
+ parsedTimeSeriesValue: s
471
521
  };
472
- }, C = (e, t) => {
522
+ }, _ = (e, t) => {
473
523
  const n = [];
474
- for (let r = 0; r < e.length; r++) {
475
- const s = e[r], o = t(r), i = o != null && s.values != null ? et(o, s) : void 0;
524
+ for (let s = 0; s < e.length; s++) {
525
+ const r = e[s], o = t(s), i = o != null && r.values != null ? tt(o, r) : void 0;
476
526
  n.push({
477
- name: s.id,
527
+ name: r.id,
478
528
  value: i
479
529
  });
480
530
  }
481
531
  return n;
482
- }, et = (e, t) => {
532
+ }, tt = (e, t) => {
483
533
  const n = t.values[e];
484
- return n == null ? typeof e == "object" ? e : e.toString() : (n == null ? void 0 : n.id) || (n == null ? void 0 : n.value) || (n == null ? void 0 : n.ids) || (n == null ? void 0 : n.values);
485
- }, tt = (e) => e.map((t) => t ? nt(t) : "").join("."), nt = (e) => e.replace(/\./g, "|.").replace(/:/g, "|:"), rt = (e, t) => {
486
- var i, c, a, u, l;
487
- const n = (c = (i = t.measures) == null ? void 0 : i.observation) == null ? void 0 : c.length;
534
+ return n == null ? typeof e == "object" ? e : e.toString() : n?.id || n?.value || n?.ids || n?.values;
535
+ }, nt = (e) => e.map((t) => t ? st(t) : "").join("."), st = (e) => e.replace(/\./g, "|.").replace(/:/g, "|:"), rt = (e, t) => {
536
+ const n = t.measures?.observation?.length;
488
537
  if (e.observations == null)
489
538
  return [
490
539
  {
491
- values: ie(e, t.measures),
492
- obsAttributes: C(
493
- ((a = t.attributes) == null ? void 0 : a.observation) || [],
494
- (f) => e[f + n]
540
+ values: te(e, t.measures),
541
+ obsAttributes: _(
542
+ t.attributes?.observation || [],
543
+ (i) => e[i + n]
495
544
  ),
496
- dimensionAtObservation: Xe
545
+ dimensionAtObservation: Ze
497
546
  }
498
547
  ];
499
- const r = e.observations, s = (u = t.dimensions.observation) == null ? void 0 : u[0], o = [];
500
- for (const f in r) {
501
- const E = s == null ? void 0 : s.values[f];
548
+ const s = e.observations, r = t.dimensions.observation?.[0], o = [];
549
+ for (const i in s) {
550
+ const a = r?.values[i];
502
551
  o.push({
503
- dimensionAtObservation: (E == null ? void 0 : E.value) || (E == null ? void 0 : E.id),
504
- values: ie(
505
- r[f],
552
+ dimensionAtObservation: a?.value || a?.id,
553
+ values: te(
554
+ s[i],
506
555
  t.measures
507
556
  ),
508
- obsAttributes: C(
509
- ((l = t.attributes) == null ? void 0 : l.observation) || [],
510
- (d) => r[f][d + n]
557
+ obsAttributes: _(
558
+ t.attributes?.observation || [],
559
+ (c) => s[i][c + n]
511
560
  )
512
561
  });
513
562
  }
514
563
  return o;
515
- }, ie = (e, t) => {
516
- var n;
517
- return ((n = t == null ? void 0 : t.observation) == null ? void 0 : n.map((r, s) => ({ name: r.id, value: e[s] }))) || [];
518
- }, st = (e, t) => e.reduce(
519
- (n, r, s) => {
520
- const o = t[s];
521
- return ot(n, r, o, ""), n;
564
+ }, te = (e, t) => t?.observation?.map((n, s) => ({ name: n.id, value: e[s] })) || [], ot = (e, t) => e.reduce(
565
+ (n, s, r) => {
566
+ const o = t[r];
567
+ return it(n, s, o, ""), n;
522
568
  },
523
569
  []
524
- ), ot = (e, t, n, r) => {
525
- var o, i, c;
526
- const s = n != null ? ((o = t == null ? void 0 : t.values) == null ? void 0 : o.length) > 0 ? ((i = t.values[n]) == null ? void 0 : i.id) || ((c = t.values[n]) == null ? void 0 : c.value) : String(n) : r;
570
+ ), it = (e, t, n, s) => {
571
+ const r = n != null ? t?.values?.length > 0 ? t.values[n]?.id || t.values[n]?.value : String(n) : s;
527
572
  e.push({
528
573
  name: t.id,
529
- value: s || ""
574
+ value: r || ""
530
575
  });
531
- }, it = /^[0-9][0-9][0-9][0-9]-Q[1-4]$/, ct = /^[0-9][0-9][0-9][0-9]-W[0-9][0-9]?$/, at = /^[0-9][0-9][0-9][0-9]-S[1-2]$/, ut = /^[0-9][0-9][0-9][0-9]$/, lt = /^[0-9][0-9][0-9][0-9]-(0[1-9]|1[0-2])-[0-9][0-9]$/, dt = /^[0-9][0-9][0-9][0-9]-M(0[1-9]|(1[0-2]))$/, k = (e) => ut.exec(e), Q = (e) => !!k(e), ft = (e) => at.exec(e), B = (e) => !!ft(e), V = (e) => dt.exec(e), F = (e) => !!V(e), K = (e) => it.exec(e), G = (e) => !!K(e), gt = (e) => lt.exec(e), Et = (e) => !!gt(e), ht = (e) => ct.exec(e), j = (e) => !!ht(e), z = 1440 * 60 * 1e3, H = 7 * z;
532
- function J(e) {
576
+ }, at = /^[0-9][0-9][0-9][0-9]-Q[1-4]$/, ct = /^[0-9][0-9][0-9][0-9]-W[0-9][0-9]?$/, ut = /^[0-9][0-9][0-9][0-9]-S[1-2]$/, dt = /^[0-9][0-9][0-9][0-9]$/, lt = /^[0-9][0-9][0-9][0-9]-(0[1-9]|1[0-2])-[0-9][0-9]$/, mt = /^[0-9][0-9][0-9][0-9]-M(0[1-9]|(1[0-2]))$/, C = (e) => dt.exec(e), U = (e) => !!C(e), ft = (e) => ut.exec(e), x = (e) => !!ft(e), Y = (e) => mt.exec(e), W = (e) => !!Y(e), V = (e) => at.exec(e), k = (e) => !!V(e), gt = (e) => lt.exec(e), ht = (e) => !!gt(e), pt = (e) => ct.exec(e), q = (e) => !!pt(e), Q = 1440 * 60 * 1e3, B = 7 * Q;
577
+ function F(e) {
533
578
  const t = `${e}-01-01`, n = new Date(t);
534
579
  if (n.getDay() !== 4) {
535
- const s = 1 + (4 - n.getDay() + 7) % 7;
536
- n.setMonth(0, s);
580
+ const r = 1 + (4 - n.getDay() + 7) % 7;
581
+ n.setMonth(0, r);
537
582
  }
538
583
  return n;
539
584
  }
540
- function At(e) {
541
- const t = new Date(e), r = -((t.getDay() + 6) % 7) + 3;
542
- return t.setDate(t.getDate() + r), new Date(t.valueOf());
585
+ function Et(e) {
586
+ const t = new Date(e), s = -((t.getDay() + 6) % 7) + 3;
587
+ return t.setDate(t.getDate() + s), new Date(t.valueOf());
543
588
  }
544
- function ce(e, t = "W") {
545
- const n = `${e}-12-31`, r = _(new Date(n), t);
546
- if (r.weekYear === e)
547
- return r.weekNumber;
548
- const s = `${e}-12-24`;
549
- return _(new Date(s), t).weekNumber;
589
+ function ne(e, t = "W") {
590
+ const n = `${e}-12-31`, s = R(new Date(n), t);
591
+ if (s.weekYear === e)
592
+ return s.weekNumber;
593
+ const r = `${e}-12-24`;
594
+ return R(new Date(r), t).weekNumber;
550
595
  }
551
- function Re(e, t, n = "W") {
596
+ function pe(e, t, n = "W") {
552
597
  return `${e}-${n}${t < 10 ? "0" + t : t}`;
553
598
  }
554
- function _(e, t = "W") {
555
- const n = At(e), r = n.getFullYear(), s = J(r), o = 1 + Math.ceil(
556
- (n.getTime() - s.getTime()) / H
599
+ function R(e, t = "W") {
600
+ const n = Et(e), s = n.getFullYear(), r = F(s), o = 1 + Math.ceil(
601
+ (n.getTime() - r.getTime()) / B
557
602
  );
558
603
  return {
559
- code: Re(r, o, t),
604
+ code: pe(s, o, t),
560
605
  weekNumber: o,
561
- weekYear: r
606
+ weekYear: s
562
607
  };
563
608
  }
564
609
  function Dt(e) {
565
- const [t, n] = e.split("-W"), s = J(+t).getTime() + (+n - 1) * H - 3 * z;
566
- return new Date(s);
610
+ const [t, n] = e.split("-W"), r = F(+t).getTime() + (+n - 1) * B - 3 * Q;
611
+ return new Date(r);
567
612
  }
568
- function yt(e) {
569
- const [t, n] = e.split("-W"), s = J(+t).getTime() + (+n - 1) * H + 3 * z;
570
- return new Date(s);
613
+ function At(e) {
614
+ const [t, n] = e.split("-W"), r = F(+t).getTime() + (+n - 1) * B + 3 * Q;
615
+ return new Date(r);
571
616
  }
572
- function we(e) {
573
- return Q(e) ? St(e) : B(e) ? Rt(e) : G(e) ? pt(e) : F(e) ? vt(e) : j(e) ? Dt(e) : Nt(e);
617
+ function Ee(e) {
618
+ return U(e) ? St(e) : x(e) ? Tt(e) : k(e) ? Rt(e) : W(e) ? It(e) : q(e) ? Dt(e) : $t(e);
574
619
  }
575
- function pe(e) {
576
- return Q(e) ? Tt(e) : B(e) ? wt(e) : G(e) ? mt(e) : F(e) ? $t(e) : j(e) ? yt(e) : It(e);
620
+ function De(e) {
621
+ return U(e) ? yt(e) : x(e) ? vt(e) : k(e) ? wt(e) : W(e) ? Nt(e) : q(e) ? At(e) : Pt(e);
577
622
  }
578
623
  function St(e) {
579
- const t = k(e);
624
+ const t = C(e);
580
625
  if (t)
581
626
  return new Date(Number(t[0]), 0, 1);
582
627
  }
583
- function Tt(e) {
584
- const t = k(e);
628
+ function yt(e) {
629
+ const t = C(e);
585
630
  if (t)
586
631
  return new Date(Number(t[0]) + 1, 0, 1);
587
632
  }
588
- function Rt(e) {
633
+ function Tt(e) {
589
634
  const [t, n] = e.split("-S");
590
635
  switch (+n) {
591
636
  case 1:
@@ -594,7 +639,7 @@ function Rt(e) {
594
639
  return new Date(+t, 6, 1);
595
640
  }
596
641
  }
597
- function wt(e) {
642
+ function vt(e) {
598
643
  const [t, n] = e.split("-S");
599
644
  switch (+n) {
600
645
  case 1:
@@ -603,12 +648,12 @@ function wt(e) {
603
648
  return new Date(+t + 1, 0, 1);
604
649
  }
605
650
  }
606
- function pt(e) {
607
- const t = K(e);
651
+ function Rt(e) {
652
+ const t = V(e);
608
653
  if (!t)
609
654
  return;
610
- const [n, r] = t[0].split("-Q");
611
- switch (+r) {
655
+ const [n, s] = t[0].split("-Q");
656
+ switch (+s) {
612
657
  case 1:
613
658
  return new Date(+n, 0, 1);
614
659
  case 2:
@@ -619,12 +664,12 @@ function pt(e) {
619
664
  return new Date(+n, 9, 1);
620
665
  }
621
666
  }
622
- function mt(e) {
623
- const t = K(e);
667
+ function wt(e) {
668
+ const t = V(e);
624
669
  if (!t)
625
670
  return;
626
- const [n, r] = t[0].split("-Q");
627
- switch (+r) {
671
+ const [n, s] = t[0].split("-Q");
672
+ switch (+s) {
628
673
  case 1:
629
674
  return new Date(+n, 3, 1);
630
675
  case 2:
@@ -635,45 +680,45 @@ function mt(e) {
635
680
  return new Date(+n + 1, 0, 1);
636
681
  }
637
682
  }
638
- function vt(e) {
639
- const t = V(e);
683
+ function It(e) {
684
+ const t = Y(e);
640
685
  if (!t)
641
686
  return;
642
- const [n, r] = t[0].split("-M");
643
- return new Date(+n, +r - 1, 1);
687
+ const [n, s] = t[0].split("-M");
688
+ return new Date(+n, +s - 1, 1);
644
689
  }
645
- function $t(e) {
646
- const t = V(e);
690
+ function Nt(e) {
691
+ const t = Y(e);
647
692
  if (!t)
648
693
  return;
649
- const [n, r] = t[0].split("-M");
650
- return new Date(+n, +r, 1);
694
+ const [n, s] = t[0].split("-M");
695
+ return new Date(+n, +s, 1);
651
696
  }
652
- const Nt = (e) => /* @__PURE__ */ new Date(`${e}T00:00:00`), It = (e) => {
697
+ const $t = (e) => /* @__PURE__ */ new Date(`${e}T00:00:00`), Pt = (e) => {
653
698
  const t = /* @__PURE__ */ new Date(`${e}T23:59:00`);
654
699
  return t.setMinutes(t.getMinutes() + 1), t;
655
- }, _t = 1, Pt = (e, t, n, r = !0, s = "Q") => {
656
- const o = [], i = t && t > 3 ? Ct(t, r) : 1, c = n ? Math.floor((n - 1) / 3) : 4;
657
- for (let a = i; a <= c; a++)
658
- o.push(`${e}-${s}${a}`);
700
+ }, bt = 1, _t = (e, t, n, s = !0, r = "Q") => {
701
+ const o = [], i = t && t > 3 ? Yt(t, s) : 1, a = n ? Math.floor((n - 1) / 3) : 4;
702
+ for (let c = i; c <= a; c++)
703
+ o.push(`${e}-${r}${c}`);
659
704
  return o;
660
- }, Ot = (e, t, n, r = "S") => {
661
- const s = [];
662
- return (t || 1) < 7 && (n || 12) > 6 && s.push(`${e}-${r}1`), n == null && s.push(`${e}-${r}2`), s;
663
- }, Nn = (e) => Math.ceil(e / 3), me = (e, t, n = "M") => `${e}-${n}${t.toString().padStart(2, "0")}`, Lt = (e, t, n = "M") => {
705
+ }, Ot = (e, t, n, s = "S") => {
664
706
  const r = [];
665
- for (let s = t; s <= 12; s++)
666
- r.push(me(e, s, n));
667
- return r;
668
- }, bt = (e, t, n, r = "M") => {
707
+ return (t || 1) < 7 && (n || 12) > 6 && r.push(`${e}-${s}1`), n == null && r.push(`${e}-${s}2`), r;
708
+ }, $n = (e) => Math.ceil(e / 3), Ae = (e, t, n = "M") => `${e}-${n}${t.toString().padStart(2, "0")}`, Lt = (e, t, n = "M") => {
669
709
  const s = [];
670
- for (let o = t; o < n; o++)
671
- s.push(me(e, o, r));
710
+ for (let r = t; r <= 12; r++)
711
+ s.push(Ae(e, r, n));
672
712
  return s;
673
- }, Ut = (e, t, n, r = "M") => {
674
- const s = t || 1, o = n == null, i = n || 12;
675
- return o ? Lt(e, s, r) : bt(e, s, i, r);
676
- }, In = (e, t, n = "M") => {
713
+ }, Mt = (e, t, n, s = "M") => {
714
+ const r = [];
715
+ for (let o = t; o < n; o++)
716
+ r.push(Ae(e, o, s));
717
+ return r;
718
+ }, Ct = (e, t, n, s = "M") => {
719
+ const r = t || 1, o = n == null, i = n || 12;
720
+ return o ? Lt(e, r, s) : Mt(e, r, i, s);
721
+ }, Pn = (e, t, n = "M") => {
677
722
  switch (t) {
678
723
  case 0:
679
724
  return [
@@ -702,171 +747,162 @@ const Nt = (e) => /* @__PURE__ */ new Date(`${e}T00:00:00`), It = (e) => {
702
747
  default:
703
748
  return [];
704
749
  }
705
- }, xt = (e, t) => {
706
- const n = R(t, !0), r = R(e), s = n.getFullYear(), o = r.getFullYear(), i = n.getTime() <= r.getTime() ? o + _t - s : 0;
707
- return Array.from({ length: i }, (a, u) => s + u);
708
- }, R = (e, t = !1) => {
709
- const n = Yt(e, t);
750
+ }, Ut = (e, t) => {
751
+ const n = g(t, !0), s = g(e), r = n.getFullYear(), o = s.getFullYear(), i = n.getTime() <= s.getTime() ? o + bt - r : 0;
752
+ return Array.from({ length: i }, (c, u) => r + u);
753
+ }, g = (e, t = !1) => {
754
+ const n = xt(e, t);
710
755
  return n ? (n.getTimezoneOffset() > 0 && n.setMinutes(n.getMinutes() + n.getTimezoneOffset()), n) : /* @__PURE__ */ new Date();
711
- }, Yt = (e, t = !1) => {
756
+ }, xt = (e, t = !1) => {
712
757
  const n = Number(e);
713
- return e.toString().length !== 13 ? t ? we(e) : pe(e) : isNaN(n) ? /* @__PURE__ */ new Date(`${e}T00:00:00.000Z`) : new Date(n);
714
- }, Ct = (e, t) => t ? Math.floor((e + 1) / 3) : Math.ceil((e + 1) / 3), _n = (e, t) => {
715
- const n = ue(e) - ue(t);
758
+ return e.toString().length !== 13 ? t ? Ee(e) : De(e) : isNaN(n) ? /* @__PURE__ */ new Date(`${e}T00:00:00.000Z`) : new Date(n);
759
+ }, Yt = (e, t) => t ? Math.floor((e + 1) / 3) : Math.ceil((e + 1) / 3), bn = (e, t) => {
760
+ const n = re(e) - re(t);
716
761
  if (n === 0 && e !== t) {
717
- const r = ae(e), s = ae(t);
718
- return r - s;
762
+ const s = se(e), r = se(t);
763
+ return s - r;
719
764
  }
720
765
  return n;
721
- }, ae = (e) => Q(e) ? 6 : B(e) ? 5 : G(e) ? 4 : F(e) ? 3 : j(e) ? 2 : Et(e) ? 1 : 0, ue = (e, t = !1) => {
722
- const n = t ? we(e) : pe(e);
723
- return (n == null ? void 0 : n.getTime()) || 0;
724
- };
725
- var X = /* @__PURE__ */ ((e) => (e.LAST_UPDATE_AT = "lastUpdatedAt", e.SERIES_COUNT = "series_count", e))(X || {}), Wt = /* @__PURE__ */ ((e) => (e.C = "c", e))(Wt || {}), w = /* @__PURE__ */ ((e) => (e.EQUALS = "eq", e.NOT_EQUALS = "ne", e.LESS = "lt", e.LESS_OR_EQUAL = "le", e.GREATER = "gt", e.GREATER_OR_EQUAL = "ge", e.CONTAINS = "co", e.NOT_CONTAINS = "nc", e.STARTS = "sw", e.ENDS = "ew", e))(w || {}), qt = /* @__PURE__ */ ((e) => (e.BOOLEAN = "Boolean", e.DATE_TIME = "DateTime", e.DECIMAL = "Decimal", e.INTEGER = "Integer", e.OBSERVATION_TIME_PERIOD = "ObservationalTimePeriod", e.STRING = "String", e.TIME = "Time", e.TIME_RANGE = "TimeRange", e.URI = "URI", e))(qt || {}), Mt = /* @__PURE__ */ ((e) => (e.ANNUAL = "A", e.QUARTERLY = "Q", e.MONTHLY = "M", e))(Mt || {});
726
- function Pn(e) {
727
- var t, n;
728
- return (n = (t = e == null ? void 0 : e.annotations) == null ? void 0 : t.find((r) => {
729
- if (r.id === X.LAST_UPDATE_AT)
730
- return r;
731
- })) == null ? void 0 : n.value;
766
+ }, se = (e) => U(e) ? 6 : x(e) ? 5 : k(e) ? 4 : W(e) ? 3 : q(e) ? 2 : ht(e) ? 1 : 0, re = (e, t = !1) => (t ? Ee(e) : De(e))?.getTime() || 0;
767
+ var G = /* @__PURE__ */ ((e) => (e.LAST_UPDATE_AT = "lastUpdatedAt", e.SERIES_COUNT = "series_count", e))(G || {}), Wt = /* @__PURE__ */ ((e) => (e.C = "c", e))(Wt || {}), h = /* @__PURE__ */ ((e) => (e.EQUALS = "eq", e.NOT_EQUALS = "ne", e.LESS = "lt", e.LESS_OR_EQUAL = "le", e.GREATER = "gt", e.GREATER_OR_EQUAL = "ge", e.CONTAINS = "co", e.NOT_CONTAINS = "nc", e.STARTS = "sw", e.ENDS = "ew", e))(h || {}), Vt = /* @__PURE__ */ ((e) => (e.BOOLEAN = "Boolean", e.DATE_TIME = "DateTime", e.DECIMAL = "Decimal", e.INTEGER = "Integer", e.OBSERVATION_TIME_PERIOD = "ObservationalTimePeriod", e.STRING = "String", e.TIME = "Time", e.TIME_RANGE = "TimeRange", e.URI = "URI", e))(Vt || {}), kt = /* @__PURE__ */ ((e) => (e.ANNUAL = "A", e.QUARTERLY = "Q", e.MONTHLY = "M", e))(kt || {});
768
+ function _n(e) {
769
+ return e?.annotations?.find((t) => {
770
+ if (t.id === G.LAST_UPDATE_AT)
771
+ return t;
772
+ })?.value;
732
773
  }
733
- const Z = (e, t) => (e == null ? void 0 : e.names) && (e == null ? void 0 : e.names[t]) || (e == null ? void 0 : e.name), ve = (e, t, n) => {
734
- if (!(!e || t != null && t.has(e == null ? void 0 : e.id)) && (t == null || t.set(e == null ? void 0 : e.id, e), e != null && e.parent)) {
735
- const r = n == null ? void 0 : n.get(e == null ? void 0 : e.parent);
736
- ve(r, t, n);
774
+ const K = (e, t) => e?.names && e?.names[t] || e?.name, Se = (e, t, n) => {
775
+ if (!(!e || t?.has(e?.id)) && (t?.set(e?.id, e), e?.parent)) {
776
+ const s = n?.get(e?.parent);
777
+ Se(s, t, n);
737
778
  }
738
- }, kt = (e, t) => {
739
- const n = /* @__PURE__ */ new Map(), r = new Map(e == null ? void 0 : e.map((s) => [s.id, s]));
740
- return t == null || t.forEach((s) => {
741
- ve(s, n, r);
742
- }), Array.from(n == null ? void 0 : n.values());
743
- }, Qt = "time_period_end", Bt = "time_period_start", Vt = "TIME_PERIOD", On = (e) => {
744
- const t = e == null ? void 0 : e.find(
779
+ }, qt = (e, t) => {
780
+ const n = /* @__PURE__ */ new Map(), s = new Map(e?.map((r) => [r.id, r]));
781
+ return t?.forEach((r) => {
782
+ Se(r, n, s);
783
+ }), Array.from(n?.values());
784
+ }, Qt = "time_period_end", Bt = "time_period_start", Ft = "TIME_PERIOD", On = (e) => {
785
+ const t = e?.find(
745
786
  (o) => o.id === Bt
746
- ), n = e == null ? void 0 : e.find(
787
+ ), n = e?.find(
747
788
  (o) => o.id === Qt
748
- ), r = n != null && n.title ? new Date(n == null ? void 0 : n.title) : null;
789
+ ), s = n?.title ? new Date(n?.title) : null;
749
790
  return {
750
- startPeriod: t != null && t.title ? new Date(t == null ? void 0 : t.title) : null,
751
- endPeriod: r
791
+ startPeriod: t?.title ? new Date(t?.title) : null,
792
+ endPeriod: s
752
793
  };
753
- }, Ft = (e, t) => e.id.localeCompare(t.id), Kt = (e, t) => e.memberValue.localeCompare(t.memberValue), Gt = (e, t) => {
754
- const n = new Array(e.length), r = e.map((i, c) => [i, c]);
755
- r.sort(
756
- (i, c) => Ft(i[0], c[0])
794
+ }, Gt = (e, t) => e.id.localeCompare(t.id), Kt = (e, t) => e.memberValue.localeCompare(t.memberValue), jt = (e, t) => {
795
+ const n = new Array(e.length), s = e.map((i, a) => [i, a]);
796
+ s.sort(
797
+ (i, a) => Gt(i[0], a[0])
757
798
  );
758
- const s = [...t];
759
- s.sort(Kt);
799
+ const r = [...t];
800
+ r.sort(Kt);
760
801
  let o = 0;
761
- for (const i of r) {
762
- const c = i[0];
763
- for (; o < s.length && s[o].memberValue.localeCompare(c.id) < 0; )
802
+ for (const i of s) {
803
+ const a = i[0];
804
+ for (; o < r.length && r[o].memberValue.localeCompare(a.id) < 0; )
764
805
  o += 1;
765
- o < s.length && s[o].memberValue === c.id && (n[i[1]] = i[0]);
806
+ o < r.length && r[o].memberValue === a.id && (n[i[1]] = i[0]);
766
807
  }
767
808
  return n.filter((i) => i != null);
768
- }, jt = (e) => !!(e != null && e.some((t) => t.parent)), Ln = (e, t, n, r, s = []) => {
769
- var i, c;
809
+ }, Ht = (e) => !!e?.some((t) => t.parent), Ln = (e, t, n, s, r = []) => {
770
810
  let o = e || [];
771
811
  if (zt(n || [], t || "")) {
772
- const a = (i = (n || [])[0].cubeRegions) == null ? void 0 : i.find(
773
- ({ isIncluded: u }) => u
812
+ const i = (n || [])[0].cubeRegions?.find(
813
+ ({ isIncluded: a }) => a
774
814
  );
775
- if (a) {
776
- const u = (c = a.memberSelection) == null ? void 0 : c.find(
777
- ({ componentId: l }) => l === t
815
+ if (i) {
816
+ const a = i.memberSelection?.find(
817
+ ({ componentId: c }) => c === t
778
818
  );
779
- u ? o = o.length === 0 ? (u.selectionValues || []).map(({ memberValue: l }) => ({
780
- id: l,
781
- name: l
782
- })) : Gt(o, u.selectionValues) : o = [];
819
+ a ? o = o.length === 0 ? (a.selectionValues || []).map(({ memberValue: c }) => ({
820
+ id: c,
821
+ name: c
822
+ })) : jt(o, a.selectionValues) : o = [];
783
823
  }
784
- } else s.length !== 0 && (o = o.filter(({ id: a }) => s.includes(a)));
785
- return jt(e) && (o = kt(e, o)), o == null ? void 0 : o.map((a) => ({
786
- ...a,
787
- name: r ? Z(a, r) : a == null ? void 0 : a.name
824
+ } else r.length !== 0 && (o = o.filter(({ id: i }) => r.includes(i)));
825
+ return Ht(e) && (o = qt(e, o)), o?.map((i) => ({
826
+ ...i,
827
+ name: s ? K(i, s) : i?.name
788
828
  }));
789
- }, zt = (e, t) => e != null && e.length > 0 && t != null, bn = (e) => {
790
- var n;
829
+ }, zt = (e, t) => e != null && e.length > 0 && t != null, Mn = (e) => {
791
830
  const t = [];
792
- return (n = e == null ? void 0 : e.filters) == null || n.forEach((r) => {
793
- r.componentCode !== Vt && t.push({
794
- componentCode: r.componentCode,
795
- operator: w.EQUALS,
796
- value: r.values.join(",")
831
+ return e?.filters?.forEach((n) => {
832
+ n.componentCode !== Ft && t.push({
833
+ componentCode: n.componentCode,
834
+ operator: h.EQUALS,
835
+ value: n.values.join(",")
797
836
  });
798
837
  }), t;
799
- }, Ht = /^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i, le = (e) => {
838
+ }, Jt = /^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i, oe = (e) => {
800
839
  if (typeof e != "string")
801
840
  throw new TypeError("Invalid argument expected string");
802
- const t = e.match(Ht);
841
+ const t = e.match(Jt);
803
842
  if (!t)
804
843
  throw new Error(`Invalid argument not valid semver ('${e}' received)`);
805
844
  return t.shift(), t;
806
- }, de = (e) => e === "*" || e === "x" || e === "X", fe = (e) => {
845
+ }, ie = (e) => e === "*" || e === "x" || e === "X", ae = (e) => {
807
846
  const t = parseInt(e, 10);
808
847
  return isNaN(t) ? e : t;
809
- }, Jt = (e, t) => typeof e != typeof t ? [String(e), String(t)] : [e, t], Xt = (e, t) => {
810
- if (de(e) || de(t))
848
+ }, Xt = (e, t) => typeof e != typeof t ? [String(e), String(t)] : [e, t], Zt = (e, t) => {
849
+ if (ie(e) || ie(t))
811
850
  return 0;
812
- const [n, r] = Jt(fe(e), fe(t));
813
- return n > r ? 1 : n < r ? -1 : 0;
814
- }, ge = (e, t) => {
851
+ const [n, s] = Xt(ae(e), ae(t));
852
+ return n > s ? 1 : n < s ? -1 : 0;
853
+ }, ce = (e, t) => {
815
854
  for (let n = 0; n < Math.max(e.length, t.length); n++) {
816
- const r = Xt(e[n] || "0", t[n] || "0");
817
- if (r !== 0)
818
- return r;
855
+ const s = Zt(e[n] || "0", t[n] || "0");
856
+ if (s !== 0)
857
+ return s;
819
858
  }
820
859
  return 0;
821
- }, Zt = (e, t) => {
822
- const n = le(e), r = le(t), s = n.pop(), o = r.pop(), i = ge(n, r);
823
- return i !== 0 ? i : s && o ? ge(s.split("."), o.split(".")) : s || o ? s ? -1 : 1 : 0;
824
- }, en = (e, t, n) => {
825
- tn(n);
826
- const r = Zt(e, t);
827
- return $e[n].includes(r);
828
- }, $e = {
860
+ }, en = (e, t) => {
861
+ const n = oe(e), s = oe(t), r = n.pop(), o = s.pop(), i = ce(n, s);
862
+ return i !== 0 ? i : r && o ? ce(r.split("."), o.split(".")) : r || o ? r ? -1 : 1 : 0;
863
+ }, tn = (e, t, n) => {
864
+ nn(n);
865
+ const s = en(e, t);
866
+ return ye[n].includes(s);
867
+ }, ye = {
829
868
  ">": [1],
830
869
  ">=": [0, 1],
831
870
  "=": [0],
832
871
  "<=": [-1, 0],
833
872
  "<": [-1],
834
873
  "!=": [-1, 1]
835
- }, Ee = Object.keys($e), tn = (e) => {
836
- if (Ee.indexOf(e) === -1)
837
- throw new Error(`Invalid operator, expected one of ${Ee.join("|")}`);
838
- }, W = "+", ee = (e, t) => {
839
- const { agency: n, id: r, version: s } = p(e), o = t.filter(
840
- (a) => {
841
- var u;
842
- return a.agencyID === n && a.id === r && !((u = a == null ? void 0 : a.version) != null && u.includes(W));
843
- }
874
+ }, ue = Object.keys(ye), nn = (e) => {
875
+ if (ue.indexOf(e) === -1)
876
+ throw new Error(`Invalid operator, expected one of ${ue.join("|")}`);
877
+ }, O = "+", j = (e, t) => {
878
+ const { agency: n, id: s, version: r } = D(e), o = t.filter(
879
+ (c) => c.agencyID === n && c.id === s && !c?.version?.includes(O)
844
880
  );
845
881
  if (o.length === 1)
846
882
  return o[0];
847
- if (!(s != null && s.includes(W)))
848
- return o.find((a) => a.version === s);
883
+ if (!r?.includes(O))
884
+ return o.find((c) => c.version === r);
849
885
  const i = o.map(
850
- (a) => a.version
851
- ), c = nn(s, i);
886
+ (c) => c.version
887
+ ), a = sn(r, i);
852
888
  return o.find(
853
- (a) => a.version === c[0]
889
+ (c) => c.version === a[0]
854
890
  );
855
- }, nn = (e, t) => {
891
+ }, sn = (e, t) => {
856
892
  const n = rn(e, t);
857
893
  return n.length > 0 ? [n[0]] : [];
858
894
  }, rn = (e, t) => {
859
895
  const n = [];
860
- return t.forEach((r) => {
861
- on(e, r) && n.push(r);
896
+ return t.forEach((s) => {
897
+ an(e, s) && n.push(s);
862
898
  }), n;
863
- }, sn = (e) => {
899
+ }, on = (e) => {
864
900
  const t = e.trim().replace(/\d+\+/, "*"), [n] = t.split("*");
865
901
  return new RegExp(`^${n}`);
866
- }, on = (e, t) => {
902
+ }, an = (e, t) => {
867
903
  const n = e.trim().replace(/\+/, "");
868
- return sn(e).test(t) && en(t, n, ">=");
869
- }, te = (e, t) => {
904
+ return on(e).test(t) && tn(t, n, ">=");
905
+ }, H = (e, t) => {
870
906
  const { concept: n } = cn(e, t);
871
907
  return n;
872
908
  }, cn = (e, t) => {
@@ -875,351 +911,348 @@ const Z = (e, t) => (e == null ? void 0 : e.names) && (e == null ? void 0 : e.na
875
911
  concept: void 0,
876
912
  scheme: void 0
877
913
  };
878
- const { childId: n, agency: r, id: s, version: o } = Pe(e);
879
- if (o != null && o.includes(W)) {
880
- const i = ee(
914
+ const { childId: n, agency: s, id: r, version: o } = we(e);
915
+ if (o?.includes(O)) {
916
+ const i = j(
881
917
  e,
882
918
  t
883
919
  );
884
920
  return {
885
- concept: he((i == null ? void 0 : i.concepts) || [], n),
921
+ concept: de(i?.concepts || [], n),
886
922
  scheme: i
887
923
  };
888
924
  }
889
925
  for (const i of t)
890
- if (an(i, s, r, o))
926
+ if (un(i, r, s, o))
891
927
  return {
892
- concept: he((i == null ? void 0 : i.concepts) || [], n),
928
+ concept: de(i?.concepts || [], n),
893
929
  scheme: i
894
930
  };
895
931
  return {
896
932
  concept: void 0,
897
933
  scheme: void 0
898
934
  };
899
- }, he = (e, t) => e == null ? void 0 : e.find((n) => n.id === t), an = (e, t, n, r) => e.id === t && e.agencyID === n && e.version === r, Un = (e = [], t = [], n) => {
900
- var a, u;
901
- const r = (n == null ? void 0 : n.conceptIdentity) || "", s = te(r, t), o = I(
902
- (a = n == null ? void 0 : n.localRepresentation) == null ? void 0 : a.enumeration
903
- ), i = I(
904
- (u = s == null ? void 0 : s.coreRepresentation) == null ? void 0 : u.enumeration
905
- ), c = o || i;
906
- if (c != null)
907
- return ee(c, e);
908
- }, xn = (e, t, n, r) => {
909
- var o, i;
910
- const s = (o = t == null ? void 0 : t.find(
911
- (c) => (c == null ? void 0 : c.id) === (e == null ? void 0 : e.id)
912
- )) == null ? void 0 : o.values;
913
- return ((i = n == null ? void 0 : n.filter((c) => s == null ? void 0 : s.some((a) => a.id === c.id))) == null ? void 0 : i.map((c) => ({
914
- ...c,
915
- name: r ? Z(c, r) : c == null ? void 0 : c.name
916
- }))) || [];
917
- }, un = (e, t) => {
918
- var s, o, i;
919
- const n = (s = t == null ? void 0 : t.dataStructureComponents) == null ? void 0 : s.attributeList, r = (o = e == null ? void 0 : e.metadataStructureComponents) == null ? void 0 : o.metadataAttributeList;
920
- return (i = n == null ? void 0 : n.metadataAttributeUsages) == null ? void 0 : i.map((c) => {
921
- var u;
922
- const a = (u = r == null ? void 0 : r.metadataAttributes) == null ? void 0 : u.find(
923
- (l) => (l == null ? void 0 : l.id) === (c == null ? void 0 : c.metadataAttributeReference)
935
+ }, de = (e, t) => e?.find((n) => n.id === t), un = (e, t, n, s) => e.id === t && e.agencyID === n && e.version === s, Cn = (e = [], t = [], n) => {
936
+ const s = n?.conceptIdentity || "", r = H(s, t), o = v(
937
+ n?.localRepresentation?.enumeration
938
+ ), i = v(
939
+ r?.coreRepresentation?.enumeration
940
+ ), a = o || i;
941
+ if (a != null)
942
+ return j(a, e);
943
+ }, Un = (e, t, n, s) => {
944
+ const r = t?.find(
945
+ (o) => o?.id === e?.id
946
+ )?.values;
947
+ return n?.filter((o) => r?.some((i) => i.id === o.id))?.map((o) => ({
948
+ ...o,
949
+ name: s ? K(o, s) : o?.name
950
+ })) || [];
951
+ }, dn = (e, t) => {
952
+ const n = t?.dataStructureComponents?.attributeList, s = e?.metadataStructureComponents?.metadataAttributeList;
953
+ return n?.metadataAttributeUsages?.map((r) => {
954
+ const o = s?.metadataAttributes?.find(
955
+ (i) => i?.id === r?.metadataAttributeReference
924
956
  );
925
957
  return {
926
- ...a,
927
- attributeRelationship: c.attributeRelationship,
928
- isMandatory: Number(a == null ? void 0 : a.minOccurs) > 0
958
+ ...o,
959
+ attributeRelationship: r.attributeRelationship,
960
+ isMandatory: Number(o?.minOccurs) > 0
929
961
  };
930
962
  });
931
- }, Yn = (e = [], t, n) => {
932
- const r = I(t == null ? void 0 : t.conceptIdentity) || "", s = te(r, e);
933
- return n ? Z(s, n) : (s == null ? void 0 : s.name) ?? (s == null ? void 0 : s.id) ?? (t == null ? void 0 : t.id);
963
+ }, xn = (e = [], t, n) => {
964
+ const s = v(t?.conceptIdentity) || "", r = H(s, e);
965
+ return n ? K(r, n) : r?.name ?? r?.id ?? t?.id;
934
966
  };
935
- function Ae(e) {
936
- var t, n, r;
937
- return (r = (n = (t = e == null ? void 0 : e.dataStructures) == null ? void 0 : t[0]) == null ? void 0 : n.dataStructureComponents) == null ? void 0 : r.dimensionList;
967
+ function le(e) {
968
+ return e?.dataStructures?.[0]?.dataStructureComponents?.dimensionList;
938
969
  }
939
- function Cn(e) {
940
- var t, n, r, s;
941
- return ((s = (r = (n = (t = e == null ? void 0 : e.data) == null ? void 0 : t.structures) == null ? void 0 : n[0]) == null ? void 0 : r.dimensions) == null ? void 0 : s.series) || [];
970
+ function Yn(e) {
971
+ return e?.data?.structures?.[0]?.dimensions?.series || [];
942
972
  }
943
973
  function Wn(e) {
944
- var t, n, r, s, o;
945
- return ((o = (s = (r = (n = (t = e == null ? void 0 : e.data) == null ? void 0 : t.structures) == null ? void 0 : n[0]) == null ? void 0 : r.dimensions) == null ? void 0 : s.observation) == null ? void 0 : o[0].values.map((i) => i.value).filter((i) => i != null)) || [];
974
+ return e?.data?.structures?.[0]?.dimensions?.observation?.[0].values.map((t) => t.value).filter((t) => t != null) || [];
946
975
  }
947
- function qn(e) {
976
+ function Vn(e) {
948
977
  return e.find(
949
978
  (t) => t.type === M.TIME_DIMENSION
950
979
  );
951
980
  }
952
- const Mn = (e) => {
953
- var i, c, a, u, l, f;
954
- const t = /* @__PURE__ */ new Map(), n = (i = e == null ? void 0 : e.dataStructures) == null ? void 0 : i[0], r = (c = e == null ? void 0 : e.metadataStructures) == null ? void 0 : c[0], s = (e == null ? void 0 : e.conceptSchemes) || [], o = (e == null ? void 0 : e.codelists) || [];
981
+ const kn = (e) => {
982
+ const t = /* @__PURE__ */ new Map(), n = e?.dataStructures?.[0], s = e?.metadataStructures?.[0], r = e?.conceptSchemes || [], o = e?.codelists || [];
955
983
  return e && [
956
- ...((a = Ae(e)) == null ? void 0 : a.dimensions) || [],
957
- ...((u = Ae(e)) == null ? void 0 : u.timeDimensions) || [],
958
- ...un(r, n),
959
- ...((f = (l = n == null ? void 0 : n.dataStructureComponents) == null ? void 0 : l.attributeList) == null ? void 0 : f.attributes) || []
984
+ ...le(e)?.dimensions || [],
985
+ ...le(e)?.timeDimensions || [],
986
+ ...dn(s, n),
987
+ ...n?.dataStructureComponents?.attributeList?.attributes || []
960
988
  ].forEach(
961
- (d) => {
962
- var A, y;
963
- const g = te(
964
- d == null ? void 0 : d.conceptIdentity,
965
- s
966
- ), h = ((A = d == null ? void 0 : d.localRepresentation) == null ? void 0 : A.enumeration) || ((y = g == null ? void 0 : g.coreRepresentation) == null ? void 0 : y.enumeration), D = ee(
967
- h,
989
+ (a) => {
990
+ const c = H(
991
+ a?.conceptIdentity,
992
+ r
993
+ ), u = a?.localRepresentation?.enumeration || c?.coreRepresentation?.enumeration, d = j(
994
+ u,
968
995
  o
969
996
  );
970
- d != null && d.id && (h ? t.set(d == null ? void 0 : d.id, {
971
- ...D,
972
- name: g == null ? void 0 : g.name,
973
- names: g == null ? void 0 : g.names
974
- }) : t.set(d == null ? void 0 : d.id, {
975
- id: d == null ? void 0 : d.id,
976
- name: g == null ? void 0 : g.name,
977
- names: g == null ? void 0 : g.names
997
+ a?.id && (u ? t.set(a?.id, {
998
+ ...d,
999
+ name: c?.name,
1000
+ names: c?.names
1001
+ }) : t.set(a?.id, {
1002
+ id: a?.id,
1003
+ name: c?.name,
1004
+ names: c?.names
978
1005
  }));
979
1006
  }
980
1007
  ), t;
981
- }, kn = (e) => {
982
- var t;
983
- return ((t = e == null ? void 0 : e.find(
984
- (n) => n.id === X.SERIES_COUNT
985
- )) == null ? void 0 : t.title) || "";
986
- }, ln = "/api/download", Qn = (e, t, n, r, s, o, i) => {
987
- const c = new URLSearchParams({
1008
+ }, qn = (e) => e?.find(
1009
+ (t) => t.id === G.SERIES_COUNT
1010
+ )?.title || "", ln = "/api/download", Qn = (e, t, n, s, r, o, i) => {
1011
+ const a = new URLSearchParams({
988
1012
  urn: e,
989
1013
  format: t,
990
1014
  compress: "false",
991
1015
  filename: o,
992
- filters: JSON.stringify(s),
993
- attribute: r,
1016
+ filters: JSON.stringify(r),
1017
+ attribute: s,
994
1018
  language: n,
995
1019
  isMetadata: i ? "true" : "none"
996
- }).toString(), a = `${ln}?${c}`;
997
- window.open(a, "_blank");
1020
+ }).toString(), c = `${ln}?${a}`;
1021
+ window.open(c, "_blank");
998
1022
  }, Bn = (e, t) => {
999
- var r, s;
1000
1023
  const n = [];
1001
- for (const o of e) {
1002
- if (o.type !== M.DIMENSION)
1024
+ for (const s of e) {
1025
+ if (s.type !== M.DIMENSION)
1003
1026
  continue;
1004
- const i = t.find((c) => c.componentCode === o.id);
1005
- i != null && ((r = i.values) == null ? void 0 : r.length) > 0 ? n.push((s = i.values) == null ? void 0 : s.join(We)) : n.push("*");
1027
+ const r = t.find((o) => o.componentCode === s.id);
1028
+ r != null && r.values?.length > 0 ? n.push(r.values?.join(We)) : n.push("*");
1006
1029
  }
1007
1030
  return n.join(".");
1008
- }, dn = (e, t) => {
1031
+ }, mn = (e, t) => {
1009
1032
  if (!e || !e.startPeriod && !e.endPeriod)
1010
1033
  return null;
1011
- const n = [], { startPeriod: r, endPeriod: s } = e;
1012
- if (r && n.push(
1013
- `${w.GREATER_OR_EQUAL}${re}${r.toISOString().split("T")[0]}`
1014
- ), s && n.push(
1015
- `${w.LESS_OR_EQUAL}${re}${s.toISOString().split("T")[0]}`
1034
+ const n = [], { startPeriod: s, endPeriod: r } = e;
1035
+ if (s && n.push(
1036
+ `${h.GREATER_OR_EQUAL}${J}${s.toISOString().split("T")[0]}`
1037
+ ), r && n.push(
1038
+ `${h.LESS_OR_EQUAL}${J}${r.toISOString().split("T")[0]}`
1016
1039
  ), n.length === 0)
1017
1040
  return null;
1018
1041
  const o = t;
1019
1042
  return n.map(
1020
- (i) => `${encodeURIComponent(`c[${o}]`)}${Ce}${encodeURIComponent(i)}`
1021
- ).join(Se);
1022
- }, Vn = (e, t) => {
1043
+ (i) => `${encodeURIComponent(`c[${o}]`)}${Ye}${encodeURIComponent(i)}`
1044
+ ).join(ge);
1045
+ }, Fn = (e, t) => {
1023
1046
  const n = fn(e, t) || null;
1024
- return n ? dn(n, t == null ? void 0 : t.id) : null;
1047
+ return n ? mn(n, t?.id) : null;
1025
1048
  }, fn = (e, t) => {
1026
- var a, u;
1027
- const n = t.id, r = (a = e == null ? void 0 : e.filters) == null ? void 0 : a.find(
1028
- (l) => l.componentCode === n
1049
+ const n = t.id, s = e?.filters?.find(
1050
+ (c) => c.componentCode === n
1029
1051
  );
1030
- if (!r || !r.values)
1052
+ if (!s || !s.values)
1031
1053
  return null;
1032
- const s = (u = r.values) == null ? void 0 : u.filter((l) => !!l);
1033
- if (!s.length)
1054
+ const r = s.values?.filter((c) => !!c);
1055
+ if (!r.length)
1034
1056
  return null;
1035
- const o = r.operator;
1036
- if (o === w.LESS_OR_EQUAL || o === w.LESS)
1037
- return { startPeriod: null, endPeriod: v(s[0]) };
1038
- if (o === w.GREATER_OR_EQUAL || o === w.GREATER)
1039
- return { startPeriod: v(s[0]), endPeriod: null };
1040
- const i = v(s[0]), c = v(s[1]);
1041
- return { startPeriod: i, endPeriod: c };
1042
- }, Ne = (e, t, n) => {
1043
- const r = R(t, !0), s = R(n), o = R(e, !0), i = R(e), c = r.getTime() > o.getTime() ? r : o, a = s.getTime() < i.getTime() ? s : i;
1057
+ const o = s.operator;
1058
+ if (o === h.LESS_OR_EQUAL || o === h.LESS)
1059
+ return { startPeriod: null, endPeriod: S(r[0]) };
1060
+ if (o === h.GREATER_OR_EQUAL || o === h.GREATER)
1061
+ return { startPeriod: S(r[0]), endPeriod: null };
1062
+ const i = S(r[0]), a = S(r[1]);
1063
+ return { startPeriod: i, endPeriod: a };
1064
+ }, Te = (e, t, n) => {
1065
+ const s = g(t, !0), r = g(n), o = g(e, !0), i = g(e), a = s.getTime() > o.getTime() ? s : o, c = r.getTime() < i.getTime() ? r : i;
1044
1066
  return {
1045
- start: c,
1046
- end: a
1067
+ start: a,
1068
+ end: c
1047
1069
  };
1048
- }, gn = (e, t, n, r = "W") => {
1049
- const s = +e, { start: o, end: i } = Ne(e, t, n);
1070
+ }, gn = (e, t, n, s = "W") => {
1071
+ const r = +e, { start: o, end: i } = Te(e, t, n);
1050
1072
  if (o.getTime() > i.getTime())
1051
1073
  return [];
1052
- const c = _(o, r), a = c.weekYear === s ? c.weekNumber : c.weekYear < s ? 1 : ce(s, r), u = _(i, r), l = u.weekYear === s ? u.weekNumber : u.weekYear > s ? ce(s, r) : 1, f = [];
1053
- if (a < l)
1054
- for (let E = a; E <= l; E++)
1055
- f.push(Re(s, E, r));
1056
- return f;
1057
- }, En = (e) => {
1074
+ const a = R(o, s), c = a.weekYear === r ? a.weekNumber : a.weekYear < r ? 1 : ne(r, s), u = R(i, s), d = u.weekYear === r ? u.weekNumber : u.weekYear > r ? ne(r, s) : 1, l = [];
1075
+ if (c < d)
1076
+ for (let m = c; m <= d; m++)
1077
+ l.push(pe(r, m, s));
1078
+ return l;
1079
+ }, hn = (e) => {
1058
1080
  const t = new Date(e);
1059
1081
  return t.setMinutes(t.getMinutes() - t.getTimezoneOffset()), t.toISOString().slice(0, 10);
1060
- }, hn = (e, t, n) => {
1061
- const { start: r, end: s } = Ne(e, t, n);
1062
- if (r.getTime() > s.getTime())
1082
+ }, pn = (e, t, n) => {
1083
+ const { start: s, end: r } = Te(e, t, n);
1084
+ if (s.getTime() > r.getTime())
1063
1085
  return [];
1064
1086
  const o = [], i = new Date(
1065
- r.getFullYear(),
1066
- r.getMonth(),
1067
- r.getDate()
1068
- ), c = new Date(s.getFullYear(), s.getMonth(), s.getDate());
1069
- for (; i.getTime() < c.getTime(); ) {
1070
- const a = En(i);
1071
- o.push(a), i.setDate(i.getDate() + 1);
1087
+ s.getFullYear(),
1088
+ s.getMonth(),
1089
+ s.getDate()
1090
+ ), a = new Date(r.getFullYear(), r.getMonth(), r.getDate());
1091
+ for (; i.getTime() < a.getTime(); ) {
1092
+ const c = hn(i);
1093
+ o.push(c), i.setDate(i.getDate() + 1);
1072
1094
  }
1073
1095
  return o;
1074
- }, An = (e) => ({
1075
- isDailyExist: !!(e != null && e.some(({ memberValue: t }) => t === "D")),
1076
- isWeeklyExist: !!(e != null && e.some(({ memberValue: t }) => t === "W")),
1077
- isMonthlyExist: !!(e != null && e.some(({ memberValue: t }) => t === "M")),
1078
- isQuarterlyExist: !!(e != null && e.some(({ memberValue: t }) => t === "Q")),
1079
- isSemiAnnualExist: !!(e != null && e.some(({ memberValue: t }) => t === "S")),
1080
- isYearlyExist: !!(e != null && e.some(
1096
+ }, En = (e) => ({
1097
+ isDailyExist: !!e?.some(({ memberValue: t }) => t === "D"),
1098
+ isWeeklyExist: !!e?.some(({ memberValue: t }) => t === "W"),
1099
+ isMonthlyExist: !!e?.some(({ memberValue: t }) => t === "M"),
1100
+ isQuarterlyExist: !!e?.some(({ memberValue: t }) => t === "Q"),
1101
+ isSemiAnnualExist: !!e?.some(({ memberValue: t }) => t === "S"),
1102
+ isYearlyExist: !!e?.some(
1081
1103
  ({ memberValue: t }) => t === "A" || t === "Y"
1082
- ))
1083
- }), Dn = (e, t, n, r) => {
1084
- var i, c;
1085
- const s = r === 0 ? ((i = R(t.toString(), !0)) == null ? void 0 : i.getMonth()) + 1 : void 0, o = r === e.length - 1 ? ((c = R(n.toString())) == null ? void 0 : c.getMonth()) + 1 || 1 : void 0;
1086
- return { startMonth: s, endMonth: o };
1087
- }, yn = ["FREQUENCY", "FREQ"], Fn = (e, t) => {
1088
- var a, u, l, f, E, d, g;
1089
- const n = (E = (f = (l = (u = (a = e == null ? void 0 : e[0]) == null ? void 0 : a.cubeRegions) == null ? void 0 : u[0]) == null ? void 0 : l.memberSelection) == null ? void 0 : f.find(
1090
- (h) => yn.includes(h.componentId)
1091
- )) == null ? void 0 : E.selectionValues, r = An(n || []), s = ((d = t == null ? void 0 : t.startPeriod) == null ? void 0 : d.getTime()) || 1, o = ((g = t == null ? void 0 : t.endPeriod) == null ? void 0 : g.getTime()) || 1, i = xt(o, s), c = [];
1092
- return i.forEach((h, D) => {
1093
- const A = [], { startMonth: y, endMonth: S } = Dn(
1104
+ )
1105
+ }), Dn = (e, t, n, s) => {
1106
+ const r = s === 0 ? g(t.toString(), !0)?.getMonth() + 1 : void 0, o = s === e.length - 1 ? g(n.toString())?.getMonth() + 1 || 1 : void 0;
1107
+ return { startMonth: r, endMonth: o };
1108
+ }, An = ["FREQUENCY", "FREQ"], Gn = (e, t) => {
1109
+ const n = e?.[0]?.cubeRegions?.[0]?.memberSelection?.find(
1110
+ (c) => An.includes(c.componentId)
1111
+ )?.selectionValues, s = En(n || []), r = t?.startPeriod?.getTime() || 1, o = t?.endPeriod?.getTime() || 1, i = Ut(o, r), a = [];
1112
+ return i.forEach((c, u) => {
1113
+ const d = [], { startMonth: l, endMonth: m } = Dn(
1094
1114
  i,
1095
- new Date(s),
1115
+ new Date(r),
1096
1116
  new Date(o),
1097
- D
1117
+ u
1098
1118
  ), {
1099
- isDailyExist: P,
1100
- isWeeklyExist: O,
1101
- isMonthlyExist: L,
1102
- isQuarterlyExist: b,
1103
- isSemiAnnualExist: U,
1104
- isYearlyExist: T
1105
- } = r;
1106
- T && A.push(h.toString()), U && A.push(...Ot(h, y, S)), b && A.push(
1107
- ...Pt(h, y, S, !1)
1108
- ), L && A.push(...Ut(h, y, S)), O && A.push(
1109
- ...gn(h, s.toString(), o.toString())
1110
- ), P && A.push(
1111
- ...hn(h, s.toString(), o.toString())
1112
- ), c.push(...A);
1113
- }), c;
1119
+ isDailyExist: f,
1120
+ isWeeklyExist: p,
1121
+ isMonthlyExist: w,
1122
+ isQuarterlyExist: I,
1123
+ isSemiAnnualExist: N,
1124
+ isYearlyExist: $
1125
+ } = s;
1126
+ $ && d.push(c.toString()), N && d.push(...Ot(c, l, m)), I && d.push(
1127
+ ..._t(c, l, m, !1)
1128
+ ), w && d.push(...Ct(c, l, m)), p && d.push(
1129
+ ...gn(c, r.toString(), o.toString())
1130
+ ), f && d.push(
1131
+ ...pn(c, r.toString(), o.toString())
1132
+ ), a.push(...d);
1133
+ }), a;
1114
1134
  };
1135
+ function Sn(e) {
1136
+ const { urn: t } = e.details;
1137
+ return Ie(t.resourceId, t.version, t.agencyId);
1138
+ }
1139
+ function Kn(e) {
1140
+ const t = {};
1141
+ for (const n of e.datasets) {
1142
+ const s = n.dataset, r = Sn(s);
1143
+ t[r] = s.details.dimensions;
1144
+ }
1145
+ return t;
1146
+ }
1115
1147
  export {
1116
- X as Annotations,
1117
- je as AssignmentStatus,
1118
- Tn as AvailabilityApi,
1119
- Ye as DATASET_DATA_URL,
1120
- wn as DatasetApi,
1148
+ G as Annotations,
1149
+ He as AssignmentStatus,
1150
+ yn as AvailabilityApi,
1151
+ xe as DATASET_DATA_URL,
1152
+ vn as DatasetApi,
1121
1153
  M as DimensionType,
1122
- be as DownloadType,
1123
- mn as FREQUENCY_DIMENSION_ID,
1124
- yn as FREQUENCY_DIM_ID,
1154
+ Me as DownloadType,
1155
+ wn as FREQUENCY_DIMENSION_ID,
1156
+ An as FREQUENCY_DIM_ID,
1125
1157
  Le as FileColumnsAttribute,
1126
- qe as GET_v3_FILTER_ALL,
1127
- Rn as GET_v3_FILTER_AND,
1158
+ Ve as GET_v3_FILTER_ALL,
1159
+ Tn as GET_v3_FILTER_AND,
1128
1160
  We as GET_v3_FILTER_OR,
1129
- Xe as OBSERVATION_KEY,
1161
+ Ze as OBSERVATION_KEY,
1130
1162
  ze as OccurrenceType,
1131
- Mt as Periods,
1132
- qt as RepresentationTextType,
1163
+ kt as Periods,
1164
+ Vt as RepresentationTextType,
1133
1165
  Wt as SDMX_DATA_QUERY_PARAMS,
1134
- W as SINGLE_WILDCARD_SYMBOL,
1135
- pn as SdmxApiClient,
1136
- De as SdmxAvailabilityMode,
1137
- $ as SdmxDataFormat,
1138
- ye as SdmxDetails,
1139
- q as SdmxReferences,
1140
- w as SeriesFilterOperator,
1141
- Vt as TIME_PERIOD,
1166
+ O as SINGLE_WILDCARD_SYMBOL,
1167
+ Rn as SdmxApiClient,
1168
+ me as SdmxAvailabilityMode,
1169
+ y as SdmxDataFormat,
1170
+ fe as SdmxDetails,
1171
+ L as SdmxReferences,
1172
+ h as SeriesFilterOperator,
1173
+ Ft as TIME_PERIOD,
1142
1174
  Qt as TIME_PERIOD_END,
1143
1175
  Bt as TIME_PERIOD_START,
1176
+ Kn as buildDatasetDimensionsMetadataMap,
1144
1177
  lt as dailyPattern,
1145
- nt as decodeDimensionId,
1146
- Un as findCodelistByDimension,
1147
- se as generateDatasetDataRequest,
1148
- Sn as generateShortUrn,
1149
- Fn as getAdditionalColumns,
1178
+ st as decodeDimensionId,
1179
+ Cn as findCodelistByDimension,
1180
+ X as generateDatasetDataRequest,
1181
+ Ie as generateShortUrn,
1182
+ Gn as getAdditionalColumns,
1150
1183
  On as getAnnotationPeriod,
1151
- ee as getArtifactByUrnWithWildCard,
1152
- vn as getAttachedDimensionsSeriesByDimension,
1153
- He as getAttachedDimensionsSeriesByTsId,
1154
- Te as getAttachedDimensionsSeriesKey,
1155
- Je as getAttributeValueFromDataQueryResponse,
1156
- xn as getAvailableCodes,
1184
+ j as getArtifactByUrnWithWildCard,
1185
+ In as getAttachedDimensionsSeriesByDimension,
1186
+ Je as getAttachedDimensionsSeriesByTsId,
1187
+ he as getAttachedDimensionsSeriesKey,
1188
+ Xe as getAttributeValueFromDataQueryResponse,
1189
+ Un as getAvailableCodes,
1157
1190
  Ln as getAvailableCodesFromConstrains,
1158
- Pe as getChildParsedUrn,
1159
- te as getConcept,
1160
- he as getConceptByUrn,
1191
+ we as getChildParsedUrn,
1192
+ H as getConcept,
1193
+ de as getConceptByUrn,
1161
1194
  cn as getConceptWithScheme,
1162
- un as getConvertedMetaAttributes,
1195
+ dn as getConvertedMetaAttributes,
1163
1196
  gt as getDailyRegExp,
1164
- hn as getDaysColumns,
1165
- Yn as getDimensionTitle,
1166
- Ae as getDimensions,
1167
- kt as getFilteredItemsWithParents,
1168
- bn as getFiltersDtoFromDataQuery,
1169
- _ as getISOWeek,
1170
- I as getKeyFromUrn,
1171
- Pn as getLastUpdatedTime,
1172
- ce as getLastWeekNumberOfYear,
1173
- Z as getLocalizedName,
1174
- Ut as getMonthlyData,
1175
- In as getMonthlyDataByQuarter,
1176
- V as getMonthlyRegExp,
1177
- pe as getParsedEndPeriodDate,
1178
- $n as getParsedResponse,
1179
- we as getParsedStartPeriodDate,
1180
- R as getPeriodDate,
1181
- An as getPeriods,
1182
- Nn as getQuarterByMonth,
1183
- K as getQuarterlyRegExp,
1184
- Pt as getQuartersData,
1185
- dn as getQueryTimePeriodFilters,
1186
- Ue as getRequestAcceptHeader,
1187
- nn as getResolvedVersionBySingleWildcard,
1197
+ pn as getDaysColumns,
1198
+ xn as getDimensionTitle,
1199
+ le as getDimensions,
1200
+ qt as getFilteredItemsWithParents,
1201
+ Mn as getFiltersDtoFromDataQuery,
1202
+ R as getISOWeek,
1203
+ v as getKeyFromUrn,
1204
+ _n as getLastUpdatedTime,
1205
+ ne as getLastWeekNumberOfYear,
1206
+ K as getLocalizedName,
1207
+ Ct as getMonthlyData,
1208
+ Pn as getMonthlyDataByQuarter,
1209
+ Y as getMonthlyRegExp,
1210
+ De as getParsedEndPeriodDate,
1211
+ Nn as getParsedResponse,
1212
+ Ee as getParsedStartPeriodDate,
1213
+ g as getPeriodDate,
1214
+ En as getPeriods,
1215
+ $n as getQuarterByMonth,
1216
+ V as getQuarterlyRegExp,
1217
+ _t as getQuartersData,
1218
+ mn as getQueryTimePeriodFilters,
1219
+ Ce as getRequestAcceptHeader,
1220
+ sn as getResolvedVersionBySingleWildcard,
1188
1221
  Ot as getSemiAnnualData,
1189
1222
  ft as getSemiAnnuallyRegExp,
1190
- C as getSeriesAttributes,
1191
- Ze as getSeriesName,
1192
- Mn as getStructureComponentsMap,
1193
- Cn as getStructureDimensions,
1194
- qn as getTimeDimension,
1223
+ _ as getSeriesAttributes,
1224
+ et as getSeriesName,
1225
+ kn as getStructureComponentsMap,
1226
+ Yn as getStructureDimensions,
1227
+ Vn as getTimeDimension,
1195
1228
  Wn as getTimePeriods,
1196
- Vn as getTimeQueryFilter,
1229
+ Fn as getTimeQueryFilter,
1197
1230
  fn as getTimeRangeFromAttachment,
1198
- kn as getTimeSeriesCount,
1231
+ qn as getTimeSeriesCount,
1199
1232
  Bn as getTimeSeriesFilterKey,
1200
- tt as getTimeSeriesId,
1201
- Re as getWeekCode,
1202
- yt as getWeeklyPeriodEndDate,
1233
+ nt as getTimeSeriesId,
1234
+ pe as getWeekCode,
1235
+ At as getWeeklyPeriodEndDate,
1203
1236
  Dt as getWeeklyPeriodStartDate,
1204
- ht as getWeeklyRegExp,
1237
+ pt as getWeeklyRegExp,
1205
1238
  gn as getWeeksColumns,
1206
- sn as getWildCardRegexp,
1207
- Ne as getYearPeriod,
1208
- k as getYearlyRegExp,
1209
- xt as getYears,
1210
- Et as isDaily,
1211
- F as isMonthly,
1212
- G as isQuarterly,
1213
- B as isSemiAnnually,
1214
- j as isWeekly,
1215
- on as isWildCardVersionCorrect,
1216
- Q as isYearly,
1217
- dt as monthlyPattern,
1239
+ on as getWildCardRegexp,
1240
+ Te as getYearPeriod,
1241
+ C as getYearlyRegExp,
1242
+ Ut as getYears,
1243
+ ht as isDaily,
1244
+ W as isMonthly,
1245
+ k as isQuarterly,
1246
+ x as isSemiAnnually,
1247
+ q as isWeekly,
1248
+ an as isWildCardVersionCorrect,
1249
+ U as isYearly,
1250
+ mt as monthlyPattern,
1218
1251
  Qn as openDownloadWindow,
1219
- it as quarterPattern,
1220
- at as semiAnnuallyPattern,
1221
- _n as sortPeriods,
1222
- p as splitUrn,
1252
+ at as quarterPattern,
1253
+ ut as semiAnnuallyPattern,
1254
+ bn as sortPeriods,
1255
+ D as splitUrn,
1223
1256
  ct as weeklyPattern,
1224
- ut as yearlyPattern
1257
+ dt as yearlyPattern
1225
1258
  };