@kong-ui-public/i18n 0.2.2 → 0.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/i18n.es.js +244 -235
- package/dist/i18n.es.js.map +1 -1
- package/dist/i18n.umd.js +9 -9
- package/dist/i18n.umd.js.map +1 -1
- package/package.json +3 -3
package/dist/i18n.es.js
CHANGED
|
@@ -26,6 +26,15 @@ var m = function() {
|
|
|
26
26
|
return t;
|
|
27
27
|
}, m.apply(this, arguments);
|
|
28
28
|
};
|
|
29
|
+
function Ze(e, t) {
|
|
30
|
+
var n = {};
|
|
31
|
+
for (var r in e)
|
|
32
|
+
Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]);
|
|
33
|
+
if (e != null && typeof Object.getOwnPropertySymbols == "function")
|
|
34
|
+
for (var i = 0, r = Object.getOwnPropertySymbols(e); i < r.length; i++)
|
|
35
|
+
t.indexOf(r[i]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[i]) && (n[r[i]] = e[r[i]]);
|
|
36
|
+
return n;
|
|
37
|
+
}
|
|
29
38
|
function O(e, t, n) {
|
|
30
39
|
if (n || arguments.length === 2)
|
|
31
40
|
for (var r = 0, i = t.length, a; r < i; r++)
|
|
@@ -40,47 +49,47 @@ 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
|
-
})(
|
|
55
|
+
})(w || (w = {}));
|
|
47
56
|
function ae(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 Ee(e) {
|
|
54
63
|
return e.type === d.number;
|
|
55
64
|
}
|
|
56
65
|
function de(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 xe(e) {
|
|
63
72
|
return e.type === d.select;
|
|
64
73
|
}
|
|
65
74
|
function Te(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
80
|
function Se(e) {
|
|
72
81
|
return e.type === d.tag;
|
|
73
82
|
}
|
|
74
83
|
function Ie(e) {
|
|
75
|
-
return !!(e && typeof e == "object" && e.type ===
|
|
84
|
+
return !!(e && typeof e == "object" && e.type === w.number);
|
|
76
85
|
}
|
|
77
86
|
function q(e) {
|
|
78
|
-
return !!(e && typeof e == "object" && e.type ===
|
|
87
|
+
return !!(e && typeof e == "object" && e.type === w.dateTime);
|
|
79
88
|
}
|
|
80
|
-
var Ae = /[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/,
|
|
81
|
-
function
|
|
89
|
+
var Ae = /[ \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(
|
|
92
|
+
return e.replace(qe, function(n) {
|
|
84
93
|
var r = n.length;
|
|
85
94
|
switch (n[0]) {
|
|
86
95
|
case "G":
|
|
@@ -169,11 +178,11 @@ 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
187
|
}), n = [], r = 0, i = t; r < i.length; r++) {
|
|
179
188
|
var a = i[r], o = a.split("/");
|
|
@@ -188,10 +197,10 @@ function Qe(e) {
|
|
|
188
197
|
}
|
|
189
198
|
return n;
|
|
190
199
|
}
|
|
191
|
-
function
|
|
200
|
+
function $e(e) {
|
|
192
201
|
return e.replace(/^(.*?)-/, "");
|
|
193
202
|
}
|
|
194
|
-
var oe = /^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g, He = /^(@+)?(\+|#+)?[rs]?$/g,
|
|
203
|
+
var oe = /^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g, He = /^(@+)?(\+|#+)?[rs]?$/g, Ke = /(\*)(0+)|(#+)(0+)|(0+)/g, Ne = /^(0+)$/;
|
|
195
204
|
function se(e) {
|
|
196
205
|
var t = {};
|
|
197
206
|
return e[e.length - 1] === "r" ? t.roundingPriority = "morePrecision" : e[e.length - 1] === "s" && (t.roundingPriority = "lessPrecision"), e.replace(He, function(n, r, i) {
|
|
@@ -238,7 +247,7 @@ 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"
|
|
@@ -256,7 +265,7 @@ function ue(e) {
|
|
|
256
265
|
var t = {}, n = _e(e);
|
|
257
266
|
return n || t;
|
|
258
267
|
}
|
|
259
|
-
function
|
|
268
|
+
function tt(e) {
|
|
260
269
|
for (var t = {}, n = 0, r = e; n < r.length; n++) {
|
|
261
270
|
var i = r[n];
|
|
262
271
|
switch (i.stem) {
|
|
@@ -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":
|
|
@@ -321,7 +330,7 @@ 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, p) {
|
|
325
334
|
if (l)
|
|
326
335
|
t.minimumIntegerDigits = u.length;
|
|
327
336
|
else {
|
|
@@ -354,7 +363,7 @@ function et(e) {
|
|
|
354
363
|
}
|
|
355
364
|
var o = _e(i.stem);
|
|
356
365
|
o && (t = m(m({}, t), o));
|
|
357
|
-
var s =
|
|
366
|
+
var s = et(i.stem);
|
|
358
367
|
s && (t = m(m({}, t), s));
|
|
359
368
|
}
|
|
360
369
|
return t;
|
|
@@ -1696,13 +1705,13 @@ var U = {
|
|
|
1696
1705
|
"h"
|
|
1697
1706
|
]
|
|
1698
1707
|
};
|
|
1699
|
-
function
|
|
1708
|
+
function rt(e, t) {
|
|
1700
1709
|
for (var n = "", r = 0; r < e.length; r++) {
|
|
1701
1710
|
var i = e.charAt(r);
|
|
1702
1711
|
if (i === "j") {
|
|
1703
1712
|
for (var a = 0; r + 1 < e.length && e.charAt(r + 1) === i; )
|
|
1704
1713
|
a++, r++;
|
|
1705
|
-
var o = 1 + (a & 1), s = a < 2 ? 1 : 3 + (a >> 1), h = "a", l =
|
|
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
|
n += h;
|
|
1708
1717
|
for (; o-- > 0; )
|
|
@@ -1712,7 +1721,7 @@ function tt(e, t) {
|
|
|
1712
1721
|
}
|
|
1713
1722
|
return n;
|
|
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
|
|
@@ -1734,20 +1743,20 @@ function rt(e) {
|
|
|
1734
1743
|
var i = U[r || ""] || U[n || ""] || U["".concat(n, "-001")] || U["001"];
|
|
1735
1744
|
return i[0];
|
|
1736
1745
|
}
|
|
1737
|
-
var X,
|
|
1746
|
+
var X, it = new RegExp("^".concat(Ae.source, "*")), at = new RegExp("".concat(Ae.source, "*$"));
|
|
1738
1747
|
function v(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
|
}, J = !0;
|
|
1744
1753
|
try {
|
|
1745
|
-
var
|
|
1746
|
-
J = ((X =
|
|
1754
|
+
var gt = Re("([^\\p{White_Space}\\p{Pattern_Syntax}]*)", "yu");
|
|
1755
|
+
J = ((X = gt.exec("a")) === null || X === void 0 ? void 0 : X[0]) === "a";
|
|
1747
1756
|
} catch {
|
|
1748
1757
|
J = !1;
|
|
1749
1758
|
}
|
|
1750
|
-
var he =
|
|
1759
|
+
var he = ot ? (
|
|
1751
1760
|
// Native
|
|
1752
1761
|
function(t, n, r) {
|
|
1753
1762
|
return t.startsWith(n, r);
|
|
@@ -1757,7 +1766,7 @@ var he = at ? (
|
|
|
1757
1766
|
function(t, n, r) {
|
|
1758
1767
|
return t.slice(r, r + n.length) === n;
|
|
1759
1768
|
}
|
|
1760
|
-
), Q =
|
|
1769
|
+
), Q = st ? String.fromCodePoint : (
|
|
1761
1770
|
// IE11
|
|
1762
1771
|
function() {
|
|
1763
1772
|
for (var t = [], n = 0; n < arguments.length; n++)
|
|
@@ -1771,7 +1780,7 @@ var he = at ? (
|
|
|
1771
1780
|
}
|
|
1772
1781
|
), le = (
|
|
1773
1782
|
// native
|
|
1774
|
-
|
|
1783
|
+
ut ? Object.fromEntries : (
|
|
1775
1784
|
// Ponyfill
|
|
1776
1785
|
function(t) {
|
|
1777
1786
|
for (var n = {}, r = 0, i = t; r < i.length; r++) {
|
|
@@ -1781,7 +1790,7 @@ var he = at ? (
|
|
|
1781
1790
|
return n;
|
|
1782
1791
|
}
|
|
1783
1792
|
)
|
|
1784
|
-
), Be =
|
|
1793
|
+
), Be = ht ? (
|
|
1785
1794
|
// Native
|
|
1786
1795
|
function(t, n) {
|
|
1787
1796
|
return t.codePointAt(n);
|
|
@@ -1795,7 +1804,7 @@ var he = at ? (
|
|
|
1795
1804
|
return i < 55296 || i > 56319 || n + 1 === r || (a = t.charCodeAt(n + 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,7 +1822,7 @@ 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
1828
|
function Re(e, t) {
|
|
@@ -1832,13 +1841,13 @@ if (J) {
|
|
|
1832
1841
|
Y = function(t, n) {
|
|
1833
1842
|
for (var r = []; ; ) {
|
|
1834
1843
|
var i = Be(t, n);
|
|
1835
|
-
if (i === void 0 || Oe(i) ||
|
|
1844
|
+
if (i === void 0 || Oe(i) || yt(i))
|
|
1836
1845
|
break;
|
|
1837
1846
|
r.push(i), n += i >= 65536 ? 2 : 1;
|
|
1838
1847
|
}
|
|
1839
1848
|
return Q.apply(void 0, r);
|
|
1840
1849
|
};
|
|
1841
|
-
var
|
|
1850
|
+
var bt = (
|
|
1842
1851
|
/** @class */
|
|
1843
1852
|
function() {
|
|
1844
1853
|
function e(t, n) {
|
|
@@ -1920,7 +1929,7 @@ var vt = (
|
|
|
1920
1929
|
return this.error(g.INVALID_TAG, v(r, 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
1935
|
}, e.prototype.parseLiteral = function(t, n) {
|
|
@@ -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
2050
|
return this.error(g.EXPECT_ARGUMENT_STYLE, v(this.clonePosition(), this.clonePosition()));
|
|
2042
2051
|
var p = v(u, this.clonePosition());
|
|
2043
2052
|
l = { style: c, styleLocation: p };
|
|
2044
2053
|
}
|
|
2045
|
-
var
|
|
2046
|
-
if (
|
|
2047
|
-
return
|
|
2048
|
-
var
|
|
2054
|
+
var b = this.tryParseArgumentClose(i);
|
|
2055
|
+
if (b.err)
|
|
2056
|
+
return b;
|
|
2057
|
+
var E = v(i, this.clonePosition());
|
|
2049
2058
|
if (l && he(l == null ? void 0 : l.style, "::", 0)) {
|
|
2050
|
-
var
|
|
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: r, location:
|
|
2063
|
+
val: { type: d.number, value: r, location: E, style: f.val },
|
|
2055
2064
|
err: null
|
|
2056
2065
|
};
|
|
2057
2066
|
} else {
|
|
2058
|
-
if (
|
|
2059
|
-
return this.error(g.EXPECT_DATE_TIME_SKELETON,
|
|
2060
|
-
var
|
|
2061
|
-
this.locale && (
|
|
2067
|
+
if (y.length === 0)
|
|
2068
|
+
return this.error(g.EXPECT_DATE_TIME_SKELETON, E);
|
|
2069
|
+
var x = y;
|
|
2070
|
+
this.locale && (x = rt(y, this.locale));
|
|
2062
2071
|
var c = {
|
|
2063
|
-
type:
|
|
2064
|
-
pattern:
|
|
2072
|
+
type: w.dateTime,
|
|
2073
|
+
pattern: x,
|
|
2065
2074
|
location: l.styleLocation,
|
|
2066
|
-
parsedOptions: this.shouldParseSkeletons ?
|
|
2075
|
+
parsedOptions: this.shouldParseSkeletons ? Je(x) : {}
|
|
2067
2076
|
}, H = s === "date" ? d.date : d.time;
|
|
2068
2077
|
return {
|
|
2069
|
-
val: { type: H, value: r, location:
|
|
2078
|
+
val: { type: H, value: r, location: E, style: c },
|
|
2070
2079
|
err: null
|
|
2071
2080
|
};
|
|
2072
2081
|
}
|
|
@@ -2075,7 +2084,7 @@ var vt = (
|
|
|
2075
2084
|
val: {
|
|
2076
2085
|
type: s === "number" ? d.number : s === "date" ? d.date : d.time,
|
|
2077
2086
|
value: r,
|
|
2078
|
-
location:
|
|
2087
|
+
location: E,
|
|
2079
2088
|
style: (a = l == null ? void 0 : l.style) !== null && a !== void 0 ? a : null
|
|
2080
2089
|
},
|
|
2081
2090
|
err: null
|
|
@@ -2088,22 +2097,22 @@ var vt = (
|
|
|
2088
2097
|
if (this.bumpSpace(), !this.bumpIf(","))
|
|
2089
2098
|
return this.error(g.EXPECT_SELECT_ARGUMENT_OPTIONS, v(T, m({}, T)));
|
|
2090
2099
|
this.bumpSpace();
|
|
2091
|
-
var
|
|
2092
|
-
if (s !== "select" &&
|
|
2100
|
+
var D = this.parseIdentifierIfPossible(), L = 0;
|
|
2101
|
+
if (s !== "select" && D.value === "offset") {
|
|
2093
2102
|
if (!this.bumpIf(":"))
|
|
2094
2103
|
return this.error(g.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE, v(this.clonePosition(), this.clonePosition()));
|
|
2095
2104
|
this.bumpSpace();
|
|
2096
2105
|
var f = this.tryParseDecimalInteger(g.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE, g.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE);
|
|
2097
2106
|
if (f.err)
|
|
2098
2107
|
return f;
|
|
2099
|
-
this.bumpSpace(),
|
|
2108
|
+
this.bumpSpace(), D = this.parseIdentifierIfPossible(), L = f.val;
|
|
2100
2109
|
}
|
|
2101
|
-
var G = this.tryParsePluralOrSelectOptions(t, s, n,
|
|
2110
|
+
var G = this.tryParsePluralOrSelectOptions(t, s, n, D);
|
|
2102
2111
|
if (G.err)
|
|
2103
2112
|
return G;
|
|
2104
|
-
var
|
|
2105
|
-
if (
|
|
2106
|
-
return
|
|
2113
|
+
var b = this.tryParseArgumentClose(i);
|
|
2114
|
+
if (b.err)
|
|
2115
|
+
return b;
|
|
2107
2116
|
var ie = v(i, this.clonePosition());
|
|
2108
2117
|
return s === "select" ? {
|
|
2109
2118
|
val: {
|
|
@@ -2168,16 +2177,16 @@ var vt = (
|
|
|
2168
2177
|
}, e.prototype.parseNumberSkeletonFromString = function(t, n) {
|
|
2169
2178
|
var r = [];
|
|
2170
2179
|
try {
|
|
2171
|
-
r =
|
|
2180
|
+
r = Ye(t);
|
|
2172
2181
|
} catch {
|
|
2173
2182
|
return this.error(g.INVALID_NUMBER_SKELETON, n);
|
|
2174
2183
|
}
|
|
2175
2184
|
return {
|
|
2176
2185
|
val: {
|
|
2177
|
-
type:
|
|
2186
|
+
type: w.number,
|
|
2178
2187
|
tokens: r,
|
|
2179
2188
|
location: n,
|
|
2180
|
-
parsedOptions: this.shouldParseSkeletons ?
|
|
2189
|
+
parsedOptions: this.shouldParseSkeletons ? tt(r) : {}
|
|
2181
2190
|
},
|
|
2182
2191
|
err: null
|
|
2183
2192
|
};
|
|
@@ -2199,16 +2208,16 @@ var vt = (
|
|
|
2199
2208
|
var p = this.clonePosition();
|
|
2200
2209
|
if (!this.bumpIf("{"))
|
|
2201
2210
|
return this.error(n === "select" ? g.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT : g.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT, v(this.clonePosition(), this.clonePosition()));
|
|
2202
|
-
var
|
|
2203
|
-
if (E.err)
|
|
2204
|
-
return E;
|
|
2205
|
-
var b = this.tryParseArgumentClose(p);
|
|
2211
|
+
var b = this.parseMessage(t + 1, n, r);
|
|
2206
2212
|
if (b.err)
|
|
2207
2213
|
return b;
|
|
2214
|
+
var E = this.tryParseArgumentClose(p);
|
|
2215
|
+
if (E.err)
|
|
2216
|
+
return E;
|
|
2208
2217
|
s.push([
|
|
2209
2218
|
l,
|
|
2210
2219
|
{
|
|
2211
|
-
value:
|
|
2220
|
+
value: b.val,
|
|
2212
2221
|
location: v(p, this.clonePosition())
|
|
2213
2222
|
}
|
|
2214
2223
|
]), h.add(l), this.bumpSpace(), a = this.parseIdentifierIfPossible(), l = a.value, u = a.location;
|
|
@@ -2225,7 +2234,7 @@ var vt = (
|
|
|
2225
2234
|
break;
|
|
2226
2235
|
}
|
|
2227
2236
|
var h = v(i, this.clonePosition());
|
|
2228
|
-
return a ? (o *= r,
|
|
2237
|
+
return a ? (o *= r, mt(o) ? { val: o, err: null } : this.error(n, h)) : this.error(t, h);
|
|
2229
2238
|
}, e.prototype.offset = function() {
|
|
2230
2239
|
return this.position.offset;
|
|
2231
2240
|
}, e.prototype.isEOF = function() {
|
|
@@ -2297,27 +2306,27 @@ function $(e) {
|
|
|
2297
2306
|
function Et(e) {
|
|
2298
2307
|
return $(e) || e === 47;
|
|
2299
2308
|
}
|
|
2300
|
-
function
|
|
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
2312
|
function Oe(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 yt(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
2318
|
function K(e) {
|
|
2310
2319
|
e.forEach(function(t) {
|
|
2311
|
-
if (delete t.location,
|
|
2320
|
+
if (delete t.location, xe(t) || Te(t))
|
|
2312
2321
|
for (var n in t.options)
|
|
2313
2322
|
delete t.options[n].location, K(t.options[n].value);
|
|
2314
2323
|
else
|
|
2315
|
-
|
|
2324
|
+
Ee(t) && Ie(t.style) || (de(t) || ye(t)) && q(t.style) ? delete t.style.location : Se(t) && K(t.children);
|
|
2316
2325
|
});
|
|
2317
2326
|
}
|
|
2318
2327
|
function xt(e, t) {
|
|
2319
2328
|
t === void 0 && (t = {}), t = m({ shouldParseSkeletons: !0, requiresOtherClause: !0 }, t);
|
|
2320
|
-
var n = new
|
|
2329
|
+
var n = new bt(e, t).parse();
|
|
2321
2330
|
if (n.err) {
|
|
2322
2331
|
var r = SyntaxError(g[n.err.kind]);
|
|
2323
2332
|
throw r.location = n.err.location, r.originalMessage = n.err.message, r;
|
|
@@ -2325,17 +2334,17 @@ function xt(e, t) {
|
|
|
2325
2334
|
return t != null && t.captureLocation || K(n.val), n.val;
|
|
2326
2335
|
}
|
|
2327
2336
|
function _(e, t) {
|
|
2328
|
-
var n = t && t.cache ? t.cache :
|
|
2337
|
+
var n = t && t.cache ? t.cache : Nt, r = t && t.serializer ? t.serializer : Ht, i = t && t.strategy ? t.strategy : St;
|
|
2329
2338
|
return i(e, {
|
|
2330
2339
|
cache: n,
|
|
2331
2340
|
serializer: r
|
|
2332
2341
|
});
|
|
2333
2342
|
}
|
|
2334
|
-
function
|
|
2343
|
+
function Tt(e) {
|
|
2335
2344
|
return e == null || typeof e == "number" || typeof e == "boolean";
|
|
2336
2345
|
}
|
|
2337
2346
|
function Pe(e, t, n, r) {
|
|
2338
|
-
var i =
|
|
2347
|
+
var i = Tt(r) ? r : n(r), a = t.get(i);
|
|
2339
2348
|
return typeof a > "u" && (a = e.call(this, r), t.set(i, a)), a;
|
|
2340
2349
|
}
|
|
2341
2350
|
function Le(e, t, n) {
|
|
@@ -2345,17 +2354,17 @@ function Le(e, t, n) {
|
|
|
2345
2354
|
function ee(e, t, n, r, i) {
|
|
2346
2355
|
return n.bind(t, e, r, i);
|
|
2347
2356
|
}
|
|
2348
|
-
function
|
|
2357
|
+
function St(e, t) {
|
|
2349
2358
|
var n = e.length === 1 ? Pe : Le;
|
|
2350
2359
|
return ee(e, this, n, t.cache.create(), t.serializer);
|
|
2351
2360
|
}
|
|
2352
|
-
function
|
|
2361
|
+
function It(e, t) {
|
|
2353
2362
|
return ee(e, this, Le, t.cache.create(), t.serializer);
|
|
2354
2363
|
}
|
|
2355
|
-
function
|
|
2364
|
+
function At(e, t) {
|
|
2356
2365
|
return ee(e, this, Pe, t.cache.create(), t.serializer);
|
|
2357
2366
|
}
|
|
2358
|
-
var
|
|
2367
|
+
var Ht = function() {
|
|
2359
2368
|
return JSON.stringify(arguments);
|
|
2360
2369
|
};
|
|
2361
2370
|
function te() {
|
|
@@ -2367,13 +2376,13 @@ te.prototype.get = function(e) {
|
|
|
2367
2376
|
te.prototype.set = function(e, t) {
|
|
2368
2377
|
this.cache[e] = t;
|
|
2369
2378
|
};
|
|
2370
|
-
var
|
|
2379
|
+
var Nt = {
|
|
2371
2380
|
create: function() {
|
|
2372
2381
|
return new te();
|
|
2373
2382
|
}
|
|
2374
2383
|
}, B = {
|
|
2375
|
-
variadic:
|
|
2376
|
-
monadic:
|
|
2384
|
+
variadic: It,
|
|
2385
|
+
monadic: At
|
|
2377
2386
|
}, R;
|
|
2378
2387
|
(function(e) {
|
|
2379
2388
|
e.MISSING_VALUE = "MISSING_VALUE", e.INVALID_VALUE = "INVALID_VALUE", e.MISSING_INTL_API = "MISSING_INTL_API";
|
|
@@ -2399,7 +2408,7 @@ var P = (
|
|
|
2399
2408
|
}
|
|
2400
2409
|
return t;
|
|
2401
2410
|
}(P)
|
|
2402
|
-
),
|
|
2411
|
+
), _t = (
|
|
2403
2412
|
/** @class */
|
|
2404
2413
|
function(e) {
|
|
2405
2414
|
N(t, e);
|
|
@@ -2408,7 +2417,7 @@ var P = (
|
|
|
2408
2417
|
}
|
|
2409
2418
|
return t;
|
|
2410
2419
|
}(P)
|
|
2411
|
-
),
|
|
2420
|
+
), Bt = (
|
|
2412
2421
|
/** @class */
|
|
2413
2422
|
function(e) {
|
|
2414
2423
|
N(t, e);
|
|
@@ -2421,13 +2430,13 @@ var P = (
|
|
|
2421
2430
|
(function(e) {
|
|
2422
2431
|
e[e.literal = 0] = "literal", e[e.object = 1] = "object";
|
|
2423
2432
|
})(I || (I = {}));
|
|
2424
|
-
function
|
|
2433
|
+
function Rt(e) {
|
|
2425
2434
|
return e.length < 2 ? e : e.reduce(function(t, n) {
|
|
2426
2435
|
var r = t[t.length - 1];
|
|
2427
2436
|
return !r || r.type !== I.literal || n.type !== I.literal ? t.push(n) : r.value += n.value, t;
|
|
2428
2437
|
}, []);
|
|
2429
2438
|
}
|
|
2430
|
-
function
|
|
2439
|
+
function Ot(e) {
|
|
2431
2440
|
return typeof e == "function";
|
|
2432
2441
|
}
|
|
2433
2442
|
function V(e, t, n, r, i, a, o) {
|
|
@@ -2447,7 +2456,7 @@ function V(e, t, n, r, i, a, o) {
|
|
|
2447
2456
|
});
|
|
2448
2457
|
continue;
|
|
2449
2458
|
}
|
|
2450
|
-
if (
|
|
2459
|
+
if (ze(u)) {
|
|
2451
2460
|
typeof a == "number" && s.push({
|
|
2452
2461
|
type: I.literal,
|
|
2453
2462
|
value: n.getNumberFormat(t).format(a)
|
|
@@ -2456,9 +2465,9 @@ function V(e, t, n, r, i, a, o) {
|
|
|
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
2472
|
type: typeof c == "string" ? I.literal : I.object,
|
|
2464
2473
|
value: c
|
|
@@ -2473,7 +2482,7 @@ function V(e, t, n, r, i, a, o) {
|
|
|
2473
2482
|
});
|
|
2474
2483
|
continue;
|
|
2475
2484
|
}
|
|
2476
|
-
if (
|
|
2485
|
+
if (ye(u)) {
|
|
2477
2486
|
var p = typeof u.style == "string" ? r.time[u.style] : q(u.style) ? u.style.parsedOptions : r.time.medium;
|
|
2478
2487
|
s.push({
|
|
2479
2488
|
type: I.literal,
|
|
@@ -2481,7 +2490,7 @@ function V(e, t, n, r, i, a, o) {
|
|
|
2481
2490
|
});
|
|
2482
2491
|
continue;
|
|
2483
2492
|
}
|
|
2484
|
-
if (
|
|
2493
|
+
if (Ee(u)) {
|
|
2485
2494
|
var p = typeof u.style == "string" ? r.number[u.style] : Ie(u.style) ? u.style.parsedOptions : void 0;
|
|
2486
2495
|
p && p.scale && (c = c * (p.scale || 1)), s.push({
|
|
2487
2496
|
type: I.literal,
|
|
@@ -2490,10 +2499,10 @@ function V(e, t, n, r, i, a, o) {
|
|
|
2490
2499
|
continue;
|
|
2491
2500
|
}
|
|
2492
2501
|
if (Se(u)) {
|
|
2493
|
-
var
|
|
2494
|
-
if (!
|
|
2495
|
-
throw new
|
|
2496
|
-
var
|
|
2502
|
+
var b = u.children, E = u.value, y = i[E];
|
|
2503
|
+
if (!Ot(y))
|
|
2504
|
+
throw new _t(E, "function", o);
|
|
2505
|
+
var x = V(b, t, n, r, i, a), H = y(x.map(function(L) {
|
|
2497
2506
|
return L.value;
|
|
2498
2507
|
}));
|
|
2499
2508
|
Array.isArray(H) || (H = [H]), s.push.apply(s, H.map(function(L) {
|
|
@@ -2503,7 +2512,7 @@ function V(e, t, n, r, i, a, o) {
|
|
|
2503
2512
|
};
|
|
2504
2513
|
}));
|
|
2505
2514
|
}
|
|
2506
|
-
if (
|
|
2515
|
+
if (xe(u)) {
|
|
2507
2516
|
var T = u.options[c] || u.options.other;
|
|
2508
2517
|
if (!T)
|
|
2509
2518
|
throw new ce(u.value, c, Object.keys(u.options), o);
|
|
@@ -2517,8 +2526,8 @@ function V(e, t, n, r, i, a, o) {
|
|
|
2517
2526
|
throw new P(`Intl.PluralRules is not available in this environment.
|
|
2518
2527
|
Try polyfilling it using "@formatjs/intl-pluralrules"
|
|
2519
2528
|
`, R.MISSING_INTL_API, o);
|
|
2520
|
-
var
|
|
2521
|
-
T = u.options[
|
|
2529
|
+
var D = n.getPluralRules(t, { type: u.pluralType }).select(c - (u.offset || 0));
|
|
2530
|
+
T = u.options[D] || u.options.other;
|
|
2522
2531
|
}
|
|
2523
2532
|
if (!T)
|
|
2524
2533
|
throw new ce(u.value, c, Object.keys(u.options), o);
|
|
@@ -2526,16 +2535,16 @@ Try polyfilling it using "@formatjs/intl-pluralrules"
|
|
|
2526
2535
|
continue;
|
|
2527
2536
|
}
|
|
2528
2537
|
}
|
|
2529
|
-
return
|
|
2538
|
+
return Rt(s);
|
|
2530
2539
|
}
|
|
2531
|
-
function
|
|
2540
|
+
function Pt(e, t) {
|
|
2532
2541
|
return t ? m(m(m({}, e || {}), t || {}), Object.keys(e).reduce(function(n, r) {
|
|
2533
2542
|
return n[r] = m(m({}, e[r]), t[r] || {}), n;
|
|
2534
2543
|
}, {})) : e;
|
|
2535
2544
|
}
|
|
2536
|
-
function
|
|
2545
|
+
function Lt(e, t) {
|
|
2537
2546
|
return t ? Object.keys(e).reduce(function(n, r) {
|
|
2538
|
-
return n[r] =
|
|
2547
|
+
return n[r] = Pt(e[r], t[r]), n;
|
|
2539
2548
|
}, m({}, e)) : e;
|
|
2540
2549
|
}
|
|
2541
2550
|
function Z(e) {
|
|
@@ -2552,7 +2561,7 @@ function Z(e) {
|
|
|
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: {},
|
|
@@ -2594,35 +2603,35 @@ var Me = (
|
|
|
2594
2603
|
number: {},
|
|
2595
2604
|
dateTime: {},
|
|
2596
2605
|
pluralRules: {}
|
|
2597
|
-
}, this.format = function(
|
|
2598
|
-
var
|
|
2599
|
-
if (
|
|
2600
|
-
return
|
|
2601
|
-
var
|
|
2602
|
-
return !
|
|
2606
|
+
}, this.format = function(h) {
|
|
2607
|
+
var l = a.formatToParts(h);
|
|
2608
|
+
if (l.length === 1)
|
|
2609
|
+
return l[0].value;
|
|
2610
|
+
var u = l.reduce(function(f, c) {
|
|
2611
|
+
return !f.length || c.type !== I.literal || typeof f[f.length - 1] != "string" ? f.push(c.value) : f[f.length - 1] += c.value, f;
|
|
2603
2612
|
}, []);
|
|
2604
|
-
return
|
|
2605
|
-
}, this.formatToParts = function(
|
|
2606
|
-
return V(a.ast, a.locales, a.formatters, a.formats,
|
|
2613
|
+
return u.length <= 1 ? u[0] || "" : u;
|
|
2614
|
+
}, this.formatToParts = function(h) {
|
|
2615
|
+
return V(a.ast, a.locales, a.formatters, a.formats, h, void 0, a.message);
|
|
2607
2616
|
}, this.resolvedOptions = function() {
|
|
2608
|
-
var
|
|
2617
|
+
var h;
|
|
2609
2618
|
return {
|
|
2610
|
-
locale: ((
|
|
2619
|
+
locale: ((h = a.resolvedLocale) === null || h === void 0 ? void 0 : h.toString()) || Intl.NumberFormat.supportedLocalesOf(a.locales)[0]
|
|
2611
2620
|
};
|
|
2612
2621
|
}, this.getAst = function() {
|
|
2613
2622
|
return a.ast;
|
|
2614
2623
|
}, this.locales = n, this.resolvedLocale = e.resolveLocale(n), 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
|
-
|
|
2618
|
-
|
|
2619
|
-
|
|
2620
|
-
});
|
|
2626
|
+
var o = i || {};
|
|
2627
|
+
o.formatters;
|
|
2628
|
+
var s = Ze(o, ["formatters"]);
|
|
2629
|
+
this.ast = e.__parse(t, m(m({}, s), { locale: this.resolvedLocale }));
|
|
2621
2630
|
} else
|
|
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, r), this.formatters = i && i.formatters || Mt(this.formatterCache);
|
|
2626
2635
|
}
|
|
2627
2636
|
return Object.defineProperty(e, "defaultLocale", {
|
|
2628
2637
|
get: function() {
|
|
@@ -2712,7 +2721,7 @@ var A = (
|
|
|
2712
2721
|
}
|
|
2713
2722
|
return t;
|
|
2714
2723
|
}(Error)
|
|
2715
|
-
),
|
|
2724
|
+
), Ct = (
|
|
2716
2725
|
/** @class */
|
|
2717
2726
|
function(e) {
|
|
2718
2727
|
N(t, e);
|
|
@@ -2721,7 +2730,7 @@ var A = (
|
|
|
2721
2730
|
}
|
|
2722
2731
|
return t;
|
|
2723
2732
|
}(A)
|
|
2724
|
-
),
|
|
2733
|
+
), wt = (
|
|
2725
2734
|
/** @class */
|
|
2726
2735
|
function(e) {
|
|
2727
2736
|
N(t, e);
|
|
@@ -2785,9 +2794,9 @@ function C(e, t, n) {
|
|
|
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,7 +2804,7 @@ var Ft = function(e) {
|
|
|
2795
2804
|
defaultFormats: {},
|
|
2796
2805
|
fallbackOnEmptyString: !0,
|
|
2797
2806
|
onError: Ft,
|
|
2798
|
-
onWarn:
|
|
2807
|
+
onWarn: Gt
|
|
2799
2808
|
};
|
|
2800
2809
|
function Ce() {
|
|
2801
2810
|
return {
|
|
@@ -2822,7 +2831,7 @@ function M(e) {
|
|
|
2822
2831
|
}
|
|
2823
2832
|
};
|
|
2824
2833
|
}
|
|
2825
|
-
function
|
|
2834
|
+
function jt(e) {
|
|
2826
2835
|
e === void 0 && (e = Ce());
|
|
2827
2836
|
var t = Intl.RelativeTimeFormat, n = Intl.ListFormat, r = Intl.DisplayNames, i = _(function() {
|
|
2828
2837
|
for (var s, h = [], l = 0; l < arguments.length; l++)
|
|
@@ -2890,9 +2899,9 @@ function ne(e, t, n, r) {
|
|
|
2890
2899
|
var i = e && e[t], a;
|
|
2891
2900
|
if (i && (a = i[n]), a)
|
|
2892
2901
|
return a;
|
|
2893
|
-
r(new
|
|
2902
|
+
r(new Ct("No ".concat(t, " format named: ").concat(n)));
|
|
2894
2903
|
}
|
|
2895
|
-
function
|
|
2904
|
+
function Vt(e, t, n) {
|
|
2896
2905
|
if (n === void 0 && (n = Error), !e)
|
|
2897
2906
|
throw new n(t);
|
|
2898
2907
|
}
|
|
@@ -2916,45 +2925,45 @@ function pe(e, t) {
|
|
|
2916
2925
|
var ve = function(e, t, n, r, i) {
|
|
2917
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, p = e.defaultRichTextElements;
|
|
2918
2927
|
n === void 0 && (n = { id: "" });
|
|
2919
|
-
var
|
|
2920
|
-
|
|
2921
|
-
var
|
|
2928
|
+
var b = n.id, E = n.defaultMessage;
|
|
2929
|
+
Vt(!!b, "[@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(b), x = (
|
|
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 (!r &&
|
|
2930
|
-
return
|
|
2931
|
-
if (r = m(m({}, p), r || {}), o = pe(o, c), l = pe(l, c), !
|
|
2932
|
-
if (u === !1 &&
|
|
2933
|
-
return
|
|
2934
|
-
if ((!
|
|
2936
|
+
if (Array.isArray(x) && x.length === 1 && x[0].type === d.literal)
|
|
2937
|
+
return x[0].value;
|
|
2938
|
+
if (!r && x && typeof x == "string" && !p)
|
|
2939
|
+
return x.replace(/'\{(.*?)\}'/gi, "{$1}");
|
|
2940
|
+
if (r = m(m({}, p), r || {}), o = pe(o, c), l = pe(l, c), !x) {
|
|
2941
|
+
if (u === !1 && x === "")
|
|
2942
|
+
return x;
|
|
2943
|
+
if ((!E || a && a.toLowerCase() !== h.toLowerCase()) && f(new Dt(n, a)), E)
|
|
2935
2944
|
try {
|
|
2936
|
-
var H = t.getMessageFormat(
|
|
2945
|
+
var H = t.getMessageFormat(E, h, l, i);
|
|
2937
2946
|
return H.format(r);
|
|
2938
2947
|
} catch (T) {
|
|
2939
|
-
return f(new W('Error formatting default message for: "'.concat(
|
|
2948
|
+
return f(new W('Error formatting default message for: "'.concat(y, '", rendering default message verbatim'), a, n, T)), typeof E == "string" ? E : y;
|
|
2940
2949
|
}
|
|
2941
|
-
return
|
|
2950
|
+
return y;
|
|
2942
2951
|
}
|
|
2943
2952
|
try {
|
|
2944
|
-
var H = t.getMessageFormat(
|
|
2953
|
+
var H = t.getMessageFormat(x, a, o, m({ formatters: t }, i || {}));
|
|
2945
2954
|
return H.format(r);
|
|
2946
2955
|
} catch (T) {
|
|
2947
|
-
f(new W('Error formatting message: "'.concat(
|
|
2956
|
+
f(new W('Error formatting message: "'.concat(y, '", using ').concat(E ? "default message" : "id", " as fallback."), a, n, T));
|
|
2948
2957
|
}
|
|
2949
|
-
if (
|
|
2958
|
+
if (E)
|
|
2950
2959
|
try {
|
|
2951
|
-
var H = t.getMessageFormat(
|
|
2960
|
+
var H = t.getMessageFormat(E, h, l, i);
|
|
2952
2961
|
return H.format(r);
|
|
2953
2962
|
} catch (T) {
|
|
2954
|
-
f(new W('Error formatting the default message for: "'.concat(
|
|
2963
|
+
f(new W('Error formatting the default message for: "'.concat(y, '", rendering message verbatim'), a, n, T));
|
|
2955
2964
|
}
|
|
2956
|
-
return typeof
|
|
2957
|
-
},
|
|
2965
|
+
return typeof x == "string" ? x : typeof E == "string" ? E : y;
|
|
2966
|
+
}, we = [
|
|
2958
2967
|
"formatMatcher",
|
|
2959
2968
|
"timeZone",
|
|
2960
2969
|
"hour12",
|
|
@@ -2978,10 +2987,10 @@ var ve = function(e, t, n, r, i) {
|
|
|
2978
2987
|
function k(e, t, n, r) {
|
|
2979
2988
|
var i = e.locale, a = e.formats, o = e.onError, s = e.timeZone;
|
|
2980
2989
|
r === void 0 && (r = {});
|
|
2981
|
-
var h = r.format, l = m(m({}, s && { timeZone: s }), h && ne(a, t, h, o)), u = C(r,
|
|
2990
|
+
var h = r.format, l = m(m({}, s && { timeZone: s }), h && ne(a, t, h, o)), u = C(r, we, l);
|
|
2982
2991
|
return t === "time" && !u.hour && !u.minute && !u.second && !u.timeStyle && !u.dateStyle && (u = m(m({}, u), { hour: "numeric", minute: "numeric" })), n(i, u);
|
|
2983
2992
|
}
|
|
2984
|
-
function
|
|
2993
|
+
function kt(e, t) {
|
|
2985
2994
|
for (var n = [], r = 2; r < arguments.length; r++)
|
|
2986
2995
|
n[r - 2] = arguments[r];
|
|
2987
2996
|
var i = n[0], a = n[1], o = a === void 0 ? {} : a, s = typeof i == "string" ? new Date(i || 0) : i;
|
|
@@ -2992,7 +3001,7 @@ function Vt(e, t) {
|
|
|
2992
3001
|
}
|
|
2993
3002
|
return String(s);
|
|
2994
3003
|
}
|
|
2995
|
-
function
|
|
3004
|
+
function Xt(e, t) {
|
|
2996
3005
|
for (var n = [], r = 2; r < arguments.length; r++)
|
|
2997
3006
|
n[r - 2] = arguments[r];
|
|
2998
3007
|
var i = n[0], a = n[1], o = a === void 0 ? {} : a, s = typeof i == "string" ? new Date(i || 0) : i;
|
|
@@ -3003,10 +3012,10 @@ function kt(e, t) {
|
|
|
3003
3012
|
}
|
|
3004
3013
|
return String(s);
|
|
3005
3014
|
}
|
|
3006
|
-
function
|
|
3015
|
+
function Zt(e, t) {
|
|
3007
3016
|
for (var n = [], r = 2; r < arguments.length; r++)
|
|
3008
3017
|
n[r - 2] = arguments[r];
|
|
3009
|
-
var i = n[0], a = n[1], o = n[2], s = o === void 0 ? {} : o, h = e.timeZone, l = e.locale, u = e.onError, f = C(s,
|
|
3018
|
+
var i = n[0], a = n[1], o = n[2], s = o === void 0 ? {} : o, h = e.timeZone, l = e.locale, u = e.onError, f = C(s, we, h ? { timeZone: h } : {});
|
|
3010
3019
|
try {
|
|
3011
3020
|
return t(l, f).formatRange(i, a);
|
|
3012
3021
|
} catch (c) {
|
|
@@ -3014,7 +3023,7 @@ function Xt(e, t) {
|
|
|
3014
3023
|
}
|
|
3015
3024
|
return String(i);
|
|
3016
3025
|
}
|
|
3017
|
-
function
|
|
3026
|
+
function Wt(e, t) {
|
|
3018
3027
|
for (var n = [], r = 2; r < arguments.length; r++)
|
|
3019
3028
|
n[r - 2] = arguments[r];
|
|
3020
3029
|
var i = n[0], a = n[1], o = a === void 0 ? {} : a, s = typeof i == "string" ? new Date(i || 0) : i;
|
|
@@ -3025,7 +3034,7 @@ function Zt(e, t) {
|
|
|
3025
3034
|
}
|
|
3026
3035
|
return [];
|
|
3027
3036
|
}
|
|
3028
|
-
function
|
|
3037
|
+
function zt(e, t) {
|
|
3029
3038
|
for (var n = [], r = 2; r < arguments.length; r++)
|
|
3030
3039
|
n[r - 2] = arguments[r];
|
|
3031
3040
|
var i = n[0], a = n[1], o = a === void 0 ? {} : a, s = typeof i == "string" ? new Date(i || 0) : i;
|
|
@@ -3036,51 +3045,51 @@ function Wt(e, t) {
|
|
|
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, n, r) {
|
|
3046
3055
|
var i = e.locale, a = e.onError, o = Intl.DisplayNames;
|
|
3047
3056
|
o || a(new P(`Intl.DisplayNames is not available in this environment.
|
|
3048
3057
|
Try polyfilling it using "@formatjs/intl-displaynames"
|
|
3049
3058
|
`, R.MISSING_INTL_API));
|
|
3050
|
-
var s = C(r,
|
|
3059
|
+
var s = C(r, qt);
|
|
3051
3060
|
try {
|
|
3052
3061
|
return t(i, s).of(n);
|
|
3053
3062
|
} catch (h) {
|
|
3054
3063
|
a(new A(S.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
|
|
3073
|
+
function $t(e, t, n, r) {
|
|
3065
3074
|
r === void 0 && (r = {});
|
|
3066
|
-
var i =
|
|
3075
|
+
var i = De(e, t, n, r).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
|
|
3081
|
+
function De(e, t, n, r) {
|
|
3073
3082
|
var i = e.locale, a = e.onError;
|
|
3074
3083
|
r === void 0 && (r = {});
|
|
3075
3084
|
var o = Intl.ListFormat;
|
|
3076
3085
|
o || a(new P(`Intl.ListFormat is not available in this environment.
|
|
3077
3086
|
Try polyfilling it using "@formatjs/intl-listformat"
|
|
3078
3087
|
`, R.MISSING_INTL_API));
|
|
3079
|
-
var s = C(r,
|
|
3088
|
+
var s = C(r, Qt);
|
|
3080
3089
|
try {
|
|
3081
3090
|
var h = {}, l = n.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);
|
|
@@ -3093,13 +3102,13 @@ Try polyfilling it using "@formatjs/intl-listformat"
|
|
|
3093
3102
|
}
|
|
3094
3103
|
return n;
|
|
3095
3104
|
}
|
|
3096
|
-
var
|
|
3097
|
-
function
|
|
3105
|
+
var Kt = ["type"];
|
|
3106
|
+
function er(e, t, n, r) {
|
|
3098
3107
|
var i = e.locale, a = e.onError;
|
|
3099
3108
|
r === void 0 && (r = {}), Intl.PluralRules || a(new P(`Intl.PluralRules is not available in this environment.
|
|
3100
3109
|
Try polyfilling it using "@formatjs/intl-pluralrules"
|
|
3101
3110
|
`, R.MISSING_INTL_API));
|
|
3102
|
-
var o = C(r,
|
|
3111
|
+
var o = C(r, Kt);
|
|
3103
3112
|
try {
|
|
3104
3113
|
return t(i, o).select(n);
|
|
3105
3114
|
} catch (s) {
|
|
@@ -3107,27 +3116,27 @@ Try polyfilling it using "@formatjs/intl-pluralrules"
|
|
|
3107
3116
|
}
|
|
3108
3117
|
return "other";
|
|
3109
3118
|
}
|
|
3110
|
-
var
|
|
3111
|
-
function
|
|
3119
|
+
var tr = ["numeric", "style"];
|
|
3120
|
+
function rr(e, t, n) {
|
|
3112
3121
|
var r = e.locale, i = e.formats, a = e.onError;
|
|
3113
3122
|
n === void 0 && (n = {});
|
|
3114
|
-
var o = n.format, s = !!o && ne(i, "relative", o, a) || {}, h = C(n,
|
|
3123
|
+
var o = n.format, s = !!o && ne(i, "relative", o, a) || {}, h = C(n, tr, s);
|
|
3115
3124
|
return t(r, h);
|
|
3116
3125
|
}
|
|
3117
|
-
function
|
|
3126
|
+
function nr(e, t, n, r, i) {
|
|
3118
3127
|
i === void 0 && (i = {}), r || (r = "second");
|
|
3119
3128
|
var a = Intl.RelativeTimeFormat;
|
|
3120
3129
|
a || e.onError(new P(`Intl.RelativeTimeFormat is not available in this environment.
|
|
3121
3130
|
Try polyfilling it using "@formatjs/intl-relativetimeformat"
|
|
3122
3131
|
`, R.MISSING_INTL_API));
|
|
3123
3132
|
try {
|
|
3124
|
-
return
|
|
3133
|
+
return rr(e, t, i).format(n, r);
|
|
3125
3134
|
} catch (o) {
|
|
3126
3135
|
e.onError(new re("Error formatting relative time.", e.locale, o));
|
|
3127
3136
|
}
|
|
3128
3137
|
return String(n);
|
|
3129
3138
|
}
|
|
3130
|
-
var
|
|
3139
|
+
var ir = [
|
|
3131
3140
|
"style",
|
|
3132
3141
|
"currency",
|
|
3133
3142
|
"currencyDisplay",
|
|
@@ -3149,79 +3158,79 @@ var nr = [
|
|
|
3149
3158
|
"unitDisplay",
|
|
3150
3159
|
"numberingSystem"
|
|
3151
3160
|
];
|
|
3152
|
-
function
|
|
3161
|
+
function Fe(e, t, n) {
|
|
3153
3162
|
var r = e.locale, i = e.formats, a = e.onError;
|
|
3154
3163
|
n === void 0 && (n = {});
|
|
3155
|
-
var o = n.format, s = o && ne(i, "number", o, a) || {}, h = C(n,
|
|
3164
|
+
var o = n.format, s = o && ne(i, "number", o, a) || {}, h = C(n, ir, s);
|
|
3156
3165
|
return t(r, h);
|
|
3157
3166
|
}
|
|
3158
|
-
function
|
|
3167
|
+
function ar(e, t, n, r) {
|
|
3159
3168
|
r === void 0 && (r = {});
|
|
3160
3169
|
try {
|
|
3161
|
-
return
|
|
3170
|
+
return Fe(e, t, r).format(n);
|
|
3162
3171
|
} catch (i) {
|
|
3163
3172
|
e.onError(new A(S.FORMAT_ERROR, "Error formatting number.", i));
|
|
3164
3173
|
}
|
|
3165
3174
|
return String(n);
|
|
3166
3175
|
}
|
|
3167
|
-
function
|
|
3176
|
+
function or(e, t, n, r) {
|
|
3168
3177
|
r === void 0 && (r = {});
|
|
3169
3178
|
try {
|
|
3170
|
-
return
|
|
3179
|
+
return Fe(e, t, r).formatToParts(n);
|
|
3171
3180
|
} catch (i) {
|
|
3172
3181
|
e.onError(new A(S.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 n =
|
|
3187
|
-
return i ? !Intl.NumberFormat.supportedLocalesOf(i).length && o ? o(new me('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 me('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
|
|
3194
|
+
function hr(e, t) {
|
|
3195
|
+
var n = jt(t), r = m(m({}, Ut), e), i = r.locale, a = r.defaultLocale, o = r.onError;
|
|
3196
|
+
return i ? !Intl.NumberFormat.supportedLocalesOf(i).length && o ? o(new me('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 me('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 wt('"locale" was not configured, using "'.concat(a, '" as fallback. See https://formatjs.io/docs/react-intl/api#intlshape for more details'))), r.locale = r.defaultLocale || "en"), ur(r), m(m({}, r), {
|
|
3188
3197
|
formatters: n,
|
|
3189
|
-
formatNumber:
|
|
3190
|
-
formatNumberToParts:
|
|
3191
|
-
formatRelativeTime:
|
|
3192
|
-
formatDate:
|
|
3193
|
-
formatDateToParts:
|
|
3194
|
-
formatTime:
|
|
3195
|
-
formatDateTimeRange:
|
|
3196
|
-
formatTimeToParts:
|
|
3197
|
-
formatPlural:
|
|
3198
|
+
formatNumber: ar.bind(null, r, n.getNumberFormat),
|
|
3199
|
+
formatNumberToParts: or.bind(null, r, n.getNumberFormat),
|
|
3200
|
+
formatRelativeTime: nr.bind(null, r, n.getRelativeTimeFormat),
|
|
3201
|
+
formatDate: kt.bind(null, r, n.getDateTimeFormat),
|
|
3202
|
+
formatDateToParts: Wt.bind(null, r, n.getDateTimeFormat),
|
|
3203
|
+
formatTime: Xt.bind(null, r, n.getDateTimeFormat),
|
|
3204
|
+
formatDateTimeRange: Zt.bind(null, r, n.getDateTimeFormat),
|
|
3205
|
+
formatTimeToParts: zt.bind(null, r, n.getDateTimeFormat),
|
|
3206
|
+
formatPlural: er.bind(null, r, n.getPluralRules),
|
|
3198
3207
|
// @ts-expect-error TODO: will get to this later
|
|
3199
3208
|
formatMessage: ve.bind(null, r, n),
|
|
3200
3209
|
// @ts-expect-error TODO: will get to this later
|
|
3201
3210
|
$t: ve.bind(null, r, n),
|
|
3202
|
-
formatList:
|
|
3203
|
-
formatListToParts:
|
|
3204
|
-
formatDisplayName:
|
|
3211
|
+
formatList: $t.bind(null, r, n.getListFormat),
|
|
3212
|
+
formatListToParts: De.bind(null, r, n.getListFormat),
|
|
3213
|
+
formatDisplayName: Jt.bind(null, r, n.getDisplayNames)
|
|
3205
3214
|
});
|
|
3206
3215
|
}
|
|
3207
|
-
var
|
|
3208
|
-
|
|
3209
|
-
|
|
3216
|
+
var lr = F;
|
|
3217
|
+
F.flatten = F;
|
|
3218
|
+
F.unflatten = je;
|
|
3210
3219
|
function Ge(e) {
|
|
3211
3220
|
return e && e.constructor && typeof e.constructor.isBuffer == "function" && e.constructor.isBuffer(e);
|
|
3212
3221
|
}
|
|
3213
3222
|
function Ue(e) {
|
|
3214
3223
|
return e;
|
|
3215
3224
|
}
|
|
3216
|
-
function
|
|
3225
|
+
function F(e, t) {
|
|
3217
3226
|
t = t || {};
|
|
3218
3227
|
const n = t.delimiter || ".", r = t.maxDepth, i = t.transformKey || Ue, 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), p = Object.prototype.toString.call(f),
|
|
3222
|
-
if (!c && !
|
|
3223
|
-
return o(f,
|
|
3224
|
-
a[
|
|
3230
|
+
const f = s[u], c = t.safe && Array.isArray(f), p = Object.prototype.toString.call(f), b = Ge(f), E = p === "[object Object]" || p === "[object Array]", y = h ? h + n + i(u) : i(u);
|
|
3231
|
+
if (!c && !b && E && Object.keys(f).length && (!t.maxDepth || l < r))
|
|
3232
|
+
return o(f, y, l + 1);
|
|
3233
|
+
a[y] = f;
|
|
3225
3234
|
});
|
|
3226
3235
|
}
|
|
3227
3236
|
return o(e), a;
|
|
@@ -3236,8 +3245,8 @@ function je(e, t) {
|
|
|
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(p,
|
|
3240
|
-
return p[u + n +
|
|
3248
|
+
return Object.keys(c).reduce(function(p, b) {
|
|
3249
|
+
return p[u + n + b] = c[b], p;
|
|
3241
3250
|
}, f);
|
|
3242
3251
|
}
|
|
3243
3252
|
function l(u) {
|
|
@@ -3255,34 +3264,34 @@ 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
|
+
F(e[f], t)
|
|
3259
3268
|
);
|
|
3260
3269
|
}, {}), Object.keys(e).forEach(function(u) {
|
|
3261
3270
|
const f = u.split(n).map(i);
|
|
3262
|
-
let c = s(f.shift()), p = s(f[0]),
|
|
3271
|
+
let c = s(f.shift()), p = s(f[0]), b = a;
|
|
3263
3272
|
for (; p !== void 0; ) {
|
|
3264
3273
|
if (c === "__proto__")
|
|
3265
3274
|
return;
|
|
3266
|
-
const
|
|
3267
|
-
if (!r && !
|
|
3275
|
+
const E = Object.prototype.toString.call(b[c]), y = E === "[object Object]" || E === "[object Array]";
|
|
3276
|
+
if (!r && !y && typeof b[c] < "u")
|
|
3268
3277
|
return;
|
|
3269
|
-
(r && !
|
|
3278
|
+
(r && !y || !r && b[c] == null) && (b[c] = typeof p == "number" && !t.object ? [] : {}), b = b[c], f.length > 0 && (c = s(f.shift()), p = s(f[0]));
|
|
3270
3279
|
}
|
|
3271
|
-
|
|
3280
|
+
b[c] = je(e[u], t);
|
|
3272
3281
|
}), a;
|
|
3273
3282
|
}
|
|
3274
|
-
const
|
|
3283
|
+
const fr = Ce();
|
|
3275
3284
|
let Ve;
|
|
3276
|
-
const
|
|
3277
|
-
const r =
|
|
3285
|
+
const gr = (e, t, n = !1) => {
|
|
3286
|
+
const r = 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
3296
|
t: (h, l, u) => r.formatMessage({ id: h }, l, u),
|
|
3288
3297
|
te: (h) => !!r.messages[h],
|
|
@@ -3292,10 +3301,10 @@ const mr = (e, t, n = !1) => {
|
|
|
3292
3301
|
};
|
|
3293
3302
|
return n && (Ve = s), s;
|
|
3294
3303
|
};
|
|
3295
|
-
function
|
|
3304
|
+
function pr() {
|
|
3296
3305
|
return Ve;
|
|
3297
3306
|
}
|
|
3298
|
-
const
|
|
3307
|
+
const cr = (e) => ke({
|
|
3299
3308
|
name: "I18nT",
|
|
3300
3309
|
props: {
|
|
3301
3310
|
keypath: {
|
|
@@ -3325,15 +3334,15 @@ const fr = (e) => ke({
|
|
|
3325
3334
|
}), Xe(t.tag, t, o);
|
|
3326
3335
|
};
|
|
3327
3336
|
}
|
|
3328
|
-
}),
|
|
3337
|
+
}), vr = {
|
|
3329
3338
|
install(e, t) {
|
|
3330
3339
|
const { i18n: n } = t;
|
|
3331
|
-
e.component("I18nT",
|
|
3340
|
+
e.component("I18nT", cr(n));
|
|
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
|