@intlify/core 12.0.0-alpha.6 → 12.0.0-alpha.8
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 +35 -54
- package/dist/core.esm-browser.prod.js +348 -351
- package/dist/core.global.js +35 -54
- package/dist/core.global.prod.js +249 -252
- package/dist/core.js +1 -1
- package/dist/core.node.js +1 -1
- package/dist/core.runtime.esm-browser.js +29 -42
- package/dist/core.runtime.esm-browser.prod.js +201 -204
- package/dist/core.runtime.global.js +29 -42
- package/dist/core.runtime.global.prod.js +183 -186
- package/dist/core.runtime.js +3 -5
- package/dist/core.runtime.node.js +3 -5
- package/package.json +3 -3
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @intlify/core v12.0.0-alpha.
|
|
2
|
+
* @intlify/core v12.0.0-alpha.8
|
|
3
3
|
* (c) 2016-present kazuya kawaguchi and contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/ const e = /\{([0-9a-z]+)\}/gi;
|
|
6
6
|
function t(t, ...n) {
|
|
7
|
-
return n.length === 1 && y(n[0]) && (n = n[0]),
|
|
7
|
+
return n.length === 1 && y(n[0]) && (n = n[0]), n && n.hasOwnProperty || (n = {}), t.replace(e, (e, t) => n.hasOwnProperty(t) ? n[t] : ``);
|
|
8
8
|
}
|
|
9
9
|
const n = (e, t, n) => r({
|
|
10
10
|
l: e,
|
|
@@ -22,28 +22,28 @@ function m(e) {
|
|
|
22
22
|
return f(Object.prototype, e);
|
|
23
23
|
}
|
|
24
24
|
const h = Array.isArray, g = (e) => typeof e == `function`, _ = (e) => typeof e == `string`, v = (e) => typeof e == `boolean`, y = (e) => typeof e == `object` && !!e, b = (e) => y(e) && g(e.then) && g(e.catch), x = Object.prototype.toString, S = (e) => x.call(e), C = (e) => S(e) === `[object Object]`, w = (e) => e == null ? `` : h(e) || C(e) && e.toString === x ? JSON.stringify(e, null, 2) : String(e);
|
|
25
|
-
function
|
|
25
|
+
function T(e, t = ``) {
|
|
26
26
|
return e.reduce((e, n, r) => r === 0 ? e + n : e + t + n, ``);
|
|
27
27
|
}
|
|
28
|
-
function
|
|
28
|
+
function ee(e, t) {
|
|
29
29
|
typeof console < `u` && (console.warn(`[intlify] ` + e), t && console.warn(t.stack));
|
|
30
30
|
}
|
|
31
|
-
function
|
|
31
|
+
function E(e) {
|
|
32
32
|
return e.replace(/&/g, `&`).replace(/</g, `<`).replace(/>/g, `>`).replace(/"/g, `"`).replace(/'/g, `'`).replace(/\//g, `/`).replace(/=/g, `=`);
|
|
33
33
|
}
|
|
34
|
-
function
|
|
34
|
+
function te(e) {
|
|
35
35
|
return e.replace(/&(?![a-z0-9#]{2,6};)/gi, `&`).replace(/"/g, `"`).replace(/'/g, `'`).replace(/</g, `<`).replace(/>/g, `>`);
|
|
36
36
|
}
|
|
37
|
-
const
|
|
37
|
+
const D = /^javascript:/i, ne = /^(?:href|xlink:href|src|action|formaction)$/i, re = /&#(?:x([0-9a-f]+)|(\d+));?/gi, O = /&(?:Tab|NewLine);/g, ie = /:?/gi, ae = /[\u0000-\u0020\u007f-\u009f]/g, oe = /(?:^|[\s"'<>/])on\w+\s*=\s*["']?[^"'>]+["']?/i, se = /(^|[\s"'<>/])on(\w+\s*=)/gi, ce = /(?:^|[\s"'<>/])srcdoc\s*=/i, le = /(^|[\s"'<>/])s(rcdoc\s*=)/gi, ue = /<(?:base|animate|set)(?=[\s/>]|$)/i, de = /<(base|animate|set)(?=[\s/>]|$)/gi, fe = /(^|[\s"'<>/])((?:href|xlink:href|src|action|formaction)\s*=\s*)([^\s"'=<>`]+)/gi;
|
|
38
38
|
function pe(e, t, n) {
|
|
39
39
|
let r = t || n;
|
|
40
40
|
if (!r) return e;
|
|
41
41
|
let i = Number.parseInt(r, t ? 16 : 10);
|
|
42
42
|
return i <= 127 ? String.fromCharCode(i) : e;
|
|
43
43
|
}
|
|
44
|
-
function
|
|
45
|
-
let t = e.replace(
|
|
46
|
-
return
|
|
44
|
+
function k(e) {
|
|
45
|
+
let t = e.replace(re, pe).replace(O, ``).replace(ie, `:`).replace(ae, ``);
|
|
46
|
+
return D.test(t);
|
|
47
47
|
}
|
|
48
48
|
function me(e) {
|
|
49
49
|
let t = /url\s*\(/gi, n = ``, r = 0, i;
|
|
@@ -51,25 +51,22 @@ function me(e) {
|
|
|
51
51
|
let a = i.index, o = t.lastIndex - 1, s = o + 1, c = 1, l = null;
|
|
52
52
|
for (; s < e.length; s++) {
|
|
53
53
|
let t = e[s];
|
|
54
|
-
if (l)
|
|
55
|
-
|
|
56
|
-
continue;
|
|
57
|
-
}
|
|
58
|
-
if (t === `"` || t === `'`) l = t;
|
|
54
|
+
if (l) t === l && (l = null);
|
|
55
|
+
else if (t === `"` || t === `'`) l = t;
|
|
59
56
|
else if (t === `(`) c++;
|
|
60
57
|
else if (t === `)` && (c--, c === 0)) break;
|
|
61
58
|
}
|
|
62
59
|
if (c !== 0) break;
|
|
63
60
|
let u = e.slice(o + 1, s).trim(), d = u.startsWith(`"`) && u.endsWith(`"`) || u.startsWith(`'`) && u.endsWith(`'`) ? u.slice(1, -1).trim() : u;
|
|
64
|
-
n += e.slice(r, a), n +=
|
|
61
|
+
n += e.slice(r, a), n += k(d) ? `url(about:blank)` : e.slice(a, s + 1), r = s + 1;
|
|
65
62
|
}
|
|
66
63
|
return n + e.slice(r);
|
|
67
64
|
}
|
|
68
65
|
function he(e, t) {
|
|
69
|
-
return
|
|
66
|
+
return ne.test(e) && k(t) ? `about:blank` : te(e.toLowerCase() === `style` ? me(t) : t);
|
|
70
67
|
}
|
|
71
68
|
function ge(e) {
|
|
72
|
-
return e = e.replace(/([\w:-]+)\s*=\s*"([^"]*)"/g, (e, t, n) => `${t}="${he(t, n)}"`), e = e.replace(/([\w:-]+)\s*=\s*'([^']*)'/g, (e, t, n) => `${t}='${he(t, n)}'`),
|
|
69
|
+
return e = e.replace(/([\w:-]+)\s*=\s*"([^"]*)"/g, (e, t, n) => `${t}="${he(t, n)}"`), e = e.replace(/([\w:-]+)\s*=\s*'([^']*)'/g, (e, t, n) => `${t}='${he(t, n)}'`), oe.test(e) && (e = e.replace(se, `$1on$2`)), ce.test(e) && (e = e.replace(le, `$1s$2`)), ue.test(e) && (e = e.replace(de, `<$1`)), e = e.replace(fe, (e, t, n, r) => k(r) ? `${t}${n}about:blank` : e), e;
|
|
73
70
|
}
|
|
74
71
|
const _e = (e) => !y(e) || h(e);
|
|
75
72
|
function ve(e, t) {
|
|
@@ -95,7 +92,7 @@ function ve(e, t) {
|
|
|
95
92
|
}
|
|
96
93
|
}
|
|
97
94
|
}
|
|
98
|
-
const
|
|
95
|
+
const A = {
|
|
99
96
|
EXPECTED_TOKEN: 1,
|
|
100
97
|
INVALID_TOKEN_IN_PLACEHOLDER: 2,
|
|
101
98
|
UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER: 3,
|
|
@@ -113,47 +110,47 @@ const O = {
|
|
|
113
110
|
UNHANDLED_CODEGEN_NODE_TYPE: 15,
|
|
114
111
|
UNHANDLED_MINIFIER_NODE_TYPE: 16
|
|
115
112
|
};
|
|
116
|
-
|
|
113
|
+
A.EXPECTED_TOKEN, A.INVALID_TOKEN_IN_PLACEHOLDER, A.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER, A.UNKNOWN_ESCAPE_SEQUENCE, A.INVALID_UNICODE_ESCAPE_SEQUENCE, A.UNBALANCED_CLOSING_BRACE, A.UNTERMINATED_CLOSING_BRACE, A.EMPTY_PLACEHOLDER, A.NOT_ALLOW_NEST_PLACEHOLDER, A.INVALID_LINKED_FORMAT, A.MUST_HAVE_MESSAGES_IN_PLURAL, A.UNEXPECTED_EMPTY_LINKED_MODIFIER, A.UNEXPECTED_EMPTY_LINKED_KEY, A.UNEXPECTED_LEXICAL_ANALYSIS, A.UNHANDLED_CODEGEN_NODE_TYPE, A.UNHANDLED_MINIFIER_NODE_TYPE;
|
|
117
114
|
function ye(e, t, n = {}) {
|
|
118
115
|
let { domain: r, messages: i, args: a } = n, o = SyntaxError(String(e));
|
|
119
116
|
return o.code = e, t && (o.location = t), o.domain = r, o;
|
|
120
117
|
}
|
|
121
|
-
function
|
|
122
|
-
return y(e) &&
|
|
118
|
+
function j(e) {
|
|
119
|
+
return y(e) && M(e) === 0 && (f(e, `b`) || f(e, `body`));
|
|
123
120
|
}
|
|
124
121
|
const be = [`b`, `body`];
|
|
125
122
|
function xe(e) {
|
|
126
123
|
return F(e, be);
|
|
127
124
|
}
|
|
128
|
-
const
|
|
129
|
-
function Se(e) {
|
|
130
|
-
return F(e, A, []);
|
|
131
|
-
}
|
|
132
|
-
const j = [`s`, `static`];
|
|
125
|
+
const Se = [`c`, `cases`];
|
|
133
126
|
function Ce(e) {
|
|
134
|
-
return F(e,
|
|
127
|
+
return F(e, Se, []);
|
|
135
128
|
}
|
|
136
|
-
const
|
|
137
|
-
function
|
|
138
|
-
return F(e,
|
|
129
|
+
const we = [`s`, `static`];
|
|
130
|
+
function Te(e) {
|
|
131
|
+
return F(e, we);
|
|
139
132
|
}
|
|
140
|
-
const
|
|
141
|
-
function
|
|
142
|
-
return F(e,
|
|
133
|
+
const Ee = [`i`, `items`];
|
|
134
|
+
function De(e) {
|
|
135
|
+
return F(e, Ee, []);
|
|
143
136
|
}
|
|
144
|
-
const
|
|
137
|
+
const Oe = [`t`, `type`];
|
|
138
|
+
function M(e) {
|
|
139
|
+
return F(e, Oe);
|
|
140
|
+
}
|
|
141
|
+
const N = [`v`, `value`];
|
|
145
142
|
function P(e, t) {
|
|
146
|
-
let n = F(e,
|
|
143
|
+
let n = F(e, N);
|
|
147
144
|
if (n != null) return n;
|
|
148
145
|
throw I(t);
|
|
149
146
|
}
|
|
150
|
-
const
|
|
151
|
-
function Oe(e) {
|
|
152
|
-
return F(e, De);
|
|
153
|
-
}
|
|
154
|
-
const ke = [`k`, `key`];
|
|
147
|
+
const ke = [`m`, `modifier`];
|
|
155
148
|
function Ae(e) {
|
|
156
|
-
|
|
149
|
+
return F(e, ke);
|
|
150
|
+
}
|
|
151
|
+
const je = [`k`, `key`];
|
|
152
|
+
function Me(e) {
|
|
153
|
+
let t = F(e, je);
|
|
157
154
|
if (t) return t;
|
|
158
155
|
throw I(6);
|
|
159
156
|
}
|
|
@@ -164,41 +161,41 @@ function F(e, t, n) {
|
|
|
164
161
|
}
|
|
165
162
|
return n;
|
|
166
163
|
}
|
|
167
|
-
const
|
|
164
|
+
const Ne = [
|
|
168
165
|
...be,
|
|
169
|
-
...
|
|
170
|
-
...
|
|
171
|
-
...M,
|
|
172
|
-
...ke,
|
|
173
|
-
...De,
|
|
166
|
+
...Se,
|
|
167
|
+
...we,
|
|
174
168
|
...Ee,
|
|
175
|
-
...
|
|
169
|
+
...je,
|
|
170
|
+
...ke,
|
|
171
|
+
...N,
|
|
172
|
+
...Oe
|
|
176
173
|
];
|
|
177
174
|
function I(e) {
|
|
178
175
|
return Error(`unhandled node type: ${e}`);
|
|
179
176
|
}
|
|
180
|
-
function
|
|
181
|
-
return (t) =>
|
|
177
|
+
function Pe(e) {
|
|
178
|
+
return (t) => Fe(t, e);
|
|
182
179
|
}
|
|
183
|
-
function
|
|
180
|
+
function Fe(e, t) {
|
|
184
181
|
let n = xe(t);
|
|
185
182
|
if (n == null) throw I(0);
|
|
186
|
-
if (
|
|
187
|
-
let t =
|
|
188
|
-
return e.plural(t.reduce((t, n) => [...h(t) ? t : [t],
|
|
183
|
+
if (M(n) === 1) {
|
|
184
|
+
let t = Ce(n);
|
|
185
|
+
return e.plural(t.reduce((t, n) => [...h(t) ? t : [t], Ie(e, n)], []));
|
|
189
186
|
}
|
|
190
|
-
return
|
|
187
|
+
return Ie(e, n);
|
|
191
188
|
}
|
|
192
|
-
function
|
|
193
|
-
let n =
|
|
189
|
+
function Ie(e, t) {
|
|
190
|
+
let n = Te(t);
|
|
194
191
|
if (n != null) return e.type === `text` ? n : e.normalize([n]);
|
|
195
192
|
{
|
|
196
|
-
let n =
|
|
193
|
+
let n = De(t).reduce((t, n) => [...t, L(e, n)], []);
|
|
197
194
|
return e.normalize(n);
|
|
198
195
|
}
|
|
199
196
|
}
|
|
200
197
|
function L(e, t) {
|
|
201
|
-
let n =
|
|
198
|
+
let n = M(t);
|
|
202
199
|
switch (n) {
|
|
203
200
|
case 3: return P(t, n);
|
|
204
201
|
case 9: return P(t, n);
|
|
@@ -215,7 +212,7 @@ function L(e, t) {
|
|
|
215
212
|
throw I(n);
|
|
216
213
|
}
|
|
217
214
|
case 6: {
|
|
218
|
-
let n = t, r =
|
|
215
|
+
let n = t, r = Ae(n), i = Me(n);
|
|
219
216
|
return e.linked(L(e, i), r ? L(e, r) : void 0, e.type);
|
|
220
217
|
}
|
|
221
218
|
case 7: return P(t, n);
|
|
@@ -224,14 +221,14 @@ function L(e, t) {
|
|
|
224
221
|
}
|
|
225
222
|
}
|
|
226
223
|
let R = u();
|
|
227
|
-
function
|
|
224
|
+
function Le() {
|
|
228
225
|
R = u();
|
|
229
226
|
}
|
|
230
|
-
function
|
|
227
|
+
function Re(e, t) {
|
|
231
228
|
{
|
|
232
|
-
if (!
|
|
229
|
+
if (!j(e)) return (() => e);
|
|
233
230
|
let t = e.cacheKey;
|
|
234
|
-
return t ? R[t] || (R[t] =
|
|
231
|
+
return t ? R[t] || (R[t] = Pe(e)) : Pe(e);
|
|
235
232
|
}
|
|
236
233
|
}
|
|
237
234
|
const z = {
|
|
@@ -241,8 +238,8 @@ const z = {
|
|
|
241
238
|
NOT_SUPPORT_LOCALE_PROMISE_VALUE: 20,
|
|
242
239
|
NOT_SUPPORT_LOCALE_ASYNC_FUNCTION: 21,
|
|
243
240
|
NOT_SUPPORT_LOCALE_TYPE: 22
|
|
244
|
-
},
|
|
245
|
-
function
|
|
241
|
+
}, ze = 23;
|
|
242
|
+
function Be(e) {
|
|
246
243
|
return ye(e, null, void 0);
|
|
247
244
|
}
|
|
248
245
|
z.INVALID_ARGUMENT, z.INVALID_DATE_ARGUMENT, z.INVALID_ISO_DATE_ARGUMENT, z.NOT_SUPPORT_LOCALE_PROMISE_VALUE, z.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION, z.NOT_SUPPORT_LOCALE_TYPE;
|
|
@@ -263,35 +260,35 @@ function H(e) {
|
|
|
263
260
|
}
|
|
264
261
|
throw Error(z.NOT_SUPPORT_LOCALE_TYPE);
|
|
265
262
|
}
|
|
266
|
-
function
|
|
263
|
+
function Ve(e, t, n) {
|
|
267
264
|
return [.../* @__PURE__ */ new Set([n, ...h(t) ? t : y(t) ? Object.keys(t).filter((e) => e !== "default") : _(t) ? [t] : [n]])];
|
|
268
265
|
}
|
|
269
|
-
function
|
|
266
|
+
function He(e, t, n) {
|
|
270
267
|
let r = _(n) ? n : G, i = e, a;
|
|
271
268
|
y(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)));
|
|
272
269
|
let o = a.get(r);
|
|
273
270
|
if (o) return o;
|
|
274
271
|
let s = [], c = [n];
|
|
275
|
-
for (; h(c);) c =
|
|
272
|
+
for (; h(c);) c = Ue(s, c, t);
|
|
276
273
|
let l = h(t) || !C(t) ? t : t.default ? t.default : null;
|
|
277
|
-
return c = _(l) ? [l] : l, h(c) &&
|
|
274
|
+
return c = _(l) ? [l] : l, h(c) && Ue(s, c, !1), a.set(r, s), s;
|
|
278
275
|
}
|
|
279
|
-
function
|
|
276
|
+
function Ue(e, t, n) {
|
|
280
277
|
let r = !0;
|
|
281
278
|
for (let i = 0; i < t.length && v(r); i++) {
|
|
282
279
|
let a = t[i];
|
|
283
|
-
_(a) && (r =
|
|
280
|
+
_(a) && (r = We(e, t[i], n));
|
|
284
281
|
}
|
|
285
282
|
return r;
|
|
286
283
|
}
|
|
287
|
-
function
|
|
284
|
+
function We(e, t, n) {
|
|
288
285
|
let r, i = t.split(`-`);
|
|
289
286
|
do
|
|
290
|
-
r =
|
|
287
|
+
r = Ge(e, i.join(`-`), n), i.splice(-1, 1);
|
|
291
288
|
while (i.length && r === !0);
|
|
292
289
|
return r;
|
|
293
290
|
}
|
|
294
|
-
function
|
|
291
|
+
function Ge(e, t, n) {
|
|
295
292
|
let r = !1;
|
|
296
293
|
if (!e.includes(t) && (r = !0, t)) {
|
|
297
294
|
r = t[t.length - 1] !== `!`;
|
|
@@ -338,15 +335,15 @@ U[0] = {
|
|
|
338
335
|
o: 8,
|
|
339
336
|
l: [6, 0]
|
|
340
337
|
};
|
|
341
|
-
const
|
|
342
|
-
function
|
|
343
|
-
return
|
|
338
|
+
const Ke = /^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;
|
|
339
|
+
function qe(e) {
|
|
340
|
+
return Ke.test(e);
|
|
344
341
|
}
|
|
345
|
-
function
|
|
342
|
+
function Je(e) {
|
|
346
343
|
let t = e.charCodeAt(0);
|
|
347
344
|
return t === e.charCodeAt(e.length - 1) && (t === 34 || t === 39) ? e.slice(1, -1) : e;
|
|
348
345
|
}
|
|
349
|
-
function
|
|
346
|
+
function Ye(e) {
|
|
350
347
|
if (e == null) return `o`;
|
|
351
348
|
switch (e.charCodeAt(0)) {
|
|
352
349
|
case 91:
|
|
@@ -367,11 +364,11 @@ function qe(e) {
|
|
|
367
364
|
}
|
|
368
365
|
return `i`;
|
|
369
366
|
}
|
|
370
|
-
function
|
|
367
|
+
function Xe(e) {
|
|
371
368
|
let t = e.trim();
|
|
372
|
-
return e.charAt(0) === `0` && isNaN(parseInt(e)) ? !1 :
|
|
369
|
+
return e.charAt(0) === `0` && isNaN(parseInt(e)) ? !1 : qe(t) ? Je(t) : `*` + t;
|
|
373
370
|
}
|
|
374
|
-
function
|
|
371
|
+
function Ze(e) {
|
|
375
372
|
let t = [], n = -1, r = 0, i = 0, a, o, s, c, l, u, d, f = [];
|
|
376
373
|
f[0] = () => {
|
|
377
374
|
o === void 0 ? o = s : o += s;
|
|
@@ -382,7 +379,7 @@ function Ye(e) {
|
|
|
382
379
|
}, f[3] = () => {
|
|
383
380
|
if (i > 0) i--, r = 4, f[0]();
|
|
384
381
|
else {
|
|
385
|
-
if (i = 0, o === void 0 || (o =
|
|
382
|
+
if (i = 0, o === void 0 || (o = Xe(o), o === !1)) return !1;
|
|
386
383
|
f[1]();
|
|
387
384
|
}
|
|
388
385
|
};
|
|
@@ -391,22 +388,22 @@ function Ye(e) {
|
|
|
391
388
|
if (r === 5 && t === `'` || r === 6 && t === `"`) return n++, s = `\\` + t, f[0](), !0;
|
|
392
389
|
}
|
|
393
390
|
for (; r !== null;) if (n++, a = e[n], !(a === `\\` && p())) {
|
|
394
|
-
if (c =
|
|
391
|
+
if (c = Ye(a), d = U[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;
|
|
395
392
|
if (r === 7) return t;
|
|
396
393
|
}
|
|
397
394
|
}
|
|
398
|
-
const
|
|
399
|
-
function
|
|
395
|
+
const Qe = /* @__PURE__ */ new Map();
|
|
396
|
+
function $e(e, t) {
|
|
400
397
|
return y(e) ? p(e, t) : null;
|
|
401
398
|
}
|
|
402
|
-
function
|
|
399
|
+
function et(e, t) {
|
|
403
400
|
if (!y(e)) return null;
|
|
404
|
-
let n =
|
|
405
|
-
if (n || (n =
|
|
401
|
+
let n = Qe.get(t);
|
|
402
|
+
if (n || (n = Ze(t), n && Qe.set(t, n)), !n) return null;
|
|
406
403
|
let r = n.length, i = e, a = 0;
|
|
407
404
|
for (; a < r;) {
|
|
408
405
|
let e = n[a];
|
|
409
|
-
if (
|
|
406
|
+
if (Ne.includes(e) && j(i) || !y(i) || !f(i, e)) return null;
|
|
410
407
|
let t = i[e];
|
|
411
408
|
if (t === void 0 || g(i)) return null;
|
|
412
409
|
i = t, a++;
|
|
@@ -426,7 +423,7 @@ const W = {
|
|
|
426
423
|
IGNORE_UNSAFE_LOCALE: 10,
|
|
427
424
|
FALLBACK_TO_DEFAULT_PLURAL_RULE: 11,
|
|
428
425
|
FALLBACK_FROM_INVALID_LOCALE: 12
|
|
429
|
-
},
|
|
426
|
+
}, tt = 13, nt = {
|
|
430
427
|
[W.NOT_FOUND_KEY]: `Not found '{key}' key in '{locale}' locale {resource}.`,
|
|
431
428
|
[W.FALLBACK_TO_TRANSLATE]: `Fall back to translate '{key}' key with '{target}' locale.`,
|
|
432
429
|
[W.CANNOT_FORMAT_NUMBER]: `Cannot format a number value due to not supported Intl.NumberFormat.`,
|
|
@@ -440,36 +437,36 @@ const W = {
|
|
|
440
437
|
[W.FALLBACK_TO_DEFAULT_PLURAL_RULE]: `Fall back to the default plural rule for '{locale}' locale: Intl.PluralRules does not support it`,
|
|
441
438
|
[W.FALLBACK_FROM_INVALID_LOCALE]: `Fall back to '{target}' locale for {type} formatting with '{locale}' locale: it is not a BCP 47 language tag`
|
|
442
439
|
};
|
|
443
|
-
function
|
|
444
|
-
return t(
|
|
440
|
+
function rt(e, ...n) {
|
|
441
|
+
return t(nt[e], ...n);
|
|
445
442
|
}
|
|
446
|
-
const
|
|
447
|
-
function
|
|
443
|
+
const it = `12.0.0-alpha.8`, at = -1, G = `en-US`, ot = ``, st = (e) => `${e.charAt(0).toLocaleUpperCase()}${e.substr(1)}`;
|
|
444
|
+
function ct() {
|
|
448
445
|
return {
|
|
449
446
|
upper: (e, t) => t === `text` && _(e) ? e.toUpperCase() : t === `vnode` && y(e) && `__v_isVNode` in e ? e.children.toUpperCase() : e,
|
|
450
447
|
lower: (e, t) => t === `text` && _(e) ? e.toLowerCase() : t === `vnode` && y(e) && `__v_isVNode` in e ? e.children.toLowerCase() : e,
|
|
451
|
-
capitalize: (e, t) => t === `text` && _(e) ?
|
|
448
|
+
capitalize: (e, t) => t === `text` && _(e) ? st(e) : t === `vnode` && y(e) && `__v_isVNode` in e ? st(e.children) : e
|
|
452
449
|
};
|
|
453
450
|
}
|
|
454
|
-
let
|
|
455
|
-
function
|
|
456
|
-
|
|
451
|
+
let K;
|
|
452
|
+
function lt(e) {
|
|
453
|
+
K = e;
|
|
457
454
|
}
|
|
458
|
-
let
|
|
459
|
-
function
|
|
460
|
-
|
|
455
|
+
let ut;
|
|
456
|
+
function dt(e) {
|
|
457
|
+
ut = e;
|
|
461
458
|
}
|
|
462
|
-
let
|
|
463
|
-
function
|
|
464
|
-
|
|
459
|
+
let ft;
|
|
460
|
+
function pt(e) {
|
|
461
|
+
ft = e;
|
|
465
462
|
}
|
|
466
|
-
let
|
|
467
|
-
function
|
|
468
|
-
let t = g(e.onWarn) ? e.onWarn :
|
|
469
|
-
|
|
470
|
-
let
|
|
463
|
+
let mt = 0;
|
|
464
|
+
function ht(e = {}) {
|
|
465
|
+
let t = g(e.onWarn) ? e.onWarn : ee, n = _(e.version) ? e.version : it, r = _(e.locale) || g(e.locale) ? e.locale : G, i = g(r) ? G : r, a = vt(e.fallbackLocale) ? e.fallbackLocale : i, o = C(e.messages) ? e.messages : q(i), s = C(e.datetimeFormats) ? e.datetimeFormats : q(i), l = C(e.numberFormats) ? e.numberFormats : q(i), d = c(u(), e.modifiers, ct()), f = e.pluralRules || u(), p = g(e.missing) ? e.missing : null, m = !J(e.missingWarn) || e.missingWarn, h = !J(e.fallbackWarn) || e.fallbackWarn, b = !!e.fallbackFormat, x = !!e.unresolving, S = g(e.postTranslation) ? e.postTranslation : null, w = C(e.processor) ? e.processor : null, T = !v(e.warnHtmlMessage) || e.warnHtmlMessage, E = !!e.escapeParameter, te = g(e.messageCompiler) ? e.messageCompiler : K || null, D = g(e.messageResolver) ? e.messageResolver : ut || $e, ne = g(e.localeFallbacker) ? e.localeFallbacker : ft || Ve, re = y(e.fallbackContext) ? e.fallbackContext : void 0;
|
|
466
|
+
mt++;
|
|
467
|
+
let O = {
|
|
471
468
|
version: n,
|
|
472
|
-
cid:
|
|
469
|
+
cid: mt,
|
|
473
470
|
locale: r,
|
|
474
471
|
fallbackLocale: a,
|
|
475
472
|
messages: o,
|
|
@@ -482,39 +479,39 @@ function mt(e = {}) {
|
|
|
482
479
|
unresolving: x,
|
|
483
480
|
postTranslation: S,
|
|
484
481
|
processor: w,
|
|
485
|
-
warnHtmlMessage:
|
|
486
|
-
escapeParameter:
|
|
487
|
-
messageCompiler:
|
|
488
|
-
messageResolver:
|
|
489
|
-
localeFallbacker:
|
|
490
|
-
fallbackContext:
|
|
482
|
+
warnHtmlMessage: T,
|
|
483
|
+
escapeParameter: E,
|
|
484
|
+
messageCompiler: te,
|
|
485
|
+
messageResolver: D,
|
|
486
|
+
localeFallbacker: ne,
|
|
487
|
+
fallbackContext: re,
|
|
491
488
|
onWarn: t
|
|
492
489
|
};
|
|
493
|
-
return
|
|
490
|
+
return O.datetimeFormats = s, O.numberFormats = l, O.__datetimeFormatters = /* @__PURE__ */ new Map(), O.__numberFormatters = /* @__PURE__ */ new Map(), O;
|
|
494
491
|
}
|
|
495
|
-
const
|
|
496
|
-
function
|
|
492
|
+
const q = (e) => ({ [e]: u() });
|
|
493
|
+
function gt(e, t) {
|
|
497
494
|
let n = p(e.messages, t);
|
|
498
495
|
if (n == null) return;
|
|
499
496
|
let r = u();
|
|
500
497
|
return ve(n, r), r;
|
|
501
498
|
}
|
|
502
|
-
function
|
|
499
|
+
function _t(e, t, n) {
|
|
503
500
|
m(t) || (e.messages[t] = n);
|
|
504
501
|
}
|
|
505
|
-
function
|
|
502
|
+
function vt(e) {
|
|
506
503
|
return _(e) || h(e) || C(e) || e === !1;
|
|
507
504
|
}
|
|
508
|
-
function
|
|
505
|
+
function J(e) {
|
|
509
506
|
return v(e) || o(e);
|
|
510
507
|
}
|
|
511
|
-
function
|
|
508
|
+
function yt(e, t) {
|
|
512
509
|
return o(e) ? e.test(t) : e;
|
|
513
510
|
}
|
|
514
|
-
function
|
|
511
|
+
function bt(e, t) {
|
|
515
512
|
return o(e) ? e.test(t) : e;
|
|
516
513
|
}
|
|
517
|
-
function
|
|
514
|
+
function Y(e, t, n, r, i) {
|
|
518
515
|
let { missing: a, onWarn: o } = e;
|
|
519
516
|
if (a !== null) {
|
|
520
517
|
let r = a(e, n, t, i);
|
|
@@ -522,84 +519,84 @@ function J(e, t, n, r, i) {
|
|
|
522
519
|
}
|
|
523
520
|
return t;
|
|
524
521
|
}
|
|
525
|
-
function
|
|
522
|
+
function xt(e, t) {
|
|
526
523
|
let n = e;
|
|
527
524
|
y(t) ? n.__localeChainObjectCache?.delete(t) : n.__localeChainCache?.delete(t);
|
|
528
525
|
}
|
|
529
|
-
function
|
|
530
|
-
|
|
526
|
+
function St(e, t, n) {
|
|
527
|
+
xt(e, n), e.fallbackContext && xt(e.fallbackContext, n);
|
|
531
528
|
{
|
|
532
529
|
let { __datetimeFormatters: t, __numberFormatters: n } = e;
|
|
533
530
|
t.clear(), n.clear();
|
|
534
531
|
}
|
|
535
532
|
e.localeFallbacker(e, n, t);
|
|
536
533
|
}
|
|
537
|
-
function
|
|
534
|
+
function Ct(e, t) {
|
|
538
535
|
return e !== t && e.split(`-`)[0] === t.split(`-`)[0];
|
|
539
536
|
}
|
|
540
|
-
function
|
|
537
|
+
function wt(e, t) {
|
|
541
538
|
let n = t.indexOf(e);
|
|
542
539
|
if (n === -1) return !1;
|
|
543
|
-
for (let r = n + 1; r < t.length; r++) if (
|
|
540
|
+
for (let r = n + 1; r < t.length; r++) if (Ct(e, t[r])) return !0;
|
|
544
541
|
return !1;
|
|
545
542
|
}
|
|
546
|
-
function
|
|
543
|
+
function Tt(e, t, n, r, i, a, o) {
|
|
547
544
|
let { fallbackLocale: s, localeFallbacker: c, onWarn: l } = e, u = c(e, s, n);
|
|
548
545
|
for (let n = 0; n < u.length; n++) {
|
|
549
546
|
let a = u[n], s = p(p(r, a) || {}, t);
|
|
550
547
|
if (C(s) && _(a)) return a;
|
|
551
|
-
|
|
548
|
+
Y(e, t, a, i, o);
|
|
552
549
|
}
|
|
553
550
|
return null;
|
|
554
551
|
}
|
|
555
|
-
function
|
|
552
|
+
function Et(e) {
|
|
556
553
|
try {
|
|
557
554
|
return Intl.getCanonicalLocales(e), !0;
|
|
558
555
|
} catch {
|
|
559
556
|
return !1;
|
|
560
557
|
}
|
|
561
558
|
}
|
|
562
|
-
function
|
|
559
|
+
function Dt(e, t, n, r, i) {
|
|
563
560
|
try {
|
|
564
561
|
return new t(n, r);
|
|
565
562
|
} catch (i) {
|
|
566
|
-
if (
|
|
563
|
+
if (Et(n)) throw i;
|
|
567
564
|
let { fallbackLocale: a, localeFallbacker: o, onWarn: s } = e;
|
|
568
|
-
return new t(o(e, a, n).find(
|
|
565
|
+
return new t(o(e, a, n).find(Et) || `en-US`, r);
|
|
569
566
|
}
|
|
570
567
|
}
|
|
571
|
-
function
|
|
568
|
+
function Ot(e, [t, n, r, i], a, o, s, l) {
|
|
572
569
|
let u = v(r.missingWarn) ? r.missingWarn : e.missingWarn, d = v(r.fallbackWarn) ? r.fallbackWarn : e.fallbackWarn, f = !!r.part, p = B(e, r);
|
|
573
570
|
if (!_(t) || t === ``) {
|
|
574
|
-
let t =
|
|
571
|
+
let t = Dt(e, a, p.replace(/!/g, ``), i, l);
|
|
575
572
|
return f ? t.formatToParts(n) : t.format(n);
|
|
576
573
|
}
|
|
577
|
-
let m =
|
|
574
|
+
let m = Tt(e, t, p, s, u, d, l);
|
|
578
575
|
if (!_(m)) return e.unresolving ? -1 : t;
|
|
579
|
-
let h = s[m][t], g =
|
|
580
|
-
return y || (y =
|
|
576
|
+
let h = s[m][t], g = kt(m, t, i), y = o.get(g);
|
|
577
|
+
return y || (y = Dt(e, a, m, c({}, h, i), l), o.set(g, y)), f ? y.formatToParts(n) : y.format(n);
|
|
581
578
|
}
|
|
582
|
-
function
|
|
579
|
+
function kt(e, t, n) {
|
|
583
580
|
let r = `${e}__${t}`;
|
|
584
581
|
return C(n) && !s(n) && (r = `${r}__${JSON.stringify(n)}`), r;
|
|
585
582
|
}
|
|
586
|
-
function
|
|
583
|
+
function At(e, t, n) {
|
|
587
584
|
for (let r in n) {
|
|
588
585
|
let n = `${t}__${r}`;
|
|
589
586
|
for (let t of e.keys()) (t === n || t.startsWith(`${n}__`)) && e.delete(t);
|
|
590
587
|
}
|
|
591
588
|
}
|
|
592
|
-
function
|
|
589
|
+
function jt(e, t, n, r) {
|
|
593
590
|
let [, i, a, o] = e, s = n;
|
|
594
591
|
return _(i) ? t.key = i : C(i) && Object.keys(i).forEach((e) => {
|
|
595
592
|
r.includes(e) ? s[e] = i[e] : t[e] = i[e];
|
|
596
593
|
}), _(a) ? t.locale = a : C(a) && (s = a), C(o) && (s = o), s;
|
|
597
594
|
}
|
|
598
|
-
function
|
|
595
|
+
function Mt(e, ...t) {
|
|
599
596
|
let { datetimeFormats: n, onWarn: r } = e, { __datetimeFormatters: o } = e;
|
|
600
|
-
return !_(t[0]) && !a(t[0]) && !i(t[0]) ? `` :
|
|
597
|
+
return !_(t[0]) && !a(t[0]) && !i(t[0]) ? `` : Ot(e, Pt(...t), Intl.DateTimeFormat, o, n, `datetime format`);
|
|
601
598
|
}
|
|
602
|
-
const
|
|
599
|
+
const Nt = [
|
|
603
600
|
`localeMatcher`,
|
|
604
601
|
`weekday`,
|
|
605
602
|
`era`,
|
|
@@ -621,7 +618,7 @@ const Mt = [
|
|
|
621
618
|
`hourCycle`,
|
|
622
619
|
`fractionalSecondDigits`
|
|
623
620
|
];
|
|
624
|
-
function
|
|
621
|
+
function Pt(...e) {
|
|
625
622
|
let [t] = e, n = u(), r = u(), o;
|
|
626
623
|
if (_(t)) {
|
|
627
624
|
let e = t.match(/^(\d{4}-\d{2}-\d{2})(?:(T|\s)(.+))?$/);
|
|
@@ -638,7 +635,7 @@ function Nt(...e) {
|
|
|
638
635
|
o = t;
|
|
639
636
|
} else if (i(t)) o = t;
|
|
640
637
|
else throw Error(z.INVALID_ARGUMENT);
|
|
641
|
-
let s =
|
|
638
|
+
let s = jt(e, n, r, Nt);
|
|
642
639
|
return [
|
|
643
640
|
n.key || ``,
|
|
644
641
|
o,
|
|
@@ -646,14 +643,14 @@ function Nt(...e) {
|
|
|
646
643
|
s
|
|
647
644
|
];
|
|
648
645
|
}
|
|
649
|
-
function
|
|
650
|
-
|
|
646
|
+
function Ft(e, t, n) {
|
|
647
|
+
At(e.__datetimeFormatters, t, n);
|
|
651
648
|
}
|
|
652
|
-
function
|
|
649
|
+
function It(e, ...t) {
|
|
653
650
|
let { numberFormats: n, onWarn: r } = e, { __numberFormatters: a } = e;
|
|
654
|
-
return i(t[0]) ?
|
|
651
|
+
return i(t[0]) ? Ot(e, Rt(...t), Intl.NumberFormat, a, n, `number format`) : ``;
|
|
655
652
|
}
|
|
656
|
-
const
|
|
653
|
+
const Lt = [
|
|
657
654
|
`localeMatcher`,
|
|
658
655
|
`style`,
|
|
659
656
|
`currency`,
|
|
@@ -675,10 +672,10 @@ const It = [
|
|
|
675
672
|
`roundingIncrement`,
|
|
676
673
|
`trailingZeroDisplay`
|
|
677
674
|
];
|
|
678
|
-
function
|
|
675
|
+
function Rt(...e) {
|
|
679
676
|
let [t] = e, n = u(), r = u();
|
|
680
677
|
if (!i(t)) throw Error(z.INVALID_ARGUMENT);
|
|
681
|
-
let a = t, o =
|
|
678
|
+
let a = t, o = jt(e, n, r, Lt);
|
|
682
679
|
return [
|
|
683
680
|
n.key || ``,
|
|
684
681
|
a,
|
|
@@ -686,14 +683,14 @@ function Lt(...e) {
|
|
|
686
683
|
o
|
|
687
684
|
];
|
|
688
685
|
}
|
|
689
|
-
function
|
|
690
|
-
|
|
686
|
+
function zt(e, t, n) {
|
|
687
|
+
At(e.__numberFormatters, t, n);
|
|
691
688
|
}
|
|
692
|
-
const
|
|
693
|
-
function
|
|
689
|
+
const Bt = (e) => e, Vt = (e) => ``, Ht = `text`, Ut = (e) => e.length === 0 ? `` : T(e), Wt = w;
|
|
690
|
+
function X(e, t) {
|
|
694
691
|
return e = Math.abs(e), t === 2 ? e === 1 ? 0 : 1 : Math.min(e, 2);
|
|
695
692
|
}
|
|
696
|
-
const
|
|
693
|
+
const Gt = [
|
|
697
694
|
`zero`,
|
|
698
695
|
`one`,
|
|
699
696
|
`two`,
|
|
@@ -701,41 +698,41 @@ const X = [
|
|
|
701
698
|
`many`,
|
|
702
699
|
`other`
|
|
703
700
|
], Z = /* @__PURE__ */ new Map();
|
|
704
|
-
function
|
|
701
|
+
function Kt(e) {
|
|
705
702
|
try {
|
|
706
703
|
if (Intl.PluralRules.supportedLocalesOf(e).length === 0) return null;
|
|
707
704
|
let t = new Intl.PluralRules(e);
|
|
708
705
|
return {
|
|
709
706
|
rules: t,
|
|
710
|
-
categories: t.resolvedOptions().pluralCategories.slice().sort((e, t) =>
|
|
707
|
+
categories: t.resolvedOptions().pluralCategories.slice().sort((e, t) => Gt.indexOf(e) - Gt.indexOf(t))
|
|
711
708
|
};
|
|
712
709
|
} catch {
|
|
713
710
|
return null;
|
|
714
711
|
}
|
|
715
712
|
}
|
|
716
|
-
function
|
|
713
|
+
function qt(e) {
|
|
717
714
|
let t = Z.get(e);
|
|
718
|
-
return t === void 0 && (t =
|
|
715
|
+
return t === void 0 && (t = Kt(e), Z.size >= 1e3 && Z.delete(Z.keys().next().value), Z.set(e, t)), t;
|
|
719
716
|
}
|
|
720
|
-
function
|
|
717
|
+
function Jt(e) {
|
|
721
718
|
return i(e.pluralIndex) ? e.pluralIndex : i(e.named?.count) ? e.named.count : i(e.named?.n) ? e.named.n : -1;
|
|
722
719
|
}
|
|
723
|
-
function
|
|
724
|
-
let t = e.locale, n =
|
|
720
|
+
function Yt(e = {}) {
|
|
721
|
+
let t = e.locale, n = Jt(e), r;
|
|
725
722
|
r = _(t) && e.pluralRules && g(p(e.pluralRules, t)) ? e.pluralRules[t] : _(t) && typeof Intl < `u` && Intl.PluralRules !== void 0 ? (e, n) => {
|
|
726
|
-
let r =
|
|
727
|
-
if (r === null || n > r.categories.length) return
|
|
723
|
+
let r = qt(t);
|
|
724
|
+
if (r === null || n > r.categories.length) return X(e, n);
|
|
728
725
|
let { rules: i, categories: a } = r, o = i.select(Math.abs(e)), s = a.indexOf(o);
|
|
729
726
|
return Math.min(s === -1 ? n - 1 : s, n - 1);
|
|
730
|
-
} :
|
|
731
|
-
let a = r ===
|
|
727
|
+
} : X;
|
|
728
|
+
let a = r === X ? void 0 : X, o = (e) => e[r(n, e.length, a)], s = e.list || [], l = (e) => s[e], d = e.named || u(), f = i(e.pluralIndex), v = (t) => {
|
|
732
729
|
let n = m(t) ? p(d, t) : d[t];
|
|
733
730
|
return f && n == null && (t === `count` || t === `n`) ? e.pluralIndex : n;
|
|
734
731
|
};
|
|
735
732
|
function b(t, n) {
|
|
736
|
-
return (g(e.messages) ? e.messages(t, !!n) : y(e.messages) ? e.messages[t] : !1) || (e.parent ? e.parent.message(t) :
|
|
733
|
+
return (g(e.messages) ? e.messages(t, !!n) : y(e.messages) ? e.messages[t] : !1) || (e.parent ? e.parent.message(t) : Vt);
|
|
737
734
|
}
|
|
738
|
-
let x = (t) => e.modifiers ? p(e.modifiers, t) :
|
|
735
|
+
let x = (t) => e.modifiers ? p(e.modifiers, t) : Bt, S = g(e.processor?.normalize) ? e.processor.normalize : Ut, C = g(e.processor?.interpolate) ? e.processor.interpolate : Wt, w = {
|
|
739
736
|
list: l,
|
|
740
737
|
named: v,
|
|
741
738
|
plural: o,
|
|
@@ -748,7 +745,7 @@ function qt(e = {}) {
|
|
|
748
745
|
return g(l) ? l(c, i) : c;
|
|
749
746
|
},
|
|
750
747
|
message: b,
|
|
751
|
-
type: _(e.processor?.type) ? e.processor.type :
|
|
748
|
+
type: _(e.processor?.type) ? e.processor.type : Ht,
|
|
752
749
|
interpolate: C,
|
|
753
750
|
normalize: S,
|
|
754
751
|
values: c(u(), s, d, f ? {
|
|
@@ -758,41 +755,41 @@ function qt(e = {}) {
|
|
|
758
755
|
};
|
|
759
756
|
return w;
|
|
760
757
|
}
|
|
761
|
-
const
|
|
762
|
-
function
|
|
763
|
-
let [n, r] =
|
|
764
|
-
a &&
|
|
758
|
+
const Xt = () => ``, Q = (e) => g(e), $ = (e) => _(e) || j(e) || Q(e);
|
|
759
|
+
function Zt(e, ...t) {
|
|
760
|
+
let [n, r] = tn(...t), i = B(e, r), a = v(r.escapeParameter) ? r.escapeParameter : e.escapeParameter;
|
|
761
|
+
a && Qt(r);
|
|
765
762
|
let o = !!r.resolvedMessage, [s, c, l] = o ? [
|
|
766
763
|
n,
|
|
767
764
|
i,
|
|
768
765
|
p(e.messages, i) || u()
|
|
769
|
-
] :
|
|
766
|
+
] : $t(e, n, i, e.fallbackLocale, v(r.fallbackWarn) ? r.fallbackWarn : e.fallbackWarn, v(r.missingWarn) ? r.missingWarn : e.missingWarn), d = n;
|
|
770
767
|
if (!o && !$(s)) {
|
|
771
768
|
let t = _(r.default) ? r.default : v(r.default) || e.fallbackFormat ? e.messageCompiler ? n : () => n : null;
|
|
772
769
|
(e.fallbackFormat || t != null && (_(t) || g(t))) && (s = t, d = s);
|
|
773
770
|
}
|
|
774
771
|
if (!o && (!$(s) || !_(c))) return e.unresolving ? -1 : n;
|
|
775
|
-
let f = !1, m = Q(s) ? s :
|
|
772
|
+
let f = !1, m = Q(s) ? s : en(e, n, c, s, d, () => {
|
|
776
773
|
f = !0;
|
|
777
774
|
});
|
|
778
775
|
if (f) return s;
|
|
779
|
-
let h = m(
|
|
776
|
+
let h = m(Yt(rn(e, c, l, r))), y = e.postTranslation ? e.postTranslation(h, n) : h;
|
|
780
777
|
return a && _(y) && (y = ge(y)), y;
|
|
781
778
|
}
|
|
782
|
-
function
|
|
783
|
-
if (h(e.list) && (e.list = e.list.map((e) => _(e) ?
|
|
779
|
+
function Qt(e) {
|
|
780
|
+
if (h(e.list) && (e.list = e.list.map((e) => _(e) ? E(e) : e)), y(e.named)) {
|
|
784
781
|
let t = e.named, n = u();
|
|
785
782
|
for (let e of Object.keys(t)) {
|
|
786
783
|
let r = t[e];
|
|
787
|
-
n[e] = _(r) ?
|
|
784
|
+
n[e] = _(r) ? E(r) : r;
|
|
788
785
|
}
|
|
789
786
|
e.named = n;
|
|
790
787
|
}
|
|
791
788
|
}
|
|
792
|
-
function
|
|
789
|
+
function $t(e, t, n, r, i, a) {
|
|
793
790
|
let { messages: o, onWarn: s, messageResolver: c, localeFallbacker: l } = e, d = l(e, r, n), f = u(), m, h = null;
|
|
794
|
-
for (let n = 0; n < d.length && (m = d[n], f = p(o, m) || u(), (h = c(f, t)) === null && (h = p(f, t)), !$(h)); n++) if (!
|
|
795
|
-
let n =
|
|
791
|
+
for (let n = 0; n < d.length && (m = d[n], f = p(o, m) || u(), (h = c(f, t)) === null && (h = p(f, t)), !$(h)); n++) if (!wt(m, d)) {
|
|
792
|
+
let n = Y(e, t, m, a, `translate`);
|
|
796
793
|
n !== t && (h = n);
|
|
797
794
|
}
|
|
798
795
|
return [
|
|
@@ -801,7 +798,7 @@ function Zt(e, t, n, r, i, a) {
|
|
|
801
798
|
f
|
|
802
799
|
];
|
|
803
800
|
}
|
|
804
|
-
function
|
|
801
|
+
function en(e, t, n, r, i, a) {
|
|
805
802
|
if (Q(r)) {
|
|
806
803
|
let e = r;
|
|
807
804
|
return e.locale = e.locale || n, e.key = e.key || t, e;
|
|
@@ -810,16 +807,16 @@ function Qt(e, t, n, r, i, a) {
|
|
|
810
807
|
let e = (() => r);
|
|
811
808
|
return e.locale = n, e.key = t, e;
|
|
812
809
|
}
|
|
813
|
-
let o = e.messageCompiler(r,
|
|
810
|
+
let o = e.messageCompiler(r, nn(e, n, i, r, e.warnHtmlMessage, a));
|
|
814
811
|
return o.locale = n, o.key = t, o.source = r, o;
|
|
815
812
|
}
|
|
816
|
-
function
|
|
813
|
+
function tn(...e) {
|
|
817
814
|
let [t, n, r] = e;
|
|
818
|
-
if (!_(t) && !i(t) && !Q(t) && !
|
|
815
|
+
if (!_(t) && !i(t) && !Q(t) && !j(t)) throw Error(z.INVALID_ARGUMENT);
|
|
819
816
|
let a = i(t) ? String(t) : (Q(t), t), o = u();
|
|
820
817
|
return i(n) ? o.plural = n : _(n) ? o.default = n : C(n) && !s(n) ? o.named = n : h(n) && (o.list = n), i(r) ? o.plural = r : _(r) ? o.default = r : C(r) && c(o, r), [a, o];
|
|
821
818
|
}
|
|
822
|
-
function
|
|
819
|
+
function nn(e, t, r, i, a, o) {
|
|
823
820
|
return {
|
|
824
821
|
locale: t,
|
|
825
822
|
key: r,
|
|
@@ -830,7 +827,7 @@ function en(e, t, r, i, a, o) {
|
|
|
830
827
|
onCacheKey: (e) => n(t, r, e)
|
|
831
828
|
};
|
|
832
829
|
}
|
|
833
|
-
function
|
|
830
|
+
function rn(e, t, n, r) {
|
|
834
831
|
let { modifiers: a, pluralRules: o, messageResolver: s, fallbackLocale: c, fallbackWarn: l, missingWarn: u, fallbackContext: d } = e;
|
|
835
832
|
return {
|
|
836
833
|
locale: t,
|
|
@@ -839,16 +836,16 @@ function tn(e, t, n, r) {
|
|
|
839
836
|
messages: (r, i) => {
|
|
840
837
|
let a = s(n, r);
|
|
841
838
|
if (a == null && (d || i)) {
|
|
842
|
-
let [n, , i] =
|
|
839
|
+
let [n, , i] = $t(d || e, r, t, c, l, u);
|
|
843
840
|
a = n ?? s(i, r);
|
|
844
841
|
}
|
|
845
|
-
if (_(a) ||
|
|
846
|
-
let n = !1, i =
|
|
842
|
+
if (_(a) || j(a)) {
|
|
843
|
+
let n = !1, i = en(e, r, t, a, r, () => {
|
|
847
844
|
n = !0;
|
|
848
845
|
});
|
|
849
|
-
return n ?
|
|
846
|
+
return n ? Xt : i;
|
|
850
847
|
}
|
|
851
|
-
return Q(a) ? a :
|
|
848
|
+
return Q(a) ? a : Xt;
|
|
852
849
|
},
|
|
853
850
|
processor: e.processor ?? void 0,
|
|
854
851
|
list: r.list ?? void 0,
|
|
@@ -856,4 +853,4 @@ function tn(e, t, n, r) {
|
|
|
856
853
|
pluralIndex: i(r.plural) ? r.plural : void 0
|
|
857
854
|
};
|
|
858
855
|
}
|
|
859
|
-
export {
|
|
856
|
+
export { Ne as AST_NODE_PROPS_KEYS, ze as CORE_ERROR_CODES_EXTEND_POINT, tt as CORE_WARN_CODES_EXTEND_POINT, W as CoreWarnCodes, Nt as DATETIME_FORMAT_OPTIONS_KEYS, G as DEFAULT_LOCALE, Ht as DEFAULT_MESSAGE_DATA_TYPE, ot as MISSING_RESOLVE_VALUE, at as NOT_RESOLVED, Lt as NUMBER_FORMAT_OPTIONS_KEYS, it as VERSION, Le as clearCompileCache, Ft as clearDateTimeFormat, zt as clearNumberFormat, Re as compile, ye as createCompileError, ht as createCoreContext, Be as createCoreError, Yt as createMessageContext, Mt as datetime, He as fallbackWithLocaleChain, Ve as fallbackWithSimple, B as getLocale, gt as getLocaleMessage, rt as getWarnMessage, Y as handleMissing, Ct as isAlmostSameLocale, vt as isFallbackLocale, wt as isImplicitFallback, j as isMessageAST, $ as isMessageFormat, Q as isMessageFunction, yt as isTranslateFallbackWarn, bt as isTranslateMissingWarn, J as isWarnOption, It as number, Ze as parse, Pt as parseDateTimeArgs, Rt as parseNumberArgs, tn as parseTranslateArgs, pt as registerLocaleFallbacker, lt as registerMessageCompiler, dt as registerMessageResolver, H as resolveLocale, et as resolveValue, $e as resolveWithKeyValue, _t as setLocaleMessage, Zt as translate, St as updateFallbackLocale };
|