@intlify/core 12.0.0-alpha.11 → 12.0.0-alpha.12
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/core.esm-browser.js +12 -5
- package/dist/core.esm-browser.prod.js +28 -22
- package/dist/core.global.js +12 -5
- package/dist/core.global.prod.js +341 -335
- package/dist/core.js +1 -1
- package/dist/core.node.js +1 -1
- package/dist/core.runtime.esm-browser.js +12 -5
- package/dist/core.runtime.esm-browser.prod.js +28 -22
- package/dist/core.runtime.global.js +12 -5
- package/dist/core.runtime.global.prod.js +240 -234
- package/dist/core.runtime.js +1 -1
- package/dist/core.runtime.node.js +1 -1
- package/package.json +3 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @intlify/core v12.0.0-alpha.
|
|
2
|
+
* @intlify/core v12.0.0-alpha.12
|
|
3
3
|
* (c) 2016-present kazuya kawaguchi and contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/ var IntlifyCore = (function(e) {
|
|
@@ -23,31 +23,31 @@
|
|
|
23
23
|
function h(e) {
|
|
24
24
|
return p(Object.prototype, e);
|
|
25
25
|
}
|
|
26
|
-
let g = Array.isArray, _ = (e) => typeof e == `function`, v = (e) => typeof e == `string`, y = (e) => typeof e == `boolean`, b = (e) => typeof e == `object` && !!e, x = (e) => b(e) && _(e.then) && _(e.catch), S = Object.prototype.toString, C = (e) => S.call(e), w = (e) => C(e) === `[object Object]`,
|
|
27
|
-
function
|
|
26
|
+
let g = Array.isArray, _ = (e) => typeof e == `function`, v = (e) => typeof e == `string`, y = (e) => typeof e == `boolean`, b = (e) => typeof e == `object` && !!e, x = (e) => b(e) && _(e.then) && _(e.catch), S = Object.prototype.toString, C = (e) => S.call(e), w = (e) => C(e) === `[object Object]`, T = (e) => e == null ? `` : g(e) || w(e) && e.toString === S ? JSON.stringify(e, null, 2) : String(e);
|
|
27
|
+
function ee(e, t = ``) {
|
|
28
28
|
return e.reduce((e, n, r) => r === 0 ? e + n : e + t + n, ``);
|
|
29
29
|
}
|
|
30
|
-
function
|
|
30
|
+
function te(e, t) {
|
|
31
31
|
typeof console < `u` && (console.warn(`[intlify] ` + e), t && console.warn(t.stack));
|
|
32
32
|
}
|
|
33
|
-
function
|
|
33
|
+
function E(e) {
|
|
34
34
|
return e.replace(/&/g, `&`).replace(/</g, `<`).replace(/>/g, `>`).replace(/"/g, `"`).replace(/'/g, `'`).replace(/\//g, `/`).replace(/=/g, `=`);
|
|
35
35
|
}
|
|
36
|
-
function
|
|
36
|
+
function ne(e) {
|
|
37
37
|
return e.replace(/&(?![a-z0-9#]{2,6};)/gi, `&`).replace(/"/g, `"`).replace(/'/g, `'`).replace(/</g, `<`).replace(/>/g, `>`);
|
|
38
38
|
}
|
|
39
|
-
let
|
|
40
|
-
function
|
|
39
|
+
let re = /^javascript:/i, ie = /^(?:href|xlink:href|src|action|formaction)$/i, D = /&#(?:x([0-9a-f]+)|(\d+));?/gi, ae = /&(?:Tab|NewLine);/g, oe = /:?/gi, se = /[\u0000-\u0020\u007f-\u009f]/g, ce = /^on\w/i, le = /^srcdoc$/i, ue = /^(?:base|animate|set|script|plaintext)$/i, de = /^(?:iframe|noembed|noframes|noscript|style|textarea|title|xmp)$/i, O = /<(\/?)([a-z][^\t\n\f\r />]*)/iy, k = /([\t\n\f\r /]*)(?:(>)|([^\t\n\f\r />][^\t\n\f\r />=]*)(?:[\t\n\f\r ]*=[\t\n\f\r ]*(?:(["'])([\s\S]*?)(\4|$)|([^\t\n\f\r >]*)))?)/y, A = /<!--(?:>|->|[\s\S]*?--!?>)/y;
|
|
40
|
+
function fe(e, t, n) {
|
|
41
41
|
let r = t || n;
|
|
42
42
|
if (!r) return e;
|
|
43
43
|
let i = Number.parseInt(r, t ? 16 : 10);
|
|
44
44
|
return i <= 127 ? String.fromCharCode(i) : e;
|
|
45
45
|
}
|
|
46
|
-
function
|
|
47
|
-
let t = e.replace(
|
|
48
|
-
return
|
|
46
|
+
function pe(e) {
|
|
47
|
+
let t = e.replace(D, fe).replace(ae, ``).replace(oe, `:`).replace(se, ``);
|
|
48
|
+
return re.test(t);
|
|
49
49
|
}
|
|
50
|
-
function
|
|
50
|
+
function me(e) {
|
|
51
51
|
let t = /url\s*\(/gi, n = ``, r = 0, i;
|
|
52
52
|
for (; (i = t.exec(e)) !== null;) {
|
|
53
53
|
let a = i.index, o = t.lastIndex - 1, s = o + 1, c = 1, l = null;
|
|
@@ -60,31 +60,31 @@
|
|
|
60
60
|
}
|
|
61
61
|
if (c !== 0) break;
|
|
62
62
|
let u = e.slice(o + 1, s).trim(), d = u.startsWith(`"`) && u.endsWith(`"`) || u.startsWith(`'`) && u.endsWith(`'`) ? u.slice(1, -1).trim() : u;
|
|
63
|
-
n += e.slice(r, a), n +=
|
|
63
|
+
n += e.slice(r, a), n += pe(d) ? `url(about:blank)` : e.slice(a, s + 1), r = s + 1;
|
|
64
64
|
}
|
|
65
65
|
return n + e.slice(r);
|
|
66
66
|
}
|
|
67
|
-
function
|
|
68
|
-
return
|
|
67
|
+
function he(e, t) {
|
|
68
|
+
return ie.test(e) && pe(t) ? `about:blank` : ne(e.toLowerCase() === `style` ? me(t) : t);
|
|
69
69
|
}
|
|
70
|
-
function
|
|
70
|
+
function j(e) {
|
|
71
71
|
return e.replace(/</g, `<`);
|
|
72
72
|
}
|
|
73
|
-
function
|
|
73
|
+
function ge(e, t, n, r) {
|
|
74
74
|
let i = e;
|
|
75
|
-
if (
|
|
75
|
+
if (ce.test(e) ? (r.eventHandler = !0, i = `on${e.slice(2)}`) : le.test(e) && (r.srcdoc = !0, i = `s${e.slice(1)}`), t === void 0) return i;
|
|
76
76
|
let a = n || ``;
|
|
77
|
-
return `${i}=${a}${
|
|
77
|
+
return `${i}=${a}${he(e, t)}${a}`;
|
|
78
78
|
}
|
|
79
|
-
function
|
|
80
|
-
|
|
81
|
-
let r =
|
|
79
|
+
function _e(e, t, n) {
|
|
80
|
+
O.lastIndex = t;
|
|
81
|
+
let r = O.exec(e);
|
|
82
82
|
if (!r) return;
|
|
83
83
|
let [, i, a] = r, o = r[0], s;
|
|
84
|
-
for (
|
|
84
|
+
for (k.lastIndex = O.lastIndex; s = k.exec(e);) {
|
|
85
85
|
let [r, c, l, u, d, f, p, m] = s;
|
|
86
86
|
if (l) {
|
|
87
|
-
let n =
|
|
87
|
+
let n = k.lastIndex;
|
|
88
88
|
return [
|
|
89
89
|
i ? e.slice(t, n) : o + r,
|
|
90
90
|
a,
|
|
@@ -92,7 +92,7 @@
|
|
|
92
92
|
];
|
|
93
93
|
}
|
|
94
94
|
if (d && !p) break;
|
|
95
|
-
i || (o += c +
|
|
95
|
+
i || (o += c + ge(u, d ? f : m, d, n));
|
|
96
96
|
}
|
|
97
97
|
return [
|
|
98
98
|
o,
|
|
@@ -100,37 +100,37 @@
|
|
|
100
100
|
-1
|
|
101
101
|
];
|
|
102
102
|
}
|
|
103
|
-
function
|
|
103
|
+
function ve(e, t, n) {
|
|
104
104
|
for (let r = e.indexOf(`</`, t); r !== -1; r = e.indexOf(`</`, r + 2)) {
|
|
105
|
-
let t =
|
|
105
|
+
let t = _e(e, r, {});
|
|
106
106
|
if (t && t[1].toLowerCase() === n.toLowerCase()) return t[2] === -1 ? -1 : r;
|
|
107
107
|
}
|
|
108
108
|
return -1;
|
|
109
109
|
}
|
|
110
|
-
function
|
|
110
|
+
function ye(e) {
|
|
111
111
|
let t = {}, n = ``, r = 0, i;
|
|
112
112
|
for (; (i = e.indexOf(`<`, r)) !== -1;) {
|
|
113
113
|
n += e.slice(r, i), r = i + 1;
|
|
114
|
-
let a =
|
|
114
|
+
let a = _e(e, i, t);
|
|
115
115
|
if (a) {
|
|
116
116
|
let [o, s, c] = a;
|
|
117
117
|
if (c === -1) {
|
|
118
|
-
t.unclosed = !0, n +=
|
|
118
|
+
t.unclosed = !0, n += j(e.slice(i)), r = e.length;
|
|
119
119
|
break;
|
|
120
120
|
}
|
|
121
121
|
if (r = c, o[1] === `/`) n += o;
|
|
122
|
-
else if (
|
|
123
|
-
else if (
|
|
124
|
-
let i =
|
|
125
|
-
i === -1 ? (t.unclosed = !0, n +=
|
|
122
|
+
else if (ue.test(s)) t.element = !0, n += j(o);
|
|
123
|
+
else if (de.test(s)) {
|
|
124
|
+
let i = ve(e, c, s);
|
|
125
|
+
i === -1 ? (t.unclosed = !0, n += j(o)) : (n += o + j(e.slice(c, i)), r = i);
|
|
126
126
|
} else n += o;
|
|
127
|
-
} else
|
|
127
|
+
} else A.lastIndex = i, A.test(e) ? (n += e.slice(i, A.lastIndex), r = A.lastIndex) : (e.startsWith(`<!--`, i) && (t.unclosed = !0), n += `<`);
|
|
128
128
|
}
|
|
129
129
|
return n += e.slice(r), n;
|
|
130
130
|
}
|
|
131
|
-
let
|
|
132
|
-
function
|
|
133
|
-
if (
|
|
131
|
+
let be = (e) => !b(e) || g(e);
|
|
132
|
+
function xe(e, t) {
|
|
133
|
+
if (be(e) || be(t) || t === Object.prototype) throw Error(`Invalid value`);
|
|
134
134
|
let n = [e, t];
|
|
135
135
|
for (; n.length;) {
|
|
136
136
|
let e = n.pop(), t = n.pop(), r = Object.keys(t);
|
|
@@ -152,7 +152,7 @@
|
|
|
152
152
|
}
|
|
153
153
|
}
|
|
154
154
|
}
|
|
155
|
-
let
|
|
155
|
+
let M = {
|
|
156
156
|
EXPECTED_TOKEN: 1,
|
|
157
157
|
INVALID_TOKEN_IN_PLACEHOLDER: 2,
|
|
158
158
|
UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER: 3,
|
|
@@ -170,128 +170,128 @@
|
|
|
170
170
|
UNHANDLED_CODEGEN_NODE_TYPE: 15,
|
|
171
171
|
UNHANDLED_MINIFIER_NODE_TYPE: 16
|
|
172
172
|
};
|
|
173
|
-
|
|
174
|
-
function
|
|
173
|
+
M.EXPECTED_TOKEN, M.INVALID_TOKEN_IN_PLACEHOLDER, M.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER, M.UNKNOWN_ESCAPE_SEQUENCE, M.INVALID_UNICODE_ESCAPE_SEQUENCE, M.UNBALANCED_CLOSING_BRACE, M.UNTERMINATED_CLOSING_BRACE, M.EMPTY_PLACEHOLDER, M.NOT_ALLOW_NEST_PLACEHOLDER, M.INVALID_LINKED_FORMAT, M.MUST_HAVE_MESSAGES_IN_PLURAL, M.UNEXPECTED_EMPTY_LINKED_MODIFIER, M.UNEXPECTED_EMPTY_LINKED_KEY, M.UNEXPECTED_LEXICAL_ANALYSIS, M.UNHANDLED_CODEGEN_NODE_TYPE, M.UNHANDLED_MINIFIER_NODE_TYPE;
|
|
174
|
+
function Se(e, t, n = {}) {
|
|
175
175
|
let { domain: r, messages: i, args: a } = n, o = SyntaxError(String(e));
|
|
176
176
|
return o.code = e, t && (o.location = t), o.domain = r, o;
|
|
177
177
|
}
|
|
178
|
-
function
|
|
179
|
-
return b(e) &&
|
|
178
|
+
function N(e) {
|
|
179
|
+
return b(e) && P(e) === 0 && (p(e, `b`) || p(e, `body`));
|
|
180
180
|
}
|
|
181
|
-
let
|
|
182
|
-
function
|
|
183
|
-
return
|
|
181
|
+
let Ce = [`b`, `body`];
|
|
182
|
+
function we(e) {
|
|
183
|
+
return I(e, Ce);
|
|
184
184
|
}
|
|
185
|
-
let
|
|
186
|
-
function
|
|
187
|
-
return
|
|
185
|
+
let Te = [`c`, `cases`];
|
|
186
|
+
function Ee(e) {
|
|
187
|
+
return I(e, Te, []);
|
|
188
188
|
}
|
|
189
|
-
let
|
|
190
|
-
function
|
|
191
|
-
return
|
|
189
|
+
let De = [`s`, `static`];
|
|
190
|
+
function Oe(e) {
|
|
191
|
+
return I(e, De);
|
|
192
192
|
}
|
|
193
|
-
let
|
|
194
|
-
function
|
|
195
|
-
return
|
|
193
|
+
let ke = [`i`, `items`];
|
|
194
|
+
function Ae(e) {
|
|
195
|
+
return I(e, ke, []);
|
|
196
196
|
}
|
|
197
|
-
let
|
|
198
|
-
function
|
|
199
|
-
return
|
|
197
|
+
let je = [`t`, `type`];
|
|
198
|
+
function P(e) {
|
|
199
|
+
return I(e, je);
|
|
200
200
|
}
|
|
201
|
-
let
|
|
202
|
-
function
|
|
203
|
-
let n =
|
|
201
|
+
let Me = [`v`, `value`];
|
|
202
|
+
function F(e, t) {
|
|
203
|
+
let n = I(e, Me);
|
|
204
204
|
if (n != null) return n;
|
|
205
|
-
throw
|
|
205
|
+
throw L(t);
|
|
206
206
|
}
|
|
207
|
-
let
|
|
208
|
-
function
|
|
209
|
-
return
|
|
207
|
+
let Ne = [`m`, `modifier`];
|
|
208
|
+
function Pe(e) {
|
|
209
|
+
return I(e, Ne);
|
|
210
210
|
}
|
|
211
|
-
let
|
|
212
|
-
function
|
|
213
|
-
let t =
|
|
211
|
+
let Fe = [`k`, `key`];
|
|
212
|
+
function Ie(e) {
|
|
213
|
+
let t = I(e, Fe);
|
|
214
214
|
if (t) return t;
|
|
215
|
-
throw
|
|
215
|
+
throw L(6);
|
|
216
216
|
}
|
|
217
|
-
function
|
|
217
|
+
function I(e, t, n) {
|
|
218
218
|
for (let n = 0; n < t.length; n++) {
|
|
219
219
|
let r = t[n];
|
|
220
220
|
if (p(e, r) && e[r] != null) return e[r];
|
|
221
221
|
}
|
|
222
222
|
return n;
|
|
223
223
|
}
|
|
224
|
-
let
|
|
225
|
-
...
|
|
226
|
-
...
|
|
227
|
-
...
|
|
228
|
-
...
|
|
229
|
-
...
|
|
230
|
-
...Pe,
|
|
224
|
+
let Le = [
|
|
225
|
+
...Ce,
|
|
226
|
+
...Te,
|
|
227
|
+
...De,
|
|
228
|
+
...ke,
|
|
229
|
+
...Fe,
|
|
231
230
|
...Ne,
|
|
232
|
-
...Me
|
|
231
|
+
...Me,
|
|
232
|
+
...je
|
|
233
233
|
];
|
|
234
|
-
function
|
|
234
|
+
function L(e) {
|
|
235
235
|
return Error(`unhandled node type: ${e}`);
|
|
236
236
|
}
|
|
237
|
-
function
|
|
238
|
-
return (t) =>
|
|
237
|
+
function Re(e) {
|
|
238
|
+
return (t) => ze(t, e);
|
|
239
239
|
}
|
|
240
|
-
function
|
|
241
|
-
let n =
|
|
242
|
-
if (n == null) throw
|
|
243
|
-
if (
|
|
244
|
-
let t =
|
|
245
|
-
return e.plural(t.reduce((t, n) => [...g(t) ? t : [t],
|
|
240
|
+
function ze(e, t) {
|
|
241
|
+
let n = we(t);
|
|
242
|
+
if (n == null) throw L(0);
|
|
243
|
+
if (P(n) === 1) {
|
|
244
|
+
let t = Ee(n);
|
|
245
|
+
return e.plural(t.reduce((t, n) => [...g(t) ? t : [t], Be(e, n)], []));
|
|
246
246
|
}
|
|
247
|
-
return
|
|
247
|
+
return Be(e, n);
|
|
248
248
|
}
|
|
249
|
-
function
|
|
250
|
-
let n =
|
|
249
|
+
function Be(e, t) {
|
|
250
|
+
let n = Oe(t);
|
|
251
251
|
if (n != null) return e.type === `text` ? n : e.normalize([n]);
|
|
252
252
|
{
|
|
253
|
-
let n =
|
|
253
|
+
let n = Ae(t).reduce((t, n) => [...t, R(e, n)], []);
|
|
254
254
|
return e.normalize(n);
|
|
255
255
|
}
|
|
256
256
|
}
|
|
257
|
-
function
|
|
258
|
-
let n =
|
|
257
|
+
function R(e, t) {
|
|
258
|
+
let n = P(t);
|
|
259
259
|
switch (n) {
|
|
260
|
-
case 3: return
|
|
261
|
-
case 9: return
|
|
260
|
+
case 3: return F(t, n);
|
|
261
|
+
case 9: return F(t, n);
|
|
262
262
|
case 4: {
|
|
263
263
|
let r = t;
|
|
264
264
|
if (p(r, `k`) && r.k) return e.interpolate(e.named(r.k));
|
|
265
265
|
if (p(r, `key`) && r.key) return e.interpolate(e.named(r.key));
|
|
266
|
-
throw
|
|
266
|
+
throw L(n);
|
|
267
267
|
}
|
|
268
268
|
case 5: {
|
|
269
269
|
let r = t;
|
|
270
270
|
if (p(r, `i`) && a(r.i)) return e.interpolate(e.list(r.i));
|
|
271
271
|
if (p(r, `index`) && a(r.index)) return e.interpolate(e.list(r.index));
|
|
272
|
-
throw
|
|
272
|
+
throw L(n);
|
|
273
273
|
}
|
|
274
274
|
case 6: {
|
|
275
|
-
let n = t, r =
|
|
276
|
-
return e.linked(
|
|
275
|
+
let n = t, r = Pe(n), i = Ie(n);
|
|
276
|
+
return e.linked(R(e, i), r ? R(e, r) : void 0, e.type);
|
|
277
277
|
}
|
|
278
|
-
case 7: return
|
|
279
|
-
case 8: return
|
|
278
|
+
case 7: return F(t, n);
|
|
279
|
+
case 8: return F(t, n);
|
|
280
280
|
default: throw Error(`unhandled node on format message part: ${n}`);
|
|
281
281
|
}
|
|
282
282
|
}
|
|
283
|
-
let
|
|
284
|
-
function
|
|
285
|
-
|
|
283
|
+
let z = d();
|
|
284
|
+
function Ve() {
|
|
285
|
+
z = d();
|
|
286
286
|
}
|
|
287
|
-
function
|
|
287
|
+
function He(e, t) {
|
|
288
288
|
{
|
|
289
|
-
if (!
|
|
289
|
+
if (!N(e)) return (() => e);
|
|
290
290
|
let t = e.cacheKey;
|
|
291
|
-
return t ?
|
|
291
|
+
return t ? z[t] || (z[t] = Re(e)) : Re(e);
|
|
292
292
|
}
|
|
293
293
|
}
|
|
294
|
-
let
|
|
294
|
+
let B = {
|
|
295
295
|
INVALID_ARGUMENT: 17,
|
|
296
296
|
INVALID_DATE_ARGUMENT: 18,
|
|
297
297
|
INVALID_ISO_DATE_ARGUMENT: 19,
|
|
@@ -299,56 +299,56 @@
|
|
|
299
299
|
NOT_SUPPORT_LOCALE_ASYNC_FUNCTION: 21,
|
|
300
300
|
NOT_SUPPORT_LOCALE_TYPE: 22
|
|
301
301
|
};
|
|
302
|
-
function
|
|
303
|
-
return
|
|
302
|
+
function V(e) {
|
|
303
|
+
return Se(e, null, void 0);
|
|
304
304
|
}
|
|
305
|
-
|
|
306
|
-
function
|
|
307
|
-
return t.locale == null ?
|
|
305
|
+
B.INVALID_ARGUMENT, B.INVALID_DATE_ARGUMENT, B.INVALID_ISO_DATE_ARGUMENT, B.NOT_SUPPORT_LOCALE_PROMISE_VALUE, B.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION, B.NOT_SUPPORT_LOCALE_TYPE;
|
|
306
|
+
function H(e, t) {
|
|
307
|
+
return t.locale == null ? W(e.locale) : W(t.locale);
|
|
308
308
|
}
|
|
309
|
-
let
|
|
310
|
-
function
|
|
309
|
+
let U;
|
|
310
|
+
function W(e) {
|
|
311
311
|
if (v(e)) return e;
|
|
312
312
|
if (_(e)) {
|
|
313
|
-
if (e.resolvedOnce &&
|
|
313
|
+
if (e.resolvedOnce && U != null) return U;
|
|
314
314
|
if (e.constructor.name === `Function`) {
|
|
315
315
|
let t = e();
|
|
316
|
-
if (x(t)) throw B
|
|
317
|
-
return
|
|
316
|
+
if (x(t)) throw V(B.NOT_SUPPORT_LOCALE_PROMISE_VALUE);
|
|
317
|
+
return U = t;
|
|
318
318
|
}
|
|
319
|
-
throw B
|
|
319
|
+
throw V(B.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION);
|
|
320
320
|
}
|
|
321
|
-
throw B
|
|
321
|
+
throw V(B.NOT_SUPPORT_LOCALE_TYPE);
|
|
322
322
|
}
|
|
323
|
-
function
|
|
323
|
+
function Ue(e, t, n) {
|
|
324
324
|
return [.../* @__PURE__ */ new Set([n, ...g(t) ? t : b(t) ? Object.keys(t).filter((e) => e !== "default") : v(t) ? [t] : [n]])];
|
|
325
325
|
}
|
|
326
|
-
function
|
|
327
|
-
let r = v(n) ? n :
|
|
326
|
+
function We(e, t, n) {
|
|
327
|
+
let r = v(n) ? n : q, i = e, a;
|
|
328
328
|
b(t) ? (i.__localeChainObjectCache || (i.__localeChainObjectCache = /* @__PURE__ */ new WeakMap()), a = i.__localeChainObjectCache.get(t), a || (a = /* @__PURE__ */ new Map(), i.__localeChainObjectCache.set(t, a))) : (i.__localeChainCache || (i.__localeChainCache = /* @__PURE__ */ new Map()), a = i.__localeChainCache.get(t), a || (a = /* @__PURE__ */ new Map(), i.__localeChainCache.set(t, a)));
|
|
329
329
|
let o = a.get(r);
|
|
330
330
|
if (o) return o;
|
|
331
331
|
let s = [], c = [n];
|
|
332
|
-
for (; g(c);) c =
|
|
332
|
+
for (; g(c);) c = Ge(s, c, t);
|
|
333
333
|
let l = g(t) || !w(t) ? t : t.default ? t.default : null;
|
|
334
|
-
return c = v(l) ? [l] : l, g(c) &&
|
|
334
|
+
return c = v(l) ? [l] : l, g(c) && Ge(s, c, !1), a.set(r, s), s;
|
|
335
335
|
}
|
|
336
|
-
function
|
|
336
|
+
function Ge(e, t, n) {
|
|
337
337
|
let r = !0;
|
|
338
338
|
for (let i = 0; i < t.length && y(r); i++) {
|
|
339
339
|
let a = t[i];
|
|
340
|
-
v(a) && (r =
|
|
340
|
+
v(a) && (r = Ke(e, t[i], n));
|
|
341
341
|
}
|
|
342
342
|
return r;
|
|
343
343
|
}
|
|
344
|
-
function
|
|
344
|
+
function Ke(e, t, n) {
|
|
345
345
|
let r, i = t.split(`-`);
|
|
346
346
|
do
|
|
347
|
-
r =
|
|
347
|
+
r = qe(e, i.join(`-`), n), i.splice(-1, 1);
|
|
348
348
|
while (i.length && r === !0);
|
|
349
349
|
return r;
|
|
350
350
|
}
|
|
351
|
-
function
|
|
351
|
+
function qe(e, t, n) {
|
|
352
352
|
let r = !1;
|
|
353
353
|
if (!e.includes(t) && (r = !0, t)) {
|
|
354
354
|
r = t[t.length - 1] !== `!`;
|
|
@@ -357,53 +357,53 @@
|
|
|
357
357
|
}
|
|
358
358
|
return r;
|
|
359
359
|
}
|
|
360
|
-
let
|
|
361
|
-
|
|
360
|
+
let G = [];
|
|
361
|
+
G[0] = {
|
|
362
362
|
w: [0],
|
|
363
363
|
i: [3, 0],
|
|
364
364
|
"[": [4],
|
|
365
365
|
o: [7]
|
|
366
|
-
},
|
|
366
|
+
}, G[1] = {
|
|
367
367
|
w: [1],
|
|
368
368
|
".": [2],
|
|
369
369
|
"[": [4],
|
|
370
370
|
o: [7]
|
|
371
|
-
},
|
|
371
|
+
}, G[2] = {
|
|
372
372
|
w: [2],
|
|
373
373
|
i: [3, 0],
|
|
374
374
|
0: [3, 0]
|
|
375
|
-
},
|
|
375
|
+
}, G[3] = {
|
|
376
376
|
i: [3, 0],
|
|
377
377
|
0: [3, 0],
|
|
378
378
|
w: [1, 1],
|
|
379
379
|
".": [2, 1],
|
|
380
380
|
"[": [4, 1],
|
|
381
381
|
o: [7, 1]
|
|
382
|
-
},
|
|
382
|
+
}, G[4] = {
|
|
383
383
|
"'": [5, 0],
|
|
384
384
|
"\"": [6, 0],
|
|
385
385
|
"[": [4, 2],
|
|
386
386
|
"]": [1, 3],
|
|
387
387
|
o: 8,
|
|
388
388
|
l: [4, 0]
|
|
389
|
-
},
|
|
389
|
+
}, G[5] = {
|
|
390
390
|
"'": [4, 0],
|
|
391
391
|
o: 8,
|
|
392
392
|
l: [5, 0]
|
|
393
|
-
},
|
|
393
|
+
}, G[6] = {
|
|
394
394
|
"\"": [4, 0],
|
|
395
395
|
o: 8,
|
|
396
396
|
l: [6, 0]
|
|
397
397
|
};
|
|
398
|
-
let
|
|
399
|
-
function
|
|
400
|
-
return
|
|
398
|
+
let Je = /^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;
|
|
399
|
+
function Ye(e) {
|
|
400
|
+
return Je.test(e);
|
|
401
401
|
}
|
|
402
|
-
function
|
|
402
|
+
function Xe(e) {
|
|
403
403
|
let t = e.charCodeAt(0);
|
|
404
404
|
return t === e.charCodeAt(e.length - 1) && (t === 34 || t === 39) ? e.slice(1, -1) : e;
|
|
405
405
|
}
|
|
406
|
-
function
|
|
406
|
+
function Ze(e) {
|
|
407
407
|
if (e == null) return `o`;
|
|
408
408
|
switch (e.charCodeAt(0)) {
|
|
409
409
|
case 91:
|
|
@@ -424,11 +424,11 @@
|
|
|
424
424
|
}
|
|
425
425
|
return `i`;
|
|
426
426
|
}
|
|
427
|
-
function
|
|
427
|
+
function Qe(e) {
|
|
428
428
|
let t = e.trim();
|
|
429
|
-
return e.charAt(0) === `0` && isNaN(parseInt(e)) ? !1 :
|
|
429
|
+
return e.charAt(0) === `0` && isNaN(parseInt(e)) ? !1 : Ye(t) ? Xe(t) : `*` + t;
|
|
430
430
|
}
|
|
431
|
-
function
|
|
431
|
+
function $e(e) {
|
|
432
432
|
let t = [], n = -1, r = 0, i = 0, a, o, s, c, l, u, d, f = [];
|
|
433
433
|
f[0] = () => {
|
|
434
434
|
o === void 0 ? o = s : o += s;
|
|
@@ -439,7 +439,7 @@
|
|
|
439
439
|
}, f[3] = () => {
|
|
440
440
|
if (i > 0) i--, r = 4, f[0]();
|
|
441
441
|
else {
|
|
442
|
-
if (i = 0, o === void 0 || (o =
|
|
442
|
+
if (i = 0, o === void 0 || (o = Qe(o), o === !1)) return !1;
|
|
443
443
|
f[1]();
|
|
444
444
|
}
|
|
445
445
|
};
|
|
@@ -448,29 +448,29 @@
|
|
|
448
448
|
if (r === 5 && t === `'` || r === 6 && t === `"`) return n++, s = `\\` + t, f[0](), !0;
|
|
449
449
|
}
|
|
450
450
|
for (; r !== null;) if (n++, a = e[n], !(a === `\\` && p())) {
|
|
451
|
-
if (c =
|
|
451
|
+
if (c = Ze(a), d = G[r], l = d[c] || d.l || 8, l === 8 || (r = l[0], l[1] !== void 0 && (u = f[l[1]], u && (s = a, u() === !1)))) return;
|
|
452
452
|
if (r === 7) return t;
|
|
453
453
|
}
|
|
454
454
|
}
|
|
455
|
-
let
|
|
456
|
-
function
|
|
455
|
+
let et = /* @__PURE__ */ new Map();
|
|
456
|
+
function tt(e, t) {
|
|
457
457
|
return b(e) ? m(e, t) : null;
|
|
458
458
|
}
|
|
459
|
-
function
|
|
459
|
+
function nt(e, t) {
|
|
460
460
|
if (!b(e)) return null;
|
|
461
|
-
let n =
|
|
462
|
-
if (n || (n =
|
|
461
|
+
let n = et.get(t);
|
|
462
|
+
if (n || (n = $e(t), n && et.set(t, n)), !n) return null;
|
|
463
463
|
let r = n.length, i = e, a = 0;
|
|
464
464
|
for (; a < r;) {
|
|
465
465
|
let e = n[a];
|
|
466
|
-
if (
|
|
466
|
+
if (Le.includes(e) && N(i) || !b(i) || !p(i, e)) return null;
|
|
467
467
|
let t = i[e];
|
|
468
468
|
if (t === void 0 || _(i)) return null;
|
|
469
469
|
i = t, a++;
|
|
470
470
|
}
|
|
471
471
|
return i;
|
|
472
472
|
}
|
|
473
|
-
let
|
|
473
|
+
let K = {
|
|
474
474
|
NOT_FOUND_KEY: 1,
|
|
475
475
|
FALLBACK_TO_TRANSLATE: 2,
|
|
476
476
|
CANNOT_FORMAT_NUMBER: 3,
|
|
@@ -483,50 +483,50 @@
|
|
|
483
483
|
IGNORE_UNSAFE_LOCALE: 10,
|
|
484
484
|
FALLBACK_TO_DEFAULT_PLURAL_RULE: 11,
|
|
485
485
|
FALLBACK_FROM_INVALID_LOCALE: 12
|
|
486
|
-
},
|
|
487
|
-
[
|
|
488
|
-
[
|
|
489
|
-
[
|
|
490
|
-
[
|
|
491
|
-
[
|
|
492
|
-
[
|
|
493
|
-
[
|
|
494
|
-
[
|
|
495
|
-
[
|
|
496
|
-
[
|
|
497
|
-
[
|
|
498
|
-
[
|
|
486
|
+
}, rt = {
|
|
487
|
+
[K.NOT_FOUND_KEY]: `Not found '{key}' key in '{locale}' locale {resource}.`,
|
|
488
|
+
[K.FALLBACK_TO_TRANSLATE]: `Fall back to translate '{key}' key with '{target}' locale.`,
|
|
489
|
+
[K.CANNOT_FORMAT_NUMBER]: `Cannot format a number value due to not supported Intl.NumberFormat.`,
|
|
490
|
+
[K.FALLBACK_TO_NUMBER_FORMAT]: `Fall back to number format '{key}' key with '{target}' locale.`,
|
|
491
|
+
[K.CANNOT_FORMAT_DATE]: `Cannot format a date value due to not supported Intl.DateTimeFormat.`,
|
|
492
|
+
[K.FALLBACK_TO_DATE_FORMAT]: `Fall back to datetime format '{key}' key with '{target}' locale.`,
|
|
493
|
+
[K.EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER]: `This project is using Custom Message Compiler, which is an experimental feature. It may receive breaking changes or be removed in the future.`,
|
|
494
|
+
[K.INVALID_NUMBER_ARGUMENT]: `Invalid argument for number formatting: expected a number but received '{value}'.`,
|
|
495
|
+
[K.INVALID_DATE_ARGUMENT]: `Invalid argument for datetime formatting: expected a Date, number, or ISO string but received '{value}'.`,
|
|
496
|
+
[K.IGNORE_UNSAFE_LOCALE]: `Ignore '{locale}' locale: it is a property name of Object.prototype`,
|
|
497
|
+
[K.FALLBACK_TO_DEFAULT_PLURAL_RULE]: `Fall back to the default plural rule for '{locale}' locale: Intl.PluralRules does not support it`,
|
|
498
|
+
[K.FALLBACK_FROM_INVALID_LOCALE]: `Fall back to '{target}' locale for {type} formatting with '{locale}' locale: it is not a BCP 47 language tag`
|
|
499
499
|
};
|
|
500
|
-
function
|
|
501
|
-
return n(
|
|
500
|
+
function it(e, ...t) {
|
|
501
|
+
return n(rt[e], ...t);
|
|
502
502
|
}
|
|
503
|
-
let
|
|
504
|
-
function
|
|
503
|
+
let at = `12.0.0-alpha.12`, q = `en-US`, ot = (e) => `${e.charAt(0).toLocaleUpperCase()}${e.substr(1)}`;
|
|
504
|
+
function st() {
|
|
505
505
|
return {
|
|
506
506
|
upper: (e, t) => t === `text` && v(e) ? e.toUpperCase() : t === `vnode` && b(e) && `__v_isVNode` in e ? e.children.toUpperCase() : e,
|
|
507
507
|
lower: (e, t) => t === `text` && v(e) ? e.toLowerCase() : t === `vnode` && b(e) && `__v_isVNode` in e ? e.children.toLowerCase() : e,
|
|
508
|
-
capitalize: (e, t) => t === `text` && v(e) ?
|
|
508
|
+
capitalize: (e, t) => t === `text` && v(e) ? ot(e) : t === `vnode` && b(e) && `__v_isVNode` in e ? ot(e.children) : e
|
|
509
509
|
};
|
|
510
510
|
}
|
|
511
|
-
let
|
|
512
|
-
function
|
|
513
|
-
|
|
511
|
+
let ct;
|
|
512
|
+
function lt(e) {
|
|
513
|
+
ct = e;
|
|
514
514
|
}
|
|
515
|
-
let
|
|
516
|
-
function
|
|
517
|
-
|
|
515
|
+
let ut;
|
|
516
|
+
function dt(e) {
|
|
517
|
+
ut = e;
|
|
518
518
|
}
|
|
519
|
-
let
|
|
520
|
-
function
|
|
521
|
-
|
|
519
|
+
let ft;
|
|
520
|
+
function pt(e) {
|
|
521
|
+
ft = e;
|
|
522
522
|
}
|
|
523
|
-
let
|
|
524
|
-
function
|
|
525
|
-
let t = _(e.onWarn) ? e.onWarn :
|
|
526
|
-
|
|
527
|
-
let
|
|
523
|
+
let mt = 0;
|
|
524
|
+
function ht(e = {}) {
|
|
525
|
+
let t = _(e.onWarn) ? e.onWarn : te, n = v(e.version) ? e.version : at, r = v(e.locale) || _(e.locale) ? e.locale : q, i = _(r) ? q : r, a = vt(e.fallbackLocale) ? e.fallbackLocale : i, o = w(e.messages) ? e.messages : J(i), s = w(e.datetimeFormats) ? e.datetimeFormats : J(i), c = w(e.numberFormats) ? e.numberFormats : J(i), u = l(d(), e.modifiers, st()), f = e.pluralRules || d(), p = _(e.missing) ? e.missing : null, m = !yt(e.missingWarn) || e.missingWarn, h = !yt(e.fallbackWarn) || e.fallbackWarn, g = !!e.fallbackFormat, x = !!e.unresolving, S = _(e.postTranslation) ? e.postTranslation : null, C = w(e.processor) ? e.processor : null, T = !y(e.warnHtmlMessage) || e.warnHtmlMessage, ee = !!e.escapeParameter, E = _(e.messageCompiler) ? e.messageCompiler : ct || null, ne = _(e.messageResolver) ? e.messageResolver : ut || tt, re = _(e.localeFallbacker) ? e.localeFallbacker : ft || Ue, ie = b(e.fallbackContext) ? e.fallbackContext : void 0;
|
|
526
|
+
mt++;
|
|
527
|
+
let D = {
|
|
528
528
|
version: n,
|
|
529
|
-
cid:
|
|
529
|
+
cid: mt,
|
|
530
530
|
locale: r,
|
|
531
531
|
fallbackLocale: a,
|
|
532
532
|
messages: o,
|
|
@@ -539,30 +539,30 @@
|
|
|
539
539
|
unresolving: x,
|
|
540
540
|
postTranslation: S,
|
|
541
541
|
processor: C,
|
|
542
|
-
warnHtmlMessage:
|
|
543
|
-
escapeParameter:
|
|
544
|
-
messageCompiler:
|
|
545
|
-
messageResolver:
|
|
546
|
-
localeFallbacker:
|
|
547
|
-
fallbackContext:
|
|
542
|
+
warnHtmlMessage: T,
|
|
543
|
+
escapeParameter: ee,
|
|
544
|
+
messageCompiler: E,
|
|
545
|
+
messageResolver: ne,
|
|
546
|
+
localeFallbacker: re,
|
|
547
|
+
fallbackContext: ie,
|
|
548
548
|
onWarn: t
|
|
549
549
|
};
|
|
550
|
-
return
|
|
550
|
+
return D.datetimeFormats = s, D.numberFormats = c, D.__datetimeFormatters = /* @__PURE__ */ new Map(), D.__numberFormatters = /* @__PURE__ */ new Map(), D;
|
|
551
551
|
}
|
|
552
|
-
let
|
|
553
|
-
function
|
|
552
|
+
let J = (e) => ({ [e]: d() });
|
|
553
|
+
function gt(e, t) {
|
|
554
554
|
let n = m(e.messages, t);
|
|
555
555
|
if (n == null) return;
|
|
556
556
|
let r = d();
|
|
557
|
-
return
|
|
557
|
+
return xe(n, r), r;
|
|
558
558
|
}
|
|
559
|
-
function
|
|
559
|
+
function _t(e, t, n) {
|
|
560
560
|
h(t) || (e.messages[t] = n);
|
|
561
561
|
}
|
|
562
|
-
function
|
|
562
|
+
function vt(e) {
|
|
563
563
|
return v(e) || g(e) || w(e) || e === !1;
|
|
564
564
|
}
|
|
565
|
-
function
|
|
565
|
+
function yt(e) {
|
|
566
566
|
return y(e) || s(e);
|
|
567
567
|
}
|
|
568
568
|
function bt(e, t) {
|
|
@@ -626,7 +626,7 @@
|
|
|
626
626
|
}
|
|
627
627
|
}
|
|
628
628
|
function kt(e, [t, n, r, i], a, o, s, c) {
|
|
629
|
-
let u = y(r.missingWarn) ? r.missingWarn : e.missingWarn, d = y(r.fallbackWarn) ? r.fallbackWarn : e.fallbackWarn, f = !!r.part, p =
|
|
629
|
+
let u = y(r.missingWarn) ? r.missingWarn : e.missingWarn, d = y(r.fallbackWarn) ? r.fallbackWarn : e.fallbackWarn, f = !!r.part, p = H(e, r);
|
|
630
630
|
if (!v(t) || t === ``) {
|
|
631
631
|
let t = Ot(e, a, p.replace(/!/g, ``), i, c);
|
|
632
632
|
return f ? t.formatToParts(n) : t.format(n);
|
|
@@ -682,19 +682,19 @@
|
|
|
682
682
|
let [t] = e, n = d(), r = d(), i;
|
|
683
683
|
if (v(t)) {
|
|
684
684
|
let e = t.match(/^(\d{4}-\d{2}-\d{2})(?:(T|\s)(.+))?$/);
|
|
685
|
-
if (!e) throw B
|
|
685
|
+
if (!e) throw V(B.INVALID_ISO_DATE_ARGUMENT);
|
|
686
686
|
let n = e[3] ? e[3].trim().startsWith(`T`) ? `${e[1].trim()}${e[3].trim()}` : `${e[1].trim()}T${e[3].trim()}` : e[1].trim();
|
|
687
687
|
i = new Date(n);
|
|
688
688
|
try {
|
|
689
689
|
i.toISOString();
|
|
690
690
|
} catch {
|
|
691
|
-
throw B
|
|
691
|
+
throw V(B.INVALID_ISO_DATE_ARGUMENT);
|
|
692
692
|
}
|
|
693
693
|
} else if (o(t)) {
|
|
694
|
-
if (isNaN(t.getTime())) throw B
|
|
694
|
+
if (isNaN(t.getTime())) throw V(B.INVALID_DATE_ARGUMENT);
|
|
695
695
|
i = t;
|
|
696
696
|
} else if (a(t)) i = t;
|
|
697
|
-
else throw B
|
|
697
|
+
else throw V(B.INVALID_ARGUMENT);
|
|
698
698
|
let s = Mt(e, n, r, Pt);
|
|
699
699
|
return [
|
|
700
700
|
n.key || ``,
|
|
@@ -734,7 +734,7 @@
|
|
|
734
734
|
];
|
|
735
735
|
function zt(...e) {
|
|
736
736
|
let [t] = e, n = d(), r = d();
|
|
737
|
-
if (!a(t)) throw B
|
|
737
|
+
if (!a(t)) throw V(B.INVALID_ARGUMENT);
|
|
738
738
|
let i = t, o = Mt(e, n, r, Rt);
|
|
739
739
|
return [
|
|
740
740
|
n.key || ``,
|
|
@@ -746,7 +746,7 @@
|
|
|
746
746
|
function Bt(e, t, n) {
|
|
747
747
|
jt(e.__numberFormatters, t, n);
|
|
748
748
|
}
|
|
749
|
-
let Vt = (e) => e, Ht = (e) => ``, Ut = `text`, Wt = (e) => e.length === 0 ? `` :
|
|
749
|
+
let Vt = (e) => e, Ht = (e) => ``, Ut = `text`, Wt = (e) => e.length === 0 ? `` : ee(e), Gt = T;
|
|
750
750
|
function X(e, t) {
|
|
751
751
|
return e = Math.abs(e), t === 2 ? e === 1 ? 0 : 1 : Math.min(e, 2);
|
|
752
752
|
}
|
|
@@ -815,38 +815,44 @@
|
|
|
815
815
|
};
|
|
816
816
|
return w;
|
|
817
817
|
}
|
|
818
|
-
let Zt = () => ``, Q = (e) => _(e), $ = (e) => v(e) ||
|
|
818
|
+
let Zt = () => ``, Q = (e) => _(e), $ = (e) => v(e) || N(e) || Q(e);
|
|
819
819
|
function Qt(e, ...t) {
|
|
820
|
-
let [n, r] =
|
|
820
|
+
let [n, r] = an(...t), i = H(e, r), a = y(r.escapeParameter) ? r.escapeParameter : e.escapeParameter;
|
|
821
821
|
a && $t(r);
|
|
822
822
|
let o = !!r.resolvedMessage, [s, c, l] = o ? [
|
|
823
823
|
n,
|
|
824
824
|
i,
|
|
825
825
|
m(e.messages, i) || d()
|
|
826
|
-
] :
|
|
826
|
+
] : nn(e, n, i, e.fallbackLocale, y(r.fallbackWarn) ? r.fallbackWarn : e.fallbackWarn, y(r.missingWarn) ? r.missingWarn : e.missingWarn), u = n;
|
|
827
827
|
if (!o && !$(s)) {
|
|
828
828
|
let t = v(r.default) ? r.default : y(r.default) || e.fallbackFormat ? e.messageCompiler ? n : () => n : null;
|
|
829
829
|
(e.fallbackFormat || t != null && (v(t) || _(t))) && (s = t, u = s);
|
|
830
830
|
}
|
|
831
831
|
if (!o && (!$(s) || !v(c))) return e.unresolving ? -1 : n;
|
|
832
|
-
let f = !1, p = Q(s) ? s :
|
|
832
|
+
let f = !1, p = Q(s) ? s : rn(e, n, c, s, u, () => {
|
|
833
833
|
f = !0;
|
|
834
834
|
});
|
|
835
835
|
if (f) return s;
|
|
836
|
-
let h = p(Xt(
|
|
837
|
-
return a && v(g) && (g =
|
|
836
|
+
let h = p(Xt(sn(e, c, l, r, a))), g = e.postTranslation ? e.postTranslation(h, n) : h;
|
|
837
|
+
return a && v(g) && (g = ye(g)), g;
|
|
838
838
|
}
|
|
839
839
|
function $t(e) {
|
|
840
|
-
if (g(e.list) && (e.list = e.list.map((e) => v(e) ?
|
|
840
|
+
if (g(e.list) && (e.list = e.list.map((e) => v(e) ? E(e) : e)), b(e.named)) {
|
|
841
841
|
let t = e.named, n = d();
|
|
842
842
|
for (let e of Object.keys(t)) {
|
|
843
843
|
let r = t[e];
|
|
844
|
-
n[e] = v(r) ?
|
|
844
|
+
n[e] = v(r) ? E(r) : r;
|
|
845
845
|
}
|
|
846
846
|
e.named = n;
|
|
847
847
|
}
|
|
848
848
|
}
|
|
849
|
-
function en(e
|
|
849
|
+
function en(e) {
|
|
850
|
+
return v(e) ? e : E(T(e));
|
|
851
|
+
}
|
|
852
|
+
function tn(e, t) {
|
|
853
|
+
return !t || _(e?.interpolate) ? e ?? void 0 : l({}, e, { interpolate: en });
|
|
854
|
+
}
|
|
855
|
+
function nn(e, t, n, r, i, a) {
|
|
850
856
|
let { messages: o, onWarn: s, messageResolver: c, localeFallbacker: l } = e, u = l(e, r, n), f = d(), p, h = null;
|
|
851
857
|
for (let n = 0; n < u.length && (p = u[n], f = m(o, p) || d(), (h = c(f, t)) === null && (h = m(f, t)), !$(h)); n++) if (!Tt(p, u)) {
|
|
852
858
|
let n = Y(e, t, p, a, `translate`);
|
|
@@ -858,7 +864,7 @@
|
|
|
858
864
|
f
|
|
859
865
|
];
|
|
860
866
|
}
|
|
861
|
-
function
|
|
867
|
+
function rn(e, t, n, r, i, a) {
|
|
862
868
|
if (Q(r)) {
|
|
863
869
|
let e = r;
|
|
864
870
|
return e.locale = e.locale || n, e.key = e.key || t, e;
|
|
@@ -867,16 +873,16 @@
|
|
|
867
873
|
let e = (() => r);
|
|
868
874
|
return e.locale = n, e.key = t, e;
|
|
869
875
|
}
|
|
870
|
-
let o = e.messageCompiler(r,
|
|
876
|
+
let o = e.messageCompiler(r, on(e, n, i, r, e.warnHtmlMessage, a));
|
|
871
877
|
return o.locale = n, o.key = t, o.source = r, o;
|
|
872
878
|
}
|
|
873
|
-
function
|
|
879
|
+
function an(...e) {
|
|
874
880
|
let [t, n, r] = e;
|
|
875
|
-
if (!v(t) && !a(t) && !Q(t) && !
|
|
881
|
+
if (!v(t) && !a(t) && !Q(t) && !N(t)) throw V(B.INVALID_ARGUMENT);
|
|
876
882
|
let i = a(t) ? String(t) : (Q(t), t), o = d();
|
|
877
883
|
return a(n) ? o.plural = n : v(n) ? o.default = n : w(n) && !c(n) ? o.named = n : g(n) && (o.list = n), a(r) ? o.plural = r : v(r) ? o.default = r : w(r) && l(o, r), [i, o];
|
|
878
884
|
}
|
|
879
|
-
function
|
|
885
|
+
function on(e, t, n, i, a, o) {
|
|
880
886
|
return {
|
|
881
887
|
locale: t,
|
|
882
888
|
key: n,
|
|
@@ -887,31 +893,31 @@
|
|
|
887
893
|
onCacheKey: (e) => r(t, n, e)
|
|
888
894
|
};
|
|
889
895
|
}
|
|
890
|
-
function
|
|
891
|
-
let { modifiers:
|
|
896
|
+
function sn(e, t, n, r, i) {
|
|
897
|
+
let { modifiers: o, pluralRules: s, messageResolver: c, fallbackLocale: l, fallbackWarn: u, missingWarn: d, fallbackContext: f } = e;
|
|
892
898
|
return {
|
|
893
899
|
locale: t,
|
|
894
|
-
modifiers:
|
|
895
|
-
pluralRules:
|
|
900
|
+
modifiers: o,
|
|
901
|
+
pluralRules: s,
|
|
896
902
|
messages: (r, i) => {
|
|
897
|
-
let a =
|
|
898
|
-
if (a == null && (
|
|
899
|
-
let [n, , i] =
|
|
900
|
-
a = n ??
|
|
903
|
+
let a = c(n, r);
|
|
904
|
+
if (a == null && (f || i)) {
|
|
905
|
+
let [n, , i] = nn(f || e, r, t, l, u, d);
|
|
906
|
+
a = n ?? c(i, r);
|
|
901
907
|
}
|
|
902
|
-
if (v(a) ||
|
|
903
|
-
let n = !1, i =
|
|
908
|
+
if (v(a) || N(a)) {
|
|
909
|
+
let n = !1, i = rn(e, r, t, a, r, () => {
|
|
904
910
|
n = !0;
|
|
905
911
|
});
|
|
906
912
|
return n ? Zt : i;
|
|
907
913
|
}
|
|
908
914
|
return Q(a) ? a : Zt;
|
|
909
915
|
},
|
|
910
|
-
processor: e.processor
|
|
916
|
+
processor: tn(e.processor, i),
|
|
911
917
|
list: r.list ?? void 0,
|
|
912
918
|
named: r.named ?? void 0,
|
|
913
919
|
pluralIndex: a(r.plural) ? r.plural : void 0
|
|
914
920
|
};
|
|
915
921
|
}
|
|
916
|
-
return e.AST_NODE_PROPS_KEYS =
|
|
922
|
+
return e.AST_NODE_PROPS_KEYS = Le, e.CORE_ERROR_CODES_EXTEND_POINT = 23, e.CORE_WARN_CODES_EXTEND_POINT = 13, e.CoreWarnCodes = K, e.DATETIME_FORMAT_OPTIONS_KEYS = Pt, e.DEFAULT_LOCALE = q, e.DEFAULT_MESSAGE_DATA_TYPE = Ut, e.MISSING_RESOLVE_VALUE = ``, e.NOT_RESOLVED = -1, e.NUMBER_FORMAT_OPTIONS_KEYS = Rt, e.VERSION = at, e.clearCompileCache = Ve, e.clearDateTimeFormat = It, e.clearNumberFormat = Bt, e.compile = He, e.createCompileError = Se, e.createCoreContext = ht, e.createCoreError = V, e.createMessageContext = Xt, e.datetime = Nt, e.fallbackWithLocaleChain = We, e.fallbackWithSimple = Ue, e.getLocale = H, e.getLocaleMessage = gt, e.getWarnMessage = it, e.handleMissing = Y, e.isAlmostSameLocale = wt, e.isFallbackLocale = vt, e.isImplicitFallback = Tt, e.isMessageAST = N, e.isMessageFormat = $, e.isMessageFunction = Q, e.isTranslateFallbackWarn = bt, e.isTranslateMissingWarn = xt, e.isWarnOption = yt, e.number = Lt, e.parse = $e, e.parseDateTimeArgs = Ft, e.parseNumberArgs = zt, e.parseTranslateArgs = an, e.registerLocaleFallbacker = pt, e.registerMessageCompiler = lt, e.registerMessageResolver = dt, e.resolveLocale = W, e.resolveValue = nt, e.resolveWithKeyValue = tt, e.setLocaleMessage = _t, e.translate = Qt, e.updateFallbackLocale = Ct, e;
|
|
917
923
|
})({});
|