@epam/statgpt-sdmx-toolkit 0.3.0-rc.2 → 0.3.0-rc.21
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/constants/index.d.ts +1 -0
- package/constants/time-period.d.ts +3 -0
- package/index.cjs +2 -2
- package/index.mjs +3663 -832
- package/models/dataset-dimensions-scheme.d.ts +7 -0
- package/models/datasets-metadata.d.ts +2 -1
- package/models/index.d.ts +1 -0
- package/package.json +5 -4
- package/utils/constraint.d.ts +2 -4
package/index.mjs
CHANGED
|
@@ -1,468 +1,3293 @@
|
|
|
1
|
-
const
|
|
2
|
-
if (
|
|
3
|
-
const
|
|
4
|
-
return
|
|
1
|
+
const K = (t) => {
|
|
2
|
+
if (t != null) {
|
|
3
|
+
const e = t.split("=");
|
|
4
|
+
return e.length === 1 ? t : e[1];
|
|
5
5
|
}
|
|
6
|
-
},
|
|
7
|
-
if (
|
|
6
|
+
}, H = (t) => {
|
|
7
|
+
if (t == null)
|
|
8
8
|
return {};
|
|
9
|
-
const
|
|
9
|
+
const e = K(t), n = {
|
|
10
10
|
agency: "",
|
|
11
11
|
id: "",
|
|
12
12
|
version: ""
|
|
13
13
|
};
|
|
14
|
-
return
|
|
15
|
-
},
|
|
16
|
-
const [
|
|
17
|
-
return { childId: n, agency:
|
|
18
|
-
},
|
|
19
|
-
const
|
|
20
|
-
return `${n}:${
|
|
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
|
+
}, Pt = (t) => {
|
|
16
|
+
const [e, n] = t.split(")."), { agency: r, id: s, version: a } = H(e + ")");
|
|
17
|
+
return { childId: n, agency: r, id: s, version: a };
|
|
18
|
+
}, Mt = (t, e, n) => {
|
|
19
|
+
const r = e === "" ? "" : `(${e})`;
|
|
20
|
+
return `${n}:${t}${r}`;
|
|
21
21
|
};
|
|
22
|
-
var
|
|
23
|
-
function
|
|
22
|
+
var ue = /* @__PURE__ */ ((t) => (t.DESCENDANTS = "descendants", t.NONE = "none", t.ALL = "all", t))(ue || {}), Ze = /* @__PURE__ */ ((t) => (t.EXACT = "exact", t.AVAILABLE = "available", t))(Ze || {});
|
|
23
|
+
function vt(t) {
|
|
24
24
|
return {
|
|
25
25
|
data: {
|
|
26
|
-
codelists:
|
|
27
|
-
conceptSchemes:
|
|
28
|
-
dataConstraints:
|
|
29
|
-
dataflows:
|
|
30
|
-
dataStructures:
|
|
31
|
-
metadataStructures:
|
|
26
|
+
codelists: t.data.codelists,
|
|
27
|
+
conceptSchemes: t.data.conceptSchemes,
|
|
28
|
+
dataConstraints: t.data.dataConstraints?.map(Ot),
|
|
29
|
+
dataflows: t.data.dataflows,
|
|
30
|
+
dataStructures: t.data.dataStructures,
|
|
31
|
+
metadataStructures: t.data.metadataStructures
|
|
32
32
|
}
|
|
33
33
|
};
|
|
34
34
|
}
|
|
35
|
-
function
|
|
35
|
+
function Ot(t) {
|
|
36
36
|
return {
|
|
37
|
-
...
|
|
38
|
-
cubeRegions:
|
|
37
|
+
...t,
|
|
38
|
+
cubeRegions: t.cubeRegions?.map(At)
|
|
39
39
|
};
|
|
40
40
|
}
|
|
41
|
-
function
|
|
41
|
+
function At(t) {
|
|
42
42
|
return {
|
|
43
|
-
isIncluded:
|
|
44
|
-
memberSelection:
|
|
43
|
+
isIncluded: t.include,
|
|
44
|
+
memberSelection: t.keyValues.map(Nt)
|
|
45
45
|
};
|
|
46
46
|
}
|
|
47
|
-
function
|
|
47
|
+
function Nt(t) {
|
|
48
48
|
return {
|
|
49
|
-
included:
|
|
50
|
-
componentId:
|
|
51
|
-
selectionValues:
|
|
49
|
+
included: t.include,
|
|
50
|
+
componentId: t.id,
|
|
51
|
+
selectionValues: t.values.map(kt)
|
|
52
52
|
};
|
|
53
53
|
}
|
|
54
|
-
function
|
|
54
|
+
function kt(t) {
|
|
55
55
|
return {
|
|
56
|
-
memberValue:
|
|
56
|
+
memberValue: t.value
|
|
57
57
|
};
|
|
58
58
|
}
|
|
59
|
-
const
|
|
60
|
-
class
|
|
61
|
-
constructor(
|
|
62
|
-
this.client =
|
|
59
|
+
const Rt = (t = "", e = "", n = "") => `sdmx/3.0/availability/dataflow/${t}/${e}/${n}`;
|
|
60
|
+
class La {
|
|
61
|
+
constructor(e) {
|
|
62
|
+
this.client = e;
|
|
63
63
|
}
|
|
64
|
-
async getConstraints(
|
|
65
|
-
const { agency:
|
|
64
|
+
async getConstraints(e, n) {
|
|
65
|
+
const { agency: r, id: s, version: a } = H(e), o = {
|
|
66
66
|
filters: n || [],
|
|
67
|
-
mode:
|
|
68
|
-
references:
|
|
69
|
-
},
|
|
67
|
+
mode: Ze.AVAILABLE,
|
|
68
|
+
references: ue.NONE
|
|
69
|
+
}, i = Rt(r, s, a);
|
|
70
70
|
if (this.client.config.sdmxProxyUrl) {
|
|
71
71
|
const c = await this.client.postRequest(
|
|
72
|
-
|
|
73
|
-
{ body:
|
|
72
|
+
i,
|
|
73
|
+
{ body: o },
|
|
74
74
|
this.client.config.sdmxProxyUrl
|
|
75
75
|
);
|
|
76
|
-
return
|
|
76
|
+
return vt(c);
|
|
77
77
|
}
|
|
78
78
|
return await this.client.postRequest(
|
|
79
|
-
|
|
80
|
-
{ body:
|
|
79
|
+
i,
|
|
80
|
+
{ body: o },
|
|
81
81
|
this.client.config.constrainsApiUrl || this.client.config.apiUrl
|
|
82
82
|
);
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
|
-
var
|
|
86
|
-
const
|
|
87
|
-
switch (
|
|
88
|
-
case
|
|
89
|
-
return
|
|
85
|
+
var X = /* @__PURE__ */ ((t) => (t.CSV = "csv", t.JSON = "json", t.XML = "xml", t))(X || {}), _t = /* @__PURE__ */ ((t) => (t.ID = "id", t.NAME = "name", t.ID_NAME = "both", t))(_t || {}), It = /* @__PURE__ */ ((t) => (t.FULL_DATASET = "full", t.DATA_IN_TABLE = "query", t))(It || {});
|
|
86
|
+
const Yt = (t, e) => {
|
|
87
|
+
switch (t) {
|
|
88
|
+
case X.CSV:
|
|
89
|
+
return B(
|
|
90
90
|
"application/vnd.sdmx.data+csv;version=2.0.0",
|
|
91
|
-
|
|
91
|
+
e
|
|
92
92
|
);
|
|
93
|
-
case
|
|
94
|
-
return
|
|
93
|
+
case X.XML:
|
|
94
|
+
return B(
|
|
95
95
|
"application/vnd.sdmx.data+xml;version=3.0.0",
|
|
96
|
-
|
|
96
|
+
e
|
|
97
97
|
);
|
|
98
|
-
case
|
|
99
|
-
return
|
|
98
|
+
case X.JSON:
|
|
99
|
+
return B(`application/${t}`, e);
|
|
100
100
|
default:
|
|
101
|
-
return
|
|
101
|
+
return B(
|
|
102
102
|
"application/vnd.sdmx.data+csv;version=2.0.0",
|
|
103
|
-
|
|
103
|
+
e
|
|
104
104
|
);
|
|
105
105
|
}
|
|
106
|
-
},
|
|
107
|
-
var
|
|
108
|
-
const
|
|
109
|
-
const { filterKey:
|
|
110
|
-
return `${`${
|
|
111
|
-
},
|
|
112
|
-
class
|
|
113
|
-
constructor(
|
|
114
|
-
this.client =
|
|
115
|
-
}
|
|
116
|
-
async getDataSet(
|
|
117
|
-
const { agency:
|
|
106
|
+
}, B = (t, e) => `${t}; labels=${e}`;
|
|
107
|
+
var et = /* @__PURE__ */ ((t) => (t.REFERENCE_PARTIAL = "referencepartial", t.FULL = "full", t))(et || {});
|
|
108
|
+
const Ct = "all", Lt = "sdmx/3.0/data/dataflow", tt = "&", Re = ":", St = "=", Wt = "+", Sa = ",", $t = "*", _e = (t, e, n) => {
|
|
109
|
+
const { filterKey: r, timeFilter: s } = n, { agency: a, id: o, version: i } = H(t), c = [s || "", e].filter((d) => !!d).join(tt);
|
|
110
|
+
return `${`${Lt}/${a}/${o}/${i}`}/${r || $t}?${c}`;
|
|
111
|
+
}, qt = (t = "", e = "", n = "", r = ue.DESCENDANTS) => `sdmx/3.0/structure/dataflow/${t}/${e}/${n}?references=${r}&detail=${et.REFERENCE_PARTIAL}`;
|
|
112
|
+
class Wa {
|
|
113
|
+
constructor(e) {
|
|
114
|
+
this.client = e;
|
|
115
|
+
}
|
|
116
|
+
async getDataSet(e, n) {
|
|
117
|
+
const { agency: r, id: s, version: a } = H(e);
|
|
118
118
|
return await this.client.getRequest(
|
|
119
|
-
|
|
119
|
+
qt(r, s, a, n)
|
|
120
120
|
);
|
|
121
121
|
}
|
|
122
|
-
async getDatasetData(
|
|
123
|
-
const
|
|
122
|
+
async getDatasetData(e, n) {
|
|
123
|
+
const r = new URLSearchParams({
|
|
124
124
|
includeHistory: "false",
|
|
125
125
|
limit: "1000",
|
|
126
|
-
attributes:
|
|
126
|
+
attributes: Ct,
|
|
127
127
|
dimensionAtObservation: "TIME_PERIOD"
|
|
128
128
|
// TODO: use time dimensions
|
|
129
|
-
}).toString(),
|
|
130
|
-
return await this.client.getRequest(
|
|
129
|
+
}).toString(), s = _e(e, r, n);
|
|
130
|
+
return await this.client.getRequest(s);
|
|
131
131
|
}
|
|
132
|
-
async downloadDataSet(
|
|
132
|
+
async downloadDataSet(e, n, r, s, a, o, i = !1) {
|
|
133
133
|
const c = new URLSearchParams({
|
|
134
134
|
format: n,
|
|
135
135
|
compress: "false",
|
|
136
|
-
attributes:
|
|
136
|
+
attributes: i ? "all" : "none",
|
|
137
137
|
limit: "1000"
|
|
138
|
-
}).toString(), u =
|
|
138
|
+
}).toString(), u = _e(e, c, a);
|
|
139
139
|
return this.client.streamRequest(
|
|
140
140
|
u,
|
|
141
141
|
{
|
|
142
142
|
method: "GET",
|
|
143
143
|
headers: {
|
|
144
|
-
Accept:
|
|
145
|
-
"Accept-language":
|
|
144
|
+
Accept: Yt(n, s),
|
|
145
|
+
"Accept-language": r
|
|
146
146
|
}
|
|
147
147
|
},
|
|
148
|
-
|
|
148
|
+
o
|
|
149
149
|
);
|
|
150
150
|
}
|
|
151
151
|
}
|
|
152
|
-
const
|
|
153
|
-
class
|
|
154
|
-
constructor(
|
|
155
|
-
super(
|
|
152
|
+
const Qt = (t, e) => t.error || t.message || `${e.status} ${e.statusText}`, Ft = "application/json", Ht = "Content-Type", ee = "Api-Key", Ut = "X-CONVERSATION-ID", j = "Ocp-Apim-Subscription-Key";
|
|
153
|
+
class Ie extends Error {
|
|
154
|
+
constructor(e) {
|
|
155
|
+
super(e.message), this.isHttpError = !0, this.name = "HttpError", this.code = e.code, this.status = e.status, this.details = e.details, this.displayMessage = e.displayMessage;
|
|
156
156
|
}
|
|
157
157
|
}
|
|
158
|
-
const
|
|
159
|
-
|
|
160
|
-
|
|
158
|
+
const nt = 6048e5, Bt = 864e5, de = 6e4, le = 36e5, Gt = 1e3, Ye = /* @__PURE__ */ Symbol.for("constructDateFrom");
|
|
159
|
+
function E(t, e) {
|
|
160
|
+
return typeof t == "function" ? t(e) : t && typeof t == "object" && Ye in t ? t[Ye](e) : t instanceof Date ? new t.constructor(e) : new Date(e);
|
|
161
|
+
}
|
|
162
|
+
function y(t, e) {
|
|
163
|
+
return E(e || t, t);
|
|
164
|
+
}
|
|
165
|
+
function rt(t, e, n) {
|
|
166
|
+
const r = y(t, n?.in);
|
|
167
|
+
return isNaN(e) ? E(n?.in || t, NaN) : (e && r.setDate(r.getDate() + e), r);
|
|
168
|
+
}
|
|
169
|
+
let Vt = {};
|
|
170
|
+
function S() {
|
|
171
|
+
return Vt;
|
|
172
|
+
}
|
|
173
|
+
function _(t, e) {
|
|
174
|
+
const n = S(), r = e?.weekStartsOn ?? e?.locale?.options?.weekStartsOn ?? n.weekStartsOn ?? n.locale?.options?.weekStartsOn ?? 0, s = y(t, e?.in), a = s.getDay(), o = (a < r ? 7 : 0) + a - r;
|
|
175
|
+
return s.setDate(s.getDate() - o), s.setHours(0, 0, 0, 0), s;
|
|
176
|
+
}
|
|
177
|
+
function L(t, e) {
|
|
178
|
+
return _(t, { ...e, weekStartsOn: 1 });
|
|
179
|
+
}
|
|
180
|
+
function st(t, e) {
|
|
181
|
+
const n = y(t, e?.in), r = n.getFullYear(), s = E(n, 0);
|
|
182
|
+
s.setFullYear(r + 1, 0, 4), s.setHours(0, 0, 0, 0);
|
|
183
|
+
const a = L(s), o = E(n, 0);
|
|
184
|
+
o.setFullYear(r, 0, 4), o.setHours(0, 0, 0, 0);
|
|
185
|
+
const i = L(o);
|
|
186
|
+
return n.getTime() >= a.getTime() ? r + 1 : n.getTime() >= i.getTime() ? r : r - 1;
|
|
187
|
+
}
|
|
188
|
+
function z(t) {
|
|
189
|
+
const e = y(t), n = new Date(
|
|
190
|
+
Date.UTC(
|
|
191
|
+
e.getFullYear(),
|
|
192
|
+
e.getMonth(),
|
|
193
|
+
e.getDate(),
|
|
194
|
+
e.getHours(),
|
|
195
|
+
e.getMinutes(),
|
|
196
|
+
e.getSeconds(),
|
|
197
|
+
e.getMilliseconds()
|
|
198
|
+
)
|
|
199
|
+
);
|
|
200
|
+
return n.setUTCFullYear(e.getFullYear()), +t - +n;
|
|
201
|
+
}
|
|
202
|
+
function Xt(t, ...e) {
|
|
203
|
+
const n = E.bind(
|
|
204
|
+
null,
|
|
205
|
+
e.find((r) => typeof r == "object")
|
|
206
|
+
);
|
|
207
|
+
return e.map(n);
|
|
208
|
+
}
|
|
209
|
+
function Ce(t, e) {
|
|
210
|
+
const n = y(t, e?.in);
|
|
211
|
+
return n.setHours(0, 0, 0, 0), n;
|
|
212
|
+
}
|
|
213
|
+
function jt(t, e, n) {
|
|
214
|
+
const [r, s] = Xt(
|
|
215
|
+
n?.in,
|
|
216
|
+
t,
|
|
217
|
+
e
|
|
218
|
+
), a = Ce(r), o = Ce(s), i = +a - z(a), c = +o - z(o);
|
|
219
|
+
return Math.round((i - c) / Bt);
|
|
220
|
+
}
|
|
221
|
+
function Kt(t, e) {
|
|
222
|
+
const n = st(t, e), r = E(t, 0);
|
|
223
|
+
return r.setFullYear(n, 0, 4), r.setHours(0, 0, 0, 0), L(r);
|
|
224
|
+
}
|
|
225
|
+
function zt(t) {
|
|
226
|
+
return t instanceof Date || typeof t == "object" && Object.prototype.toString.call(t) === "[object Date]";
|
|
227
|
+
}
|
|
228
|
+
function re(t) {
|
|
229
|
+
return !(!zt(t) && typeof t != "number" || isNaN(+y(t)));
|
|
230
|
+
}
|
|
231
|
+
function Jt(t, e) {
|
|
232
|
+
const n = y(t, e?.in);
|
|
233
|
+
return n.setFullYear(n.getFullYear(), 0, 1), n.setHours(0, 0, 0, 0), n;
|
|
234
|
+
}
|
|
235
|
+
const Zt = {
|
|
236
|
+
lessThanXSeconds: {
|
|
237
|
+
one: "less than a second",
|
|
238
|
+
other: "less than {{count}} seconds"
|
|
239
|
+
},
|
|
240
|
+
xSeconds: {
|
|
241
|
+
one: "1 second",
|
|
242
|
+
other: "{{count}} seconds"
|
|
243
|
+
},
|
|
244
|
+
halfAMinute: "half a minute",
|
|
245
|
+
lessThanXMinutes: {
|
|
246
|
+
one: "less than a minute",
|
|
247
|
+
other: "less than {{count}} minutes"
|
|
248
|
+
},
|
|
249
|
+
xMinutes: {
|
|
250
|
+
one: "1 minute",
|
|
251
|
+
other: "{{count}} minutes"
|
|
252
|
+
},
|
|
253
|
+
aboutXHours: {
|
|
254
|
+
one: "about 1 hour",
|
|
255
|
+
other: "about {{count}} hours"
|
|
256
|
+
},
|
|
257
|
+
xHours: {
|
|
258
|
+
one: "1 hour",
|
|
259
|
+
other: "{{count}} hours"
|
|
260
|
+
},
|
|
261
|
+
xDays: {
|
|
262
|
+
one: "1 day",
|
|
263
|
+
other: "{{count}} days"
|
|
264
|
+
},
|
|
265
|
+
aboutXWeeks: {
|
|
266
|
+
one: "about 1 week",
|
|
267
|
+
other: "about {{count}} weeks"
|
|
268
|
+
},
|
|
269
|
+
xWeeks: {
|
|
270
|
+
one: "1 week",
|
|
271
|
+
other: "{{count}} weeks"
|
|
272
|
+
},
|
|
273
|
+
aboutXMonths: {
|
|
274
|
+
one: "about 1 month",
|
|
275
|
+
other: "about {{count}} months"
|
|
276
|
+
},
|
|
277
|
+
xMonths: {
|
|
278
|
+
one: "1 month",
|
|
279
|
+
other: "{{count}} months"
|
|
280
|
+
},
|
|
281
|
+
aboutXYears: {
|
|
282
|
+
one: "about 1 year",
|
|
283
|
+
other: "about {{count}} years"
|
|
284
|
+
},
|
|
285
|
+
xYears: {
|
|
286
|
+
one: "1 year",
|
|
287
|
+
other: "{{count}} years"
|
|
288
|
+
},
|
|
289
|
+
overXYears: {
|
|
290
|
+
one: "over 1 year",
|
|
291
|
+
other: "over {{count}} years"
|
|
292
|
+
},
|
|
293
|
+
almostXYears: {
|
|
294
|
+
one: "almost 1 year",
|
|
295
|
+
other: "almost {{count}} years"
|
|
296
|
+
}
|
|
297
|
+
}, en = (t, e, n) => {
|
|
298
|
+
let r;
|
|
299
|
+
const s = Zt[t];
|
|
300
|
+
return typeof s == "string" ? r = s : e === 1 ? r = s.one : r = s.other.replace("{{count}}", e.toString()), n?.addSuffix ? n.comparison && n.comparison > 0 ? "in " + r : r + " ago" : r;
|
|
301
|
+
};
|
|
302
|
+
function te(t) {
|
|
303
|
+
return (e = {}) => {
|
|
304
|
+
const n = e.width ? String(e.width) : t.defaultWidth;
|
|
305
|
+
return t.formats[n] || t.formats[t.defaultWidth];
|
|
306
|
+
};
|
|
307
|
+
}
|
|
308
|
+
const tn = {
|
|
309
|
+
full: "EEEE, MMMM do, y",
|
|
310
|
+
long: "MMMM do, y",
|
|
311
|
+
medium: "MMM d, y",
|
|
312
|
+
short: "MM/dd/yyyy"
|
|
313
|
+
}, nn = {
|
|
314
|
+
full: "h:mm:ss a zzzz",
|
|
315
|
+
long: "h:mm:ss a z",
|
|
316
|
+
medium: "h:mm:ss a",
|
|
317
|
+
short: "h:mm a"
|
|
318
|
+
}, rn = {
|
|
319
|
+
full: "{{date}} 'at' {{time}}",
|
|
320
|
+
long: "{{date}} 'at' {{time}}",
|
|
321
|
+
medium: "{{date}}, {{time}}",
|
|
322
|
+
short: "{{date}}, {{time}}"
|
|
323
|
+
}, sn = {
|
|
324
|
+
date: te({
|
|
325
|
+
formats: tn,
|
|
326
|
+
defaultWidth: "full"
|
|
327
|
+
}),
|
|
328
|
+
time: te({
|
|
329
|
+
formats: nn,
|
|
330
|
+
defaultWidth: "full"
|
|
331
|
+
}),
|
|
332
|
+
dateTime: te({
|
|
333
|
+
formats: rn,
|
|
334
|
+
defaultWidth: "full"
|
|
335
|
+
})
|
|
336
|
+
}, an = {
|
|
337
|
+
lastWeek: "'last' eeee 'at' p",
|
|
338
|
+
yesterday: "'yesterday at' p",
|
|
339
|
+
today: "'today at' p",
|
|
340
|
+
tomorrow: "'tomorrow at' p",
|
|
341
|
+
nextWeek: "eeee 'at' p",
|
|
342
|
+
other: "P"
|
|
343
|
+
}, on = (t, e, n, r) => an[t];
|
|
344
|
+
function q(t) {
|
|
345
|
+
return (e, n) => {
|
|
346
|
+
const r = n?.context ? String(n.context) : "standalone";
|
|
347
|
+
let s;
|
|
348
|
+
if (r === "formatting" && t.formattingValues) {
|
|
349
|
+
const o = t.defaultFormattingWidth || t.defaultWidth, i = n?.width ? String(n.width) : o;
|
|
350
|
+
s = t.formattingValues[i] || t.formattingValues[o];
|
|
351
|
+
} else {
|
|
352
|
+
const o = t.defaultWidth, i = n?.width ? String(n.width) : t.defaultWidth;
|
|
353
|
+
s = t.values[i] || t.values[o];
|
|
354
|
+
}
|
|
355
|
+
const a = t.argumentCallback ? t.argumentCallback(e) : e;
|
|
356
|
+
return s[a];
|
|
357
|
+
};
|
|
358
|
+
}
|
|
359
|
+
const cn = {
|
|
360
|
+
narrow: ["B", "A"],
|
|
361
|
+
abbreviated: ["BC", "AD"],
|
|
362
|
+
wide: ["Before Christ", "Anno Domini"]
|
|
363
|
+
}, un = {
|
|
364
|
+
narrow: ["1", "2", "3", "4"],
|
|
365
|
+
abbreviated: ["Q1", "Q2", "Q3", "Q4"],
|
|
366
|
+
wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"]
|
|
367
|
+
}, dn = {
|
|
368
|
+
narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
|
|
369
|
+
abbreviated: [
|
|
370
|
+
"Jan",
|
|
371
|
+
"Feb",
|
|
372
|
+
"Mar",
|
|
373
|
+
"Apr",
|
|
374
|
+
"May",
|
|
375
|
+
"Jun",
|
|
376
|
+
"Jul",
|
|
377
|
+
"Aug",
|
|
378
|
+
"Sep",
|
|
379
|
+
"Oct",
|
|
380
|
+
"Nov",
|
|
381
|
+
"Dec"
|
|
382
|
+
],
|
|
383
|
+
wide: [
|
|
384
|
+
"January",
|
|
385
|
+
"February",
|
|
386
|
+
"March",
|
|
387
|
+
"April",
|
|
388
|
+
"May",
|
|
389
|
+
"June",
|
|
390
|
+
"July",
|
|
391
|
+
"August",
|
|
392
|
+
"September",
|
|
393
|
+
"October",
|
|
394
|
+
"November",
|
|
395
|
+
"December"
|
|
396
|
+
]
|
|
397
|
+
}, ln = {
|
|
398
|
+
narrow: ["S", "M", "T", "W", "T", "F", "S"],
|
|
399
|
+
short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
|
|
400
|
+
abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
|
|
401
|
+
wide: [
|
|
402
|
+
"Sunday",
|
|
403
|
+
"Monday",
|
|
404
|
+
"Tuesday",
|
|
405
|
+
"Wednesday",
|
|
406
|
+
"Thursday",
|
|
407
|
+
"Friday",
|
|
408
|
+
"Saturday"
|
|
409
|
+
]
|
|
410
|
+
}, fn = {
|
|
411
|
+
narrow: {
|
|
412
|
+
am: "a",
|
|
413
|
+
pm: "p",
|
|
414
|
+
midnight: "mi",
|
|
415
|
+
noon: "n",
|
|
416
|
+
morning: "morning",
|
|
417
|
+
afternoon: "afternoon",
|
|
418
|
+
evening: "evening",
|
|
419
|
+
night: "night"
|
|
420
|
+
},
|
|
421
|
+
abbreviated: {
|
|
422
|
+
am: "AM",
|
|
423
|
+
pm: "PM",
|
|
424
|
+
midnight: "midnight",
|
|
425
|
+
noon: "noon",
|
|
426
|
+
morning: "morning",
|
|
427
|
+
afternoon: "afternoon",
|
|
428
|
+
evening: "evening",
|
|
429
|
+
night: "night"
|
|
430
|
+
},
|
|
431
|
+
wide: {
|
|
432
|
+
am: "a.m.",
|
|
433
|
+
pm: "p.m.",
|
|
434
|
+
midnight: "midnight",
|
|
435
|
+
noon: "noon",
|
|
436
|
+
morning: "morning",
|
|
437
|
+
afternoon: "afternoon",
|
|
438
|
+
evening: "evening",
|
|
439
|
+
night: "night"
|
|
440
|
+
}
|
|
441
|
+
}, mn = {
|
|
442
|
+
narrow: {
|
|
443
|
+
am: "a",
|
|
444
|
+
pm: "p",
|
|
445
|
+
midnight: "mi",
|
|
446
|
+
noon: "n",
|
|
447
|
+
morning: "in the morning",
|
|
448
|
+
afternoon: "in the afternoon",
|
|
449
|
+
evening: "in the evening",
|
|
450
|
+
night: "at night"
|
|
451
|
+
},
|
|
452
|
+
abbreviated: {
|
|
453
|
+
am: "AM",
|
|
454
|
+
pm: "PM",
|
|
455
|
+
midnight: "midnight",
|
|
456
|
+
noon: "noon",
|
|
457
|
+
morning: "in the morning",
|
|
458
|
+
afternoon: "in the afternoon",
|
|
459
|
+
evening: "in the evening",
|
|
460
|
+
night: "at night"
|
|
461
|
+
},
|
|
462
|
+
wide: {
|
|
463
|
+
am: "a.m.",
|
|
464
|
+
pm: "p.m.",
|
|
465
|
+
midnight: "midnight",
|
|
466
|
+
noon: "noon",
|
|
467
|
+
morning: "in the morning",
|
|
468
|
+
afternoon: "in the afternoon",
|
|
469
|
+
evening: "in the evening",
|
|
470
|
+
night: "at night"
|
|
471
|
+
}
|
|
472
|
+
}, hn = (t, e) => {
|
|
473
|
+
const n = Number(t), r = n % 100;
|
|
474
|
+
if (r > 20 || r < 10)
|
|
475
|
+
switch (r % 10) {
|
|
476
|
+
case 1:
|
|
477
|
+
return n + "st";
|
|
478
|
+
case 2:
|
|
479
|
+
return n + "nd";
|
|
480
|
+
case 3:
|
|
481
|
+
return n + "rd";
|
|
482
|
+
}
|
|
483
|
+
return n + "th";
|
|
484
|
+
}, wn = {
|
|
485
|
+
ordinalNumber: hn,
|
|
486
|
+
era: q({
|
|
487
|
+
values: cn,
|
|
488
|
+
defaultWidth: "wide"
|
|
489
|
+
}),
|
|
490
|
+
quarter: q({
|
|
491
|
+
values: un,
|
|
492
|
+
defaultWidth: "wide",
|
|
493
|
+
argumentCallback: (t) => t - 1
|
|
494
|
+
}),
|
|
495
|
+
month: q({
|
|
496
|
+
values: dn,
|
|
497
|
+
defaultWidth: "wide"
|
|
498
|
+
}),
|
|
499
|
+
day: q({
|
|
500
|
+
values: ln,
|
|
501
|
+
defaultWidth: "wide"
|
|
502
|
+
}),
|
|
503
|
+
dayPeriod: q({
|
|
504
|
+
values: fn,
|
|
505
|
+
defaultWidth: "wide",
|
|
506
|
+
formattingValues: mn,
|
|
507
|
+
defaultFormattingWidth: "wide"
|
|
508
|
+
})
|
|
509
|
+
};
|
|
510
|
+
function Q(t) {
|
|
511
|
+
return (e, n = {}) => {
|
|
512
|
+
const r = n.width, s = r && t.matchPatterns[r] || t.matchPatterns[t.defaultMatchWidth], a = e.match(s);
|
|
513
|
+
if (!a)
|
|
514
|
+
return null;
|
|
515
|
+
const o = a[0], i = r && t.parsePatterns[r] || t.parsePatterns[t.defaultParseWidth], c = Array.isArray(i) ? pn(i, (l) => l.test(o)) : (
|
|
516
|
+
// [TODO] -- I challenge you to fix the type
|
|
517
|
+
gn(i, (l) => l.test(o))
|
|
518
|
+
);
|
|
519
|
+
let u;
|
|
520
|
+
u = t.valueCallback ? t.valueCallback(c) : c, u = n.valueCallback ? (
|
|
521
|
+
// [TODO] -- I challenge you to fix the type
|
|
522
|
+
n.valueCallback(u)
|
|
523
|
+
) : u;
|
|
524
|
+
const d = e.slice(o.length);
|
|
525
|
+
return { value: u, rest: d };
|
|
526
|
+
};
|
|
527
|
+
}
|
|
528
|
+
function gn(t, e) {
|
|
529
|
+
for (const n in t)
|
|
530
|
+
if (Object.prototype.hasOwnProperty.call(t, n) && e(t[n]))
|
|
531
|
+
return n;
|
|
532
|
+
}
|
|
533
|
+
function pn(t, e) {
|
|
534
|
+
for (let n = 0; n < t.length; n++)
|
|
535
|
+
if (e(t[n]))
|
|
536
|
+
return n;
|
|
537
|
+
}
|
|
538
|
+
function yn(t) {
|
|
539
|
+
return (e, n = {}) => {
|
|
540
|
+
const r = e.match(t.matchPattern);
|
|
541
|
+
if (!r) return null;
|
|
542
|
+
const s = r[0], a = e.match(t.parsePattern);
|
|
543
|
+
if (!a) return null;
|
|
544
|
+
let o = t.valueCallback ? t.valueCallback(a[0]) : a[0];
|
|
545
|
+
o = n.valueCallback ? n.valueCallback(o) : o;
|
|
546
|
+
const i = e.slice(s.length);
|
|
547
|
+
return { value: o, rest: i };
|
|
161
548
|
};
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
549
|
+
}
|
|
550
|
+
const bn = /^(\d+)(th|st|nd|rd)?/i, Dn = /\d+/i, Tn = {
|
|
551
|
+
narrow: /^(b|a)/i,
|
|
552
|
+
abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
|
|
553
|
+
wide: /^(before christ|before common era|anno domini|common era)/i
|
|
554
|
+
}, En = {
|
|
555
|
+
any: [/^b/i, /^(a|c)/i]
|
|
556
|
+
}, xn = {
|
|
557
|
+
narrow: /^[1234]/i,
|
|
558
|
+
abbreviated: /^q[1234]/i,
|
|
559
|
+
wide: /^[1234](th|st|nd|rd)? quarter/i
|
|
560
|
+
}, Pn = {
|
|
561
|
+
any: [/1/i, /2/i, /3/i, /4/i]
|
|
562
|
+
}, Mn = {
|
|
563
|
+
narrow: /^[jfmasond]/i,
|
|
564
|
+
abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
|
|
565
|
+
wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
|
|
566
|
+
}, vn = {
|
|
567
|
+
narrow: [
|
|
568
|
+
/^j/i,
|
|
569
|
+
/^f/i,
|
|
570
|
+
/^m/i,
|
|
571
|
+
/^a/i,
|
|
572
|
+
/^m/i,
|
|
573
|
+
/^j/i,
|
|
574
|
+
/^j/i,
|
|
575
|
+
/^a/i,
|
|
576
|
+
/^s/i,
|
|
577
|
+
/^o/i,
|
|
578
|
+
/^n/i,
|
|
579
|
+
/^d/i
|
|
580
|
+
],
|
|
581
|
+
any: [
|
|
582
|
+
/^ja/i,
|
|
583
|
+
/^f/i,
|
|
584
|
+
/^mar/i,
|
|
585
|
+
/^ap/i,
|
|
586
|
+
/^may/i,
|
|
587
|
+
/^jun/i,
|
|
588
|
+
/^jul/i,
|
|
589
|
+
/^au/i,
|
|
590
|
+
/^s/i,
|
|
591
|
+
/^o/i,
|
|
592
|
+
/^n/i,
|
|
593
|
+
/^d/i
|
|
594
|
+
]
|
|
595
|
+
}, On = {
|
|
596
|
+
narrow: /^[smtwf]/i,
|
|
597
|
+
short: /^(su|mo|tu|we|th|fr|sa)/i,
|
|
598
|
+
abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
|
|
599
|
+
wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
|
|
600
|
+
}, An = {
|
|
601
|
+
narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
|
|
602
|
+
any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
|
|
603
|
+
}, Nn = {
|
|
604
|
+
narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
|
|
605
|
+
any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
|
|
606
|
+
}, kn = {
|
|
607
|
+
any: {
|
|
608
|
+
am: /^a/i,
|
|
609
|
+
pm: /^p/i,
|
|
610
|
+
midnight: /^mi/i,
|
|
611
|
+
noon: /^no/i,
|
|
612
|
+
morning: /morning/i,
|
|
613
|
+
afternoon: /afternoon/i,
|
|
614
|
+
evening: /evening/i,
|
|
615
|
+
night: /night/i
|
|
616
|
+
}
|
|
617
|
+
}, Rn = {
|
|
618
|
+
ordinalNumber: yn({
|
|
619
|
+
matchPattern: bn,
|
|
620
|
+
parsePattern: Dn,
|
|
621
|
+
valueCallback: (t) => parseInt(t, 10)
|
|
622
|
+
}),
|
|
623
|
+
era: Q({
|
|
624
|
+
matchPatterns: Tn,
|
|
625
|
+
defaultMatchWidth: "wide",
|
|
626
|
+
parsePatterns: En,
|
|
627
|
+
defaultParseWidth: "any"
|
|
628
|
+
}),
|
|
629
|
+
quarter: Q({
|
|
630
|
+
matchPatterns: xn,
|
|
631
|
+
defaultMatchWidth: "wide",
|
|
632
|
+
parsePatterns: Pn,
|
|
633
|
+
defaultParseWidth: "any",
|
|
634
|
+
valueCallback: (t) => t + 1
|
|
635
|
+
}),
|
|
636
|
+
month: Q({
|
|
637
|
+
matchPatterns: Mn,
|
|
638
|
+
defaultMatchWidth: "wide",
|
|
639
|
+
parsePatterns: vn,
|
|
640
|
+
defaultParseWidth: "any"
|
|
641
|
+
}),
|
|
642
|
+
day: Q({
|
|
643
|
+
matchPatterns: On,
|
|
644
|
+
defaultMatchWidth: "wide",
|
|
645
|
+
parsePatterns: An,
|
|
646
|
+
defaultParseWidth: "any"
|
|
647
|
+
}),
|
|
648
|
+
dayPeriod: Q({
|
|
649
|
+
matchPatterns: Nn,
|
|
650
|
+
defaultMatchWidth: "any",
|
|
651
|
+
parsePatterns: kn,
|
|
652
|
+
defaultParseWidth: "any"
|
|
653
|
+
})
|
|
654
|
+
}, at = {
|
|
655
|
+
code: "en-US",
|
|
656
|
+
formatDistance: en,
|
|
657
|
+
formatLong: sn,
|
|
658
|
+
formatRelative: on,
|
|
659
|
+
localize: wn,
|
|
660
|
+
match: Rn,
|
|
661
|
+
options: {
|
|
662
|
+
weekStartsOn: 0,
|
|
663
|
+
firstWeekContainsDate: 1
|
|
664
|
+
}
|
|
665
|
+
};
|
|
666
|
+
function _n(t, e) {
|
|
667
|
+
const n = y(t, e?.in);
|
|
668
|
+
return jt(n, Jt(n)) + 1;
|
|
669
|
+
}
|
|
670
|
+
function ot(t, e) {
|
|
671
|
+
const n = y(t, e?.in), r = +L(n) - +Kt(n);
|
|
672
|
+
return Math.round(r / nt) + 1;
|
|
673
|
+
}
|
|
674
|
+
function fe(t, e) {
|
|
675
|
+
const n = y(t, e?.in), r = n.getFullYear(), s = S(), a = e?.firstWeekContainsDate ?? e?.locale?.options?.firstWeekContainsDate ?? s.firstWeekContainsDate ?? s.locale?.options?.firstWeekContainsDate ?? 1, o = E(e?.in || t, 0);
|
|
676
|
+
o.setFullYear(r + 1, 0, a), o.setHours(0, 0, 0, 0);
|
|
677
|
+
const i = _(o, e), c = E(e?.in || t, 0);
|
|
678
|
+
c.setFullYear(r, 0, a), c.setHours(0, 0, 0, 0);
|
|
679
|
+
const u = _(c, e);
|
|
680
|
+
return +n >= +i ? r + 1 : +n >= +u ? r : r - 1;
|
|
681
|
+
}
|
|
682
|
+
function In(t, e) {
|
|
683
|
+
const n = S(), r = e?.firstWeekContainsDate ?? e?.locale?.options?.firstWeekContainsDate ?? n.firstWeekContainsDate ?? n.locale?.options?.firstWeekContainsDate ?? 1, s = fe(t, e), a = E(e?.in || t, 0);
|
|
684
|
+
return a.setFullYear(s, 0, r), a.setHours(0, 0, 0, 0), _(a, e);
|
|
685
|
+
}
|
|
686
|
+
function it(t, e) {
|
|
687
|
+
const n = y(t, e?.in), r = +_(n, e) - +In(n, e);
|
|
688
|
+
return Math.round(r / nt) + 1;
|
|
689
|
+
}
|
|
690
|
+
function h(t, e) {
|
|
691
|
+
const n = t < 0 ? "-" : "", r = Math.abs(t).toString().padStart(e, "0");
|
|
692
|
+
return n + r;
|
|
693
|
+
}
|
|
694
|
+
const N = {
|
|
695
|
+
// Year
|
|
696
|
+
y(t, e) {
|
|
697
|
+
const n = t.getFullYear(), r = n > 0 ? n : 1 - n;
|
|
698
|
+
return h(e === "yy" ? r % 100 : r, e.length);
|
|
699
|
+
},
|
|
700
|
+
// Month
|
|
701
|
+
M(t, e) {
|
|
702
|
+
const n = t.getMonth();
|
|
703
|
+
return e === "M" ? String(n + 1) : h(n + 1, 2);
|
|
704
|
+
},
|
|
705
|
+
// Day of the month
|
|
706
|
+
d(t, e) {
|
|
707
|
+
return h(t.getDate(), e.length);
|
|
708
|
+
},
|
|
709
|
+
// AM or PM
|
|
710
|
+
a(t, e) {
|
|
711
|
+
const n = t.getHours() / 12 >= 1 ? "pm" : "am";
|
|
712
|
+
switch (e) {
|
|
713
|
+
case "a":
|
|
714
|
+
case "aa":
|
|
715
|
+
return n.toUpperCase();
|
|
716
|
+
case "aaa":
|
|
717
|
+
return n;
|
|
718
|
+
case "aaaaa":
|
|
719
|
+
return n[0];
|
|
720
|
+
default:
|
|
721
|
+
return n === "am" ? "a.m." : "p.m.";
|
|
722
|
+
}
|
|
723
|
+
},
|
|
724
|
+
// Hour [1-12]
|
|
725
|
+
h(t, e) {
|
|
726
|
+
return h(t.getHours() % 12 || 12, e.length);
|
|
727
|
+
},
|
|
728
|
+
// Hour [0-23]
|
|
729
|
+
H(t, e) {
|
|
730
|
+
return h(t.getHours(), e.length);
|
|
731
|
+
},
|
|
732
|
+
// Minute
|
|
733
|
+
m(t, e) {
|
|
734
|
+
return h(t.getMinutes(), e.length);
|
|
735
|
+
},
|
|
736
|
+
// Second
|
|
737
|
+
s(t, e) {
|
|
738
|
+
return h(t.getSeconds(), e.length);
|
|
739
|
+
},
|
|
740
|
+
// Fraction of second
|
|
741
|
+
S(t, e) {
|
|
742
|
+
const n = e.length, r = t.getMilliseconds(), s = Math.trunc(
|
|
743
|
+
r * Math.pow(10, n - 3)
|
|
744
|
+
);
|
|
745
|
+
return h(s, e.length);
|
|
746
|
+
}
|
|
747
|
+
}, C = {
|
|
748
|
+
midnight: "midnight",
|
|
749
|
+
noon: "noon",
|
|
750
|
+
morning: "morning",
|
|
751
|
+
afternoon: "afternoon",
|
|
752
|
+
evening: "evening",
|
|
753
|
+
night: "night"
|
|
754
|
+
}, Le = {
|
|
755
|
+
// Era
|
|
756
|
+
G: function(t, e, n) {
|
|
757
|
+
const r = t.getFullYear() > 0 ? 1 : 0;
|
|
758
|
+
switch (e) {
|
|
759
|
+
// AD, BC
|
|
760
|
+
case "G":
|
|
761
|
+
case "GG":
|
|
762
|
+
case "GGG":
|
|
763
|
+
return n.era(r, { width: "abbreviated" });
|
|
764
|
+
// A, B
|
|
765
|
+
case "GGGGG":
|
|
766
|
+
return n.era(r, { width: "narrow" });
|
|
767
|
+
default:
|
|
768
|
+
return n.era(r, { width: "wide" });
|
|
769
|
+
}
|
|
770
|
+
},
|
|
771
|
+
// Year
|
|
772
|
+
y: function(t, e, n) {
|
|
773
|
+
if (e === "yo") {
|
|
774
|
+
const r = t.getFullYear(), s = r > 0 ? r : 1 - r;
|
|
775
|
+
return n.ordinalNumber(s, { unit: "year" });
|
|
776
|
+
}
|
|
777
|
+
return N.y(t, e);
|
|
778
|
+
},
|
|
779
|
+
// Local week-numbering year
|
|
780
|
+
Y: function(t, e, n, r) {
|
|
781
|
+
const s = fe(t, r), a = s > 0 ? s : 1 - s;
|
|
782
|
+
if (e === "YY") {
|
|
783
|
+
const o = a % 100;
|
|
784
|
+
return h(o, 2);
|
|
785
|
+
}
|
|
786
|
+
return e === "Yo" ? n.ordinalNumber(a, { unit: "year" }) : h(a, e.length);
|
|
787
|
+
},
|
|
788
|
+
// ISO week-numbering year
|
|
789
|
+
R: function(t, e) {
|
|
790
|
+
const n = st(t);
|
|
791
|
+
return h(n, e.length);
|
|
792
|
+
},
|
|
793
|
+
// Extended year. This is a single number designating the year of this calendar system.
|
|
794
|
+
// The main difference between `y` and `u` localizers are B.C. years:
|
|
795
|
+
// | Year | `y` | `u` |
|
|
796
|
+
// |------|-----|-----|
|
|
797
|
+
// | AC 1 | 1 | 1 |
|
|
798
|
+
// | BC 1 | 1 | 0 |
|
|
799
|
+
// | BC 2 | 2 | -1 |
|
|
800
|
+
// Also `yy` always returns the last two digits of a year,
|
|
801
|
+
// while `uu` pads single digit years to 2 characters and returns other years unchanged.
|
|
802
|
+
u: function(t, e) {
|
|
803
|
+
const n = t.getFullYear();
|
|
804
|
+
return h(n, e.length);
|
|
805
|
+
},
|
|
806
|
+
// Quarter
|
|
807
|
+
Q: function(t, e, n) {
|
|
808
|
+
const r = Math.ceil((t.getMonth() + 1) / 3);
|
|
809
|
+
switch (e) {
|
|
810
|
+
// 1, 2, 3, 4
|
|
811
|
+
case "Q":
|
|
812
|
+
return String(r);
|
|
813
|
+
// 01, 02, 03, 04
|
|
814
|
+
case "QQ":
|
|
815
|
+
return h(r, 2);
|
|
816
|
+
// 1st, 2nd, 3rd, 4th
|
|
817
|
+
case "Qo":
|
|
818
|
+
return n.ordinalNumber(r, { unit: "quarter" });
|
|
819
|
+
// Q1, Q2, Q3, Q4
|
|
820
|
+
case "QQQ":
|
|
821
|
+
return n.quarter(r, {
|
|
822
|
+
width: "abbreviated",
|
|
823
|
+
context: "formatting"
|
|
824
|
+
});
|
|
825
|
+
// 1, 2, 3, 4 (narrow quarter; could be not numerical)
|
|
826
|
+
case "QQQQQ":
|
|
827
|
+
return n.quarter(r, {
|
|
828
|
+
width: "narrow",
|
|
829
|
+
context: "formatting"
|
|
830
|
+
});
|
|
831
|
+
default:
|
|
832
|
+
return n.quarter(r, {
|
|
833
|
+
width: "wide",
|
|
834
|
+
context: "formatting"
|
|
835
|
+
});
|
|
836
|
+
}
|
|
837
|
+
},
|
|
838
|
+
// Stand-alone quarter
|
|
839
|
+
q: function(t, e, n) {
|
|
840
|
+
const r = Math.ceil((t.getMonth() + 1) / 3);
|
|
841
|
+
switch (e) {
|
|
842
|
+
// 1, 2, 3, 4
|
|
843
|
+
case "q":
|
|
844
|
+
return String(r);
|
|
845
|
+
// 01, 02, 03, 04
|
|
846
|
+
case "qq":
|
|
847
|
+
return h(r, 2);
|
|
848
|
+
// 1st, 2nd, 3rd, 4th
|
|
849
|
+
case "qo":
|
|
850
|
+
return n.ordinalNumber(r, { unit: "quarter" });
|
|
851
|
+
// Q1, Q2, Q3, Q4
|
|
852
|
+
case "qqq":
|
|
853
|
+
return n.quarter(r, {
|
|
854
|
+
width: "abbreviated",
|
|
855
|
+
context: "standalone"
|
|
856
|
+
});
|
|
857
|
+
// 1, 2, 3, 4 (narrow quarter; could be not numerical)
|
|
858
|
+
case "qqqqq":
|
|
859
|
+
return n.quarter(r, {
|
|
860
|
+
width: "narrow",
|
|
861
|
+
context: "standalone"
|
|
862
|
+
});
|
|
863
|
+
default:
|
|
864
|
+
return n.quarter(r, {
|
|
865
|
+
width: "wide",
|
|
866
|
+
context: "standalone"
|
|
867
|
+
});
|
|
868
|
+
}
|
|
869
|
+
},
|
|
870
|
+
// Month
|
|
871
|
+
M: function(t, e, n) {
|
|
872
|
+
const r = t.getMonth();
|
|
873
|
+
switch (e) {
|
|
874
|
+
case "M":
|
|
875
|
+
case "MM":
|
|
876
|
+
return N.M(t, e);
|
|
877
|
+
// 1st, 2nd, ..., 12th
|
|
878
|
+
case "Mo":
|
|
879
|
+
return n.ordinalNumber(r + 1, { unit: "month" });
|
|
880
|
+
// Jan, Feb, ..., Dec
|
|
881
|
+
case "MMM":
|
|
882
|
+
return n.month(r, {
|
|
883
|
+
width: "abbreviated",
|
|
884
|
+
context: "formatting"
|
|
885
|
+
});
|
|
886
|
+
// J, F, ..., D
|
|
887
|
+
case "MMMMM":
|
|
888
|
+
return n.month(r, {
|
|
889
|
+
width: "narrow",
|
|
890
|
+
context: "formatting"
|
|
891
|
+
});
|
|
892
|
+
default:
|
|
893
|
+
return n.month(r, { width: "wide", context: "formatting" });
|
|
894
|
+
}
|
|
895
|
+
},
|
|
896
|
+
// Stand-alone month
|
|
897
|
+
L: function(t, e, n) {
|
|
898
|
+
const r = t.getMonth();
|
|
899
|
+
switch (e) {
|
|
900
|
+
// 1, 2, ..., 12
|
|
901
|
+
case "L":
|
|
902
|
+
return String(r + 1);
|
|
903
|
+
// 01, 02, ..., 12
|
|
904
|
+
case "LL":
|
|
905
|
+
return h(r + 1, 2);
|
|
906
|
+
// 1st, 2nd, ..., 12th
|
|
907
|
+
case "Lo":
|
|
908
|
+
return n.ordinalNumber(r + 1, { unit: "month" });
|
|
909
|
+
// Jan, Feb, ..., Dec
|
|
910
|
+
case "LLL":
|
|
911
|
+
return n.month(r, {
|
|
912
|
+
width: "abbreviated",
|
|
913
|
+
context: "standalone"
|
|
914
|
+
});
|
|
915
|
+
// J, F, ..., D
|
|
916
|
+
case "LLLLL":
|
|
917
|
+
return n.month(r, {
|
|
918
|
+
width: "narrow",
|
|
919
|
+
context: "standalone"
|
|
920
|
+
});
|
|
921
|
+
default:
|
|
922
|
+
return n.month(r, { width: "wide", context: "standalone" });
|
|
923
|
+
}
|
|
924
|
+
},
|
|
925
|
+
// Local week of year
|
|
926
|
+
w: function(t, e, n, r) {
|
|
927
|
+
const s = it(t, r);
|
|
928
|
+
return e === "wo" ? n.ordinalNumber(s, { unit: "week" }) : h(s, e.length);
|
|
929
|
+
},
|
|
930
|
+
// ISO week of year
|
|
931
|
+
I: function(t, e, n) {
|
|
932
|
+
const r = ot(t);
|
|
933
|
+
return e === "Io" ? n.ordinalNumber(r, { unit: "week" }) : h(r, e.length);
|
|
934
|
+
},
|
|
935
|
+
// Day of the month
|
|
936
|
+
d: function(t, e, n) {
|
|
937
|
+
return e === "do" ? n.ordinalNumber(t.getDate(), { unit: "date" }) : N.d(t, e);
|
|
938
|
+
},
|
|
939
|
+
// Day of year
|
|
940
|
+
D: function(t, e, n) {
|
|
941
|
+
const r = _n(t);
|
|
942
|
+
return e === "Do" ? n.ordinalNumber(r, { unit: "dayOfYear" }) : h(r, e.length);
|
|
943
|
+
},
|
|
944
|
+
// Day of week
|
|
945
|
+
E: function(t, e, n) {
|
|
946
|
+
const r = t.getDay();
|
|
947
|
+
switch (e) {
|
|
948
|
+
// Tue
|
|
949
|
+
case "E":
|
|
950
|
+
case "EE":
|
|
951
|
+
case "EEE":
|
|
952
|
+
return n.day(r, {
|
|
953
|
+
width: "abbreviated",
|
|
954
|
+
context: "formatting"
|
|
955
|
+
});
|
|
956
|
+
// T
|
|
957
|
+
case "EEEEE":
|
|
958
|
+
return n.day(r, {
|
|
959
|
+
width: "narrow",
|
|
960
|
+
context: "formatting"
|
|
961
|
+
});
|
|
962
|
+
// Tu
|
|
963
|
+
case "EEEEEE":
|
|
964
|
+
return n.day(r, {
|
|
965
|
+
width: "short",
|
|
966
|
+
context: "formatting"
|
|
967
|
+
});
|
|
968
|
+
default:
|
|
969
|
+
return n.day(r, {
|
|
970
|
+
width: "wide",
|
|
971
|
+
context: "formatting"
|
|
972
|
+
});
|
|
973
|
+
}
|
|
974
|
+
},
|
|
975
|
+
// Local day of week
|
|
976
|
+
e: function(t, e, n, r) {
|
|
977
|
+
const s = t.getDay(), a = (s - r.weekStartsOn + 8) % 7 || 7;
|
|
978
|
+
switch (e) {
|
|
979
|
+
// Numerical value (Nth day of week with current locale or weekStartsOn)
|
|
980
|
+
case "e":
|
|
981
|
+
return String(a);
|
|
982
|
+
// Padded numerical value
|
|
983
|
+
case "ee":
|
|
984
|
+
return h(a, 2);
|
|
985
|
+
// 1st, 2nd, ..., 7th
|
|
986
|
+
case "eo":
|
|
987
|
+
return n.ordinalNumber(a, { unit: "day" });
|
|
988
|
+
case "eee":
|
|
989
|
+
return n.day(s, {
|
|
990
|
+
width: "abbreviated",
|
|
991
|
+
context: "formatting"
|
|
992
|
+
});
|
|
993
|
+
// T
|
|
994
|
+
case "eeeee":
|
|
995
|
+
return n.day(s, {
|
|
996
|
+
width: "narrow",
|
|
997
|
+
context: "formatting"
|
|
998
|
+
});
|
|
999
|
+
// Tu
|
|
1000
|
+
case "eeeeee":
|
|
1001
|
+
return n.day(s, {
|
|
1002
|
+
width: "short",
|
|
1003
|
+
context: "formatting"
|
|
1004
|
+
});
|
|
1005
|
+
default:
|
|
1006
|
+
return n.day(s, {
|
|
1007
|
+
width: "wide",
|
|
1008
|
+
context: "formatting"
|
|
1009
|
+
});
|
|
1010
|
+
}
|
|
1011
|
+
},
|
|
1012
|
+
// Stand-alone local day of week
|
|
1013
|
+
c: function(t, e, n, r) {
|
|
1014
|
+
const s = t.getDay(), a = (s - r.weekStartsOn + 8) % 7 || 7;
|
|
1015
|
+
switch (e) {
|
|
1016
|
+
// Numerical value (same as in `e`)
|
|
1017
|
+
case "c":
|
|
1018
|
+
return String(a);
|
|
1019
|
+
// Padded numerical value
|
|
1020
|
+
case "cc":
|
|
1021
|
+
return h(a, e.length);
|
|
1022
|
+
// 1st, 2nd, ..., 7th
|
|
1023
|
+
case "co":
|
|
1024
|
+
return n.ordinalNumber(a, { unit: "day" });
|
|
1025
|
+
case "ccc":
|
|
1026
|
+
return n.day(s, {
|
|
1027
|
+
width: "abbreviated",
|
|
1028
|
+
context: "standalone"
|
|
1029
|
+
});
|
|
1030
|
+
// T
|
|
1031
|
+
case "ccccc":
|
|
1032
|
+
return n.day(s, {
|
|
1033
|
+
width: "narrow",
|
|
1034
|
+
context: "standalone"
|
|
1035
|
+
});
|
|
1036
|
+
// Tu
|
|
1037
|
+
case "cccccc":
|
|
1038
|
+
return n.day(s, {
|
|
1039
|
+
width: "short",
|
|
1040
|
+
context: "standalone"
|
|
1041
|
+
});
|
|
1042
|
+
default:
|
|
1043
|
+
return n.day(s, {
|
|
1044
|
+
width: "wide",
|
|
1045
|
+
context: "standalone"
|
|
1046
|
+
});
|
|
1047
|
+
}
|
|
1048
|
+
},
|
|
1049
|
+
// ISO day of week
|
|
1050
|
+
i: function(t, e, n) {
|
|
1051
|
+
const r = t.getDay(), s = r === 0 ? 7 : r;
|
|
1052
|
+
switch (e) {
|
|
1053
|
+
// 2
|
|
1054
|
+
case "i":
|
|
1055
|
+
return String(s);
|
|
1056
|
+
// 02
|
|
1057
|
+
case "ii":
|
|
1058
|
+
return h(s, e.length);
|
|
1059
|
+
// 2nd
|
|
1060
|
+
case "io":
|
|
1061
|
+
return n.ordinalNumber(s, { unit: "day" });
|
|
1062
|
+
// Tue
|
|
1063
|
+
case "iii":
|
|
1064
|
+
return n.day(r, {
|
|
1065
|
+
width: "abbreviated",
|
|
1066
|
+
context: "formatting"
|
|
1067
|
+
});
|
|
1068
|
+
// T
|
|
1069
|
+
case "iiiii":
|
|
1070
|
+
return n.day(r, {
|
|
1071
|
+
width: "narrow",
|
|
1072
|
+
context: "formatting"
|
|
1073
|
+
});
|
|
1074
|
+
// Tu
|
|
1075
|
+
case "iiiiii":
|
|
1076
|
+
return n.day(r, {
|
|
1077
|
+
width: "short",
|
|
1078
|
+
context: "formatting"
|
|
1079
|
+
});
|
|
1080
|
+
default:
|
|
1081
|
+
return n.day(r, {
|
|
1082
|
+
width: "wide",
|
|
1083
|
+
context: "formatting"
|
|
1084
|
+
});
|
|
1085
|
+
}
|
|
1086
|
+
},
|
|
1087
|
+
// AM or PM
|
|
1088
|
+
a: function(t, e, n) {
|
|
1089
|
+
const s = t.getHours() / 12 >= 1 ? "pm" : "am";
|
|
1090
|
+
switch (e) {
|
|
1091
|
+
case "a":
|
|
1092
|
+
case "aa":
|
|
1093
|
+
return n.dayPeriod(s, {
|
|
1094
|
+
width: "abbreviated",
|
|
1095
|
+
context: "formatting"
|
|
1096
|
+
});
|
|
1097
|
+
case "aaa":
|
|
1098
|
+
return n.dayPeriod(s, {
|
|
1099
|
+
width: "abbreviated",
|
|
1100
|
+
context: "formatting"
|
|
1101
|
+
}).toLowerCase();
|
|
1102
|
+
case "aaaaa":
|
|
1103
|
+
return n.dayPeriod(s, {
|
|
1104
|
+
width: "narrow",
|
|
1105
|
+
context: "formatting"
|
|
1106
|
+
});
|
|
1107
|
+
default:
|
|
1108
|
+
return n.dayPeriod(s, {
|
|
1109
|
+
width: "wide",
|
|
1110
|
+
context: "formatting"
|
|
1111
|
+
});
|
|
1112
|
+
}
|
|
1113
|
+
},
|
|
1114
|
+
// AM, PM, midnight, noon
|
|
1115
|
+
b: function(t, e, n) {
|
|
1116
|
+
const r = t.getHours();
|
|
1117
|
+
let s;
|
|
1118
|
+
switch (r === 12 ? s = C.noon : r === 0 ? s = C.midnight : s = r / 12 >= 1 ? "pm" : "am", e) {
|
|
1119
|
+
case "b":
|
|
1120
|
+
case "bb":
|
|
1121
|
+
return n.dayPeriod(s, {
|
|
1122
|
+
width: "abbreviated",
|
|
1123
|
+
context: "formatting"
|
|
1124
|
+
});
|
|
1125
|
+
case "bbb":
|
|
1126
|
+
return n.dayPeriod(s, {
|
|
1127
|
+
width: "abbreviated",
|
|
1128
|
+
context: "formatting"
|
|
1129
|
+
}).toLowerCase();
|
|
1130
|
+
case "bbbbb":
|
|
1131
|
+
return n.dayPeriod(s, {
|
|
1132
|
+
width: "narrow",
|
|
1133
|
+
context: "formatting"
|
|
1134
|
+
});
|
|
1135
|
+
default:
|
|
1136
|
+
return n.dayPeriod(s, {
|
|
1137
|
+
width: "wide",
|
|
1138
|
+
context: "formatting"
|
|
1139
|
+
});
|
|
1140
|
+
}
|
|
1141
|
+
},
|
|
1142
|
+
// in the morning, in the afternoon, in the evening, at night
|
|
1143
|
+
B: function(t, e, n) {
|
|
1144
|
+
const r = t.getHours();
|
|
1145
|
+
let s;
|
|
1146
|
+
switch (r >= 17 ? s = C.evening : r >= 12 ? s = C.afternoon : r >= 4 ? s = C.morning : s = C.night, e) {
|
|
1147
|
+
case "B":
|
|
1148
|
+
case "BB":
|
|
1149
|
+
case "BBB":
|
|
1150
|
+
return n.dayPeriod(s, {
|
|
1151
|
+
width: "abbreviated",
|
|
1152
|
+
context: "formatting"
|
|
1153
|
+
});
|
|
1154
|
+
case "BBBBB":
|
|
1155
|
+
return n.dayPeriod(s, {
|
|
1156
|
+
width: "narrow",
|
|
1157
|
+
context: "formatting"
|
|
1158
|
+
});
|
|
1159
|
+
default:
|
|
1160
|
+
return n.dayPeriod(s, {
|
|
1161
|
+
width: "wide",
|
|
1162
|
+
context: "formatting"
|
|
1163
|
+
});
|
|
1164
|
+
}
|
|
1165
|
+
},
|
|
1166
|
+
// Hour [1-12]
|
|
1167
|
+
h: function(t, e, n) {
|
|
1168
|
+
if (e === "ho") {
|
|
1169
|
+
let r = t.getHours() % 12;
|
|
1170
|
+
return r === 0 && (r = 12), n.ordinalNumber(r, { unit: "hour" });
|
|
1171
|
+
}
|
|
1172
|
+
return N.h(t, e);
|
|
1173
|
+
},
|
|
1174
|
+
// Hour [0-23]
|
|
1175
|
+
H: function(t, e, n) {
|
|
1176
|
+
return e === "Ho" ? n.ordinalNumber(t.getHours(), { unit: "hour" }) : N.H(t, e);
|
|
1177
|
+
},
|
|
1178
|
+
// Hour [0-11]
|
|
1179
|
+
K: function(t, e, n) {
|
|
1180
|
+
const r = t.getHours() % 12;
|
|
1181
|
+
return e === "Ko" ? n.ordinalNumber(r, { unit: "hour" }) : h(r, e.length);
|
|
1182
|
+
},
|
|
1183
|
+
// Hour [1-24]
|
|
1184
|
+
k: function(t, e, n) {
|
|
1185
|
+
let r = t.getHours();
|
|
1186
|
+
return r === 0 && (r = 24), e === "ko" ? n.ordinalNumber(r, { unit: "hour" }) : h(r, e.length);
|
|
1187
|
+
},
|
|
1188
|
+
// Minute
|
|
1189
|
+
m: function(t, e, n) {
|
|
1190
|
+
return e === "mo" ? n.ordinalNumber(t.getMinutes(), { unit: "minute" }) : N.m(t, e);
|
|
1191
|
+
},
|
|
1192
|
+
// Second
|
|
1193
|
+
s: function(t, e, n) {
|
|
1194
|
+
return e === "so" ? n.ordinalNumber(t.getSeconds(), { unit: "second" }) : N.s(t, e);
|
|
1195
|
+
},
|
|
1196
|
+
// Fraction of second
|
|
1197
|
+
S: function(t, e) {
|
|
1198
|
+
return N.S(t, e);
|
|
1199
|
+
},
|
|
1200
|
+
// Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
|
|
1201
|
+
X: function(t, e, n) {
|
|
1202
|
+
const r = t.getTimezoneOffset();
|
|
1203
|
+
if (r === 0)
|
|
1204
|
+
return "Z";
|
|
1205
|
+
switch (e) {
|
|
1206
|
+
// Hours and optional minutes
|
|
1207
|
+
case "X":
|
|
1208
|
+
return We(r);
|
|
1209
|
+
// Hours, minutes and optional seconds without `:` delimiter
|
|
1210
|
+
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
|
|
1211
|
+
// so this token always has the same output as `XX`
|
|
1212
|
+
case "XXXX":
|
|
1213
|
+
case "XX":
|
|
1214
|
+
return I(r);
|
|
1215
|
+
// Hours and minutes with `:` delimiter
|
|
1216
|
+
default:
|
|
1217
|
+
return I(r, ":");
|
|
1218
|
+
}
|
|
1219
|
+
},
|
|
1220
|
+
// Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
|
|
1221
|
+
x: function(t, e, n) {
|
|
1222
|
+
const r = t.getTimezoneOffset();
|
|
1223
|
+
switch (e) {
|
|
1224
|
+
// Hours and optional minutes
|
|
1225
|
+
case "x":
|
|
1226
|
+
return We(r);
|
|
1227
|
+
// Hours, minutes and optional seconds without `:` delimiter
|
|
1228
|
+
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
|
|
1229
|
+
// so this token always has the same output as `xx`
|
|
1230
|
+
case "xxxx":
|
|
1231
|
+
case "xx":
|
|
1232
|
+
return I(r);
|
|
1233
|
+
// Hours and minutes with `:` delimiter
|
|
1234
|
+
default:
|
|
1235
|
+
return I(r, ":");
|
|
1236
|
+
}
|
|
1237
|
+
},
|
|
1238
|
+
// Timezone (GMT)
|
|
1239
|
+
O: function(t, e, n) {
|
|
1240
|
+
const r = t.getTimezoneOffset();
|
|
1241
|
+
switch (e) {
|
|
1242
|
+
// Short
|
|
1243
|
+
case "O":
|
|
1244
|
+
case "OO":
|
|
1245
|
+
case "OOO":
|
|
1246
|
+
return "GMT" + Se(r, ":");
|
|
1247
|
+
default:
|
|
1248
|
+
return "GMT" + I(r, ":");
|
|
1249
|
+
}
|
|
1250
|
+
},
|
|
1251
|
+
// Timezone (specific non-location)
|
|
1252
|
+
z: function(t, e, n) {
|
|
1253
|
+
const r = t.getTimezoneOffset();
|
|
1254
|
+
switch (e) {
|
|
1255
|
+
// Short
|
|
1256
|
+
case "z":
|
|
1257
|
+
case "zz":
|
|
1258
|
+
case "zzz":
|
|
1259
|
+
return "GMT" + Se(r, ":");
|
|
1260
|
+
default:
|
|
1261
|
+
return "GMT" + I(r, ":");
|
|
1262
|
+
}
|
|
1263
|
+
},
|
|
1264
|
+
// Seconds timestamp
|
|
1265
|
+
t: function(t, e, n) {
|
|
1266
|
+
const r = Math.trunc(+t / 1e3);
|
|
1267
|
+
return h(r, e.length);
|
|
1268
|
+
},
|
|
1269
|
+
// Milliseconds timestamp
|
|
1270
|
+
T: function(t, e, n) {
|
|
1271
|
+
return h(+t, e.length);
|
|
1272
|
+
}
|
|
1273
|
+
};
|
|
1274
|
+
function Se(t, e = "") {
|
|
1275
|
+
const n = t > 0 ? "-" : "+", r = Math.abs(t), s = Math.trunc(r / 60), a = r % 60;
|
|
1276
|
+
return a === 0 ? n + String(s) : n + String(s) + e + h(a, 2);
|
|
1277
|
+
}
|
|
1278
|
+
function We(t, e) {
|
|
1279
|
+
return t % 60 === 0 ? (t > 0 ? "-" : "+") + h(Math.abs(t) / 60, 2) : I(t, e);
|
|
1280
|
+
}
|
|
1281
|
+
function I(t, e = "") {
|
|
1282
|
+
const n = t > 0 ? "-" : "+", r = Math.abs(t), s = h(Math.trunc(r / 60), 2), a = h(r % 60, 2);
|
|
1283
|
+
return n + s + e + a;
|
|
1284
|
+
}
|
|
1285
|
+
const $e = (t, e) => {
|
|
1286
|
+
switch (t) {
|
|
1287
|
+
case "P":
|
|
1288
|
+
return e.date({ width: "short" });
|
|
1289
|
+
case "PP":
|
|
1290
|
+
return e.date({ width: "medium" });
|
|
1291
|
+
case "PPP":
|
|
1292
|
+
return e.date({ width: "long" });
|
|
1293
|
+
default:
|
|
1294
|
+
return e.date({ width: "full" });
|
|
1295
|
+
}
|
|
1296
|
+
}, ct = (t, e) => {
|
|
1297
|
+
switch (t) {
|
|
1298
|
+
case "p":
|
|
1299
|
+
return e.time({ width: "short" });
|
|
1300
|
+
case "pp":
|
|
1301
|
+
return e.time({ width: "medium" });
|
|
1302
|
+
case "ppp":
|
|
1303
|
+
return e.time({ width: "long" });
|
|
1304
|
+
default:
|
|
1305
|
+
return e.time({ width: "full" });
|
|
1306
|
+
}
|
|
1307
|
+
}, Yn = (t, e) => {
|
|
1308
|
+
const n = t.match(/(P+)(p+)?/) || [], r = n[1], s = n[2];
|
|
1309
|
+
if (!s)
|
|
1310
|
+
return $e(t, e);
|
|
1311
|
+
let a;
|
|
1312
|
+
switch (r) {
|
|
1313
|
+
case "P":
|
|
1314
|
+
a = e.dateTime({ width: "short" });
|
|
1315
|
+
break;
|
|
1316
|
+
case "PP":
|
|
1317
|
+
a = e.dateTime({ width: "medium" });
|
|
1318
|
+
break;
|
|
1319
|
+
case "PPP":
|
|
1320
|
+
a = e.dateTime({ width: "long" });
|
|
1321
|
+
break;
|
|
1322
|
+
default:
|
|
1323
|
+
a = e.dateTime({ width: "full" });
|
|
1324
|
+
break;
|
|
1325
|
+
}
|
|
1326
|
+
return a.replace("{{date}}", $e(r, e)).replace("{{time}}", ct(s, e));
|
|
1327
|
+
}, se = {
|
|
1328
|
+
p: ct,
|
|
1329
|
+
P: Yn
|
|
1330
|
+
}, Cn = /^D+$/, Ln = /^Y+$/, Sn = ["D", "DD", "YY", "YYYY"];
|
|
1331
|
+
function ut(t) {
|
|
1332
|
+
return Cn.test(t);
|
|
1333
|
+
}
|
|
1334
|
+
function dt(t) {
|
|
1335
|
+
return Ln.test(t);
|
|
1336
|
+
}
|
|
1337
|
+
function ae(t, e, n) {
|
|
1338
|
+
const r = Wn(t, e, n);
|
|
1339
|
+
if (console.warn(r), Sn.includes(t)) throw new RangeError(r);
|
|
1340
|
+
}
|
|
1341
|
+
function Wn(t, e, n) {
|
|
1342
|
+
const r = t[0] === "Y" ? "years" : "days of the month";
|
|
1343
|
+
return `Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${e}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`;
|
|
1344
|
+
}
|
|
1345
|
+
const $n = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, qn = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, Qn = /^'([^]*?)'?$/, Fn = /''/g, Hn = /[a-zA-Z]/;
|
|
1346
|
+
function Un(t, e, n) {
|
|
1347
|
+
const r = S(), s = r.locale ?? at, a = r.firstWeekContainsDate ?? r.locale?.options?.firstWeekContainsDate ?? 1, o = r.weekStartsOn ?? r.locale?.options?.weekStartsOn ?? 0, i = y(t, n?.in);
|
|
1348
|
+
if (!re(i))
|
|
1349
|
+
throw new RangeError("Invalid time value");
|
|
1350
|
+
let c = e.match(qn).map((d) => {
|
|
1351
|
+
const l = d[0];
|
|
1352
|
+
if (l === "p" || l === "P") {
|
|
1353
|
+
const g = se[l];
|
|
1354
|
+
return g(d, s.formatLong);
|
|
1355
|
+
}
|
|
1356
|
+
return d;
|
|
1357
|
+
}).join("").match($n).map((d) => {
|
|
1358
|
+
if (d === "''")
|
|
1359
|
+
return { isToken: !1, value: "'" };
|
|
1360
|
+
const l = d[0];
|
|
1361
|
+
if (l === "'")
|
|
1362
|
+
return { isToken: !1, value: Bn(d) };
|
|
1363
|
+
if (Le[l])
|
|
1364
|
+
return { isToken: !0, value: d };
|
|
1365
|
+
if (l.match(Hn))
|
|
1366
|
+
throw new RangeError(
|
|
1367
|
+
"Format string contains an unescaped latin alphabet character `" + l + "`"
|
|
1368
|
+
);
|
|
1369
|
+
return { isToken: !1, value: d };
|
|
1370
|
+
});
|
|
1371
|
+
s.localize.preprocessor && (c = s.localize.preprocessor(i, c));
|
|
1372
|
+
const u = {
|
|
1373
|
+
firstWeekContainsDate: a,
|
|
1374
|
+
weekStartsOn: o,
|
|
1375
|
+
locale: s
|
|
1376
|
+
};
|
|
1377
|
+
return c.map((d) => {
|
|
1378
|
+
if (!d.isToken) return d.value;
|
|
1379
|
+
const l = d.value;
|
|
1380
|
+
(dt(l) || ut(l)) && ae(l, e, String(t));
|
|
1381
|
+
const g = Le[l[0]];
|
|
1382
|
+
return g(i, l, s.localize, u);
|
|
1383
|
+
}).join("");
|
|
1384
|
+
}
|
|
1385
|
+
function Bn(t) {
|
|
1386
|
+
const e = t.match(Qn);
|
|
1387
|
+
return e ? e[1].replace(Fn, "'") : t;
|
|
1388
|
+
}
|
|
1389
|
+
function Gn() {
|
|
1390
|
+
return Object.assign({}, S());
|
|
1391
|
+
}
|
|
1392
|
+
function Vn(t, e) {
|
|
1393
|
+
const n = y(t, e?.in).getDay();
|
|
1394
|
+
return n === 0 ? 7 : n;
|
|
1395
|
+
}
|
|
1396
|
+
function Xn(t, e) {
|
|
1397
|
+
const n = jn(e) ? new e(0) : E(e, 0);
|
|
1398
|
+
return n.setFullYear(t.getFullYear(), t.getMonth(), t.getDate()), n.setHours(
|
|
1399
|
+
t.getHours(),
|
|
1400
|
+
t.getMinutes(),
|
|
1401
|
+
t.getSeconds(),
|
|
1402
|
+
t.getMilliseconds()
|
|
1403
|
+
), n;
|
|
1404
|
+
}
|
|
1405
|
+
function jn(t) {
|
|
1406
|
+
return typeof t == "function" && t.prototype?.constructor === t;
|
|
1407
|
+
}
|
|
1408
|
+
const Kn = 10;
|
|
1409
|
+
class lt {
|
|
1410
|
+
subPriority = 0;
|
|
1411
|
+
validate(e, n) {
|
|
1412
|
+
return !0;
|
|
1413
|
+
}
|
|
1414
|
+
}
|
|
1415
|
+
class zn extends lt {
|
|
1416
|
+
constructor(e, n, r, s, a) {
|
|
1417
|
+
super(), this.value = e, this.validateValue = n, this.setValue = r, this.priority = s, a && (this.subPriority = a);
|
|
1418
|
+
}
|
|
1419
|
+
validate(e, n) {
|
|
1420
|
+
return this.validateValue(e, this.value, n);
|
|
1421
|
+
}
|
|
1422
|
+
set(e, n, r) {
|
|
1423
|
+
return this.setValue(e, n, this.value, r);
|
|
1424
|
+
}
|
|
1425
|
+
}
|
|
1426
|
+
class Jn extends lt {
|
|
1427
|
+
priority = Kn;
|
|
1428
|
+
subPriority = -1;
|
|
1429
|
+
constructor(e, n) {
|
|
1430
|
+
super(), this.context = e || ((r) => E(n, r));
|
|
1431
|
+
}
|
|
1432
|
+
set(e, n) {
|
|
1433
|
+
return n.timestampIsSet ? e : E(e, Xn(e, this.context));
|
|
1434
|
+
}
|
|
1435
|
+
}
|
|
1436
|
+
class m {
|
|
1437
|
+
run(e, n, r, s) {
|
|
1438
|
+
const a = this.parse(e, n, r, s);
|
|
1439
|
+
return a ? {
|
|
1440
|
+
setter: new zn(
|
|
1441
|
+
a.value,
|
|
1442
|
+
this.validate,
|
|
1443
|
+
this.set,
|
|
1444
|
+
this.priority,
|
|
1445
|
+
this.subPriority
|
|
1446
|
+
),
|
|
1447
|
+
rest: a.rest
|
|
1448
|
+
} : null;
|
|
1449
|
+
}
|
|
1450
|
+
validate(e, n, r) {
|
|
1451
|
+
return !0;
|
|
1452
|
+
}
|
|
1453
|
+
}
|
|
1454
|
+
class Zn extends m {
|
|
1455
|
+
priority = 140;
|
|
1456
|
+
parse(e, n, r) {
|
|
1457
|
+
switch (n) {
|
|
1458
|
+
// AD, BC
|
|
1459
|
+
case "G":
|
|
1460
|
+
case "GG":
|
|
1461
|
+
case "GGG":
|
|
1462
|
+
return r.era(e, { width: "abbreviated" }) || r.era(e, { width: "narrow" });
|
|
1463
|
+
// A, B
|
|
1464
|
+
case "GGGGG":
|
|
1465
|
+
return r.era(e, { width: "narrow" });
|
|
1466
|
+
default:
|
|
1467
|
+
return r.era(e, { width: "wide" }) || r.era(e, { width: "abbreviated" }) || r.era(e, { width: "narrow" });
|
|
1468
|
+
}
|
|
1469
|
+
}
|
|
1470
|
+
set(e, n, r) {
|
|
1471
|
+
return n.era = r, e.setFullYear(r, 0, 1), e.setHours(0, 0, 0, 0), e;
|
|
1472
|
+
}
|
|
1473
|
+
incompatibleTokens = ["R", "u", "t", "T"];
|
|
1474
|
+
}
|
|
1475
|
+
const D = {
|
|
1476
|
+
month: /^(1[0-2]|0?\d)/,
|
|
1477
|
+
// 0 to 12
|
|
1478
|
+
date: /^(3[0-1]|[0-2]?\d)/,
|
|
1479
|
+
// 0 to 31
|
|
1480
|
+
dayOfYear: /^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,
|
|
1481
|
+
// 0 to 366
|
|
1482
|
+
week: /^(5[0-3]|[0-4]?\d)/,
|
|
1483
|
+
// 0 to 53
|
|
1484
|
+
hour23h: /^(2[0-3]|[0-1]?\d)/,
|
|
1485
|
+
// 0 to 23
|
|
1486
|
+
hour24h: /^(2[0-4]|[0-1]?\d)/,
|
|
1487
|
+
// 0 to 24
|
|
1488
|
+
hour11h: /^(1[0-1]|0?\d)/,
|
|
1489
|
+
// 0 to 11
|
|
1490
|
+
hour12h: /^(1[0-2]|0?\d)/,
|
|
1491
|
+
// 0 to 12
|
|
1492
|
+
minute: /^[0-5]?\d/,
|
|
1493
|
+
// 0 to 59
|
|
1494
|
+
second: /^[0-5]?\d/,
|
|
1495
|
+
// 0 to 59
|
|
1496
|
+
singleDigit: /^\d/,
|
|
1497
|
+
// 0 to 9
|
|
1498
|
+
twoDigits: /^\d{1,2}/,
|
|
1499
|
+
// 0 to 99
|
|
1500
|
+
threeDigits: /^\d{1,3}/,
|
|
1501
|
+
// 0 to 999
|
|
1502
|
+
fourDigits: /^\d{1,4}/,
|
|
1503
|
+
// 0 to 9999
|
|
1504
|
+
anyDigitsSigned: /^-?\d+/,
|
|
1505
|
+
singleDigitSigned: /^-?\d/,
|
|
1506
|
+
// 0 to 9, -0 to -9
|
|
1507
|
+
twoDigitsSigned: /^-?\d{1,2}/,
|
|
1508
|
+
// 0 to 99, -0 to -99
|
|
1509
|
+
threeDigitsSigned: /^-?\d{1,3}/,
|
|
1510
|
+
// 0 to 999, -0 to -999
|
|
1511
|
+
fourDigitsSigned: /^-?\d{1,4}/
|
|
1512
|
+
// 0 to 9999, -0 to -9999
|
|
1513
|
+
}, O = {
|
|
1514
|
+
basicOptionalMinutes: /^([+-])(\d{2})(\d{2})?|Z/,
|
|
1515
|
+
basic: /^([+-])(\d{2})(\d{2})|Z/,
|
|
1516
|
+
basicOptionalSeconds: /^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,
|
|
1517
|
+
extended: /^([+-])(\d{2}):(\d{2})|Z/,
|
|
1518
|
+
extendedOptionalSeconds: /^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/
|
|
1519
|
+
};
|
|
1520
|
+
function T(t, e) {
|
|
1521
|
+
return t && {
|
|
1522
|
+
value: e(t.value),
|
|
1523
|
+
rest: t.rest
|
|
1524
|
+
};
|
|
1525
|
+
}
|
|
1526
|
+
function p(t, e) {
|
|
1527
|
+
const n = e.match(t);
|
|
1528
|
+
return n ? {
|
|
1529
|
+
value: parseInt(n[0], 10),
|
|
1530
|
+
rest: e.slice(n[0].length)
|
|
1531
|
+
} : null;
|
|
1532
|
+
}
|
|
1533
|
+
function A(t, e) {
|
|
1534
|
+
const n = e.match(t);
|
|
1535
|
+
if (!n)
|
|
1536
|
+
return null;
|
|
1537
|
+
if (n[0] === "Z")
|
|
1538
|
+
return {
|
|
1539
|
+
value: 0,
|
|
1540
|
+
rest: e.slice(1)
|
|
1541
|
+
};
|
|
1542
|
+
const r = n[1] === "+" ? 1 : -1, s = n[2] ? parseInt(n[2], 10) : 0, a = n[3] ? parseInt(n[3], 10) : 0, o = n[5] ? parseInt(n[5], 10) : 0;
|
|
1543
|
+
return {
|
|
1544
|
+
value: r * (s * le + a * de + o * Gt),
|
|
1545
|
+
rest: e.slice(n[0].length)
|
|
1546
|
+
};
|
|
1547
|
+
}
|
|
1548
|
+
function ft(t) {
|
|
1549
|
+
return p(D.anyDigitsSigned, t);
|
|
1550
|
+
}
|
|
1551
|
+
function b(t, e) {
|
|
1552
|
+
switch (t) {
|
|
1553
|
+
case 1:
|
|
1554
|
+
return p(D.singleDigit, e);
|
|
1555
|
+
case 2:
|
|
1556
|
+
return p(D.twoDigits, e);
|
|
1557
|
+
case 3:
|
|
1558
|
+
return p(D.threeDigits, e);
|
|
1559
|
+
case 4:
|
|
1560
|
+
return p(D.fourDigits, e);
|
|
1561
|
+
default:
|
|
1562
|
+
return p(new RegExp("^\\d{1," + t + "}"), e);
|
|
1563
|
+
}
|
|
1564
|
+
}
|
|
1565
|
+
function J(t, e) {
|
|
1566
|
+
switch (t) {
|
|
1567
|
+
case 1:
|
|
1568
|
+
return p(D.singleDigitSigned, e);
|
|
1569
|
+
case 2:
|
|
1570
|
+
return p(D.twoDigitsSigned, e);
|
|
1571
|
+
case 3:
|
|
1572
|
+
return p(D.threeDigitsSigned, e);
|
|
1573
|
+
case 4:
|
|
1574
|
+
return p(D.fourDigitsSigned, e);
|
|
1575
|
+
default:
|
|
1576
|
+
return p(new RegExp("^-?\\d{1," + t + "}"), e);
|
|
1577
|
+
}
|
|
1578
|
+
}
|
|
1579
|
+
function me(t) {
|
|
1580
|
+
switch (t) {
|
|
1581
|
+
case "morning":
|
|
1582
|
+
return 4;
|
|
1583
|
+
case "evening":
|
|
1584
|
+
return 17;
|
|
1585
|
+
case "pm":
|
|
1586
|
+
case "noon":
|
|
1587
|
+
case "afternoon":
|
|
1588
|
+
return 12;
|
|
1589
|
+
default:
|
|
1590
|
+
return 0;
|
|
1591
|
+
}
|
|
1592
|
+
}
|
|
1593
|
+
function mt(t, e) {
|
|
1594
|
+
const n = e > 0, r = n ? e : 1 - e;
|
|
1595
|
+
let s;
|
|
1596
|
+
if (r <= 50)
|
|
1597
|
+
s = t || 100;
|
|
1598
|
+
else {
|
|
1599
|
+
const a = r + 50, o = Math.trunc(a / 100) * 100, i = t >= a % 100;
|
|
1600
|
+
s = t + o - (i ? 100 : 0);
|
|
1601
|
+
}
|
|
1602
|
+
return n ? s : 1 - s;
|
|
1603
|
+
}
|
|
1604
|
+
function ht(t) {
|
|
1605
|
+
return t % 400 === 0 || t % 4 === 0 && t % 100 !== 0;
|
|
1606
|
+
}
|
|
1607
|
+
class er extends m {
|
|
1608
|
+
priority = 130;
|
|
1609
|
+
incompatibleTokens = ["Y", "R", "u", "w", "I", "i", "e", "c", "t", "T"];
|
|
1610
|
+
parse(e, n, r) {
|
|
1611
|
+
const s = (a) => ({
|
|
1612
|
+
year: a,
|
|
1613
|
+
isTwoDigitYear: n === "yy"
|
|
1614
|
+
});
|
|
1615
|
+
switch (n) {
|
|
1616
|
+
case "y":
|
|
1617
|
+
return T(b(4, e), s);
|
|
1618
|
+
case "yo":
|
|
1619
|
+
return T(
|
|
1620
|
+
r.ordinalNumber(e, {
|
|
1621
|
+
unit: "year"
|
|
1622
|
+
}),
|
|
1623
|
+
s
|
|
1624
|
+
);
|
|
1625
|
+
default:
|
|
1626
|
+
return T(b(n.length, e), s);
|
|
1627
|
+
}
|
|
1628
|
+
}
|
|
1629
|
+
validate(e, n) {
|
|
1630
|
+
return n.isTwoDigitYear || n.year > 0;
|
|
1631
|
+
}
|
|
1632
|
+
set(e, n, r) {
|
|
1633
|
+
const s = e.getFullYear();
|
|
1634
|
+
if (r.isTwoDigitYear) {
|
|
1635
|
+
const o = mt(
|
|
1636
|
+
r.year,
|
|
1637
|
+
s
|
|
1638
|
+
);
|
|
1639
|
+
return e.setFullYear(o, 0, 1), e.setHours(0, 0, 0, 0), e;
|
|
1640
|
+
}
|
|
1641
|
+
const a = !("era" in n) || n.era === 1 ? r.year : 1 - r.year;
|
|
1642
|
+
return e.setFullYear(a, 0, 1), e.setHours(0, 0, 0, 0), e;
|
|
1643
|
+
}
|
|
1644
|
+
}
|
|
1645
|
+
class tr extends m {
|
|
1646
|
+
priority = 130;
|
|
1647
|
+
parse(e, n, r) {
|
|
1648
|
+
const s = (a) => ({
|
|
1649
|
+
year: a,
|
|
1650
|
+
isTwoDigitYear: n === "YY"
|
|
1651
|
+
});
|
|
1652
|
+
switch (n) {
|
|
1653
|
+
case "Y":
|
|
1654
|
+
return T(b(4, e), s);
|
|
1655
|
+
case "Yo":
|
|
1656
|
+
return T(
|
|
1657
|
+
r.ordinalNumber(e, {
|
|
1658
|
+
unit: "year"
|
|
1659
|
+
}),
|
|
1660
|
+
s
|
|
1661
|
+
);
|
|
1662
|
+
default:
|
|
1663
|
+
return T(b(n.length, e), s);
|
|
1664
|
+
}
|
|
1665
|
+
}
|
|
1666
|
+
validate(e, n) {
|
|
1667
|
+
return n.isTwoDigitYear || n.year > 0;
|
|
1668
|
+
}
|
|
1669
|
+
set(e, n, r, s) {
|
|
1670
|
+
const a = fe(e, s);
|
|
1671
|
+
if (r.isTwoDigitYear) {
|
|
1672
|
+
const i = mt(
|
|
1673
|
+
r.year,
|
|
1674
|
+
a
|
|
1675
|
+
);
|
|
1676
|
+
return e.setFullYear(
|
|
1677
|
+
i,
|
|
1678
|
+
0,
|
|
1679
|
+
s.firstWeekContainsDate
|
|
1680
|
+
), e.setHours(0, 0, 0, 0), _(e, s);
|
|
1681
|
+
}
|
|
1682
|
+
const o = !("era" in n) || n.era === 1 ? r.year : 1 - r.year;
|
|
1683
|
+
return e.setFullYear(o, 0, s.firstWeekContainsDate), e.setHours(0, 0, 0, 0), _(e, s);
|
|
1684
|
+
}
|
|
1685
|
+
incompatibleTokens = [
|
|
1686
|
+
"y",
|
|
1687
|
+
"R",
|
|
1688
|
+
"u",
|
|
1689
|
+
"Q",
|
|
1690
|
+
"q",
|
|
1691
|
+
"M",
|
|
1692
|
+
"L",
|
|
1693
|
+
"I",
|
|
1694
|
+
"d",
|
|
1695
|
+
"D",
|
|
1696
|
+
"i",
|
|
1697
|
+
"t",
|
|
1698
|
+
"T"
|
|
1699
|
+
];
|
|
1700
|
+
}
|
|
1701
|
+
class nr extends m {
|
|
1702
|
+
priority = 130;
|
|
1703
|
+
parse(e, n) {
|
|
1704
|
+
return J(n === "R" ? 4 : n.length, e);
|
|
1705
|
+
}
|
|
1706
|
+
set(e, n, r) {
|
|
1707
|
+
const s = E(e, 0);
|
|
1708
|
+
return s.setFullYear(r, 0, 4), s.setHours(0, 0, 0, 0), L(s);
|
|
1709
|
+
}
|
|
1710
|
+
incompatibleTokens = [
|
|
1711
|
+
"G",
|
|
1712
|
+
"y",
|
|
1713
|
+
"Y",
|
|
1714
|
+
"u",
|
|
1715
|
+
"Q",
|
|
1716
|
+
"q",
|
|
1717
|
+
"M",
|
|
1718
|
+
"L",
|
|
1719
|
+
"w",
|
|
1720
|
+
"d",
|
|
1721
|
+
"D",
|
|
1722
|
+
"e",
|
|
1723
|
+
"c",
|
|
1724
|
+
"t",
|
|
1725
|
+
"T"
|
|
1726
|
+
];
|
|
1727
|
+
}
|
|
1728
|
+
class rr extends m {
|
|
1729
|
+
priority = 130;
|
|
1730
|
+
parse(e, n) {
|
|
1731
|
+
return J(n === "u" ? 4 : n.length, e);
|
|
1732
|
+
}
|
|
1733
|
+
set(e, n, r) {
|
|
1734
|
+
return e.setFullYear(r, 0, 1), e.setHours(0, 0, 0, 0), e;
|
|
1735
|
+
}
|
|
1736
|
+
incompatibleTokens = ["G", "y", "Y", "R", "w", "I", "i", "e", "c", "t", "T"];
|
|
1737
|
+
}
|
|
1738
|
+
class sr extends m {
|
|
1739
|
+
priority = 120;
|
|
1740
|
+
parse(e, n, r) {
|
|
1741
|
+
switch (n) {
|
|
1742
|
+
// 1, 2, 3, 4
|
|
1743
|
+
case "Q":
|
|
1744
|
+
case "QQ":
|
|
1745
|
+
return b(n.length, e);
|
|
1746
|
+
// 1st, 2nd, 3rd, 4th
|
|
1747
|
+
case "Qo":
|
|
1748
|
+
return r.ordinalNumber(e, { unit: "quarter" });
|
|
1749
|
+
// Q1, Q2, Q3, Q4
|
|
1750
|
+
case "QQQ":
|
|
1751
|
+
return r.quarter(e, {
|
|
1752
|
+
width: "abbreviated",
|
|
1753
|
+
context: "formatting"
|
|
1754
|
+
}) || r.quarter(e, {
|
|
1755
|
+
width: "narrow",
|
|
1756
|
+
context: "formatting"
|
|
1757
|
+
});
|
|
1758
|
+
// 1, 2, 3, 4 (narrow quarter; could be not numerical)
|
|
1759
|
+
case "QQQQQ":
|
|
1760
|
+
return r.quarter(e, {
|
|
1761
|
+
width: "narrow",
|
|
1762
|
+
context: "formatting"
|
|
1763
|
+
});
|
|
1764
|
+
default:
|
|
1765
|
+
return r.quarter(e, {
|
|
1766
|
+
width: "wide",
|
|
1767
|
+
context: "formatting"
|
|
1768
|
+
}) || r.quarter(e, {
|
|
1769
|
+
width: "abbreviated",
|
|
1770
|
+
context: "formatting"
|
|
1771
|
+
}) || r.quarter(e, {
|
|
1772
|
+
width: "narrow",
|
|
1773
|
+
context: "formatting"
|
|
1774
|
+
});
|
|
1775
|
+
}
|
|
1776
|
+
}
|
|
1777
|
+
validate(e, n) {
|
|
1778
|
+
return n >= 1 && n <= 4;
|
|
1779
|
+
}
|
|
1780
|
+
set(e, n, r) {
|
|
1781
|
+
return e.setMonth((r - 1) * 3, 1), e.setHours(0, 0, 0, 0), e;
|
|
1782
|
+
}
|
|
1783
|
+
incompatibleTokens = [
|
|
1784
|
+
"Y",
|
|
1785
|
+
"R",
|
|
1786
|
+
"q",
|
|
1787
|
+
"M",
|
|
1788
|
+
"L",
|
|
1789
|
+
"w",
|
|
1790
|
+
"I",
|
|
1791
|
+
"d",
|
|
1792
|
+
"D",
|
|
1793
|
+
"i",
|
|
1794
|
+
"e",
|
|
1795
|
+
"c",
|
|
1796
|
+
"t",
|
|
1797
|
+
"T"
|
|
1798
|
+
];
|
|
1799
|
+
}
|
|
1800
|
+
class ar extends m {
|
|
1801
|
+
priority = 120;
|
|
1802
|
+
parse(e, n, r) {
|
|
1803
|
+
switch (n) {
|
|
1804
|
+
// 1, 2, 3, 4
|
|
1805
|
+
case "q":
|
|
1806
|
+
case "qq":
|
|
1807
|
+
return b(n.length, e);
|
|
1808
|
+
// 1st, 2nd, 3rd, 4th
|
|
1809
|
+
case "qo":
|
|
1810
|
+
return r.ordinalNumber(e, { unit: "quarter" });
|
|
1811
|
+
// Q1, Q2, Q3, Q4
|
|
1812
|
+
case "qqq":
|
|
1813
|
+
return r.quarter(e, {
|
|
1814
|
+
width: "abbreviated",
|
|
1815
|
+
context: "standalone"
|
|
1816
|
+
}) || r.quarter(e, {
|
|
1817
|
+
width: "narrow",
|
|
1818
|
+
context: "standalone"
|
|
1819
|
+
});
|
|
1820
|
+
// 1, 2, 3, 4 (narrow quarter; could be not numerical)
|
|
1821
|
+
case "qqqqq":
|
|
1822
|
+
return r.quarter(e, {
|
|
1823
|
+
width: "narrow",
|
|
1824
|
+
context: "standalone"
|
|
1825
|
+
});
|
|
1826
|
+
default:
|
|
1827
|
+
return r.quarter(e, {
|
|
1828
|
+
width: "wide",
|
|
1829
|
+
context: "standalone"
|
|
1830
|
+
}) || r.quarter(e, {
|
|
1831
|
+
width: "abbreviated",
|
|
1832
|
+
context: "standalone"
|
|
1833
|
+
}) || r.quarter(e, {
|
|
1834
|
+
width: "narrow",
|
|
1835
|
+
context: "standalone"
|
|
1836
|
+
});
|
|
1837
|
+
}
|
|
1838
|
+
}
|
|
1839
|
+
validate(e, n) {
|
|
1840
|
+
return n >= 1 && n <= 4;
|
|
1841
|
+
}
|
|
1842
|
+
set(e, n, r) {
|
|
1843
|
+
return e.setMonth((r - 1) * 3, 1), e.setHours(0, 0, 0, 0), e;
|
|
1844
|
+
}
|
|
1845
|
+
incompatibleTokens = [
|
|
1846
|
+
"Y",
|
|
1847
|
+
"R",
|
|
1848
|
+
"Q",
|
|
1849
|
+
"M",
|
|
1850
|
+
"L",
|
|
1851
|
+
"w",
|
|
1852
|
+
"I",
|
|
1853
|
+
"d",
|
|
1854
|
+
"D",
|
|
1855
|
+
"i",
|
|
1856
|
+
"e",
|
|
1857
|
+
"c",
|
|
1858
|
+
"t",
|
|
1859
|
+
"T"
|
|
1860
|
+
];
|
|
1861
|
+
}
|
|
1862
|
+
class or extends m {
|
|
1863
|
+
incompatibleTokens = [
|
|
1864
|
+
"Y",
|
|
1865
|
+
"R",
|
|
1866
|
+
"q",
|
|
1867
|
+
"Q",
|
|
1868
|
+
"L",
|
|
1869
|
+
"w",
|
|
1870
|
+
"I",
|
|
1871
|
+
"D",
|
|
1872
|
+
"i",
|
|
1873
|
+
"e",
|
|
1874
|
+
"c",
|
|
1875
|
+
"t",
|
|
1876
|
+
"T"
|
|
1877
|
+
];
|
|
1878
|
+
priority = 110;
|
|
1879
|
+
parse(e, n, r) {
|
|
1880
|
+
const s = (a) => a - 1;
|
|
1881
|
+
switch (n) {
|
|
1882
|
+
// 1, 2, ..., 12
|
|
1883
|
+
case "M":
|
|
1884
|
+
return T(
|
|
1885
|
+
p(D.month, e),
|
|
1886
|
+
s
|
|
1887
|
+
);
|
|
1888
|
+
// 01, 02, ..., 12
|
|
1889
|
+
case "MM":
|
|
1890
|
+
return T(b(2, e), s);
|
|
1891
|
+
// 1st, 2nd, ..., 12th
|
|
1892
|
+
case "Mo":
|
|
1893
|
+
return T(
|
|
1894
|
+
r.ordinalNumber(e, {
|
|
1895
|
+
unit: "month"
|
|
1896
|
+
}),
|
|
1897
|
+
s
|
|
1898
|
+
);
|
|
1899
|
+
// Jan, Feb, ..., Dec
|
|
1900
|
+
case "MMM":
|
|
1901
|
+
return r.month(e, {
|
|
1902
|
+
width: "abbreviated",
|
|
1903
|
+
context: "formatting"
|
|
1904
|
+
}) || r.month(e, { width: "narrow", context: "formatting" });
|
|
1905
|
+
// J, F, ..., D
|
|
1906
|
+
case "MMMMM":
|
|
1907
|
+
return r.month(e, {
|
|
1908
|
+
width: "narrow",
|
|
1909
|
+
context: "formatting"
|
|
1910
|
+
});
|
|
1911
|
+
default:
|
|
1912
|
+
return r.month(e, { width: "wide", context: "formatting" }) || r.month(e, {
|
|
1913
|
+
width: "abbreviated",
|
|
1914
|
+
context: "formatting"
|
|
1915
|
+
}) || r.month(e, { width: "narrow", context: "formatting" });
|
|
1916
|
+
}
|
|
1917
|
+
}
|
|
1918
|
+
validate(e, n) {
|
|
1919
|
+
return n >= 0 && n <= 11;
|
|
1920
|
+
}
|
|
1921
|
+
set(e, n, r) {
|
|
1922
|
+
return e.setMonth(r, 1), e.setHours(0, 0, 0, 0), e;
|
|
1923
|
+
}
|
|
1924
|
+
}
|
|
1925
|
+
class ir extends m {
|
|
1926
|
+
priority = 110;
|
|
1927
|
+
parse(e, n, r) {
|
|
1928
|
+
const s = (a) => a - 1;
|
|
1929
|
+
switch (n) {
|
|
1930
|
+
// 1, 2, ..., 12
|
|
1931
|
+
case "L":
|
|
1932
|
+
return T(
|
|
1933
|
+
p(D.month, e),
|
|
1934
|
+
s
|
|
1935
|
+
);
|
|
1936
|
+
// 01, 02, ..., 12
|
|
1937
|
+
case "LL":
|
|
1938
|
+
return T(b(2, e), s);
|
|
1939
|
+
// 1st, 2nd, ..., 12th
|
|
1940
|
+
case "Lo":
|
|
1941
|
+
return T(
|
|
1942
|
+
r.ordinalNumber(e, {
|
|
1943
|
+
unit: "month"
|
|
1944
|
+
}),
|
|
1945
|
+
s
|
|
1946
|
+
);
|
|
1947
|
+
// Jan, Feb, ..., Dec
|
|
1948
|
+
case "LLL":
|
|
1949
|
+
return r.month(e, {
|
|
1950
|
+
width: "abbreviated",
|
|
1951
|
+
context: "standalone"
|
|
1952
|
+
}) || r.month(e, { width: "narrow", context: "standalone" });
|
|
1953
|
+
// J, F, ..., D
|
|
1954
|
+
case "LLLLL":
|
|
1955
|
+
return r.month(e, {
|
|
1956
|
+
width: "narrow",
|
|
1957
|
+
context: "standalone"
|
|
1958
|
+
});
|
|
1959
|
+
default:
|
|
1960
|
+
return r.month(e, { width: "wide", context: "standalone" }) || r.month(e, {
|
|
1961
|
+
width: "abbreviated",
|
|
1962
|
+
context: "standalone"
|
|
1963
|
+
}) || r.month(e, { width: "narrow", context: "standalone" });
|
|
1964
|
+
}
|
|
1965
|
+
}
|
|
1966
|
+
validate(e, n) {
|
|
1967
|
+
return n >= 0 && n <= 11;
|
|
1968
|
+
}
|
|
1969
|
+
set(e, n, r) {
|
|
1970
|
+
return e.setMonth(r, 1), e.setHours(0, 0, 0, 0), e;
|
|
1971
|
+
}
|
|
1972
|
+
incompatibleTokens = [
|
|
1973
|
+
"Y",
|
|
1974
|
+
"R",
|
|
1975
|
+
"q",
|
|
1976
|
+
"Q",
|
|
1977
|
+
"M",
|
|
1978
|
+
"w",
|
|
1979
|
+
"I",
|
|
1980
|
+
"D",
|
|
1981
|
+
"i",
|
|
1982
|
+
"e",
|
|
1983
|
+
"c",
|
|
1984
|
+
"t",
|
|
1985
|
+
"T"
|
|
1986
|
+
];
|
|
1987
|
+
}
|
|
1988
|
+
function cr(t, e, n) {
|
|
1989
|
+
const r = y(t, n?.in), s = it(r, n) - e;
|
|
1990
|
+
return r.setDate(r.getDate() - s * 7), y(r, n?.in);
|
|
1991
|
+
}
|
|
1992
|
+
class ur extends m {
|
|
1993
|
+
priority = 100;
|
|
1994
|
+
parse(e, n, r) {
|
|
1995
|
+
switch (n) {
|
|
1996
|
+
case "w":
|
|
1997
|
+
return p(D.week, e);
|
|
1998
|
+
case "wo":
|
|
1999
|
+
return r.ordinalNumber(e, { unit: "week" });
|
|
2000
|
+
default:
|
|
2001
|
+
return b(n.length, e);
|
|
2002
|
+
}
|
|
2003
|
+
}
|
|
2004
|
+
validate(e, n) {
|
|
2005
|
+
return n >= 1 && n <= 53;
|
|
2006
|
+
}
|
|
2007
|
+
set(e, n, r, s) {
|
|
2008
|
+
return _(cr(e, r, s), s);
|
|
2009
|
+
}
|
|
2010
|
+
incompatibleTokens = [
|
|
2011
|
+
"y",
|
|
2012
|
+
"R",
|
|
2013
|
+
"u",
|
|
2014
|
+
"q",
|
|
2015
|
+
"Q",
|
|
2016
|
+
"M",
|
|
2017
|
+
"L",
|
|
2018
|
+
"I",
|
|
2019
|
+
"d",
|
|
2020
|
+
"D",
|
|
2021
|
+
"i",
|
|
2022
|
+
"t",
|
|
2023
|
+
"T"
|
|
2024
|
+
];
|
|
2025
|
+
}
|
|
2026
|
+
function dr(t, e, n) {
|
|
2027
|
+
const r = y(t, n?.in), s = ot(r, n) - e;
|
|
2028
|
+
return r.setDate(r.getDate() - s * 7), r;
|
|
2029
|
+
}
|
|
2030
|
+
class lr extends m {
|
|
2031
|
+
priority = 100;
|
|
2032
|
+
parse(e, n, r) {
|
|
2033
|
+
switch (n) {
|
|
2034
|
+
case "I":
|
|
2035
|
+
return p(D.week, e);
|
|
2036
|
+
case "Io":
|
|
2037
|
+
return r.ordinalNumber(e, { unit: "week" });
|
|
2038
|
+
default:
|
|
2039
|
+
return b(n.length, e);
|
|
2040
|
+
}
|
|
2041
|
+
}
|
|
2042
|
+
validate(e, n) {
|
|
2043
|
+
return n >= 1 && n <= 53;
|
|
2044
|
+
}
|
|
2045
|
+
set(e, n, r) {
|
|
2046
|
+
return L(dr(e, r));
|
|
2047
|
+
}
|
|
2048
|
+
incompatibleTokens = [
|
|
2049
|
+
"y",
|
|
2050
|
+
"Y",
|
|
2051
|
+
"u",
|
|
2052
|
+
"q",
|
|
2053
|
+
"Q",
|
|
2054
|
+
"M",
|
|
2055
|
+
"L",
|
|
2056
|
+
"w",
|
|
2057
|
+
"d",
|
|
2058
|
+
"D",
|
|
2059
|
+
"e",
|
|
2060
|
+
"c",
|
|
2061
|
+
"t",
|
|
2062
|
+
"T"
|
|
2063
|
+
];
|
|
2064
|
+
}
|
|
2065
|
+
const fr = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], mr = [
|
|
2066
|
+
31,
|
|
2067
|
+
29,
|
|
2068
|
+
31,
|
|
2069
|
+
30,
|
|
2070
|
+
31,
|
|
2071
|
+
30,
|
|
2072
|
+
31,
|
|
2073
|
+
31,
|
|
2074
|
+
30,
|
|
2075
|
+
31,
|
|
2076
|
+
30,
|
|
2077
|
+
31
|
|
2078
|
+
];
|
|
2079
|
+
class hr extends m {
|
|
2080
|
+
priority = 90;
|
|
2081
|
+
subPriority = 1;
|
|
2082
|
+
parse(e, n, r) {
|
|
2083
|
+
switch (n) {
|
|
2084
|
+
case "d":
|
|
2085
|
+
return p(D.date, e);
|
|
2086
|
+
case "do":
|
|
2087
|
+
return r.ordinalNumber(e, { unit: "date" });
|
|
2088
|
+
default:
|
|
2089
|
+
return b(n.length, e);
|
|
2090
|
+
}
|
|
2091
|
+
}
|
|
2092
|
+
validate(e, n) {
|
|
2093
|
+
const r = e.getFullYear(), s = ht(r), a = e.getMonth();
|
|
2094
|
+
return s ? n >= 1 && n <= mr[a] : n >= 1 && n <= fr[a];
|
|
2095
|
+
}
|
|
2096
|
+
set(e, n, r) {
|
|
2097
|
+
return e.setDate(r), e.setHours(0, 0, 0, 0), e;
|
|
2098
|
+
}
|
|
2099
|
+
incompatibleTokens = [
|
|
2100
|
+
"Y",
|
|
2101
|
+
"R",
|
|
2102
|
+
"q",
|
|
2103
|
+
"Q",
|
|
2104
|
+
"w",
|
|
2105
|
+
"I",
|
|
2106
|
+
"D",
|
|
2107
|
+
"i",
|
|
2108
|
+
"e",
|
|
2109
|
+
"c",
|
|
2110
|
+
"t",
|
|
2111
|
+
"T"
|
|
2112
|
+
];
|
|
2113
|
+
}
|
|
2114
|
+
class wr extends m {
|
|
2115
|
+
priority = 90;
|
|
2116
|
+
subpriority = 1;
|
|
2117
|
+
parse(e, n, r) {
|
|
2118
|
+
switch (n) {
|
|
2119
|
+
case "D":
|
|
2120
|
+
case "DD":
|
|
2121
|
+
return p(D.dayOfYear, e);
|
|
2122
|
+
case "Do":
|
|
2123
|
+
return r.ordinalNumber(e, { unit: "date" });
|
|
2124
|
+
default:
|
|
2125
|
+
return b(n.length, e);
|
|
2126
|
+
}
|
|
2127
|
+
}
|
|
2128
|
+
validate(e, n) {
|
|
2129
|
+
const r = e.getFullYear();
|
|
2130
|
+
return ht(r) ? n >= 1 && n <= 366 : n >= 1 && n <= 365;
|
|
2131
|
+
}
|
|
2132
|
+
set(e, n, r) {
|
|
2133
|
+
return e.setMonth(0, r), e.setHours(0, 0, 0, 0), e;
|
|
2134
|
+
}
|
|
2135
|
+
incompatibleTokens = [
|
|
2136
|
+
"Y",
|
|
2137
|
+
"R",
|
|
2138
|
+
"q",
|
|
2139
|
+
"Q",
|
|
2140
|
+
"M",
|
|
2141
|
+
"L",
|
|
2142
|
+
"w",
|
|
2143
|
+
"I",
|
|
2144
|
+
"d",
|
|
2145
|
+
"E",
|
|
2146
|
+
"i",
|
|
2147
|
+
"e",
|
|
2148
|
+
"c",
|
|
2149
|
+
"t",
|
|
2150
|
+
"T"
|
|
2151
|
+
];
|
|
2152
|
+
}
|
|
2153
|
+
function he(t, e, n) {
|
|
2154
|
+
const r = S(), s = n?.weekStartsOn ?? n?.locale?.options?.weekStartsOn ?? r.weekStartsOn ?? r.locale?.options?.weekStartsOn ?? 0, a = y(t, n?.in), o = a.getDay(), c = (e % 7 + 7) % 7, u = 7 - s, d = e < 0 || e > 6 ? e - (o + u) % 7 : (c + u) % 7 - (o + u) % 7;
|
|
2155
|
+
return rt(a, d, n);
|
|
2156
|
+
}
|
|
2157
|
+
class gr extends m {
|
|
2158
|
+
priority = 90;
|
|
2159
|
+
parse(e, n, r) {
|
|
2160
|
+
switch (n) {
|
|
2161
|
+
// Tue
|
|
2162
|
+
case "E":
|
|
2163
|
+
case "EE":
|
|
2164
|
+
case "EEE":
|
|
2165
|
+
return r.day(e, {
|
|
2166
|
+
width: "abbreviated",
|
|
2167
|
+
context: "formatting"
|
|
2168
|
+
}) || r.day(e, { width: "short", context: "formatting" }) || r.day(e, { width: "narrow", context: "formatting" });
|
|
2169
|
+
// T
|
|
2170
|
+
case "EEEEE":
|
|
2171
|
+
return r.day(e, {
|
|
2172
|
+
width: "narrow",
|
|
2173
|
+
context: "formatting"
|
|
2174
|
+
});
|
|
2175
|
+
// Tu
|
|
2176
|
+
case "EEEEEE":
|
|
2177
|
+
return r.day(e, { width: "short", context: "formatting" }) || r.day(e, { width: "narrow", context: "formatting" });
|
|
2178
|
+
default:
|
|
2179
|
+
return r.day(e, { width: "wide", context: "formatting" }) || r.day(e, {
|
|
2180
|
+
width: "abbreviated",
|
|
2181
|
+
context: "formatting"
|
|
2182
|
+
}) || r.day(e, { width: "short", context: "formatting" }) || r.day(e, { width: "narrow", context: "formatting" });
|
|
2183
|
+
}
|
|
2184
|
+
}
|
|
2185
|
+
validate(e, n) {
|
|
2186
|
+
return n >= 0 && n <= 6;
|
|
2187
|
+
}
|
|
2188
|
+
set(e, n, r, s) {
|
|
2189
|
+
return e = he(e, r, s), e.setHours(0, 0, 0, 0), e;
|
|
2190
|
+
}
|
|
2191
|
+
incompatibleTokens = ["D", "i", "e", "c", "t", "T"];
|
|
2192
|
+
}
|
|
2193
|
+
class pr extends m {
|
|
2194
|
+
priority = 90;
|
|
2195
|
+
parse(e, n, r, s) {
|
|
2196
|
+
const a = (o) => {
|
|
2197
|
+
const i = Math.floor((o - 1) / 7) * 7;
|
|
2198
|
+
return (o + s.weekStartsOn + 6) % 7 + i;
|
|
2199
|
+
};
|
|
2200
|
+
switch (n) {
|
|
2201
|
+
// 3
|
|
2202
|
+
case "e":
|
|
2203
|
+
case "ee":
|
|
2204
|
+
return T(b(n.length, e), a);
|
|
2205
|
+
// 3rd
|
|
2206
|
+
case "eo":
|
|
2207
|
+
return T(
|
|
2208
|
+
r.ordinalNumber(e, {
|
|
2209
|
+
unit: "day"
|
|
2210
|
+
}),
|
|
2211
|
+
a
|
|
2212
|
+
);
|
|
2213
|
+
// Tue
|
|
2214
|
+
case "eee":
|
|
2215
|
+
return r.day(e, {
|
|
2216
|
+
width: "abbreviated",
|
|
2217
|
+
context: "formatting"
|
|
2218
|
+
}) || r.day(e, { width: "short", context: "formatting" }) || r.day(e, { width: "narrow", context: "formatting" });
|
|
2219
|
+
// T
|
|
2220
|
+
case "eeeee":
|
|
2221
|
+
return r.day(e, {
|
|
2222
|
+
width: "narrow",
|
|
2223
|
+
context: "formatting"
|
|
2224
|
+
});
|
|
2225
|
+
// Tu
|
|
2226
|
+
case "eeeeee":
|
|
2227
|
+
return r.day(e, { width: "short", context: "formatting" }) || r.day(e, { width: "narrow", context: "formatting" });
|
|
2228
|
+
default:
|
|
2229
|
+
return r.day(e, { width: "wide", context: "formatting" }) || r.day(e, {
|
|
2230
|
+
width: "abbreviated",
|
|
2231
|
+
context: "formatting"
|
|
2232
|
+
}) || r.day(e, { width: "short", context: "formatting" }) || r.day(e, { width: "narrow", context: "formatting" });
|
|
2233
|
+
}
|
|
2234
|
+
}
|
|
2235
|
+
validate(e, n) {
|
|
2236
|
+
return n >= 0 && n <= 6;
|
|
2237
|
+
}
|
|
2238
|
+
set(e, n, r, s) {
|
|
2239
|
+
return e = he(e, r, s), e.setHours(0, 0, 0, 0), e;
|
|
2240
|
+
}
|
|
2241
|
+
incompatibleTokens = [
|
|
2242
|
+
"y",
|
|
2243
|
+
"R",
|
|
2244
|
+
"u",
|
|
2245
|
+
"q",
|
|
2246
|
+
"Q",
|
|
2247
|
+
"M",
|
|
2248
|
+
"L",
|
|
2249
|
+
"I",
|
|
2250
|
+
"d",
|
|
2251
|
+
"D",
|
|
2252
|
+
"E",
|
|
2253
|
+
"i",
|
|
2254
|
+
"c",
|
|
2255
|
+
"t",
|
|
2256
|
+
"T"
|
|
2257
|
+
];
|
|
2258
|
+
}
|
|
2259
|
+
class yr extends m {
|
|
2260
|
+
priority = 90;
|
|
2261
|
+
parse(e, n, r, s) {
|
|
2262
|
+
const a = (o) => {
|
|
2263
|
+
const i = Math.floor((o - 1) / 7) * 7;
|
|
2264
|
+
return (o + s.weekStartsOn + 6) % 7 + i;
|
|
2265
|
+
};
|
|
2266
|
+
switch (n) {
|
|
2267
|
+
// 3
|
|
2268
|
+
case "c":
|
|
2269
|
+
case "cc":
|
|
2270
|
+
return T(b(n.length, e), a);
|
|
2271
|
+
// 3rd
|
|
2272
|
+
case "co":
|
|
2273
|
+
return T(
|
|
2274
|
+
r.ordinalNumber(e, {
|
|
2275
|
+
unit: "day"
|
|
2276
|
+
}),
|
|
2277
|
+
a
|
|
2278
|
+
);
|
|
2279
|
+
// Tue
|
|
2280
|
+
case "ccc":
|
|
2281
|
+
return r.day(e, {
|
|
2282
|
+
width: "abbreviated",
|
|
2283
|
+
context: "standalone"
|
|
2284
|
+
}) || r.day(e, { width: "short", context: "standalone" }) || r.day(e, { width: "narrow", context: "standalone" });
|
|
2285
|
+
// T
|
|
2286
|
+
case "ccccc":
|
|
2287
|
+
return r.day(e, {
|
|
2288
|
+
width: "narrow",
|
|
2289
|
+
context: "standalone"
|
|
2290
|
+
});
|
|
2291
|
+
// Tu
|
|
2292
|
+
case "cccccc":
|
|
2293
|
+
return r.day(e, { width: "short", context: "standalone" }) || r.day(e, { width: "narrow", context: "standalone" });
|
|
2294
|
+
default:
|
|
2295
|
+
return r.day(e, { width: "wide", context: "standalone" }) || r.day(e, {
|
|
2296
|
+
width: "abbreviated",
|
|
2297
|
+
context: "standalone"
|
|
2298
|
+
}) || r.day(e, { width: "short", context: "standalone" }) || r.day(e, { width: "narrow", context: "standalone" });
|
|
2299
|
+
}
|
|
2300
|
+
}
|
|
2301
|
+
validate(e, n) {
|
|
2302
|
+
return n >= 0 && n <= 6;
|
|
2303
|
+
}
|
|
2304
|
+
set(e, n, r, s) {
|
|
2305
|
+
return e = he(e, r, s), e.setHours(0, 0, 0, 0), e;
|
|
2306
|
+
}
|
|
2307
|
+
incompatibleTokens = [
|
|
2308
|
+
"y",
|
|
2309
|
+
"R",
|
|
2310
|
+
"u",
|
|
2311
|
+
"q",
|
|
2312
|
+
"Q",
|
|
2313
|
+
"M",
|
|
2314
|
+
"L",
|
|
2315
|
+
"I",
|
|
2316
|
+
"d",
|
|
2317
|
+
"D",
|
|
2318
|
+
"E",
|
|
2319
|
+
"i",
|
|
2320
|
+
"e",
|
|
2321
|
+
"t",
|
|
2322
|
+
"T"
|
|
2323
|
+
];
|
|
2324
|
+
}
|
|
2325
|
+
function br(t, e, n) {
|
|
2326
|
+
const r = y(t, n?.in), s = Vn(r, n), a = e - s;
|
|
2327
|
+
return rt(r, a, n);
|
|
2328
|
+
}
|
|
2329
|
+
class Dr extends m {
|
|
2330
|
+
priority = 90;
|
|
2331
|
+
parse(e, n, r) {
|
|
2332
|
+
const s = (a) => a === 0 ? 7 : a;
|
|
2333
|
+
switch (n) {
|
|
2334
|
+
// 2
|
|
2335
|
+
case "i":
|
|
2336
|
+
case "ii":
|
|
2337
|
+
return b(n.length, e);
|
|
2338
|
+
// 2nd
|
|
2339
|
+
case "io":
|
|
2340
|
+
return r.ordinalNumber(e, { unit: "day" });
|
|
2341
|
+
// Tue
|
|
2342
|
+
case "iii":
|
|
2343
|
+
return T(
|
|
2344
|
+
r.day(e, {
|
|
2345
|
+
width: "abbreviated",
|
|
2346
|
+
context: "formatting"
|
|
2347
|
+
}) || r.day(e, {
|
|
2348
|
+
width: "short",
|
|
2349
|
+
context: "formatting"
|
|
2350
|
+
}) || r.day(e, {
|
|
2351
|
+
width: "narrow",
|
|
2352
|
+
context: "formatting"
|
|
2353
|
+
}),
|
|
2354
|
+
s
|
|
2355
|
+
);
|
|
2356
|
+
// T
|
|
2357
|
+
case "iiiii":
|
|
2358
|
+
return T(
|
|
2359
|
+
r.day(e, {
|
|
2360
|
+
width: "narrow",
|
|
2361
|
+
context: "formatting"
|
|
2362
|
+
}),
|
|
2363
|
+
s
|
|
2364
|
+
);
|
|
2365
|
+
// Tu
|
|
2366
|
+
case "iiiiii":
|
|
2367
|
+
return T(
|
|
2368
|
+
r.day(e, {
|
|
2369
|
+
width: "short",
|
|
2370
|
+
context: "formatting"
|
|
2371
|
+
}) || r.day(e, {
|
|
2372
|
+
width: "narrow",
|
|
2373
|
+
context: "formatting"
|
|
2374
|
+
}),
|
|
2375
|
+
s
|
|
2376
|
+
);
|
|
2377
|
+
default:
|
|
2378
|
+
return T(
|
|
2379
|
+
r.day(e, {
|
|
2380
|
+
width: "wide",
|
|
2381
|
+
context: "formatting"
|
|
2382
|
+
}) || r.day(e, {
|
|
2383
|
+
width: "abbreviated",
|
|
2384
|
+
context: "formatting"
|
|
2385
|
+
}) || r.day(e, {
|
|
2386
|
+
width: "short",
|
|
2387
|
+
context: "formatting"
|
|
2388
|
+
}) || r.day(e, {
|
|
2389
|
+
width: "narrow",
|
|
2390
|
+
context: "formatting"
|
|
2391
|
+
}),
|
|
2392
|
+
s
|
|
2393
|
+
);
|
|
2394
|
+
}
|
|
2395
|
+
}
|
|
2396
|
+
validate(e, n) {
|
|
2397
|
+
return n >= 1 && n <= 7;
|
|
2398
|
+
}
|
|
2399
|
+
set(e, n, r) {
|
|
2400
|
+
return e = br(e, r), e.setHours(0, 0, 0, 0), e;
|
|
2401
|
+
}
|
|
2402
|
+
incompatibleTokens = [
|
|
2403
|
+
"y",
|
|
2404
|
+
"Y",
|
|
2405
|
+
"u",
|
|
2406
|
+
"q",
|
|
2407
|
+
"Q",
|
|
2408
|
+
"M",
|
|
2409
|
+
"L",
|
|
2410
|
+
"w",
|
|
2411
|
+
"d",
|
|
2412
|
+
"D",
|
|
2413
|
+
"E",
|
|
2414
|
+
"e",
|
|
2415
|
+
"c",
|
|
2416
|
+
"t",
|
|
2417
|
+
"T"
|
|
2418
|
+
];
|
|
2419
|
+
}
|
|
2420
|
+
class Tr extends m {
|
|
2421
|
+
priority = 80;
|
|
2422
|
+
parse(e, n, r) {
|
|
2423
|
+
switch (n) {
|
|
2424
|
+
case "a":
|
|
2425
|
+
case "aa":
|
|
2426
|
+
case "aaa":
|
|
2427
|
+
return r.dayPeriod(e, {
|
|
2428
|
+
width: "abbreviated",
|
|
2429
|
+
context: "formatting"
|
|
2430
|
+
}) || r.dayPeriod(e, {
|
|
2431
|
+
width: "narrow",
|
|
2432
|
+
context: "formatting"
|
|
2433
|
+
});
|
|
2434
|
+
case "aaaaa":
|
|
2435
|
+
return r.dayPeriod(e, {
|
|
2436
|
+
width: "narrow",
|
|
2437
|
+
context: "formatting"
|
|
2438
|
+
});
|
|
2439
|
+
default:
|
|
2440
|
+
return r.dayPeriod(e, {
|
|
2441
|
+
width: "wide",
|
|
2442
|
+
context: "formatting"
|
|
2443
|
+
}) || r.dayPeriod(e, {
|
|
2444
|
+
width: "abbreviated",
|
|
2445
|
+
context: "formatting"
|
|
2446
|
+
}) || r.dayPeriod(e, {
|
|
2447
|
+
width: "narrow",
|
|
2448
|
+
context: "formatting"
|
|
2449
|
+
});
|
|
2450
|
+
}
|
|
2451
|
+
}
|
|
2452
|
+
set(e, n, r) {
|
|
2453
|
+
return e.setHours(me(r), 0, 0, 0), e;
|
|
2454
|
+
}
|
|
2455
|
+
incompatibleTokens = ["b", "B", "H", "k", "t", "T"];
|
|
2456
|
+
}
|
|
2457
|
+
class Er extends m {
|
|
2458
|
+
priority = 80;
|
|
2459
|
+
parse(e, n, r) {
|
|
2460
|
+
switch (n) {
|
|
2461
|
+
case "b":
|
|
2462
|
+
case "bb":
|
|
2463
|
+
case "bbb":
|
|
2464
|
+
return r.dayPeriod(e, {
|
|
2465
|
+
width: "abbreviated",
|
|
2466
|
+
context: "formatting"
|
|
2467
|
+
}) || r.dayPeriod(e, {
|
|
2468
|
+
width: "narrow",
|
|
2469
|
+
context: "formatting"
|
|
2470
|
+
});
|
|
2471
|
+
case "bbbbb":
|
|
2472
|
+
return r.dayPeriod(e, {
|
|
2473
|
+
width: "narrow",
|
|
2474
|
+
context: "formatting"
|
|
2475
|
+
});
|
|
2476
|
+
default:
|
|
2477
|
+
return r.dayPeriod(e, {
|
|
2478
|
+
width: "wide",
|
|
2479
|
+
context: "formatting"
|
|
2480
|
+
}) || r.dayPeriod(e, {
|
|
2481
|
+
width: "abbreviated",
|
|
2482
|
+
context: "formatting"
|
|
2483
|
+
}) || r.dayPeriod(e, {
|
|
2484
|
+
width: "narrow",
|
|
2485
|
+
context: "formatting"
|
|
2486
|
+
});
|
|
2487
|
+
}
|
|
2488
|
+
}
|
|
2489
|
+
set(e, n, r) {
|
|
2490
|
+
return e.setHours(me(r), 0, 0, 0), e;
|
|
2491
|
+
}
|
|
2492
|
+
incompatibleTokens = ["a", "B", "H", "k", "t", "T"];
|
|
2493
|
+
}
|
|
2494
|
+
class xr extends m {
|
|
2495
|
+
priority = 80;
|
|
2496
|
+
parse(e, n, r) {
|
|
2497
|
+
switch (n) {
|
|
2498
|
+
case "B":
|
|
2499
|
+
case "BB":
|
|
2500
|
+
case "BBB":
|
|
2501
|
+
return r.dayPeriod(e, {
|
|
2502
|
+
width: "abbreviated",
|
|
2503
|
+
context: "formatting"
|
|
2504
|
+
}) || r.dayPeriod(e, {
|
|
2505
|
+
width: "narrow",
|
|
2506
|
+
context: "formatting"
|
|
2507
|
+
});
|
|
2508
|
+
case "BBBBB":
|
|
2509
|
+
return r.dayPeriod(e, {
|
|
2510
|
+
width: "narrow",
|
|
2511
|
+
context: "formatting"
|
|
2512
|
+
});
|
|
2513
|
+
default:
|
|
2514
|
+
return r.dayPeriod(e, {
|
|
2515
|
+
width: "wide",
|
|
2516
|
+
context: "formatting"
|
|
2517
|
+
}) || r.dayPeriod(e, {
|
|
2518
|
+
width: "abbreviated",
|
|
2519
|
+
context: "formatting"
|
|
2520
|
+
}) || r.dayPeriod(e, {
|
|
2521
|
+
width: "narrow",
|
|
2522
|
+
context: "formatting"
|
|
2523
|
+
});
|
|
2524
|
+
}
|
|
2525
|
+
}
|
|
2526
|
+
set(e, n, r) {
|
|
2527
|
+
return e.setHours(me(r), 0, 0, 0), e;
|
|
2528
|
+
}
|
|
2529
|
+
incompatibleTokens = ["a", "b", "t", "T"];
|
|
2530
|
+
}
|
|
2531
|
+
class Pr extends m {
|
|
2532
|
+
priority = 70;
|
|
2533
|
+
parse(e, n, r) {
|
|
2534
|
+
switch (n) {
|
|
2535
|
+
case "h":
|
|
2536
|
+
return p(D.hour12h, e);
|
|
2537
|
+
case "ho":
|
|
2538
|
+
return r.ordinalNumber(e, { unit: "hour" });
|
|
2539
|
+
default:
|
|
2540
|
+
return b(n.length, e);
|
|
2541
|
+
}
|
|
2542
|
+
}
|
|
2543
|
+
validate(e, n) {
|
|
2544
|
+
return n >= 1 && n <= 12;
|
|
2545
|
+
}
|
|
2546
|
+
set(e, n, r) {
|
|
2547
|
+
const s = e.getHours() >= 12;
|
|
2548
|
+
return s && r < 12 ? e.setHours(r + 12, 0, 0, 0) : !s && r === 12 ? e.setHours(0, 0, 0, 0) : e.setHours(r, 0, 0, 0), e;
|
|
2549
|
+
}
|
|
2550
|
+
incompatibleTokens = ["H", "K", "k", "t", "T"];
|
|
2551
|
+
}
|
|
2552
|
+
class Mr extends m {
|
|
2553
|
+
priority = 70;
|
|
2554
|
+
parse(e, n, r) {
|
|
2555
|
+
switch (n) {
|
|
2556
|
+
case "H":
|
|
2557
|
+
return p(D.hour23h, e);
|
|
2558
|
+
case "Ho":
|
|
2559
|
+
return r.ordinalNumber(e, { unit: "hour" });
|
|
2560
|
+
default:
|
|
2561
|
+
return b(n.length, e);
|
|
2562
|
+
}
|
|
2563
|
+
}
|
|
2564
|
+
validate(e, n) {
|
|
2565
|
+
return n >= 0 && n <= 23;
|
|
2566
|
+
}
|
|
2567
|
+
set(e, n, r) {
|
|
2568
|
+
return e.setHours(r, 0, 0, 0), e;
|
|
2569
|
+
}
|
|
2570
|
+
incompatibleTokens = ["a", "b", "h", "K", "k", "t", "T"];
|
|
2571
|
+
}
|
|
2572
|
+
class vr extends m {
|
|
2573
|
+
priority = 70;
|
|
2574
|
+
parse(e, n, r) {
|
|
2575
|
+
switch (n) {
|
|
2576
|
+
case "K":
|
|
2577
|
+
return p(D.hour11h, e);
|
|
2578
|
+
case "Ko":
|
|
2579
|
+
return r.ordinalNumber(e, { unit: "hour" });
|
|
2580
|
+
default:
|
|
2581
|
+
return b(n.length, e);
|
|
2582
|
+
}
|
|
2583
|
+
}
|
|
2584
|
+
validate(e, n) {
|
|
2585
|
+
return n >= 0 && n <= 11;
|
|
2586
|
+
}
|
|
2587
|
+
set(e, n, r) {
|
|
2588
|
+
return e.getHours() >= 12 && r < 12 ? e.setHours(r + 12, 0, 0, 0) : e.setHours(r, 0, 0, 0), e;
|
|
2589
|
+
}
|
|
2590
|
+
incompatibleTokens = ["h", "H", "k", "t", "T"];
|
|
2591
|
+
}
|
|
2592
|
+
class Or extends m {
|
|
2593
|
+
priority = 70;
|
|
2594
|
+
parse(e, n, r) {
|
|
2595
|
+
switch (n) {
|
|
2596
|
+
case "k":
|
|
2597
|
+
return p(D.hour24h, e);
|
|
2598
|
+
case "ko":
|
|
2599
|
+
return r.ordinalNumber(e, { unit: "hour" });
|
|
2600
|
+
default:
|
|
2601
|
+
return b(n.length, e);
|
|
2602
|
+
}
|
|
2603
|
+
}
|
|
2604
|
+
validate(e, n) {
|
|
2605
|
+
return n >= 1 && n <= 24;
|
|
2606
|
+
}
|
|
2607
|
+
set(e, n, r) {
|
|
2608
|
+
const s = r <= 24 ? r % 24 : r;
|
|
2609
|
+
return e.setHours(s, 0, 0, 0), e;
|
|
2610
|
+
}
|
|
2611
|
+
incompatibleTokens = ["a", "b", "h", "H", "K", "t", "T"];
|
|
2612
|
+
}
|
|
2613
|
+
class Ar extends m {
|
|
2614
|
+
priority = 60;
|
|
2615
|
+
parse(e, n, r) {
|
|
2616
|
+
switch (n) {
|
|
2617
|
+
case "m":
|
|
2618
|
+
return p(D.minute, e);
|
|
2619
|
+
case "mo":
|
|
2620
|
+
return r.ordinalNumber(e, { unit: "minute" });
|
|
2621
|
+
default:
|
|
2622
|
+
return b(n.length, e);
|
|
2623
|
+
}
|
|
2624
|
+
}
|
|
2625
|
+
validate(e, n) {
|
|
2626
|
+
return n >= 0 && n <= 59;
|
|
2627
|
+
}
|
|
2628
|
+
set(e, n, r) {
|
|
2629
|
+
return e.setMinutes(r, 0, 0), e;
|
|
2630
|
+
}
|
|
2631
|
+
incompatibleTokens = ["t", "T"];
|
|
2632
|
+
}
|
|
2633
|
+
class Nr extends m {
|
|
2634
|
+
priority = 50;
|
|
2635
|
+
parse(e, n, r) {
|
|
2636
|
+
switch (n) {
|
|
2637
|
+
case "s":
|
|
2638
|
+
return p(D.second, e);
|
|
2639
|
+
case "so":
|
|
2640
|
+
return r.ordinalNumber(e, { unit: "second" });
|
|
2641
|
+
default:
|
|
2642
|
+
return b(n.length, e);
|
|
2643
|
+
}
|
|
2644
|
+
}
|
|
2645
|
+
validate(e, n) {
|
|
2646
|
+
return n >= 0 && n <= 59;
|
|
2647
|
+
}
|
|
2648
|
+
set(e, n, r) {
|
|
2649
|
+
return e.setSeconds(r, 0), e;
|
|
2650
|
+
}
|
|
2651
|
+
incompatibleTokens = ["t", "T"];
|
|
2652
|
+
}
|
|
2653
|
+
class kr extends m {
|
|
2654
|
+
priority = 30;
|
|
2655
|
+
parse(e, n) {
|
|
2656
|
+
const r = (s) => Math.trunc(s * Math.pow(10, -n.length + 3));
|
|
2657
|
+
return T(b(n.length, e), r);
|
|
2658
|
+
}
|
|
2659
|
+
set(e, n, r) {
|
|
2660
|
+
return e.setMilliseconds(r), e;
|
|
2661
|
+
}
|
|
2662
|
+
incompatibleTokens = ["t", "T"];
|
|
2663
|
+
}
|
|
2664
|
+
class Rr extends m {
|
|
2665
|
+
priority = 10;
|
|
2666
|
+
parse(e, n) {
|
|
2667
|
+
switch (n) {
|
|
2668
|
+
case "X":
|
|
2669
|
+
return A(
|
|
2670
|
+
O.basicOptionalMinutes,
|
|
2671
|
+
e
|
|
2672
|
+
);
|
|
2673
|
+
case "XX":
|
|
2674
|
+
return A(O.basic, e);
|
|
2675
|
+
case "XXXX":
|
|
2676
|
+
return A(
|
|
2677
|
+
O.basicOptionalSeconds,
|
|
2678
|
+
e
|
|
2679
|
+
);
|
|
2680
|
+
case "XXXXX":
|
|
2681
|
+
return A(
|
|
2682
|
+
O.extendedOptionalSeconds,
|
|
2683
|
+
e
|
|
2684
|
+
);
|
|
2685
|
+
default:
|
|
2686
|
+
return A(O.extended, e);
|
|
2687
|
+
}
|
|
2688
|
+
}
|
|
2689
|
+
set(e, n, r) {
|
|
2690
|
+
return n.timestampIsSet ? e : E(
|
|
2691
|
+
e,
|
|
2692
|
+
e.getTime() - z(e) - r
|
|
2693
|
+
);
|
|
2694
|
+
}
|
|
2695
|
+
incompatibleTokens = ["t", "T", "x"];
|
|
2696
|
+
}
|
|
2697
|
+
class _r extends m {
|
|
2698
|
+
priority = 10;
|
|
2699
|
+
parse(e, n) {
|
|
2700
|
+
switch (n) {
|
|
2701
|
+
case "x":
|
|
2702
|
+
return A(
|
|
2703
|
+
O.basicOptionalMinutes,
|
|
2704
|
+
e
|
|
2705
|
+
);
|
|
2706
|
+
case "xx":
|
|
2707
|
+
return A(O.basic, e);
|
|
2708
|
+
case "xxxx":
|
|
2709
|
+
return A(
|
|
2710
|
+
O.basicOptionalSeconds,
|
|
2711
|
+
e
|
|
2712
|
+
);
|
|
2713
|
+
case "xxxxx":
|
|
2714
|
+
return A(
|
|
2715
|
+
O.extendedOptionalSeconds,
|
|
2716
|
+
e
|
|
2717
|
+
);
|
|
2718
|
+
default:
|
|
2719
|
+
return A(O.extended, e);
|
|
2720
|
+
}
|
|
2721
|
+
}
|
|
2722
|
+
set(e, n, r) {
|
|
2723
|
+
return n.timestampIsSet ? e : E(
|
|
2724
|
+
e,
|
|
2725
|
+
e.getTime() - z(e) - r
|
|
2726
|
+
);
|
|
2727
|
+
}
|
|
2728
|
+
incompatibleTokens = ["t", "T", "X"];
|
|
2729
|
+
}
|
|
2730
|
+
class Ir extends m {
|
|
2731
|
+
priority = 40;
|
|
2732
|
+
parse(e) {
|
|
2733
|
+
return ft(e);
|
|
2734
|
+
}
|
|
2735
|
+
set(e, n, r) {
|
|
2736
|
+
return [E(e, r * 1e3), { timestampIsSet: !0 }];
|
|
2737
|
+
}
|
|
2738
|
+
incompatibleTokens = "*";
|
|
2739
|
+
}
|
|
2740
|
+
class Yr extends m {
|
|
2741
|
+
priority = 20;
|
|
2742
|
+
parse(e) {
|
|
2743
|
+
return ft(e);
|
|
2744
|
+
}
|
|
2745
|
+
set(e, n, r) {
|
|
2746
|
+
return [E(e, r), { timestampIsSet: !0 }];
|
|
2747
|
+
}
|
|
2748
|
+
incompatibleTokens = "*";
|
|
2749
|
+
}
|
|
2750
|
+
const Cr = {
|
|
2751
|
+
G: new Zn(),
|
|
2752
|
+
y: new er(),
|
|
2753
|
+
Y: new tr(),
|
|
2754
|
+
R: new nr(),
|
|
2755
|
+
u: new rr(),
|
|
2756
|
+
Q: new sr(),
|
|
2757
|
+
q: new ar(),
|
|
2758
|
+
M: new or(),
|
|
2759
|
+
L: new ir(),
|
|
2760
|
+
w: new ur(),
|
|
2761
|
+
I: new lr(),
|
|
2762
|
+
d: new hr(),
|
|
2763
|
+
D: new wr(),
|
|
2764
|
+
E: new gr(),
|
|
2765
|
+
e: new pr(),
|
|
2766
|
+
c: new yr(),
|
|
2767
|
+
i: new Dr(),
|
|
2768
|
+
a: new Tr(),
|
|
2769
|
+
b: new Er(),
|
|
2770
|
+
B: new xr(),
|
|
2771
|
+
h: new Pr(),
|
|
2772
|
+
H: new Mr(),
|
|
2773
|
+
K: new vr(),
|
|
2774
|
+
k: new Or(),
|
|
2775
|
+
m: new Ar(),
|
|
2776
|
+
s: new Nr(),
|
|
2777
|
+
S: new kr(),
|
|
2778
|
+
X: new Rr(),
|
|
2779
|
+
x: new _r(),
|
|
2780
|
+
t: new Ir(),
|
|
2781
|
+
T: new Yr()
|
|
2782
|
+
}, Lr = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, Sr = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, Wr = /^'([^]*?)'?$/, $r = /''/g, qr = /\S/, Qr = /[a-zA-Z]/;
|
|
2783
|
+
function Fr(t, e, n, r) {
|
|
2784
|
+
const s = () => E(n, NaN), a = Gn(), o = a.locale ?? at, i = a.firstWeekContainsDate ?? a.locale?.options?.firstWeekContainsDate ?? 1, c = a.weekStartsOn ?? a.locale?.options?.weekStartsOn ?? 0;
|
|
2785
|
+
if (!e)
|
|
2786
|
+
return t ? s() : y(n, r?.in);
|
|
2787
|
+
const u = {
|
|
2788
|
+
firstWeekContainsDate: i,
|
|
2789
|
+
weekStartsOn: c,
|
|
2790
|
+
locale: o
|
|
2791
|
+
}, d = [new Jn(r?.in, n)], l = e.match(Sr).map((f) => {
|
|
2792
|
+
const w = f[0];
|
|
2793
|
+
if (w in se) {
|
|
2794
|
+
const M = se[w];
|
|
2795
|
+
return M(f, o.formatLong);
|
|
2796
|
+
}
|
|
2797
|
+
return f;
|
|
2798
|
+
}).join("").match(Lr), g = [];
|
|
2799
|
+
for (let f of l) {
|
|
2800
|
+
dt(f) && ae(f, e, t), ut(f) && ae(f, e, t);
|
|
2801
|
+
const w = f[0], M = Cr[w];
|
|
2802
|
+
if (M) {
|
|
2803
|
+
const { incompatibleTokens: v } = M;
|
|
2804
|
+
if (Array.isArray(v)) {
|
|
2805
|
+
const $ = g.find(
|
|
2806
|
+
(U) => v.includes(U.token) || U.token === w
|
|
2807
|
+
);
|
|
2808
|
+
if ($)
|
|
2809
|
+
throw new RangeError(
|
|
2810
|
+
`The format string mustn't contain \`${$.fullToken}\` and \`${f}\` at the same time`
|
|
2811
|
+
);
|
|
2812
|
+
} else if (M.incompatibleTokens === "*" && g.length > 0)
|
|
2813
|
+
throw new RangeError(
|
|
2814
|
+
`The format string mustn't contain \`${f}\` and any other token at the same time`
|
|
2815
|
+
);
|
|
2816
|
+
g.push({ token: w, fullToken: f });
|
|
2817
|
+
const W = M.run(
|
|
2818
|
+
t,
|
|
2819
|
+
f,
|
|
2820
|
+
o.match,
|
|
2821
|
+
u
|
|
2822
|
+
);
|
|
2823
|
+
if (!W)
|
|
2824
|
+
return s();
|
|
2825
|
+
d.push(W.setter), t = W.rest;
|
|
2826
|
+
} else {
|
|
2827
|
+
if (w.match(Qr))
|
|
2828
|
+
throw new RangeError(
|
|
2829
|
+
"Format string contains an unescaped latin alphabet character `" + w + "`"
|
|
2830
|
+
);
|
|
2831
|
+
if (f === "''" ? f = "'" : w === "'" && (f = Hr(f)), t.indexOf(f) === 0)
|
|
2832
|
+
t = t.slice(f.length);
|
|
2833
|
+
else
|
|
2834
|
+
return s();
|
|
2835
|
+
}
|
|
2836
|
+
}
|
|
2837
|
+
if (t.length > 0 && qr.test(t))
|
|
2838
|
+
return s();
|
|
2839
|
+
const x = d.map((f) => f.priority).sort((f, w) => w - f).filter((f, w, M) => M.indexOf(f) === w).map(
|
|
2840
|
+
(f) => d.filter((w) => w.priority === f).sort((w, M) => M.subPriority - w.subPriority)
|
|
2841
|
+
).map((f) => f[0]);
|
|
2842
|
+
let P = y(n, r?.in);
|
|
2843
|
+
if (isNaN(+P)) return s();
|
|
2844
|
+
const Y = {};
|
|
2845
|
+
for (const f of x) {
|
|
2846
|
+
if (!f.validate(P, u))
|
|
2847
|
+
return s();
|
|
2848
|
+
const w = f.set(P, Y, u);
|
|
2849
|
+
Array.isArray(w) ? (P = w[0], Object.assign(Y, w[1])) : P = w;
|
|
2850
|
+
}
|
|
2851
|
+
return P;
|
|
2852
|
+
}
|
|
2853
|
+
function Hr(t) {
|
|
2854
|
+
return t.match(Wr)[1].replace($r, "'");
|
|
2855
|
+
}
|
|
2856
|
+
function Ur(t, e) {
|
|
2857
|
+
const n = () => E(e?.in, NaN), s = Xr(t);
|
|
2858
|
+
let a;
|
|
2859
|
+
if (s.date) {
|
|
2860
|
+
const u = jr(s.date, 2);
|
|
2861
|
+
a = Kr(u.restDateString, u.year);
|
|
2862
|
+
}
|
|
2863
|
+
if (!a || isNaN(+a)) return n();
|
|
2864
|
+
const o = +a;
|
|
2865
|
+
let i = 0, c;
|
|
2866
|
+
if (s.time && (i = zr(s.time), isNaN(i)))
|
|
2867
|
+
return n();
|
|
2868
|
+
if (s.timezone) {
|
|
2869
|
+
if (c = Jr(s.timezone), isNaN(c)) return n();
|
|
2870
|
+
} else {
|
|
2871
|
+
const u = new Date(o + i), d = y(0, e?.in);
|
|
2872
|
+
return d.setFullYear(
|
|
2873
|
+
u.getUTCFullYear(),
|
|
2874
|
+
u.getUTCMonth(),
|
|
2875
|
+
u.getUTCDate()
|
|
2876
|
+
), d.setHours(
|
|
2877
|
+
u.getUTCHours(),
|
|
2878
|
+
u.getUTCMinutes(),
|
|
2879
|
+
u.getUTCSeconds(),
|
|
2880
|
+
u.getUTCMilliseconds()
|
|
2881
|
+
), d;
|
|
2882
|
+
}
|
|
2883
|
+
return y(o + i + c, e?.in);
|
|
2884
|
+
}
|
|
2885
|
+
const G = {
|
|
2886
|
+
dateTimeDelimiter: /[T ]/,
|
|
2887
|
+
timeZoneDelimiter: /[Z ]/i,
|
|
2888
|
+
timezone: /([Z+-].*)$/
|
|
2889
|
+
}, Br = /^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/, Gr = /^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/, Vr = /^([+-])(\d{2})(?::?(\d{2}))?$/;
|
|
2890
|
+
function Xr(t) {
|
|
2891
|
+
const e = {}, n = t.split(G.dateTimeDelimiter);
|
|
2892
|
+
let r;
|
|
2893
|
+
if (n.length > 2)
|
|
2894
|
+
return e;
|
|
2895
|
+
if (/:/.test(n[0]) ? r = n[0] : (e.date = n[0], r = n[1], G.timeZoneDelimiter.test(e.date) && (e.date = t.split(G.timeZoneDelimiter)[0], r = t.substr(
|
|
2896
|
+
e.date.length,
|
|
2897
|
+
t.length
|
|
2898
|
+
))), r) {
|
|
2899
|
+
const s = G.timezone.exec(r);
|
|
2900
|
+
s ? (e.time = r.replace(s[1], ""), e.timezone = s[1]) : e.time = r;
|
|
2901
|
+
}
|
|
2902
|
+
return e;
|
|
2903
|
+
}
|
|
2904
|
+
function jr(t, e) {
|
|
2905
|
+
const n = new RegExp(
|
|
2906
|
+
"^(?:(\\d{4}|[+-]\\d{" + (4 + e) + "})|(\\d{2}|[+-]\\d{" + (2 + e) + "})$)"
|
|
2907
|
+
), r = t.match(n);
|
|
2908
|
+
if (!r) return { year: NaN, restDateString: "" };
|
|
2909
|
+
const s = r[1] ? parseInt(r[1]) : null, a = r[2] ? parseInt(r[2]) : null;
|
|
2910
|
+
return {
|
|
2911
|
+
year: a === null ? s : a * 100,
|
|
2912
|
+
restDateString: t.slice((r[1] || r[2]).length)
|
|
2913
|
+
};
|
|
2914
|
+
}
|
|
2915
|
+
function Kr(t, e) {
|
|
2916
|
+
if (e === null) return /* @__PURE__ */ new Date(NaN);
|
|
2917
|
+
const n = t.match(Br);
|
|
2918
|
+
if (!n) return /* @__PURE__ */ new Date(NaN);
|
|
2919
|
+
const r = !!n[4], s = F(n[1]), a = F(n[2]) - 1, o = F(n[3]), i = F(n[4]), c = F(n[5]) - 1;
|
|
2920
|
+
if (r)
|
|
2921
|
+
return rs(e, i, c) ? Zr(e, i, c) : /* @__PURE__ */ new Date(NaN);
|
|
2922
|
+
{
|
|
2923
|
+
const u = /* @__PURE__ */ new Date(0);
|
|
2924
|
+
return !ts(e, a, o) || !ns(e, s) ? /* @__PURE__ */ new Date(NaN) : (u.setUTCFullYear(e, a, Math.max(s, o)), u);
|
|
2925
|
+
}
|
|
2926
|
+
}
|
|
2927
|
+
function F(t) {
|
|
2928
|
+
return t ? parseInt(t) : 1;
|
|
2929
|
+
}
|
|
2930
|
+
function zr(t) {
|
|
2931
|
+
const e = t.match(Gr);
|
|
2932
|
+
if (!e) return NaN;
|
|
2933
|
+
const n = ne(e[1]), r = ne(e[2]), s = ne(e[3]);
|
|
2934
|
+
return ss(n, r, s) ? n * le + r * de + s * 1e3 : NaN;
|
|
2935
|
+
}
|
|
2936
|
+
function ne(t) {
|
|
2937
|
+
return t && parseFloat(t.replace(",", ".")) || 0;
|
|
2938
|
+
}
|
|
2939
|
+
function Jr(t) {
|
|
2940
|
+
if (t === "Z") return 0;
|
|
2941
|
+
const e = t.match(Vr);
|
|
2942
|
+
if (!e) return 0;
|
|
2943
|
+
const n = e[1] === "+" ? -1 : 1, r = parseInt(e[2]), s = e[3] && parseInt(e[3]) || 0;
|
|
2944
|
+
return as(r, s) ? n * (r * le + s * de) : NaN;
|
|
2945
|
+
}
|
|
2946
|
+
function Zr(t, e, n) {
|
|
2947
|
+
const r = /* @__PURE__ */ new Date(0);
|
|
2948
|
+
r.setUTCFullYear(t, 0, 4);
|
|
2949
|
+
const s = r.getUTCDay() || 7, a = (e - 1) * 7 + n + 1 - s;
|
|
2950
|
+
return r.setUTCDate(r.getUTCDate() + a), r;
|
|
2951
|
+
}
|
|
2952
|
+
const es = [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
|
|
2953
|
+
function wt(t) {
|
|
2954
|
+
return t % 400 === 0 || t % 4 === 0 && t % 100 !== 0;
|
|
2955
|
+
}
|
|
2956
|
+
function ts(t, e, n) {
|
|
2957
|
+
return e >= 0 && e <= 11 && n >= 1 && n <= (es[e] || (wt(t) ? 29 : 28));
|
|
2958
|
+
}
|
|
2959
|
+
function ns(t, e) {
|
|
2960
|
+
return e >= 1 && e <= (wt(t) ? 366 : 365);
|
|
2961
|
+
}
|
|
2962
|
+
function rs(t, e, n) {
|
|
2963
|
+
return e >= 1 && e <= 53 && n >= 0 && n <= 6;
|
|
2964
|
+
}
|
|
2965
|
+
function ss(t, e, n) {
|
|
2966
|
+
return t === 24 ? e === 0 && n === 0 : n >= 0 && n < 60 && e >= 0 && e < 60 && t >= 0 && t < 25;
|
|
2967
|
+
}
|
|
2968
|
+
function as(t, e) {
|
|
2969
|
+
return e >= 0 && e <= 59;
|
|
2970
|
+
}
|
|
2971
|
+
const V = (t) => {
|
|
2972
|
+
if (!t.includes("T")) {
|
|
2973
|
+
for (const n of os) {
|
|
2974
|
+
const r = Fr(t, n, /* @__PURE__ */ new Date());
|
|
2975
|
+
if (re(r))
|
|
2976
|
+
return r;
|
|
2977
|
+
}
|
|
2978
|
+
return null;
|
|
2979
|
+
}
|
|
2980
|
+
const e = Ur(t);
|
|
2981
|
+
return re(e) ? e : null;
|
|
2982
|
+
}, os = ["yyyy-MM-dd", "MM-dd-yyyy"], oe = (t, e, n) => {
|
|
2983
|
+
const r = {};
|
|
2984
|
+
return e?.contentType !== null && (r[Ht] = e?.contentType || Ft), e?.jwt && (r.Authorization = `Bearer ${e.jwt}`), e?.chatReference && (r[Ut] = e.chatReference), { ...r, ...n };
|
|
2985
|
+
}, is = (t) => {
|
|
2986
|
+
const e = { ...t };
|
|
2987
|
+
return e[ee] && (e[ee] = e[ee].substring(0, 8) + "...[REDACTED]"), e.Authorization && (e.Authorization = "Bearer [REDACTED]"), e[j] && (e[j] = e[j].substring(0, 8) + "...[REDACTED]"), e;
|
|
2988
|
+
}, qe = async (t, e, n) => await fetch(t, {
|
|
167
2989
|
method: n.method || "GET",
|
|
168
|
-
headers:
|
|
2990
|
+
headers: e,
|
|
169
2991
|
body: n.body ? JSON.stringify(n.body) : void 0
|
|
170
|
-
}),
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
2992
|
+
}), cs = async (t, e, n) => {
|
|
2993
|
+
const r = n?.body === void 0 ? void 0 : n?.isFormData ? n.body : JSON.stringify(n.body);
|
|
2994
|
+
return await fetch(t, {
|
|
2995
|
+
method: n.method,
|
|
2996
|
+
headers: e,
|
|
2997
|
+
body: r,
|
|
2998
|
+
signal: n?.signal
|
|
2999
|
+
});
|
|
3000
|
+
};
|
|
3001
|
+
class us {
|
|
177
3002
|
constructor() {
|
|
178
3003
|
this.decoder = new TextDecoder();
|
|
179
3004
|
}
|
|
180
|
-
async streamChat(
|
|
181
|
-
const { onMessage:
|
|
3005
|
+
async streamChat(e, n, r = {}, s) {
|
|
3006
|
+
const { onMessage: a, onError: o, onComplete: i, signal: c } = r;
|
|
182
3007
|
try {
|
|
183
3008
|
const u = await this.initializeStreamRequest(
|
|
184
|
-
|
|
3009
|
+
e,
|
|
185
3010
|
n,
|
|
186
3011
|
c,
|
|
187
|
-
|
|
3012
|
+
s
|
|
188
3013
|
);
|
|
189
|
-
await this.processStreamData(u,
|
|
3014
|
+
await this.processStreamData(u, a), i?.();
|
|
190
3015
|
} catch (u) {
|
|
191
|
-
this.handleStreamError(u,
|
|
3016
|
+
this.handleStreamError(u, o);
|
|
192
3017
|
}
|
|
193
3018
|
}
|
|
194
|
-
async initializeStreamRequest(
|
|
195
|
-
const
|
|
196
|
-
jwt:
|
|
197
|
-
}),
|
|
198
|
-
|
|
3019
|
+
async initializeStreamRequest(e, n, r, s) {
|
|
3020
|
+
const a = oe(void 0, {
|
|
3021
|
+
jwt: s
|
|
3022
|
+
}), o = await cs(
|
|
3023
|
+
e,
|
|
199
3024
|
{
|
|
200
3025
|
Accept: "text/event-stream",
|
|
201
|
-
...
|
|
3026
|
+
...a
|
|
202
3027
|
},
|
|
203
3028
|
{
|
|
204
3029
|
method: "POST",
|
|
205
3030
|
body: n,
|
|
206
|
-
signal:
|
|
3031
|
+
signal: r
|
|
207
3032
|
}
|
|
208
3033
|
);
|
|
209
|
-
if (!
|
|
210
|
-
const
|
|
3034
|
+
if (!o.ok) {
|
|
3035
|
+
const i = await o.text();
|
|
211
3036
|
let c = {};
|
|
212
3037
|
try {
|
|
213
|
-
c = JSON.parse(
|
|
3038
|
+
c = JSON.parse(i);
|
|
214
3039
|
} catch {
|
|
215
3040
|
c.error = "Failed to parse error body";
|
|
216
3041
|
}
|
|
217
|
-
throw new
|
|
218
|
-
status:
|
|
3042
|
+
throw new Ie({
|
|
3043
|
+
status: o.status,
|
|
219
3044
|
message: c.error ?? "No response body"
|
|
220
3045
|
});
|
|
221
3046
|
}
|
|
222
|
-
if (!
|
|
223
|
-
throw new
|
|
3047
|
+
if (!o.body)
|
|
3048
|
+
throw new Ie({
|
|
224
3049
|
message: "No response body",
|
|
225
|
-
status:
|
|
3050
|
+
status: o.status
|
|
226
3051
|
});
|
|
227
|
-
return
|
|
3052
|
+
return o.body.getReader();
|
|
228
3053
|
}
|
|
229
|
-
async processStreamData(
|
|
230
|
-
let
|
|
3054
|
+
async processStreamData(e, n) {
|
|
3055
|
+
let r = "";
|
|
231
3056
|
try {
|
|
232
3057
|
for (; ; ) {
|
|
233
|
-
const { done:
|
|
234
|
-
if (
|
|
235
|
-
|
|
3058
|
+
const { done: s, value: a } = await e.read();
|
|
3059
|
+
if (s) {
|
|
3060
|
+
r.trim() && this.parseSSEDataLine(r, n);
|
|
236
3061
|
break;
|
|
237
3062
|
}
|
|
238
|
-
const
|
|
239
|
-
|
|
240
|
-
const
|
|
3063
|
+
const o = this.decoder.decode(a, { stream: !0 });
|
|
3064
|
+
r += o;
|
|
3065
|
+
const i = r.split(`
|
|
241
3066
|
`);
|
|
242
|
-
|
|
243
|
-
for (const c of
|
|
3067
|
+
r = i.pop() || "";
|
|
3068
|
+
for (const c of i)
|
|
244
3069
|
this.parseSSEDataLine(c, n);
|
|
245
3070
|
}
|
|
246
3071
|
} finally {
|
|
247
|
-
|
|
3072
|
+
e.releaseLock();
|
|
248
3073
|
}
|
|
249
3074
|
}
|
|
250
|
-
handleStreamError(
|
|
251
|
-
const
|
|
252
|
-
throw n?.(
|
|
3075
|
+
handleStreamError(e, n) {
|
|
3076
|
+
const r = e instanceof Error ? e : new Error(String(e));
|
|
3077
|
+
throw n?.(r), r;
|
|
253
3078
|
}
|
|
254
|
-
parseSSEDataLine(
|
|
255
|
-
const
|
|
256
|
-
if (!(!
|
|
257
|
-
const
|
|
258
|
-
if (
|
|
3079
|
+
parseSSEDataLine(e, n) {
|
|
3080
|
+
const r = e.trim();
|
|
3081
|
+
if (!(!r || r.startsWith(":")) && r.startsWith("data: ")) {
|
|
3082
|
+
const s = r.slice(6);
|
|
3083
|
+
if (s === "[DONE]") {
|
|
259
3084
|
console.info("SSE: Stream completed");
|
|
260
3085
|
return;
|
|
261
3086
|
}
|
|
262
|
-
let
|
|
3087
|
+
let a;
|
|
263
3088
|
try {
|
|
264
|
-
|
|
265
|
-
} catch (
|
|
266
|
-
console.error(`Failed to parse SSE data: ${
|
|
3089
|
+
a = JSON.parse(s);
|
|
3090
|
+
} catch (o) {
|
|
3091
|
+
console.error(`Failed to parse SSE data: ${s} ${o}`);
|
|
267
3092
|
}
|
|
268
|
-
n?.(
|
|
3093
|
+
n?.(a);
|
|
269
3094
|
}
|
|
270
3095
|
}
|
|
271
3096
|
}
|
|
272
|
-
new
|
|
273
|
-
class
|
|
274
|
-
constructor(
|
|
275
|
-
this.config =
|
|
276
|
-
apiUrl:
|
|
3097
|
+
new us();
|
|
3098
|
+
class $a {
|
|
3099
|
+
constructor(e) {
|
|
3100
|
+
this.config = e, console.info("SdmxApiClient initialized", {
|
|
3101
|
+
apiUrl: e.apiUrl || "NOT SET"
|
|
277
3102
|
});
|
|
278
3103
|
}
|
|
279
|
-
async getRequest(
|
|
280
|
-
return this.request(
|
|
3104
|
+
async getRequest(e, n) {
|
|
3105
|
+
return this.request(e, { ...n, method: "GET" });
|
|
281
3106
|
}
|
|
282
|
-
async postRequest(
|
|
283
|
-
return this.request(
|
|
3107
|
+
async postRequest(e, n, r) {
|
|
3108
|
+
return this.request(e, { ...n, method: "POST" }, r);
|
|
284
3109
|
}
|
|
285
|
-
async streamRequest(
|
|
286
|
-
const
|
|
287
|
-
...
|
|
3110
|
+
async streamRequest(e, n, r) {
|
|
3111
|
+
const s = `${this.config.apiUrl}/${e}`, a = {
|
|
3112
|
+
...oe(void 0, {
|
|
288
3113
|
jwt: this.config.jwt
|
|
289
3114
|
}),
|
|
290
3115
|
...n.headers
|
|
291
3116
|
};
|
|
292
|
-
this.config.apiKey != null && (
|
|
293
|
-
const
|
|
3117
|
+
this.config.apiKey != null && (a[j] = this.config.apiKey);
|
|
3118
|
+
const o = new ReadableStream({
|
|
294
3119
|
async start(c) {
|
|
295
3120
|
try {
|
|
296
|
-
const u = await
|
|
3121
|
+
const u = await qe(s, a, n);
|
|
297
3122
|
if (!u.ok) {
|
|
298
|
-
const
|
|
3123
|
+
const x = await u.text();
|
|
299
3124
|
throw console.error(
|
|
300
|
-
`Fetch failed! Status: ${u.status}, Body: ${
|
|
3125
|
+
`Fetch failed! Status: ${u.status}, Body: ${x}`
|
|
301
3126
|
), new Error(`Fetch failed with status ${u.status}`);
|
|
302
3127
|
}
|
|
303
3128
|
const d = u.body?.getReader();
|
|
304
3129
|
if (!d) throw new Error("Failed to create stream reader");
|
|
305
3130
|
const l = new Uint8Array([239, 187, 191]);
|
|
306
3131
|
c.enqueue(l);
|
|
307
|
-
const
|
|
308
|
-
const { done:
|
|
309
|
-
|
|
3132
|
+
const g = async () => {
|
|
3133
|
+
const { done: x, value: P } = await d.read();
|
|
3134
|
+
x ? c.close() : (c.enqueue(P), await g());
|
|
310
3135
|
};
|
|
311
|
-
|
|
3136
|
+
g();
|
|
312
3137
|
} catch (u) {
|
|
313
3138
|
c.error(u);
|
|
314
3139
|
}
|
|
315
3140
|
}
|
|
316
|
-
}),
|
|
317
|
-
"Content-Disposition": `attachment; filename=${encodeURIComponent(
|
|
3141
|
+
}), i = new Headers({
|
|
3142
|
+
"Content-Disposition": `attachment; filename=${encodeURIComponent(r)}`
|
|
318
3143
|
});
|
|
319
|
-
return new Response(
|
|
3144
|
+
return new Response(o, { headers: i });
|
|
320
3145
|
}
|
|
321
|
-
async request(
|
|
322
|
-
const
|
|
323
|
-
...
|
|
3146
|
+
async request(e, n, r) {
|
|
3147
|
+
const s = Date.now(), a = `${r || this.config.apiUrl}/${e}`, o = {
|
|
3148
|
+
...oe(void 0, {
|
|
324
3149
|
jwt: this.config.jwt
|
|
325
3150
|
}),
|
|
326
3151
|
...n.headers
|
|
327
3152
|
};
|
|
328
|
-
this.config.apiKey != null && (
|
|
3153
|
+
this.config.apiKey != null && (o["Ocp-Apim-Subscription-Key"] = this.config.apiKey), this.addInfoRequestLog("API Request", a, n, o);
|
|
329
3154
|
try {
|
|
330
|
-
const
|
|
3155
|
+
const i = await qe(a, o, n), c = Date.now() - s;
|
|
331
3156
|
let u;
|
|
332
|
-
const d = await
|
|
3157
|
+
const d = await i.text();
|
|
333
3158
|
try {
|
|
334
3159
|
u = d ? JSON.parse(d) : {};
|
|
335
3160
|
} catch {
|
|
336
3161
|
if (this.addErrorRequestParsing(
|
|
337
|
-
o,
|
|
338
|
-
n,
|
|
339
3162
|
a,
|
|
3163
|
+
n,
|
|
3164
|
+
i,
|
|
340
3165
|
c,
|
|
341
3166
|
d
|
|
342
|
-
), !
|
|
3167
|
+
), !i.ok)
|
|
343
3168
|
throw new Error(
|
|
344
|
-
`API request failed: ${
|
|
3169
|
+
`API request failed: ${i.status} ${i.statusText} - ${d.substring(0, 100)}`
|
|
345
3170
|
);
|
|
346
3171
|
u = { data: d };
|
|
347
3172
|
}
|
|
348
|
-
if (!
|
|
349
|
-
this.addErrorRequestLog(
|
|
350
|
-
const l =
|
|
3173
|
+
if (!i.ok) {
|
|
3174
|
+
this.addErrorRequestLog(a, n, i, c, u);
|
|
3175
|
+
const l = Qt(u, i);
|
|
351
3176
|
throw new Error(`API request failed: ${l}`);
|
|
352
3177
|
}
|
|
353
3178
|
return u;
|
|
354
|
-
} catch (
|
|
355
|
-
const c = Date.now() -
|
|
3179
|
+
} catch (i) {
|
|
3180
|
+
const c = Date.now() - s;
|
|
356
3181
|
throw console.error("API Request Exception", {
|
|
357
3182
|
method: n.method,
|
|
358
|
-
url:
|
|
3183
|
+
url: a,
|
|
359
3184
|
duration: `${c}ms`,
|
|
360
|
-
error:
|
|
361
|
-
}),
|
|
3185
|
+
error: i instanceof Error ? i.message : String(i)
|
|
3186
|
+
}), i;
|
|
362
3187
|
}
|
|
363
3188
|
}
|
|
364
|
-
addInfoRequestLog(
|
|
365
|
-
const
|
|
366
|
-
method:
|
|
3189
|
+
addInfoRequestLog(e, n, r, s) {
|
|
3190
|
+
const a = {
|
|
3191
|
+
method: r.method || "GET",
|
|
367
3192
|
url: n,
|
|
368
|
-
headers:
|
|
3193
|
+
headers: is(s)
|
|
369
3194
|
};
|
|
370
|
-
|
|
3195
|
+
r.body && (a.body = r.body), console.info(e, a);
|
|
371
3196
|
}
|
|
372
|
-
addErrorRequestLog(
|
|
3197
|
+
addErrorRequestLog(e, n, r, s, a) {
|
|
373
3198
|
console.error("API Request Failed", {
|
|
374
3199
|
method: n.method,
|
|
375
|
-
url:
|
|
376
|
-
status:
|
|
377
|
-
statusText:
|
|
378
|
-
duration: `${
|
|
379
|
-
response:
|
|
3200
|
+
url: e,
|
|
3201
|
+
status: r.status,
|
|
3202
|
+
statusText: r.statusText,
|
|
3203
|
+
duration: `${s}ms`,
|
|
3204
|
+
response: a
|
|
380
3205
|
});
|
|
381
3206
|
}
|
|
382
|
-
addErrorRequestParsing(
|
|
3207
|
+
addErrorRequestParsing(e, n, r, s, a) {
|
|
383
3208
|
console.error("API Response Parse Error", {
|
|
384
3209
|
method: n.method,
|
|
385
|
-
url:
|
|
386
|
-
status:
|
|
387
|
-
statusText:
|
|
388
|
-
duration: `${
|
|
389
|
-
responseText:
|
|
3210
|
+
url: e,
|
|
3211
|
+
status: r.status,
|
|
3212
|
+
statusText: r.statusText,
|
|
3213
|
+
duration: `${s}ms`,
|
|
3214
|
+
responseText: a.substring(0, 200),
|
|
390
3215
|
error: "Response is not valid JSON"
|
|
391
3216
|
});
|
|
392
3217
|
}
|
|
393
3218
|
}
|
|
394
|
-
const
|
|
395
|
-
var
|
|
396
|
-
const
|
|
397
|
-
const n =
|
|
398
|
-
for (const
|
|
399
|
-
const c =
|
|
400
|
-
e,
|
|
3219
|
+
const qa = ["FREQ", "FREQUENCY"], ds = "TIME_PERIOD", ls = "time_period_start", fs = "time_period_end";
|
|
3220
|
+
var ms = /* @__PURE__ */ ((t) => (t.CONDITIONAL = "Conditional", t.MANDATORY = "Mandatory", t))(ms || {}), we = /* @__PURE__ */ ((t) => (t.DIMENSION = "Dimension", t.MEASURE_DIMENSION = "MeasureDimension", t.TIME_DIMENSION = "TimeDimension", t))(we || {}), hs = /* @__PURE__ */ ((t) => (t.UNBOUNDED = "unbounded", t))(hs || {});
|
|
3221
|
+
const ws = (t, e) => {
|
|
3222
|
+
const n = t?.data?.dataSets?.[0], s = t?.data?.structures?.[0]?.attributes?.dimensionGroup || [], a = n?.dimensionGroupAttributes, o = {};
|
|
3223
|
+
for (const i of s) {
|
|
3224
|
+
const c = i.relationship.dimensions, { codedSeriesKey: u, decodedSeriesKey: d } = gt(
|
|
401
3225
|
t,
|
|
3226
|
+
e,
|
|
402
3227
|
c
|
|
403
3228
|
);
|
|
404
|
-
i
|
|
405
|
-
values:
|
|
3229
|
+
o[i.id] = {
|
|
3230
|
+
values: a?.[u] || [],
|
|
406
3231
|
decodedSeriesKey: d,
|
|
407
3232
|
codedSeriesKey: u
|
|
408
3233
|
};
|
|
409
3234
|
}
|
|
410
|
-
return
|
|
411
|
-
},
|
|
412
|
-
const
|
|
413
|
-
...
|
|
414
|
-
...
|
|
415
|
-
],
|
|
416
|
-
return n?.forEach((
|
|
417
|
-
const c =
|
|
3235
|
+
return o;
|
|
3236
|
+
}, gt = (t, e, n) => {
|
|
3237
|
+
const r = t?.data?.structures?.[0], s = [
|
|
3238
|
+
...r?.dimensions.series || [],
|
|
3239
|
+
...r?.dimensions.observation || []
|
|
3240
|
+
], a = new Array(s?.length), o = new Array(s?.length);
|
|
3241
|
+
return n?.forEach((i) => {
|
|
3242
|
+
const c = s?.findIndex((l) => l.id === i) || 0, u = e[c], d = s[c].values.findIndex(
|
|
418
3243
|
(l) => l.id === u || l.value === u
|
|
419
3244
|
) || 0;
|
|
420
|
-
|
|
3245
|
+
a[c] = d >= 0 ? d : u, o[c] = u;
|
|
421
3246
|
}), {
|
|
422
|
-
codedSeriesKey:
|
|
423
|
-
decodedSeriesKey:
|
|
3247
|
+
codedSeriesKey: a.join(":"),
|
|
3248
|
+
decodedSeriesKey: o.join(":")
|
|
424
3249
|
};
|
|
425
|
-
},
|
|
426
|
-
const
|
|
427
|
-
(l) => l.relationship.dimensions?.length === 1 && l.relationship.dimensions.includes(
|
|
428
|
-
),
|
|
429
|
-
...
|
|
430
|
-
...
|
|
431
|
-
], c =
|
|
3250
|
+
}, Qa = (t, e, n) => {
|
|
3251
|
+
const r = t?.data?.dataSets?.[0], s = t?.data?.structures?.[0], a = (s?.attributes?.dimensionGroup || []).filter(
|
|
3252
|
+
(l) => l.relationship.dimensions?.length === 1 && l.relationship.dimensions.includes(e || "")
|
|
3253
|
+
), o = r?.dimensionGroupAttributes, i = [
|
|
3254
|
+
...s?.dimensions.series || [],
|
|
3255
|
+
...s?.dimensions.observation || []
|
|
3256
|
+
], c = i?.findIndex((l) => l.id === e), u = new Array(i?.length);
|
|
432
3257
|
u[c] = n || "";
|
|
433
3258
|
const d = {};
|
|
434
|
-
for (const l of
|
|
435
|
-
const
|
|
436
|
-
|
|
3259
|
+
for (const l of a) {
|
|
3260
|
+
const g = l.relationship.dimensions, { codedSeriesKey: x, decodedSeriesKey: P } = gt(
|
|
3261
|
+
t,
|
|
437
3262
|
u,
|
|
438
|
-
|
|
3263
|
+
g
|
|
439
3264
|
);
|
|
440
3265
|
d[l.id] = {
|
|
441
|
-
values:
|
|
442
|
-
decodedSeriesKey:
|
|
443
|
-
codedSeriesKey:
|
|
3266
|
+
values: o?.[x] || [],
|
|
3267
|
+
decodedSeriesKey: P,
|
|
3268
|
+
codedSeriesKey: x
|
|
444
3269
|
};
|
|
445
3270
|
}
|
|
446
3271
|
return d;
|
|
447
|
-
},
|
|
448
|
-
if (
|
|
3272
|
+
}, gs = (t, e) => {
|
|
3273
|
+
if (e == null)
|
|
449
3274
|
return;
|
|
450
|
-
const n =
|
|
451
|
-
return n ?? (
|
|
452
|
-
},
|
|
453
|
-
const
|
|
454
|
-
if (!
|
|
3275
|
+
const n = t.values?.[e];
|
|
3276
|
+
return n ?? (e instanceof Array ? { values: e } : { value: e.toString() });
|
|
3277
|
+
}, ps = "Observation", Fa = (t) => {
|
|
3278
|
+
const e = t?.data?.dataSets, n = t?.data?.structures?.[0];
|
|
3279
|
+
if (!e || !n)
|
|
455
3280
|
return [];
|
|
456
|
-
const
|
|
457
|
-
for (const u in
|
|
458
|
-
const d = [], { name: l, parsedTimeSeriesValue:
|
|
3281
|
+
const r = n.attributes, s = n.dimensions, a = r?.dimensionGroup || [], o = e[0].series || e[0].observations, i = s.series?.length ? s.series : s.observation, c = [];
|
|
3282
|
+
for (const u in o) {
|
|
3283
|
+
const d = [], { name: l, parsedTimeSeriesValue: g } = ys(
|
|
459
3284
|
u,
|
|
460
|
-
|
|
461
|
-
),
|
|
462
|
-
if (Object.keys(
|
|
3285
|
+
i
|
|
3286
|
+
), x = o[u], P = x.attributes || [];
|
|
3287
|
+
if (Object.keys(x).length === 0) {
|
|
463
3288
|
c.push({
|
|
464
3289
|
name: l,
|
|
465
|
-
parsedTimeSeriesValue:
|
|
3290
|
+
parsedTimeSeriesValue: g,
|
|
466
3291
|
values: d,
|
|
467
3292
|
attributes: [],
|
|
468
3293
|
dataSetAttrs: []
|
|
@@ -470,190 +3295,190 @@ const Je = (e, t) => {
|
|
|
470
3295
|
continue;
|
|
471
3296
|
}
|
|
472
3297
|
d.push(
|
|
473
|
-
...
|
|
3298
|
+
...Es(x, n)
|
|
474
3299
|
);
|
|
475
|
-
const
|
|
476
|
-
|
|
477
|
-
(
|
|
478
|
-
),
|
|
3300
|
+
const Y = ie(
|
|
3301
|
+
r?.series || [],
|
|
3302
|
+
(v) => P[v]
|
|
3303
|
+
), f = xs(
|
|
479
3304
|
n.attributes?.dataSet || [],
|
|
480
|
-
|
|
481
|
-
),
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
),
|
|
485
|
-
const
|
|
486
|
-
|
|
487
|
-
|
|
3305
|
+
e[0].attributes?.filter((v) => v != null) || []
|
|
3306
|
+
), w = ws(
|
|
3307
|
+
t,
|
|
3308
|
+
g
|
|
3309
|
+
), M = a.map((v, W) => {
|
|
3310
|
+
const $ = w[v.id], U = gs(
|
|
3311
|
+
v,
|
|
3312
|
+
$.values[W]
|
|
488
3313
|
);
|
|
489
3314
|
return {
|
|
490
|
-
attribute:
|
|
491
|
-
dimensionGroupValue:
|
|
492
|
-
dimensionGroupData:
|
|
3315
|
+
attribute: v,
|
|
3316
|
+
dimensionGroupValue: U,
|
|
3317
|
+
dimensionGroupData: $
|
|
493
3318
|
};
|
|
494
3319
|
});
|
|
495
3320
|
c.push({
|
|
496
3321
|
name: l,
|
|
497
|
-
parsedTimeSeriesValue:
|
|
3322
|
+
parsedTimeSeriesValue: g,
|
|
498
3323
|
values: d,
|
|
499
|
-
attributes:
|
|
500
|
-
dataSetAttrs:
|
|
501
|
-
dimensionGroupAttributes:
|
|
3324
|
+
attributes: Y,
|
|
3325
|
+
dataSetAttrs: f,
|
|
3326
|
+
dimensionGroupAttributes: M
|
|
502
3327
|
});
|
|
503
3328
|
}
|
|
504
3329
|
return c;
|
|
505
|
-
},
|
|
506
|
-
const n =
|
|
507
|
-
for (let
|
|
508
|
-
const
|
|
509
|
-
if (
|
|
3330
|
+
}, ys = (t, e) => {
|
|
3331
|
+
const n = t.split(new RegExp("(?<!\\|):(?!\\||$)")), r = [];
|
|
3332
|
+
for (let s = 0; s < n.length; s++) {
|
|
3333
|
+
const a = e?.[s], o = Number(n[s]);
|
|
3334
|
+
if (o < 0 || a == null)
|
|
510
3335
|
continue;
|
|
511
|
-
const
|
|
512
|
-
if (
|
|
513
|
-
|
|
3336
|
+
const i = a.values[o];
|
|
3337
|
+
if (i == null) {
|
|
3338
|
+
r.push(n[s].replace("|:", ":"));
|
|
514
3339
|
continue;
|
|
515
3340
|
}
|
|
516
|
-
|
|
3341
|
+
r.push(i?.id || i?.value || "");
|
|
517
3342
|
}
|
|
518
3343
|
return {
|
|
519
|
-
name:
|
|
520
|
-
parsedTimeSeriesValue:
|
|
3344
|
+
name: Ds(r),
|
|
3345
|
+
parsedTimeSeriesValue: r
|
|
521
3346
|
};
|
|
522
|
-
},
|
|
3347
|
+
}, ie = (t, e) => {
|
|
523
3348
|
const n = [];
|
|
524
|
-
for (let
|
|
525
|
-
const
|
|
3349
|
+
for (let r = 0; r < t.length; r++) {
|
|
3350
|
+
const s = t[r], a = e(r), o = a != null && s.values != null ? bs(a, s) : void 0;
|
|
526
3351
|
n.push({
|
|
527
|
-
name:
|
|
528
|
-
value:
|
|
3352
|
+
name: s.id,
|
|
3353
|
+
value: o
|
|
529
3354
|
});
|
|
530
3355
|
}
|
|
531
3356
|
return n;
|
|
532
|
-
},
|
|
533
|
-
const n =
|
|
534
|
-
return n == null ? typeof
|
|
535
|
-
},
|
|
536
|
-
const n =
|
|
537
|
-
if (
|
|
3357
|
+
}, bs = (t, e) => {
|
|
3358
|
+
const n = e.values[t];
|
|
3359
|
+
return n == null ? typeof t == "object" ? t : t.toString() : n?.id || n?.value || n?.ids || n?.values;
|
|
3360
|
+
}, Ds = (t) => t.map((e) => e ? Ts(e) : "").join("."), Ts = (t) => t.replace(/\./g, "|.").replace(/:/g, "|:"), Es = (t, e) => {
|
|
3361
|
+
const n = e.measures?.observation?.length;
|
|
3362
|
+
if (t.observations == null)
|
|
538
3363
|
return [
|
|
539
3364
|
{
|
|
540
|
-
values:
|
|
541
|
-
obsAttributes:
|
|
542
|
-
|
|
543
|
-
(
|
|
3365
|
+
values: Qe(t, e.measures),
|
|
3366
|
+
obsAttributes: ie(
|
|
3367
|
+
e.attributes?.observation || [],
|
|
3368
|
+
(o) => t[o + n]
|
|
544
3369
|
),
|
|
545
|
-
dimensionAtObservation:
|
|
3370
|
+
dimensionAtObservation: ps
|
|
546
3371
|
}
|
|
547
3372
|
];
|
|
548
|
-
const
|
|
549
|
-
for (const
|
|
550
|
-
const
|
|
551
|
-
|
|
552
|
-
dimensionAtObservation:
|
|
553
|
-
values:
|
|
554
|
-
|
|
555
|
-
|
|
3373
|
+
const r = t.observations, s = e.dimensions.observation?.[0], a = [];
|
|
3374
|
+
for (const o in r) {
|
|
3375
|
+
const i = s?.values[o];
|
|
3376
|
+
a.push({
|
|
3377
|
+
dimensionAtObservation: i?.value || i?.id,
|
|
3378
|
+
values: Qe(
|
|
3379
|
+
r[o],
|
|
3380
|
+
e.measures
|
|
556
3381
|
),
|
|
557
|
-
obsAttributes:
|
|
558
|
-
|
|
559
|
-
(c) =>
|
|
3382
|
+
obsAttributes: ie(
|
|
3383
|
+
e.attributes?.observation || [],
|
|
3384
|
+
(c) => r[o][c + n]
|
|
560
3385
|
)
|
|
561
3386
|
});
|
|
562
3387
|
}
|
|
563
|
-
return
|
|
564
|
-
},
|
|
565
|
-
(n,
|
|
566
|
-
const
|
|
567
|
-
return
|
|
3388
|
+
return a;
|
|
3389
|
+
}, Qe = (t, e) => e?.observation?.map((n, r) => ({ name: n.id, value: t[r] })) || [], xs = (t, e) => t.reduce(
|
|
3390
|
+
(n, r, s) => {
|
|
3391
|
+
const a = e[s];
|
|
3392
|
+
return Ps(n, r, a, ""), n;
|
|
568
3393
|
},
|
|
569
3394
|
[]
|
|
570
|
-
),
|
|
571
|
-
const
|
|
572
|
-
|
|
573
|
-
name:
|
|
574
|
-
value:
|
|
3395
|
+
), Ps = (t, e, n, r) => {
|
|
3396
|
+
const s = n != null ? e?.values?.length > 0 ? e.values[n]?.id || e.values[n]?.value : String(n) : r;
|
|
3397
|
+
t.push({
|
|
3398
|
+
name: e.id,
|
|
3399
|
+
value: s || ""
|
|
575
3400
|
});
|
|
576
|
-
},
|
|
577
|
-
function
|
|
578
|
-
const
|
|
3401
|
+
}, Ms = /^[0-9][0-9][0-9][0-9]-Q[1-4]$/, vs = /^[0-9][0-9][0-9][0-9]-W[0-9][0-9]?$/, Os = /^[0-9][0-9][0-9][0-9]-S[1-2]$/, As = /^[0-9][0-9][0-9][0-9]$/, Ns = /^[0-9][0-9][0-9][0-9]-(0[1-9]|1[0-2])-[0-9][0-9]$/, ks = /^[0-9][0-9][0-9][0-9]-M(0[1-9]|(1[0-2]))$/, ge = (t) => As.exec(t), pe = (t) => !!ge(t), Rs = (t) => Os.exec(t), ye = (t) => !!Rs(t), be = (t) => ks.exec(t), De = (t) => !!be(t), Te = (t) => Ms.exec(t), Ee = (t) => !!Te(t), _s = (t) => Ns.exec(t), Is = (t) => !!_s(t), Ys = (t) => vs.exec(t), xe = (t) => !!Ys(t), Pe = 1440 * 60 * 1e3, Me = 7 * Pe;
|
|
3402
|
+
function ve(t) {
|
|
3403
|
+
const e = `${t}-01-01`, n = new Date(e);
|
|
579
3404
|
if (n.getDay() !== 4) {
|
|
580
|
-
const
|
|
581
|
-
n.setMonth(0,
|
|
3405
|
+
const s = 1 + (4 - n.getDay() + 7) % 7;
|
|
3406
|
+
n.setMonth(0, s);
|
|
582
3407
|
}
|
|
583
3408
|
return n;
|
|
584
3409
|
}
|
|
585
|
-
function
|
|
586
|
-
const
|
|
587
|
-
return
|
|
3410
|
+
function Cs(t) {
|
|
3411
|
+
const e = new Date(t), r = -((e.getDay() + 6) % 7) + 3;
|
|
3412
|
+
return e.setDate(e.getDate() + r), new Date(e.valueOf());
|
|
588
3413
|
}
|
|
589
|
-
function
|
|
590
|
-
const n = `${
|
|
591
|
-
if (
|
|
592
|
-
return
|
|
593
|
-
const
|
|
594
|
-
return
|
|
3414
|
+
function Fe(t, e = "W") {
|
|
3415
|
+
const n = `${t}-12-31`, r = Z(new Date(n), e);
|
|
3416
|
+
if (r.weekYear === t)
|
|
3417
|
+
return r.weekNumber;
|
|
3418
|
+
const s = `${t}-12-24`;
|
|
3419
|
+
return Z(new Date(s), e).weekNumber;
|
|
595
3420
|
}
|
|
596
|
-
function
|
|
597
|
-
return `${
|
|
3421
|
+
function pt(t, e, n = "W") {
|
|
3422
|
+
return `${t}-${n}${e < 10 ? "0" + e : e}`;
|
|
598
3423
|
}
|
|
599
|
-
function
|
|
600
|
-
const n =
|
|
601
|
-
(n.getTime() -
|
|
3424
|
+
function Z(t, e = "W") {
|
|
3425
|
+
const n = Cs(t), r = n.getFullYear(), s = ve(r), a = 1 + Math.ceil(
|
|
3426
|
+
(n.getTime() - s.getTime()) / Me
|
|
602
3427
|
);
|
|
603
3428
|
return {
|
|
604
|
-
code:
|
|
605
|
-
weekNumber:
|
|
606
|
-
weekYear:
|
|
3429
|
+
code: pt(r, a, e),
|
|
3430
|
+
weekNumber: a,
|
|
3431
|
+
weekYear: r
|
|
607
3432
|
};
|
|
608
3433
|
}
|
|
609
|
-
function
|
|
610
|
-
const [
|
|
611
|
-
return new Date(
|
|
3434
|
+
function Ls(t) {
|
|
3435
|
+
const [e, n] = t.split("-W"), s = ve(+e).getTime() + (+n - 1) * Me - 3 * Pe;
|
|
3436
|
+
return new Date(s);
|
|
612
3437
|
}
|
|
613
|
-
function
|
|
614
|
-
const [
|
|
615
|
-
return new Date(
|
|
3438
|
+
function Ss(t) {
|
|
3439
|
+
const [e, n] = t.split("-W"), s = ve(+e).getTime() + (+n - 1) * Me + 3 * Pe;
|
|
3440
|
+
return new Date(s);
|
|
616
3441
|
}
|
|
617
|
-
function
|
|
618
|
-
return
|
|
3442
|
+
function yt(t) {
|
|
3443
|
+
return pe(t) ? Ws(t) : ye(t) ? qs(t) : Ee(t) ? Fs(t) : De(t) ? Us(t) : xe(t) ? Ls(t) : Gs(t);
|
|
619
3444
|
}
|
|
620
|
-
function
|
|
621
|
-
return
|
|
3445
|
+
function bt(t) {
|
|
3446
|
+
return pe(t) ? $s(t) : ye(t) ? Qs(t) : Ee(t) ? Hs(t) : De(t) ? Bs(t) : xe(t) ? Ss(t) : Vs(t);
|
|
622
3447
|
}
|
|
623
|
-
function
|
|
624
|
-
const
|
|
625
|
-
if (
|
|
626
|
-
return new Date(Number(
|
|
3448
|
+
function Ws(t) {
|
|
3449
|
+
const e = ge(t);
|
|
3450
|
+
if (e)
|
|
3451
|
+
return new Date(Number(e[0]), 0, 1);
|
|
627
3452
|
}
|
|
628
|
-
function
|
|
629
|
-
const
|
|
630
|
-
if (
|
|
631
|
-
return new Date(Number(
|
|
3453
|
+
function $s(t) {
|
|
3454
|
+
const e = ge(t);
|
|
3455
|
+
if (e)
|
|
3456
|
+
return new Date(Number(e[0]) + 1, 0, 1);
|
|
632
3457
|
}
|
|
633
|
-
function
|
|
634
|
-
const [
|
|
3458
|
+
function qs(t) {
|
|
3459
|
+
const [e, n] = t.split("-S");
|
|
635
3460
|
switch (+n) {
|
|
636
3461
|
case 1:
|
|
637
|
-
return new Date(+
|
|
3462
|
+
return new Date(+e, 0, 1);
|
|
638
3463
|
case 2:
|
|
639
|
-
return new Date(+
|
|
3464
|
+
return new Date(+e, 6, 1);
|
|
640
3465
|
}
|
|
641
3466
|
}
|
|
642
|
-
function
|
|
643
|
-
const [
|
|
3467
|
+
function Qs(t) {
|
|
3468
|
+
const [e, n] = t.split("-S");
|
|
644
3469
|
switch (+n) {
|
|
645
3470
|
case 1:
|
|
646
|
-
return new Date(+
|
|
3471
|
+
return new Date(+e, 6, 1);
|
|
647
3472
|
case 2:
|
|
648
|
-
return new Date(+
|
|
3473
|
+
return new Date(+e + 1, 0, 1);
|
|
649
3474
|
}
|
|
650
3475
|
}
|
|
651
|
-
function
|
|
652
|
-
const
|
|
653
|
-
if (!
|
|
3476
|
+
function Fs(t) {
|
|
3477
|
+
const e = Te(t);
|
|
3478
|
+
if (!e)
|
|
654
3479
|
return;
|
|
655
|
-
const [n,
|
|
656
|
-
switch (+
|
|
3480
|
+
const [n, r] = e[0].split("-Q");
|
|
3481
|
+
switch (+r) {
|
|
657
3482
|
case 1:
|
|
658
3483
|
return new Date(+n, 0, 1);
|
|
659
3484
|
case 2:
|
|
@@ -664,12 +3489,12 @@ function Rt(e) {
|
|
|
664
3489
|
return new Date(+n, 9, 1);
|
|
665
3490
|
}
|
|
666
3491
|
}
|
|
667
|
-
function
|
|
668
|
-
const
|
|
669
|
-
if (!
|
|
3492
|
+
function Hs(t) {
|
|
3493
|
+
const e = Te(t);
|
|
3494
|
+
if (!e)
|
|
670
3495
|
return;
|
|
671
|
-
const [n,
|
|
672
|
-
switch (+
|
|
3496
|
+
const [n, r] = e[0].split("-Q");
|
|
3497
|
+
switch (+r) {
|
|
673
3498
|
case 1:
|
|
674
3499
|
return new Date(+n, 3, 1);
|
|
675
3500
|
case 2:
|
|
@@ -680,579 +3505,585 @@ function wt(e) {
|
|
|
680
3505
|
return new Date(+n + 1, 0, 1);
|
|
681
3506
|
}
|
|
682
3507
|
}
|
|
683
|
-
function
|
|
684
|
-
const
|
|
685
|
-
if (!
|
|
3508
|
+
function Us(t) {
|
|
3509
|
+
const e = be(t);
|
|
3510
|
+
if (!e)
|
|
686
3511
|
return;
|
|
687
|
-
const [n,
|
|
688
|
-
return new Date(+n, +
|
|
3512
|
+
const [n, r] = e[0].split("-M");
|
|
3513
|
+
return new Date(+n, +r - 1, 1);
|
|
689
3514
|
}
|
|
690
|
-
function
|
|
691
|
-
const
|
|
692
|
-
if (!
|
|
3515
|
+
function Bs(t) {
|
|
3516
|
+
const e = be(t);
|
|
3517
|
+
if (!e)
|
|
693
3518
|
return;
|
|
694
|
-
const [n,
|
|
695
|
-
return new Date(+n, +
|
|
696
|
-
}
|
|
697
|
-
const
|
|
698
|
-
const
|
|
699
|
-
return
|
|
700
|
-
},
|
|
701
|
-
const
|
|
702
|
-
for (let c =
|
|
703
|
-
|
|
704
|
-
return
|
|
705
|
-
},
|
|
706
|
-
const r = [];
|
|
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") => {
|
|
3519
|
+
const [n, r] = e[0].split("-M");
|
|
3520
|
+
return new Date(+n, +r, 1);
|
|
3521
|
+
}
|
|
3522
|
+
const Gs = (t) => /* @__PURE__ */ new Date(`${t}T00:00:00`), Vs = (t) => {
|
|
3523
|
+
const e = /* @__PURE__ */ new Date(`${t}T23:59:00`);
|
|
3524
|
+
return e.setMinutes(e.getMinutes() + 1), e;
|
|
3525
|
+
}, Xs = 1, js = (t, e, n, r = !0, s = "Q") => {
|
|
3526
|
+
const a = [], o = e && e > 3 ? na(e, r) : 1, i = n ? Math.floor((n - 1) / 3) : 4;
|
|
3527
|
+
for (let c = o; c <= i; c++)
|
|
3528
|
+
a.push(`${t}-${s}${c}`);
|
|
3529
|
+
return a;
|
|
3530
|
+
}, Ks = (t, e, n, r = "S") => {
|
|
709
3531
|
const s = [];
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
return s;
|
|
713
|
-
}, Mt = (e, t, n, s = "M") => {
|
|
3532
|
+
return (e || 1) < 7 && (n || 12) > 6 && s.push(`${t}-${r}1`), n == null && s.push(`${t}-${r}2`), s;
|
|
3533
|
+
}, Ha = (t) => Math.ceil(t / 3), Dt = (t, e, n = "M") => `${t}-${n}${e.toString().padStart(2, "0")}`, zs = (t, e, n = "M") => {
|
|
714
3534
|
const r = [];
|
|
715
|
-
for (let
|
|
716
|
-
r.push(
|
|
3535
|
+
for (let s = e; s <= 12; s++)
|
|
3536
|
+
r.push(Dt(t, s, n));
|
|
717
3537
|
return r;
|
|
718
|
-
},
|
|
719
|
-
const
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
3538
|
+
}, Js = (t, e, n, r = "M") => {
|
|
3539
|
+
const s = [];
|
|
3540
|
+
for (let a = e; a < n; a++)
|
|
3541
|
+
s.push(Dt(t, a, r));
|
|
3542
|
+
return s;
|
|
3543
|
+
}, Zs = (t, e, n, r = "M") => {
|
|
3544
|
+
const s = e || 1, a = n == null, o = n || 12;
|
|
3545
|
+
return a ? zs(t, s, r) : Js(t, s, o, r);
|
|
3546
|
+
}, Ua = (t, e, n = "M") => {
|
|
3547
|
+
switch (e) {
|
|
723
3548
|
case 0:
|
|
724
3549
|
return [
|
|
725
|
-
`${
|
|
726
|
-
`${
|
|
727
|
-
`${
|
|
3550
|
+
`${t}-${n}01`,
|
|
3551
|
+
`${t}-${n}02`,
|
|
3552
|
+
`${t}-${n}03`
|
|
728
3553
|
];
|
|
729
3554
|
case 1:
|
|
730
3555
|
return [
|
|
731
|
-
`${
|
|
732
|
-
`${
|
|
733
|
-
`${
|
|
3556
|
+
`${t}-${n}04`,
|
|
3557
|
+
`${t}-${n}05`,
|
|
3558
|
+
`${t}-${n}06`
|
|
734
3559
|
];
|
|
735
3560
|
case 2:
|
|
736
3561
|
return [
|
|
737
|
-
`${
|
|
738
|
-
`${
|
|
739
|
-
`${
|
|
3562
|
+
`${t}-${n}07`,
|
|
3563
|
+
`${t}-${n}08`,
|
|
3564
|
+
`${t}-${n}09`
|
|
740
3565
|
];
|
|
741
3566
|
case 3:
|
|
742
3567
|
return [
|
|
743
|
-
`${
|
|
744
|
-
`${
|
|
745
|
-
`${
|
|
3568
|
+
`${t}-${n}10`,
|
|
3569
|
+
`${t}-${n}11`,
|
|
3570
|
+
`${t}-${n}12`
|
|
746
3571
|
];
|
|
747
3572
|
default:
|
|
748
3573
|
return [];
|
|
749
3574
|
}
|
|
750
|
-
},
|
|
751
|
-
const n =
|
|
752
|
-
return Array.from({ length:
|
|
753
|
-
},
|
|
754
|
-
const n =
|
|
3575
|
+
}, ea = (t, e) => {
|
|
3576
|
+
const n = k(e, !0), r = k(t), s = n.getFullYear(), a = r.getFullYear(), o = n.getTime() <= r.getTime() ? a + Xs - s : 0;
|
|
3577
|
+
return Array.from({ length: o }, (c, u) => s + u);
|
|
3578
|
+
}, k = (t, e = !1) => {
|
|
3579
|
+
const n = ta(t, e);
|
|
755
3580
|
return n ? (n.getTimezoneOffset() > 0 && n.setMinutes(n.getMinutes() + n.getTimezoneOffset()), n) : /* @__PURE__ */ new Date();
|
|
756
|
-
},
|
|
757
|
-
const n = Number(
|
|
758
|
-
return
|
|
759
|
-
},
|
|
760
|
-
const n =
|
|
761
|
-
if (n === 0 &&
|
|
762
|
-
const
|
|
763
|
-
return
|
|
3581
|
+
}, ta = (t, e = !1) => {
|
|
3582
|
+
const n = Number(t);
|
|
3583
|
+
return t.toString().length !== 13 ? e ? yt(t) : bt(t) : isNaN(n) ? /* @__PURE__ */ new Date(`${t}T00:00:00.000Z`) : new Date(n);
|
|
3584
|
+
}, na = (t, e) => e ? Math.floor((t + 1) / 3) : Math.ceil((t + 1) / 3), Ba = (t, e) => {
|
|
3585
|
+
const n = Ue(t) - Ue(e);
|
|
3586
|
+
if (n === 0 && t !== e) {
|
|
3587
|
+
const r = He(t), s = He(e);
|
|
3588
|
+
return r - s;
|
|
764
3589
|
}
|
|
765
3590
|
return n;
|
|
766
|
-
},
|
|
767
|
-
var
|
|
768
|
-
function
|
|
769
|
-
return
|
|
770
|
-
if (
|
|
771
|
-
return
|
|
3591
|
+
}, He = (t) => pe(t) ? 6 : ye(t) ? 5 : Ee(t) ? 4 : De(t) ? 3 : xe(t) ? 2 : Is(t) ? 1 : 0, Ue = (t, e = !1) => (e ? yt(t) : bt(t))?.getTime() || 0;
|
|
3592
|
+
var Oe = /* @__PURE__ */ ((t) => (t.LAST_UPDATE_AT = "lastUpdatedAt", t.SERIES_COUNT = "series_count", t))(Oe || {}), ra = /* @__PURE__ */ ((t) => (t.C = "c", t))(ra || {}), R = /* @__PURE__ */ ((t) => (t.EQUALS = "eq", t.NOT_EQUALS = "ne", t.LESS = "lt", t.LESS_OR_EQUAL = "le", t.GREATER = "gt", t.GREATER_OR_EQUAL = "ge", t.CONTAINS = "co", t.NOT_CONTAINS = "nc", t.STARTS = "sw", t.ENDS = "ew", t))(R || {}), sa = /* @__PURE__ */ ((t) => (t.BOOLEAN = "Boolean", t.DATE_TIME = "DateTime", t.DECIMAL = "Decimal", t.INTEGER = "Integer", t.OBSERVATION_TIME_PERIOD = "ObservationalTimePeriod", t.STRING = "String", t.TIME = "Time", t.TIME_RANGE = "TimeRange", t.URI = "URI", t))(sa || {}), aa = /* @__PURE__ */ ((t) => (t.ANNUAL = "A", t.QUARTERLY = "Q", t.MONTHLY = "M", t))(aa || {});
|
|
3593
|
+
function Ga(t) {
|
|
3594
|
+
return t?.annotations?.find((e) => {
|
|
3595
|
+
if (e.id === Oe.LAST_UPDATE_AT)
|
|
3596
|
+
return e;
|
|
772
3597
|
})?.value;
|
|
773
3598
|
}
|
|
774
|
-
const
|
|
775
|
-
if (!(!
|
|
776
|
-
const
|
|
777
|
-
|
|
3599
|
+
const Ae = (t, e) => t?.names && t?.names[e] || t?.name, Tt = (t, e, n) => {
|
|
3600
|
+
if (!(!t || e?.has(t?.id)) && (e?.set(t?.id, t), t?.parent)) {
|
|
3601
|
+
const r = n?.get(t?.parent);
|
|
3602
|
+
Tt(r, e, n);
|
|
778
3603
|
}
|
|
779
|
-
},
|
|
780
|
-
const n = /* @__PURE__ */ new Map(),
|
|
781
|
-
return
|
|
782
|
-
|
|
3604
|
+
}, oa = (t, e) => {
|
|
3605
|
+
const n = /* @__PURE__ */ new Map(), r = new Map(t?.map((s) => [s.id, s]));
|
|
3606
|
+
return e?.forEach((s) => {
|
|
3607
|
+
Tt(s, n, r);
|
|
783
3608
|
}), Array.from(n?.values());
|
|
784
|
-
},
|
|
785
|
-
const
|
|
786
|
-
(
|
|
787
|
-
), n =
|
|
788
|
-
(
|
|
789
|
-
),
|
|
3609
|
+
}, Va = (t) => {
|
|
3610
|
+
const e = t?.find(
|
|
3611
|
+
(a) => a.id === ls
|
|
3612
|
+
), n = t?.find(
|
|
3613
|
+
(a) => a.id === fs
|
|
3614
|
+
), r = n?.title ? new Date(n?.title) : null;
|
|
790
3615
|
return {
|
|
791
|
-
startPeriod:
|
|
792
|
-
endPeriod:
|
|
3616
|
+
startPeriod: e?.title ? new Date(e?.title) : null,
|
|
3617
|
+
endPeriod: r
|
|
793
3618
|
};
|
|
794
|
-
},
|
|
795
|
-
const n = new Array(
|
|
796
|
-
|
|
797
|
-
(
|
|
3619
|
+
}, ia = (t, e) => t.id.localeCompare(e.id), ca = (t, e) => t.memberValue.localeCompare(e.memberValue), ua = (t, e) => {
|
|
3620
|
+
const n = new Array(t.length), r = t.map((o, i) => [o, i]);
|
|
3621
|
+
r.sort(
|
|
3622
|
+
(o, i) => ia(o[0], i[0])
|
|
798
3623
|
);
|
|
799
|
-
const
|
|
800
|
-
|
|
801
|
-
let
|
|
802
|
-
for (const
|
|
803
|
-
const
|
|
804
|
-
for (;
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
}
|
|
808
|
-
return n.filter((
|
|
809
|
-
},
|
|
810
|
-
let
|
|
811
|
-
if (
|
|
812
|
-
const
|
|
813
|
-
({ isIncluded:
|
|
3624
|
+
const s = [...e];
|
|
3625
|
+
s.sort(ca);
|
|
3626
|
+
let a = 0;
|
|
3627
|
+
for (const o of r) {
|
|
3628
|
+
const i = o[0];
|
|
3629
|
+
for (; a < s.length && s[a].memberValue.localeCompare(i.id) < 0; )
|
|
3630
|
+
a += 1;
|
|
3631
|
+
a < s.length && s[a].memberValue === i.id && (n[o[1]] = o[0]);
|
|
3632
|
+
}
|
|
3633
|
+
return n.filter((o) => o != null);
|
|
3634
|
+
}, da = (t) => !!t?.some((e) => e.parent), Xa = (t, e, n, r, s = []) => {
|
|
3635
|
+
let a = t || [];
|
|
3636
|
+
if (la(n || [], e || "")) {
|
|
3637
|
+
const o = (n || [])[0].cubeRegions?.find(
|
|
3638
|
+
({ isIncluded: i }) => i
|
|
814
3639
|
);
|
|
815
|
-
if (
|
|
816
|
-
const
|
|
817
|
-
({ componentId: c }) => c ===
|
|
3640
|
+
if (o) {
|
|
3641
|
+
const i = o.memberSelection?.find(
|
|
3642
|
+
({ componentId: c }) => c === e
|
|
818
3643
|
);
|
|
819
|
-
|
|
3644
|
+
i ? a = a.length === 0 ? (i.selectionValues || []).map(({ memberValue: c }) => ({
|
|
820
3645
|
id: c,
|
|
821
3646
|
name: c
|
|
822
|
-
})) :
|
|
3647
|
+
})) : ua(a, i.selectionValues) : a = [];
|
|
823
3648
|
}
|
|
824
|
-
} else
|
|
825
|
-
return
|
|
826
|
-
...
|
|
827
|
-
name:
|
|
3649
|
+
} else s.length !== 0 && (a = a.filter(({ id: o }) => s.includes(o)));
|
|
3650
|
+
return da(t) && (a = oa(t, a)), a?.map((o) => ({
|
|
3651
|
+
...o,
|
|
3652
|
+
name: r ? Ae(o, r) : o?.name
|
|
828
3653
|
}));
|
|
829
|
-
},
|
|
830
|
-
const
|
|
831
|
-
return
|
|
832
|
-
n.componentCode !==
|
|
3654
|
+
}, la = (t, e) => t != null && t.length > 0 && e != null, fa = (t) => {
|
|
3655
|
+
const e = [];
|
|
3656
|
+
return t?.filters?.forEach((n) => {
|
|
3657
|
+
n.componentCode !== ds && e.push({
|
|
833
3658
|
componentCode: n.componentCode,
|
|
834
|
-
operator:
|
|
3659
|
+
operator: R.EQUALS,
|
|
835
3660
|
value: n.values.join(",")
|
|
836
3661
|
});
|
|
837
|
-
}),
|
|
838
|
-
},
|
|
839
|
-
|
|
3662
|
+
}), e;
|
|
3663
|
+
}, ja = (t) => {
|
|
3664
|
+
const e = /* @__PURE__ */ new Map();
|
|
3665
|
+
return t?.forEach((n) => {
|
|
3666
|
+
e.set(n.urn, fa(n));
|
|
3667
|
+
}), e;
|
|
3668
|
+
}, ma = /^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i, Be = (t) => {
|
|
3669
|
+
if (typeof t != "string")
|
|
840
3670
|
throw new TypeError("Invalid argument expected string");
|
|
841
|
-
const
|
|
842
|
-
if (!
|
|
843
|
-
throw new Error(`Invalid argument not valid semver ('${
|
|
844
|
-
return
|
|
845
|
-
},
|
|
846
|
-
const
|
|
847
|
-
return isNaN(
|
|
848
|
-
},
|
|
849
|
-
if (
|
|
3671
|
+
const e = t.match(ma);
|
|
3672
|
+
if (!e)
|
|
3673
|
+
throw new Error(`Invalid argument not valid semver ('${t}' received)`);
|
|
3674
|
+
return e.shift(), e;
|
|
3675
|
+
}, Ge = (t) => t === "*" || t === "x" || t === "X", Ve = (t) => {
|
|
3676
|
+
const e = parseInt(t, 10);
|
|
3677
|
+
return isNaN(e) ? t : e;
|
|
3678
|
+
}, ha = (t, e) => typeof t != typeof e ? [String(t), String(e)] : [t, e], wa = (t, e) => {
|
|
3679
|
+
if (Ge(t) || Ge(e))
|
|
850
3680
|
return 0;
|
|
851
|
-
const [n,
|
|
852
|
-
return n >
|
|
853
|
-
},
|
|
854
|
-
for (let n = 0; n < Math.max(
|
|
855
|
-
const
|
|
856
|
-
if (
|
|
857
|
-
return
|
|
3681
|
+
const [n, r] = ha(Ve(t), Ve(e));
|
|
3682
|
+
return n > r ? 1 : n < r ? -1 : 0;
|
|
3683
|
+
}, Xe = (t, e) => {
|
|
3684
|
+
for (let n = 0; n < Math.max(t.length, e.length); n++) {
|
|
3685
|
+
const r = wa(t[n] || "0", e[n] || "0");
|
|
3686
|
+
if (r !== 0)
|
|
3687
|
+
return r;
|
|
858
3688
|
}
|
|
859
3689
|
return 0;
|
|
860
|
-
},
|
|
861
|
-
const n =
|
|
862
|
-
return
|
|
863
|
-
},
|
|
864
|
-
|
|
865
|
-
const
|
|
866
|
-
return
|
|
867
|
-
},
|
|
3690
|
+
}, ga = (t, e) => {
|
|
3691
|
+
const n = Be(t), r = Be(e), s = n.pop(), a = r.pop(), o = Xe(n, r);
|
|
3692
|
+
return o !== 0 ? o : s && a ? Xe(s.split("."), a.split(".")) : s || a ? s ? -1 : 1 : 0;
|
|
3693
|
+
}, pa = (t, e, n) => {
|
|
3694
|
+
ya(n);
|
|
3695
|
+
const r = ga(t, e);
|
|
3696
|
+
return Et[n].includes(r);
|
|
3697
|
+
}, Et = {
|
|
868
3698
|
">": [1],
|
|
869
3699
|
">=": [0, 1],
|
|
870
3700
|
"=": [0],
|
|
871
3701
|
"<=": [-1, 0],
|
|
872
3702
|
"<": [-1],
|
|
873
3703
|
"!=": [-1, 1]
|
|
874
|
-
},
|
|
875
|
-
if (
|
|
876
|
-
throw new Error(`Invalid operator, expected one of ${
|
|
877
|
-
},
|
|
878
|
-
const { agency: n, id:
|
|
879
|
-
(c) => c.agencyID === n && c.id ===
|
|
3704
|
+
}, je = Object.keys(Et), ya = (t) => {
|
|
3705
|
+
if (je.indexOf(t) === -1)
|
|
3706
|
+
throw new Error(`Invalid operator, expected one of ${je.join("|")}`);
|
|
3707
|
+
}, ce = "+", Ne = (t, e) => {
|
|
3708
|
+
const { agency: n, id: r, version: s } = H(t), a = e.filter(
|
|
3709
|
+
(c) => c.agencyID === n && c.id === r && !c?.version?.includes(ce)
|
|
880
3710
|
);
|
|
881
|
-
if (
|
|
882
|
-
return
|
|
883
|
-
if (!
|
|
884
|
-
return
|
|
885
|
-
const
|
|
3711
|
+
if (a.length === 1)
|
|
3712
|
+
return a[0];
|
|
3713
|
+
if (!s?.includes(ce))
|
|
3714
|
+
return a.find((c) => c.version === s);
|
|
3715
|
+
const o = a.map(
|
|
886
3716
|
(c) => c.version
|
|
887
|
-
),
|
|
888
|
-
return
|
|
889
|
-
(c) => c.version ===
|
|
3717
|
+
), i = ba(s, o);
|
|
3718
|
+
return a.find(
|
|
3719
|
+
(c) => c.version === i[0]
|
|
890
3720
|
);
|
|
891
|
-
},
|
|
892
|
-
const n =
|
|
3721
|
+
}, ba = (t, e) => {
|
|
3722
|
+
const n = Da(t, e);
|
|
893
3723
|
return n.length > 0 ? [n[0]] : [];
|
|
894
|
-
},
|
|
3724
|
+
}, Da = (t, e) => {
|
|
895
3725
|
const n = [];
|
|
896
|
-
return
|
|
897
|
-
|
|
3726
|
+
return e.forEach((r) => {
|
|
3727
|
+
Ea(t, r) && n.push(r);
|
|
898
3728
|
}), n;
|
|
899
|
-
},
|
|
900
|
-
const
|
|
3729
|
+
}, Ta = (t) => {
|
|
3730
|
+
const e = t.trim().replace(/\d+\+/, "*"), [n] = e.split("*");
|
|
901
3731
|
return new RegExp(`^${n}`);
|
|
902
|
-
},
|
|
903
|
-
const n =
|
|
904
|
-
return
|
|
905
|
-
},
|
|
906
|
-
const { concept: n } =
|
|
3732
|
+
}, Ea = (t, e) => {
|
|
3733
|
+
const n = t.trim().replace(/\+/, "");
|
|
3734
|
+
return Ta(t).test(e) && pa(e, n, ">=");
|
|
3735
|
+
}, ke = (t, e) => {
|
|
3736
|
+
const { concept: n } = xa(t, e);
|
|
907
3737
|
return n;
|
|
908
|
-
},
|
|
909
|
-
if (
|
|
3738
|
+
}, xa = (t, e) => {
|
|
3739
|
+
if (t == null)
|
|
910
3740
|
return {
|
|
911
3741
|
concept: void 0,
|
|
912
3742
|
scheme: void 0
|
|
913
3743
|
};
|
|
914
|
-
const { childId: n, agency:
|
|
915
|
-
if (
|
|
916
|
-
const
|
|
917
|
-
|
|
918
|
-
|
|
3744
|
+
const { childId: n, agency: r, id: s, version: a } = Pt(t);
|
|
3745
|
+
if (a?.includes(ce)) {
|
|
3746
|
+
const o = Ne(
|
|
3747
|
+
t,
|
|
3748
|
+
e
|
|
919
3749
|
);
|
|
920
3750
|
return {
|
|
921
|
-
concept:
|
|
922
|
-
scheme:
|
|
3751
|
+
concept: Ke(o?.concepts || [], n),
|
|
3752
|
+
scheme: o
|
|
923
3753
|
};
|
|
924
3754
|
}
|
|
925
|
-
for (const
|
|
926
|
-
if (
|
|
3755
|
+
for (const o of e)
|
|
3756
|
+
if (Pa(o, s, r, a))
|
|
927
3757
|
return {
|
|
928
|
-
concept:
|
|
929
|
-
scheme:
|
|
3758
|
+
concept: Ke(o?.concepts || [], n),
|
|
3759
|
+
scheme: o
|
|
930
3760
|
};
|
|
931
3761
|
return {
|
|
932
3762
|
concept: void 0,
|
|
933
3763
|
scheme: void 0
|
|
934
3764
|
};
|
|
935
|
-
},
|
|
936
|
-
const
|
|
3765
|
+
}, Ke = (t, e) => t?.find((n) => n.id === e), Pa = (t, e, n, r) => t.id === e && t.agencyID === n && t.version === r, Ka = (t = [], e = [], n) => {
|
|
3766
|
+
const r = n?.conceptIdentity || "", s = ke(r, e), a = K(
|
|
937
3767
|
n?.localRepresentation?.enumeration
|
|
938
|
-
),
|
|
939
|
-
|
|
940
|
-
),
|
|
941
|
-
if (
|
|
942
|
-
return
|
|
943
|
-
},
|
|
944
|
-
const
|
|
945
|
-
(
|
|
3768
|
+
), o = K(
|
|
3769
|
+
s?.coreRepresentation?.enumeration
|
|
3770
|
+
), i = a || o;
|
|
3771
|
+
if (i != null)
|
|
3772
|
+
return Ne(i, t);
|
|
3773
|
+
}, za = (t, e, n, r) => {
|
|
3774
|
+
const s = e?.find(
|
|
3775
|
+
(a) => a?.id === t?.id
|
|
946
3776
|
)?.values;
|
|
947
|
-
return n?.filter((
|
|
948
|
-
...
|
|
949
|
-
name:
|
|
3777
|
+
return n?.filter((a) => s?.some((o) => o.id === a.id))?.map((a) => ({
|
|
3778
|
+
...a,
|
|
3779
|
+
name: r ? Ae(a, r) : a?.name
|
|
950
3780
|
})) || [];
|
|
951
|
-
},
|
|
952
|
-
const n =
|
|
953
|
-
return n?.metadataAttributeUsages?.map((
|
|
954
|
-
const
|
|
955
|
-
(
|
|
3781
|
+
}, Ma = (t, e) => {
|
|
3782
|
+
const n = e?.dataStructureComponents?.attributeList, r = t?.metadataStructureComponents?.metadataAttributeList;
|
|
3783
|
+
return n?.metadataAttributeUsages?.map((s) => {
|
|
3784
|
+
const a = r?.metadataAttributes?.find(
|
|
3785
|
+
(o) => o?.id === s?.metadataAttributeReference
|
|
956
3786
|
);
|
|
957
3787
|
return {
|
|
958
|
-
...
|
|
959
|
-
attributeRelationship:
|
|
960
|
-
isMandatory: Number(
|
|
3788
|
+
...a,
|
|
3789
|
+
attributeRelationship: s.attributeRelationship,
|
|
3790
|
+
isMandatory: Number(a?.minOccurs) > 0
|
|
961
3791
|
};
|
|
962
3792
|
});
|
|
963
|
-
},
|
|
964
|
-
const
|
|
965
|
-
return n ?
|
|
3793
|
+
}, Ja = (t = [], e, n) => {
|
|
3794
|
+
const r = K(e?.conceptIdentity) || "", s = ke(r, t);
|
|
3795
|
+
return n ? Ae(s, n) : s?.name ?? s?.id ?? e?.id;
|
|
966
3796
|
};
|
|
967
|
-
function
|
|
968
|
-
return
|
|
3797
|
+
function ze(t) {
|
|
3798
|
+
return t?.dataStructures?.[0]?.dataStructureComponents?.dimensionList;
|
|
969
3799
|
}
|
|
970
|
-
function
|
|
971
|
-
return
|
|
3800
|
+
function Za(t) {
|
|
3801
|
+
return t?.data?.structures?.[0]?.dimensions?.series || [];
|
|
972
3802
|
}
|
|
973
|
-
function
|
|
974
|
-
return
|
|
3803
|
+
function eo(t) {
|
|
3804
|
+
return t?.data?.structures?.[0]?.dimensions?.observation?.[0].values.map((e) => e.value).filter((e) => e != null) || [];
|
|
975
3805
|
}
|
|
976
|
-
function
|
|
977
|
-
return
|
|
978
|
-
(
|
|
3806
|
+
function to(t) {
|
|
3807
|
+
return t.find(
|
|
3808
|
+
(e) => e.type === we.TIME_DIMENSION
|
|
979
3809
|
);
|
|
980
3810
|
}
|
|
981
|
-
const
|
|
982
|
-
const
|
|
983
|
-
return
|
|
984
|
-
...
|
|
985
|
-
...
|
|
986
|
-
...
|
|
3811
|
+
const no = (t) => {
|
|
3812
|
+
const e = /* @__PURE__ */ new Map(), n = t?.dataStructures?.[0], r = t?.metadataStructures?.[0], s = t?.conceptSchemes || [], a = t?.codelists || [];
|
|
3813
|
+
return t && [
|
|
3814
|
+
...ze(t)?.dimensions || [],
|
|
3815
|
+
...ze(t)?.timeDimensions || [],
|
|
3816
|
+
...Ma(r, n),
|
|
987
3817
|
...n?.dataStructureComponents?.attributeList?.attributes || []
|
|
988
3818
|
].forEach(
|
|
989
|
-
(
|
|
990
|
-
const c =
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
), u =
|
|
3819
|
+
(i) => {
|
|
3820
|
+
const c = ke(
|
|
3821
|
+
i?.conceptIdentity,
|
|
3822
|
+
s
|
|
3823
|
+
), u = i?.localRepresentation?.enumeration || c?.coreRepresentation?.enumeration, d = Ne(
|
|
994
3824
|
u,
|
|
995
|
-
|
|
3825
|
+
a
|
|
996
3826
|
);
|
|
997
|
-
|
|
3827
|
+
i?.id && (u ? e.set(i?.id, {
|
|
998
3828
|
...d,
|
|
999
3829
|
name: c?.name,
|
|
1000
3830
|
names: c?.names
|
|
1001
|
-
}) :
|
|
1002
|
-
id:
|
|
3831
|
+
}) : e.set(i?.id, {
|
|
3832
|
+
id: i?.id,
|
|
1003
3833
|
name: c?.name,
|
|
1004
3834
|
names: c?.names
|
|
1005
3835
|
}));
|
|
1006
3836
|
}
|
|
1007
|
-
),
|
|
1008
|
-
},
|
|
1009
|
-
(
|
|
1010
|
-
)?.title || "",
|
|
1011
|
-
const
|
|
1012
|
-
urn:
|
|
1013
|
-
format:
|
|
3837
|
+
), e;
|
|
3838
|
+
}, ro = (t) => t?.find(
|
|
3839
|
+
(e) => e.id === Oe.SERIES_COUNT
|
|
3840
|
+
)?.title || "", va = "/api/download", so = (t, e, n, r, s, a, o) => {
|
|
3841
|
+
const i = new URLSearchParams({
|
|
3842
|
+
urn: t,
|
|
3843
|
+
format: e,
|
|
1014
3844
|
compress: "false",
|
|
1015
|
-
filename:
|
|
1016
|
-
filters: JSON.stringify(
|
|
1017
|
-
attribute:
|
|
3845
|
+
filename: a,
|
|
3846
|
+
filters: JSON.stringify(s),
|
|
3847
|
+
attribute: r,
|
|
1018
3848
|
language: n,
|
|
1019
|
-
isMetadata:
|
|
1020
|
-
}).toString(), c = `${
|
|
3849
|
+
isMetadata: o ? "true" : "none"
|
|
3850
|
+
}).toString(), c = `${va}?${i}`;
|
|
1021
3851
|
window.open(c, "_blank");
|
|
1022
|
-
},
|
|
3852
|
+
}, ao = (t, e) => {
|
|
1023
3853
|
const n = [];
|
|
1024
|
-
for (const
|
|
1025
|
-
if (
|
|
3854
|
+
for (const r of t) {
|
|
3855
|
+
if (r.type !== we.DIMENSION)
|
|
1026
3856
|
continue;
|
|
1027
|
-
const
|
|
1028
|
-
|
|
3857
|
+
const s = e.find((a) => a.componentCode === r.id);
|
|
3858
|
+
s != null && s.values?.length > 0 ? n.push(s.values?.join(Wt)) : n.push("*");
|
|
1029
3859
|
}
|
|
1030
3860
|
return n.join(".");
|
|
1031
|
-
},
|
|
1032
|
-
if (!
|
|
3861
|
+
}, Oa = (t, e) => {
|
|
3862
|
+
if (!t || !t.startPeriod && !t.endPeriod)
|
|
1033
3863
|
return null;
|
|
1034
|
-
const n = [], { startPeriod:
|
|
1035
|
-
if (
|
|
1036
|
-
`${
|
|
1037
|
-
),
|
|
1038
|
-
`${
|
|
3864
|
+
const n = [], { startPeriod: r, endPeriod: s } = t;
|
|
3865
|
+
if (r && n.push(
|
|
3866
|
+
`${R.GREATER_OR_EQUAL}${Re}${Je(r)}`
|
|
3867
|
+
), s && n.push(
|
|
3868
|
+
`${R.LESS_OR_EQUAL}${Re}${Je(s)}`
|
|
1039
3869
|
), n.length === 0)
|
|
1040
3870
|
return null;
|
|
1041
|
-
const
|
|
3871
|
+
const a = e;
|
|
1042
3872
|
return n.map(
|
|
1043
|
-
(
|
|
1044
|
-
).join(
|
|
1045
|
-
},
|
|
1046
|
-
const n =
|
|
1047
|
-
return n ?
|
|
1048
|
-
},
|
|
1049
|
-
const n =
|
|
3873
|
+
(o) => `${encodeURIComponent(`c[${a}]`)}${St}${encodeURIComponent(o)}`
|
|
3874
|
+
).join(tt);
|
|
3875
|
+
}, Je = (t) => Un(t, "yyyy-MM-dd"), oo = (t, e) => {
|
|
3876
|
+
const n = Aa(t, e) || null;
|
|
3877
|
+
return n ? Oa(n, e?.id) : null;
|
|
3878
|
+
}, Aa = (t, e) => {
|
|
3879
|
+
const n = e.id, r = t?.filters?.find(
|
|
1050
3880
|
(c) => c.componentCode === n
|
|
1051
3881
|
);
|
|
1052
|
-
if (!
|
|
3882
|
+
if (!r || !r.values)
|
|
1053
3883
|
return null;
|
|
1054
|
-
const
|
|
1055
|
-
if (!
|
|
3884
|
+
const s = r.values?.filter((c) => !!c);
|
|
3885
|
+
if (!s.length)
|
|
1056
3886
|
return null;
|
|
1057
|
-
const
|
|
1058
|
-
if (
|
|
1059
|
-
return { startPeriod: null, endPeriod:
|
|
1060
|
-
if (
|
|
1061
|
-
return { startPeriod:
|
|
1062
|
-
const
|
|
1063
|
-
return { startPeriod:
|
|
1064
|
-
},
|
|
1065
|
-
const
|
|
3887
|
+
const a = r.operator;
|
|
3888
|
+
if (a === R.LESS_OR_EQUAL || a === R.LESS)
|
|
3889
|
+
return { startPeriod: null, endPeriod: V(s[0]) };
|
|
3890
|
+
if (a === R.GREATER_OR_EQUAL || a === R.GREATER)
|
|
3891
|
+
return { startPeriod: V(s[0]), endPeriod: null };
|
|
3892
|
+
const o = V(s[0]), i = V(s[1]);
|
|
3893
|
+
return { startPeriod: o, endPeriod: i };
|
|
3894
|
+
}, xt = (t, e, n) => {
|
|
3895
|
+
const r = k(e, !0), s = k(n), a = k(t, !0), o = k(t), i = r.getTime() > a.getTime() ? r : a, c = s.getTime() < o.getTime() ? s : o;
|
|
1066
3896
|
return {
|
|
1067
|
-
start:
|
|
3897
|
+
start: i,
|
|
1068
3898
|
end: c
|
|
1069
3899
|
};
|
|
1070
|
-
},
|
|
1071
|
-
const
|
|
1072
|
-
if (
|
|
3900
|
+
}, Na = (t, e, n, r = "W") => {
|
|
3901
|
+
const s = +t, { start: a, end: o } = xt(t, e, n);
|
|
3902
|
+
if (a.getTime() > o.getTime())
|
|
1073
3903
|
return [];
|
|
1074
|
-
const
|
|
3904
|
+
const i = Z(a, r), c = i.weekYear === s ? i.weekNumber : i.weekYear < s ? 1 : Fe(s, r), u = Z(o, r), d = u.weekYear === s ? u.weekNumber : u.weekYear > s ? Fe(s, r) : 1, l = [];
|
|
1075
3905
|
if (c < d)
|
|
1076
|
-
for (let
|
|
1077
|
-
l.push(
|
|
3906
|
+
for (let g = c; g <= d; g++)
|
|
3907
|
+
l.push(pt(s, g, r));
|
|
1078
3908
|
return l;
|
|
1079
|
-
},
|
|
1080
|
-
const
|
|
1081
|
-
return
|
|
1082
|
-
},
|
|
1083
|
-
const { start:
|
|
1084
|
-
if (
|
|
3909
|
+
}, ka = (t) => {
|
|
3910
|
+
const e = new Date(t);
|
|
3911
|
+
return e.setMinutes(e.getMinutes() - e.getTimezoneOffset()), e.toISOString().slice(0, 10);
|
|
3912
|
+
}, Ra = (t, e, n) => {
|
|
3913
|
+
const { start: r, end: s } = xt(t, e, n);
|
|
3914
|
+
if (r.getTime() > s.getTime())
|
|
1085
3915
|
return [];
|
|
1086
|
-
const
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
),
|
|
1091
|
-
for (;
|
|
1092
|
-
const c =
|
|
1093
|
-
|
|
3916
|
+
const a = [], o = new Date(
|
|
3917
|
+
r.getFullYear(),
|
|
3918
|
+
r.getMonth(),
|
|
3919
|
+
r.getDate()
|
|
3920
|
+
), i = new Date(s.getFullYear(), s.getMonth(), s.getDate());
|
|
3921
|
+
for (; o.getTime() < i.getTime(); ) {
|
|
3922
|
+
const c = ka(o);
|
|
3923
|
+
a.push(c), o.setDate(o.getDate() + 1);
|
|
1094
3924
|
}
|
|
1095
|
-
return
|
|
1096
|
-
},
|
|
1097
|
-
isDailyExist: !!
|
|
1098
|
-
isWeeklyExist: !!
|
|
1099
|
-
isMonthlyExist: !!
|
|
1100
|
-
isQuarterlyExist: !!
|
|
1101
|
-
isSemiAnnualExist: !!
|
|
1102
|
-
isYearlyExist: !!
|
|
1103
|
-
({ memberValue:
|
|
3925
|
+
return a;
|
|
3926
|
+
}, _a = (t) => ({
|
|
3927
|
+
isDailyExist: !!t?.some(({ memberValue: e }) => e === "D"),
|
|
3928
|
+
isWeeklyExist: !!t?.some(({ memberValue: e }) => e === "W"),
|
|
3929
|
+
isMonthlyExist: !!t?.some(({ memberValue: e }) => e === "M"),
|
|
3930
|
+
isQuarterlyExist: !!t?.some(({ memberValue: e }) => e === "Q"),
|
|
3931
|
+
isSemiAnnualExist: !!t?.some(({ memberValue: e }) => e === "S"),
|
|
3932
|
+
isYearlyExist: !!t?.some(
|
|
3933
|
+
({ memberValue: e }) => e === "A" || e === "Y"
|
|
1104
3934
|
)
|
|
1105
|
-
}),
|
|
1106
|
-
const
|
|
1107
|
-
return { startMonth:
|
|
1108
|
-
},
|
|
1109
|
-
const n =
|
|
1110
|
-
(c) =>
|
|
1111
|
-
)?.selectionValues,
|
|
1112
|
-
return
|
|
1113
|
-
const d = [], { startMonth: l, endMonth:
|
|
1114
|
-
|
|
1115
|
-
new Date(
|
|
1116
|
-
new Date(
|
|
3935
|
+
}), Ia = (t, e, n, r) => {
|
|
3936
|
+
const s = r === 0 ? k(e.toString(), !0)?.getMonth() + 1 : void 0, a = r === t.length - 1 ? k(n.toString())?.getMonth() + 1 || 1 : void 0;
|
|
3937
|
+
return { startMonth: s, endMonth: a };
|
|
3938
|
+
}, Ya = ["FREQUENCY", "FREQ"], io = (t, e) => {
|
|
3939
|
+
const n = t?.[0]?.cubeRegions?.[0]?.memberSelection?.find(
|
|
3940
|
+
(c) => Ya.includes(c.componentId)
|
|
3941
|
+
)?.selectionValues, r = _a(n || []), s = e?.startPeriod?.getTime() || 1, a = e?.endPeriod?.getTime() || 1, o = ea(a, s), i = [];
|
|
3942
|
+
return o.forEach((c, u) => {
|
|
3943
|
+
const d = [], { startMonth: l, endMonth: g } = Ia(
|
|
3944
|
+
o,
|
|
3945
|
+
new Date(s),
|
|
3946
|
+
new Date(a),
|
|
1117
3947
|
u
|
|
1118
3948
|
), {
|
|
1119
|
-
isDailyExist:
|
|
1120
|
-
isWeeklyExist:
|
|
1121
|
-
isMonthlyExist:
|
|
1122
|
-
isQuarterlyExist:
|
|
1123
|
-
isSemiAnnualExist:
|
|
1124
|
-
isYearlyExist:
|
|
1125
|
-
} =
|
|
1126
|
-
|
|
1127
|
-
...
|
|
1128
|
-
),
|
|
1129
|
-
...
|
|
1130
|
-
),
|
|
1131
|
-
...
|
|
1132
|
-
),
|
|
1133
|
-
}),
|
|
3949
|
+
isDailyExist: x,
|
|
3950
|
+
isWeeklyExist: P,
|
|
3951
|
+
isMonthlyExist: Y,
|
|
3952
|
+
isQuarterlyExist: f,
|
|
3953
|
+
isSemiAnnualExist: w,
|
|
3954
|
+
isYearlyExist: M
|
|
3955
|
+
} = r;
|
|
3956
|
+
M && d.push(c.toString()), w && d.push(...Ks(c, l, g)), f && d.push(
|
|
3957
|
+
...js(c, l, g, !1)
|
|
3958
|
+
), Y && d.push(...Zs(c, l, g)), P && d.push(
|
|
3959
|
+
...Na(c, s.toString(), a.toString())
|
|
3960
|
+
), x && d.push(
|
|
3961
|
+
...Ra(c, s.toString(), a.toString())
|
|
3962
|
+
), i.push(...d);
|
|
3963
|
+
}), i;
|
|
1134
3964
|
};
|
|
1135
|
-
function
|
|
1136
|
-
const { urn:
|
|
1137
|
-
return
|
|
3965
|
+
function Ca(t) {
|
|
3966
|
+
const { urn: e } = t.details;
|
|
3967
|
+
return Mt(e.resourceId, e.version, e.agencyId);
|
|
1138
3968
|
}
|
|
1139
|
-
function
|
|
1140
|
-
const
|
|
1141
|
-
for (const n of
|
|
1142
|
-
const
|
|
1143
|
-
|
|
3969
|
+
function co(t) {
|
|
3970
|
+
const e = {};
|
|
3971
|
+
for (const n of t.datasets) {
|
|
3972
|
+
const r = n.dataset, s = Ca(r);
|
|
3973
|
+
e[s] = r.details.dimensions;
|
|
1144
3974
|
}
|
|
1145
|
-
return
|
|
3975
|
+
return e;
|
|
1146
3976
|
}
|
|
1147
3977
|
export {
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
3978
|
+
Oe as Annotations,
|
|
3979
|
+
ms as AssignmentStatus,
|
|
3980
|
+
La as AvailabilityApi,
|
|
3981
|
+
Lt as DATASET_DATA_URL,
|
|
3982
|
+
Wa as DatasetApi,
|
|
3983
|
+
we as DimensionType,
|
|
3984
|
+
It as DownloadType,
|
|
3985
|
+
qa as FREQUENCY_DIMENSION_ID,
|
|
3986
|
+
Ya as FREQUENCY_DIM_ID,
|
|
3987
|
+
_t as FileColumnsAttribute,
|
|
3988
|
+
$t as GET_v3_FILTER_ALL,
|
|
3989
|
+
Sa as GET_v3_FILTER_AND,
|
|
3990
|
+
Wt as GET_v3_FILTER_OR,
|
|
3991
|
+
ps as OBSERVATION_KEY,
|
|
3992
|
+
hs as OccurrenceType,
|
|
3993
|
+
aa as Periods,
|
|
3994
|
+
sa as RepresentationTextType,
|
|
3995
|
+
ra as SDMX_DATA_QUERY_PARAMS,
|
|
3996
|
+
ce as SINGLE_WILDCARD_SYMBOL,
|
|
3997
|
+
$a as SdmxApiClient,
|
|
3998
|
+
Ze as SdmxAvailabilityMode,
|
|
3999
|
+
X as SdmxDataFormat,
|
|
4000
|
+
et as SdmxDetails,
|
|
4001
|
+
ue as SdmxReferences,
|
|
4002
|
+
R as SeriesFilterOperator,
|
|
4003
|
+
ds as TIME_PERIOD,
|
|
4004
|
+
fs as TIME_PERIOD_END_ANNOTATION_KEY,
|
|
4005
|
+
ls as TIME_PERIOD_START_ANNOTATION_KEY,
|
|
4006
|
+
co as buildDatasetDimensionsMetadataMap,
|
|
4007
|
+
Ns as dailyPattern,
|
|
4008
|
+
Ts as decodeDimensionId,
|
|
4009
|
+
Ka as findCodelistByDimension,
|
|
4010
|
+
_e as generateDatasetDataRequest,
|
|
4011
|
+
Mt as generateShortUrn,
|
|
4012
|
+
io as getAdditionalColumns,
|
|
4013
|
+
Va as getAnnotationPeriod,
|
|
4014
|
+
Ne as getArtifactByUrnWithWildCard,
|
|
4015
|
+
Qa as getAttachedDimensionsSeriesByDimension,
|
|
4016
|
+
ws as getAttachedDimensionsSeriesByTsId,
|
|
4017
|
+
gt as getAttachedDimensionsSeriesKey,
|
|
4018
|
+
gs as getAttributeValueFromDataQueryResponse,
|
|
4019
|
+
za as getAvailableCodes,
|
|
4020
|
+
Xa as getAvailableCodesFromConstrains,
|
|
4021
|
+
Pt as getChildParsedUrn,
|
|
4022
|
+
ke as getConcept,
|
|
4023
|
+
Ke as getConceptByUrn,
|
|
4024
|
+
xa as getConceptWithScheme,
|
|
4025
|
+
Ma as getConvertedMetaAttributes,
|
|
4026
|
+
_s as getDailyRegExp,
|
|
4027
|
+
Ra as getDaysColumns,
|
|
4028
|
+
Ja as getDimensionTitle,
|
|
4029
|
+
ze as getDimensions,
|
|
4030
|
+
oa as getFilteredItemsWithParents,
|
|
4031
|
+
fa as getFiltersDtoFromDataQuery,
|
|
4032
|
+
ja as getFiltersDtoMapFromDataQuery,
|
|
4033
|
+
Z as getISOWeek,
|
|
4034
|
+
K as getKeyFromUrn,
|
|
4035
|
+
Ga as getLastUpdatedTime,
|
|
4036
|
+
Fe as getLastWeekNumberOfYear,
|
|
4037
|
+
Ae as getLocalizedName,
|
|
4038
|
+
Zs as getMonthlyData,
|
|
4039
|
+
Ua as getMonthlyDataByQuarter,
|
|
4040
|
+
be as getMonthlyRegExp,
|
|
4041
|
+
bt as getParsedEndPeriodDate,
|
|
4042
|
+
Fa as getParsedResponse,
|
|
4043
|
+
yt as getParsedStartPeriodDate,
|
|
4044
|
+
k as getPeriodDate,
|
|
4045
|
+
_a as getPeriods,
|
|
4046
|
+
Ha as getQuarterByMonth,
|
|
4047
|
+
Te as getQuarterlyRegExp,
|
|
4048
|
+
js as getQuartersData,
|
|
4049
|
+
Oa as getQueryTimePeriodFilters,
|
|
4050
|
+
Yt as getRequestAcceptHeader,
|
|
4051
|
+
ba as getResolvedVersionBySingleWildcard,
|
|
4052
|
+
Ks as getSemiAnnualData,
|
|
4053
|
+
Rs as getSemiAnnuallyRegExp,
|
|
4054
|
+
ie as getSeriesAttributes,
|
|
4055
|
+
ys as getSeriesName,
|
|
4056
|
+
no as getStructureComponentsMap,
|
|
4057
|
+
Za as getStructureDimensions,
|
|
4058
|
+
to as getTimeDimension,
|
|
4059
|
+
eo as getTimePeriods,
|
|
4060
|
+
oo as getTimeQueryFilter,
|
|
4061
|
+
Aa as getTimeRangeFromAttachment,
|
|
4062
|
+
ro as getTimeSeriesCount,
|
|
4063
|
+
ao as getTimeSeriesFilterKey,
|
|
4064
|
+
Ds as getTimeSeriesId,
|
|
4065
|
+
pt as getWeekCode,
|
|
4066
|
+
Ss as getWeeklyPeriodEndDate,
|
|
4067
|
+
Ls as getWeeklyPeriodStartDate,
|
|
4068
|
+
Ys as getWeeklyRegExp,
|
|
4069
|
+
Na as getWeeksColumns,
|
|
4070
|
+
Ta as getWildCardRegexp,
|
|
4071
|
+
xt as getYearPeriod,
|
|
4072
|
+
ge as getYearlyRegExp,
|
|
4073
|
+
ea as getYears,
|
|
4074
|
+
Is as isDaily,
|
|
4075
|
+
De as isMonthly,
|
|
4076
|
+
Ee as isQuarterly,
|
|
4077
|
+
ye as isSemiAnnually,
|
|
4078
|
+
xe as isWeekly,
|
|
4079
|
+
Ea as isWildCardVersionCorrect,
|
|
4080
|
+
pe as isYearly,
|
|
4081
|
+
ks as monthlyPattern,
|
|
4082
|
+
so as openDownloadWindow,
|
|
4083
|
+
Ms as quarterPattern,
|
|
4084
|
+
Os as semiAnnuallyPattern,
|
|
4085
|
+
Ba as sortPeriods,
|
|
4086
|
+
H as splitUrn,
|
|
4087
|
+
vs as weeklyPattern,
|
|
4088
|
+
As as yearlyPattern
|
|
1258
4089
|
};
|