@intlify/core 12.0.0-alpha.11 → 12.0.0-alpha.13

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,5 +1,5 @@
1
1
  /**
2
- * @intlify/core v12.0.0-alpha.11
2
+ * @intlify/core v12.0.0-alpha.13
3
3
  * (c) 2016-present kazuya kawaguchi and contributors
4
4
  * @license MIT
5
5
  **/ const e = /\{([0-9a-z]+)\}/gi;
@@ -34,7 +34,7 @@ function T(e) {
34
34
  function ne(e) {
35
35
  return e.replace(/&(?![a-z0-9#]{2,6};)/gi, `&amp;`).replace(/"/g, `&quot;`).replace(/'/g, `&apos;`).replace(/</g, `&lt;`).replace(/>/g, `&gt;`);
36
36
  }
37
- const re = /^javascript:/i, ie = /^(?:href|xlink:href|src|action|formaction)$/i, ae = /&#(?:x([0-9a-f]+)|(\d+));?/gi, E = /&(?:Tab|NewLine);/g, oe = /&colon;?/gi, se = /[\u0000-\u0020\u007f-\u009f]/g, ce = /^on\w/i, le = /^srcdoc$/i, ue = /^(?:base|animate|set|script|plaintext)$/i, de = /^(?:iframe|noembed|noframes|noscript|style|textarea|title|xmp)$/i, D = /<(\/?)([a-z][^\t\n\f\r />]*)/iy, O = /([\t\n\f\r /]*)(?:(>)|([^\t\n\f\r />][^\t\n\f\r />=]*)(?:[\t\n\f\r ]*=[\t\n\f\r ]*(?:(["'])([\s\S]*?)(\4|$)|([^\t\n\f\r >]*)))?)/y, k = /<!--(?:>|->|[\s\S]*?--!?>)/y;
37
+ const re = /^javascript:/i, ie = /^(?:href|xlink:href|src|action|formaction)$/i, E = /&#(?:x([0-9a-f]+)|(\d+));?/gi, D = /&(?:Tab|NewLine);/g, ae = /&colon;?/gi, oe = /[\u0000-\u0020\u007f-\u009f]/g, se = /^on\w/i, ce = /^srcdoc$/i, le = /^(?:base|animate|set|script|plaintext)$/i, ue = /^(?:iframe|noembed|noframes|noscript|style|textarea|title|xmp)$/i, O = /<(\/?)([a-z][^\t\n\f\r />]*)/iy, de = /([\t\n\f\r /]*)(?:(>)|([^\t\n\f\r />][^\t\n\f\r />=]*)(?:[\t\n\f\r ]*=[\t\n\f\r ]*(?:(["'])([\s\S]*?)(\4|$)|([^\t\n\f\r >]*)))?)/y, k = /<!--(?:>|->|[\s\S]*?--!?>)/y;
38
38
  function fe(e, t, n) {
39
39
  let r = t || n;
40
40
  if (!r) return e;
@@ -42,7 +42,7 @@ function fe(e, t, n) {
42
42
  return i <= 127 ? String.fromCharCode(i) : e;
43
43
  }
44
44
  function pe(e) {
45
- let t = e.replace(ae, fe).replace(E, ``).replace(oe, `:`).replace(se, ``);
45
+ let t = e.replace(E, fe).replace(D, ``).replace(ae, `:`).replace(oe, ``);
46
46
  return re.test(t);
47
47
  }
48
48
  function me(e) {
@@ -70,65 +70,150 @@ function A(e) {
70
70
  }
71
71
  function ge(e, t, n, r) {
72
72
  let i = e;
73
- if (ce.test(e) ? (r.eventHandler = !0, i = `&#111;n${e.slice(2)}`) : le.test(e) && (r.srcdoc = !0, i = `&#115;${e.slice(1)}`), t === void 0) return i;
73
+ if (se.test(e) ? (r.eventHandler = !0, i = `&#111;n${e.slice(2)}`) : ce.test(e) && (r.srcdoc = !0, i = `&#115;${e.slice(1)}`), t === void 0) return i;
74
74
  let a = n || ``;
75
75
  return `${i}=${a}${he(e, t)}${a}`;
76
76
  }
77
- function _e(e, t, n) {
78
- D.lastIndex = t;
79
- let r = D.exec(e);
77
+ const _e = /^(?:area|base|basefont|bgsound|br|col|embed|frame|hr|image|img|input|keygen|link|meta|param|source|track|wbr|html|head|body|frameset)$/, ve = /^(?:[bipsu]|big|blockquote|body|br|center|code|dd|div|dl|dt|em|embed|h[1-6]|head|hr|img|li|listing|menu|meta|nobr|ol|pre|ruby|small|span|strong|strike|sub|sup|table|tt|ul|var)$/, ye = /^(?:address|article|aside|blockquote|center|details|dialog|dir|div|dl|fieldset|figcaption|figure|footer|header|hgroup|main|menu|nav|ol|p|search|section|summary|ul|h[1-6]|pre|listing|form|li|dd|dt|plaintext|table|hr|xmp)$/, be = /^(?:applet|caption|html|table|td|th|marquee|object|template|button)$/, xe = /^(?:foreignobject|desc|title)$/, Se = /^(?:foreignobject|desc|mi|mo|mn|ms|mtext|annotation-xml)$/, Ce = /^(?:mi|mo|mn|ms|mtext)$/, we = /^(?:text\/html|application\/xhtml\+xml)$/i;
78
+ function j(e) {
79
+ return e.replace(/[A-Z]+/g, (e) => e.toLowerCase());
80
+ }
81
+ function Te(e, t) {
82
+ return !!e && e.namespace !== 0 && (!e.integration || Ce.test(e.name) && (t === `mglyph` || t === `malignmark`)) && (e.name !== `annotation-xml` || t !== `svg`);
83
+ }
84
+ function Ee(e, t) {
85
+ return ve.test(e) || e === `font` && (t.has(`color`) || t.has(`face`) || t.has(`size`));
86
+ }
87
+ function M(e, t, n) {
88
+ let r = ``;
89
+ for (let i = e.length - 1; i >= t; i--) {
90
+ let t = e[i];
91
+ t.namespace === 0 && t.name === `form` ? n[t.part] = A(n[t.part]) : r += `</${t.name}>`;
92
+ }
93
+ return e.length = t, r;
94
+ }
95
+ function De(e, t) {
96
+ let n = e.length;
97
+ for (; n > 0 && e[n - 1].namespace !== 0 && !e[n - 1].integration;) n--;
98
+ return M(e, n, t);
99
+ }
100
+ function Oe(e, t, n, r, i) {
101
+ let a = t.length + 1, o = ``, s = e[e.length - 1];
102
+ if (Te(s, n)) {
103
+ if (!Ee(n, r)) return i || e.push({
104
+ name: n,
105
+ namespace: s.namespace,
106
+ integration: s.namespace === 1 ? xe.test(n) : Ce.test(n) || n === `annotation-xml` && we.test((r.get(`encoding`) || ``).replace(E, fe)),
107
+ part: a
108
+ }), o;
109
+ o = De(e, t);
110
+ }
111
+ if (ye.test(n)) for (let n = e.length - 1; n >= 0; n--) {
112
+ let r = e[n];
113
+ if (r.namespace === 0 ? be.test(r.name) : r.integration) break;
114
+ if (r.namespace === 0 && r.name === `p`) {
115
+ o += M(e, n, t);
116
+ break;
117
+ }
118
+ }
119
+ if (!Se.test(n)) return n === `svg` || n === `math` ? i || e.push({
120
+ name: n,
121
+ namespace: n === `svg` ? 1 : 2,
122
+ integration: !1,
123
+ part: a
124
+ }) : _e.test(n) || e.push({
125
+ name: n,
126
+ namespace: 0,
127
+ integration: !1,
128
+ part: a
129
+ }), o;
130
+ }
131
+ function ke(e, t, n) {
132
+ let r = ``;
133
+ (n === `p` || n === `br`) && (r = De(e, t));
134
+ let i = e.length - 1;
135
+ for (; i >= 0 && e[i].namespace !== 0 && e[i].name !== n;) i--;
136
+ if (!(i >= 0 && e[i].namespace !== 0)) for (; i >= 0 && (e[i].namespace !== 0 || e[i].name !== n);) i--;
137
+ return i < 0 ? n === `br` || n === `p` ? r : void 0 : (r += M(e, i + 1, t), e.length = i, r);
138
+ }
139
+ function Ae(e, t, n) {
140
+ O.lastIndex = t;
141
+ let r = O.exec(e);
80
142
  if (!r) return;
81
- let [, i, a] = r, o = r[0], s;
82
- for (O.lastIndex = D.lastIndex; s = O.exec(e);) {
83
- let [r, c, l, u, d, f, p, m] = s;
84
- if (l) {
85
- let n = O.lastIndex;
143
+ let [, i, a] = r, o = r[0], s = /* @__PURE__ */ new Map(), c;
144
+ for (de.lastIndex = O.lastIndex; c = de.exec(e);) {
145
+ let [r, l, u, d, f, p, m, h] = c;
146
+ if (u) {
147
+ let n = de.lastIndex;
86
148
  return [
87
149
  i ? e.slice(t, n) : o + r,
88
150
  a,
89
- n
151
+ n,
152
+ !i && l.endsWith(`/`),
153
+ s
90
154
  ];
91
155
  }
92
- if (d && !p) break;
93
- i || (o += c + ge(u, d ? f : m, d, n));
156
+ if (f && !m) break;
157
+ if (!i) {
158
+ let e = f ? p : h, t = j(d);
159
+ s.has(t) || s.set(t, e || ``), o += l + ge(d, e, f, n);
160
+ }
94
161
  }
95
162
  return [
96
163
  o,
97
164
  a,
98
- -1
165
+ -1,
166
+ !1,
167
+ s
99
168
  ];
100
169
  }
101
- function ve(e, t, n) {
170
+ function je(e, t, n) {
102
171
  for (let r = e.indexOf(`</`, t); r !== -1; r = e.indexOf(`</`, r + 2)) {
103
- let t = _e(e, r, {});
172
+ let t = Ae(e, r, {});
104
173
  if (t && t[1].toLowerCase() === n.toLowerCase()) return t[2] === -1 ? -1 : r;
105
174
  }
106
175
  return -1;
107
176
  }
108
- function ye(e) {
109
- let t = {}, n = ``, r = 0, i;
110
- for (; (i = e.indexOf(`<`, r)) !== -1;) {
111
- n += e.slice(r, i), r = i + 1;
112
- let a = _e(e, i, t);
113
- if (a) {
114
- let [o, s, c] = a;
115
- if (c === -1) {
116
- t.unclosed = !0, n += A(e.slice(i)), r = e.length;
177
+ function Me(e) {
178
+ let t = {}, n = [], r = [], i = 0, a;
179
+ for (; (a = e.indexOf(`<`, i)) !== -1;) {
180
+ n.push(e.slice(i, a)), i = a + 1;
181
+ let o = Ae(e, a, t);
182
+ if (o) {
183
+ let [s, c, l, u, d] = o;
184
+ if (l === -1) {
185
+ t.unclosed = !0, n.push(A(e.slice(a))), i = e.length;
117
186
  break;
118
187
  }
119
- if (r = c, o[1] === `/`) n += o;
120
- else if (ue.test(s)) t.element = !0, n += A(o);
121
- else if (de.test(s)) {
122
- let i = ve(e, c, s);
123
- i === -1 ? (t.unclosed = !0, n += A(o)) : (n += o + A(e.slice(c, i)), r = i);
124
- } else n += o;
125
- } else k.lastIndex = i, k.test(e) ? (n += e.slice(i, k.lastIndex), r = k.lastIndex) : (e.startsWith(`<!--`, i) && (t.unclosed = !0), n += `&lt;`);
126
- }
127
- return n += e.slice(r), n;
128
- }
129
- const be = (e) => !y(e) || h(e);
130
- function xe(e, t) {
131
- if (be(e) || be(t) || t === Object.prototype) throw Error(`Invalid value`);
188
+ if (i = l, s[1] === `/`) {
189
+ let e = ke(r, n, j(c));
190
+ e === void 0 ? t.closed = !0 : (e && (t.closed = !0), n.push(e + s));
191
+ } else if (le.test(c)) t.element = !0, n.push(A(s));
192
+ else {
193
+ let a = ``;
194
+ if (ue.test(c)) {
195
+ let r = je(e, l, c);
196
+ if (r === -1) {
197
+ t.unclosed = !0, n.push(A(s));
198
+ continue;
199
+ }
200
+ a = A(e.slice(l, r)), i = r;
201
+ }
202
+ let o = Oe(r, n, j(c), d, u);
203
+ o === void 0 ? (t.closed = !0, n.push(A(s) + a)) : n.push(o, s + a);
204
+ }
205
+ } else k.lastIndex = a, k.test(e) ? (n.push(e.slice(a, k.lastIndex)), i = k.lastIndex) : (e.startsWith(`<!--`, a) && (t.unclosed = !0), n.push(`&lt;`));
206
+ }
207
+ n.push(e.slice(i));
208
+ for (let e = r.length - 1; e >= 0; e--) {
209
+ let i = r[e];
210
+ t.closed = !0, i.namespace === 0 && i.name === `form` ? n[i.part] = A(n[i.part]) : n.push(`</${i.name}>`);
211
+ }
212
+ return n.join(``);
213
+ }
214
+ const Ne = (e) => !y(e) || h(e);
215
+ function Pe(e, t) {
216
+ if (Ne(e) || Ne(t) || t === Object.prototype) throw Error(`Invalid value`);
132
217
  let n = [e, t];
133
218
  for (; n.length;) {
134
219
  let e = n.pop(), t = n.pop(), r = Object.keys(t);
@@ -150,7 +235,7 @@ function xe(e, t) {
150
235
  }
151
236
  }
152
237
  }
153
- const j = {
238
+ const N = {
154
239
  EXPECTED_TOKEN: 1,
155
240
  INVALID_TOKEN_IN_PLACEHOLDER: 2,
156
241
  UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER: 3,
@@ -168,185 +253,185 @@ const j = {
168
253
  UNHANDLED_CODEGEN_NODE_TYPE: 15,
169
254
  UNHANDLED_MINIFIER_NODE_TYPE: 16
170
255
  };
171
- j.EXPECTED_TOKEN, j.INVALID_TOKEN_IN_PLACEHOLDER, j.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER, j.UNKNOWN_ESCAPE_SEQUENCE, j.INVALID_UNICODE_ESCAPE_SEQUENCE, j.UNBALANCED_CLOSING_BRACE, j.UNTERMINATED_CLOSING_BRACE, j.EMPTY_PLACEHOLDER, j.NOT_ALLOW_NEST_PLACEHOLDER, j.INVALID_LINKED_FORMAT, j.MUST_HAVE_MESSAGES_IN_PLURAL, j.UNEXPECTED_EMPTY_LINKED_MODIFIER, j.UNEXPECTED_EMPTY_LINKED_KEY, j.UNEXPECTED_LEXICAL_ANALYSIS, j.UNHANDLED_CODEGEN_NODE_TYPE, j.UNHANDLED_MINIFIER_NODE_TYPE;
172
- function Se(e, t, n = {}) {
256
+ 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;
257
+ function Fe(e, t, n = {}) {
173
258
  let { domain: r, messages: i, args: a } = n, o = SyntaxError(String(e));
174
259
  return o.code = e, t && (o.location = t), o.domain = r, o;
175
260
  }
176
- function M(e) {
177
- return y(e) && N(e) === 0 && (f(e, `b`) || f(e, `body`));
261
+ function P(e) {
262
+ return y(e) && F(e) === 0 && (f(e, `b`) || f(e, `body`));
178
263
  }
179
- const Ce = [`b`, `body`];
180
- function we(e) {
181
- return F(e, Ce);
264
+ const Ie = [`b`, `body`];
265
+ function Le(e) {
266
+ return L(e, Ie);
182
267
  }
183
- const Te = [`c`, `cases`];
184
- function Ee(e) {
185
- return F(e, Te, []);
268
+ const Re = [`c`, `cases`];
269
+ function ze(e) {
270
+ return L(e, Re, []);
186
271
  }
187
- const De = [`s`, `static`];
188
- function Oe(e) {
189
- return F(e, De);
272
+ const Be = [`s`, `static`];
273
+ function Ve(e) {
274
+ return L(e, Be);
190
275
  }
191
- const ke = [`i`, `items`];
192
- function Ae(e) {
193
- return F(e, ke, []);
276
+ const He = [`i`, `items`];
277
+ function Ue(e) {
278
+ return L(e, He, []);
194
279
  }
195
- const je = [`t`, `type`];
196
- function N(e) {
197
- return F(e, je);
280
+ const We = [`t`, `type`];
281
+ function F(e) {
282
+ return L(e, We);
198
283
  }
199
- const Me = [`v`, `value`];
200
- function P(e, t) {
201
- let n = F(e, Me);
284
+ const Ge = [`v`, `value`];
285
+ function I(e, t) {
286
+ let n = L(e, Ge);
202
287
  if (n != null) return n;
203
- throw I(t);
288
+ throw R(t);
204
289
  }
205
- const Ne = [`m`, `modifier`];
206
- function Pe(e) {
207
- return F(e, Ne);
290
+ const Ke = [`m`, `modifier`];
291
+ function qe(e) {
292
+ return L(e, Ke);
208
293
  }
209
- const Fe = [`k`, `key`];
210
- function Ie(e) {
211
- let t = F(e, Fe);
294
+ const Je = [`k`, `key`];
295
+ function Ye(e) {
296
+ let t = L(e, Je);
212
297
  if (t) return t;
213
- throw I(6);
298
+ throw R(6);
214
299
  }
215
- function F(e, t, n) {
300
+ function L(e, t, n) {
216
301
  for (let n = 0; n < t.length; n++) {
217
302
  let r = t[n];
218
303
  if (f(e, r) && e[r] != null) return e[r];
219
304
  }
220
305
  return n;
221
306
  }
222
- const Le = [
223
- ...Ce,
224
- ...Te,
225
- ...De,
226
- ...ke,
227
- ...Fe,
228
- ...Ne,
229
- ...Me,
230
- ...je
307
+ const Xe = [
308
+ ...Ie,
309
+ ...Re,
310
+ ...Be,
311
+ ...He,
312
+ ...Je,
313
+ ...Ke,
314
+ ...Ge,
315
+ ...We
231
316
  ];
232
- function I(e) {
317
+ function R(e) {
233
318
  return Error(`unhandled node type: ${e}`);
234
319
  }
235
- function Re(e) {
236
- return (t) => ze(t, e);
237
- }
238
- function ze(e, t) {
239
- let n = we(t);
240
- if (n == null) throw I(0);
241
- if (N(n) === 1) {
242
- let t = Ee(n);
243
- return e.plural(t.reduce((t, n) => [...h(t) ? t : [t], Be(e, n)], []));
320
+ function Ze(e) {
321
+ return (t) => Qe(t, e);
322
+ }
323
+ function Qe(e, t) {
324
+ let n = Le(t);
325
+ if (n == null) throw R(0);
326
+ if (F(n) === 1) {
327
+ let t = ze(n);
328
+ return e.plural(t.reduce((t, n) => [...h(t) ? t : [t], $e(e, n)], []));
244
329
  }
245
- return Be(e, n);
330
+ return $e(e, n);
246
331
  }
247
- function Be(e, t) {
248
- let n = Oe(t);
332
+ function $e(e, t) {
333
+ let n = Ve(t);
249
334
  if (n != null) return e.type === `text` ? n : e.normalize([n]);
250
335
  {
251
- let n = Ae(t).reduce((t, n) => [...t, L(e, n)], []);
336
+ let n = Ue(t).reduce((t, n) => [...t, z(e, n)], []);
252
337
  return e.normalize(n);
253
338
  }
254
339
  }
255
- function L(e, t) {
256
- let n = N(t);
340
+ function z(e, t) {
341
+ let n = F(t);
257
342
  switch (n) {
258
- case 3: return P(t, n);
259
- case 9: return P(t, n);
343
+ case 3: return I(t, n);
344
+ case 9: return I(t, n);
260
345
  case 4: {
261
346
  let r = t;
262
347
  if (f(r, `k`) && r.k) return e.interpolate(e.named(r.k));
263
348
  if (f(r, `key`) && r.key) return e.interpolate(e.named(r.key));
264
- throw I(n);
349
+ throw R(n);
265
350
  }
266
351
  case 5: {
267
352
  let r = t;
268
353
  if (f(r, `i`) && i(r.i)) return e.interpolate(e.list(r.i));
269
354
  if (f(r, `index`) && i(r.index)) return e.interpolate(e.list(r.index));
270
- throw I(n);
355
+ throw R(n);
271
356
  }
272
357
  case 6: {
273
- let n = t, r = Pe(n), i = Ie(n);
274
- return e.linked(L(e, i), r ? L(e, r) : void 0, e.type);
358
+ let n = t, r = qe(n), i = Ye(n);
359
+ return e.linked(z(e, i), r ? z(e, r) : void 0, e.type);
275
360
  }
276
- case 7: return P(t, n);
277
- case 8: return P(t, n);
361
+ case 7: return I(t, n);
362
+ case 8: return I(t, n);
278
363
  default: throw Error(`unhandled node on format message part: ${n}`);
279
364
  }
280
365
  }
281
- let R = u();
282
- function Ve() {
283
- R = u();
366
+ let B = u();
367
+ function et() {
368
+ B = u();
284
369
  }
285
- function He(e, t) {
370
+ function tt(e, t) {
286
371
  {
287
- if (!M(e)) return (() => e);
372
+ if (!P(e)) return (() => e);
288
373
  let t = e.cacheKey;
289
- return t ? R[t] || (R[t] = Re(e)) : Re(e);
374
+ return t ? B[t] || (B[t] = Ze(e)) : Ze(e);
290
375
  }
291
376
  }
292
- const z = {
377
+ const V = {
293
378
  INVALID_ARGUMENT: 17,
294
379
  INVALID_DATE_ARGUMENT: 18,
295
380
  INVALID_ISO_DATE_ARGUMENT: 19,
296
381
  NOT_SUPPORT_LOCALE_PROMISE_VALUE: 20,
297
382
  NOT_SUPPORT_LOCALE_ASYNC_FUNCTION: 21,
298
383
  NOT_SUPPORT_LOCALE_TYPE: 22
299
- }, Ue = 23;
300
- function We(e) {
301
- return Se(e, null, void 0);
384
+ }, nt = 23;
385
+ function rt(e) {
386
+ return Fe(e, null, void 0);
302
387
  }
303
- 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;
304
- function B(e, t) {
305
- return t.locale == null ? H(e.locale) : H(t.locale);
388
+ V.INVALID_ARGUMENT, V.INVALID_DATE_ARGUMENT, V.INVALID_ISO_DATE_ARGUMENT, V.NOT_SUPPORT_LOCALE_PROMISE_VALUE, V.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION, V.NOT_SUPPORT_LOCALE_TYPE;
389
+ function it(e, t) {
390
+ return t.locale == null ? U(e.locale) : U(t.locale);
306
391
  }
307
- let V;
308
- function H(e) {
392
+ let H;
393
+ function U(e) {
309
394
  if (_(e)) return e;
310
395
  if (g(e)) {
311
- if (e.resolvedOnce && V != null) return V;
396
+ if (e.resolvedOnce && H != null) return H;
312
397
  if (e.constructor.name === `Function`) {
313
398
  let t = e();
314
- if (b(t)) throw Error(z.NOT_SUPPORT_LOCALE_PROMISE_VALUE);
315
- return V = t;
399
+ if (b(t)) throw Error(V.NOT_SUPPORT_LOCALE_PROMISE_VALUE);
400
+ return H = t;
316
401
  }
317
- throw Error(z.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION);
402
+ throw Error(V.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION);
318
403
  }
319
- throw Error(z.NOT_SUPPORT_LOCALE_TYPE);
404
+ throw Error(V.NOT_SUPPORT_LOCALE_TYPE);
320
405
  }
321
- function Ge(e, t, n) {
406
+ function at(e, t, n) {
322
407
  return [.../* @__PURE__ */ new Set([n, ...h(t) ? t : y(t) ? Object.keys(t).filter((e) => e !== "default") : _(t) ? [t] : [n]])];
323
408
  }
324
- function Ke(e, t, n) {
409
+ function ot(e, t, n) {
325
410
  let r = _(n) ? n : K, i = e, a;
326
411
  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)));
327
412
  let o = a.get(r);
328
413
  if (o) return o;
329
414
  let s = [], c = [n];
330
- for (; h(c);) c = qe(s, c, t);
415
+ for (; h(c);) c = st(s, c, t);
331
416
  let l = h(t) || !C(t) ? t : t.default ? t.default : null;
332
- return c = _(l) ? [l] : l, h(c) && qe(s, c, !1), a.set(r, s), s;
417
+ return c = _(l) ? [l] : l, h(c) && st(s, c, !1), a.set(r, s), s;
333
418
  }
334
- function qe(e, t, n) {
419
+ function st(e, t, n) {
335
420
  let r = !0;
336
421
  for (let i = 0; i < t.length && v(r); i++) {
337
422
  let a = t[i];
338
- _(a) && (r = Je(e, t[i], n));
423
+ _(a) && (r = ct(e, t[i], n));
339
424
  }
340
425
  return r;
341
426
  }
342
- function Je(e, t, n) {
427
+ function ct(e, t, n) {
343
428
  let r, i = t.split(`-`);
344
429
  do
345
- r = Ye(e, i.join(`-`), n), i.splice(-1, 1);
430
+ r = lt(e, i.join(`-`), n), i.splice(-1, 1);
346
431
  while (i.length && r === !0);
347
432
  return r;
348
433
  }
349
- function Ye(e, t, n) {
434
+ function lt(e, t, n) {
350
435
  let r = !1;
351
436
  if (!e.includes(t) && (r = !0, t)) {
352
437
  r = t[t.length - 1] !== `!`;
@@ -355,53 +440,53 @@ function Ye(e, t, n) {
355
440
  }
356
441
  return r;
357
442
  }
358
- const U = [];
359
- U[0] = {
443
+ const W = [];
444
+ W[0] = {
360
445
  w: [0],
361
446
  i: [3, 0],
362
447
  "[": [4],
363
448
  o: [7]
364
- }, U[1] = {
449
+ }, W[1] = {
365
450
  w: [1],
366
451
  ".": [2],
367
452
  "[": [4],
368
453
  o: [7]
369
- }, U[2] = {
454
+ }, W[2] = {
370
455
  w: [2],
371
456
  i: [3, 0],
372
457
  0: [3, 0]
373
- }, U[3] = {
458
+ }, W[3] = {
374
459
  i: [3, 0],
375
460
  0: [3, 0],
376
461
  w: [1, 1],
377
462
  ".": [2, 1],
378
463
  "[": [4, 1],
379
464
  o: [7, 1]
380
- }, U[4] = {
465
+ }, W[4] = {
381
466
  "'": [5, 0],
382
467
  "\"": [6, 0],
383
468
  "[": [4, 2],
384
469
  "]": [1, 3],
385
470
  o: 8,
386
471
  l: [4, 0]
387
- }, U[5] = {
472
+ }, W[5] = {
388
473
  "'": [4, 0],
389
474
  o: 8,
390
475
  l: [5, 0]
391
- }, U[6] = {
476
+ }, W[6] = {
392
477
  "\"": [4, 0],
393
478
  o: 8,
394
479
  l: [6, 0]
395
480
  };
396
- const Xe = /^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;
397
- function Ze(e) {
398
- return Xe.test(e);
481
+ const ut = /^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;
482
+ function dt(e) {
483
+ return ut.test(e);
399
484
  }
400
- function Qe(e) {
485
+ function ft(e) {
401
486
  let t = e.charCodeAt(0);
402
487
  return t === e.charCodeAt(e.length - 1) && (t === 34 || t === 39) ? e.slice(1, -1) : e;
403
488
  }
404
- function $e(e) {
489
+ function pt(e) {
405
490
  if (e == null) return `o`;
406
491
  switch (e.charCodeAt(0)) {
407
492
  case 91:
@@ -422,11 +507,11 @@ function $e(e) {
422
507
  }
423
508
  return `i`;
424
509
  }
425
- function et(e) {
510
+ function mt(e) {
426
511
  let t = e.trim();
427
- return e.charAt(0) === `0` && isNaN(parseInt(e)) ? !1 : Ze(t) ? Qe(t) : `*` + t;
512
+ return e.charAt(0) === `0` && isNaN(parseInt(e)) ? !1 : dt(t) ? ft(t) : `*` + t;
428
513
  }
429
- function tt(e) {
514
+ function ht(e) {
430
515
  let t = [], n = -1, r = 0, i = 0, a, o, s, c, l, u, d, f = [];
431
516
  f[0] = () => {
432
517
  o === void 0 ? o = s : o += s;
@@ -437,7 +522,7 @@ function tt(e) {
437
522
  }, f[3] = () => {
438
523
  if (i > 0) i--, r = 4, f[0]();
439
524
  else {
440
- if (i = 0, o === void 0 || (o = et(o), o === !1)) return !1;
525
+ if (i = 0, o === void 0 || (o = mt(o), o === !1)) return !1;
441
526
  f[1]();
442
527
  }
443
528
  };
@@ -446,29 +531,29 @@ function tt(e) {
446
531
  if (r === 5 && t === `'` || r === 6 && t === `"`) return n++, s = `\\` + t, f[0](), !0;
447
532
  }
448
533
  for (; r !== null;) if (n++, a = e[n], !(a === `\\` && p())) {
449
- if (c = $e(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;
534
+ if (c = pt(a), d = W[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;
450
535
  if (r === 7) return t;
451
536
  }
452
537
  }
453
- const nt = /* @__PURE__ */ new Map();
454
- function rt(e, t) {
538
+ const gt = /* @__PURE__ */ new Map();
539
+ function _t(e, t) {
455
540
  return y(e) ? p(e, t) : null;
456
541
  }
457
- function it(e, t) {
542
+ function vt(e, t) {
458
543
  if (!y(e)) return null;
459
- let n = nt.get(t);
460
- if (n || (n = tt(t), n && nt.set(t, n)), !n) return null;
544
+ let n = gt.get(t);
545
+ if (n || (n = ht(t), n && gt.set(t, n)), !n) return null;
461
546
  let r = n.length, i = e, a = 0;
462
547
  for (; a < r;) {
463
548
  let e = n[a];
464
- if (Le.includes(e) && M(i) || !y(i) || !f(i, e)) return null;
549
+ if (Xe.includes(e) && P(i) || !y(i) || !f(i, e)) return null;
465
550
  let t = i[e];
466
551
  if (t === void 0 || g(i)) return null;
467
552
  i = t, a++;
468
553
  }
469
554
  return i;
470
555
  }
471
- const W = {
556
+ const G = {
472
557
  NOT_FOUND_KEY: 1,
473
558
  FALLBACK_TO_TRANSLATE: 2,
474
559
  CANNOT_FORMAT_NUMBER: 3,
@@ -481,50 +566,50 @@ const W = {
481
566
  IGNORE_UNSAFE_LOCALE: 10,
482
567
  FALLBACK_TO_DEFAULT_PLURAL_RULE: 11,
483
568
  FALLBACK_FROM_INVALID_LOCALE: 12
484
- }, at = 13, ot = {
485
- [W.NOT_FOUND_KEY]: `Not found '{key}' key in '{locale}' locale {resource}.`,
486
- [W.FALLBACK_TO_TRANSLATE]: `Fall back to translate '{key}' key with '{target}' locale.`,
487
- [W.CANNOT_FORMAT_NUMBER]: `Cannot format a number value due to not supported Intl.NumberFormat.`,
488
- [W.FALLBACK_TO_NUMBER_FORMAT]: `Fall back to number format '{key}' key with '{target}' locale.`,
489
- [W.CANNOT_FORMAT_DATE]: `Cannot format a date value due to not supported Intl.DateTimeFormat.`,
490
- [W.FALLBACK_TO_DATE_FORMAT]: `Fall back to datetime format '{key}' key with '{target}' locale.`,
491
- [W.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.`,
492
- [W.INVALID_NUMBER_ARGUMENT]: `Invalid argument for number formatting: expected a number but received '{value}'.`,
493
- [W.INVALID_DATE_ARGUMENT]: `Invalid argument for datetime formatting: expected a Date, number, or ISO string but received '{value}'.`,
494
- [W.IGNORE_UNSAFE_LOCALE]: `Ignore '{locale}' locale: it is a property name of Object.prototype`,
495
- [W.FALLBACK_TO_DEFAULT_PLURAL_RULE]: `Fall back to the default plural rule for '{locale}' locale: Intl.PluralRules does not support it`,
496
- [W.FALLBACK_FROM_INVALID_LOCALE]: `Fall back to '{target}' locale for {type} formatting with '{locale}' locale: it is not a BCP 47 language tag`
569
+ }, yt = 13, bt = {
570
+ [G.NOT_FOUND_KEY]: `Not found '{key}' key in '{locale}' locale {resource}.`,
571
+ [G.FALLBACK_TO_TRANSLATE]: `Fall back to translate '{key}' key with '{target}' locale.`,
572
+ [G.CANNOT_FORMAT_NUMBER]: `Cannot format a number value due to not supported Intl.NumberFormat.`,
573
+ [G.FALLBACK_TO_NUMBER_FORMAT]: `Fall back to number format '{key}' key with '{target}' locale.`,
574
+ [G.CANNOT_FORMAT_DATE]: `Cannot format a date value due to not supported Intl.DateTimeFormat.`,
575
+ [G.FALLBACK_TO_DATE_FORMAT]: `Fall back to datetime format '{key}' key with '{target}' locale.`,
576
+ [G.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.`,
577
+ [G.INVALID_NUMBER_ARGUMENT]: `Invalid argument for number formatting: expected a number but received '{value}'.`,
578
+ [G.INVALID_DATE_ARGUMENT]: `Invalid argument for datetime formatting: expected a Date, number, or ISO string but received '{value}'.`,
579
+ [G.IGNORE_UNSAFE_LOCALE]: `Ignore '{locale}' locale: it is a property name of Object.prototype`,
580
+ [G.FALLBACK_TO_DEFAULT_PLURAL_RULE]: `Fall back to the default plural rule for '{locale}' locale: Intl.PluralRules does not support it`,
581
+ [G.FALLBACK_FROM_INVALID_LOCALE]: `Fall back to '{target}' locale for {type} formatting with '{locale}' locale: it is not a BCP 47 language tag`
497
582
  };
498
- function st(e, ...n) {
499
- return t(ot[e], ...n);
583
+ function xt(e, ...n) {
584
+ return t(bt[e], ...n);
500
585
  }
501
- const G = `12.0.0-alpha.11`, ct = -1, K = `en-US`, lt = ``, ut = (e) => `${e.charAt(0).toLocaleUpperCase()}${e.substr(1)}`;
502
- function dt() {
586
+ const St = `12.0.0-alpha.13`, Ct = -1, K = `en-US`, wt = ``, Tt = (e) => `${e.charAt(0).toLocaleUpperCase()}${e.substr(1)}`;
587
+ function Et() {
503
588
  return {
504
589
  upper: (e, t) => t === `text` && _(e) ? e.toUpperCase() : t === `vnode` && y(e) && `__v_isVNode` in e ? e.children.toUpperCase() : e,
505
590
  lower: (e, t) => t === `text` && _(e) ? e.toLowerCase() : t === `vnode` && y(e) && `__v_isVNode` in e ? e.children.toLowerCase() : e,
506
- capitalize: (e, t) => t === `text` && _(e) ? ut(e) : t === `vnode` && y(e) && `__v_isVNode` in e ? ut(e.children) : e
591
+ capitalize: (e, t) => t === `text` && _(e) ? Tt(e) : t === `vnode` && y(e) && `__v_isVNode` in e ? Tt(e.children) : e
507
592
  };
508
593
  }
509
- let ft;
510
- function pt(e) {
511
- ft = e;
594
+ let Dt;
595
+ function Ot(e) {
596
+ Dt = e;
512
597
  }
513
- let mt;
514
- function ht(e) {
515
- mt = e;
598
+ let kt;
599
+ function At(e) {
600
+ kt = e;
516
601
  }
517
- let gt;
518
- function _t(e) {
519
- gt = e;
602
+ let jt;
603
+ function Mt(e) {
604
+ jt = e;
520
605
  }
521
- let vt = 0;
522
- function yt(e = {}) {
523
- let t = g(e.onWarn) ? e.onWarn : te, n = _(e.version) ? e.version : G, r = _(e.locale) || g(e.locale) ? e.locale : K, i = g(r) ? K : r, a = St(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, dt()), 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, ee = !v(e.warnHtmlMessage) || e.warnHtmlMessage, T = !!e.escapeParameter, ne = g(e.messageCompiler) ? e.messageCompiler : ft || null, re = g(e.messageResolver) ? e.messageResolver : mt || rt, ie = g(e.localeFallbacker) ? e.localeFallbacker : gt || Ge, ae = y(e.fallbackContext) ? e.fallbackContext : void 0;
524
- vt++;
525
- let E = {
606
+ let Nt = 0;
607
+ function Pt(e = {}) {
608
+ let t = g(e.onWarn) ? e.onWarn : te, n = _(e.version) ? e.version : St, r = _(e.locale) || g(e.locale) ? e.locale : K, i = g(r) ? K : r, a = Lt(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, Et()), 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, ee = !v(e.warnHtmlMessage) || e.warnHtmlMessage, T = !!e.escapeParameter, ne = g(e.messageCompiler) ? e.messageCompiler : Dt || null, re = g(e.messageResolver) ? e.messageResolver : kt || _t, ie = g(e.localeFallbacker) ? e.localeFallbacker : jt || at, E = y(e.fallbackContext) ? e.fallbackContext : void 0;
609
+ Nt++;
610
+ let D = {
526
611
  version: n,
527
- cid: vt,
612
+ cid: Nt,
528
613
  locale: r,
529
614
  fallbackLocale: a,
530
615
  messages: o,
@@ -542,31 +627,31 @@ function yt(e = {}) {
542
627
  messageCompiler: ne,
543
628
  messageResolver: re,
544
629
  localeFallbacker: ie,
545
- fallbackContext: ae,
630
+ fallbackContext: E,
546
631
  onWarn: t
547
632
  };
548
- return E.datetimeFormats = s, E.numberFormats = l, E.__datetimeFormatters = /* @__PURE__ */ new Map(), E.__numberFormatters = /* @__PURE__ */ new Map(), E;
633
+ return D.datetimeFormats = s, D.numberFormats = l, D.__datetimeFormatters = /* @__PURE__ */ new Map(), D.__numberFormatters = /* @__PURE__ */ new Map(), D;
549
634
  }
550
635
  const q = (e) => ({ [e]: u() });
551
- function bt(e, t) {
636
+ function Ft(e, t) {
552
637
  let n = p(e.messages, t);
553
638
  if (n == null) return;
554
639
  let r = u();
555
- return xe(n, r), r;
640
+ return Pe(n, r), r;
556
641
  }
557
- function xt(e, t, n) {
642
+ function It(e, t, n) {
558
643
  m(t) || (e.messages[t] = n);
559
644
  }
560
- function St(e) {
645
+ function Lt(e) {
561
646
  return _(e) || h(e) || C(e) || e === !1;
562
647
  }
563
648
  function J(e) {
564
649
  return v(e) || o(e);
565
650
  }
566
- function Ct(e, t) {
651
+ function Rt(e, t) {
567
652
  return o(e) ? e.test(t) : e;
568
653
  }
569
- function wt(e, t) {
654
+ function zt(e, t) {
570
655
  return o(e) ? e.test(t) : e;
571
656
  }
572
657
  function Y(e, t, n, r, i) {
@@ -577,28 +662,28 @@ function Y(e, t, n, r, i) {
577
662
  }
578
663
  return t;
579
664
  }
580
- function Tt(e, t) {
665
+ function Bt(e, t) {
581
666
  let n = e;
582
667
  y(t) ? n.__localeChainObjectCache?.delete(t) : n.__localeChainCache?.delete(t);
583
668
  }
584
- function Et(e, t, n) {
585
- Tt(e, n), e.fallbackContext && Tt(e.fallbackContext, n);
669
+ function Vt(e, t, n) {
670
+ Bt(e, n), e.fallbackContext && Bt(e.fallbackContext, n);
586
671
  {
587
672
  let { __datetimeFormatters: t, __numberFormatters: n } = e;
588
673
  t.clear(), n.clear();
589
674
  }
590
675
  e.localeFallbacker(e, n, t);
591
676
  }
592
- function Dt(e, t) {
677
+ function Ht(e, t) {
593
678
  return e !== t && e.split(`-`)[0] === t.split(`-`)[0];
594
679
  }
595
- function Ot(e, t) {
680
+ function Ut(e, t) {
596
681
  let n = t.indexOf(e);
597
682
  if (n === -1) return !1;
598
- for (let r = n + 1; r < t.length; r++) if (Dt(e, t[r])) return !0;
683
+ for (let r = n + 1; r < t.length; r++) if (Ht(e, t[r])) return !0;
599
684
  return !1;
600
685
  }
601
- function kt(e, t, n, r, i, a, o) {
686
+ function Wt(e, t, n, r, i, a, o) {
602
687
  let { fallbackLocale: s, localeFallbacker: c, onWarn: l } = e, u = c(e, s, n);
603
688
  for (let n = 0; n < u.length; n++) {
604
689
  let a = u[n], s = p(p(r, a) || {}, t);
@@ -607,54 +692,54 @@ function kt(e, t, n, r, i, a, o) {
607
692
  }
608
693
  return null;
609
694
  }
610
- function At(e) {
695
+ function Gt(e) {
611
696
  try {
612
697
  return Intl.getCanonicalLocales(e), !0;
613
698
  } catch {
614
699
  return !1;
615
700
  }
616
701
  }
617
- function jt(e, t, n, r, i) {
702
+ function Kt(e, t, n, r, i) {
618
703
  try {
619
704
  return new t(n, r);
620
705
  } catch (i) {
621
- if (At(n)) throw i;
706
+ if (Gt(n)) throw i;
622
707
  let { fallbackLocale: a, localeFallbacker: o, onWarn: s } = e;
623
- return new t(o(e, a, n).find(At) || `en-US`, r);
708
+ return new t(o(e, a, n).find(Gt) || `en-US`, r);
624
709
  }
625
710
  }
626
- function Mt(e, [t, n, r, i], a, o, s, l) {
627
- let u = v(r.missingWarn) ? r.missingWarn : e.missingWarn, d = v(r.fallbackWarn) ? r.fallbackWarn : e.fallbackWarn, f = !!r.part, p = B(e, r);
711
+ function qt(e, [t, n, r, i], a, o, s, l) {
712
+ let u = v(r.missingWarn) ? r.missingWarn : e.missingWarn, d = v(r.fallbackWarn) ? r.fallbackWarn : e.fallbackWarn, f = !!r.part, p = it(e, r);
628
713
  if (!_(t) || t === ``) {
629
- let t = jt(e, a, p.replace(/!/g, ``), i, l);
714
+ let t = Kt(e, a, p.replace(/!/g, ``), i, l);
630
715
  return f ? t.formatToParts(n) : t.format(n);
631
716
  }
632
- let m = kt(e, t, p, s, u, d, l);
717
+ let m = Wt(e, t, p, s, u, d, l);
633
718
  if (!_(m)) return e.unresolving ? -1 : t;
634
- let h = s[m][t], g = Nt(m, t, i), y = o.get(g);
635
- return y || (y = jt(e, a, m, c({}, h, i), l), o.set(g, y)), f ? y.formatToParts(n) : y.format(n);
719
+ let h = s[m][t], g = Jt(m, t, i), y = o.get(g);
720
+ return y || (y = Kt(e, a, m, c({}, h, i), l), o.set(g, y)), f ? y.formatToParts(n) : y.format(n);
636
721
  }
637
- function Nt(e, t, n) {
722
+ function Jt(e, t, n) {
638
723
  let r = `${e}__${t}`;
639
724
  return C(n) && !s(n) && (r = `${r}__${JSON.stringify(n)}`), r;
640
725
  }
641
- function Pt(e, t, n) {
726
+ function Yt(e, t, n) {
642
727
  for (let r in n) {
643
728
  let n = `${t}__${r}`;
644
729
  for (let t of e.keys()) (t === n || t.startsWith(`${n}__`)) && e.delete(t);
645
730
  }
646
731
  }
647
- function Ft(e, t, n, r) {
732
+ function Xt(e, t, n, r) {
648
733
  let [, i, a, o] = e, s = n;
649
734
  return _(i) ? t.key = i : C(i) && Object.keys(i).forEach((e) => {
650
735
  r.includes(e) ? s[e] = i[e] : t[e] = i[e];
651
736
  }), _(a) ? t.locale = a : C(a) && (s = a), C(o) && (s = o), s;
652
737
  }
653
- function It(e, ...t) {
738
+ function Zt(e, ...t) {
654
739
  let { datetimeFormats: n, onWarn: r } = e, { __datetimeFormatters: o } = e;
655
- return !_(t[0]) && !a(t[0]) && !i(t[0]) ? `` : Mt(e, Rt(...t), Intl.DateTimeFormat, o, n, `datetime format`);
740
+ return !_(t[0]) && !a(t[0]) && !i(t[0]) ? `` : qt(e, $t(...t), Intl.DateTimeFormat, o, n, `datetime format`);
656
741
  }
657
- const Lt = [
742
+ const Qt = [
658
743
  `localeMatcher`,
659
744
  `weekday`,
660
745
  `era`,
@@ -676,24 +761,24 @@ const Lt = [
676
761
  `hourCycle`,
677
762
  `fractionalSecondDigits`
678
763
  ];
679
- function Rt(...e) {
764
+ function $t(...e) {
680
765
  let [t] = e, n = u(), r = u(), o;
681
766
  if (_(t)) {
682
767
  let e = t.match(/^(\d{4}-\d{2}-\d{2})(?:(T|\s)(.+))?$/);
683
- if (!e) throw Error(z.INVALID_ISO_DATE_ARGUMENT);
768
+ if (!e) throw Error(V.INVALID_ISO_DATE_ARGUMENT);
684
769
  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();
685
770
  o = new Date(n);
686
771
  try {
687
772
  o.toISOString();
688
773
  } catch {
689
- throw Error(z.INVALID_ISO_DATE_ARGUMENT);
774
+ throw Error(V.INVALID_ISO_DATE_ARGUMENT);
690
775
  }
691
776
  } else if (a(t)) {
692
- if (isNaN(t.getTime())) throw Error(z.INVALID_DATE_ARGUMENT);
777
+ if (isNaN(t.getTime())) throw Error(V.INVALID_DATE_ARGUMENT);
693
778
  o = t;
694
779
  } else if (i(t)) o = t;
695
- else throw Error(z.INVALID_ARGUMENT);
696
- let s = Ft(e, n, r, Lt);
780
+ else throw Error(V.INVALID_ARGUMENT);
781
+ let s = Xt(e, n, r, Qt);
697
782
  return [
698
783
  n.key || ``,
699
784
  o,
@@ -701,14 +786,14 @@ function Rt(...e) {
701
786
  s
702
787
  ];
703
788
  }
704
- function zt(e, t, n) {
705
- Pt(e.__datetimeFormatters, t, n);
789
+ function en(e, t, n) {
790
+ Yt(e.__datetimeFormatters, t, n);
706
791
  }
707
- function Bt(e, ...t) {
792
+ function tn(e, ...t) {
708
793
  let { numberFormats: n, onWarn: r } = e, { __numberFormatters: a } = e;
709
- return i(t[0]) ? Mt(e, Ht(...t), Intl.NumberFormat, a, n, `number format`) : ``;
794
+ return i(t[0]) ? qt(e, rn(...t), Intl.NumberFormat, a, n, `number format`) : ``;
710
795
  }
711
- const Vt = [
796
+ const nn = [
712
797
  `localeMatcher`,
713
798
  `style`,
714
799
  `currency`,
@@ -730,10 +815,10 @@ const Vt = [
730
815
  `roundingIncrement`,
731
816
  `trailingZeroDisplay`
732
817
  ];
733
- function Ht(...e) {
818
+ function rn(...e) {
734
819
  let [t] = e, n = u(), r = u();
735
- if (!i(t)) throw Error(z.INVALID_ARGUMENT);
736
- let a = t, o = Ft(e, n, r, Vt);
820
+ if (!i(t)) throw Error(V.INVALID_ARGUMENT);
821
+ let a = t, o = Xt(e, n, r, nn);
737
822
  return [
738
823
  n.key || ``,
739
824
  a,
@@ -741,14 +826,14 @@ function Ht(...e) {
741
826
  o
742
827
  ];
743
828
  }
744
- function Ut(e, t, n) {
745
- Pt(e.__numberFormatters, t, n);
829
+ function an(e, t, n) {
830
+ Yt(e.__numberFormatters, t, n);
746
831
  }
747
- const Wt = (e) => e, Gt = (e) => ``, Kt = `text`, qt = (e) => e.length === 0 ? `` : ee(e), Jt = w;
832
+ const on = (e) => e, sn = (e) => ``, cn = `text`, ln = (e) => e.length === 0 ? `` : ee(e), un = w;
748
833
  function X(e, t) {
749
834
  return e = Math.abs(e), t === 2 ? e === 1 ? 0 : 1 : Math.min(e, 2);
750
835
  }
751
- const Yt = [
836
+ const dn = [
752
837
  `zero`,
753
838
  `one`,
754
839
  `two`,
@@ -756,29 +841,29 @@ const Yt = [
756
841
  `many`,
757
842
  `other`
758
843
  ], Z = /* @__PURE__ */ new Map();
759
- function Xt(e) {
844
+ function fn(e) {
760
845
  try {
761
846
  if (Intl.PluralRules.supportedLocalesOf(e).length === 0) return null;
762
847
  let t = new Intl.PluralRules(e);
763
848
  return {
764
849
  rules: t,
765
- categories: t.resolvedOptions().pluralCategories.slice().sort((e, t) => Yt.indexOf(e) - Yt.indexOf(t))
850
+ categories: t.resolvedOptions().pluralCategories.slice().sort((e, t) => dn.indexOf(e) - dn.indexOf(t))
766
851
  };
767
852
  } catch {
768
853
  return null;
769
854
  }
770
855
  }
771
- function Zt(e) {
856
+ function pn(e) {
772
857
  let t = Z.get(e);
773
- return t === void 0 && (t = Xt(e), Z.size >= 1e3 && Z.delete(Z.keys().next().value), Z.set(e, t)), t;
858
+ return t === void 0 && (t = fn(e), Z.size >= 1e3 && Z.delete(Z.keys().next().value), Z.set(e, t)), t;
774
859
  }
775
- function Qt(e) {
860
+ function mn(e) {
776
861
  return i(e.pluralIndex) ? e.pluralIndex : i(e.named?.count) ? e.named.count : i(e.named?.n) ? e.named.n : -1;
777
862
  }
778
- function $t(e = {}) {
779
- let t = e.locale, n = Qt(e), r;
863
+ function hn(e = {}) {
864
+ let t = e.locale, n = mn(e), r;
780
865
  r = _(t) && e.pluralRules && g(p(e.pluralRules, t)) ? e.pluralRules[t] : _(t) && typeof Intl < `u` && Intl.PluralRules !== void 0 ? (e, n) => {
781
- let r = Zt(t);
866
+ let r = pn(t);
782
867
  if (r === null || n > r.categories.length) return X(e, n);
783
868
  let { rules: i, categories: a } = r, o = i.select(Math.abs(e)), s = a.indexOf(o);
784
869
  return Math.min(s === -1 ? n - 1 : s, n - 1);
@@ -788,9 +873,9 @@ function $t(e = {}) {
788
873
  return f && n == null && (t === `count` || t === `n`) ? e.pluralIndex : n;
789
874
  };
790
875
  function b(t, n) {
791
- return (g(e.messages) ? e.messages(t, !!n) : y(e.messages) ? e.messages[t] : !1) || (e.parent ? e.parent.message(t) : Gt);
876
+ return (g(e.messages) ? e.messages(t, !!n) : y(e.messages) ? e.messages[t] : !1) || (e.parent ? e.parent.message(t) : sn);
792
877
  }
793
- let x = (t) => e.modifiers ? p(e.modifiers, t) : Wt, S = g(e.processor?.normalize) ? e.processor.normalize : qt, C = g(e.processor?.interpolate) ? e.processor.interpolate : Jt, w = {
878
+ let x = (t) => e.modifiers ? p(e.modifiers, t) : on, S = g(e.processor?.normalize) ? e.processor.normalize : ln, C = g(e.processor?.interpolate) ? e.processor.interpolate : un, w = {
794
879
  list: l,
795
880
  named: v,
796
881
  plural: o,
@@ -803,7 +888,7 @@ function $t(e = {}) {
803
888
  return g(l) ? l(c, i) : c;
804
889
  },
805
890
  message: b,
806
- type: _(e.processor?.type) ? e.processor.type : Kt,
891
+ type: _(e.processor?.type) ? e.processor.type : cn,
807
892
  interpolate: C,
808
893
  normalize: S,
809
894
  values: c(u(), s, d, f ? {
@@ -813,28 +898,28 @@ function $t(e = {}) {
813
898
  };
814
899
  return w;
815
900
  }
816
- const en = () => ``, Q = (e) => g(e), $ = (e) => _(e) || M(e) || Q(e);
817
- function tn(e, ...t) {
818
- let [n, r] = on(...t), i = B(e, r), a = v(r.escapeParameter) ? r.escapeParameter : e.escapeParameter;
819
- a && nn(r);
901
+ const gn = () => ``, Q = (e) => g(e), $ = (e) => _(e) || P(e) || Q(e);
902
+ function _n(e, ...t) {
903
+ let [n, r] = Cn(...t), i = it(e, r), a = v(r.escapeParameter) ? r.escapeParameter : e.escapeParameter;
904
+ a && vn(r);
820
905
  let o = !!r.resolvedMessage, [s, c, l] = o ? [
821
906
  n,
822
907
  i,
823
908
  p(e.messages, i) || u()
824
- ] : rn(e, n, i, e.fallbackLocale, v(r.fallbackWarn) ? r.fallbackWarn : e.fallbackWarn, v(r.missingWarn) ? r.missingWarn : e.missingWarn), d = n;
909
+ ] : xn(e, n, i, e.fallbackLocale, v(r.fallbackWarn) ? r.fallbackWarn : e.fallbackWarn, v(r.missingWarn) ? r.missingWarn : e.missingWarn), d = n;
825
910
  if (!o && !$(s)) {
826
911
  let t = _(r.default) ? r.default : v(r.default) || e.fallbackFormat ? e.messageCompiler ? n : () => n : null;
827
912
  (e.fallbackFormat || t != null && (_(t) || g(t))) && (s = t, d = s);
828
913
  }
829
914
  if (!o && (!$(s) || !_(c))) return e.unresolving ? -1 : n;
830
- let f = !1, m = Q(s) ? s : an(e, n, c, s, d, () => {
915
+ let f = !1, m = Q(s) ? s : Sn(e, n, c, s, d, () => {
831
916
  f = !0;
832
917
  });
833
918
  if (f) return s;
834
- let h = m($t(cn(e, c, l, r))), y = e.postTranslation ? e.postTranslation(h, n) : h;
835
- return a && _(y) && (y = ye(y)), y;
919
+ let h = m(hn(Tn(e, c, l, r, a))), y = e.postTranslation ? e.postTranslation(h, n) : h;
920
+ return a && _(y) && (y = Me(y)), y;
836
921
  }
837
- function nn(e) {
922
+ function vn(e) {
838
923
  if (h(e.list) && (e.list = e.list.map((e) => _(e) ? T(e) : e)), y(e.named)) {
839
924
  let t = e.named, n = u();
840
925
  for (let e of Object.keys(t)) {
@@ -844,9 +929,15 @@ function nn(e) {
844
929
  e.named = n;
845
930
  }
846
931
  }
847
- function rn(e, t, n, r, i, a) {
932
+ function yn(e) {
933
+ return _(e) ? e : T(w(e));
934
+ }
935
+ function bn(e, t) {
936
+ return !t || g(e?.interpolate) ? e ?? void 0 : c({}, e, { interpolate: yn });
937
+ }
938
+ function xn(e, t, n, r, i, a) {
848
939
  let { messages: o, onWarn: s, messageResolver: c, localeFallbacker: l } = e, d = l(e, r, n), f = u(), m, h = null;
849
- 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 (!Ot(m, d)) {
940
+ 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 (!Ut(m, d)) {
850
941
  let n = Y(e, t, m, a, `translate`);
851
942
  n !== t && (h = n);
852
943
  }
@@ -856,7 +947,7 @@ function rn(e, t, n, r, i, a) {
856
947
  f
857
948
  ];
858
949
  }
859
- function an(e, t, n, r, i, a) {
950
+ function Sn(e, t, n, r, i, a) {
860
951
  if (Q(r)) {
861
952
  let e = r;
862
953
  return e.locale = e.locale || n, e.key = e.key || t, e;
@@ -865,16 +956,16 @@ function an(e, t, n, r, i, a) {
865
956
  let e = (() => r);
866
957
  return e.locale = n, e.key = t, e;
867
958
  }
868
- let o = e.messageCompiler(r, sn(e, n, i, r, e.warnHtmlMessage, a));
959
+ let o = e.messageCompiler(r, wn(e, n, i, r, e.warnHtmlMessage, a));
869
960
  return o.locale = n, o.key = t, o.source = r, o;
870
961
  }
871
- function on(...e) {
962
+ function Cn(...e) {
872
963
  let [t, n, r] = e;
873
- if (!_(t) && !i(t) && !Q(t) && !M(t)) throw Error(z.INVALID_ARGUMENT);
964
+ if (!_(t) && !i(t) && !Q(t) && !P(t)) throw Error(V.INVALID_ARGUMENT);
874
965
  let a = i(t) ? String(t) : (Q(t), t), o = u();
875
966
  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];
876
967
  }
877
- function sn(e, t, r, i, a, o) {
968
+ function wn(e, t, r, i, a, o) {
878
969
  return {
879
970
  locale: t,
880
971
  key: r,
@@ -885,30 +976,30 @@ function sn(e, t, r, i, a, o) {
885
976
  onCacheKey: (e) => n(t, r, e)
886
977
  };
887
978
  }
888
- function cn(e, t, n, r) {
889
- let { modifiers: a, pluralRules: o, messageResolver: s, fallbackLocale: c, fallbackWarn: l, missingWarn: u, fallbackContext: d } = e;
979
+ function Tn(e, t, n, r, a) {
980
+ let { modifiers: o, pluralRules: s, messageResolver: c, fallbackLocale: l, fallbackWarn: u, missingWarn: d, fallbackContext: f } = e;
890
981
  return {
891
982
  locale: t,
892
- modifiers: a,
893
- pluralRules: o,
983
+ modifiers: o,
984
+ pluralRules: s,
894
985
  messages: (r, i) => {
895
- let a = s(n, r);
896
- if (a == null && (d || i)) {
897
- let [n, , i] = rn(d || e, r, t, c, l, u);
898
- a = n ?? s(i, r);
986
+ let a = c(n, r);
987
+ if (a == null && (f || i)) {
988
+ let [n, , i] = xn(f || e, r, t, l, u, d);
989
+ a = n ?? c(i, r);
899
990
  }
900
- if (_(a) || M(a)) {
901
- let n = !1, i = an(e, r, t, a, r, () => {
991
+ if (_(a) || P(a)) {
992
+ let n = !1, i = Sn(e, r, t, a, r, () => {
902
993
  n = !0;
903
994
  });
904
- return n ? en : i;
995
+ return n ? gn : i;
905
996
  }
906
- return Q(a) ? a : en;
997
+ return Q(a) ? a : gn;
907
998
  },
908
- processor: e.processor ?? void 0,
999
+ processor: bn(e.processor, a),
909
1000
  list: r.list ?? void 0,
910
1001
  named: r.named ?? void 0,
911
1002
  pluralIndex: i(r.plural) ? r.plural : void 0
912
1003
  };
913
1004
  }
914
- export { Le as AST_NODE_PROPS_KEYS, Ue as CORE_ERROR_CODES_EXTEND_POINT, at as CORE_WARN_CODES_EXTEND_POINT, W as CoreWarnCodes, Lt as DATETIME_FORMAT_OPTIONS_KEYS, K as DEFAULT_LOCALE, Kt as DEFAULT_MESSAGE_DATA_TYPE, lt as MISSING_RESOLVE_VALUE, ct as NOT_RESOLVED, Vt as NUMBER_FORMAT_OPTIONS_KEYS, G as VERSION, Ve as clearCompileCache, zt as clearDateTimeFormat, Ut as clearNumberFormat, He as compile, Se as createCompileError, yt as createCoreContext, We as createCoreError, $t as createMessageContext, It as datetime, Ke as fallbackWithLocaleChain, Ge as fallbackWithSimple, B as getLocale, bt as getLocaleMessage, st as getWarnMessage, Y as handleMissing, Dt as isAlmostSameLocale, St as isFallbackLocale, Ot as isImplicitFallback, M as isMessageAST, $ as isMessageFormat, Q as isMessageFunction, Ct as isTranslateFallbackWarn, wt as isTranslateMissingWarn, J as isWarnOption, Bt as number, tt as parse, Rt as parseDateTimeArgs, Ht as parseNumberArgs, on as parseTranslateArgs, _t as registerLocaleFallbacker, pt as registerMessageCompiler, ht as registerMessageResolver, H as resolveLocale, it as resolveValue, rt as resolveWithKeyValue, xt as setLocaleMessage, tn as translate, Et as updateFallbackLocale };
1005
+ export { Xe as AST_NODE_PROPS_KEYS, nt as CORE_ERROR_CODES_EXTEND_POINT, yt as CORE_WARN_CODES_EXTEND_POINT, G as CoreWarnCodes, Qt as DATETIME_FORMAT_OPTIONS_KEYS, K as DEFAULT_LOCALE, cn as DEFAULT_MESSAGE_DATA_TYPE, wt as MISSING_RESOLVE_VALUE, Ct as NOT_RESOLVED, nn as NUMBER_FORMAT_OPTIONS_KEYS, St as VERSION, et as clearCompileCache, en as clearDateTimeFormat, an as clearNumberFormat, tt as compile, Fe as createCompileError, Pt as createCoreContext, rt as createCoreError, hn as createMessageContext, Zt as datetime, ot as fallbackWithLocaleChain, at as fallbackWithSimple, it as getLocale, Ft as getLocaleMessage, xt as getWarnMessage, Y as handleMissing, Ht as isAlmostSameLocale, Lt as isFallbackLocale, Ut as isImplicitFallback, P as isMessageAST, $ as isMessageFormat, Q as isMessageFunction, Rt as isTranslateFallbackWarn, zt as isTranslateMissingWarn, J as isWarnOption, tn as number, ht as parse, $t as parseDateTimeArgs, rn as parseNumberArgs, Cn as parseTranslateArgs, Mt as registerLocaleFallbacker, Ot as registerMessageCompiler, At as registerMessageResolver, U as resolveLocale, vt as resolveValue, _t as resolveWithKeyValue, It as setLocaleMessage, _n as translate, Vt as updateFallbackLocale };