@kong-ui-public/i18n 0.2.1 → 0.2.3
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/dist/i18n.es.js +768 -759
- package/dist/i18n.es.js.map +1 -1
- package/dist/i18n.umd.js +11 -11
- package/dist/i18n.umd.js.map +1 -1
- package/package.json +4 -3
package/dist/i18n.es.js
CHANGED
|
@@ -1,93 +1,102 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
var
|
|
3
|
-
return
|
|
4
|
-
|
|
5
|
-
} || function(
|
|
6
|
-
for (var i in
|
|
7
|
-
Object.prototype.hasOwnProperty.call(
|
|
8
|
-
},
|
|
1
|
+
import { defineComponent as Xe, h as Ze } from "vue";
|
|
2
|
+
var q = function(e, t) {
|
|
3
|
+
return q = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(r, n) {
|
|
4
|
+
r.__proto__ = n;
|
|
5
|
+
} || function(r, n) {
|
|
6
|
+
for (var i in n)
|
|
7
|
+
Object.prototype.hasOwnProperty.call(n, i) && (r[i] = n[i]);
|
|
8
|
+
}, q(e, t);
|
|
9
9
|
};
|
|
10
|
-
function
|
|
10
|
+
function _(e, t) {
|
|
11
11
|
if (typeof t != "function" && t !== null)
|
|
12
12
|
throw new TypeError("Class extends value " + String(t) + " is not a constructor or null");
|
|
13
|
-
|
|
14
|
-
function
|
|
13
|
+
q(e, t);
|
|
14
|
+
function r() {
|
|
15
15
|
this.constructor = e;
|
|
16
16
|
}
|
|
17
|
-
e.prototype = t === null ? Object.create(t) : (
|
|
18
|
-
}
|
|
19
|
-
var
|
|
20
|
-
return
|
|
21
|
-
for (var
|
|
22
|
-
|
|
23
|
-
for (var a in
|
|
24
|
-
Object.prototype.hasOwnProperty.call(
|
|
17
|
+
e.prototype = t === null ? Object.create(t) : (r.prototype = t.prototype, new r());
|
|
18
|
+
}
|
|
19
|
+
var v = function() {
|
|
20
|
+
return v = Object.assign || function(t) {
|
|
21
|
+
for (var r, n = 1, i = arguments.length; n < i; n++) {
|
|
22
|
+
r = arguments[n];
|
|
23
|
+
for (var a in r)
|
|
24
|
+
Object.prototype.hasOwnProperty.call(r, a) && (t[a] = r[a]);
|
|
25
25
|
}
|
|
26
26
|
return t;
|
|
27
|
-
},
|
|
27
|
+
}, v.apply(this, arguments);
|
|
28
28
|
};
|
|
29
|
-
function
|
|
30
|
-
if (
|
|
31
|
-
for (var
|
|
32
|
-
(a || !(
|
|
29
|
+
function P(e, t, r) {
|
|
30
|
+
if (r || arguments.length === 2)
|
|
31
|
+
for (var n = 0, i = t.length, a; n < i; n++)
|
|
32
|
+
(a || !(n in t)) && (a || (a = Array.prototype.slice.call(t, 0, n)), a[n] = t[n]);
|
|
33
33
|
return e.concat(a || Array.prototype.slice.call(t));
|
|
34
34
|
}
|
|
35
|
-
var
|
|
35
|
+
var x = function() {
|
|
36
|
+
return x = Object.assign || function(t) {
|
|
37
|
+
for (var r, n = 1, i = arguments.length; n < i; n++) {
|
|
38
|
+
r = arguments[n];
|
|
39
|
+
for (var a in r)
|
|
40
|
+
Object.prototype.hasOwnProperty.call(r, a) && (t[a] = r[a]);
|
|
41
|
+
}
|
|
42
|
+
return t;
|
|
43
|
+
}, x.apply(this, arguments);
|
|
44
|
+
}, m;
|
|
36
45
|
(function(e) {
|
|
37
46
|
e[e.EXPECT_ARGUMENT_CLOSING_BRACE = 1] = "EXPECT_ARGUMENT_CLOSING_BRACE", e[e.EMPTY_ARGUMENT = 2] = "EMPTY_ARGUMENT", e[e.MALFORMED_ARGUMENT = 3] = "MALFORMED_ARGUMENT", e[e.EXPECT_ARGUMENT_TYPE = 4] = "EXPECT_ARGUMENT_TYPE", e[e.INVALID_ARGUMENT_TYPE = 5] = "INVALID_ARGUMENT_TYPE", e[e.EXPECT_ARGUMENT_STYLE = 6] = "EXPECT_ARGUMENT_STYLE", e[e.INVALID_NUMBER_SKELETON = 7] = "INVALID_NUMBER_SKELETON", e[e.INVALID_DATE_TIME_SKELETON = 8] = "INVALID_DATE_TIME_SKELETON", e[e.EXPECT_NUMBER_SKELETON = 9] = "EXPECT_NUMBER_SKELETON", e[e.EXPECT_DATE_TIME_SKELETON = 10] = "EXPECT_DATE_TIME_SKELETON", e[e.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE = 11] = "UNCLOSED_QUOTE_IN_ARGUMENT_STYLE", e[e.EXPECT_SELECT_ARGUMENT_OPTIONS = 12] = "EXPECT_SELECT_ARGUMENT_OPTIONS", e[e.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE = 13] = "EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE", e[e.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE = 14] = "INVALID_PLURAL_ARGUMENT_OFFSET_VALUE", e[e.EXPECT_SELECT_ARGUMENT_SELECTOR = 15] = "EXPECT_SELECT_ARGUMENT_SELECTOR", e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR = 16] = "EXPECT_PLURAL_ARGUMENT_SELECTOR", e[e.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT = 17] = "EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT", e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT = 18] = "EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT", e[e.INVALID_PLURAL_ARGUMENT_SELECTOR = 19] = "INVALID_PLURAL_ARGUMENT_SELECTOR", e[e.DUPLICATE_PLURAL_ARGUMENT_SELECTOR = 20] = "DUPLICATE_PLURAL_ARGUMENT_SELECTOR", e[e.DUPLICATE_SELECT_ARGUMENT_SELECTOR = 21] = "DUPLICATE_SELECT_ARGUMENT_SELECTOR", e[e.MISSING_OTHER_CLAUSE = 22] = "MISSING_OTHER_CLAUSE", e[e.INVALID_TAG = 23] = "INVALID_TAG", e[e.INVALID_TAG_NAME = 25] = "INVALID_TAG_NAME", e[e.UNMATCHED_CLOSING_TAG = 26] = "UNMATCHED_CLOSING_TAG", e[e.UNCLOSED_TAG = 27] = "UNCLOSED_TAG";
|
|
38
|
-
})(
|
|
47
|
+
})(m || (m = {}));
|
|
39
48
|
var d;
|
|
40
49
|
(function(e) {
|
|
41
50
|
e[e.literal = 0] = "literal", e[e.argument = 1] = "argument", e[e.number = 2] = "number", e[e.date = 3] = "date", e[e.time = 4] = "time", e[e.select = 5] = "select", e[e.plural = 6] = "plural", e[e.pound = 7] = "pound", e[e.tag = 8] = "tag";
|
|
42
51
|
})(d || (d = {}));
|
|
43
|
-
var
|
|
52
|
+
var w;
|
|
44
53
|
(function(e) {
|
|
45
54
|
e[e.number = 0] = "number", e[e.dateTime = 1] = "dateTime";
|
|
46
|
-
})(
|
|
47
|
-
function
|
|
55
|
+
})(w || (w = {}));
|
|
56
|
+
function oe(e) {
|
|
48
57
|
return e.type === d.literal;
|
|
49
58
|
}
|
|
50
|
-
function
|
|
59
|
+
function We(e) {
|
|
51
60
|
return e.type === d.argument;
|
|
52
61
|
}
|
|
53
|
-
function
|
|
62
|
+
function de(e) {
|
|
54
63
|
return e.type === d.number;
|
|
55
64
|
}
|
|
56
|
-
function
|
|
65
|
+
function xe(e) {
|
|
57
66
|
return e.type === d.date;
|
|
58
67
|
}
|
|
59
|
-
function
|
|
68
|
+
function ye(e) {
|
|
60
69
|
return e.type === d.time;
|
|
61
70
|
}
|
|
62
|
-
function
|
|
71
|
+
function Te(e) {
|
|
63
72
|
return e.type === d.select;
|
|
64
73
|
}
|
|
65
|
-
function
|
|
74
|
+
function Se(e) {
|
|
66
75
|
return e.type === d.plural;
|
|
67
76
|
}
|
|
68
|
-
function
|
|
77
|
+
function ze(e) {
|
|
69
78
|
return e.type === d.pound;
|
|
70
79
|
}
|
|
71
|
-
function
|
|
80
|
+
function Ie(e) {
|
|
72
81
|
return e.type === d.tag;
|
|
73
82
|
}
|
|
74
|
-
function
|
|
75
|
-
return !!(e && typeof e == "object" && e.type ===
|
|
83
|
+
function Ae(e) {
|
|
84
|
+
return !!(e && typeof e == "object" && e.type === w.number);
|
|
76
85
|
}
|
|
77
|
-
function
|
|
78
|
-
return !!(e && typeof e == "object" && e.type ===
|
|
86
|
+
function J(e) {
|
|
87
|
+
return !!(e && typeof e == "object" && e.type === w.dateTime);
|
|
79
88
|
}
|
|
80
|
-
var
|
|
81
|
-
function
|
|
89
|
+
var He = /[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/, qe = /(?:[Eec]{1,6}|G{1,5}|[Qq]{1,5}|(?:[yYur]+|U{1,5})|[ML]{1,5}|d{1,2}|D{1,3}|F{1}|[abB]{1,5}|[hkHK]{1,2}|w{1,2}|W{1}|m{1,2}|s{1,2}|[zZOvVxX]{1,4})(?=([^']*'[^']*')*[^']*$)/g;
|
|
90
|
+
function Je(e) {
|
|
82
91
|
var t = {};
|
|
83
|
-
return e.replace(
|
|
84
|
-
var
|
|
85
|
-
switch (
|
|
92
|
+
return e.replace(qe, function(r) {
|
|
93
|
+
var n = r.length;
|
|
94
|
+
switch (r[0]) {
|
|
86
95
|
case "G":
|
|
87
|
-
t.era =
|
|
96
|
+
t.era = n === 4 ? "long" : n === 5 ? "narrow" : "short";
|
|
88
97
|
break;
|
|
89
98
|
case "y":
|
|
90
|
-
t.year =
|
|
99
|
+
t.year = n === 2 ? "2-digit" : "numeric";
|
|
91
100
|
break;
|
|
92
101
|
case "Y":
|
|
93
102
|
case "u":
|
|
@@ -99,30 +108,30 @@ function qe(e) {
|
|
|
99
108
|
throw new RangeError("`q/Q` (quarter) patterns are not supported");
|
|
100
109
|
case "M":
|
|
101
110
|
case "L":
|
|
102
|
-
t.month = ["numeric", "2-digit", "short", "long", "narrow"][
|
|
111
|
+
t.month = ["numeric", "2-digit", "short", "long", "narrow"][n - 1];
|
|
103
112
|
break;
|
|
104
113
|
case "w":
|
|
105
114
|
case "W":
|
|
106
115
|
throw new RangeError("`w/W` (week) patterns are not supported");
|
|
107
116
|
case "d":
|
|
108
|
-
t.day = ["numeric", "2-digit"][
|
|
117
|
+
t.day = ["numeric", "2-digit"][n - 1];
|
|
109
118
|
break;
|
|
110
119
|
case "D":
|
|
111
120
|
case "F":
|
|
112
121
|
case "g":
|
|
113
122
|
throw new RangeError("`D/F/g` (day) patterns are not supported, use `d` instead");
|
|
114
123
|
case "E":
|
|
115
|
-
t.weekday =
|
|
124
|
+
t.weekday = n === 4 ? "short" : n === 5 ? "narrow" : "short";
|
|
116
125
|
break;
|
|
117
126
|
case "e":
|
|
118
|
-
if (
|
|
127
|
+
if (n < 4)
|
|
119
128
|
throw new RangeError("`e..eee` (weekday) patterns are not supported");
|
|
120
|
-
t.weekday = ["short", "long", "narrow", "short"][
|
|
129
|
+
t.weekday = ["short", "long", "narrow", "short"][n - 4];
|
|
121
130
|
break;
|
|
122
131
|
case "c":
|
|
123
|
-
if (
|
|
132
|
+
if (n < 4)
|
|
124
133
|
throw new RangeError("`c..ccc` (weekday) patterns are not supported");
|
|
125
|
-
t.weekday = ["short", "long", "narrow", "short"][
|
|
134
|
+
t.weekday = ["short", "long", "narrow", "short"][n - 4];
|
|
126
135
|
break;
|
|
127
136
|
case "a":
|
|
128
137
|
t.hour12 = !0;
|
|
@@ -131,32 +140,32 @@ function qe(e) {
|
|
|
131
140
|
case "B":
|
|
132
141
|
throw new RangeError("`b/B` (period) patterns are not supported, use `a` instead");
|
|
133
142
|
case "h":
|
|
134
|
-
t.hourCycle = "h12", t.hour = ["numeric", "2-digit"][
|
|
143
|
+
t.hourCycle = "h12", t.hour = ["numeric", "2-digit"][n - 1];
|
|
135
144
|
break;
|
|
136
145
|
case "H":
|
|
137
|
-
t.hourCycle = "h23", t.hour = ["numeric", "2-digit"][
|
|
146
|
+
t.hourCycle = "h23", t.hour = ["numeric", "2-digit"][n - 1];
|
|
138
147
|
break;
|
|
139
148
|
case "K":
|
|
140
|
-
t.hourCycle = "h11", t.hour = ["numeric", "2-digit"][
|
|
149
|
+
t.hourCycle = "h11", t.hour = ["numeric", "2-digit"][n - 1];
|
|
141
150
|
break;
|
|
142
151
|
case "k":
|
|
143
|
-
t.hourCycle = "h24", t.hour = ["numeric", "2-digit"][
|
|
152
|
+
t.hourCycle = "h24", t.hour = ["numeric", "2-digit"][n - 1];
|
|
144
153
|
break;
|
|
145
154
|
case "j":
|
|
146
155
|
case "J":
|
|
147
156
|
case "C":
|
|
148
157
|
throw new RangeError("`j/J/C` (hour) patterns are not supported, use `h/H/K/k` instead");
|
|
149
158
|
case "m":
|
|
150
|
-
t.minute = ["numeric", "2-digit"][
|
|
159
|
+
t.minute = ["numeric", "2-digit"][n - 1];
|
|
151
160
|
break;
|
|
152
161
|
case "s":
|
|
153
|
-
t.second = ["numeric", "2-digit"][
|
|
162
|
+
t.second = ["numeric", "2-digit"][n - 1];
|
|
154
163
|
break;
|
|
155
164
|
case "S":
|
|
156
165
|
case "A":
|
|
157
166
|
throw new RangeError("`S/A` (second) patterns are not supported, use `s` instead");
|
|
158
167
|
case "z":
|
|
159
|
-
t.timeZoneName =
|
|
168
|
+
t.timeZoneName = n < 4 ? "short" : "long";
|
|
160
169
|
break;
|
|
161
170
|
case "Z":
|
|
162
171
|
case "O":
|
|
@@ -169,14 +178,14 @@ function qe(e) {
|
|
|
169
178
|
return "";
|
|
170
179
|
}), t;
|
|
171
180
|
}
|
|
172
|
-
var
|
|
173
|
-
function
|
|
181
|
+
var Qe = /[\t-\r \x85\u200E\u200F\u2028\u2029]/i;
|
|
182
|
+
function Ye(e) {
|
|
174
183
|
if (e.length === 0)
|
|
175
184
|
throw new Error("Number skeleton cannot be empty");
|
|
176
|
-
for (var t = e.split(
|
|
185
|
+
for (var t = e.split(Qe).filter(function(c) {
|
|
177
186
|
return c.length > 0;
|
|
178
|
-
}),
|
|
179
|
-
var a = i[
|
|
187
|
+
}), r = [], n = 0, i = t; n < i.length; n++) {
|
|
188
|
+
var a = i[n], o = a.split("/");
|
|
180
189
|
if (o.length === 0)
|
|
181
190
|
throw new Error("Invalid number skeleton");
|
|
182
191
|
for (var s = o[0], h = o.slice(1), l = 0, u = h; l < u.length; l++) {
|
|
@@ -184,21 +193,21 @@ function Qe(e) {
|
|
|
184
193
|
if (f.length === 0)
|
|
185
194
|
throw new Error("Invalid number skeleton");
|
|
186
195
|
}
|
|
187
|
-
|
|
196
|
+
r.push({ stem: s, options: h });
|
|
188
197
|
}
|
|
189
|
-
return
|
|
198
|
+
return r;
|
|
190
199
|
}
|
|
191
|
-
function
|
|
200
|
+
function $e(e) {
|
|
192
201
|
return e.replace(/^(.*?)-/, "");
|
|
193
202
|
}
|
|
194
|
-
var
|
|
195
|
-
function
|
|
203
|
+
var se = /^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g, Ne = /^(@+)?(\+|#+)?[rs]?$/g, Ke = /(\*)(0+)|(#+)(0+)|(0+)/g, _e = /^(0+)$/;
|
|
204
|
+
function ue(e) {
|
|
196
205
|
var t = {};
|
|
197
|
-
return e[e.length - 1] === "r" ? t.roundingPriority = "morePrecision" : e[e.length - 1] === "s" && (t.roundingPriority = "lessPrecision"), e.replace(
|
|
198
|
-
return typeof i != "string" ? (t.minimumSignificantDigits =
|
|
206
|
+
return e[e.length - 1] === "r" ? t.roundingPriority = "morePrecision" : e[e.length - 1] === "s" && (t.roundingPriority = "lessPrecision"), e.replace(Ne, function(r, n, i) {
|
|
207
|
+
return typeof i != "string" ? (t.minimumSignificantDigits = n.length, t.maximumSignificantDigits = n.length) : i === "+" ? t.minimumSignificantDigits = n.length : n[0] === "#" ? t.maximumSignificantDigits = n.length : (t.minimumSignificantDigits = n.length, t.maximumSignificantDigits = n.length + (typeof i == "string" ? i.length : 0)), "";
|
|
199
208
|
}), t;
|
|
200
209
|
}
|
|
201
|
-
function
|
|
210
|
+
function Be(e) {
|
|
202
211
|
switch (e) {
|
|
203
212
|
case "sign-auto":
|
|
204
213
|
return {
|
|
@@ -238,27 +247,27 @@ function _e(e) {
|
|
|
238
247
|
};
|
|
239
248
|
}
|
|
240
249
|
}
|
|
241
|
-
function
|
|
250
|
+
function et(e) {
|
|
242
251
|
var t;
|
|
243
252
|
if (e[0] === "E" && e[1] === "E" ? (t = {
|
|
244
253
|
notation: "engineering"
|
|
245
254
|
}, e = e.slice(2)) : e[0] === "E" && (t = {
|
|
246
255
|
notation: "scientific"
|
|
247
256
|
}, e = e.slice(1)), t) {
|
|
248
|
-
var
|
|
249
|
-
if (
|
|
257
|
+
var r = e.slice(0, 2);
|
|
258
|
+
if (r === "+!" ? (t.signDisplay = "always", e = e.slice(2)) : r === "+?" && (t.signDisplay = "exceptZero", e = e.slice(2)), !_e.test(e))
|
|
250
259
|
throw new Error("Malformed concise eng/scientific notation");
|
|
251
260
|
t.minimumIntegerDigits = e.length;
|
|
252
261
|
}
|
|
253
262
|
return t;
|
|
254
263
|
}
|
|
255
|
-
function
|
|
256
|
-
var t = {},
|
|
257
|
-
return
|
|
264
|
+
function he(e) {
|
|
265
|
+
var t = {}, r = Be(e);
|
|
266
|
+
return r || t;
|
|
258
267
|
}
|
|
259
|
-
function
|
|
260
|
-
for (var t = {},
|
|
261
|
-
var i = r
|
|
268
|
+
function tt(e) {
|
|
269
|
+
for (var t = {}, r = 0, n = e; r < n.length; r++) {
|
|
270
|
+
var i = n[r];
|
|
262
271
|
switch (i.stem) {
|
|
263
272
|
case "percent":
|
|
264
273
|
case "%":
|
|
@@ -280,7 +289,7 @@ function et(e) {
|
|
|
280
289
|
continue;
|
|
281
290
|
case "measure-unit":
|
|
282
291
|
case "unit":
|
|
283
|
-
t.style = "unit", t.unit =
|
|
292
|
+
t.style = "unit", t.unit = $e(i.options[0]);
|
|
284
293
|
continue;
|
|
285
294
|
case "compact-short":
|
|
286
295
|
case "K":
|
|
@@ -291,13 +300,13 @@ function et(e) {
|
|
|
291
300
|
t.notation = "compact", t.compactDisplay = "long";
|
|
292
301
|
continue;
|
|
293
302
|
case "scientific":
|
|
294
|
-
t =
|
|
295
|
-
return
|
|
303
|
+
t = x(x(x({}, t), { notation: "scientific" }), i.options.reduce(function(h, l) {
|
|
304
|
+
return x(x({}, h), he(l));
|
|
296
305
|
}, {}));
|
|
297
306
|
continue;
|
|
298
307
|
case "engineering":
|
|
299
|
-
t =
|
|
300
|
-
return
|
|
308
|
+
t = x(x(x({}, t), { notation: "engineering" }), i.options.reduce(function(h, l) {
|
|
309
|
+
return x(x({}, h), he(l));
|
|
301
310
|
}, {}));
|
|
302
311
|
continue;
|
|
303
312
|
case "notation-simple":
|
|
@@ -321,45 +330,45 @@ function et(e) {
|
|
|
321
330
|
case "integer-width":
|
|
322
331
|
if (i.options.length > 1)
|
|
323
332
|
throw new RangeError("integer-width stems only accept a single optional option");
|
|
324
|
-
i.options[0].replace(
|
|
333
|
+
i.options[0].replace(Ke, function(h, l, u, f, c, g) {
|
|
325
334
|
if (l)
|
|
326
335
|
t.minimumIntegerDigits = u.length;
|
|
327
336
|
else {
|
|
328
337
|
if (f && c)
|
|
329
338
|
throw new Error("We currently do not support maximum integer digits");
|
|
330
|
-
if (
|
|
339
|
+
if (g)
|
|
331
340
|
throw new Error("We currently do not support exact integer digits");
|
|
332
341
|
}
|
|
333
342
|
return "";
|
|
334
343
|
});
|
|
335
344
|
continue;
|
|
336
345
|
}
|
|
337
|
-
if (
|
|
346
|
+
if (_e.test(i.stem)) {
|
|
338
347
|
t.minimumIntegerDigits = i.stem.length;
|
|
339
348
|
continue;
|
|
340
349
|
}
|
|
341
|
-
if (
|
|
350
|
+
if (se.test(i.stem)) {
|
|
342
351
|
if (i.options.length > 1)
|
|
343
352
|
throw new RangeError("Fraction-precision stems only accept a single optional option");
|
|
344
|
-
i.stem.replace(
|
|
345
|
-
return u === "*" ? t.minimumFractionDigits = l.length : f && f[0] === "#" ? t.maximumFractionDigits = f.length : c &&
|
|
353
|
+
i.stem.replace(se, function(h, l, u, f, c, g) {
|
|
354
|
+
return u === "*" ? t.minimumFractionDigits = l.length : f && f[0] === "#" ? t.maximumFractionDigits = f.length : c && g ? (t.minimumFractionDigits = c.length, t.maximumFractionDigits = c.length + g.length) : (t.minimumFractionDigits = l.length, t.maximumFractionDigits = l.length), "";
|
|
346
355
|
});
|
|
347
356
|
var a = i.options[0];
|
|
348
|
-
a === "w" ? t =
|
|
357
|
+
a === "w" ? t = x(x({}, t), { trailingZeroDisplay: "stripIfInteger" }) : a && (t = x(x({}, t), ue(a)));
|
|
349
358
|
continue;
|
|
350
359
|
}
|
|
351
|
-
if (
|
|
352
|
-
t =
|
|
360
|
+
if (Ne.test(i.stem)) {
|
|
361
|
+
t = x(x({}, t), ue(i.stem));
|
|
353
362
|
continue;
|
|
354
363
|
}
|
|
355
|
-
var o =
|
|
356
|
-
o && (t =
|
|
357
|
-
var s =
|
|
358
|
-
s && (t =
|
|
364
|
+
var o = Be(i.stem);
|
|
365
|
+
o && (t = x(x({}, t), o));
|
|
366
|
+
var s = et(i.stem);
|
|
367
|
+
s && (t = x(x({}, t), s));
|
|
359
368
|
}
|
|
360
369
|
return t;
|
|
361
370
|
}
|
|
362
|
-
var
|
|
371
|
+
var j = {
|
|
363
372
|
AX: [
|
|
364
373
|
"H"
|
|
365
374
|
],
|
|
@@ -1696,23 +1705,23 @@ var U = {
|
|
|
1696
1705
|
"h"
|
|
1697
1706
|
]
|
|
1698
1707
|
};
|
|
1699
|
-
function
|
|
1700
|
-
for (var
|
|
1701
|
-
var i = e.charAt(
|
|
1708
|
+
function rt(e, t) {
|
|
1709
|
+
for (var r = "", n = 0; n < e.length; n++) {
|
|
1710
|
+
var i = e.charAt(n);
|
|
1702
1711
|
if (i === "j") {
|
|
1703
|
-
for (var a = 0;
|
|
1704
|
-
a++,
|
|
1705
|
-
var o = 1 + (a & 1), s = a < 2 ? 1 : 3 + (a >> 1), h = "a", l =
|
|
1712
|
+
for (var a = 0; n + 1 < e.length && e.charAt(n + 1) === i; )
|
|
1713
|
+
a++, n++;
|
|
1714
|
+
var o = 1 + (a & 1), s = a < 2 ? 1 : 3 + (a >> 1), h = "a", l = nt(t);
|
|
1706
1715
|
for ((l == "H" || l == "k") && (s = 0); s-- > 0; )
|
|
1707
|
-
|
|
1716
|
+
r += h;
|
|
1708
1717
|
for (; o-- > 0; )
|
|
1709
|
-
|
|
1718
|
+
r = l + r;
|
|
1710
1719
|
} else
|
|
1711
|
-
i === "J" ?
|
|
1720
|
+
i === "J" ? r += "H" : r += i;
|
|
1712
1721
|
}
|
|
1713
|
-
return
|
|
1722
|
+
return r;
|
|
1714
1723
|
}
|
|
1715
|
-
function
|
|
1724
|
+
function nt(e) {
|
|
1716
1725
|
var t = e.hourCycle;
|
|
1717
1726
|
if (t === void 0 && // @ts-ignore hourCycle(s) is not identified yet
|
|
1718
1727
|
e.hourCycles && // @ts-ignore
|
|
@@ -1729,73 +1738,73 @@ function rt(e) {
|
|
|
1729
1738
|
default:
|
|
1730
1739
|
throw new Error("Invalid hourCycle");
|
|
1731
1740
|
}
|
|
1732
|
-
var
|
|
1733
|
-
|
|
1734
|
-
var i =
|
|
1741
|
+
var r = e.language, n;
|
|
1742
|
+
r !== "root" && (n = e.maximize().region);
|
|
1743
|
+
var i = j[n || ""] || j[r || ""] || j["".concat(r, "-001")] || j["001"];
|
|
1735
1744
|
return i[0];
|
|
1736
1745
|
}
|
|
1737
|
-
var
|
|
1738
|
-
function
|
|
1746
|
+
var Z, it = new RegExp("^".concat(He.source, "*")), at = new RegExp("".concat(He.source, "*$"));
|
|
1747
|
+
function p(e, t) {
|
|
1739
1748
|
return { start: e, end: t };
|
|
1740
1749
|
}
|
|
1741
|
-
var
|
|
1750
|
+
var ot = !!String.prototype.startsWith, st = !!String.fromCodePoint, ut = !!Object.fromEntries, ht = !!String.prototype.codePointAt, lt = !!String.prototype.trimStart, ft = !!String.prototype.trimEnd, ct = !!Number.isSafeInteger, mt = ct ? Number.isSafeInteger : function(e) {
|
|
1742
1751
|
return typeof e == "number" && isFinite(e) && Math.floor(e) === e && Math.abs(e) <= 9007199254740991;
|
|
1743
|
-
},
|
|
1752
|
+
}, Q = !0;
|
|
1744
1753
|
try {
|
|
1745
|
-
var
|
|
1746
|
-
|
|
1754
|
+
var gt = Oe("([^\\p{White_Space}\\p{Pattern_Syntax}]*)", "yu");
|
|
1755
|
+
Q = ((Z = gt.exec("a")) === null || Z === void 0 ? void 0 : Z[0]) === "a";
|
|
1747
1756
|
} catch {
|
|
1748
|
-
|
|
1757
|
+
Q = !1;
|
|
1749
1758
|
}
|
|
1750
|
-
var
|
|
1759
|
+
var le = ot ? (
|
|
1751
1760
|
// Native
|
|
1752
|
-
function(t,
|
|
1753
|
-
return t.startsWith(
|
|
1761
|
+
function(t, r, n) {
|
|
1762
|
+
return t.startsWith(r, n);
|
|
1754
1763
|
}
|
|
1755
1764
|
) : (
|
|
1756
1765
|
// For IE11
|
|
1757
|
-
function(t,
|
|
1758
|
-
return t.slice(
|
|
1766
|
+
function(t, r, n) {
|
|
1767
|
+
return t.slice(n, n + r.length) === r;
|
|
1759
1768
|
}
|
|
1760
|
-
),
|
|
1769
|
+
), Y = st ? String.fromCodePoint : (
|
|
1761
1770
|
// IE11
|
|
1762
1771
|
function() {
|
|
1763
|
-
for (var t = [],
|
|
1764
|
-
t[
|
|
1765
|
-
for (var
|
|
1772
|
+
for (var t = [], r = 0; r < arguments.length; r++)
|
|
1773
|
+
t[r] = arguments[r];
|
|
1774
|
+
for (var n = "", i = t.length, a = 0, o; i > a; ) {
|
|
1766
1775
|
if (o = t[a++], o > 1114111)
|
|
1767
1776
|
throw RangeError(o + " is not a valid code point");
|
|
1768
|
-
|
|
1777
|
+
n += o < 65536 ? String.fromCharCode(o) : String.fromCharCode(((o -= 65536) >> 10) + 55296, o % 1024 + 56320);
|
|
1769
1778
|
}
|
|
1770
|
-
return
|
|
1779
|
+
return n;
|
|
1771
1780
|
}
|
|
1772
|
-
),
|
|
1781
|
+
), fe = (
|
|
1773
1782
|
// native
|
|
1774
|
-
|
|
1783
|
+
ut ? Object.fromEntries : (
|
|
1775
1784
|
// Ponyfill
|
|
1776
1785
|
function(t) {
|
|
1777
|
-
for (var
|
|
1778
|
-
var a = i[
|
|
1779
|
-
|
|
1786
|
+
for (var r = {}, n = 0, i = t; n < i.length; n++) {
|
|
1787
|
+
var a = i[n], o = a[0], s = a[1];
|
|
1788
|
+
r[o] = s;
|
|
1780
1789
|
}
|
|
1781
|
-
return
|
|
1790
|
+
return r;
|
|
1782
1791
|
}
|
|
1783
1792
|
)
|
|
1784
|
-
),
|
|
1793
|
+
), Re = ht ? (
|
|
1785
1794
|
// Native
|
|
1786
|
-
function(t,
|
|
1787
|
-
return t.codePointAt(
|
|
1795
|
+
function(t, r) {
|
|
1796
|
+
return t.codePointAt(r);
|
|
1788
1797
|
}
|
|
1789
1798
|
) : (
|
|
1790
1799
|
// IE 11
|
|
1791
|
-
function(t,
|
|
1792
|
-
var
|
|
1793
|
-
if (!(
|
|
1794
|
-
var i = t.charCodeAt(
|
|
1795
|
-
return i < 55296 || i > 56319 ||
|
|
1800
|
+
function(t, r) {
|
|
1801
|
+
var n = t.length;
|
|
1802
|
+
if (!(r < 0 || r >= n)) {
|
|
1803
|
+
var i = t.charCodeAt(r), a;
|
|
1804
|
+
return i < 55296 || i > 56319 || r + 1 === n || (a = t.charCodeAt(r + 1)) < 56320 || a > 57343 ? i : (i - 55296 << 10) + (a - 56320) + 65536;
|
|
1796
1805
|
}
|
|
1797
1806
|
}
|
|
1798
|
-
),
|
|
1807
|
+
), pt = lt ? (
|
|
1799
1808
|
// Native
|
|
1800
1809
|
function(t) {
|
|
1801
1810
|
return t.trimStart();
|
|
@@ -1803,9 +1812,9 @@ var he = at ? (
|
|
|
1803
1812
|
) : (
|
|
1804
1813
|
// Ponyfill
|
|
1805
1814
|
function(t) {
|
|
1806
|
-
return t.replace(
|
|
1815
|
+
return t.replace(it, "");
|
|
1807
1816
|
}
|
|
1808
|
-
),
|
|
1817
|
+
), vt = ft ? (
|
|
1809
1818
|
// Native
|
|
1810
1819
|
function(t) {
|
|
1811
1820
|
return t.trimEnd();
|
|
@@ -1813,69 +1822,69 @@ var he = at ? (
|
|
|
1813
1822
|
) : (
|
|
1814
1823
|
// Ponyfill
|
|
1815
1824
|
function(t) {
|
|
1816
|
-
return t.replace(
|
|
1825
|
+
return t.replace(at, "");
|
|
1817
1826
|
}
|
|
1818
1827
|
);
|
|
1819
|
-
function
|
|
1828
|
+
function Oe(e, t) {
|
|
1820
1829
|
return new RegExp(e, t);
|
|
1821
1830
|
}
|
|
1822
|
-
var
|
|
1823
|
-
if (
|
|
1824
|
-
var
|
|
1825
|
-
|
|
1826
|
-
var
|
|
1827
|
-
|
|
1828
|
-
var i =
|
|
1829
|
-
return (
|
|
1831
|
+
var $;
|
|
1832
|
+
if (Q) {
|
|
1833
|
+
var ce = Oe("([^\\p{White_Space}\\p{Pattern_Syntax}]*)", "yu");
|
|
1834
|
+
$ = function(t, r) {
|
|
1835
|
+
var n;
|
|
1836
|
+
ce.lastIndex = r;
|
|
1837
|
+
var i = ce.exec(t);
|
|
1838
|
+
return (n = i[1]) !== null && n !== void 0 ? n : "";
|
|
1830
1839
|
};
|
|
1831
1840
|
} else
|
|
1832
|
-
|
|
1833
|
-
for (var
|
|
1834
|
-
var i =
|
|
1835
|
-
if (i === void 0 ||
|
|
1841
|
+
$ = function(t, r) {
|
|
1842
|
+
for (var n = []; ; ) {
|
|
1843
|
+
var i = Re(t, r);
|
|
1844
|
+
if (i === void 0 || Pe(i) || xt(i))
|
|
1836
1845
|
break;
|
|
1837
|
-
|
|
1846
|
+
n.push(i), r += i >= 65536 ? 2 : 1;
|
|
1838
1847
|
}
|
|
1839
|
-
return
|
|
1848
|
+
return Y.apply(void 0, n);
|
|
1840
1849
|
};
|
|
1841
|
-
var
|
|
1850
|
+
var Et = (
|
|
1842
1851
|
/** @class */
|
|
1843
1852
|
function() {
|
|
1844
|
-
function e(t,
|
|
1845
|
-
|
|
1853
|
+
function e(t, r) {
|
|
1854
|
+
r === void 0 && (r = {}), this.message = t, this.position = { offset: 0, line: 1, column: 1 }, this.ignoreTag = !!r.ignoreTag, this.locale = r.locale, this.requiresOtherClause = !!r.requiresOtherClause, this.shouldParseSkeletons = !!r.shouldParseSkeletons;
|
|
1846
1855
|
}
|
|
1847
1856
|
return e.prototype.parse = function() {
|
|
1848
1857
|
if (this.offset() !== 0)
|
|
1849
1858
|
throw Error("parser can only be used once");
|
|
1850
1859
|
return this.parseMessage(0, "", !1);
|
|
1851
|
-
}, e.prototype.parseMessage = function(t,
|
|
1860
|
+
}, e.prototype.parseMessage = function(t, r, n) {
|
|
1852
1861
|
for (var i = []; !this.isEOF(); ) {
|
|
1853
1862
|
var a = this.char();
|
|
1854
1863
|
if (a === 123) {
|
|
1855
|
-
var o = this.parseArgument(t,
|
|
1864
|
+
var o = this.parseArgument(t, n);
|
|
1856
1865
|
if (o.err)
|
|
1857
1866
|
return o;
|
|
1858
1867
|
i.push(o.val);
|
|
1859
1868
|
} else {
|
|
1860
1869
|
if (a === 125 && t > 0)
|
|
1861
1870
|
break;
|
|
1862
|
-
if (a === 35 && (
|
|
1871
|
+
if (a === 35 && (r === "plural" || r === "selectordinal")) {
|
|
1863
1872
|
var s = this.clonePosition();
|
|
1864
1873
|
this.bump(), i.push({
|
|
1865
1874
|
type: d.pound,
|
|
1866
|
-
location:
|
|
1875
|
+
location: p(s, this.clonePosition())
|
|
1867
1876
|
});
|
|
1868
1877
|
} else if (a === 60 && !this.ignoreTag && this.peek() === 47) {
|
|
1869
|
-
if (
|
|
1878
|
+
if (n)
|
|
1870
1879
|
break;
|
|
1871
|
-
return this.error(
|
|
1872
|
-
} else if (a === 60 && !this.ignoreTag &&
|
|
1873
|
-
var o = this.parseTag(t,
|
|
1880
|
+
return this.error(m.UNMATCHED_CLOSING_TAG, p(this.clonePosition(), this.clonePosition()));
|
|
1881
|
+
} else if (a === 60 && !this.ignoreTag && K(this.peek() || 0)) {
|
|
1882
|
+
var o = this.parseTag(t, r);
|
|
1874
1883
|
if (o.err)
|
|
1875
1884
|
return o;
|
|
1876
1885
|
i.push(o.val);
|
|
1877
1886
|
} else {
|
|
1878
|
-
var o = this.parseLiteral(t,
|
|
1887
|
+
var o = this.parseLiteral(t, r);
|
|
1879
1888
|
if (o.err)
|
|
1880
1889
|
return o;
|
|
1881
1890
|
i.push(o.val);
|
|
@@ -1883,8 +1892,8 @@ var vt = (
|
|
|
1883
1892
|
}
|
|
1884
1893
|
}
|
|
1885
1894
|
return { val: i, err: null };
|
|
1886
|
-
}, e.prototype.parseTag = function(t,
|
|
1887
|
-
var
|
|
1895
|
+
}, e.prototype.parseTag = function(t, r) {
|
|
1896
|
+
var n = this.clonePosition();
|
|
1888
1897
|
this.bump();
|
|
1889
1898
|
var i = this.parseTagName();
|
|
1890
1899
|
if (this.bumpSpace(), this.bumpIf("/>"))
|
|
@@ -1892,45 +1901,45 @@ var vt = (
|
|
|
1892
1901
|
val: {
|
|
1893
1902
|
type: d.literal,
|
|
1894
1903
|
value: "<".concat(i, "/>"),
|
|
1895
|
-
location:
|
|
1904
|
+
location: p(n, this.clonePosition())
|
|
1896
1905
|
},
|
|
1897
1906
|
err: null
|
|
1898
1907
|
};
|
|
1899
1908
|
if (this.bumpIf(">")) {
|
|
1900
|
-
var a = this.parseMessage(t + 1,
|
|
1909
|
+
var a = this.parseMessage(t + 1, r, !0);
|
|
1901
1910
|
if (a.err)
|
|
1902
1911
|
return a;
|
|
1903
1912
|
var o = a.val, s = this.clonePosition();
|
|
1904
1913
|
if (this.bumpIf("</")) {
|
|
1905
|
-
if (this.isEOF() ||
|
|
1906
|
-
return this.error(
|
|
1914
|
+
if (this.isEOF() || !K(this.char()))
|
|
1915
|
+
return this.error(m.INVALID_TAG, p(s, this.clonePosition()));
|
|
1907
1916
|
var h = this.clonePosition(), l = this.parseTagName();
|
|
1908
|
-
return i !== l ? this.error(
|
|
1917
|
+
return i !== l ? this.error(m.UNMATCHED_CLOSING_TAG, p(h, this.clonePosition())) : (this.bumpSpace(), this.bumpIf(">") ? {
|
|
1909
1918
|
val: {
|
|
1910
1919
|
type: d.tag,
|
|
1911
1920
|
value: i,
|
|
1912
1921
|
children: o,
|
|
1913
|
-
location:
|
|
1922
|
+
location: p(n, this.clonePosition())
|
|
1914
1923
|
},
|
|
1915
1924
|
err: null
|
|
1916
|
-
} : this.error(
|
|
1925
|
+
} : this.error(m.INVALID_TAG, p(s, this.clonePosition())));
|
|
1917
1926
|
} else
|
|
1918
|
-
return this.error(
|
|
1927
|
+
return this.error(m.UNCLOSED_TAG, p(n, this.clonePosition()));
|
|
1919
1928
|
} else
|
|
1920
|
-
return this.error(
|
|
1929
|
+
return this.error(m.INVALID_TAG, p(n, this.clonePosition()));
|
|
1921
1930
|
}, e.prototype.parseTagName = function() {
|
|
1922
1931
|
var t = this.offset();
|
|
1923
|
-
for (this.bump(); !this.isEOF() &&
|
|
1932
|
+
for (this.bump(); !this.isEOF() && dt(this.char()); )
|
|
1924
1933
|
this.bump();
|
|
1925
1934
|
return this.message.slice(t, this.offset());
|
|
1926
|
-
}, e.prototype.parseLiteral = function(t,
|
|
1927
|
-
for (var
|
|
1928
|
-
var a = this.tryParseQuote(
|
|
1935
|
+
}, e.prototype.parseLiteral = function(t, r) {
|
|
1936
|
+
for (var n = this.clonePosition(), i = ""; ; ) {
|
|
1937
|
+
var a = this.tryParseQuote(r);
|
|
1929
1938
|
if (a) {
|
|
1930
1939
|
i += a;
|
|
1931
1940
|
continue;
|
|
1932
1941
|
}
|
|
1933
|
-
var o = this.tryParseUnquoted(t,
|
|
1942
|
+
var o = this.tryParseUnquoted(t, r);
|
|
1934
1943
|
if (o) {
|
|
1935
1944
|
i += o;
|
|
1936
1945
|
continue;
|
|
@@ -1942,14 +1951,14 @@ var vt = (
|
|
|
1942
1951
|
}
|
|
1943
1952
|
break;
|
|
1944
1953
|
}
|
|
1945
|
-
var h =
|
|
1954
|
+
var h = p(n, this.clonePosition());
|
|
1946
1955
|
return {
|
|
1947
1956
|
val: { type: d.literal, value: i, location: h },
|
|
1948
1957
|
err: null
|
|
1949
1958
|
};
|
|
1950
1959
|
}, e.prototype.tryParseLeftAngleBracket = function() {
|
|
1951
1960
|
return !this.isEOF() && this.char() === 60 && (this.ignoreTag || // If at the opening tag or closing tag position, bail.
|
|
1952
|
-
!
|
|
1961
|
+
!bt(this.peek() || 0)) ? (this.bump(), "<") : null;
|
|
1953
1962
|
}, e.prototype.tryParseQuote = function(t) {
|
|
1954
1963
|
if (this.isEOF() || this.char() !== 39)
|
|
1955
1964
|
return null;
|
|
@@ -1969,37 +1978,37 @@ var vt = (
|
|
|
1969
1978
|
return null;
|
|
1970
1979
|
}
|
|
1971
1980
|
this.bump();
|
|
1972
|
-
var
|
|
1981
|
+
var r = [this.char()];
|
|
1973
1982
|
for (this.bump(); !this.isEOF(); ) {
|
|
1974
|
-
var
|
|
1975
|
-
if (
|
|
1983
|
+
var n = this.char();
|
|
1984
|
+
if (n === 39)
|
|
1976
1985
|
if (this.peek() === 39)
|
|
1977
|
-
|
|
1986
|
+
r.push(39), this.bump();
|
|
1978
1987
|
else {
|
|
1979
1988
|
this.bump();
|
|
1980
1989
|
break;
|
|
1981
1990
|
}
|
|
1982
1991
|
else
|
|
1983
|
-
|
|
1992
|
+
r.push(n);
|
|
1984
1993
|
this.bump();
|
|
1985
1994
|
}
|
|
1986
|
-
return
|
|
1987
|
-
}, e.prototype.tryParseUnquoted = function(t,
|
|
1995
|
+
return Y.apply(void 0, r);
|
|
1996
|
+
}, e.prototype.tryParseUnquoted = function(t, r) {
|
|
1988
1997
|
if (this.isEOF())
|
|
1989
1998
|
return null;
|
|
1990
|
-
var
|
|
1991
|
-
return
|
|
1992
|
-
}, e.prototype.parseArgument = function(t,
|
|
1993
|
-
var
|
|
1999
|
+
var n = this.char();
|
|
2000
|
+
return n === 60 || n === 123 || n === 35 && (r === "plural" || r === "selectordinal") || n === 125 && t > 0 ? null : (this.bump(), Y(n));
|
|
2001
|
+
}, e.prototype.parseArgument = function(t, r) {
|
|
2002
|
+
var n = this.clonePosition();
|
|
1994
2003
|
if (this.bump(), this.bumpSpace(), this.isEOF())
|
|
1995
|
-
return this.error(
|
|
2004
|
+
return this.error(m.EXPECT_ARGUMENT_CLOSING_BRACE, p(n, this.clonePosition()));
|
|
1996
2005
|
if (this.char() === 125)
|
|
1997
|
-
return this.bump(), this.error(
|
|
2006
|
+
return this.bump(), this.error(m.EMPTY_ARGUMENT, p(n, this.clonePosition()));
|
|
1998
2007
|
var i = this.parseIdentifierIfPossible().value;
|
|
1999
2008
|
if (!i)
|
|
2000
|
-
return this.error(
|
|
2009
|
+
return this.error(m.MALFORMED_ARGUMENT, p(n, this.clonePosition()));
|
|
2001
2010
|
if (this.bumpSpace(), this.isEOF())
|
|
2002
|
-
return this.error(
|
|
2011
|
+
return this.error(m.EXPECT_ARGUMENT_CLOSING_BRACE, p(n, this.clonePosition()));
|
|
2003
2012
|
switch (this.char()) {
|
|
2004
2013
|
case 125:
|
|
2005
2014
|
return this.bump(), {
|
|
@@ -2007,25 +2016,25 @@ var vt = (
|
|
|
2007
2016
|
type: d.argument,
|
|
2008
2017
|
// value does not include the opening and closing braces.
|
|
2009
2018
|
value: i,
|
|
2010
|
-
location:
|
|
2019
|
+
location: p(n, this.clonePosition())
|
|
2011
2020
|
},
|
|
2012
2021
|
err: null
|
|
2013
2022
|
};
|
|
2014
2023
|
case 44:
|
|
2015
|
-
return this.bump(), this.bumpSpace(), this.isEOF() ? this.error(
|
|
2024
|
+
return this.bump(), this.bumpSpace(), this.isEOF() ? this.error(m.EXPECT_ARGUMENT_CLOSING_BRACE, p(n, this.clonePosition())) : this.parseArgumentOptions(t, r, i, n);
|
|
2016
2025
|
default:
|
|
2017
|
-
return this.error(
|
|
2026
|
+
return this.error(m.MALFORMED_ARGUMENT, p(n, this.clonePosition()));
|
|
2018
2027
|
}
|
|
2019
2028
|
}, e.prototype.parseIdentifierIfPossible = function() {
|
|
2020
|
-
var t = this.clonePosition(),
|
|
2029
|
+
var t = this.clonePosition(), r = this.offset(), n = $(this.message, r), i = r + n.length;
|
|
2021
2030
|
this.bumpTo(i);
|
|
2022
|
-
var a = this.clonePosition(), o =
|
|
2023
|
-
return { value:
|
|
2024
|
-
}, e.prototype.parseArgumentOptions = function(t,
|
|
2031
|
+
var a = this.clonePosition(), o = p(t, a);
|
|
2032
|
+
return { value: n, location: o };
|
|
2033
|
+
}, e.prototype.parseArgumentOptions = function(t, r, n, i) {
|
|
2025
2034
|
var a, o = this.clonePosition(), s = this.parseIdentifierIfPossible().value, h = this.clonePosition();
|
|
2026
2035
|
switch (s) {
|
|
2027
2036
|
case "":
|
|
2028
|
-
return this.error(
|
|
2037
|
+
return this.error(m.EXPECT_ARGUMENT_TYPE, p(o, h));
|
|
2029
2038
|
case "number":
|
|
2030
2039
|
case "date":
|
|
2031
2040
|
case "time": {
|
|
@@ -2036,37 +2045,37 @@ var vt = (
|
|
|
2036
2045
|
var u = this.clonePosition(), f = this.parseSimpleArgStyleIfPossible();
|
|
2037
2046
|
if (f.err)
|
|
2038
2047
|
return f;
|
|
2039
|
-
var c =
|
|
2048
|
+
var c = vt(f.val);
|
|
2040
2049
|
if (c.length === 0)
|
|
2041
|
-
return this.error(
|
|
2042
|
-
var
|
|
2043
|
-
l = { style: c, styleLocation:
|
|
2050
|
+
return this.error(m.EXPECT_ARGUMENT_STYLE, p(this.clonePosition(), this.clonePosition()));
|
|
2051
|
+
var g = p(u, this.clonePosition());
|
|
2052
|
+
l = { style: c, styleLocation: g };
|
|
2044
2053
|
}
|
|
2045
2054
|
var E = this.tryParseArgumentClose(i);
|
|
2046
2055
|
if (E.err)
|
|
2047
2056
|
return E;
|
|
2048
|
-
var b =
|
|
2049
|
-
if (l &&
|
|
2050
|
-
var
|
|
2057
|
+
var b = p(i, this.clonePosition());
|
|
2058
|
+
if (l && le(l == null ? void 0 : l.style, "::", 0)) {
|
|
2059
|
+
var y = pt(l.style.slice(2));
|
|
2051
2060
|
if (s === "number") {
|
|
2052
|
-
var f = this.parseNumberSkeletonFromString(
|
|
2061
|
+
var f = this.parseNumberSkeletonFromString(y, l.styleLocation);
|
|
2053
2062
|
return f.err ? f : {
|
|
2054
|
-
val: { type: d.number, value:
|
|
2063
|
+
val: { type: d.number, value: n, location: b, style: f.val },
|
|
2055
2064
|
err: null
|
|
2056
2065
|
};
|
|
2057
2066
|
} else {
|
|
2058
|
-
if (
|
|
2059
|
-
return this.error(
|
|
2060
|
-
var
|
|
2061
|
-
this.locale && (
|
|
2067
|
+
if (y.length === 0)
|
|
2068
|
+
return this.error(m.EXPECT_DATE_TIME_SKELETON, b);
|
|
2069
|
+
var T = y;
|
|
2070
|
+
this.locale && (T = rt(y, this.locale));
|
|
2062
2071
|
var c = {
|
|
2063
|
-
type:
|
|
2064
|
-
pattern:
|
|
2072
|
+
type: w.dateTime,
|
|
2073
|
+
pattern: T,
|
|
2065
2074
|
location: l.styleLocation,
|
|
2066
|
-
parsedOptions: this.shouldParseSkeletons ?
|
|
2067
|
-
},
|
|
2075
|
+
parsedOptions: this.shouldParseSkeletons ? Je(T) : {}
|
|
2076
|
+
}, N = s === "date" ? d.date : d.time;
|
|
2068
2077
|
return {
|
|
2069
|
-
val: { type:
|
|
2078
|
+
val: { type: N, value: n, location: b, style: c },
|
|
2070
2079
|
err: null
|
|
2071
2080
|
};
|
|
2072
2081
|
}
|
|
@@ -2074,7 +2083,7 @@ var vt = (
|
|
|
2074
2083
|
return {
|
|
2075
2084
|
val: {
|
|
2076
2085
|
type: s === "number" ? d.number : s === "date" ? d.date : d.time,
|
|
2077
|
-
value:
|
|
2086
|
+
value: n,
|
|
2078
2087
|
location: b,
|
|
2079
2088
|
style: (a = l == null ? void 0 : l.style) !== null && a !== void 0 ? a : null
|
|
2080
2089
|
},
|
|
@@ -2084,61 +2093,61 @@ var vt = (
|
|
|
2084
2093
|
case "plural":
|
|
2085
2094
|
case "selectordinal":
|
|
2086
2095
|
case "select": {
|
|
2087
|
-
var
|
|
2096
|
+
var S = this.clonePosition();
|
|
2088
2097
|
if (this.bumpSpace(), !this.bumpIf(","))
|
|
2089
|
-
return this.error(
|
|
2098
|
+
return this.error(m.EXPECT_SELECT_ARGUMENT_OPTIONS, p(S, x({}, S)));
|
|
2090
2099
|
this.bumpSpace();
|
|
2091
|
-
var F = this.parseIdentifierIfPossible(),
|
|
2100
|
+
var F = this.parseIdentifierIfPossible(), M = 0;
|
|
2092
2101
|
if (s !== "select" && F.value === "offset") {
|
|
2093
2102
|
if (!this.bumpIf(":"))
|
|
2094
|
-
return this.error(
|
|
2103
|
+
return this.error(m.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE, p(this.clonePosition(), this.clonePosition()));
|
|
2095
2104
|
this.bumpSpace();
|
|
2096
|
-
var f = this.tryParseDecimalInteger(
|
|
2105
|
+
var f = this.tryParseDecimalInteger(m.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE, m.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE);
|
|
2097
2106
|
if (f.err)
|
|
2098
2107
|
return f;
|
|
2099
|
-
this.bumpSpace(), F = this.parseIdentifierIfPossible(),
|
|
2108
|
+
this.bumpSpace(), F = this.parseIdentifierIfPossible(), M = f.val;
|
|
2100
2109
|
}
|
|
2101
|
-
var
|
|
2102
|
-
if (
|
|
2103
|
-
return
|
|
2110
|
+
var U = this.tryParsePluralOrSelectOptions(t, s, r, F);
|
|
2111
|
+
if (U.err)
|
|
2112
|
+
return U;
|
|
2104
2113
|
var E = this.tryParseArgumentClose(i);
|
|
2105
2114
|
if (E.err)
|
|
2106
2115
|
return E;
|
|
2107
|
-
var
|
|
2116
|
+
var ae = p(i, this.clonePosition());
|
|
2108
2117
|
return s === "select" ? {
|
|
2109
2118
|
val: {
|
|
2110
2119
|
type: d.select,
|
|
2111
|
-
value:
|
|
2112
|
-
options:
|
|
2113
|
-
location:
|
|
2120
|
+
value: n,
|
|
2121
|
+
options: fe(U.val),
|
|
2122
|
+
location: ae
|
|
2114
2123
|
},
|
|
2115
2124
|
err: null
|
|
2116
2125
|
} : {
|
|
2117
2126
|
val: {
|
|
2118
2127
|
type: d.plural,
|
|
2119
|
-
value:
|
|
2120
|
-
options:
|
|
2121
|
-
offset:
|
|
2128
|
+
value: n,
|
|
2129
|
+
options: fe(U.val),
|
|
2130
|
+
offset: M,
|
|
2122
2131
|
pluralType: s === "plural" ? "cardinal" : "ordinal",
|
|
2123
|
-
location:
|
|
2132
|
+
location: ae
|
|
2124
2133
|
},
|
|
2125
2134
|
err: null
|
|
2126
2135
|
};
|
|
2127
2136
|
}
|
|
2128
2137
|
default:
|
|
2129
|
-
return this.error(
|
|
2138
|
+
return this.error(m.INVALID_ARGUMENT_TYPE, p(o, h));
|
|
2130
2139
|
}
|
|
2131
2140
|
}, e.prototype.tryParseArgumentClose = function(t) {
|
|
2132
|
-
return this.isEOF() || this.char() !== 125 ? this.error(
|
|
2141
|
+
return this.isEOF() || this.char() !== 125 ? this.error(m.EXPECT_ARGUMENT_CLOSING_BRACE, p(t, this.clonePosition())) : (this.bump(), { val: !0, err: null });
|
|
2133
2142
|
}, e.prototype.parseSimpleArgStyleIfPossible = function() {
|
|
2134
|
-
for (var t = 0,
|
|
2135
|
-
var
|
|
2136
|
-
switch (
|
|
2143
|
+
for (var t = 0, r = this.clonePosition(); !this.isEOF(); ) {
|
|
2144
|
+
var n = this.char();
|
|
2145
|
+
switch (n) {
|
|
2137
2146
|
case 39: {
|
|
2138
2147
|
this.bump();
|
|
2139
2148
|
var i = this.clonePosition();
|
|
2140
2149
|
if (!this.bumpUntil("'"))
|
|
2141
|
-
return this.error(
|
|
2150
|
+
return this.error(m.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE, p(i, this.clonePosition()));
|
|
2142
2151
|
this.bump();
|
|
2143
2152
|
break;
|
|
2144
2153
|
}
|
|
@@ -2151,7 +2160,7 @@ var vt = (
|
|
|
2151
2160
|
t -= 1;
|
|
2152
2161
|
else
|
|
2153
2162
|
return {
|
|
2154
|
-
val: this.message.slice(
|
|
2163
|
+
val: this.message.slice(r.offset, this.offset()),
|
|
2155
2164
|
err: null
|
|
2156
2165
|
};
|
|
2157
2166
|
break;
|
|
@@ -2162,61 +2171,61 @@ var vt = (
|
|
|
2162
2171
|
}
|
|
2163
2172
|
}
|
|
2164
2173
|
return {
|
|
2165
|
-
val: this.message.slice(
|
|
2174
|
+
val: this.message.slice(r.offset, this.offset()),
|
|
2166
2175
|
err: null
|
|
2167
2176
|
};
|
|
2168
|
-
}, e.prototype.parseNumberSkeletonFromString = function(t,
|
|
2169
|
-
var
|
|
2177
|
+
}, e.prototype.parseNumberSkeletonFromString = function(t, r) {
|
|
2178
|
+
var n = [];
|
|
2170
2179
|
try {
|
|
2171
|
-
|
|
2180
|
+
n = Ye(t);
|
|
2172
2181
|
} catch {
|
|
2173
|
-
return this.error(
|
|
2182
|
+
return this.error(m.INVALID_NUMBER_SKELETON, r);
|
|
2174
2183
|
}
|
|
2175
2184
|
return {
|
|
2176
2185
|
val: {
|
|
2177
|
-
type:
|
|
2178
|
-
tokens:
|
|
2179
|
-
location:
|
|
2180
|
-
parsedOptions: this.shouldParseSkeletons ?
|
|
2186
|
+
type: w.number,
|
|
2187
|
+
tokens: n,
|
|
2188
|
+
location: r,
|
|
2189
|
+
parsedOptions: this.shouldParseSkeletons ? tt(n) : {}
|
|
2181
2190
|
},
|
|
2182
2191
|
err: null
|
|
2183
2192
|
};
|
|
2184
|
-
}, e.prototype.tryParsePluralOrSelectOptions = function(t,
|
|
2193
|
+
}, e.prototype.tryParsePluralOrSelectOptions = function(t, r, n, i) {
|
|
2185
2194
|
for (var a, o = !1, s = [], h = /* @__PURE__ */ new Set(), l = i.value, u = i.location; ; ) {
|
|
2186
2195
|
if (l.length === 0) {
|
|
2187
2196
|
var f = this.clonePosition();
|
|
2188
|
-
if (
|
|
2189
|
-
var c = this.tryParseDecimalInteger(
|
|
2197
|
+
if (r !== "select" && this.bumpIf("=")) {
|
|
2198
|
+
var c = this.tryParseDecimalInteger(m.EXPECT_PLURAL_ARGUMENT_SELECTOR, m.INVALID_PLURAL_ARGUMENT_SELECTOR);
|
|
2190
2199
|
if (c.err)
|
|
2191
2200
|
return c;
|
|
2192
|
-
u =
|
|
2201
|
+
u = p(f, this.clonePosition()), l = this.message.slice(f.offset, this.offset());
|
|
2193
2202
|
} else
|
|
2194
2203
|
break;
|
|
2195
2204
|
}
|
|
2196
2205
|
if (h.has(l))
|
|
2197
|
-
return this.error(
|
|
2206
|
+
return this.error(r === "select" ? m.DUPLICATE_SELECT_ARGUMENT_SELECTOR : m.DUPLICATE_PLURAL_ARGUMENT_SELECTOR, u);
|
|
2198
2207
|
l === "other" && (o = !0), this.bumpSpace();
|
|
2199
|
-
var
|
|
2208
|
+
var g = this.clonePosition();
|
|
2200
2209
|
if (!this.bumpIf("{"))
|
|
2201
|
-
return this.error(
|
|
2202
|
-
var E = this.parseMessage(t + 1,
|
|
2210
|
+
return this.error(r === "select" ? m.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT : m.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT, p(this.clonePosition(), this.clonePosition()));
|
|
2211
|
+
var E = this.parseMessage(t + 1, r, n);
|
|
2203
2212
|
if (E.err)
|
|
2204
2213
|
return E;
|
|
2205
|
-
var b = this.tryParseArgumentClose(
|
|
2214
|
+
var b = this.tryParseArgumentClose(g);
|
|
2206
2215
|
if (b.err)
|
|
2207
2216
|
return b;
|
|
2208
2217
|
s.push([
|
|
2209
2218
|
l,
|
|
2210
2219
|
{
|
|
2211
2220
|
value: E.val,
|
|
2212
|
-
location:
|
|
2221
|
+
location: p(g, this.clonePosition())
|
|
2213
2222
|
}
|
|
2214
2223
|
]), h.add(l), this.bumpSpace(), a = this.parseIdentifierIfPossible(), l = a.value, u = a.location;
|
|
2215
2224
|
}
|
|
2216
|
-
return s.length === 0 ? this.error(
|
|
2217
|
-
}, e.prototype.tryParseDecimalInteger = function(t,
|
|
2218
|
-
var
|
|
2219
|
-
this.bumpIf("+") || this.bumpIf("-") && (
|
|
2225
|
+
return s.length === 0 ? this.error(r === "select" ? m.EXPECT_SELECT_ARGUMENT_SELECTOR : m.EXPECT_PLURAL_ARGUMENT_SELECTOR, p(this.clonePosition(), this.clonePosition())) : this.requiresOtherClause && !o ? this.error(m.MISSING_OTHER_CLAUSE, p(this.clonePosition(), this.clonePosition())) : { val: s, err: null };
|
|
2226
|
+
}, e.prototype.tryParseDecimalInteger = function(t, r) {
|
|
2227
|
+
var n = 1, i = this.clonePosition();
|
|
2228
|
+
this.bumpIf("+") || this.bumpIf("-") && (n = -1);
|
|
2220
2229
|
for (var a = !1, o = 0; !this.isEOF(); ) {
|
|
2221
2230
|
var s = this.char();
|
|
2222
2231
|
if (s >= 48 && s <= 57)
|
|
@@ -2224,8 +2233,8 @@ var vt = (
|
|
|
2224
2233
|
else
|
|
2225
2234
|
break;
|
|
2226
2235
|
}
|
|
2227
|
-
var h =
|
|
2228
|
-
return a ? (o *=
|
|
2236
|
+
var h = p(i, this.clonePosition());
|
|
2237
|
+
return a ? (o *= n, mt(o) ? { val: o, err: null } : this.error(r, h)) : this.error(t, h);
|
|
2229
2238
|
}, e.prototype.offset = function() {
|
|
2230
2239
|
return this.position.offset;
|
|
2231
2240
|
}, e.prototype.isEOF = function() {
|
|
@@ -2240,17 +2249,17 @@ var vt = (
|
|
|
2240
2249
|
var t = this.position.offset;
|
|
2241
2250
|
if (t >= this.message.length)
|
|
2242
2251
|
throw Error("out of bound");
|
|
2243
|
-
var
|
|
2244
|
-
if (
|
|
2252
|
+
var r = Re(this.message, t);
|
|
2253
|
+
if (r === void 0)
|
|
2245
2254
|
throw Error("Offset ".concat(t, " is at invalid UTF-16 code unit boundary"));
|
|
2246
|
-
return
|
|
2247
|
-
}, e.prototype.error = function(t,
|
|
2255
|
+
return r;
|
|
2256
|
+
}, e.prototype.error = function(t, r) {
|
|
2248
2257
|
return {
|
|
2249
2258
|
val: null,
|
|
2250
2259
|
err: {
|
|
2251
2260
|
kind: t,
|
|
2252
2261
|
message: this.message,
|
|
2253
|
-
location:
|
|
2262
|
+
location: r
|
|
2254
2263
|
}
|
|
2255
2264
|
};
|
|
2256
2265
|
}, e.prototype.bump = function() {
|
|
@@ -2259,336 +2268,336 @@ var vt = (
|
|
|
2259
2268
|
t === 10 ? (this.position.line += 1, this.position.column = 1, this.position.offset += 1) : (this.position.column += 1, this.position.offset += t < 65536 ? 1 : 2);
|
|
2260
2269
|
}
|
|
2261
2270
|
}, e.prototype.bumpIf = function(t) {
|
|
2262
|
-
if (
|
|
2263
|
-
for (var
|
|
2271
|
+
if (le(this.message, t, this.offset())) {
|
|
2272
|
+
for (var r = 0; r < t.length; r++)
|
|
2264
2273
|
this.bump();
|
|
2265
2274
|
return !0;
|
|
2266
2275
|
}
|
|
2267
2276
|
return !1;
|
|
2268
2277
|
}, e.prototype.bumpUntil = function(t) {
|
|
2269
|
-
var
|
|
2270
|
-
return
|
|
2278
|
+
var r = this.offset(), n = this.message.indexOf(t, r);
|
|
2279
|
+
return n >= 0 ? (this.bumpTo(n), !0) : (this.bumpTo(this.message.length), !1);
|
|
2271
2280
|
}, e.prototype.bumpTo = function(t) {
|
|
2272
2281
|
if (this.offset() > t)
|
|
2273
2282
|
throw Error("targetOffset ".concat(t, " must be greater than or equal to the current offset ").concat(this.offset()));
|
|
2274
2283
|
for (t = Math.min(t, this.message.length); ; ) {
|
|
2275
|
-
var
|
|
2276
|
-
if (
|
|
2284
|
+
var r = this.offset();
|
|
2285
|
+
if (r === t)
|
|
2277
2286
|
break;
|
|
2278
|
-
if (
|
|
2287
|
+
if (r > t)
|
|
2279
2288
|
throw Error("targetOffset ".concat(t, " is at invalid UTF-16 code unit boundary"));
|
|
2280
2289
|
if (this.bump(), this.isEOF())
|
|
2281
2290
|
break;
|
|
2282
2291
|
}
|
|
2283
2292
|
}, e.prototype.bumpSpace = function() {
|
|
2284
|
-
for (; !this.isEOF() &&
|
|
2293
|
+
for (; !this.isEOF() && Pe(this.char()); )
|
|
2285
2294
|
this.bump();
|
|
2286
2295
|
}, e.prototype.peek = function() {
|
|
2287
2296
|
if (this.isEOF())
|
|
2288
2297
|
return null;
|
|
2289
|
-
var t = this.char(),
|
|
2290
|
-
return
|
|
2298
|
+
var t = this.char(), r = this.offset(), n = this.message.charCodeAt(r + (t >= 65536 ? 2 : 1));
|
|
2299
|
+
return n ?? null;
|
|
2291
2300
|
}, e;
|
|
2292
2301
|
}()
|
|
2293
2302
|
);
|
|
2294
|
-
function
|
|
2303
|
+
function K(e) {
|
|
2295
2304
|
return e >= 97 && e <= 122 || e >= 65 && e <= 90;
|
|
2296
2305
|
}
|
|
2297
|
-
function Et(e) {
|
|
2298
|
-
return $(e) || e === 47;
|
|
2299
|
-
}
|
|
2300
2306
|
function bt(e) {
|
|
2307
|
+
return K(e) || e === 47;
|
|
2308
|
+
}
|
|
2309
|
+
function dt(e) {
|
|
2301
2310
|
return e === 45 || e === 46 || e >= 48 && e <= 57 || e === 95 || e >= 97 && e <= 122 || e >= 65 && e <= 90 || e == 183 || e >= 192 && e <= 214 || e >= 216 && e <= 246 || e >= 248 && e <= 893 || e >= 895 && e <= 8191 || e >= 8204 && e <= 8205 || e >= 8255 && e <= 8256 || e >= 8304 && e <= 8591 || e >= 11264 && e <= 12271 || e >= 12289 && e <= 55295 || e >= 63744 && e <= 64975 || e >= 65008 && e <= 65533 || e >= 65536 && e <= 983039;
|
|
2302
2311
|
}
|
|
2303
|
-
function
|
|
2312
|
+
function Pe(e) {
|
|
2304
2313
|
return e >= 9 && e <= 13 || e === 32 || e === 133 || e >= 8206 && e <= 8207 || e === 8232 || e === 8233;
|
|
2305
2314
|
}
|
|
2306
|
-
function
|
|
2315
|
+
function xt(e) {
|
|
2307
2316
|
return e >= 33 && e <= 35 || e === 36 || e >= 37 && e <= 39 || e === 40 || e === 41 || e === 42 || e === 43 || e === 44 || e === 45 || e >= 46 && e <= 47 || e >= 58 && e <= 59 || e >= 60 && e <= 62 || e >= 63 && e <= 64 || e === 91 || e === 92 || e === 93 || e === 94 || e === 96 || e === 123 || e === 124 || e === 125 || e === 126 || e === 161 || e >= 162 && e <= 165 || e === 166 || e === 167 || e === 169 || e === 171 || e === 172 || e === 174 || e === 176 || e === 177 || e === 182 || e === 187 || e === 191 || e === 215 || e === 247 || e >= 8208 && e <= 8213 || e >= 8214 && e <= 8215 || e === 8216 || e === 8217 || e === 8218 || e >= 8219 && e <= 8220 || e === 8221 || e === 8222 || e === 8223 || e >= 8224 && e <= 8231 || e >= 8240 && e <= 8248 || e === 8249 || e === 8250 || e >= 8251 && e <= 8254 || e >= 8257 && e <= 8259 || e === 8260 || e === 8261 || e === 8262 || e >= 8263 && e <= 8273 || e === 8274 || e === 8275 || e >= 8277 && e <= 8286 || e >= 8592 && e <= 8596 || e >= 8597 && e <= 8601 || e >= 8602 && e <= 8603 || e >= 8604 && e <= 8607 || e === 8608 || e >= 8609 && e <= 8610 || e === 8611 || e >= 8612 && e <= 8613 || e === 8614 || e >= 8615 && e <= 8621 || e === 8622 || e >= 8623 && e <= 8653 || e >= 8654 && e <= 8655 || e >= 8656 && e <= 8657 || e === 8658 || e === 8659 || e === 8660 || e >= 8661 && e <= 8691 || e >= 8692 && e <= 8959 || e >= 8960 && e <= 8967 || e === 8968 || e === 8969 || e === 8970 || e === 8971 || e >= 8972 && e <= 8991 || e >= 8992 && e <= 8993 || e >= 8994 && e <= 9e3 || e === 9001 || e === 9002 || e >= 9003 && e <= 9083 || e === 9084 || e >= 9085 && e <= 9114 || e >= 9115 && e <= 9139 || e >= 9140 && e <= 9179 || e >= 9180 && e <= 9185 || e >= 9186 && e <= 9254 || e >= 9255 && e <= 9279 || e >= 9280 && e <= 9290 || e >= 9291 && e <= 9311 || e >= 9472 && e <= 9654 || e === 9655 || e >= 9656 && e <= 9664 || e === 9665 || e >= 9666 && e <= 9719 || e >= 9720 && e <= 9727 || e >= 9728 && e <= 9838 || e === 9839 || e >= 9840 && e <= 10087 || e === 10088 || e === 10089 || e === 10090 || e === 10091 || e === 10092 || e === 10093 || e === 10094 || e === 10095 || e === 10096 || e === 10097 || e === 10098 || e === 10099 || e === 10100 || e === 10101 || e >= 10132 && e <= 10175 || e >= 10176 && e <= 10180 || e === 10181 || e === 10182 || e >= 10183 && e <= 10213 || e === 10214 || e === 10215 || e === 10216 || e === 10217 || e === 10218 || e === 10219 || e === 10220 || e === 10221 || e === 10222 || e === 10223 || e >= 10224 && e <= 10239 || e >= 10240 && e <= 10495 || e >= 10496 && e <= 10626 || e === 10627 || e === 10628 || e === 10629 || e === 10630 || e === 10631 || e === 10632 || e === 10633 || e === 10634 || e === 10635 || e === 10636 || e === 10637 || e === 10638 || e === 10639 || e === 10640 || e === 10641 || e === 10642 || e === 10643 || e === 10644 || e === 10645 || e === 10646 || e === 10647 || e === 10648 || e >= 10649 && e <= 10711 || e === 10712 || e === 10713 || e === 10714 || e === 10715 || e >= 10716 && e <= 10747 || e === 10748 || e === 10749 || e >= 10750 && e <= 11007 || e >= 11008 && e <= 11055 || e >= 11056 && e <= 11076 || e >= 11077 && e <= 11078 || e >= 11079 && e <= 11084 || e >= 11085 && e <= 11123 || e >= 11124 && e <= 11125 || e >= 11126 && e <= 11157 || e === 11158 || e >= 11159 && e <= 11263 || e >= 11776 && e <= 11777 || e === 11778 || e === 11779 || e === 11780 || e === 11781 || e >= 11782 && e <= 11784 || e === 11785 || e === 11786 || e === 11787 || e === 11788 || e === 11789 || e >= 11790 && e <= 11798 || e === 11799 || e >= 11800 && e <= 11801 || e === 11802 || e === 11803 || e === 11804 || e === 11805 || e >= 11806 && e <= 11807 || e === 11808 || e === 11809 || e === 11810 || e === 11811 || e === 11812 || e === 11813 || e === 11814 || e === 11815 || e === 11816 || e === 11817 || e >= 11818 && e <= 11822 || e === 11823 || e >= 11824 && e <= 11833 || e >= 11834 && e <= 11835 || e >= 11836 && e <= 11839 || e === 11840 || e === 11841 || e === 11842 || e >= 11843 && e <= 11855 || e >= 11856 && e <= 11857 || e === 11858 || e >= 11859 && e <= 11903 || e >= 12289 && e <= 12291 || e === 12296 || e === 12297 || e === 12298 || e === 12299 || e === 12300 || e === 12301 || e === 12302 || e === 12303 || e === 12304 || e === 12305 || e >= 12306 && e <= 12307 || e === 12308 || e === 12309 || e === 12310 || e === 12311 || e === 12312 || e === 12313 || e === 12314 || e === 12315 || e === 12316 || e === 12317 || e >= 12318 && e <= 12319 || e === 12320 || e === 12336 || e === 64830 || e === 64831 || e >= 65093 && e <= 65094;
|
|
2308
2317
|
}
|
|
2309
|
-
function
|
|
2318
|
+
function ee(e) {
|
|
2310
2319
|
e.forEach(function(t) {
|
|
2311
|
-
if (delete t.location,
|
|
2312
|
-
for (var
|
|
2313
|
-
delete t.options[
|
|
2320
|
+
if (delete t.location, Te(t) || Se(t))
|
|
2321
|
+
for (var r in t.options)
|
|
2322
|
+
delete t.options[r].location, ee(t.options[r].value);
|
|
2314
2323
|
else
|
|
2315
|
-
|
|
2324
|
+
de(t) && Ae(t.style) || (xe(t) || ye(t)) && J(t.style) ? delete t.style.location : Ie(t) && ee(t.children);
|
|
2316
2325
|
});
|
|
2317
2326
|
}
|
|
2318
|
-
function
|
|
2319
|
-
t === void 0 && (t = {}), t =
|
|
2320
|
-
var
|
|
2321
|
-
if (
|
|
2322
|
-
var
|
|
2323
|
-
throw
|
|
2327
|
+
function yt(e, t) {
|
|
2328
|
+
t === void 0 && (t = {}), t = x({ shouldParseSkeletons: !0, requiresOtherClause: !0 }, t);
|
|
2329
|
+
var r = new Et(e, t).parse();
|
|
2330
|
+
if (r.err) {
|
|
2331
|
+
var n = SyntaxError(m[r.err.kind]);
|
|
2332
|
+
throw n.location = r.err.location, n.originalMessage = r.err.message, n;
|
|
2324
2333
|
}
|
|
2325
|
-
return t != null && t.captureLocation ||
|
|
2334
|
+
return t != null && t.captureLocation || ee(r.val), r.val;
|
|
2326
2335
|
}
|
|
2327
|
-
function
|
|
2328
|
-
var
|
|
2336
|
+
function B(e, t) {
|
|
2337
|
+
var r = t && t.cache ? t.cache : Nt, n = t && t.serializer ? t.serializer : Ht, i = t && t.strategy ? t.strategy : St;
|
|
2329
2338
|
return i(e, {
|
|
2330
|
-
cache:
|
|
2331
|
-
serializer:
|
|
2339
|
+
cache: r,
|
|
2340
|
+
serializer: n
|
|
2332
2341
|
});
|
|
2333
2342
|
}
|
|
2334
|
-
function
|
|
2343
|
+
function Tt(e) {
|
|
2335
2344
|
return e == null || typeof e == "number" || typeof e == "boolean";
|
|
2336
2345
|
}
|
|
2337
|
-
function
|
|
2338
|
-
var i =
|
|
2339
|
-
return typeof a > "u" && (a = e.call(this,
|
|
2346
|
+
function Le(e, t, r, n) {
|
|
2347
|
+
var i = Tt(n) ? n : r(n), a = t.get(i);
|
|
2348
|
+
return typeof a > "u" && (a = e.call(this, n), t.set(i, a)), a;
|
|
2340
2349
|
}
|
|
2341
|
-
function
|
|
2342
|
-
var
|
|
2343
|
-
return typeof a > "u" && (a = e.apply(this,
|
|
2350
|
+
function Me(e, t, r) {
|
|
2351
|
+
var n = Array.prototype.slice.call(arguments, 3), i = r(n), a = t.get(i);
|
|
2352
|
+
return typeof a > "u" && (a = e.apply(this, n), t.set(i, a)), a;
|
|
2344
2353
|
}
|
|
2345
|
-
function
|
|
2346
|
-
return
|
|
2347
|
-
}
|
|
2348
|
-
function Tt(e, t) {
|
|
2349
|
-
var n = e.length === 1 ? Pe : Le;
|
|
2350
|
-
return ee(e, this, n, t.cache.create(), t.serializer);
|
|
2354
|
+
function te(e, t, r, n, i) {
|
|
2355
|
+
return r.bind(t, e, n, i);
|
|
2351
2356
|
}
|
|
2352
2357
|
function St(e, t) {
|
|
2353
|
-
|
|
2358
|
+
var r = e.length === 1 ? Le : Me;
|
|
2359
|
+
return te(e, this, r, t.cache.create(), t.serializer);
|
|
2354
2360
|
}
|
|
2355
2361
|
function It(e, t) {
|
|
2356
|
-
return
|
|
2362
|
+
return te(e, this, Me, t.cache.create(), t.serializer);
|
|
2363
|
+
}
|
|
2364
|
+
function At(e, t) {
|
|
2365
|
+
return te(e, this, Le, t.cache.create(), t.serializer);
|
|
2357
2366
|
}
|
|
2358
|
-
var
|
|
2367
|
+
var Ht = function() {
|
|
2359
2368
|
return JSON.stringify(arguments);
|
|
2360
2369
|
};
|
|
2361
|
-
function
|
|
2370
|
+
function re() {
|
|
2362
2371
|
this.cache = /* @__PURE__ */ Object.create(null);
|
|
2363
2372
|
}
|
|
2364
|
-
|
|
2373
|
+
re.prototype.get = function(e) {
|
|
2365
2374
|
return this.cache[e];
|
|
2366
2375
|
};
|
|
2367
|
-
|
|
2376
|
+
re.prototype.set = function(e, t) {
|
|
2368
2377
|
this.cache[e] = t;
|
|
2369
2378
|
};
|
|
2370
|
-
var
|
|
2379
|
+
var Nt = {
|
|
2371
2380
|
create: function() {
|
|
2372
|
-
return new
|
|
2381
|
+
return new re();
|
|
2373
2382
|
}
|
|
2374
|
-
},
|
|
2375
|
-
variadic:
|
|
2376
|
-
monadic:
|
|
2377
|
-
},
|
|
2383
|
+
}, R = {
|
|
2384
|
+
variadic: It,
|
|
2385
|
+
monadic: At
|
|
2386
|
+
}, O;
|
|
2378
2387
|
(function(e) {
|
|
2379
2388
|
e.MISSING_VALUE = "MISSING_VALUE", e.INVALID_VALUE = "INVALID_VALUE", e.MISSING_INTL_API = "MISSING_INTL_API";
|
|
2380
|
-
})(
|
|
2381
|
-
var
|
|
2389
|
+
})(O || (O = {}));
|
|
2390
|
+
var L = (
|
|
2382
2391
|
/** @class */
|
|
2383
2392
|
function(e) {
|
|
2384
|
-
|
|
2385
|
-
function t(
|
|
2386
|
-
var a = e.call(this,
|
|
2387
|
-
return a.code =
|
|
2393
|
+
_(t, e);
|
|
2394
|
+
function t(r, n, i) {
|
|
2395
|
+
var a = e.call(this, r) || this;
|
|
2396
|
+
return a.code = n, a.originalMessage = i, a;
|
|
2388
2397
|
}
|
|
2389
2398
|
return t.prototype.toString = function() {
|
|
2390
2399
|
return "[formatjs Error: ".concat(this.code, "] ").concat(this.message);
|
|
2391
2400
|
}, t;
|
|
2392
2401
|
}(Error)
|
|
2393
|
-
),
|
|
2402
|
+
), me = (
|
|
2394
2403
|
/** @class */
|
|
2395
2404
|
function(e) {
|
|
2396
|
-
|
|
2397
|
-
function t(
|
|
2398
|
-
return e.call(this, 'Invalid values for "'.concat(
|
|
2405
|
+
_(t, e);
|
|
2406
|
+
function t(r, n, i, a) {
|
|
2407
|
+
return e.call(this, 'Invalid values for "'.concat(r, '": "').concat(n, '". Options are "').concat(Object.keys(i).join('", "'), '"'), O.INVALID_VALUE, a) || this;
|
|
2399
2408
|
}
|
|
2400
2409
|
return t;
|
|
2401
|
-
}(
|
|
2402
|
-
),
|
|
2410
|
+
}(L)
|
|
2411
|
+
), _t = (
|
|
2403
2412
|
/** @class */
|
|
2404
2413
|
function(e) {
|
|
2405
|
-
|
|
2406
|
-
function t(
|
|
2407
|
-
return e.call(this, 'Value for "'.concat(
|
|
2414
|
+
_(t, e);
|
|
2415
|
+
function t(r, n, i) {
|
|
2416
|
+
return e.call(this, 'Value for "'.concat(r, '" must be of type ').concat(n), O.INVALID_VALUE, i) || this;
|
|
2408
2417
|
}
|
|
2409
2418
|
return t;
|
|
2410
|
-
}(
|
|
2411
|
-
),
|
|
2419
|
+
}(L)
|
|
2420
|
+
), Bt = (
|
|
2412
2421
|
/** @class */
|
|
2413
2422
|
function(e) {
|
|
2414
|
-
|
|
2415
|
-
function t(
|
|
2416
|
-
return e.call(this, 'The intl string context variable "'.concat(
|
|
2423
|
+
_(t, e);
|
|
2424
|
+
function t(r, n) {
|
|
2425
|
+
return e.call(this, 'The intl string context variable "'.concat(r, '" was not provided to the string "').concat(n, '"'), O.MISSING_VALUE, n) || this;
|
|
2417
2426
|
}
|
|
2418
2427
|
return t;
|
|
2419
|
-
}(
|
|
2420
|
-
),
|
|
2428
|
+
}(L)
|
|
2429
|
+
), A;
|
|
2421
2430
|
(function(e) {
|
|
2422
2431
|
e[e.literal = 0] = "literal", e[e.object = 1] = "object";
|
|
2423
|
-
})(
|
|
2424
|
-
function
|
|
2425
|
-
return e.length < 2 ? e : e.reduce(function(t,
|
|
2426
|
-
var
|
|
2427
|
-
return !
|
|
2432
|
+
})(A || (A = {}));
|
|
2433
|
+
function Rt(e) {
|
|
2434
|
+
return e.length < 2 ? e : e.reduce(function(t, r) {
|
|
2435
|
+
var n = t[t.length - 1];
|
|
2436
|
+
return !n || n.type !== A.literal || r.type !== A.literal ? t.push(r) : n.value += r.value, t;
|
|
2428
2437
|
}, []);
|
|
2429
2438
|
}
|
|
2430
|
-
function
|
|
2439
|
+
function Ot(e) {
|
|
2431
2440
|
return typeof e == "function";
|
|
2432
2441
|
}
|
|
2433
|
-
function
|
|
2434
|
-
if (e.length === 1 &&
|
|
2442
|
+
function k(e, t, r, n, i, a, o) {
|
|
2443
|
+
if (e.length === 1 && oe(e[0]))
|
|
2435
2444
|
return [
|
|
2436
2445
|
{
|
|
2437
|
-
type:
|
|
2446
|
+
type: A.literal,
|
|
2438
2447
|
value: e[0].value
|
|
2439
2448
|
}
|
|
2440
2449
|
];
|
|
2441
2450
|
for (var s = [], h = 0, l = e; h < l.length; h++) {
|
|
2442
2451
|
var u = l[h];
|
|
2443
|
-
if (
|
|
2452
|
+
if (oe(u)) {
|
|
2444
2453
|
s.push({
|
|
2445
|
-
type:
|
|
2454
|
+
type: A.literal,
|
|
2446
2455
|
value: u.value
|
|
2447
2456
|
});
|
|
2448
2457
|
continue;
|
|
2449
2458
|
}
|
|
2450
|
-
if (
|
|
2459
|
+
if (ze(u)) {
|
|
2451
2460
|
typeof a == "number" && s.push({
|
|
2452
|
-
type:
|
|
2453
|
-
value:
|
|
2461
|
+
type: A.literal,
|
|
2462
|
+
value: r.getNumberFormat(t).format(a)
|
|
2454
2463
|
});
|
|
2455
2464
|
continue;
|
|
2456
2465
|
}
|
|
2457
2466
|
var f = u.value;
|
|
2458
2467
|
if (!(i && f in i))
|
|
2459
|
-
throw new
|
|
2468
|
+
throw new Bt(f, o);
|
|
2460
2469
|
var c = i[f];
|
|
2461
|
-
if (
|
|
2470
|
+
if (We(u)) {
|
|
2462
2471
|
(!c || typeof c == "string" || typeof c == "number") && (c = typeof c == "string" || typeof c == "number" ? String(c) : ""), s.push({
|
|
2463
|
-
type: typeof c == "string" ?
|
|
2472
|
+
type: typeof c == "string" ? A.literal : A.object,
|
|
2464
2473
|
value: c
|
|
2465
2474
|
});
|
|
2466
2475
|
continue;
|
|
2467
2476
|
}
|
|
2468
|
-
if (
|
|
2469
|
-
var
|
|
2477
|
+
if (xe(u)) {
|
|
2478
|
+
var g = typeof u.style == "string" ? n.date[u.style] : J(u.style) ? u.style.parsedOptions : void 0;
|
|
2470
2479
|
s.push({
|
|
2471
|
-
type:
|
|
2472
|
-
value:
|
|
2480
|
+
type: A.literal,
|
|
2481
|
+
value: r.getDateTimeFormat(t, g).format(c)
|
|
2473
2482
|
});
|
|
2474
2483
|
continue;
|
|
2475
2484
|
}
|
|
2476
|
-
if (
|
|
2477
|
-
var
|
|
2485
|
+
if (ye(u)) {
|
|
2486
|
+
var g = typeof u.style == "string" ? n.time[u.style] : J(u.style) ? u.style.parsedOptions : n.time.medium;
|
|
2478
2487
|
s.push({
|
|
2479
|
-
type:
|
|
2480
|
-
value:
|
|
2488
|
+
type: A.literal,
|
|
2489
|
+
value: r.getDateTimeFormat(t, g).format(c)
|
|
2481
2490
|
});
|
|
2482
2491
|
continue;
|
|
2483
2492
|
}
|
|
2484
|
-
if (
|
|
2485
|
-
var
|
|
2486
|
-
|
|
2487
|
-
type:
|
|
2488
|
-
value:
|
|
2493
|
+
if (de(u)) {
|
|
2494
|
+
var g = typeof u.style == "string" ? n.number[u.style] : Ae(u.style) ? u.style.parsedOptions : void 0;
|
|
2495
|
+
g && g.scale && (c = c * (g.scale || 1)), s.push({
|
|
2496
|
+
type: A.literal,
|
|
2497
|
+
value: r.getNumberFormat(t, g).format(c)
|
|
2489
2498
|
});
|
|
2490
2499
|
continue;
|
|
2491
2500
|
}
|
|
2492
|
-
if (
|
|
2493
|
-
var E = u.children, b = u.value,
|
|
2494
|
-
if (!
|
|
2495
|
-
throw new
|
|
2496
|
-
var
|
|
2497
|
-
return
|
|
2501
|
+
if (Ie(u)) {
|
|
2502
|
+
var E = u.children, b = u.value, y = i[b];
|
|
2503
|
+
if (!Ot(y))
|
|
2504
|
+
throw new _t(b, "function", o);
|
|
2505
|
+
var T = k(E, t, r, n, i, a), N = y(T.map(function(M) {
|
|
2506
|
+
return M.value;
|
|
2498
2507
|
}));
|
|
2499
|
-
Array.isArray(
|
|
2508
|
+
Array.isArray(N) || (N = [N]), s.push.apply(s, N.map(function(M) {
|
|
2500
2509
|
return {
|
|
2501
|
-
type: typeof
|
|
2502
|
-
value:
|
|
2510
|
+
type: typeof M == "string" ? A.literal : A.object,
|
|
2511
|
+
value: M
|
|
2503
2512
|
};
|
|
2504
2513
|
}));
|
|
2505
2514
|
}
|
|
2506
|
-
if (
|
|
2507
|
-
var
|
|
2508
|
-
if (!
|
|
2509
|
-
throw new
|
|
2510
|
-
s.push.apply(s,
|
|
2515
|
+
if (Te(u)) {
|
|
2516
|
+
var S = u.options[c] || u.options.other;
|
|
2517
|
+
if (!S)
|
|
2518
|
+
throw new me(u.value, c, Object.keys(u.options), o);
|
|
2519
|
+
s.push.apply(s, k(S.value, t, r, n, i));
|
|
2511
2520
|
continue;
|
|
2512
2521
|
}
|
|
2513
|
-
if (
|
|
2514
|
-
var
|
|
2515
|
-
if (!
|
|
2522
|
+
if (Se(u)) {
|
|
2523
|
+
var S = u.options["=".concat(c)];
|
|
2524
|
+
if (!S) {
|
|
2516
2525
|
if (!Intl.PluralRules)
|
|
2517
|
-
throw new
|
|
2526
|
+
throw new L(`Intl.PluralRules is not available in this environment.
|
|
2518
2527
|
Try polyfilling it using "@formatjs/intl-pluralrules"
|
|
2519
|
-
`,
|
|
2520
|
-
var F =
|
|
2521
|
-
|
|
2528
|
+
`, O.MISSING_INTL_API, o);
|
|
2529
|
+
var F = r.getPluralRules(t, { type: u.pluralType }).select(c - (u.offset || 0));
|
|
2530
|
+
S = u.options[F] || u.options.other;
|
|
2522
2531
|
}
|
|
2523
|
-
if (!
|
|
2524
|
-
throw new
|
|
2525
|
-
s.push.apply(s,
|
|
2532
|
+
if (!S)
|
|
2533
|
+
throw new me(u.value, c, Object.keys(u.options), o);
|
|
2534
|
+
s.push.apply(s, k(S.value, t, r, n, i, c - (u.offset || 0)));
|
|
2526
2535
|
continue;
|
|
2527
2536
|
}
|
|
2528
2537
|
}
|
|
2529
|
-
return
|
|
2538
|
+
return Rt(s);
|
|
2530
2539
|
}
|
|
2531
|
-
function
|
|
2532
|
-
return t ?
|
|
2533
|
-
return n
|
|
2540
|
+
function Pt(e, t) {
|
|
2541
|
+
return t ? v(v(v({}, e || {}), t || {}), Object.keys(e).reduce(function(r, n) {
|
|
2542
|
+
return r[n] = v(v({}, e[n]), t[n] || {}), r;
|
|
2534
2543
|
}, {})) : e;
|
|
2535
2544
|
}
|
|
2536
|
-
function
|
|
2537
|
-
return t ? Object.keys(e).reduce(function(
|
|
2538
|
-
return n
|
|
2539
|
-
},
|
|
2545
|
+
function Lt(e, t) {
|
|
2546
|
+
return t ? Object.keys(e).reduce(function(r, n) {
|
|
2547
|
+
return r[n] = Pt(e[n], t[n]), r;
|
|
2548
|
+
}, v({}, e)) : e;
|
|
2540
2549
|
}
|
|
2541
|
-
function
|
|
2550
|
+
function W(e) {
|
|
2542
2551
|
return {
|
|
2543
2552
|
create: function() {
|
|
2544
2553
|
return {
|
|
2545
2554
|
get: function(t) {
|
|
2546
2555
|
return e[t];
|
|
2547
2556
|
},
|
|
2548
|
-
set: function(t,
|
|
2549
|
-
e[t] =
|
|
2557
|
+
set: function(t, r) {
|
|
2558
|
+
e[t] = r;
|
|
2550
2559
|
}
|
|
2551
2560
|
};
|
|
2552
2561
|
}
|
|
2553
2562
|
};
|
|
2554
2563
|
}
|
|
2555
|
-
function
|
|
2564
|
+
function Mt(e) {
|
|
2556
2565
|
return e === void 0 && (e = {
|
|
2557
2566
|
number: {},
|
|
2558
2567
|
dateTime: {},
|
|
2559
2568
|
pluralRules: {}
|
|
2560
2569
|
}), {
|
|
2561
|
-
getNumberFormat:
|
|
2562
|
-
for (var t,
|
|
2563
|
-
n
|
|
2564
|
-
return new ((t = Intl.NumberFormat).bind.apply(t,
|
|
2570
|
+
getNumberFormat: B(function() {
|
|
2571
|
+
for (var t, r = [], n = 0; n < arguments.length; n++)
|
|
2572
|
+
r[n] = arguments[n];
|
|
2573
|
+
return new ((t = Intl.NumberFormat).bind.apply(t, P([void 0], r, !1)))();
|
|
2565
2574
|
}, {
|
|
2566
|
-
cache:
|
|
2567
|
-
strategy:
|
|
2575
|
+
cache: W(e.number),
|
|
2576
|
+
strategy: R.variadic
|
|
2568
2577
|
}),
|
|
2569
|
-
getDateTimeFormat:
|
|
2570
|
-
for (var t,
|
|
2571
|
-
n
|
|
2572
|
-
return new ((t = Intl.DateTimeFormat).bind.apply(t,
|
|
2578
|
+
getDateTimeFormat: B(function() {
|
|
2579
|
+
for (var t, r = [], n = 0; n < arguments.length; n++)
|
|
2580
|
+
r[n] = arguments[n];
|
|
2581
|
+
return new ((t = Intl.DateTimeFormat).bind.apply(t, P([void 0], r, !1)))();
|
|
2573
2582
|
}, {
|
|
2574
|
-
cache:
|
|
2575
|
-
strategy:
|
|
2583
|
+
cache: W(e.dateTime),
|
|
2584
|
+
strategy: R.variadic
|
|
2576
2585
|
}),
|
|
2577
|
-
getPluralRules:
|
|
2578
|
-
for (var t,
|
|
2579
|
-
n
|
|
2580
|
-
return new ((t = Intl.PluralRules).bind.apply(t,
|
|
2586
|
+
getPluralRules: B(function() {
|
|
2587
|
+
for (var t, r = [], n = 0; n < arguments.length; n++)
|
|
2588
|
+
r[n] = arguments[n];
|
|
2589
|
+
return new ((t = Intl.PluralRules).bind.apply(t, P([void 0], r, !1)))();
|
|
2581
2590
|
}, {
|
|
2582
|
-
cache:
|
|
2583
|
-
strategy:
|
|
2591
|
+
cache: W(e.pluralRules),
|
|
2592
|
+
strategy: R.variadic
|
|
2584
2593
|
})
|
|
2585
2594
|
};
|
|
2586
2595
|
}
|
|
2587
|
-
var
|
|
2596
|
+
var Ce = (
|
|
2588
2597
|
/** @class */
|
|
2589
2598
|
function() {
|
|
2590
|
-
function e(t,
|
|
2591
|
-
|
|
2599
|
+
function e(t, r, n, i) {
|
|
2600
|
+
r === void 0 && (r = e.defaultLocale);
|
|
2592
2601
|
var a = this;
|
|
2593
2602
|
if (this.formatterCache = {
|
|
2594
2603
|
number: {},
|
|
@@ -2599,11 +2608,11 @@ var Me = (
|
|
|
2599
2608
|
if (s.length === 1)
|
|
2600
2609
|
return s[0].value;
|
|
2601
2610
|
var h = s.reduce(function(l, u) {
|
|
2602
|
-
return !l.length || u.type !==
|
|
2611
|
+
return !l.length || u.type !== A.literal || typeof l[l.length - 1] != "string" ? l.push(u.value) : l[l.length - 1] += u.value, l;
|
|
2603
2612
|
}, []);
|
|
2604
2613
|
return h.length <= 1 ? h[0] || "" : h;
|
|
2605
2614
|
}, this.formatToParts = function(o) {
|
|
2606
|
-
return
|
|
2615
|
+
return k(a.ast, a.locales, a.formatters, a.formats, o, void 0, a.message);
|
|
2607
2616
|
}, this.resolvedOptions = function() {
|
|
2608
2617
|
var o;
|
|
2609
2618
|
return {
|
|
@@ -2611,7 +2620,7 @@ var Me = (
|
|
|
2611
2620
|
};
|
|
2612
2621
|
}, this.getAst = function() {
|
|
2613
2622
|
return a.ast;
|
|
2614
|
-
}, this.locales =
|
|
2623
|
+
}, this.locales = r, this.resolvedLocale = e.resolveLocale(r), typeof t == "string") {
|
|
2615
2624
|
if (this.message = t, !e.__parse)
|
|
2616
2625
|
throw new TypeError("IntlMessageFormat.__parse must be set to process `message` of type `string`");
|
|
2617
2626
|
this.ast = e.__parse(t, {
|
|
@@ -2622,7 +2631,7 @@ var Me = (
|
|
|
2622
2631
|
this.ast = t;
|
|
2623
2632
|
if (!Array.isArray(this.ast))
|
|
2624
2633
|
throw new TypeError("A message must be provided as a String or AST.");
|
|
2625
|
-
this.formats =
|
|
2634
|
+
this.formats = Lt(e.formats, n), this.formatters = i && i.formatters || Mt(this.formatterCache);
|
|
2626
2635
|
}
|
|
2627
2636
|
return Object.defineProperty(e, "defaultLocale", {
|
|
2628
2637
|
get: function() {
|
|
@@ -2632,10 +2641,10 @@ var Me = (
|
|
|
2632
2641
|
configurable: !0
|
|
2633
2642
|
}), e.memoizedDefaultLocale = null, e.resolveLocale = function(t) {
|
|
2634
2643
|
if (!(typeof Intl.Locale > "u")) {
|
|
2635
|
-
var
|
|
2636
|
-
return
|
|
2644
|
+
var r = Intl.NumberFormat.supportedLocalesOf(t);
|
|
2645
|
+
return r.length > 0 ? new Intl.Locale(r[0]) : new Intl.Locale(typeof t == "string" ? t : t[0]);
|
|
2637
2646
|
}
|
|
2638
|
-
}, e.__parse =
|
|
2647
|
+
}, e.__parse = yt, e.formats = {
|
|
2639
2648
|
number: {
|
|
2640
2649
|
integer: {
|
|
2641
2650
|
maximumFractionDigits: 0
|
|
@@ -2695,99 +2704,99 @@ var Me = (
|
|
|
2695
2704
|
}
|
|
2696
2705
|
}, e;
|
|
2697
2706
|
}()
|
|
2698
|
-
),
|
|
2707
|
+
), I;
|
|
2699
2708
|
(function(e) {
|
|
2700
2709
|
e.FORMAT_ERROR = "FORMAT_ERROR", e.UNSUPPORTED_FORMATTER = "UNSUPPORTED_FORMATTER", e.INVALID_CONFIG = "INVALID_CONFIG", e.MISSING_DATA = "MISSING_DATA", e.MISSING_TRANSLATION = "MISSING_TRANSLATION";
|
|
2701
|
-
})(
|
|
2702
|
-
var
|
|
2710
|
+
})(I || (I = {}));
|
|
2711
|
+
var H = (
|
|
2703
2712
|
/** @class */
|
|
2704
2713
|
function(e) {
|
|
2705
|
-
|
|
2706
|
-
function t(
|
|
2714
|
+
_(t, e);
|
|
2715
|
+
function t(r, n, i) {
|
|
2707
2716
|
var a = this, o = i ? i instanceof Error ? i : new Error(String(i)) : void 0;
|
|
2708
|
-
return a = e.call(this, "[@formatjs/intl Error ".concat(
|
|
2717
|
+
return a = e.call(this, "[@formatjs/intl Error ".concat(r, "] ").concat(n, `
|
|
2709
2718
|
`).concat(o ? `
|
|
2710
2719
|
`.concat(o.message, `
|
|
2711
|
-
`).concat(o.stack) : "")) || this, a.code =
|
|
2720
|
+
`).concat(o.stack) : "")) || this, a.code = r, typeof Error.captureStackTrace == "function" && Error.captureStackTrace(a, t), a;
|
|
2712
2721
|
}
|
|
2713
2722
|
return t;
|
|
2714
2723
|
}(Error)
|
|
2715
|
-
),
|
|
2724
|
+
), Ct = (
|
|
2716
2725
|
/** @class */
|
|
2717
2726
|
function(e) {
|
|
2718
|
-
|
|
2719
|
-
function t(
|
|
2720
|
-
return e.call(this,
|
|
2727
|
+
_(t, e);
|
|
2728
|
+
function t(r, n) {
|
|
2729
|
+
return e.call(this, I.UNSUPPORTED_FORMATTER, r, n) || this;
|
|
2721
2730
|
}
|
|
2722
2731
|
return t;
|
|
2723
|
-
}(
|
|
2724
|
-
),
|
|
2732
|
+
}(H)
|
|
2733
|
+
), Dt = (
|
|
2725
2734
|
/** @class */
|
|
2726
2735
|
function(e) {
|
|
2727
|
-
|
|
2728
|
-
function t(
|
|
2729
|
-
return e.call(this,
|
|
2736
|
+
_(t, e);
|
|
2737
|
+
function t(r, n) {
|
|
2738
|
+
return e.call(this, I.INVALID_CONFIG, r, n) || this;
|
|
2730
2739
|
}
|
|
2731
2740
|
return t;
|
|
2732
|
-
}(
|
|
2733
|
-
),
|
|
2741
|
+
}(H)
|
|
2742
|
+
), ge = (
|
|
2734
2743
|
/** @class */
|
|
2735
2744
|
function(e) {
|
|
2736
|
-
|
|
2737
|
-
function t(
|
|
2738
|
-
return e.call(this,
|
|
2745
|
+
_(t, e);
|
|
2746
|
+
function t(r, n) {
|
|
2747
|
+
return e.call(this, I.MISSING_DATA, r, n) || this;
|
|
2739
2748
|
}
|
|
2740
2749
|
return t;
|
|
2741
|
-
}(
|
|
2742
|
-
),
|
|
2750
|
+
}(H)
|
|
2751
|
+
), ne = (
|
|
2743
2752
|
/** @class */
|
|
2744
2753
|
function(e) {
|
|
2745
|
-
|
|
2746
|
-
function t(
|
|
2747
|
-
return e.call(this,
|
|
2748
|
-
Locale: `).concat(
|
|
2754
|
+
_(t, e);
|
|
2755
|
+
function t(r, n, i) {
|
|
2756
|
+
return e.call(this, I.FORMAT_ERROR, "".concat(r, `
|
|
2757
|
+
Locale: `).concat(n, `
|
|
2749
2758
|
`), i) || this;
|
|
2750
2759
|
}
|
|
2751
2760
|
return t;
|
|
2752
|
-
}(
|
|
2753
|
-
),
|
|
2761
|
+
}(H)
|
|
2762
|
+
), z = (
|
|
2754
2763
|
/** @class */
|
|
2755
2764
|
function(e) {
|
|
2756
|
-
|
|
2757
|
-
function t(
|
|
2758
|
-
var o = e.call(this, "".concat(
|
|
2765
|
+
_(t, e);
|
|
2766
|
+
function t(r, n, i, a) {
|
|
2767
|
+
var o = e.call(this, "".concat(r, `
|
|
2759
2768
|
MessageID: `).concat(i == null ? void 0 : i.id, `
|
|
2760
2769
|
Default Message: `).concat(i == null ? void 0 : i.defaultMessage, `
|
|
2761
2770
|
Description: `).concat(i == null ? void 0 : i.description, `
|
|
2762
|
-
`),
|
|
2771
|
+
`), n, a) || this;
|
|
2763
2772
|
return o.descriptor = i, o;
|
|
2764
2773
|
}
|
|
2765
2774
|
return t;
|
|
2766
|
-
}(
|
|
2767
|
-
),
|
|
2775
|
+
}(ne)
|
|
2776
|
+
), wt = (
|
|
2768
2777
|
/** @class */
|
|
2769
2778
|
function(e) {
|
|
2770
|
-
|
|
2771
|
-
function t(
|
|
2772
|
-
var i = e.call(this,
|
|
2779
|
+
_(t, e);
|
|
2780
|
+
function t(r, n) {
|
|
2781
|
+
var i = e.call(this, I.MISSING_TRANSLATION, 'Missing message: "'.concat(r.id, '" for locale "').concat(n, '", using ').concat(r.defaultMessage ? "default message (".concat(typeof r.defaultMessage == "string" ? r.defaultMessage : r.defaultMessage.map(function(a) {
|
|
2773
2782
|
var o;
|
|
2774
2783
|
return (o = a.value) !== null && o !== void 0 ? o : JSON.stringify(a);
|
|
2775
2784
|
}).join(), ")") : "id", " as fallback.")) || this;
|
|
2776
|
-
return i.descriptor =
|
|
2785
|
+
return i.descriptor = r, i;
|
|
2777
2786
|
}
|
|
2778
2787
|
return t;
|
|
2779
|
-
}(
|
|
2788
|
+
}(H)
|
|
2780
2789
|
);
|
|
2781
|
-
function
|
|
2782
|
-
return
|
|
2783
|
-
return i in e ?
|
|
2790
|
+
function D(e, t, r) {
|
|
2791
|
+
return r === void 0 && (r = {}), t.reduce(function(n, i) {
|
|
2792
|
+
return i in e ? n[i] = e[i] : i in r && (n[i] = r[i]), n;
|
|
2784
2793
|
}, {});
|
|
2785
2794
|
}
|
|
2786
2795
|
var Ft = function(e) {
|
|
2787
2796
|
process.env.NODE_ENV !== "production" && console.error(e);
|
|
2788
|
-
},
|
|
2797
|
+
}, Gt = function(e) {
|
|
2789
2798
|
process.env.NODE_ENV !== "production" && console.warn(e);
|
|
2790
|
-
},
|
|
2799
|
+
}, Ut = {
|
|
2791
2800
|
formats: {},
|
|
2792
2801
|
messages: {},
|
|
2793
2802
|
timeZone: void 0,
|
|
@@ -2795,9 +2804,9 @@ var Ft = function(e) {
|
|
|
2795
2804
|
defaultFormats: {},
|
|
2796
2805
|
fallbackOnEmptyString: !0,
|
|
2797
2806
|
onError: Ft,
|
|
2798
|
-
onWarn:
|
|
2807
|
+
onWarn: Gt
|
|
2799
2808
|
};
|
|
2800
|
-
function
|
|
2809
|
+
function De() {
|
|
2801
2810
|
return {
|
|
2802
2811
|
dateTime: {},
|
|
2803
2812
|
number: {},
|
|
@@ -2808,153 +2817,153 @@ function Ce() {
|
|
|
2808
2817
|
displayNames: {}
|
|
2809
2818
|
};
|
|
2810
2819
|
}
|
|
2811
|
-
function
|
|
2820
|
+
function C(e) {
|
|
2812
2821
|
return {
|
|
2813
2822
|
create: function() {
|
|
2814
2823
|
return {
|
|
2815
2824
|
get: function(t) {
|
|
2816
2825
|
return e[t];
|
|
2817
2826
|
},
|
|
2818
|
-
set: function(t,
|
|
2819
|
-
e[t] =
|
|
2827
|
+
set: function(t, r) {
|
|
2828
|
+
e[t] = r;
|
|
2820
2829
|
}
|
|
2821
2830
|
};
|
|
2822
2831
|
}
|
|
2823
2832
|
};
|
|
2824
2833
|
}
|
|
2825
|
-
function
|
|
2826
|
-
e === void 0 && (e =
|
|
2827
|
-
var t = Intl.RelativeTimeFormat,
|
|
2834
|
+
function jt(e) {
|
|
2835
|
+
e === void 0 && (e = De());
|
|
2836
|
+
var t = Intl.RelativeTimeFormat, r = Intl.ListFormat, n = Intl.DisplayNames, i = B(function() {
|
|
2828
2837
|
for (var s, h = [], l = 0; l < arguments.length; l++)
|
|
2829
2838
|
h[l] = arguments[l];
|
|
2830
|
-
return new ((s = Intl.DateTimeFormat).bind.apply(s,
|
|
2839
|
+
return new ((s = Intl.DateTimeFormat).bind.apply(s, P([void 0], h, !1)))();
|
|
2831
2840
|
}, {
|
|
2832
|
-
cache:
|
|
2833
|
-
strategy:
|
|
2834
|
-
}), a =
|
|
2841
|
+
cache: C(e.dateTime),
|
|
2842
|
+
strategy: R.variadic
|
|
2843
|
+
}), a = B(function() {
|
|
2835
2844
|
for (var s, h = [], l = 0; l < arguments.length; l++)
|
|
2836
2845
|
h[l] = arguments[l];
|
|
2837
|
-
return new ((s = Intl.NumberFormat).bind.apply(s,
|
|
2846
|
+
return new ((s = Intl.NumberFormat).bind.apply(s, P([void 0], h, !1)))();
|
|
2838
2847
|
}, {
|
|
2839
|
-
cache:
|
|
2840
|
-
strategy:
|
|
2841
|
-
}), o =
|
|
2848
|
+
cache: C(e.number),
|
|
2849
|
+
strategy: R.variadic
|
|
2850
|
+
}), o = B(function() {
|
|
2842
2851
|
for (var s, h = [], l = 0; l < arguments.length; l++)
|
|
2843
2852
|
h[l] = arguments[l];
|
|
2844
|
-
return new ((s = Intl.PluralRules).bind.apply(s,
|
|
2853
|
+
return new ((s = Intl.PluralRules).bind.apply(s, P([void 0], h, !1)))();
|
|
2845
2854
|
}, {
|
|
2846
|
-
cache:
|
|
2847
|
-
strategy:
|
|
2855
|
+
cache: C(e.pluralRules),
|
|
2856
|
+
strategy: R.variadic
|
|
2848
2857
|
});
|
|
2849
2858
|
return {
|
|
2850
2859
|
getDateTimeFormat: i,
|
|
2851
2860
|
getNumberFormat: a,
|
|
2852
|
-
getMessageFormat:
|
|
2853
|
-
return new
|
|
2861
|
+
getMessageFormat: B(function(s, h, l, u) {
|
|
2862
|
+
return new Ce(s, h, l, v({ formatters: {
|
|
2854
2863
|
getNumberFormat: a,
|
|
2855
2864
|
getDateTimeFormat: i,
|
|
2856
2865
|
getPluralRules: o
|
|
2857
2866
|
} }, u || {}));
|
|
2858
2867
|
}, {
|
|
2859
|
-
cache:
|
|
2860
|
-
strategy:
|
|
2868
|
+
cache: C(e.message),
|
|
2869
|
+
strategy: R.variadic
|
|
2861
2870
|
}),
|
|
2862
|
-
getRelativeTimeFormat:
|
|
2871
|
+
getRelativeTimeFormat: B(function() {
|
|
2863
2872
|
for (var s = [], h = 0; h < arguments.length; h++)
|
|
2864
2873
|
s[h] = arguments[h];
|
|
2865
|
-
return new (t.bind.apply(t,
|
|
2874
|
+
return new (t.bind.apply(t, P([void 0], s, !1)))();
|
|
2866
2875
|
}, {
|
|
2867
|
-
cache:
|
|
2868
|
-
strategy:
|
|
2876
|
+
cache: C(e.relativeTime),
|
|
2877
|
+
strategy: R.variadic
|
|
2869
2878
|
}),
|
|
2870
2879
|
getPluralRules: o,
|
|
2871
|
-
getListFormat:
|
|
2880
|
+
getListFormat: B(function() {
|
|
2872
2881
|
for (var s = [], h = 0; h < arguments.length; h++)
|
|
2873
2882
|
s[h] = arguments[h];
|
|
2874
|
-
return new (
|
|
2883
|
+
return new (r.bind.apply(r, P([void 0], s, !1)))();
|
|
2875
2884
|
}, {
|
|
2876
|
-
cache:
|
|
2877
|
-
strategy:
|
|
2885
|
+
cache: C(e.list),
|
|
2886
|
+
strategy: R.variadic
|
|
2878
2887
|
}),
|
|
2879
|
-
getDisplayNames:
|
|
2888
|
+
getDisplayNames: B(function() {
|
|
2880
2889
|
for (var s = [], h = 0; h < arguments.length; h++)
|
|
2881
2890
|
s[h] = arguments[h];
|
|
2882
|
-
return new (
|
|
2891
|
+
return new (n.bind.apply(n, P([void 0], s, !1)))();
|
|
2883
2892
|
}, {
|
|
2884
|
-
cache:
|
|
2885
|
-
strategy:
|
|
2893
|
+
cache: C(e.displayNames),
|
|
2894
|
+
strategy: R.variadic
|
|
2886
2895
|
})
|
|
2887
2896
|
};
|
|
2888
2897
|
}
|
|
2889
|
-
function
|
|
2898
|
+
function ie(e, t, r, n) {
|
|
2890
2899
|
var i = e && e[t], a;
|
|
2891
|
-
if (i && (a = i[
|
|
2900
|
+
if (i && (a = i[r]), a)
|
|
2892
2901
|
return a;
|
|
2893
|
-
|
|
2902
|
+
n(new Ct("No ".concat(t, " format named: ").concat(r)));
|
|
2894
2903
|
}
|
|
2895
|
-
function
|
|
2896
|
-
if (
|
|
2897
|
-
throw new
|
|
2904
|
+
function Vt(e, t, r) {
|
|
2905
|
+
if (r === void 0 && (r = Error), !e)
|
|
2906
|
+
throw new r(t);
|
|
2898
2907
|
}
|
|
2899
|
-
function
|
|
2900
|
-
return Object.keys(e).reduce(function(
|
|
2901
|
-
return n
|
|
2908
|
+
function V(e, t) {
|
|
2909
|
+
return Object.keys(e).reduce(function(r, n) {
|
|
2910
|
+
return r[n] = v({ timeZone: t }, e[n]), r;
|
|
2902
2911
|
}, {});
|
|
2903
2912
|
}
|
|
2904
|
-
function
|
|
2905
|
-
var
|
|
2906
|
-
return
|
|
2907
|
-
return
|
|
2913
|
+
function pe(e, t) {
|
|
2914
|
+
var r = Object.keys(v(v({}, e), t));
|
|
2915
|
+
return r.reduce(function(n, i) {
|
|
2916
|
+
return n[i] = v(v({}, e[i] || {}), t[i] || {}), n;
|
|
2908
2917
|
}, {});
|
|
2909
2918
|
}
|
|
2910
|
-
function
|
|
2919
|
+
function ve(e, t) {
|
|
2911
2920
|
if (!t)
|
|
2912
2921
|
return e;
|
|
2913
|
-
var
|
|
2914
|
-
return
|
|
2915
|
-
}
|
|
2916
|
-
var
|
|
2917
|
-
var a = e.locale, o = e.formats, s = e.messages, h = e.defaultLocale, l = e.defaultFormats, u = e.fallbackOnEmptyString, f = e.onError, c = e.timeZone,
|
|
2918
|
-
|
|
2919
|
-
var E =
|
|
2920
|
-
|
|
2921
|
-
var
|
|
2922
|
+
var r = Ce.formats;
|
|
2923
|
+
return v(v(v({}, r), e), { date: pe(V(r.date, t), V(e.date || {}, t)), time: pe(V(r.time, t), V(e.time || {}, t)) });
|
|
2924
|
+
}
|
|
2925
|
+
var Ee = function(e, t, r, n, i) {
|
|
2926
|
+
var a = e.locale, o = e.formats, s = e.messages, h = e.defaultLocale, l = e.defaultFormats, u = e.fallbackOnEmptyString, f = e.onError, c = e.timeZone, g = e.defaultRichTextElements;
|
|
2927
|
+
r === void 0 && (r = { id: "" });
|
|
2928
|
+
var E = r.id, b = r.defaultMessage;
|
|
2929
|
+
Vt(!!E, "[@formatjs/intl] An `id` must be provided to format a message. You can either:\n1. Configure your build toolchain with [babel-plugin-formatjs](https://formatjs.io/docs/tooling/babel-plugin)\nor [@formatjs/ts-transformer](https://formatjs.io/docs/tooling/ts-transformer) OR\n2. Configure your `eslint` config to include [eslint-plugin-formatjs](https://formatjs.io/docs/tooling/linter#enforce-id)\nto autofix this issue");
|
|
2930
|
+
var y = String(E), T = (
|
|
2922
2931
|
// In case messages is Object.create(null)
|
|
2923
2932
|
// e.g import('foo.json') from webpack)
|
|
2924
2933
|
// See https://github.com/formatjs/formatjs/issues/1914
|
|
2925
|
-
s && Object.prototype.hasOwnProperty.call(s,
|
|
2934
|
+
s && Object.prototype.hasOwnProperty.call(s, y) && s[y]
|
|
2926
2935
|
);
|
|
2927
|
-
if (Array.isArray(
|
|
2928
|
-
return
|
|
2929
|
-
if (!
|
|
2930
|
-
return
|
|
2931
|
-
if (
|
|
2932
|
-
if (u === !1 &&
|
|
2933
|
-
return
|
|
2934
|
-
if ((!b || a && a.toLowerCase() !== h.toLowerCase()) && f(new
|
|
2936
|
+
if (Array.isArray(T) && T.length === 1 && T[0].type === d.literal)
|
|
2937
|
+
return T[0].value;
|
|
2938
|
+
if (!n && T && typeof T == "string" && !g)
|
|
2939
|
+
return T.replace(/'\{(.*?)\}'/gi, "{$1}");
|
|
2940
|
+
if (n = v(v({}, g), n || {}), o = ve(o, c), l = ve(l, c), !T) {
|
|
2941
|
+
if (u === !1 && T === "")
|
|
2942
|
+
return T;
|
|
2943
|
+
if ((!b || a && a.toLowerCase() !== h.toLowerCase()) && f(new wt(r, a)), b)
|
|
2935
2944
|
try {
|
|
2936
|
-
var
|
|
2937
|
-
return
|
|
2938
|
-
} catch (
|
|
2939
|
-
return f(new
|
|
2945
|
+
var N = t.getMessageFormat(b, h, l, i);
|
|
2946
|
+
return N.format(n);
|
|
2947
|
+
} catch (S) {
|
|
2948
|
+
return f(new z('Error formatting default message for: "'.concat(y, '", rendering default message verbatim'), a, r, S)), typeof b == "string" ? b : y;
|
|
2940
2949
|
}
|
|
2941
|
-
return
|
|
2950
|
+
return y;
|
|
2942
2951
|
}
|
|
2943
2952
|
try {
|
|
2944
|
-
var
|
|
2945
|
-
return
|
|
2946
|
-
} catch (
|
|
2947
|
-
f(new
|
|
2953
|
+
var N = t.getMessageFormat(T, a, o, v({ formatters: t }, i || {}));
|
|
2954
|
+
return N.format(n);
|
|
2955
|
+
} catch (S) {
|
|
2956
|
+
f(new z('Error formatting message: "'.concat(y, '", using ').concat(b ? "default message" : "id", " as fallback."), a, r, S));
|
|
2948
2957
|
}
|
|
2949
2958
|
if (b)
|
|
2950
2959
|
try {
|
|
2951
|
-
var
|
|
2952
|
-
return
|
|
2953
|
-
} catch (
|
|
2954
|
-
f(new
|
|
2960
|
+
var N = t.getMessageFormat(b, h, l, i);
|
|
2961
|
+
return N.format(n);
|
|
2962
|
+
} catch (S) {
|
|
2963
|
+
f(new z('Error formatting the default message for: "'.concat(y, '", rendering message verbatim'), a, r, S));
|
|
2955
2964
|
}
|
|
2956
|
-
return typeof
|
|
2957
|
-
},
|
|
2965
|
+
return typeof T == "string" ? T : typeof b == "string" ? b : y;
|
|
2966
|
+
}, we = [
|
|
2958
2967
|
"formatMatcher",
|
|
2959
2968
|
"timeZone",
|
|
2960
2969
|
"hour12",
|
|
@@ -2975,159 +2984,159 @@ var ve = function(e, t, n, r, i) {
|
|
|
2975
2984
|
"numberingSystem",
|
|
2976
2985
|
"fractionalSecondDigits"
|
|
2977
2986
|
];
|
|
2978
|
-
function
|
|
2987
|
+
function X(e, t, r, n) {
|
|
2979
2988
|
var i = e.locale, a = e.formats, o = e.onError, s = e.timeZone;
|
|
2980
|
-
|
|
2981
|
-
var h =
|
|
2982
|
-
return t === "time" && !u.hour && !u.minute && !u.second && !u.timeStyle && !u.dateStyle && (u =
|
|
2989
|
+
n === void 0 && (n = {});
|
|
2990
|
+
var h = n.format, l = v(v({}, s && { timeZone: s }), h && ie(a, t, h, o)), u = D(n, we, l);
|
|
2991
|
+
return t === "time" && !u.hour && !u.minute && !u.second && !u.timeStyle && !u.dateStyle && (u = v(v({}, u), { hour: "numeric", minute: "numeric" })), r(i, u);
|
|
2983
2992
|
}
|
|
2984
|
-
function
|
|
2985
|
-
for (var
|
|
2986
|
-
n
|
|
2987
|
-
var i =
|
|
2993
|
+
function kt(e, t) {
|
|
2994
|
+
for (var r = [], n = 2; n < arguments.length; n++)
|
|
2995
|
+
r[n - 2] = arguments[n];
|
|
2996
|
+
var i = r[0], a = r[1], o = a === void 0 ? {} : a, s = typeof i == "string" ? new Date(i || 0) : i;
|
|
2988
2997
|
try {
|
|
2989
|
-
return
|
|
2998
|
+
return X(e, "date", t, o).format(s);
|
|
2990
2999
|
} catch (h) {
|
|
2991
|
-
e.onError(new
|
|
3000
|
+
e.onError(new H(I.FORMAT_ERROR, "Error formatting date.", h));
|
|
2992
3001
|
}
|
|
2993
3002
|
return String(s);
|
|
2994
3003
|
}
|
|
2995
|
-
function
|
|
2996
|
-
for (var
|
|
2997
|
-
n
|
|
2998
|
-
var i =
|
|
3004
|
+
function Xt(e, t) {
|
|
3005
|
+
for (var r = [], n = 2; n < arguments.length; n++)
|
|
3006
|
+
r[n - 2] = arguments[n];
|
|
3007
|
+
var i = r[0], a = r[1], o = a === void 0 ? {} : a, s = typeof i == "string" ? new Date(i || 0) : i;
|
|
2999
3008
|
try {
|
|
3000
|
-
return
|
|
3009
|
+
return X(e, "time", t, o).format(s);
|
|
3001
3010
|
} catch (h) {
|
|
3002
|
-
e.onError(new
|
|
3011
|
+
e.onError(new H(I.FORMAT_ERROR, "Error formatting time.", h));
|
|
3003
3012
|
}
|
|
3004
3013
|
return String(s);
|
|
3005
3014
|
}
|
|
3006
|
-
function
|
|
3007
|
-
for (var
|
|
3008
|
-
n
|
|
3009
|
-
var i =
|
|
3015
|
+
function Zt(e, t) {
|
|
3016
|
+
for (var r = [], n = 2; n < arguments.length; n++)
|
|
3017
|
+
r[n - 2] = arguments[n];
|
|
3018
|
+
var i = r[0], a = r[1], o = r[2], s = o === void 0 ? {} : o, h = e.timeZone, l = e.locale, u = e.onError, f = D(s, we, h ? { timeZone: h } : {});
|
|
3010
3019
|
try {
|
|
3011
3020
|
return t(l, f).formatRange(i, a);
|
|
3012
3021
|
} catch (c) {
|
|
3013
|
-
u(new
|
|
3022
|
+
u(new H(I.FORMAT_ERROR, "Error formatting date time range.", c));
|
|
3014
3023
|
}
|
|
3015
3024
|
return String(i);
|
|
3016
3025
|
}
|
|
3017
|
-
function
|
|
3018
|
-
for (var
|
|
3019
|
-
n
|
|
3020
|
-
var i =
|
|
3026
|
+
function Wt(e, t) {
|
|
3027
|
+
for (var r = [], n = 2; n < arguments.length; n++)
|
|
3028
|
+
r[n - 2] = arguments[n];
|
|
3029
|
+
var i = r[0], a = r[1], o = a === void 0 ? {} : a, s = typeof i == "string" ? new Date(i || 0) : i;
|
|
3021
3030
|
try {
|
|
3022
|
-
return
|
|
3031
|
+
return X(e, "date", t, o).formatToParts(s);
|
|
3023
3032
|
} catch (h) {
|
|
3024
|
-
e.onError(new
|
|
3033
|
+
e.onError(new H(I.FORMAT_ERROR, "Error formatting date.", h));
|
|
3025
3034
|
}
|
|
3026
3035
|
return [];
|
|
3027
3036
|
}
|
|
3028
|
-
function
|
|
3029
|
-
for (var
|
|
3030
|
-
n
|
|
3031
|
-
var i =
|
|
3037
|
+
function zt(e, t) {
|
|
3038
|
+
for (var r = [], n = 2; n < arguments.length; n++)
|
|
3039
|
+
r[n - 2] = arguments[n];
|
|
3040
|
+
var i = r[0], a = r[1], o = a === void 0 ? {} : a, s = typeof i == "string" ? new Date(i || 0) : i;
|
|
3032
3041
|
try {
|
|
3033
|
-
return
|
|
3042
|
+
return X(e, "time", t, o).formatToParts(s);
|
|
3034
3043
|
} catch (h) {
|
|
3035
|
-
e.onError(new
|
|
3044
|
+
e.onError(new H(I.FORMAT_ERROR, "Error formatting time.", h));
|
|
3036
3045
|
}
|
|
3037
3046
|
return [];
|
|
3038
3047
|
}
|
|
3039
|
-
var
|
|
3048
|
+
var qt = [
|
|
3040
3049
|
"style",
|
|
3041
3050
|
"type",
|
|
3042
3051
|
"fallback",
|
|
3043
3052
|
"languageDisplay"
|
|
3044
3053
|
];
|
|
3045
|
-
function
|
|
3054
|
+
function Jt(e, t, r, n) {
|
|
3046
3055
|
var i = e.locale, a = e.onError, o = Intl.DisplayNames;
|
|
3047
|
-
o || a(new
|
|
3056
|
+
o || a(new L(`Intl.DisplayNames is not available in this environment.
|
|
3048
3057
|
Try polyfilling it using "@formatjs/intl-displaynames"
|
|
3049
|
-
`,
|
|
3050
|
-
var s =
|
|
3058
|
+
`, O.MISSING_INTL_API));
|
|
3059
|
+
var s = D(n, qt);
|
|
3051
3060
|
try {
|
|
3052
|
-
return t(i, s).of(
|
|
3061
|
+
return t(i, s).of(r);
|
|
3053
3062
|
} catch (h) {
|
|
3054
|
-
a(new
|
|
3063
|
+
a(new H(I.FORMAT_ERROR, "Error formatting display name.", h));
|
|
3055
3064
|
}
|
|
3056
3065
|
}
|
|
3057
|
-
var
|
|
3066
|
+
var Qt = [
|
|
3058
3067
|
"type",
|
|
3059
3068
|
"style"
|
|
3060
|
-
],
|
|
3061
|
-
function
|
|
3062
|
-
return "".concat(
|
|
3069
|
+
], be = Date.now();
|
|
3070
|
+
function Yt(e) {
|
|
3071
|
+
return "".concat(be, "_").concat(e, "_").concat(be);
|
|
3063
3072
|
}
|
|
3064
|
-
function
|
|
3065
|
-
|
|
3066
|
-
var i = Fe(e, t,
|
|
3073
|
+
function $t(e, t, r, n) {
|
|
3074
|
+
n === void 0 && (n = {});
|
|
3075
|
+
var i = Fe(e, t, r, n).reduce(function(a, o) {
|
|
3067
3076
|
var s = o.value;
|
|
3068
3077
|
return typeof s != "string" ? a.push(s) : typeof a[a.length - 1] == "string" ? a[a.length - 1] += s : a.push(s), a;
|
|
3069
3078
|
}, []);
|
|
3070
3079
|
return i.length === 1 ? i[0] : i.length === 0 ? "" : i;
|
|
3071
3080
|
}
|
|
3072
|
-
function Fe(e, t,
|
|
3081
|
+
function Fe(e, t, r, n) {
|
|
3073
3082
|
var i = e.locale, a = e.onError;
|
|
3074
|
-
|
|
3083
|
+
n === void 0 && (n = {});
|
|
3075
3084
|
var o = Intl.ListFormat;
|
|
3076
|
-
o || a(new
|
|
3085
|
+
o || a(new L(`Intl.ListFormat is not available in this environment.
|
|
3077
3086
|
Try polyfilling it using "@formatjs/intl-listformat"
|
|
3078
|
-
`,
|
|
3079
|
-
var s =
|
|
3087
|
+
`, O.MISSING_INTL_API));
|
|
3088
|
+
var s = D(n, Qt);
|
|
3080
3089
|
try {
|
|
3081
|
-
var h = {}, l =
|
|
3090
|
+
var h = {}, l = r.map(function(u, f) {
|
|
3082
3091
|
if (typeof u == "object") {
|
|
3083
|
-
var c =
|
|
3092
|
+
var c = Yt(f);
|
|
3084
3093
|
return h[c] = u, c;
|
|
3085
3094
|
}
|
|
3086
3095
|
return String(u);
|
|
3087
3096
|
});
|
|
3088
3097
|
return t(i, s).formatToParts(l).map(function(u) {
|
|
3089
|
-
return u.type === "literal" ? u :
|
|
3098
|
+
return u.type === "literal" ? u : v(v({}, u), { value: h[u.value] || u.value });
|
|
3090
3099
|
});
|
|
3091
3100
|
} catch (u) {
|
|
3092
|
-
a(new
|
|
3101
|
+
a(new H(I.FORMAT_ERROR, "Error formatting list.", u));
|
|
3093
3102
|
}
|
|
3094
|
-
return
|
|
3103
|
+
return r;
|
|
3095
3104
|
}
|
|
3096
|
-
var
|
|
3097
|
-
function
|
|
3105
|
+
var Kt = ["type"];
|
|
3106
|
+
function er(e, t, r, n) {
|
|
3098
3107
|
var i = e.locale, a = e.onError;
|
|
3099
|
-
|
|
3108
|
+
n === void 0 && (n = {}), Intl.PluralRules || a(new L(`Intl.PluralRules is not available in this environment.
|
|
3100
3109
|
Try polyfilling it using "@formatjs/intl-pluralrules"
|
|
3101
|
-
`,
|
|
3102
|
-
var o =
|
|
3110
|
+
`, O.MISSING_INTL_API));
|
|
3111
|
+
var o = D(n, Kt);
|
|
3103
3112
|
try {
|
|
3104
|
-
return t(i, o).select(
|
|
3113
|
+
return t(i, o).select(r);
|
|
3105
3114
|
} catch (s) {
|
|
3106
|
-
a(new
|
|
3115
|
+
a(new ne("Error formatting plural.", i, s));
|
|
3107
3116
|
}
|
|
3108
3117
|
return "other";
|
|
3109
3118
|
}
|
|
3110
|
-
var
|
|
3111
|
-
function
|
|
3112
|
-
var
|
|
3113
|
-
|
|
3114
|
-
var o =
|
|
3115
|
-
return t(
|
|
3119
|
+
var tr = ["numeric", "style"];
|
|
3120
|
+
function rr(e, t, r) {
|
|
3121
|
+
var n = e.locale, i = e.formats, a = e.onError;
|
|
3122
|
+
r === void 0 && (r = {});
|
|
3123
|
+
var o = r.format, s = !!o && ie(i, "relative", o, a) || {}, h = D(r, tr, s);
|
|
3124
|
+
return t(n, h);
|
|
3116
3125
|
}
|
|
3117
|
-
function
|
|
3118
|
-
i === void 0 && (i = {}),
|
|
3126
|
+
function nr(e, t, r, n, i) {
|
|
3127
|
+
i === void 0 && (i = {}), n || (n = "second");
|
|
3119
3128
|
var a = Intl.RelativeTimeFormat;
|
|
3120
|
-
a || e.onError(new
|
|
3129
|
+
a || e.onError(new L(`Intl.RelativeTimeFormat is not available in this environment.
|
|
3121
3130
|
Try polyfilling it using "@formatjs/intl-relativetimeformat"
|
|
3122
|
-
`,
|
|
3131
|
+
`, O.MISSING_INTL_API));
|
|
3123
3132
|
try {
|
|
3124
|
-
return
|
|
3133
|
+
return rr(e, t, i).format(r, n);
|
|
3125
3134
|
} catch (o) {
|
|
3126
|
-
e.onError(new
|
|
3135
|
+
e.onError(new ne("Error formatting relative time.", e.locale, o));
|
|
3127
3136
|
}
|
|
3128
|
-
return String(
|
|
3137
|
+
return String(r);
|
|
3129
3138
|
}
|
|
3130
|
-
var
|
|
3139
|
+
var ir = [
|
|
3131
3140
|
"style",
|
|
3132
3141
|
"currency",
|
|
3133
3142
|
"currencyDisplay",
|
|
@@ -3149,103 +3158,103 @@ var nr = [
|
|
|
3149
3158
|
"unitDisplay",
|
|
3150
3159
|
"numberingSystem"
|
|
3151
3160
|
];
|
|
3152
|
-
function
|
|
3153
|
-
var
|
|
3154
|
-
n === void 0 && (n = {});
|
|
3155
|
-
var o = n.format, s = o && ne(i, "number", o, a) || {}, h = C(n, nr, s);
|
|
3156
|
-
return t(r, h);
|
|
3157
|
-
}
|
|
3158
|
-
function ir(e, t, n, r) {
|
|
3161
|
+
function Ge(e, t, r) {
|
|
3162
|
+
var n = e.locale, i = e.formats, a = e.onError;
|
|
3159
3163
|
r === void 0 && (r = {});
|
|
3164
|
+
var o = r.format, s = o && ie(i, "number", o, a) || {}, h = D(r, ir, s);
|
|
3165
|
+
return t(n, h);
|
|
3166
|
+
}
|
|
3167
|
+
function ar(e, t, r, n) {
|
|
3168
|
+
n === void 0 && (n = {});
|
|
3160
3169
|
try {
|
|
3161
|
-
return
|
|
3170
|
+
return Ge(e, t, n).format(r);
|
|
3162
3171
|
} catch (i) {
|
|
3163
|
-
e.onError(new
|
|
3172
|
+
e.onError(new H(I.FORMAT_ERROR, "Error formatting number.", i));
|
|
3164
3173
|
}
|
|
3165
|
-
return String(
|
|
3174
|
+
return String(r);
|
|
3166
3175
|
}
|
|
3167
|
-
function
|
|
3168
|
-
|
|
3176
|
+
function or(e, t, r, n) {
|
|
3177
|
+
n === void 0 && (n = {});
|
|
3169
3178
|
try {
|
|
3170
|
-
return
|
|
3179
|
+
return Ge(e, t, n).formatToParts(r);
|
|
3171
3180
|
} catch (i) {
|
|
3172
|
-
e.onError(new
|
|
3181
|
+
e.onError(new H(I.FORMAT_ERROR, "Error formatting number.", i));
|
|
3173
3182
|
}
|
|
3174
3183
|
return [];
|
|
3175
3184
|
}
|
|
3176
|
-
function
|
|
3185
|
+
function sr(e) {
|
|
3177
3186
|
var t = e ? e[Object.keys(e)[0]] : void 0;
|
|
3178
3187
|
return typeof t == "string";
|
|
3179
3188
|
}
|
|
3180
|
-
function
|
|
3181
|
-
e.onWarn && e.defaultRichTextElements &&
|
|
3189
|
+
function ur(e) {
|
|
3190
|
+
e.onWarn && e.defaultRichTextElements && sr(e.messages || {}) && e.onWarn(`[@formatjs/intl] "defaultRichTextElements" was specified but "message" was not pre-compiled.
|
|
3182
3191
|
Please consider using "@formatjs/cli" to pre-compile your messages for performance.
|
|
3183
3192
|
For more details see https://formatjs.io/docs/getting-started/message-distribution`);
|
|
3184
3193
|
}
|
|
3185
|
-
function
|
|
3186
|
-
var
|
|
3187
|
-
return i ? !Intl.NumberFormat.supportedLocalesOf(i).length && o ? o(new
|
|
3188
|
-
formatters:
|
|
3189
|
-
formatNumber:
|
|
3190
|
-
formatNumberToParts:
|
|
3191
|
-
formatRelativeTime:
|
|
3192
|
-
formatDate:
|
|
3193
|
-
formatDateToParts:
|
|
3194
|
-
formatTime:
|
|
3195
|
-
formatDateTimeRange:
|
|
3196
|
-
formatTimeToParts:
|
|
3197
|
-
formatPlural:
|
|
3194
|
+
function hr(e, t) {
|
|
3195
|
+
var r = jt(t), n = v(v({}, Ut), e), i = n.locale, a = n.defaultLocale, o = n.onError;
|
|
3196
|
+
return i ? !Intl.NumberFormat.supportedLocalesOf(i).length && o ? o(new ge('Missing locale data for locale: "'.concat(i, '" in Intl.NumberFormat. Using default locale: "').concat(a, '" as fallback. See https://formatjs.io/docs/react-intl#runtime-requirements for more details'))) : !Intl.DateTimeFormat.supportedLocalesOf(i).length && o && o(new ge('Missing locale data for locale: "'.concat(i, '" in Intl.DateTimeFormat. Using default locale: "').concat(a, '" as fallback. See https://formatjs.io/docs/react-intl#runtime-requirements for more details'))) : (o && o(new Dt('"locale" was not configured, using "'.concat(a, '" as fallback. See https://formatjs.io/docs/react-intl/api#intlshape for more details'))), n.locale = n.defaultLocale || "en"), ur(n), v(v({}, n), {
|
|
3197
|
+
formatters: r,
|
|
3198
|
+
formatNumber: ar.bind(null, n, r.getNumberFormat),
|
|
3199
|
+
formatNumberToParts: or.bind(null, n, r.getNumberFormat),
|
|
3200
|
+
formatRelativeTime: nr.bind(null, n, r.getRelativeTimeFormat),
|
|
3201
|
+
formatDate: kt.bind(null, n, r.getDateTimeFormat),
|
|
3202
|
+
formatDateToParts: Wt.bind(null, n, r.getDateTimeFormat),
|
|
3203
|
+
formatTime: Xt.bind(null, n, r.getDateTimeFormat),
|
|
3204
|
+
formatDateTimeRange: Zt.bind(null, n, r.getDateTimeFormat),
|
|
3205
|
+
formatTimeToParts: zt.bind(null, n, r.getDateTimeFormat),
|
|
3206
|
+
formatPlural: er.bind(null, n, r.getPluralRules),
|
|
3198
3207
|
// @ts-expect-error TODO: will get to this later
|
|
3199
|
-
formatMessage:
|
|
3208
|
+
formatMessage: Ee.bind(null, n, r),
|
|
3200
3209
|
// @ts-expect-error TODO: will get to this later
|
|
3201
|
-
$t:
|
|
3202
|
-
formatList:
|
|
3203
|
-
formatListToParts: Fe.bind(null,
|
|
3204
|
-
formatDisplayName:
|
|
3210
|
+
$t: Ee.bind(null, n, r),
|
|
3211
|
+
formatList: $t.bind(null, n, r.getListFormat),
|
|
3212
|
+
formatListToParts: Fe.bind(null, n, r.getListFormat),
|
|
3213
|
+
formatDisplayName: Jt.bind(null, n, r.getDisplayNames)
|
|
3205
3214
|
});
|
|
3206
3215
|
}
|
|
3207
|
-
var
|
|
3208
|
-
|
|
3209
|
-
|
|
3210
|
-
function
|
|
3216
|
+
var lr = G;
|
|
3217
|
+
G.flatten = G;
|
|
3218
|
+
G.unflatten = Ve;
|
|
3219
|
+
function Ue(e) {
|
|
3211
3220
|
return e && e.constructor && typeof e.constructor.isBuffer == "function" && e.constructor.isBuffer(e);
|
|
3212
3221
|
}
|
|
3213
|
-
function
|
|
3222
|
+
function je(e) {
|
|
3214
3223
|
return e;
|
|
3215
3224
|
}
|
|
3216
|
-
function
|
|
3225
|
+
function G(e, t) {
|
|
3217
3226
|
t = t || {};
|
|
3218
|
-
const
|
|
3227
|
+
const r = t.delimiter || ".", n = t.maxDepth, i = t.transformKey || je, a = {};
|
|
3219
3228
|
function o(s, h, l) {
|
|
3220
3229
|
l = l || 1, Object.keys(s).forEach(function(u) {
|
|
3221
|
-
const f = s[u], c = t.safe && Array.isArray(f),
|
|
3222
|
-
if (!c && !E && b && Object.keys(f).length && (!t.maxDepth || l <
|
|
3223
|
-
return o(f,
|
|
3224
|
-
a[
|
|
3230
|
+
const f = s[u], c = t.safe && Array.isArray(f), g = Object.prototype.toString.call(f), E = Ue(f), b = g === "[object Object]" || g === "[object Array]", y = h ? h + r + i(u) : i(u);
|
|
3231
|
+
if (!c && !E && b && Object.keys(f).length && (!t.maxDepth || l < n))
|
|
3232
|
+
return o(f, y, l + 1);
|
|
3233
|
+
a[y] = f;
|
|
3225
3234
|
});
|
|
3226
3235
|
}
|
|
3227
3236
|
return o(e), a;
|
|
3228
3237
|
}
|
|
3229
|
-
function
|
|
3238
|
+
function Ve(e, t) {
|
|
3230
3239
|
t = t || {};
|
|
3231
|
-
const
|
|
3232
|
-
if (
|
|
3240
|
+
const r = t.delimiter || ".", n = t.overwrite || !1, i = t.transformKey || je, a = {};
|
|
3241
|
+
if (Ue(e) || Object.prototype.toString.call(e) !== "[object Object]")
|
|
3233
3242
|
return e;
|
|
3234
3243
|
function s(u) {
|
|
3235
3244
|
const f = Number(u);
|
|
3236
3245
|
return isNaN(f) || u.indexOf(".") !== -1 || t.object ? u : f;
|
|
3237
3246
|
}
|
|
3238
3247
|
function h(u, f, c) {
|
|
3239
|
-
return Object.keys(c).reduce(function(
|
|
3240
|
-
return
|
|
3248
|
+
return Object.keys(c).reduce(function(g, E) {
|
|
3249
|
+
return g[u + r + E] = c[E], g;
|
|
3241
3250
|
}, f);
|
|
3242
3251
|
}
|
|
3243
3252
|
function l(u) {
|
|
3244
|
-
const f = Object.prototype.toString.call(u), c = f === "[object Array]",
|
|
3253
|
+
const f = Object.prototype.toString.call(u), c = f === "[object Array]", g = f === "[object Object]";
|
|
3245
3254
|
if (u) {
|
|
3246
3255
|
if (c)
|
|
3247
3256
|
return !u.length;
|
|
3248
|
-
if (
|
|
3257
|
+
if (g)
|
|
3249
3258
|
return !Object.keys(u).length;
|
|
3250
3259
|
} else
|
|
3251
3260
|
return !0;
|
|
@@ -3255,47 +3264,47 @@ function je(e, t) {
|
|
|
3255
3264
|
return !(c === "[object Object]" || c === "[object Array]") || l(e[f]) ? (u[f] = e[f], u) : h(
|
|
3256
3265
|
f,
|
|
3257
3266
|
u,
|
|
3258
|
-
|
|
3267
|
+
G(e[f], t)
|
|
3259
3268
|
);
|
|
3260
3269
|
}, {}), Object.keys(e).forEach(function(u) {
|
|
3261
|
-
const f = u.split(
|
|
3262
|
-
let c = s(f.shift()),
|
|
3263
|
-
for (;
|
|
3270
|
+
const f = u.split(r).map(i);
|
|
3271
|
+
let c = s(f.shift()), g = s(f[0]), E = a;
|
|
3272
|
+
for (; g !== void 0; ) {
|
|
3264
3273
|
if (c === "__proto__")
|
|
3265
3274
|
return;
|
|
3266
|
-
const b = Object.prototype.toString.call(E[c]),
|
|
3267
|
-
if (!
|
|
3275
|
+
const b = Object.prototype.toString.call(E[c]), y = b === "[object Object]" || b === "[object Array]";
|
|
3276
|
+
if (!n && !y && typeof E[c] < "u")
|
|
3268
3277
|
return;
|
|
3269
|
-
(
|
|
3278
|
+
(n && !y || !n && E[c] == null) && (E[c] = typeof g == "number" && !t.object ? [] : {}), E = E[c], f.length > 0 && (c = s(f.shift()), g = s(f[0]));
|
|
3270
3279
|
}
|
|
3271
|
-
E[c] =
|
|
3280
|
+
E[c] = Ve(e[u], t);
|
|
3272
3281
|
}), a;
|
|
3273
3282
|
}
|
|
3274
|
-
const
|
|
3275
|
-
let
|
|
3276
|
-
const
|
|
3277
|
-
const
|
|
3283
|
+
const fr = De();
|
|
3284
|
+
let ke;
|
|
3285
|
+
const gr = (e, t, r = !1) => {
|
|
3286
|
+
const n = hr(
|
|
3278
3287
|
{
|
|
3279
3288
|
locale: e,
|
|
3280
|
-
messages:
|
|
3289
|
+
messages: lr.flatten(t, {
|
|
3281
3290
|
safe: !0
|
|
3282
3291
|
// Preserve arrays
|
|
3283
3292
|
})
|
|
3284
3293
|
},
|
|
3285
|
-
|
|
3294
|
+
fr
|
|
3286
3295
|
), s = {
|
|
3287
|
-
t: (h, l, u) =>
|
|
3288
|
-
te: (h) => !!
|
|
3289
|
-
tm: (h) =>
|
|
3290
|
-
...
|
|
3296
|
+
t: (h, l, u) => n.formatMessage({ id: h }, l, u),
|
|
3297
|
+
te: (h) => !!n.messages[h],
|
|
3298
|
+
tm: (h) => n.messages[h] || [],
|
|
3299
|
+
...n,
|
|
3291
3300
|
source: t
|
|
3292
3301
|
};
|
|
3293
|
-
return
|
|
3302
|
+
return r && (ke = s), s;
|
|
3294
3303
|
};
|
|
3295
|
-
function
|
|
3296
|
-
return
|
|
3304
|
+
function pr() {
|
|
3305
|
+
return ke;
|
|
3297
3306
|
}
|
|
3298
|
-
const
|
|
3307
|
+
const cr = (e) => Xe({
|
|
3299
3308
|
name: "I18nT",
|
|
3300
3309
|
props: {
|
|
3301
3310
|
keypath: {
|
|
@@ -3307,33 +3316,33 @@ const fr = (e) => ke({
|
|
|
3307
3316
|
default: "span"
|
|
3308
3317
|
}
|
|
3309
3318
|
},
|
|
3310
|
-
setup(t, { slots:
|
|
3311
|
-
const
|
|
3319
|
+
setup(t, { slots: r }) {
|
|
3320
|
+
const n = (i) => {
|
|
3312
3321
|
if (!i)
|
|
3313
3322
|
return [];
|
|
3314
3323
|
const a = /(\{[^}]+\})/g;
|
|
3315
3324
|
return i.split(a).filter(Boolean);
|
|
3316
3325
|
};
|
|
3317
3326
|
return () => {
|
|
3318
|
-
const i = Object.keys(
|
|
3319
|
-
let o =
|
|
3327
|
+
const i = Object.keys(r).filter((s) => s !== "_"), a = e.messages[t.keypath].toString();
|
|
3328
|
+
let o = n(a);
|
|
3320
3329
|
return o = o.filter((s) => s !== ""), o.forEach((s, h) => {
|
|
3321
3330
|
if (!s.startsWith("{") && !s.endsWith("}"))
|
|
3322
3331
|
return;
|
|
3323
3332
|
const l = s.replace(/[\{\}]/g, "");
|
|
3324
|
-
l === "0" &&
|
|
3325
|
-
}),
|
|
3333
|
+
l === "0" && r.default ? o[h] = r.default() : i.includes(l) && r[l] && (o[h] = r[l]());
|
|
3334
|
+
}), Ze(t.tag, t, o);
|
|
3326
3335
|
};
|
|
3327
3336
|
}
|
|
3328
|
-
}),
|
|
3337
|
+
}), vr = {
|
|
3329
3338
|
install(e, t) {
|
|
3330
|
-
const { i18n:
|
|
3331
|
-
e.component("I18nT",
|
|
3339
|
+
const { i18n: r } = t;
|
|
3340
|
+
e.component("I18nT", cr(r));
|
|
3332
3341
|
}
|
|
3333
3342
|
};
|
|
3334
3343
|
export {
|
|
3335
|
-
|
|
3336
|
-
|
|
3337
|
-
|
|
3344
|
+
vr as Translation,
|
|
3345
|
+
gr as createI18n,
|
|
3346
|
+
pr as useI18n
|
|
3338
3347
|
};
|
|
3339
3348
|
//# sourceMappingURL=i18n.es.js.map
|