@intlify/core 12.0.0-alpha.4 → 12.0.0-alpha.6

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.
@@ -1,32 +1,53 @@
1
1
  /**
2
- * @intlify/core v12.0.0-alpha.4
2
+ * @intlify/core v12.0.0-alpha.6
3
3
  * (c) 2016-present kazuya kawaguchi and contributors
4
4
  * @license MIT
5
5
  **/ var IntlifyCore = (function(e) {
6
6
  Object.defineProperty(e, Symbol.toStringTag, { value: `Module` });
7
- function t(e, t) {
8
- typeof console < `u` && (console.warn(`[intlify] ` + e), t && console.warn(t.stack));
9
- }
10
- let n = /\{([0-9a-z]+)\}/gi;
11
- function r(e, ...t) {
12
- return t.length === 1 && D(t[0]) && (t = t[0]), (!t || !t.hasOwnProperty) && (t = {}), e.replace(n, (e, n) => t.hasOwnProperty(n) ? t[n] : ``);
7
+ let t = /\{([0-9a-z]+)\}/gi;
8
+ function n(e, ...n) {
9
+ return n.length === 1 && b(n[0]) && (n = n[0]), (!n || !n.hasOwnProperty) && (n = {}), e.replace(t, (e, t) => n.hasOwnProperty(t) ? n[t] : ``);
13
10
  }
14
- let i = (e, t, n) => a({
11
+ let r = (e, t, n) => i({
15
12
  l: e,
16
13
  k: t,
17
14
  s: n
18
- }), a = (e) => JSON.stringify(e).replace(/\u2028/g, `\\u2028`).replace(/\u2029/g, `\\u2029`).replace(/\u0027/g, `\\u0027`), o = (e) => typeof e == `number` && isFinite(e), s = (e) => A(e) === `[object Date]`, c = (e) => A(e) === `[object RegExp]`, l = (e) => Object.keys(e).length === 0, u = Object.assign, d = Object.create, f = (e = null) => d(e);
19
- function p(e) {
15
+ }), i = (e) => JSON.stringify(e).replace(/\u2028/g, `\\u2028`).replace(/\u2029/g, `\\u2029`).replace(/\u0027/g, `\\u0027`), a = (e) => typeof e == `number` && isFinite(e), o = (e) => C(e) === `[object Date]`, s = (e) => C(e) === `[object RegExp]`, c = (e) => Object.keys(e).length === 0, l = Object.assign, u = Object.create, d = (e = null) => u(e), f = Object.prototype.hasOwnProperty;
16
+ function p(e, t) {
17
+ return f.call(e, t);
18
+ }
19
+ function m(e, t) {
20
+ let n = e[t];
21
+ return p(e, t) ? n : void 0;
22
+ }
23
+ function h(e) {
24
+ return p(Object.prototype, e);
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]`, ee = (e) => e == null ? `` : g(e) || w(e) && e.toString === S ? JSON.stringify(e, null, 2) : String(e);
27
+ function T(e, t = ``) {
28
+ return e.reduce((e, n, r) => r === 0 ? e + n : e + t + n, ``);
29
+ }
30
+ function E(e, t) {
31
+ typeof console < `u` && (console.warn(`[intlify] ` + e), t && console.warn(t.stack));
32
+ }
33
+ function D(e) {
20
34
  return e.replace(/&/g, `&amp;`).replace(/</g, `&lt;`).replace(/>/g, `&gt;`).replace(/"/g, `&quot;`).replace(/'/g, `&apos;`).replace(/\//g, `&#x2F;`).replace(/=/g, `&#x3D;`);
21
35
  }
22
- function m(e) {
36
+ function te(e) {
23
37
  return e.replace(/&(?![a-z0-9#]{2,6};)/gi, `&amp;`).replace(/"/g, `&quot;`).replace(/'/g, `&apos;`).replace(/</g, `&lt;`).replace(/>/g, `&gt;`);
24
38
  }
25
- let h = /^\s*javascript\s*(?::|&#0*58;?|&#x0*3a;?|&colon;?)/i, g = /^(?:href|src|action|formaction)$/i;
26
- function _(e) {
27
- return h.test(e);
39
+ let ne = /^javascript:/i, re = /^(?:href|src|action|formaction)$/i, O = /&#(?:x([0-9a-f]+)|(\d+));?/gi, ie = /&(?:Tab|NewLine);/g, ae = /&colon;?/gi, oe = /[\u0000-\u0020\u007f-\u009f]/g, se = /(?:^|[\s"'<>/])on\w+\s*=\s*["']?[^"'>]+["']?/i, ce = /(^|[\s"'<>/])on(\w+\s*=)/gi, le = /(?:^|[\s"'<>/])srcdoc\s*=/i, ue = /(^|[\s"'<>/])s(rcdoc\s*=)/gi, de = /(^|[\s"'<>/])((?:href|src|action|formaction)\s*=\s*)([^\s"'=<>`]+)/gi;
40
+ function fe(e, t, n) {
41
+ let r = t || n;
42
+ if (!r) return e;
43
+ let i = Number.parseInt(r, t ? 16 : 10);
44
+ return i <= 127 ? String.fromCharCode(i) : e;
28
45
  }
29
- function v(e) {
46
+ function k(e) {
47
+ let t = e.replace(O, fe).replace(ie, ``).replace(ae, `:`).replace(oe, ``);
48
+ return ne.test(t);
49
+ }
50
+ function pe(e) {
30
51
  let t = /url\s*\(/gi, n = ``, r = 0, i;
31
52
  for (; (i = t.exec(e)) !== null;) {
32
53
  let a = i.index, o = t.lastIndex - 1, s = o + 1, c = 1, l = null;
@@ -42,56 +63,55 @@
42
63
  }
43
64
  if (c !== 0) break;
44
65
  let u = e.slice(o + 1, s).trim(), d = u.startsWith(`"`) && u.endsWith(`"`) || u.startsWith(`'`) && u.endsWith(`'`) ? u.slice(1, -1).trim() : u;
45
- n += e.slice(r, a), n += _(d) ? `url(about:blank)` : e.slice(a, s + 1), r = s + 1;
66
+ n += e.slice(r, a), n += k(d) ? `url(about:blank)` : e.slice(a, s + 1), r = s + 1;
46
67
  }
47
68
  return n + e.slice(r);
48
69
  }
49
- function y(e, t) {
50
- return g.test(e) && _(t) ? `about:blank` : m(e.toLowerCase() === `style` ? v(t) : t);
51
- }
52
- function b(e) {
53
- return e = e.replace(/([\w:-]+)\s*=\s*"([^"]*)"/g, (e, t, n) => `${t}="${y(t, n)}"`), e = e.replace(/([\w:-]+)\s*=\s*'([^']*)'/g, (e, t, n) => `${t}='${y(t, n)}'`), /\s*on\w+\s*=\s*["']?[^"'>]+["']?/i.test(e) && (e = e.replace(/(\s+)on(\w+\s*=)/gi, `$1&#111;n$2`)), e = e.replace(/(\s+(?:href|src|action|formaction)\s*=\s*)([^\s"'=<>`]+)/gi, (e, t, n) => _(n) ? `${t}about:blank` : e), e;
70
+ function A(e, t) {
71
+ return re.test(e) && k(t) ? `about:blank` : te(e.toLowerCase() === `style` ? pe(t) : t);
54
72
  }
55
- let x = Object.prototype.hasOwnProperty;
56
- function S(e, t) {
57
- return x.call(e, t);
58
- }
59
- let C = Array.isArray, w = (e) => typeof e == `function`, T = (e) => typeof e == `string`, E = (e) => typeof e == `boolean`, D = (e) => typeof e == `object` && !!e, O = (e) => D(e) && w(e.then) && w(e.catch), k = Object.prototype.toString, A = (e) => k.call(e), j = (e) => A(e) === `[object Object]`, ee = (e) => e == null ? `` : C(e) || j(e) && e.toString === k ? JSON.stringify(e, null, 2) : String(e);
60
- function M(e, t = ``) {
61
- return e.reduce((e, n, r) => r === 0 ? e + n : e + t + n, ``);
73
+ function me(e) {
74
+ return e = e.replace(/([\w:-]+)\s*=\s*"([^"]*)"/g, (e, t, n) => `${t}="${A(t, n)}"`), e = e.replace(/([\w:-]+)\s*=\s*'([^']*)'/g, (e, t, n) => `${t}='${A(t, n)}'`), se.test(e) && (e = e.replace(ce, `$1&#111;n$2`)), le.test(e) && (e = e.replace(ue, `$1&#115;$2`)), e = e.replace(de, (e, t, n, r) => k(r) ? `${t}${n}about:blank` : e), e;
62
75
  }
63
- let N = (e) => !D(e) || C(e);
64
- function te(e, t) {
65
- if (N(e) || N(t)) throw Error(`Invalid value`);
66
- let n = [{
67
- src: e,
68
- des: t
69
- }];
76
+ let j = (e) => !b(e) || g(e);
77
+ function he(e, t) {
78
+ if (j(e) || j(t) || t === Object.prototype) throw Error(`Invalid value`);
79
+ let n = [e, t];
70
80
  for (; n.length;) {
71
- let { src: e, des: t } = n.pop();
72
- Object.keys(e).forEach((r) => {
73
- r !== `__proto__` && (D(e[r]) && !D(t[r]) && (t[r] = Array.isArray(e[r]) ? [] : f()), N(t[r]) || N(e[r]) ? t[r] = e[r] : n.push({
74
- src: e[r],
75
- des: t[r]
76
- }));
77
- });
81
+ let e = n.pop(), t = n.pop(), r = Object.keys(t);
82
+ for (let i = 0; i < r.length; i++) {
83
+ let a = r[i];
84
+ if (a === `__proto__`) continue;
85
+ let o = t[a];
86
+ if (!b(o)) {
87
+ e[a] = o;
88
+ continue;
89
+ }
90
+ if (g(o)) {
91
+ let t = [];
92
+ t.length = o.length, e[a] = t, n.push(o, t);
93
+ continue;
94
+ }
95
+ let s = e[a];
96
+ (!b(s) || g(s)) && (s = e[a] = d()), n.push(o, s);
97
+ }
78
98
  }
79
99
  }
80
- function ne(e, t, n) {
100
+ function ge(e, t, n) {
81
101
  return {
82
102
  line: e,
83
103
  column: t,
84
104
  offset: n
85
105
  };
86
106
  }
87
- function P(e, t, n) {
107
+ function M(e, t, n) {
88
108
  let r = {
89
109
  start: e,
90
110
  end: t
91
111
  };
92
112
  return n != null && (r.source = n), r;
93
113
  }
94
- let F = {
114
+ let N = {
95
115
  EXPECTED_TOKEN: 1,
96
116
  INVALID_TOKEN_IN_PLACEHOLDER: 2,
97
117
  UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER: 3,
@@ -109,30 +129,30 @@
109
129
  UNHANDLED_CODEGEN_NODE_TYPE: 15,
110
130
  UNHANDLED_MINIFIER_NODE_TYPE: 16
111
131
  };
112
- F.EXPECTED_TOKEN, F.INVALID_TOKEN_IN_PLACEHOLDER, F.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER, F.UNKNOWN_ESCAPE_SEQUENCE, F.INVALID_UNICODE_ESCAPE_SEQUENCE, F.UNBALANCED_CLOSING_BRACE, F.UNTERMINATED_CLOSING_BRACE, F.EMPTY_PLACEHOLDER, F.NOT_ALLOW_NEST_PLACEHOLDER, F.INVALID_LINKED_FORMAT, F.MUST_HAVE_MESSAGES_IN_PLURAL, F.UNEXPECTED_EMPTY_LINKED_MODIFIER, F.UNEXPECTED_EMPTY_LINKED_KEY, F.UNEXPECTED_LEXICAL_ANALYSIS, F.UNHANDLED_CODEGEN_NODE_TYPE, F.UNHANDLED_MINIFIER_NODE_TYPE;
113
- function I(e, t, n = {}) {
132
+ N.EXPECTED_TOKEN, N.INVALID_TOKEN_IN_PLACEHOLDER, N.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER, N.UNKNOWN_ESCAPE_SEQUENCE, N.INVALID_UNICODE_ESCAPE_SEQUENCE, N.UNBALANCED_CLOSING_BRACE, N.UNTERMINATED_CLOSING_BRACE, N.EMPTY_PLACEHOLDER, N.NOT_ALLOW_NEST_PLACEHOLDER, N.INVALID_LINKED_FORMAT, N.MUST_HAVE_MESSAGES_IN_PLURAL, N.UNEXPECTED_EMPTY_LINKED_MODIFIER, N.UNEXPECTED_EMPTY_LINKED_KEY, N.UNEXPECTED_LEXICAL_ANALYSIS, N.UNHANDLED_CODEGEN_NODE_TYPE, N.UNHANDLED_MINIFIER_NODE_TYPE;
133
+ function P(e, t, n = {}) {
114
134
  let { domain: r, messages: i, args: a } = n, o = SyntaxError(String(e));
115
135
  return o.code = e, t && (o.location = t), o.domain = r, o;
116
136
  }
117
- function re(e) {
137
+ function _e(e) {
118
138
  throw e;
119
139
  }
120
- function L(e) {
140
+ function F(e) {
121
141
  switch (e.t = e.type, e.type) {
122
142
  case 0: {
123
143
  let t = e;
124
- L(t.body), t.b = t.body, delete t.body;
144
+ F(t.body), t.b = t.body, delete t.body;
125
145
  break;
126
146
  }
127
147
  case 1: {
128
148
  let t = e, n = t.cases;
129
- for (let e = 0; e < n.length; e++) L(n[e]);
149
+ for (let e = 0; e < n.length; e++) F(n[e]);
130
150
  t.c = n, delete t.cases;
131
151
  break;
132
152
  }
133
153
  case 2: {
134
154
  let t = e, n = t.items;
135
- for (let e = 0; e < n.length; e++) L(n[e]);
155
+ for (let e = 0; e < n.length; e++) F(n[e]);
136
156
  t.i = n, delete t.items, t.static && (t.s = t.static, delete t.static);
137
157
  break;
138
158
  }
@@ -146,7 +166,7 @@
146
166
  }
147
167
  case 6: {
148
168
  let t = e;
149
- L(t.key), t.k = t.key, delete t.key, t.modifier && (L(t.modifier), t.m = t.modifier, delete t.modifier);
169
+ F(t.key), t.k = t.key, delete t.key, t.modifier && (F(t.modifier), t.m = t.modifier, delete t.modifier);
150
170
  break;
151
171
  }
152
172
  case 5: {
@@ -159,15 +179,14 @@
159
179
  t.k = t.key, delete t.key;
160
180
  break;
161
181
  }
162
- default:
163
182
  }
164
183
  delete e.type;
165
184
  }
166
- function ie(e) {
185
+ function I(e) {
167
186
  let t = e.body;
168
- return t.type === 2 ? ae(t) : t.cases.forEach((e) => ae(e)), e;
187
+ return t.type === 2 ? L(t) : t.cases.forEach((e) => L(e)), e;
169
188
  }
170
- function ae(e) {
189
+ function L(e) {
171
190
  if (e.items.length === 1) {
172
191
  let t = e.items[0];
173
192
  (t.type === 3 || t.type === 9) && (e.static = t.value, delete t.value);
@@ -175,11 +194,11 @@
175
194
  let t = [];
176
195
  for (let n = 0; n < e.items.length; n++) {
177
196
  let r = e.items[n];
178
- if (!(r.type === 3 || r.type === 9) || r.value == null) break;
197
+ if (r.type !== 3 && r.type !== 9 || r.value == null) break;
179
198
  t.push(r.value);
180
199
  }
181
200
  if (t.length === e.items.length) {
182
- e.static = M(t);
201
+ e.static = T(t);
183
202
  for (let t = 0; t < e.items.length; t++) {
184
203
  let n = e.items[t];
185
204
  (n.type === 3 || n.type === 9) && delete n.value;
@@ -187,7 +206,7 @@
187
206
  }
188
207
  }
189
208
  }
190
- function oe(e) {
209
+ function ve(e) {
191
210
  let t = e, n = 0, r = 1, i = 1, a = 0, o = (e) => t[e] === `\r` && t[e + 1] === `
192
211
  `, s = (e) => t[e] === `
193
212
  `, c = (e) => t[e] === `\u2029`, l = (e) => t[e] === `\u2028`, u = (e) => o(e) || s(e) || c(e) || l(e), d = () => n, f = () => r, p = () => i, m = () => a, h = (e) => o(e) || c(e) || l(e) ? `
@@ -224,8 +243,8 @@
224
243
  skipToPeek: S
225
244
  };
226
245
  }
227
- function se(e, t = {}) {
228
- let n = t.location !== !1, r = oe(e), i = () => r.index(), a = () => ne(r.line(), r.column(), r.index()), o = a(), s = i(), c = {
246
+ function R(e, t = {}) {
247
+ let n = t.location !== !1, r = ve(e), i = () => r.index(), a = () => ge(r.line(), r.column(), r.index()), o = a(), s = i(), c = {
229
248
  currentType: 13,
230
249
  offset: s,
231
250
  startLoc: o,
@@ -240,19 +259,22 @@
240
259
  }, l = () => c, { onError: u } = t;
241
260
  function d(e, t, r, ...i) {
242
261
  let a = l();
243
- t.column += r, t.offset += r, u && u(I(e, n ? P(a.startLoc, t) : null, {
244
- domain: `tokenizer`,
245
- args: i
246
- }));
262
+ if (t.column += r, t.offset += r, u) {
263
+ let r = P(e, n ? M(a.startLoc, t) : null, {
264
+ domain: `tokenizer`,
265
+ args: i
266
+ });
267
+ u(r);
268
+ }
247
269
  }
248
270
  function f(e, t, r) {
249
271
  e.endLoc = a(), e.currentType = t;
250
272
  let i = { type: t };
251
- return n && (i.loc = P(e.startLoc, e.endLoc)), r != null && (i.value = r), i;
273
+ return n && (i.loc = M(e.startLoc, e.endLoc)), r != null && (i.value = r), i;
252
274
  }
253
275
  let p = (e) => f(e, 13);
254
276
  function m(e, t) {
255
- return e.currentChar() === t ? (e.next(), t) : (d(F.EXPECTED_TOKEN, a(), 0, t), ``);
277
+ return e.currentChar() === t ? (e.next(), t) : (d(N.EXPECTED_TOKEN, a(), 0, t), ``);
256
278
  }
257
279
  function h(e) {
258
280
  let t = ``;
@@ -311,74 +333,74 @@
311
333
  }
312
334
  function w(e, t) {
313
335
  let { currentType: n } = t;
314
- if (!(n === 7 || n === 11)) return !1;
336
+ if (n !== 7 && n !== 11) return !1;
315
337
  h(e);
316
338
  let r = e.currentPeek() === `:`;
317
339
  return e.resetPeek(), r;
318
340
  }
319
- function T(e, t) {
341
+ function ee(e, t) {
320
342
  let { currentType: n } = t;
321
343
  if (n !== 9) return !1;
322
344
  let r = () => {
323
345
  let t = e.currentPeek();
324
346
  return t === `{` ? _(e.peek()) : t === `@` || t === `|` || t === `:` || t === `.` || t === ` ` || !t ? !1 : t === `
325
- ` ? (e.peek(), r()) : D(e, !1);
347
+ ` ? (e.peek(), r()) : E(e, !1);
326
348
  }, i = r();
327
349
  return e.resetPeek(), i;
328
350
  }
329
- function E(e) {
351
+ function T(e) {
330
352
  h(e);
331
353
  let t = e.currentPeek() === `|`;
332
354
  return e.resetPeek(), t;
333
355
  }
334
- function D(e, t = !0) {
356
+ function E(e, t = !0) {
335
357
  let n = (t = !1, r = ``) => {
336
358
  let i = e.currentPeek();
337
- return i === `{` || i === `@` || !i ? t : i === `|` ? !(r === ` ` || r === `
338
- `) : i === ` ` ? (e.peek(), n(!0, ` `)) : i === `
339
- ` ? (e.peek(), n(!0, `
340
- `)) : !0;
359
+ return i === `{` || i === `@` || !i ? t : i === `|` ? r !== ` ` && r !== `
360
+ ` : i === ` ` ? (e.peek(), n(!0, ` `)) : i !== `
361
+ ` || (e.peek(), n(!0, `
362
+ `));
341
363
  }, r = n();
342
364
  return t && e.resetPeek(), r;
343
365
  }
344
- function O(e, t) {
366
+ function D(e, t) {
345
367
  let n = e.currentChar();
346
368
  if (n !== void 0) return t(n) ? (e.next(), n) : null;
347
369
  }
348
- function k(e) {
370
+ function te(e) {
349
371
  let t = e.charCodeAt(0);
350
372
  return t >= 97 && t <= 122 || t >= 65 && t <= 90 || t >= 48 && t <= 57 || t === 95 || t === 36;
351
373
  }
352
- function A(e) {
353
- return O(e, k);
374
+ function ne(e) {
375
+ return D(e, te);
354
376
  }
355
- function j(e) {
377
+ function re(e) {
356
378
  let t = e.charCodeAt(0);
357
379
  return t >= 97 && t <= 122 || t >= 65 && t <= 90 || t >= 48 && t <= 57 || t === 95 || t === 36 || t === 45;
358
380
  }
359
- function ee(e) {
360
- return O(e, j);
381
+ function O(e) {
382
+ return D(e, re);
361
383
  }
362
- function M(e) {
384
+ function ie(e) {
363
385
  let t = e.charCodeAt(0);
364
386
  return t >= 48 && t <= 57;
365
387
  }
366
- function N(e) {
367
- return O(e, M);
388
+ function ae(e) {
389
+ return D(e, ie);
368
390
  }
369
- function te(e) {
391
+ function oe(e) {
370
392
  let t = e.charCodeAt(0);
371
393
  return t >= 48 && t <= 57 || t >= 65 && t <= 70 || t >= 97 && t <= 102;
372
394
  }
373
- function re(e) {
374
- return O(e, te);
395
+ function se(e) {
396
+ return D(e, oe);
375
397
  }
376
- function L(e) {
398
+ function ce(e) {
377
399
  let t = ``, n = ``;
378
- for (; t = N(e);) n += t;
400
+ for (; t = ae(e);) n += t;
379
401
  return n;
380
402
  }
381
- function ie(e) {
403
+ function le(e) {
382
404
  let t = ``;
383
405
  for (;;) {
384
406
  let n = e.currentChar();
@@ -387,153 +409,153 @@
387
409
  r === `{` || r === `}` || r === `@` || r === `|` || r === `\\` ? (t += n + r, e.next(), e.next()) : (e.resetPeek(), t += n, e.next());
388
410
  } else if (n === `{` || n === `}` || n === `@` || n === `|` || !n) break;
389
411
  else if (n === ` ` || n === `
390
- `) if (D(e)) t += n, e.next();
391
- else if (E(e)) break;
392
- else t += n, e.next();
393
- else t += n, e.next();
412
+ `) {
413
+ if (E(e)) t += n, e.next();
414
+ else if (T(e)) break;
415
+ else t += n, e.next();
416
+ } else t += n, e.next();
394
417
  }
395
418
  return t;
396
419
  }
397
- function ae(e) {
420
+ function ue(e) {
398
421
  g(e);
399
422
  let t = ``, n = ``;
400
- for (; t = ee(e);) n += t;
423
+ for (; t = O(e);) n += t;
401
424
  let r = e.currentChar();
402
425
  if (r && r !== `}` && r !== void 0 && r !== ` ` && r !== `
403
426
  ` && r !== ` `) {
404
- let t = R(e);
405
- return d(F.INVALID_TOKEN_IN_PLACEHOLDER, a(), 0, n + t), n + t;
427
+ let t = j(e);
428
+ return d(N.INVALID_TOKEN_IN_PLACEHOLDER, a(), 0, n + t), n + t;
406
429
  }
407
- return e.currentChar() === void 0 && d(F.UNTERMINATED_CLOSING_BRACE, a(), 0), n;
430
+ return e.currentChar() === void 0 && d(N.UNTERMINATED_CLOSING_BRACE, a(), 0), n;
408
431
  }
409
- function se(e) {
432
+ function de(e) {
410
433
  g(e);
411
434
  let t = ``;
412
- return e.currentChar() === `-` ? (e.next(), t += `-${L(e)}`) : t += L(e), e.currentChar() === void 0 && d(F.UNTERMINATED_CLOSING_BRACE, a(), 0), t;
435
+ return e.currentChar() === `-` ? (e.next(), t += `-${ce(e)}`) : t += ce(e), e.currentChar() === void 0 && d(N.UNTERMINATED_CLOSING_BRACE, a(), 0), t;
413
436
  }
414
- function ce(e) {
437
+ function fe(e) {
415
438
  return e !== `'` && e !== `
416
439
  `;
417
440
  }
418
- function le(e) {
441
+ function k(e) {
419
442
  g(e), m(e, `'`);
420
443
  let t = ``, n = ``;
421
- for (; t = O(e, ce);) t === `\\` ? n += ue(e) : n += t;
444
+ for (; t = D(e, fe);) n += t === `\\` ? pe(e) : t;
422
445
  let r = e.currentChar();
423
446
  return r === `
424
- ` || r === void 0 ? (d(F.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER, a(), 0), r === `
447
+ ` || r === void 0 ? (d(N.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER, a(), 0), r === `
425
448
  ` && (e.next(), m(e, `'`)), n) : (m(e, `'`), n);
426
449
  }
427
- function ue(e) {
450
+ function pe(e) {
428
451
  let t = e.currentChar();
429
452
  switch (t) {
430
453
  case `\\`:
431
454
  case `'`: return e.next(), `\\${t}`;
432
- case `u`: return de(e, t, 4);
433
- case `U`: return de(e, t, 6);
434
- default: return d(F.UNKNOWN_ESCAPE_SEQUENCE, a(), 0, t), ``;
455
+ case `u`: return A(e, t, 4);
456
+ case `U`: return A(e, t, 6);
457
+ default: return d(N.UNKNOWN_ESCAPE_SEQUENCE, a(), 0, t), ``;
435
458
  }
436
459
  }
437
- function de(e, t, n) {
460
+ function A(e, t, n) {
438
461
  m(e, t);
439
462
  let r = ``;
440
463
  for (let i = 0; i < n; i++) {
441
- let n = re(e);
464
+ let n = se(e);
442
465
  if (!n) {
443
- d(F.INVALID_UNICODE_ESCAPE_SEQUENCE, a(), 0, `\\${t}${r}${e.currentChar()}`);
466
+ d(N.INVALID_UNICODE_ESCAPE_SEQUENCE, a(), 0, `\\${t}${r}${e.currentChar()}`);
444
467
  break;
445
468
  }
446
469
  r += n;
447
470
  }
448
471
  return `\\${t}${r}`;
449
472
  }
450
- function fe(e) {
473
+ function me(e) {
451
474
  return e !== `{` && e !== `}` && e !== ` ` && e !== `
452
475
  `;
453
476
  }
454
- function R(e) {
477
+ function j(e) {
455
478
  g(e);
456
479
  let t = ``, n = ``;
457
- for (; t = O(e, fe);) n += t;
480
+ for (; t = D(e, me);) n += t;
458
481
  return n;
459
482
  }
460
- function z(e) {
483
+ function he(e) {
461
484
  let t = ``, n = ``;
462
- for (; t = A(e);) n += t;
485
+ for (; t = ne(e);) n += t;
463
486
  return n;
464
487
  }
465
- function pe(e) {
488
+ function _e(e) {
466
489
  let t = (n) => {
467
490
  let r = e.currentChar();
468
491
  return r === `{` || r === `@` || r === `|` || r === `(` || r === `)` || !r || r === ` ` ? n : (n += r, e.next(), t(n));
469
492
  };
470
493
  return t(``);
471
494
  }
472
- function B(e) {
495
+ function F(e) {
473
496
  g(e);
474
497
  let t = m(e, `|`);
475
498
  return g(e), t;
476
499
  }
477
- function V(e, t) {
500
+ function I(e, t) {
478
501
  let n = null;
479
502
  switch (e.currentChar()) {
480
- case `{`: return t.braceNest >= 1 && d(F.NOT_ALLOW_NEST_PLACEHOLDER, a(), 0), e.next(), n = f(t, 2, `{`), g(e), t.braceNest++, n;
481
- case `}`: return t.braceNest > 0 && t.currentType === 2 && d(F.EMPTY_PLACEHOLDER, a(), 0), e.next(), n = f(t, 3, `}`), t.braceNest--, t.braceNest > 0 && g(e), t.inLinked && t.braceNest === 0 && (t.inLinked = !1), n;
482
- case `@`: return t.braceNest > 0 && d(F.UNTERMINATED_CLOSING_BRACE, a(), 0), n = H(e, t) || p(t), t.braceNest = 0, n;
503
+ case `{`: return t.braceNest >= 1 && d(N.NOT_ALLOW_NEST_PLACEHOLDER, a(), 0), e.next(), n = f(t, 2, `{`), g(e), t.braceNest++, n;
504
+ case `}`: return t.braceNest > 0 && t.currentType === 2 && d(N.EMPTY_PLACEHOLDER, a(), 0), e.next(), n = f(t, 3, `}`), t.braceNest--, t.braceNest > 0 && g(e), t.inLinked && t.braceNest === 0 && (t.inLinked = !1), n;
505
+ case `@`: return t.braceNest > 0 && d(N.UNTERMINATED_CLOSING_BRACE, a(), 0), n = L(e, t) || p(t), t.braceNest = 0, n;
483
506
  default: {
484
507
  let r = !0, i = !0, o = !0;
485
- if (E(e)) return t.braceNest > 0 && d(F.UNTERMINATED_CLOSING_BRACE, a(), 0), n = f(t, 1, B(e)), t.braceNest = 0, t.inLinked = !1, n;
486
- if (t.braceNest > 0 && (t.currentType === 4 || t.currentType === 5 || t.currentType === 6)) return d(F.UNTERMINATED_CLOSING_BRACE, a(), 0), t.braceNest = 0, U(e, t);
487
- if (r = y(e, t)) return n = f(t, 4, ae(e)), g(e), n;
488
- if (i = b(e, t)) return n = f(t, 5, se(e)), g(e), n;
489
- if (o = x(e, t)) return n = f(t, 6, le(e)), g(e), n;
490
- if (!r && !i && !o) return n = f(t, 12, R(e)), d(F.INVALID_TOKEN_IN_PLACEHOLDER, a(), 0, n.value), g(e), n;
508
+ if (T(e)) return t.braceNest > 0 && d(N.UNTERMINATED_CLOSING_BRACE, a(), 0), n = f(t, 1, F(e)), t.braceNest = 0, t.inLinked = !1, n;
509
+ if (t.braceNest > 0 && (t.currentType === 4 || t.currentType === 5 || t.currentType === 6)) return d(N.UNTERMINATED_CLOSING_BRACE, a(), 0), t.braceNest = 0, R(e, t);
510
+ if (r = y(e, t)) return n = f(t, 4, ue(e)), g(e), n;
511
+ if (i = b(e, t)) return n = f(t, 5, de(e)), g(e), n;
512
+ if (o = x(e, t)) return n = f(t, 6, k(e)), g(e), n;
513
+ if (!r && !i && !o) return n = f(t, 12, j(e)), d(N.INVALID_TOKEN_IN_PLACEHOLDER, a(), 0, n.value), g(e), n;
491
514
  break;
492
515
  }
493
516
  }
494
517
  return n;
495
518
  }
496
- function H(e, t) {
519
+ function L(e, t) {
497
520
  let { currentType: n } = t, r = null, i = e.currentChar();
498
521
  switch ((n === 7 || n === 8 || n === 11 || n === 9) && (i === `
499
- ` || i === ` `) && d(F.INVALID_LINKED_FORMAT, a(), 0), i) {
522
+ ` || i === ` `) && d(N.INVALID_LINKED_FORMAT, a(), 0), i) {
500
523
  case `@`: return e.next(), r = f(t, 7, `@`), t.inLinked = !0, r;
501
524
  case `.`: return g(e), e.next(), f(t, 8, `.`);
502
525
  case `:`: return g(e), e.next(), f(t, 9, `:`);
503
- default: return E(e) ? (r = f(t, 1, B(e)), t.braceNest = 0, t.inLinked = !1, r) : S(e, t) || w(e, t) ? (g(e), H(e, t)) : C(e, t) ? (g(e), f(t, 11, z(e))) : T(e, t) ? (g(e), i === `{` ? V(e, t) || r : f(t, 10, pe(e))) : (n === 7 && d(F.INVALID_LINKED_FORMAT, a(), 0), t.braceNest = 0, t.inLinked = !1, U(e, t));
526
+ default: return T(e) ? (r = f(t, 1, F(e)), t.braceNest = 0, t.inLinked = !1, r) : S(e, t) || w(e, t) ? (g(e), L(e, t)) : C(e, t) ? (g(e), f(t, 11, he(e))) : ee(e, t) ? (g(e), i === `{` ? I(e, t) || r : f(t, 10, _e(e))) : (n === 7 && d(N.INVALID_LINKED_FORMAT, a(), 0), t.braceNest = 0, t.inLinked = !1, R(e, t));
504
527
  }
505
528
  }
506
- function U(e, t) {
529
+ function R(e, t) {
507
530
  let n = { type: 13 };
508
- if (t.braceNest > 0) return V(e, t) || p(t);
509
- if (t.inLinked) return H(e, t) || p(t);
531
+ if (t.braceNest > 0) return I(e, t) || p(t);
532
+ if (t.inLinked) return L(e, t) || p(t);
510
533
  switch (e.currentChar()) {
511
- case `{`: return V(e, t) || p(t);
512
- case `}`: return d(F.UNBALANCED_CLOSING_BRACE, a(), 0), e.next(), f(t, 3, `}`);
513
- case `@`: return H(e, t) || p(t);
534
+ case `{`: return I(e, t) || p(t);
535
+ case `}`: return d(N.UNBALANCED_CLOSING_BRACE, a(), 0), e.next(), f(t, 3, `}`);
536
+ case `@`: return L(e, t) || p(t);
514
537
  default:
515
- if (E(e)) return n = f(t, 1, B(e)), t.braceNest = 0, t.inLinked = !1, n;
516
- if (D(e)) return f(t, 0, ie(e));
517
- break;
538
+ if (T(e)) return n = f(t, 1, F(e)), t.braceNest = 0, t.inLinked = !1, n;
539
+ if (E(e)) return f(t, 0, le(e));
518
540
  }
519
541
  return n;
520
542
  }
521
- function me() {
543
+ function ye() {
522
544
  let { currentType: e, offset: t, startLoc: n, endLoc: o } = c;
523
- return c.lastType = e, c.lastOffset = t, c.lastStartLoc = n, c.lastEndLoc = o, c.offset = i(), c.startLoc = a(), r.currentChar() === void 0 ? f(c, 13) : U(r, c);
545
+ return c.lastType = e, c.lastOffset = t, c.lastStartLoc = n, c.lastEndLoc = o, c.offset = i(), c.startLoc = a(), r.currentChar() === void 0 ? f(c, 13) : R(r, c);
524
546
  }
525
547
  return {
526
- nextToken: me,
548
+ nextToken: ye,
527
549
  currentOffset: i,
528
550
  currentPosition: a,
529
551
  context: l
530
552
  };
531
553
  }
532
- let ce = /\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6})/g, le = /\\([\\@{}|])/g;
533
- function ue(e, t) {
554
+ let ye = /\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6})/g, be = /\\([\\@{}|])/g;
555
+ function xe(e, t) {
534
556
  return t;
535
557
  }
536
- function de(e, t, n) {
558
+ function Se(e, t, n) {
537
559
  switch (e) {
538
560
  case `\\\\`: return `\\`;
539
561
  case `\\'`: return `'`;
@@ -543,14 +565,17 @@
543
565
  }
544
566
  }
545
567
  }
546
- function fe(e = {}) {
568
+ function Ce(e = {}) {
547
569
  let t = e.location !== !1, { onError: n } = e;
548
570
  function r(e, r, i, a, ...o) {
549
571
  let s = e.currentPosition();
550
- s.offset += a, s.column += a, n && n(I(r, t ? P(i, s) : null, {
551
- domain: `parser`,
552
- args: o
553
- }));
572
+ if (s.offset += a, s.column += a, n) {
573
+ let e = P(r, t ? M(i, s) : null, {
574
+ domain: `parser`,
575
+ args: o
576
+ });
577
+ n(e);
578
+ }
554
579
  }
555
580
  function i(e, n, r) {
556
581
  let i = { type: e };
@@ -564,7 +589,7 @@
564
589
  }
565
590
  function o(e, t) {
566
591
  let n = e.context(), r = i(3, n.offset, n.startLoc);
567
- return r.value = t.replace(le, ue), a(r, e.currentOffset(), e.currentPosition()), r;
592
+ return r.value = t.replace(be, xe), a(r, e.currentOffset(), e.currentPosition()), r;
568
593
  }
569
594
  function s(e, t) {
570
595
  let { lastOffset: n, lastStartLoc: r } = e.context(), o = i(5, n, r);
@@ -574,13 +599,13 @@
574
599
  let { lastOffset: n, lastStartLoc: r } = e.context(), o = i(4, n, r);
575
600
  return o.key = t, e.nextToken(), a(o, e.currentOffset(), e.currentPosition()), o;
576
601
  }
577
- function l(e, t) {
602
+ function u(e, t) {
578
603
  let { lastOffset: n, lastStartLoc: r } = e.context(), o = i(9, n, r);
579
- return o.value = t.replace(ce, de), e.nextToken(), a(o, e.currentOffset(), e.currentPosition()), o;
604
+ return o.value = t.replace(ye, Se), e.nextToken(), a(o, e.currentOffset(), e.currentPosition()), o;
580
605
  }
581
606
  function d(e) {
582
607
  let t = e.nextToken(), n = e.context(), { lastOffset: o, lastStartLoc: s } = n, c = i(8, o, s);
583
- return t.type === 11 ? (t.value == null && r(e, F.UNEXPECTED_LEXICAL_ANALYSIS, n.lastStartLoc, 0, R(t)), c.value = t.value || ``, a(c, e.currentOffset(), e.currentPosition()), { node: c }) : (r(e, F.UNEXPECTED_EMPTY_LINKED_MODIFIER, n.lastStartLoc, 0), c.value = ``, a(c, o, s), {
608
+ return t.type === 11 ? (t.value == null && r(e, N.UNEXPECTED_LEXICAL_ANALYSIS, n.lastStartLoc, 0, z(t)), c.value = t.value || ``, a(c, e.currentOffset(), e.currentPosition()), { node: c }) : (r(e, N.UNEXPECTED_EMPTY_LINKED_MODIFIER, n.lastStartLoc, 0), c.value = ``, a(c, o, s), {
584
609
  nextConsumeToken: t,
585
610
  node: c
586
611
  });
@@ -595,21 +620,21 @@
595
620
  let t = d(e);
596
621
  n.modifier = t.node, o = t.nextConsumeToken || e.nextToken();
597
622
  }
598
- switch (o.type !== 9 && r(e, F.UNEXPECTED_LEXICAL_ANALYSIS, t.lastStartLoc, 0, R(o)), o = e.nextToken(), o.type === 2 && (o = e.nextToken()), o.type) {
623
+ switch (o.type !== 9 && r(e, N.UNEXPECTED_LEXICAL_ANALYSIS, t.lastStartLoc, 0, z(o)), o = e.nextToken(), o.type === 2 && (o = e.nextToken()), o.type) {
599
624
  case 10:
600
- o.value == null && r(e, F.UNEXPECTED_LEXICAL_ANALYSIS, t.lastStartLoc, 0, R(o)), n.key = f(e, o.value || ``);
625
+ o.value == null && r(e, N.UNEXPECTED_LEXICAL_ANALYSIS, t.lastStartLoc, 0, z(o)), n.key = f(e, o.value || ``);
601
626
  break;
602
627
  case 4:
603
- o.value == null && r(e, F.UNEXPECTED_LEXICAL_ANALYSIS, t.lastStartLoc, 0, R(o)), n.key = c(e, o.value || ``);
628
+ o.value == null && r(e, N.UNEXPECTED_LEXICAL_ANALYSIS, t.lastStartLoc, 0, z(o)), n.key = c(e, o.value || ``);
604
629
  break;
605
630
  case 5:
606
- o.value == null && r(e, F.UNEXPECTED_LEXICAL_ANALYSIS, t.lastStartLoc, 0, R(o)), n.key = s(e, o.value || ``);
631
+ o.value == null && r(e, N.UNEXPECTED_LEXICAL_ANALYSIS, t.lastStartLoc, 0, z(o)), n.key = s(e, o.value || ``);
607
632
  break;
608
633
  case 6:
609
- o.value == null && r(e, F.UNEXPECTED_LEXICAL_ANALYSIS, t.lastStartLoc, 0, R(o)), n.key = l(e, o.value || ``);
634
+ o.value == null && r(e, N.UNEXPECTED_LEXICAL_ANALYSIS, t.lastStartLoc, 0, z(o)), n.key = u(e, o.value || ``);
610
635
  break;
611
636
  default: {
612
- r(e, F.UNEXPECTED_EMPTY_LINKED_KEY, t.lastStartLoc, 0);
637
+ r(e, N.UNEXPECTED_EMPTY_LINKED_KEY, t.lastStartLoc, 0);
613
638
  let s = e.context(), c = i(7, s.offset, s.startLoc);
614
639
  return c.value = ``, a(c, s.offset, s.startLoc), n.key = c, a(n, s.offset, s.startLoc), {
615
640
  nextConsumeToken: o,
@@ -622,25 +647,25 @@
622
647
  function m(e) {
623
648
  let t = e.context(), n = i(2, t.currentType === 1 ? e.currentOffset() : t.offset, t.currentType === 1 ? t.endLoc : t.startLoc);
624
649
  n.items = [];
625
- let u = null;
650
+ let l = null;
626
651
  do {
627
- let i = u || e.nextToken();
628
- switch (u = null, i.type) {
652
+ let i = l || e.nextToken();
653
+ switch (l = null, i.type) {
629
654
  case 0:
630
- i.value == null && r(e, F.UNEXPECTED_LEXICAL_ANALYSIS, t.lastStartLoc, 0, R(i)), n.items.push(o(e, i.value || ``));
655
+ i.value == null && r(e, N.UNEXPECTED_LEXICAL_ANALYSIS, t.lastStartLoc, 0, z(i)), n.items.push(o(e, i.value || ``));
631
656
  break;
632
657
  case 5:
633
- i.value == null && r(e, F.UNEXPECTED_LEXICAL_ANALYSIS, t.lastStartLoc, 0, R(i)), n.items.push(s(e, i.value || ``));
658
+ i.value == null && r(e, N.UNEXPECTED_LEXICAL_ANALYSIS, t.lastStartLoc, 0, z(i)), n.items.push(s(e, i.value || ``));
634
659
  break;
635
660
  case 4:
636
- i.value == null && r(e, F.UNEXPECTED_LEXICAL_ANALYSIS, t.lastStartLoc, 0, R(i)), n.items.push(c(e, i.value || ``));
661
+ i.value == null && r(e, N.UNEXPECTED_LEXICAL_ANALYSIS, t.lastStartLoc, 0, z(i)), n.items.push(c(e, i.value || ``));
637
662
  break;
638
663
  case 6:
639
- i.value == null && r(e, F.UNEXPECTED_LEXICAL_ANALYSIS, t.lastStartLoc, 0, R(i)), n.items.push(l(e, i.value || ``));
664
+ i.value == null && r(e, N.UNEXPECTED_LEXICAL_ANALYSIS, t.lastStartLoc, 0, z(i)), n.items.push(u(e, i.value || ``));
640
665
  break;
641
666
  case 7: {
642
667
  let t = p(e);
643
- n.items.push(t.node), u = t.nextConsumeToken || null;
668
+ n.items.push(t.node), l = t.nextConsumeToken || null;
644
669
  break;
645
670
  }
646
671
  }
@@ -654,275 +679,276 @@
654
679
  let t = m(e);
655
680
  c || (c = t.items.length === 0), l.cases.push(t);
656
681
  } while (s.currentType !== 13);
657
- return c && r(e, F.MUST_HAVE_MESSAGES_IN_PLURAL, n, 0), a(l, e.currentOffset(), e.currentPosition()), l;
682
+ return c && r(e, N.MUST_HAVE_MESSAGES_IN_PLURAL, n, 0), a(l, e.currentOffset(), e.currentPosition()), l;
658
683
  }
659
684
  function g(e) {
660
685
  let t = e.context(), { offset: n, startLoc: r } = t, i = m(e);
661
686
  return t.currentType === 13 ? i : h(e, n, r, i);
662
687
  }
663
688
  function _(n) {
664
- let o = se(n, u({}, e)), s = o.context(), c = i(0, s.offset, s.startLoc);
665
- return t && c.loc && (c.loc.source = n), c.body = g(o), e.onCacheKey && (c.cacheKey = e.onCacheKey(n)), s.currentType !== 13 && r(o, F.UNEXPECTED_LEXICAL_ANALYSIS, s.lastStartLoc, 0, n[s.offset] || ``), a(c, o.currentOffset(), o.currentPosition()), c;
689
+ let o = R(n, l({}, e)), s = o.context(), c = i(0, s.offset, s.startLoc);
690
+ return t && c.loc && (c.loc.source = n), c.body = g(o), e.onCacheKey && (c.cacheKey = e.onCacheKey(n)), s.currentType !== 13 && r(o, N.UNEXPECTED_LEXICAL_ANALYSIS, s.lastStartLoc, 0, n[s.offset] || ``), a(c, o.currentOffset(), o.currentPosition()), c;
666
691
  }
667
692
  return { parse: _ };
668
693
  }
669
- function R(e) {
694
+ function z(e) {
670
695
  if (e.type === 13) return `EOF`;
671
696
  let t = (e.value || ``).replace(/\r?\n/gu, `\\n`);
672
697
  return t.length > 10 ? t.slice(0, 9) + `…` : t;
673
698
  }
674
- function z(e) {
675
- return D(e) && ve(e) === 0 && (S(e, `b`) || S(e, `body`));
676
- }
677
- let pe = [`b`, `body`];
678
699
  function B(e) {
679
- return G(e, pe);
700
+ return b(e) && Ne(e) === 0 && (p(e, `b`) || p(e, `body`));
701
+ }
702
+ let we = [`b`, `body`];
703
+ function Te(e) {
704
+ return H(e, we);
680
705
  }
681
- let V = [`c`, `cases`];
682
- function H(e) {
683
- return G(e, V, []);
706
+ let Ee = [`c`, `cases`];
707
+ function De(e) {
708
+ return H(e, Ee, []);
684
709
  }
685
- let U = [`s`, `static`];
686
- function me(e) {
687
- return G(e, U);
710
+ let Oe = [`s`, `static`];
711
+ function ke(e) {
712
+ return H(e, Oe);
688
713
  }
689
- let he = [`i`, `items`];
690
- function ge(e) {
691
- return G(e, he, []);
714
+ let Ae = [`i`, `items`];
715
+ function je(e) {
716
+ return H(e, Ae, []);
692
717
  }
693
- let _e = [`t`, `type`];
694
- function ve(e) {
695
- return G(e, _e);
718
+ let Me = [`t`, `type`];
719
+ function Ne(e) {
720
+ return H(e, Me);
696
721
  }
697
- let ye = [`v`, `value`];
698
- function W(e, t) {
699
- let n = G(e, ye);
722
+ let Pe = [`v`, `value`];
723
+ function V(e, t) {
724
+ let n = H(e, Pe);
700
725
  if (n != null) return n;
701
- throw K(t);
726
+ throw U(t);
702
727
  }
703
- let be = [`m`, `modifier`];
704
- function xe(e) {
705
- return G(e, be);
728
+ let Fe = [`m`, `modifier`];
729
+ function Ie(e) {
730
+ return H(e, Fe);
706
731
  }
707
- let Se = [`k`, `key`];
708
- function Ce(e) {
709
- let t = G(e, Se);
732
+ let Le = [`k`, `key`];
733
+ function Re(e) {
734
+ let t = H(e, Le);
710
735
  if (t) return t;
711
- throw K(6);
736
+ throw U(6);
712
737
  }
713
- function G(e, t, n) {
738
+ function H(e, t, n) {
714
739
  for (let n = 0; n < t.length; n++) {
715
740
  let r = t[n];
716
- if (S(e, r) && e[r] != null) return e[r];
741
+ if (p(e, r) && e[r] != null) return e[r];
717
742
  }
718
743
  return n;
719
744
  }
720
- let we = [
721
- ...pe,
722
- ...V,
723
- ...U,
724
- ...he,
725
- ...Se,
726
- ...be,
727
- ...ye,
728
- ..._e
745
+ let ze = [
746
+ ...we,
747
+ ...Ee,
748
+ ...Oe,
749
+ ...Ae,
750
+ ...Le,
751
+ ...Fe,
752
+ ...Pe,
753
+ ...Me
729
754
  ];
730
- function K(e) {
755
+ function U(e) {
731
756
  return Error(`unhandled node type: ${e}`);
732
757
  }
733
- function Te(e) {
734
- return (t) => Ee(t, e);
735
- }
736
- function Ee(e, t) {
737
- let n = B(t);
738
- if (n == null) throw K(0);
739
- if (ve(n) === 1) {
740
- let t = H(n);
741
- return e.plural(t.reduce((t, n) => [...C(t) ? t : [t], De(e, n)], []));
742
- } else return De(e, n);
743
- }
744
- function De(e, t) {
745
- let n = me(t);
758
+ function Be(e) {
759
+ return (t) => Ve(t, e);
760
+ }
761
+ function Ve(e, t) {
762
+ let n = Te(t);
763
+ if (n == null) throw U(0);
764
+ if (Ne(n) === 1) {
765
+ let t = De(n);
766
+ return e.plural(t.reduce((t, n) => [...g(t) ? t : [t], He(e, n)], []));
767
+ }
768
+ return He(e, n);
769
+ }
770
+ function He(e, t) {
771
+ let n = ke(t);
746
772
  if (n != null) return e.type === `text` ? n : e.normalize([n]);
747
773
  {
748
- let n = ge(t).reduce((t, n) => [...t, Oe(e, n)], []);
774
+ let n = je(t).reduce((t, n) => [...t, Ue(e, n)], []);
749
775
  return e.normalize(n);
750
776
  }
751
777
  }
752
- function Oe(e, t) {
753
- let n = ve(t);
778
+ function Ue(e, t) {
779
+ let n = Ne(t);
754
780
  switch (n) {
755
- case 3: return W(t, n);
756
- case 9: return W(t, n);
781
+ case 3: return V(t, n);
782
+ case 9: return V(t, n);
757
783
  case 4: {
758
784
  let r = t;
759
- if (S(r, `k`) && r.k) return e.interpolate(e.named(r.k));
760
- if (S(r, `key`) && r.key) return e.interpolate(e.named(r.key));
761
- throw K(n);
785
+ if (p(r, `k`) && r.k) return e.interpolate(e.named(r.k));
786
+ if (p(r, `key`) && r.key) return e.interpolate(e.named(r.key));
787
+ throw U(n);
762
788
  }
763
789
  case 5: {
764
790
  let r = t;
765
- if (S(r, `i`) && o(r.i)) return e.interpolate(e.list(r.i));
766
- if (S(r, `index`) && o(r.index)) return e.interpolate(e.list(r.index));
767
- throw K(n);
791
+ if (p(r, `i`) && a(r.i)) return e.interpolate(e.list(r.i));
792
+ if (p(r, `index`) && a(r.index)) return e.interpolate(e.list(r.index));
793
+ throw U(n);
768
794
  }
769
795
  case 6: {
770
- let n = t, r = xe(n), i = Ce(n);
771
- return e.linked(Oe(e, i), r ? Oe(e, r) : void 0, e.type);
796
+ let n = t, r = Ie(n), i = Re(n);
797
+ return e.linked(Ue(e, i), r ? Ue(e, r) : void 0, e.type);
772
798
  }
773
- case 7: return W(t, n);
774
- case 8: return W(t, n);
799
+ case 7: return V(t, n);
800
+ case 8: return V(t, n);
775
801
  default: throw Error(`unhandled node on format message part: ${n}`);
776
802
  }
777
803
  }
778
- let ke = (e) => e, q = f();
779
- function Ae() {
780
- q = f();
804
+ let We = (e) => e, W = d();
805
+ function Ge() {
806
+ W = d();
781
807
  }
782
- function je(e, t = {}) {
783
- let n = !1, r = t.onError || re;
808
+ function Ke(e, t = {}) {
809
+ let n = !1, r = t.onError || _e;
784
810
  t.onError = (e) => {
785
811
  n = !0, r(e);
786
812
  };
787
- let i = fe(t).parse(e);
788
- return t.optimize && ie(i), t.mangle && L(i), {
813
+ let i = Ce(t).parse(e);
814
+ return t.optimize && I(i), t.mangle && F(i), {
789
815
  ast: i,
790
816
  detectError: n,
791
817
  code: ``
792
818
  };
793
819
  }
794
- function Me(e, t) {
795
- if (T(e)) {
796
- E(t.warnHtmlMessage) && t.warnHtmlMessage;
797
- let n = (t.onCacheKey || ke)(e), r = q[n];
820
+ function qe(e, t) {
821
+ if (v(e)) {
822
+ y(t.warnHtmlMessage) && t.warnHtmlMessage;
823
+ let n = (t.onCacheKey || We)(e), r = W[n];
798
824
  if (r) return r;
799
- let { ast: i, detectError: a } = je(e, {
825
+ let { ast: i, detectError: a } = Ke(e, {
800
826
  ...t,
801
827
  location: !1,
802
828
  mangle: !0,
803
829
  optimize: !0
804
- }), o = Te(i);
805
- return a ? o : q[n] = o;
806
- } else {
830
+ }), o = Be(i);
831
+ return a ? o : W[n] = o;
832
+ }
833
+ {
834
+ if (!B(e)) return (() => e);
807
835
  let t = e.cacheKey;
808
- return t ? q[t] || (q[t] = Te(e)) : Te(e);
836
+ return t ? W[t] || (W[t] = Be(e)) : Be(e);
809
837
  }
810
838
  }
811
- let J = {
839
+ let G = {
812
840
  INVALID_ARGUMENT: 17,
813
841
  INVALID_DATE_ARGUMENT: 18,
814
842
  INVALID_ISO_DATE_ARGUMENT: 19,
815
- NOT_SUPPORT_NON_STRING_MESSAGE: 20,
816
- NOT_SUPPORT_LOCALE_PROMISE_VALUE: 21,
817
- NOT_SUPPORT_LOCALE_ASYNC_FUNCTION: 22,
818
- NOT_SUPPORT_LOCALE_TYPE: 23
843
+ NOT_SUPPORT_LOCALE_PROMISE_VALUE: 20,
844
+ NOT_SUPPORT_LOCALE_ASYNC_FUNCTION: 21,
845
+ NOT_SUPPORT_LOCALE_TYPE: 22
819
846
  };
820
- function Y(e) {
821
- return I(e, null, void 0);
847
+ function K(e) {
848
+ return P(e, null, void 0);
822
849
  }
823
- J.INVALID_ARGUMENT, J.INVALID_DATE_ARGUMENT, J.INVALID_ISO_DATE_ARGUMENT, J.NOT_SUPPORT_NON_STRING_MESSAGE, J.NOT_SUPPORT_LOCALE_PROMISE_VALUE, J.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION, J.NOT_SUPPORT_LOCALE_TYPE;
824
- function X(e, t) {
825
- return t.locale == null ? Pe(e.locale) : Pe(t.locale);
850
+ G.INVALID_ARGUMENT, G.INVALID_DATE_ARGUMENT, G.INVALID_ISO_DATE_ARGUMENT, G.NOT_SUPPORT_LOCALE_PROMISE_VALUE, G.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION, G.NOT_SUPPORT_LOCALE_TYPE;
851
+ function Je(e, t) {
852
+ return t.locale == null ? Xe(e.locale) : Xe(t.locale);
826
853
  }
827
- let Ne;
828
- function Pe(e) {
829
- if (T(e)) return e;
830
- if (w(e)) {
831
- if (e.resolvedOnce && Ne != null) return Ne;
854
+ let Ye;
855
+ function Xe(e) {
856
+ if (v(e)) return e;
857
+ if (_(e)) {
858
+ if (e.resolvedOnce && Ye != null) return Ye;
832
859
  if (e.constructor.name === `Function`) {
833
860
  let t = e();
834
- if (O(t)) throw Y(J.NOT_SUPPORT_LOCALE_PROMISE_VALUE);
835
- return Ne = t;
836
- } else throw Y(J.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION);
837
- } else throw Y(J.NOT_SUPPORT_LOCALE_TYPE);
838
- }
839
- function Fe(e, t, n) {
840
- return [...new Set([n, ...C(t) ? t : D(t) ? Object.keys(t) : T(t) ? [t] : [n]])];
841
- }
842
- function Ie(e, t, n) {
843
- let r = T(n) ? n : Qe, i = e;
844
- i.__localeChainCache || (i.__localeChainCache = /* @__PURE__ */ new Map());
845
- let a = i.__localeChainCache.get(r);
846
- if (!a) {
847
- a = [];
848
- let e = [n];
849
- for (; C(e);) e = Le(a, e, t);
850
- let o = C(t) || !j(t) ? t : t.default ? t.default : null;
851
- e = T(o) ? [o] : o, C(e) && Le(a, e, !1), i.__localeChainCache.set(r, a);
852
- }
853
- return a;
854
- }
855
- function Le(e, t, n) {
861
+ if (x(t)) throw K(G.NOT_SUPPORT_LOCALE_PROMISE_VALUE);
862
+ return Ye = t;
863
+ }
864
+ throw K(G.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION);
865
+ }
866
+ throw K(G.NOT_SUPPORT_LOCALE_TYPE);
867
+ }
868
+ function Ze(e, t, n) {
869
+ return [.../* @__PURE__ */ new Set([n, ...g(t) ? t : b(t) ? Object.keys(t).filter((e) => e !== "default") : v(t) ? [t] : [n]])];
870
+ }
871
+ function Qe(e, t, n) {
872
+ let r = v(n) ? n : Y, i = e, a;
873
+ 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)));
874
+ let o = a.get(r);
875
+ if (o) return o;
876
+ let s = [], c = [n];
877
+ for (; g(c);) c = $e(s, c, t);
878
+ let l = g(t) || !w(t) ? t : t.default ? t.default : null;
879
+ return c = v(l) ? [l] : l, g(c) && $e(s, c, !1), a.set(r, s), s;
880
+ }
881
+ function $e(e, t, n) {
856
882
  let r = !0;
857
- for (let i = 0; i < t.length && E(r); i++) {
883
+ for (let i = 0; i < t.length && y(r); i++) {
858
884
  let a = t[i];
859
- T(a) && (r = Re(e, t[i], n));
885
+ v(a) && (r = et(e, t[i], n));
860
886
  }
861
887
  return r;
862
888
  }
863
- function Re(e, t, n) {
889
+ function et(e, t, n) {
864
890
  let r, i = t.split(`-`);
865
891
  do
866
- r = ze(e, i.join(`-`), n), i.splice(-1, 1);
892
+ r = tt(e, i.join(`-`), n), i.splice(-1, 1);
867
893
  while (i.length && r === !0);
868
894
  return r;
869
895
  }
870
- function ze(e, t, n) {
896
+ function tt(e, t, n) {
871
897
  let r = !1;
872
898
  if (!e.includes(t) && (r = !0, t)) {
873
899
  r = t[t.length - 1] !== `!`;
874
900
  let i = t.replace(/!/g, ``);
875
- e.push(i), (C(n) || j(n)) && n[i] && (r = n[i]);
901
+ e.push(i), (g(n) || w(n)) && n[i] && (r = n[i]);
876
902
  }
877
903
  return r;
878
904
  }
879
- let Z = [];
880
- Z[0] = {
905
+ let q = [];
906
+ q[0] = {
881
907
  w: [0],
882
908
  i: [3, 0],
883
909
  "[": [4],
884
910
  o: [7]
885
- }, Z[1] = {
911
+ }, q[1] = {
886
912
  w: [1],
887
913
  ".": [2],
888
914
  "[": [4],
889
915
  o: [7]
890
- }, Z[2] = {
916
+ }, q[2] = {
891
917
  w: [2],
892
918
  i: [3, 0],
893
919
  0: [3, 0]
894
- }, Z[3] = {
920
+ }, q[3] = {
895
921
  i: [3, 0],
896
922
  0: [3, 0],
897
923
  w: [1, 1],
898
924
  ".": [2, 1],
899
925
  "[": [4, 1],
900
926
  o: [7, 1]
901
- }, Z[4] = {
927
+ }, q[4] = {
902
928
  "'": [5, 0],
903
929
  "\"": [6, 0],
904
930
  "[": [4, 2],
905
931
  "]": [1, 3],
906
932
  o: 8,
907
933
  l: [4, 0]
908
- }, Z[5] = {
934
+ }, q[5] = {
909
935
  "'": [4, 0],
910
936
  o: 8,
911
937
  l: [5, 0]
912
- }, Z[6] = {
938
+ }, q[6] = {
913
939
  "\"": [4, 0],
914
940
  o: 8,
915
941
  l: [6, 0]
916
942
  };
917
- let Be = /^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;
918
- function Ve(e) {
919
- return Be.test(e);
943
+ let nt = /^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;
944
+ function rt(e) {
945
+ return nt.test(e);
920
946
  }
921
- function He(e) {
947
+ function it(e) {
922
948
  let t = e.charCodeAt(0);
923
949
  return t === e.charCodeAt(e.length - 1) && (t === 34 || t === 39) ? e.slice(1, -1) : e;
924
950
  }
925
- function Ue(e) {
951
+ function at(e) {
926
952
  if (e == null) return `o`;
927
953
  switch (e.charCodeAt(0)) {
928
954
  case 91:
@@ -943,11 +969,11 @@
943
969
  }
944
970
  return `i`;
945
971
  }
946
- function We(e) {
972
+ function ot(e) {
947
973
  let t = e.trim();
948
- return e.charAt(0) === `0` && isNaN(parseInt(e)) ? !1 : Ve(t) ? He(t) : `*` + t;
974
+ return e.charAt(0) === `0` && isNaN(parseInt(e)) ? !1 : rt(t) ? it(t) : `*` + t;
949
975
  }
950
- function Ge(e) {
976
+ function st(e) {
951
977
  let t = [], n = -1, r = 0, i = 0, a, o, s, c, l, u, d, f = [];
952
978
  f[0] = () => {
953
979
  o === void 0 ? o = s : o += s;
@@ -958,7 +984,7 @@
958
984
  }, f[3] = () => {
959
985
  if (i > 0) i--, r = 4, f[0]();
960
986
  else {
961
- if (i = 0, o === void 0 || (o = We(o), o === !1)) return !1;
987
+ if (i = 0, o === void 0 || (o = ot(o), o === !1)) return !1;
962
988
  f[1]();
963
989
  }
964
990
  };
@@ -967,29 +993,29 @@
967
993
  if (r === 5 && t === `'` || r === 6 && t === `"`) return n++, s = `\\` + t, f[0](), !0;
968
994
  }
969
995
  for (; r !== null;) if (n++, a = e[n], !(a === `\\` && p())) {
970
- if (c = Ue(a), d = Z[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;
996
+ if (c = at(a), d = q[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;
971
997
  if (r === 7) return t;
972
998
  }
973
999
  }
974
- let Ke = /* @__PURE__ */ new Map();
975
- function qe(e, t) {
976
- return D(e) ? e[t] : null;
1000
+ let ct = /* @__PURE__ */ new Map();
1001
+ function lt(e, t) {
1002
+ return b(e) ? m(e, t) : null;
977
1003
  }
978
- function Je(e, t) {
979
- if (!D(e)) return null;
980
- let n = Ke.get(t);
981
- if (n || (n = Ge(t), n && Ke.set(t, n)), !n) return null;
1004
+ function ut(e, t) {
1005
+ if (!b(e)) return null;
1006
+ let n = ct.get(t);
1007
+ if (n || (n = st(t), n && ct.set(t, n)), !n) return null;
982
1008
  let r = n.length, i = e, a = 0;
983
1009
  for (; a < r;) {
984
1010
  let e = n[a];
985
- if (we.includes(e) && z(i) || !D(i) || !S(i, e)) return null;
1011
+ if (ze.includes(e) && B(i) || !b(i) || !p(i, e)) return null;
986
1012
  let t = i[e];
987
- if (t === void 0 || w(i)) return null;
1013
+ if (t === void 0 || _(i)) return null;
988
1014
  i = t, a++;
989
1015
  }
990
1016
  return i;
991
1017
  }
992
- let Q = {
1018
+ let J = {
993
1019
  NOT_FOUND_KEY: 1,
994
1020
  FALLBACK_TO_TRANSLATE: 2,
995
1021
  CANNOT_FORMAT_NUMBER: 3,
@@ -998,124 +1024,184 @@
998
1024
  FALLBACK_TO_DATE_FORMAT: 6,
999
1025
  EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER: 7,
1000
1026
  INVALID_NUMBER_ARGUMENT: 8,
1001
- INVALID_DATE_ARGUMENT: 9
1002
- }, Ye = {
1003
- [Q.NOT_FOUND_KEY]: `Not found '{key}' key in '{locale}' locale messages.`,
1004
- [Q.FALLBACK_TO_TRANSLATE]: `Fall back to translate '{key}' key with '{target}' locale.`,
1005
- [Q.CANNOT_FORMAT_NUMBER]: `Cannot format a number value due to not supported Intl.NumberFormat.`,
1006
- [Q.FALLBACK_TO_NUMBER_FORMAT]: `Fall back to number format '{key}' key with '{target}' locale.`,
1007
- [Q.CANNOT_FORMAT_DATE]: `Cannot format a date value due to not supported Intl.DateTimeFormat.`,
1008
- [Q.FALLBACK_TO_DATE_FORMAT]: `Fall back to datetime format '{key}' key with '{target}' locale.`,
1009
- [Q.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.`,
1010
- [Q.INVALID_NUMBER_ARGUMENT]: `Invalid argument for number formatting: expected a number but received '{value}'.`,
1011
- [Q.INVALID_DATE_ARGUMENT]: `Invalid argument for datetime formatting: expected a Date, number, or ISO string but received '{value}'.`
1027
+ INVALID_DATE_ARGUMENT: 9,
1028
+ IGNORE_UNSAFE_LOCALE: 10,
1029
+ FALLBACK_TO_DEFAULT_PLURAL_RULE: 11,
1030
+ FALLBACK_FROM_INVALID_LOCALE: 12
1031
+ }, dt = {
1032
+ [J.NOT_FOUND_KEY]: `Not found '{key}' key in '{locale}' locale {resource}.`,
1033
+ [J.FALLBACK_TO_TRANSLATE]: `Fall back to translate '{key}' key with '{target}' locale.`,
1034
+ [J.CANNOT_FORMAT_NUMBER]: `Cannot format a number value due to not supported Intl.NumberFormat.`,
1035
+ [J.FALLBACK_TO_NUMBER_FORMAT]: `Fall back to number format '{key}' key with '{target}' locale.`,
1036
+ [J.CANNOT_FORMAT_DATE]: `Cannot format a date value due to not supported Intl.DateTimeFormat.`,
1037
+ [J.FALLBACK_TO_DATE_FORMAT]: `Fall back to datetime format '{key}' key with '{target}' locale.`,
1038
+ [J.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.`,
1039
+ [J.INVALID_NUMBER_ARGUMENT]: `Invalid argument for number formatting: expected a number but received '{value}'.`,
1040
+ [J.INVALID_DATE_ARGUMENT]: `Invalid argument for datetime formatting: expected a Date, number, or ISO string but received '{value}'.`,
1041
+ [J.IGNORE_UNSAFE_LOCALE]: `Ignore '{locale}' locale: it is a property name of Object.prototype`,
1042
+ [J.FALLBACK_TO_DEFAULT_PLURAL_RULE]: `Fall back to the default plural rule for '{locale}' locale: Intl.PluralRules does not support it`,
1043
+ [J.FALLBACK_FROM_INVALID_LOCALE]: `Fall back to '{target}' locale for {type} formatting with '{locale}' locale: it is not a BCP 47 language tag`
1012
1044
  };
1013
- function Xe(e, ...t) {
1014
- return r(Ye[e], ...t);
1045
+ function ft(e, ...t) {
1046
+ return n(dt[e], ...t);
1015
1047
  }
1016
- let Ze = `12.0.0-alpha.4`, Qe = `en-US`, $e = (e) => `${e.charAt(0).toLocaleUpperCase()}${e.substr(1)}`;
1017
- function et() {
1048
+ let pt = `12.0.0-alpha.6`, Y = `en-US`, mt = (e) => `${e.charAt(0).toLocaleUpperCase()}${e.substr(1)}`;
1049
+ function ht() {
1018
1050
  return {
1019
- upper: (e, t) => t === `text` && T(e) ? e.toUpperCase() : t === `vnode` && D(e) && `__v_isVNode` in e ? e.children.toUpperCase() : e,
1020
- lower: (e, t) => t === `text` && T(e) ? e.toLowerCase() : t === `vnode` && D(e) && `__v_isVNode` in e ? e.children.toLowerCase() : e,
1021
- capitalize: (e, t) => t === `text` && T(e) ? $e(e) : t === `vnode` && D(e) && `__v_isVNode` in e ? $e(e.children) : e
1051
+ upper: (e, t) => t === `text` && v(e) ? e.toUpperCase() : t === `vnode` && b(e) && `__v_isVNode` in e ? e.children.toUpperCase() : e,
1052
+ lower: (e, t) => t === `text` && v(e) ? e.toLowerCase() : t === `vnode` && b(e) && `__v_isVNode` in e ? e.children.toLowerCase() : e,
1053
+ capitalize: (e, t) => t === `text` && v(e) ? mt(e) : t === `vnode` && b(e) && `__v_isVNode` in e ? mt(e.children) : e
1022
1054
  };
1023
1055
  }
1024
- let tt;
1025
- function nt(e) {
1026
- tt = e;
1027
- }
1028
- let rt;
1029
- function it(e) {
1030
- rt = e;
1031
- }
1032
- let at;
1033
- function ot(e) {
1034
- at = e;
1035
- }
1036
- let st = null, ct = (e) => {
1037
- st = e;
1038
- }, lt = () => st, ut = 0;
1039
- function dt(e = {}) {
1040
- let n = w(e.onWarn) ? e.onWarn : t, r = T(e.version) ? e.version : Ze, i = T(e.locale) || w(e.locale) ? e.locale : Qe, a = w(i) ? Qe : i, o = C(e.fallbackLocale) || j(e.fallbackLocale) || T(e.fallbackLocale) || e.fallbackLocale === !1 ? e.fallbackLocale : a, s = j(e.messages) ? e.messages : ft(a), l = j(e.datetimeFormats) ? e.datetimeFormats : ft(a), d = j(e.numberFormats) ? e.numberFormats : ft(a), p = u(f(), e.modifiers, et()), m = e.pluralRules || f(), h = w(e.missing) ? e.missing : null, g = E(e.missingWarn) || c(e.missingWarn) ? e.missingWarn : !0, _ = E(e.fallbackWarn) || c(e.fallbackWarn) ? e.fallbackWarn : !0, v = !!e.fallbackFormat, y = !!e.unresolving, b = w(e.postTranslation) ? e.postTranslation : null, x = j(e.processor) ? e.processor : null, S = E(e.warnHtmlMessage) ? e.warnHtmlMessage : !0, O = !!e.escapeParameter, k = w(e.messageCompiler) ? e.messageCompiler : tt || null, A = w(e.messageResolver) ? e.messageResolver : rt || qe, ee = w(e.localeFallbacker) ? e.localeFallbacker : at || Fe, M = D(e.fallbackContext) ? e.fallbackContext : void 0, N = e, te = D(N.__datetimeFormatters) ? N.__datetimeFormatters : /* @__PURE__ */ new Map(), ne = D(N.__numberFormatters) ? N.__numberFormatters : /* @__PURE__ */ new Map();
1041
- ut++;
1042
- let P = {
1043
- version: r,
1044
- cid: ut,
1045
- locale: i,
1046
- fallbackLocale: o,
1047
- messages: s,
1048
- modifiers: p,
1049
- pluralRules: m,
1050
- missing: h,
1051
- missingWarn: g,
1052
- fallbackWarn: _,
1053
- fallbackFormat: v,
1054
- unresolving: y,
1055
- postTranslation: b,
1056
- processor: x,
1057
- warnHtmlMessage: S,
1058
- escapeParameter: O,
1059
- messageCompiler: k,
1060
- messageResolver: A,
1061
- localeFallbacker: ee,
1062
- fallbackContext: M,
1063
- onWarn: n
1056
+ let gt;
1057
+ function _t(e) {
1058
+ gt = e;
1059
+ }
1060
+ let vt;
1061
+ function yt(e) {
1062
+ vt = e;
1063
+ }
1064
+ let bt;
1065
+ function xt(e) {
1066
+ bt = e;
1067
+ }
1068
+ let St = 0;
1069
+ function Ct(e = {}) {
1070
+ let t = _(e.onWarn) ? e.onWarn : E, n = v(e.version) ? e.version : pt, r = v(e.locale) || _(e.locale) ? e.locale : Y, i = _(r) ? Y : r, a = Dt(e.fallbackLocale) ? e.fallbackLocale : i, o = w(e.messages) ? e.messages : wt(i), s = w(e.datetimeFormats) ? e.datetimeFormats : wt(i), c = w(e.numberFormats) ? e.numberFormats : wt(i), u = l(d(), e.modifiers, ht()), f = e.pluralRules || d(), p = _(e.missing) ? e.missing : null, m = !Ot(e.missingWarn) || e.missingWarn, h = !Ot(e.fallbackWarn) || e.fallbackWarn, g = !!e.fallbackFormat, x = !!e.unresolving, S = _(e.postTranslation) ? e.postTranslation : null, C = w(e.processor) ? e.processor : null, ee = !y(e.warnHtmlMessage) || e.warnHtmlMessage, T = !!e.escapeParameter, D = _(e.messageCompiler) ? e.messageCompiler : gt || null, te = _(e.messageResolver) ? e.messageResolver : vt || lt, ne = _(e.localeFallbacker) ? e.localeFallbacker : bt || Ze, re = b(e.fallbackContext) ? e.fallbackContext : void 0;
1071
+ St++;
1072
+ let O = {
1073
+ version: n,
1074
+ cid: St,
1075
+ locale: r,
1076
+ fallbackLocale: a,
1077
+ messages: o,
1078
+ modifiers: u,
1079
+ pluralRules: f,
1080
+ missing: p,
1081
+ missingWarn: m,
1082
+ fallbackWarn: h,
1083
+ fallbackFormat: g,
1084
+ unresolving: x,
1085
+ postTranslation: S,
1086
+ processor: C,
1087
+ warnHtmlMessage: ee,
1088
+ escapeParameter: T,
1089
+ messageCompiler: D,
1090
+ messageResolver: te,
1091
+ localeFallbacker: ne,
1092
+ fallbackContext: re,
1093
+ onWarn: t
1064
1094
  };
1065
- return P.datetimeFormats = l, P.numberFormats = d, P.__datetimeFormatters = te, P.__numberFormatters = ne, P;
1095
+ return O.datetimeFormats = s, O.numberFormats = c, O.__datetimeFormatters = /* @__PURE__ */ new Map(), O.__numberFormatters = /* @__PURE__ */ new Map(), O;
1066
1096
  }
1067
- let ft = (e) => ({ [e]: f() });
1068
- function pt(e, t) {
1069
- let n = e.messages[t];
1097
+ let wt = (e) => ({ [e]: d() });
1098
+ function Tt(e, t) {
1099
+ let n = m(e.messages, t);
1070
1100
  if (n == null) return;
1071
- let r = f();
1072
- return te(n, r), r;
1101
+ let r = d();
1102
+ return he(n, r), r;
1103
+ }
1104
+ function Et(e, t, n) {
1105
+ h(t) || (e.messages[t] = n);
1073
1106
  }
1074
- function mt(e, t, n) {
1075
- e.messages[t] = n;
1107
+ function Dt(e) {
1108
+ return v(e) || g(e) || w(e) || e === !1;
1076
1109
  }
1077
- function ht(e, t) {
1078
- return c(e) ? e.test(t) : e;
1110
+ function Ot(e) {
1111
+ return y(e) || s(e);
1079
1112
  }
1080
- function gt(e, t) {
1081
- return c(e) ? e.test(t) : e;
1113
+ function kt(e, t) {
1114
+ return s(e) ? e.test(t) : e;
1082
1115
  }
1083
- function _t(e, t, n, r, i) {
1116
+ function At(e, t) {
1117
+ return s(e) ? e.test(t) : e;
1118
+ }
1119
+ function jt(e, t, n, r, i) {
1084
1120
  let { missing: a, onWarn: o } = e;
1085
1121
  if (a !== null) {
1086
1122
  let r = a(e, n, t, i);
1087
- return T(r) ? r : t;
1088
- } else return t;
1123
+ return v(r) ? r : t;
1124
+ }
1125
+ return t;
1126
+ }
1127
+ function Mt(e, t) {
1128
+ let n = e;
1129
+ b(t) ? n.__localeChainObjectCache?.delete(t) : n.__localeChainCache?.delete(t);
1089
1130
  }
1090
- function vt(e, t, n) {
1091
- let r = e;
1092
- r.__localeChainCache = /* @__PURE__ */ new Map(), e.localeFallbacker(e, n, t);
1131
+ function Nt(e, t, n) {
1132
+ Mt(e, n), e.fallbackContext && Mt(e.fallbackContext, n);
1133
+ {
1134
+ let { __datetimeFormatters: t, __numberFormatters: n } = e;
1135
+ t.clear(), n.clear();
1136
+ }
1137
+ e.localeFallbacker(e, n, t);
1093
1138
  }
1094
- function yt(e, t) {
1095
- return e === t ? !1 : e.split(`-`)[0] === t.split(`-`)[0];
1139
+ function Pt(e, t) {
1140
+ return e !== t && e.split(`-`)[0] === t.split(`-`)[0];
1096
1141
  }
1097
- function bt(e, t) {
1142
+ function Ft(e, t) {
1098
1143
  let n = t.indexOf(e);
1099
1144
  if (n === -1) return !1;
1100
- for (let r = n + 1; r < t.length; r++) if (yt(e, t[r])) return !0;
1145
+ for (let r = n + 1; r < t.length; r++) if (Pt(e, t[r])) return !0;
1101
1146
  return !1;
1102
1147
  }
1103
- function xt(e, ...t) {
1104
- let { datetimeFormats: n, unresolving: r, fallbackLocale: i, onWarn: a, localeFallbacker: c } = e, { __datetimeFormatters: d } = e;
1105
- if (!T(t[0]) && !s(t[0]) && !o(t[0])) return ``;
1106
- let [f, p, m, h] = Ct(...t), g = E(m.missingWarn) ? m.missingWarn : e.missingWarn;
1107
- E(m.fallbackWarn) ? m.fallbackWarn : e.fallbackWarn;
1108
- let _ = !!m.part, v = X(e, m), y = c(e, i, v);
1109
- if (!T(f) || f === ``) return new Intl.DateTimeFormat(v.replace(/!/g, ``), h).format(p);
1110
- let b = {}, x, S = null;
1111
- for (let t = 0; t < y.length && (x = y[t], b = n[x] || {}, S = b[f], !j(S)); t++) _t(e, f, x, g, `datetime format`);
1112
- if (!j(S) || !T(x)) return r ? -1 : f;
1113
- let C = `${x}__${f}`;
1114
- j(h) && !l(h) && (C = `${C}__${JSON.stringify(h)}`);
1115
- let w = d.get(C);
1116
- return w || (w = new Intl.DateTimeFormat(x, u({}, S, h)), d.set(C, w)), _ ? w.formatToParts(p) : w.format(p);
1117
- }
1118
- let St = [
1148
+ function It(e, t, n, r, i, a, o) {
1149
+ let { fallbackLocale: s, localeFallbacker: c, onWarn: l } = e, u = c(e, s, n);
1150
+ for (let n = 0; n < u.length; n++) {
1151
+ let a = u[n], s = m(m(r, a) || {}, t);
1152
+ if (w(s) && v(a)) return a;
1153
+ jt(e, t, a, i, o);
1154
+ }
1155
+ return null;
1156
+ }
1157
+ function Lt(e) {
1158
+ try {
1159
+ return Intl.getCanonicalLocales(e), !0;
1160
+ } catch {
1161
+ return !1;
1162
+ }
1163
+ }
1164
+ function Rt(e, t, n, r, i) {
1165
+ try {
1166
+ return new t(n, r);
1167
+ } catch (i) {
1168
+ if (Lt(n)) throw i;
1169
+ let { fallbackLocale: a, localeFallbacker: o, onWarn: s } = e;
1170
+ return new t(o(e, a, n).find(Lt) || `en-US`, r);
1171
+ }
1172
+ }
1173
+ function zt(e, [t, n, r, i], a, o, s, c) {
1174
+ let u = y(r.missingWarn) ? r.missingWarn : e.missingWarn, d = y(r.fallbackWarn) ? r.fallbackWarn : e.fallbackWarn, f = !!r.part, p = Je(e, r);
1175
+ if (!v(t) || t === ``) {
1176
+ let t = Rt(e, a, p.replace(/!/g, ``), i, c);
1177
+ return f ? t.formatToParts(n) : t.format(n);
1178
+ }
1179
+ let m = It(e, t, p, s, u, d, c);
1180
+ if (!v(m)) return e.unresolving ? -1 : t;
1181
+ let h = s[m][t], g = Bt(m, t, i), _ = o.get(g);
1182
+ return _ || (_ = Rt(e, a, m, l({}, h, i), c), o.set(g, _)), f ? _.formatToParts(n) : _.format(n);
1183
+ }
1184
+ function Bt(e, t, n) {
1185
+ let r = `${e}__${t}`;
1186
+ return w(n) && !c(n) && (r = `${r}__${JSON.stringify(n)}`), r;
1187
+ }
1188
+ function Vt(e, t, n) {
1189
+ for (let r in n) {
1190
+ let n = `${t}__${r}`;
1191
+ for (let t of e.keys()) (t === n || t.startsWith(`${n}__`)) && e.delete(t);
1192
+ }
1193
+ }
1194
+ function Ht(e, t, n, r) {
1195
+ let [, i, a, o] = e, s = n;
1196
+ return v(i) ? t.key = i : w(i) && Object.keys(i).forEach((e) => {
1197
+ r.includes(e) ? s[e] = i[e] : t[e] = i[e];
1198
+ }), v(a) ? t.locale = a : w(a) && (s = a), w(o) && (s = o), s;
1199
+ }
1200
+ function Ut(e, ...t) {
1201
+ let { datetimeFormats: n, onWarn: r } = e, { __datetimeFormatters: i } = e;
1202
+ return !v(t[0]) && !o(t[0]) && !a(t[0]) ? `` : zt(e, Gt(...t), Intl.DateTimeFormat, i, n, `datetime format`);
1203
+ }
1204
+ let Wt = [
1119
1205
  `localeMatcher`,
1120
1206
  `weekday`,
1121
1207
  `era`,
@@ -1137,55 +1223,39 @@
1137
1223
  `hourCycle`,
1138
1224
  `fractionalSecondDigits`
1139
1225
  ];
1140
- function Ct(...e) {
1141
- let [t, n, r, i] = e, a = f(), c = f(), l;
1142
- if (T(t)) {
1143
- let e = t.match(/(\d{4}-\d{2}-\d{2})(T|\s)?(.*)/);
1144
- if (!e) throw Y(J.INVALID_ISO_DATE_ARGUMENT);
1226
+ function Gt(...e) {
1227
+ let [t] = e, n = d(), r = d(), i;
1228
+ if (v(t)) {
1229
+ let e = t.match(/^(\d{4}-\d{2}-\d{2})(?:(T|\s)(.+))?$/);
1230
+ if (!e) throw K(G.INVALID_ISO_DATE_ARGUMENT);
1145
1231
  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();
1146
- l = new Date(n);
1232
+ i = new Date(n);
1147
1233
  try {
1148
- l.toISOString();
1234
+ i.toISOString();
1149
1235
  } catch {
1150
- throw Y(J.INVALID_ISO_DATE_ARGUMENT);
1236
+ throw K(G.INVALID_ISO_DATE_ARGUMENT);
1151
1237
  }
1152
- } else if (s(t)) {
1153
- if (isNaN(t.getTime())) throw Y(J.INVALID_DATE_ARGUMENT);
1154
- l = t;
1155
- } else if (o(t)) l = t;
1156
- else throw Y(J.INVALID_ARGUMENT);
1157
- return T(n) ? a.key = n : j(n) && Object.keys(n).forEach((e) => {
1158
- St.includes(e) ? c[e] = n[e] : a[e] = n[e];
1159
- }), T(r) ? a.locale = r : j(r) && (c = r), j(i) && (c = i), [
1160
- a.key || ``,
1161
- l,
1162
- a,
1163
- c
1238
+ } else if (o(t)) {
1239
+ if (isNaN(t.getTime())) throw K(G.INVALID_DATE_ARGUMENT);
1240
+ i = t;
1241
+ } else if (a(t)) i = t;
1242
+ else throw K(G.INVALID_ARGUMENT);
1243
+ let s = Ht(e, n, r, Wt);
1244
+ return [
1245
+ n.key || ``,
1246
+ i,
1247
+ n,
1248
+ s
1164
1249
  ];
1165
1250
  }
1166
- function wt(e, t, n) {
1167
- let r = e;
1168
- for (let e in n) {
1169
- let n = `${t}__${e}`;
1170
- r.__datetimeFormatters.has(n) && r.__datetimeFormatters.delete(n);
1171
- }
1172
- }
1173
- function Tt(e, ...t) {
1174
- let { numberFormats: n, unresolving: r, fallbackLocale: i, onWarn: a, localeFallbacker: s } = e, { __numberFormatters: c } = e;
1175
- if (!o(t[0])) return ``;
1176
- let [d, f, p, m] = Dt(...t), h = E(p.missingWarn) ? p.missingWarn : e.missingWarn;
1177
- E(p.fallbackWarn) ? p.fallbackWarn : e.fallbackWarn;
1178
- let g = !!p.part, _ = X(e, p), v = s(e, i, _);
1179
- if (!T(d) || d === ``) return new Intl.NumberFormat(_.replace(/!/g, ``), m).format(f);
1180
- let y = {}, b, x = null;
1181
- for (let t = 0; t < v.length && (b = v[t], y = n[b] || {}, x = y[d], !j(x)); t++) _t(e, d, b, h, `number format`);
1182
- if (!j(x) || !T(b)) return r ? -1 : d;
1183
- let S = `${b}__${d}`;
1184
- j(m) && !l(m) && (S = `${S}__${JSON.stringify(m)}`);
1185
- let C = c.get(S);
1186
- return C || (C = new Intl.NumberFormat(b, u({}, x, m)), c.set(S, C)), g ? C.formatToParts(f) : C.format(f);
1187
- }
1188
- let Et = [
1251
+ function Kt(e, t, n) {
1252
+ Vt(e.__datetimeFormatters, t, n);
1253
+ }
1254
+ function qt(e, ...t) {
1255
+ let { numberFormats: n, onWarn: r } = e, { __numberFormatters: i } = e;
1256
+ return a(t[0]) ? zt(e, Yt(...t), Intl.NumberFormat, i, n, `number format`) : ``;
1257
+ }
1258
+ let Jt = [
1189
1259
  `localeMatcher`,
1190
1260
  `style`,
1191
1261
  `currency`,
@@ -1207,124 +1277,134 @@
1207
1277
  `roundingIncrement`,
1208
1278
  `trailingZeroDisplay`
1209
1279
  ];
1210
- function Dt(...e) {
1211
- let [t, n, r, i] = e, a = f(), s = f();
1212
- if (!o(t)) throw Y(J.INVALID_ARGUMENT);
1213
- let c = t;
1214
- return T(n) ? a.key = n : j(n) && Object.keys(n).forEach((e) => {
1215
- Et.includes(e) ? s[e] = n[e] : a[e] = n[e];
1216
- }), T(r) ? a.locale = r : j(r) && (s = r), j(i) && (s = i), [
1217
- a.key || ``,
1218
- c,
1219
- a,
1220
- s
1280
+ function Yt(...e) {
1281
+ let [t] = e, n = d(), r = d();
1282
+ if (!a(t)) throw K(G.INVALID_ARGUMENT);
1283
+ let i = t, o = Ht(e, n, r, Jt);
1284
+ return [
1285
+ n.key || ``,
1286
+ i,
1287
+ n,
1288
+ o
1221
1289
  ];
1222
1290
  }
1223
- function Ot(e, t, n) {
1224
- let r = e;
1225
- for (let e in n) {
1226
- let n = `${t}__${e}`;
1227
- r.__numberFormatters.has(n) && r.__numberFormatters.delete(n);
1228
- }
1291
+ function Xt(e, t, n) {
1292
+ Vt(e.__numberFormatters, t, n);
1229
1293
  }
1230
- let kt = (e) => e, At = (e) => ``, jt = `text`, Mt = (e) => e.length === 0 ? `` : M(e), Nt = ee;
1231
- function Pt(e, t) {
1294
+ let Zt = (e) => e, Qt = (e) => ``, $t = `text`, en = (e) => e.length === 0 ? `` : T(e), tn = ee;
1295
+ function X(e, t) {
1232
1296
  return e = Math.abs(e), t === 2 ? e === 1 ? 0 : 1 : Math.min(e, 2);
1233
1297
  }
1234
- let Ft = [
1298
+ let nn = [
1235
1299
  `zero`,
1236
1300
  `one`,
1237
1301
  `two`,
1238
1302
  `few`,
1239
1303
  `many`,
1240
1304
  `other`
1241
- ], It = /* @__PURE__ */ new Map();
1242
- function Lt(e) {
1243
- let t = It.get(e);
1244
- if (!t) {
1245
- let n = new Intl.PluralRules(e);
1246
- t = {
1247
- rules: n,
1248
- categories: n.resolvedOptions().pluralCategories.slice().sort((e, t) => Ft.indexOf(e) - Ft.indexOf(t))
1249
- }, It.set(e, t);
1305
+ ], Z = /* @__PURE__ */ new Map();
1306
+ function rn(e) {
1307
+ try {
1308
+ if (Intl.PluralRules.supportedLocalesOf(e).length === 0) return null;
1309
+ let t = new Intl.PluralRules(e);
1310
+ return {
1311
+ rules: t,
1312
+ categories: t.resolvedOptions().pluralCategories.slice().sort((e, t) => nn.indexOf(e) - nn.indexOf(t))
1313
+ };
1314
+ } catch {
1315
+ return null;
1316
+ }
1317
+ }
1318
+ function an(e) {
1319
+ let t = Z.get(e);
1320
+ return t === void 0 && (t = rn(e), Z.size >= 1e3 && Z.delete(Z.keys().next().value), Z.set(e, t)), t;
1321
+ }
1322
+ function on(e) {
1323
+ return a(e.pluralIndex) ? e.pluralIndex : a(e.named?.count) ? e.named.count : a(e.named?.n) ? e.named.n : -1;
1324
+ }
1325
+ function sn(e = {}) {
1326
+ let t = e.locale, n = on(e), r;
1327
+ r = v(t) && e.pluralRules && _(m(e.pluralRules, t)) ? e.pluralRules[t] : v(t) && typeof Intl < `u` && Intl.PluralRules !== void 0 ? (e, n) => {
1328
+ let r = an(t);
1329
+ if (r === null || n > r.categories.length) return X(e, n);
1330
+ let { rules: i, categories: a } = r, o = i.select(Math.abs(e)), s = a.indexOf(o);
1331
+ return Math.min(s === -1 ? n - 1 : s, n - 1);
1332
+ } : X;
1333
+ let i = r === X ? void 0 : X, o = (e) => e[r(n, e.length, i)], s = e.list || [], c = (e) => s[e], u = e.named || d(), f = a(e.pluralIndex), p = (t) => {
1334
+ let n = h(t) ? m(u, t) : u[t];
1335
+ return f && n == null && (t === `count` || t === `n`) ? e.pluralIndex : n;
1336
+ };
1337
+ function y(t, n) {
1338
+ return (_(e.messages) ? e.messages(t, !!n) : b(e.messages) ? e.messages[t] : !1) || (e.parent ? e.parent.message(t) : Qt);
1250
1339
  }
1251
- return t;
1252
- }
1253
- function Rt(e) {
1254
- return o(e.pluralIndex) ? e.pluralIndex : o(e.named?.count) ? e.named.count : o(e.named?.n) ? e.named.n : -1;
1255
- }
1256
- function zt(e = {}) {
1257
- let t = e.locale, n = Rt(e), r;
1258
- r = T(t) && w(e.pluralRules?.[t]) ? e.pluralRules[t] : T(t) && typeof Intl < `u` && Intl.PluralRules !== void 0 ? (e, n) => {
1259
- let { rules: r, categories: i } = Lt(t);
1260
- if (n > i.length) return Pt(e, n);
1261
- let a = r.select(Math.abs(e)), o = i.indexOf(a);
1262
- return Math.min(o === -1 ? n - 1 : o, n - 1);
1263
- } : Pt;
1264
- let i = r === Pt ? void 0 : Pt, a = (e) => e[r(n, e.length, i)], s = e.list || [], c = (e) => s[e], l = e.named || f();
1265
- o(e.pluralIndex) && (l.count ??= e.pluralIndex, l.n ??= e.pluralIndex);
1266
- let d = (e) => l[e];
1267
- function p(t, n) {
1268
- return (w(e.messages) ? e.messages(t, !!n) : D(e.messages) ? e.messages[t] : !1) || (e.parent ? e.parent.message(t) : At);
1269
- }
1270
- let m = (t) => e.modifiers ? e.modifiers[t] : kt, h = w(e.processor?.normalize) ? e.processor.normalize : Mt, g = w(e.processor?.interpolate) ? e.processor.interpolate : Nt, _ = {
1340
+ let x = (t) => e.modifiers ? m(e.modifiers, t) : Zt, S = _(e.processor?.normalize) ? e.processor.normalize : en, C = _(e.processor?.interpolate) ? e.processor.interpolate : tn, w = {
1271
1341
  list: c,
1272
- named: d,
1273
- plural: a,
1342
+ named: p,
1343
+ plural: o,
1274
1344
  linked: (e, ...t) => {
1275
1345
  let [n, r] = t, i = `text`, a = ``;
1276
- t.length === 1 ? D(n) ? (a = n.modifier || a, i = n.type || i) : T(n) && (a = n || a) : t.length === 2 && (T(n) && (a = n || a), T(r) && (i = r || i));
1277
- let o = p(e, !0)(_), s = o === `` || o === void 0 ? e : o, c = i === `vnode` && C(s) && a ? s[0] : s;
1278
- return a ? m(a)(c, i) : c;
1346
+ t.length === 1 ? b(n) ? (a = n.modifier || a, i = n.type || i) : v(n) && (a = n || a) : t.length === 2 && (v(n) && (a = n || a), v(r) && (i = r || i));
1347
+ let o = y(e, !0)(w), s = o === `` || o === void 0 ? e : o, c = i === `vnode` && g(s) && a ? s[0] : s;
1348
+ if (!a) return c;
1349
+ let l = x(a);
1350
+ return _(l) ? l(c, i) : c;
1279
1351
  },
1280
- message: p,
1281
- type: T(e.processor?.type) ? e.processor.type : jt,
1282
- interpolate: g,
1283
- normalize: h,
1284
- values: u(f(), s, l)
1352
+ message: y,
1353
+ type: v(e.processor?.type) ? e.processor.type : $t,
1354
+ interpolate: C,
1355
+ normalize: S,
1356
+ values: l(d(), s, u, f ? {
1357
+ count: p(`count`),
1358
+ n: p(`n`)
1359
+ } : {})
1285
1360
  };
1286
- return _;
1361
+ return w;
1287
1362
  }
1288
- let Bt = () => ``, $ = (e) => w(e);
1289
- function Vt(e, ...t) {
1290
- let [n, r] = Gt(...t), i = X(e, r), a = E(r.escapeParameter) ? r.escapeParameter : e.escapeParameter;
1291
- a && Ht(r);
1363
+ let cn = () => ``, Q = (e) => _(e), $ = (e) => v(e) || B(e) || Q(e);
1364
+ function ln(e, ...t) {
1365
+ let [n, r] = pn(...t), i = Je(e, r), a = y(r.escapeParameter) ? r.escapeParameter : e.escapeParameter;
1366
+ a && un(r);
1292
1367
  let o = !!r.resolvedMessage, [s, c, l] = o ? [
1293
1368
  n,
1294
1369
  i,
1295
- e.messages[i] || f()
1296
- ] : Ut(e, n, i, e.fallbackLocale, E(r.fallbackWarn) ? r.fallbackWarn : e.fallbackWarn, E(r.missingWarn) ? r.missingWarn : e.missingWarn), u = n;
1297
- if (!o && !(T(s) || z(s) || $(s))) {
1298
- let t = T(r.default) ? r.default : E(r.default) || e.fallbackFormat ? e.messageCompiler ? n : () => n : null;
1299
- (e.fallbackFormat || t != null && (T(t) || w(t))) && (s = t, u = s);
1300
- }
1301
- if (!o && (!(T(s) || z(s) || $(s)) || !T(c))) return e.unresolving ? -1 : n;
1302
- let d = !1, p = $(s) ? s : Wt(e, n, c, s, u, () => {
1303
- d = !0;
1304
- });
1305
- if (d) return s;
1306
- let m = p(zt(qt(e, c, l, r))), h = e.postTranslation ? e.postTranslation(m, n) : m;
1307
- return a && T(h) && (h = b(h)), h;
1308
- }
1309
- function Ht(e) {
1310
- C(e.list) ? e.list = e.list.map((e) => T(e) ? p(e) : e) : D(e.named) && Object.keys(e.named).forEach((t) => {
1311
- T(e.named[t]) && (e.named[t] = p(e.named[t]));
1370
+ m(e.messages, i) || d()
1371
+ ] : dn(e, n, i, e.fallbackLocale, y(r.fallbackWarn) ? r.fallbackWarn : e.fallbackWarn, y(r.missingWarn) ? r.missingWarn : e.missingWarn), u = n;
1372
+ if (!o && !$(s)) {
1373
+ let t = v(r.default) ? r.default : y(r.default) || e.fallbackFormat ? e.messageCompiler ? n : () => n : null;
1374
+ (e.fallbackFormat || t != null && (v(t) || _(t))) && (s = t, u = s);
1375
+ }
1376
+ if (!o && (!$(s) || !v(c))) return e.unresolving ? -1 : n;
1377
+ let f = !1, p = Q(s) ? s : fn(e, n, c, s, u, () => {
1378
+ f = !0;
1312
1379
  });
1380
+ if (f) return s;
1381
+ let h = p(sn(hn(e, c, l, r))), g = e.postTranslation ? e.postTranslation(h, n) : h;
1382
+ return a && v(g) && (g = me(g)), g;
1383
+ }
1384
+ function un(e) {
1385
+ if (g(e.list) && (e.list = e.list.map((e) => v(e) ? D(e) : e)), b(e.named)) {
1386
+ let t = e.named, n = d();
1387
+ for (let e of Object.keys(t)) {
1388
+ let r = t[e];
1389
+ n[e] = v(r) ? D(r) : r;
1390
+ }
1391
+ e.named = n;
1392
+ }
1313
1393
  }
1314
- function Ut(e, t, n, r, i, a) {
1315
- let { messages: o, onWarn: s, messageResolver: c, localeFallbacker: l } = e, u = l(e, r, n), d = f(), p, m = null;
1316
- for (let n = 0; n < u.length && (p = u[n], d = o[p] || f(), (m = c(d, t)) === null && (m = d[t]), !(T(m) || z(m) || $(m))); n++) if (!bt(p, u)) {
1317
- let n = _t(e, t, p, a, `translate`);
1318
- n !== t && (m = n);
1394
+ function dn(e, t, n, r, i, a) {
1395
+ let { messages: o, onWarn: s, messageResolver: c, localeFallbacker: l } = e, u = l(e, r, n), f = d(), p, h = null;
1396
+ 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 (!Ft(p, u)) {
1397
+ let n = jt(e, t, p, a, `translate`);
1398
+ n !== t && (h = n);
1319
1399
  }
1320
1400
  return [
1321
- m,
1401
+ h,
1322
1402
  p,
1323
- d
1403
+ f
1324
1404
  ];
1325
1405
  }
1326
- function Wt(e, t, n, r, i, a) {
1327
- if ($(r)) {
1406
+ function fn(e, t, n, r, i, a) {
1407
+ if (Q(r)) {
1328
1408
  let e = r;
1329
1409
  return e.locale = e.locale || n, e.key = e.key || t, e;
1330
1410
  }
@@ -1332,16 +1412,16 @@
1332
1412
  let e = (() => r);
1333
1413
  return e.locale = n, e.key = t, e;
1334
1414
  }
1335
- let o = e.messageCompiler(r, Kt(e, n, i, r, e.warnHtmlMessage, a));
1415
+ let o = e.messageCompiler(r, mn(e, n, i, r, e.warnHtmlMessage, a));
1336
1416
  return o.locale = n, o.key = t, o.source = r, o;
1337
1417
  }
1338
- function Gt(...e) {
1418
+ function pn(...e) {
1339
1419
  let [t, n, r] = e;
1340
- if (!T(t) && !o(t) && !$(t) && !z(t)) throw Y(J.INVALID_ARGUMENT);
1341
- let i = o(t) ? String(t) : ($(t), t), a = f();
1342
- return o(n) ? a.plural = n : T(n) ? a.default = n : j(n) && !l(n) ? a.named = n : C(n) && (a.list = n), o(r) ? a.plural = r : T(r) ? a.default = r : j(r) && u(a, r), [i, a];
1420
+ if (!v(t) && !a(t) && !Q(t) && !B(t)) throw K(G.INVALID_ARGUMENT);
1421
+ let i = a(t) ? String(t) : (Q(t), t), o = d();
1422
+ 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];
1343
1423
  }
1344
- function Kt(e, t, n, r, a, o) {
1424
+ function mn(e, t, n, i, a, o) {
1345
1425
  return {
1346
1426
  locale: t,
1347
1427
  key: n,
@@ -1349,34 +1429,34 @@
1349
1429
  onError: (e) => {
1350
1430
  throw o?.(e), e;
1351
1431
  },
1352
- onCacheKey: (e) => i(t, n, e)
1432
+ onCacheKey: (e) => r(t, n, e)
1353
1433
  };
1354
1434
  }
1355
- function qt(e, t, n, r) {
1356
- let { modifiers: i, pluralRules: a, messageResolver: s, fallbackLocale: c, fallbackWarn: l, missingWarn: u, fallbackContext: d } = e;
1435
+ function hn(e, t, n, r) {
1436
+ let { modifiers: i, pluralRules: o, messageResolver: s, fallbackLocale: c, fallbackWarn: l, missingWarn: u, fallbackContext: d } = e;
1357
1437
  return {
1358
1438
  locale: t,
1359
1439
  modifiers: i,
1360
- pluralRules: a,
1440
+ pluralRules: o,
1361
1441
  messages: (r, i) => {
1362
1442
  let a = s(n, r);
1363
1443
  if (a == null && (d || i)) {
1364
- let [n, , i] = Ut(d || e, r, t, c, l, u);
1444
+ let [n, , i] = dn(d || e, r, t, c, l, u);
1365
1445
  a = n ?? s(i, r);
1366
1446
  }
1367
- if (T(a) || z(a)) {
1368
- let n = !1, i = Wt(e, r, t, a, r, () => {
1447
+ if (v(a) || B(a)) {
1448
+ let n = !1, i = fn(e, r, t, a, r, () => {
1369
1449
  n = !0;
1370
1450
  });
1371
- return n ? Bt : i;
1372
- } else if ($(a)) return a;
1373
- else return Bt;
1451
+ return n ? cn : i;
1452
+ }
1453
+ return Q(a) ? a : cn;
1374
1454
  },
1375
1455
  processor: e.processor ?? void 0,
1376
1456
  list: r.list ?? void 0,
1377
1457
  named: r.named ?? void 0,
1378
- pluralIndex: o(r.plural) ? r.plural : void 0
1458
+ pluralIndex: a(r.plural) ? r.plural : void 0
1379
1459
  };
1380
1460
  }
1381
- return e.AST_NODE_PROPS_KEYS = we, e.CORE_ERROR_CODES_EXTEND_POINT = 24, e.CORE_WARN_CODES_EXTEND_POINT = 10, e.CoreWarnCodes = Q, e.DATETIME_FORMAT_OPTIONS_KEYS = St, e.DEFAULT_LOCALE = Qe, e.DEFAULT_MESSAGE_DATA_TYPE = jt, e.MISSING_RESOLVE_VALUE = ``, e.NOT_RESOLVED = -1, e.NUMBER_FORMAT_OPTIONS_KEYS = Et, e.VERSION = Ze, e.clearCompileCache = Ae, e.clearDateTimeFormat = wt, e.clearNumberFormat = Ot, e.compile = Me, e.createCompileError = I, e.createCoreContext = dt, e.createCoreError = Y, e.createMessageContext = zt, e.datetime = xt, e.fallbackWithLocaleChain = Ie, e.fallbackWithSimple = Fe, e.getFallbackContext = lt, e.getLocale = X, e.getLocaleMessage = pt, e.getWarnMessage = Xe, e.handleMissing = _t, e.isAlmostSameLocale = yt, e.isImplicitFallback = bt, e.isMessageAST = z, e.isMessageFunction = $, e.isTranslateFallbackWarn = ht, e.isTranslateMissingWarn = gt, e.number = Tt, e.parse = Ge, e.parseDateTimeArgs = Ct, e.parseNumberArgs = Dt, e.parseTranslateArgs = Gt, e.registerLocaleFallbacker = ot, e.registerMessageCompiler = nt, e.registerMessageResolver = it, e.resolveLocale = Pe, e.resolveValue = Je, e.resolveWithKeyValue = qe, e.setFallbackContext = ct, e.setLocaleMessage = mt, e.translate = Vt, e.updateFallbackLocale = vt, e;
1461
+ return e.AST_NODE_PROPS_KEYS = ze, e.CORE_ERROR_CODES_EXTEND_POINT = 23, e.CORE_WARN_CODES_EXTEND_POINT = 13, e.CoreWarnCodes = J, e.DATETIME_FORMAT_OPTIONS_KEYS = Wt, e.DEFAULT_LOCALE = Y, e.DEFAULT_MESSAGE_DATA_TYPE = $t, e.MISSING_RESOLVE_VALUE = ``, e.NOT_RESOLVED = -1, e.NUMBER_FORMAT_OPTIONS_KEYS = Jt, e.VERSION = pt, e.clearCompileCache = Ge, e.clearDateTimeFormat = Kt, e.clearNumberFormat = Xt, e.compile = qe, e.createCompileError = P, e.createCoreContext = Ct, e.createCoreError = K, e.createMessageContext = sn, e.datetime = Ut, e.fallbackWithLocaleChain = Qe, e.fallbackWithSimple = Ze, e.getLocale = Je, e.getLocaleMessage = Tt, e.getWarnMessage = ft, e.handleMissing = jt, e.isAlmostSameLocale = Pt, e.isFallbackLocale = Dt, e.isImplicitFallback = Ft, e.isMessageAST = B, e.isMessageFormat = $, e.isMessageFunction = Q, e.isTranslateFallbackWarn = kt, e.isTranslateMissingWarn = At, e.isWarnOption = Ot, e.number = qt, e.parse = st, e.parseDateTimeArgs = Gt, e.parseNumberArgs = Yt, e.parseTranslateArgs = pn, e.registerLocaleFallbacker = xt, e.registerMessageCompiler = _t, e.registerMessageResolver = yt, e.resolveLocale = Xe, e.resolveValue = ut, e.resolveWithKeyValue = lt, e.setLocaleMessage = Et, e.translate = ln, e.updateFallbackLocale = Nt, e;
1382
1462
  })({});