gasp-components 1.0.10 → 1.0.11

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.
Files changed (86) hide show
  1. package/dist/UploadOutlined-9WKjHsqa.js +878 -0
  2. package/dist/components/ag-grid-table/index.js +57877 -38314
  3. package/dist/components/button/index.js +18 -18
  4. package/dist/components/checklist/checklist-item.js +3 -3
  5. package/dist/components/checklist/index.js +5 -5
  6. package/dist/components/date-picker/index.js +9 -5022
  7. package/dist/components/dragger/index.js +28 -28
  8. package/dist/components/dropdown/index.js +10 -11
  9. package/dist/components/form/index.js +8 -9
  10. package/dist/components/form-item/index.js +10 -10
  11. package/dist/components/input/index.js +8 -8
  12. package/dist/components/modal/index.js +18 -20
  13. package/dist/components/password-input/index.js +2 -2
  14. package/dist/components/progress/index.js +16 -18
  15. package/dist/components/progress-circle/index.js +3 -3
  16. package/dist/components/radio-button/index.js +8 -8
  17. package/dist/components/result-popup/index.js +13 -14
  18. package/dist/components/select/index.js +1 -1
  19. package/dist/components/side-menu/index.js +2 -2
  20. package/dist/components/side-menu/menu-item.js +4 -6
  21. package/dist/components/steps/index.js +9 -9
  22. package/dist/components/table/index.js +16 -9298
  23. package/dist/components/tabs/index.js +10 -10
  24. package/dist/components/tabs/tab.js +7 -8
  25. package/dist/components/tag/index.js +9 -258
  26. package/dist/components/timeline-horizontal/index.js +7 -7
  27. package/dist/components/upload/index.js +62 -77
  28. package/dist/index-WlPrqxgY.js +87 -0
  29. package/dist/main.js +69 -457
  30. package/package.json +1 -1
  31. package/dist/CheckCircleFilled-xt-0R96Z.js +0 -16
  32. package/dist/CheckOutlined-EgxCAgj_.js +0 -16
  33. package/dist/CloseCircleFilled-bIgIULWb.js +0 -16
  34. package/dist/CloseOutlined-Q3kC3EZS.js +0 -16
  35. package/dist/Compact-fdEKV_mF.js +0 -180
  36. package/dist/ExclamationCircleFilled-XzDBEGmA.js +0 -16
  37. package/dist/KeyCode-qFRXB1-n.js +0 -517
  38. package/dist/LoadingOutlined-6Ipqn0og.js +0 -16
  39. package/dist/Overflow-JFdXKgCr.js +0 -231
  40. package/dist/PurePanel-hLGnXbul.js +0 -60
  41. package/dist/SearchOutlined-rJTFGXUi.js +0 -16
  42. package/dist/TextArea-n3dknzTq.js +0 -716
  43. package/dist/UploadOutlined-D8jfLEgv.js +0 -27
  44. package/dist/asyncToGenerator-t4sKr8R4.js +0 -340
  45. package/dist/button-LN5ZDad8.js +0 -819
  46. package/dist/collapse-ilv4Tji1.js +0 -20
  47. package/dist/colors-opGg9oSz.js +0 -25
  48. package/dist/compact-item-jjuVmDBH.js +0 -61
  49. package/dist/context-h3WSVDPz.js +0 -2087
  50. package/dist/createFormattedComponent-FcpICAm8.js +0 -3260
  51. package/dist/index--6VfGMUo.js +0 -402
  52. package/dist/index-0mpuHoS5.js +0 -996
  53. package/dist/index-1KQbTQJ2.js +0 -4405
  54. package/dist/index-5Uo03BMk.js +0 -681
  55. package/dist/index-BFgxz47K.js +0 -89
  56. package/dist/index-D3LMPWyJ.js +0 -1437
  57. package/dist/index-DVS_nWxv.js +0 -3026
  58. package/dist/index-ELHBhuK9.js +0 -100
  59. package/dist/index-Fn8q8B3V.js +0 -107
  60. package/dist/index-GgkQrebz.js +0 -950
  61. package/dist/index-L-MzVDcK.js +0 -616
  62. package/dist/index-M3WnMjiA.js +0 -230
  63. package/dist/index-NQd_zMf0.js +0 -69
  64. package/dist/index-ZT64Ec6u.js +0 -267
  65. package/dist/index-aawDqn9q.js +0 -3337
  66. package/dist/index-k04G4nlS.js +0 -1416
  67. package/dist/index-s3u4YBl4.js +0 -8
  68. package/dist/index-vtDVJV8q.js +0 -19571
  69. package/dist/isVisible-Qi9l15Ty.js +0 -232
  70. package/dist/motion-0ToOu81j.js +0 -226
  71. package/dist/motion-NQme0FJ_.js +0 -32
  72. package/dist/omit-ylWA0ZLZ.js +0 -10
  73. package/dist/pickAttrs-zaQzRTqh.js +0 -42
  74. package/dist/progress-a1_pwKVT.js +0 -722
  75. package/dist/reactNode-R20zZQk1.js +0 -18
  76. package/dist/responsiveObserver-V1_1G14X.js +0 -71
  77. package/dist/roundedArrow-p1Pmd9av.js +0 -64
  78. package/dist/row-sPFiFm0C.js +0 -230
  79. package/dist/slide-mFXPRHku.js +0 -265
  80. package/dist/styleChecker-pZ3k2IiY.js +0 -37
  81. package/dist/useCSSVarCls-GwZT_WiF.js +0 -9
  82. package/dist/useClosable-4G12n4Bp.js +0 -15
  83. package/dist/useLocale-eThlLZJw.js +0 -16
  84. package/dist/useMergedState-qUafLuUa.js +0 -23
  85. package/dist/useVariants-s0IcneBD.js +0 -25
  86. package/dist/zoom-Ps8y0jNW.js +0 -174
@@ -1,3260 +0,0 @@
1
- import * as F from "react";
2
- var q = function(e, t) {
3
- return q = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(r, n) {
4
- r.__proto__ = n;
5
- } || function(r, n) {
6
- for (var i in n)
7
- Object.prototype.hasOwnProperty.call(n, i) && (r[i] = n[i]);
8
- }, q(e, t);
9
- };
10
- function N(e, t) {
11
- if (typeof t != "function" && t !== null)
12
- throw new TypeError("Class extends value " + String(t) + " is not a constructor or null");
13
- q(e, t);
14
- function r() {
15
- this.constructor = e;
16
- }
17
- e.prototype = t === null ? Object.create(t) : (r.prototype = t.prototype, new r());
18
- }
19
- var v = function() {
20
- return v = Object.assign || function(t) {
21
- for (var r, n = 1, i = arguments.length; n < i; n++) {
22
- r = arguments[n];
23
- for (var a in r)
24
- Object.prototype.hasOwnProperty.call(r, a) && (t[a] = r[a]);
25
- }
26
- return t;
27
- }, v.apply(this, arguments);
28
- };
29
- function W(e, t) {
30
- var r = {};
31
- for (var n in e)
32
- Object.prototype.hasOwnProperty.call(e, n) && t.indexOf(n) < 0 && (r[n] = e[n]);
33
- if (e != null && typeof Object.getOwnPropertySymbols == "function")
34
- for (var i = 0, n = Object.getOwnPropertySymbols(e); i < n.length; i++)
35
- t.indexOf(n[i]) < 0 && Object.prototype.propertyIsEnumerable.call(e, n[i]) && (r[n[i]] = e[n[i]]);
36
- return r;
37
- }
38
- function M(e, t, r) {
39
- if (r || arguments.length === 2)
40
- for (var n = 0, i = t.length, a; n < i; n++)
41
- (a || !(n in t)) && (a || (a = Array.prototype.slice.call(t, 0, n)), a[n] = t[n]);
42
- return e.concat(a || Array.prototype.slice.call(t));
43
- }
44
- var J = { exports: {} }, b = {};
45
- /** @license React v16.13.1
46
- * react-is.development.js
47
- *
48
- * Copyright (c) Facebook, Inc. and its affiliates.
49
- *
50
- * This source code is licensed under the MIT license found in the
51
- * LICENSE file in the root directory of this source tree.
52
- */
53
- var me;
54
- function lt() {
55
- return me || (me = 1, process.env.NODE_ENV !== "production" && function() {
56
- var e = typeof Symbol == "function" && Symbol.for, t = e ? Symbol.for("react.element") : 60103, r = e ? Symbol.for("react.portal") : 60106, n = e ? Symbol.for("react.fragment") : 60107, i = e ? Symbol.for("react.strict_mode") : 60108, a = e ? Symbol.for("react.profiler") : 60114, o = e ? Symbol.for("react.provider") : 60109, s = e ? Symbol.for("react.context") : 60110, h = e ? Symbol.for("react.async_mode") : 60111, u = e ? Symbol.for("react.concurrent_mode") : 60111, f = e ? Symbol.for("react.forward_ref") : 60112, m = e ? Symbol.for("react.suspense") : 60113, p = e ? Symbol.for("react.suspense_list") : 60120, y = e ? Symbol.for("react.memo") : 60115, S = e ? Symbol.for("react.lazy") : 60116, A = e ? Symbol.for("react.block") : 60121, P = e ? Symbol.for("react.fundamental") : 60117, L = e ? Symbol.for("react.responder") : 60118, I = e ? Symbol.for("react.scope") : 60119;
57
- function g(c) {
58
- return typeof c == "string" || typeof c == "function" || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
59
- c === n || c === u || c === a || c === i || c === m || c === p || typeof c == "object" && c !== null && (c.$$typeof === S || c.$$typeof === y || c.$$typeof === o || c.$$typeof === s || c.$$typeof === f || c.$$typeof === P || c.$$typeof === L || c.$$typeof === I || c.$$typeof === A);
60
- }
61
- function _(c) {
62
- if (typeof c == "object" && c !== null) {
63
- var z = c.$$typeof;
64
- switch (z) {
65
- case t:
66
- var X = c.type;
67
- switch (X) {
68
- case h:
69
- case u:
70
- case n:
71
- case a:
72
- case i:
73
- case m:
74
- return X;
75
- default:
76
- var ce = X && X.$$typeof;
77
- switch (ce) {
78
- case s:
79
- case f:
80
- case S:
81
- case y:
82
- case o:
83
- return ce;
84
- default:
85
- return z;
86
- }
87
- }
88
- case r:
89
- return z;
90
- }
91
- }
92
- }
93
- var l = h, B = u, V = s, Xe = o, $e = t, ke = f, We = n, je = S, ze = y, Ye = r, Ze = a, qe = i, Je = m, le = !1;
94
- function Qe(c) {
95
- return le || (le = !0, console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")), fe(c) || _(c) === h;
96
- }
97
- function fe(c) {
98
- return _(c) === u;
99
- }
100
- function Ke(c) {
101
- return _(c) === s;
102
- }
103
- function et(c) {
104
- return _(c) === o;
105
- }
106
- function tt(c) {
107
- return typeof c == "object" && c !== null && c.$$typeof === t;
108
- }
109
- function rt(c) {
110
- return _(c) === f;
111
- }
112
- function nt(c) {
113
- return _(c) === n;
114
- }
115
- function it(c) {
116
- return _(c) === S;
117
- }
118
- function at(c) {
119
- return _(c) === y;
120
- }
121
- function ot(c) {
122
- return _(c) === r;
123
- }
124
- function st(c) {
125
- return _(c) === a;
126
- }
127
- function ht(c) {
128
- return _(c) === i;
129
- }
130
- function ut(c) {
131
- return _(c) === m;
132
- }
133
- b.AsyncMode = l, b.ConcurrentMode = B, b.ContextConsumer = V, b.ContextProvider = Xe, b.Element = $e, b.ForwardRef = ke, b.Fragment = We, b.Lazy = je, b.Memo = ze, b.Portal = Ye, b.Profiler = Ze, b.StrictMode = qe, b.Suspense = Je, b.isAsyncMode = Qe, b.isConcurrentMode = fe, b.isContextConsumer = Ke, b.isContextProvider = et, b.isElement = tt, b.isForwardRef = rt, b.isFragment = nt, b.isLazy = it, b.isMemo = at, b.isPortal = ot, b.isProfiler = st, b.isStrictMode = ht, b.isSuspense = ut, b.isValidElementType = g, b.typeOf = _;
134
- }()), b;
135
- }
136
- var d = {};
137
- /** @license React v16.13.1
138
- * react-is.production.min.js
139
- *
140
- * Copyright (c) Facebook, Inc. and its affiliates.
141
- *
142
- * This source code is licensed under the MIT license found in the
143
- * LICENSE file in the root directory of this source tree.
144
- */
145
- var pe;
146
- function ft() {
147
- if (pe)
148
- return d;
149
- pe = 1;
150
- var e = typeof Symbol == "function" && Symbol.for, t = e ? Symbol.for("react.element") : 60103, r = e ? Symbol.for("react.portal") : 60106, n = e ? Symbol.for("react.fragment") : 60107, i = e ? Symbol.for("react.strict_mode") : 60108, a = e ? Symbol.for("react.profiler") : 60114, o = e ? Symbol.for("react.provider") : 60109, s = e ? Symbol.for("react.context") : 60110, h = e ? Symbol.for("react.async_mode") : 60111, u = e ? Symbol.for("react.concurrent_mode") : 60111, f = e ? Symbol.for("react.forward_ref") : 60112, m = e ? Symbol.for("react.suspense") : 60113, p = e ? Symbol.for("react.suspense_list") : 60120, y = e ? Symbol.for("react.memo") : 60115, S = e ? Symbol.for("react.lazy") : 60116, A = e ? Symbol.for("react.block") : 60121, P = e ? Symbol.for("react.fundamental") : 60117, L = e ? Symbol.for("react.responder") : 60118, I = e ? Symbol.for("react.scope") : 60119;
151
- function g(l) {
152
- if (typeof l == "object" && l !== null) {
153
- var B = l.$$typeof;
154
- switch (B) {
155
- case t:
156
- switch (l = l.type, l) {
157
- case h:
158
- case u:
159
- case n:
160
- case a:
161
- case i:
162
- case m:
163
- return l;
164
- default:
165
- switch (l = l && l.$$typeof, l) {
166
- case s:
167
- case f:
168
- case S:
169
- case y:
170
- case o:
171
- return l;
172
- default:
173
- return B;
174
- }
175
- }
176
- case r:
177
- return B;
178
- }
179
- }
180
- }
181
- function _(l) {
182
- return g(l) === u;
183
- }
184
- return d.AsyncMode = h, d.ConcurrentMode = u, d.ContextConsumer = s, d.ContextProvider = o, d.Element = t, d.ForwardRef = f, d.Fragment = n, d.Lazy = S, d.Memo = y, d.Portal = r, d.Profiler = a, d.StrictMode = i, d.Suspense = m, d.isAsyncMode = function(l) {
185
- return _(l) || g(l) === h;
186
- }, d.isConcurrentMode = _, d.isContextConsumer = function(l) {
187
- return g(l) === s;
188
- }, d.isContextProvider = function(l) {
189
- return g(l) === o;
190
- }, d.isElement = function(l) {
191
- return typeof l == "object" && l !== null && l.$$typeof === t;
192
- }, d.isForwardRef = function(l) {
193
- return g(l) === f;
194
- }, d.isFragment = function(l) {
195
- return g(l) === n;
196
- }, d.isLazy = function(l) {
197
- return g(l) === S;
198
- }, d.isMemo = function(l) {
199
- return g(l) === y;
200
- }, d.isPortal = function(l) {
201
- return g(l) === r;
202
- }, d.isProfiler = function(l) {
203
- return g(l) === a;
204
- }, d.isStrictMode = function(l) {
205
- return g(l) === i;
206
- }, d.isSuspense = function(l) {
207
- return g(l) === m;
208
- }, d.isValidElementType = function(l) {
209
- return typeof l == "string" || typeof l == "function" || l === n || l === u || l === a || l === i || l === m || l === p || typeof l == "object" && l !== null && (l.$$typeof === S || l.$$typeof === y || l.$$typeof === o || l.$$typeof === s || l.$$typeof === f || l.$$typeof === P || l.$$typeof === L || l.$$typeof === I || l.$$typeof === A);
210
- }, d.typeOf = g, d;
211
- }
212
- process.env.NODE_ENV === "production" ? J.exports = ft() : J.exports = lt();
213
- var ct = J.exports, _e = ct, mt = {
214
- $$typeof: !0,
215
- render: !0,
216
- defaultProps: !0,
217
- displayName: !0,
218
- propTypes: !0
219
- }, pt = {
220
- $$typeof: !0,
221
- compare: !0,
222
- defaultProps: !0,
223
- displayName: !0,
224
- propTypes: !0,
225
- type: !0
226
- }, Se = {};
227
- Se[_e.ForwardRef] = mt;
228
- Se[_e.Memo] = pt;
229
- function Et(e, t, r) {
230
- if (r === void 0 && (r = Error), !e)
231
- throw new r(t);
232
- }
233
- var E;
234
- (function(e) {
235
- e[e.EXPECT_ARGUMENT_CLOSING_BRACE = 1] = "EXPECT_ARGUMENT_CLOSING_BRACE", e[e.EMPTY_ARGUMENT = 2] = "EMPTY_ARGUMENT", e[e.MALFORMED_ARGUMENT = 3] = "MALFORMED_ARGUMENT", e[e.EXPECT_ARGUMENT_TYPE = 4] = "EXPECT_ARGUMENT_TYPE", e[e.INVALID_ARGUMENT_TYPE = 5] = "INVALID_ARGUMENT_TYPE", e[e.EXPECT_ARGUMENT_STYLE = 6] = "EXPECT_ARGUMENT_STYLE", e[e.INVALID_NUMBER_SKELETON = 7] = "INVALID_NUMBER_SKELETON", e[e.INVALID_DATE_TIME_SKELETON = 8] = "INVALID_DATE_TIME_SKELETON", e[e.EXPECT_NUMBER_SKELETON = 9] = "EXPECT_NUMBER_SKELETON", e[e.EXPECT_DATE_TIME_SKELETON = 10] = "EXPECT_DATE_TIME_SKELETON", e[e.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE = 11] = "UNCLOSED_QUOTE_IN_ARGUMENT_STYLE", e[e.EXPECT_SELECT_ARGUMENT_OPTIONS = 12] = "EXPECT_SELECT_ARGUMENT_OPTIONS", e[e.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE = 13] = "EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE", e[e.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE = 14] = "INVALID_PLURAL_ARGUMENT_OFFSET_VALUE", e[e.EXPECT_SELECT_ARGUMENT_SELECTOR = 15] = "EXPECT_SELECT_ARGUMENT_SELECTOR", e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR = 16] = "EXPECT_PLURAL_ARGUMENT_SELECTOR", e[e.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT = 17] = "EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT", e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT = 18] = "EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT", e[e.INVALID_PLURAL_ARGUMENT_SELECTOR = 19] = "INVALID_PLURAL_ARGUMENT_SELECTOR", e[e.DUPLICATE_PLURAL_ARGUMENT_SELECTOR = 20] = "DUPLICATE_PLURAL_ARGUMENT_SELECTOR", e[e.DUPLICATE_SELECT_ARGUMENT_SELECTOR = 21] = "DUPLICATE_SELECT_ARGUMENT_SELECTOR", e[e.MISSING_OTHER_CLAUSE = 22] = "MISSING_OTHER_CLAUSE", e[e.INVALID_TAG = 23] = "INVALID_TAG", e[e.INVALID_TAG_NAME = 25] = "INVALID_TAG_NAME", e[e.UNMATCHED_CLOSING_TAG = 26] = "UNMATCHED_CLOSING_TAG", e[e.UNCLOSED_TAG = 27] = "UNCLOSED_TAG";
236
- })(E || (E = {}));
237
- var T;
238
- (function(e) {
239
- e[e.literal = 0] = "literal", e[e.argument = 1] = "argument", e[e.number = 2] = "number", e[e.date = 3] = "date", e[e.time = 4] = "time", e[e.select = 5] = "select", e[e.plural = 6] = "plural", e[e.pound = 7] = "pound", e[e.tag = 8] = "tag";
240
- })(T || (T = {}));
241
- var D;
242
- (function(e) {
243
- e[e.number = 0] = "number", e[e.dateTime = 1] = "dateTime";
244
- })(D || (D = {}));
245
- function Ee(e) {
246
- return e.type === T.literal;
247
- }
248
- function vt(e) {
249
- return e.type === T.argument;
250
- }
251
- function He(e) {
252
- return e.type === T.number;
253
- }
254
- function Ae(e) {
255
- return e.type === T.date;
256
- }
257
- function Pe(e) {
258
- return e.type === T.time;
259
- }
260
- function Ne(e) {
261
- return e.type === T.select;
262
- }
263
- function Ie(e) {
264
- return e.type === T.plural;
265
- }
266
- function xt(e) {
267
- return e.type === T.pound;
268
- }
269
- function Be(e) {
270
- return e.type === T.tag;
271
- }
272
- function Re(e) {
273
- return !!(e && typeof e == "object" && e.type === D.number);
274
- }
275
- function Q(e) {
276
- return !!(e && typeof e == "object" && e.type === D.dateTime);
277
- }
278
- var Ce = /[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/, bt = /(?:[Eec]{1,6}|G{1,5}|[Qq]{1,5}|(?:[yYur]+|U{1,5})|[ML]{1,5}|d{1,2}|D{1,3}|F{1}|[abB]{1,5}|[hkHK]{1,2}|w{1,2}|W{1}|m{1,2}|s{1,2}|[zZOvVxX]{1,4})(?=([^']*'[^']*')*[^']*$)/g;
279
- function dt(e) {
280
- var t = {};
281
- return e.replace(bt, function(r) {
282
- var n = r.length;
283
- switch (r[0]) {
284
- case "G":
285
- t.era = n === 4 ? "long" : n === 5 ? "narrow" : "short";
286
- break;
287
- case "y":
288
- t.year = n === 2 ? "2-digit" : "numeric";
289
- break;
290
- case "Y":
291
- case "u":
292
- case "U":
293
- case "r":
294
- throw new RangeError("`Y/u/U/r` (year) patterns are not supported, use `y` instead");
295
- case "q":
296
- case "Q":
297
- throw new RangeError("`q/Q` (quarter) patterns are not supported");
298
- case "M":
299
- case "L":
300
- t.month = ["numeric", "2-digit", "short", "long", "narrow"][n - 1];
301
- break;
302
- case "w":
303
- case "W":
304
- throw new RangeError("`w/W` (week) patterns are not supported");
305
- case "d":
306
- t.day = ["numeric", "2-digit"][n - 1];
307
- break;
308
- case "D":
309
- case "F":
310
- case "g":
311
- throw new RangeError("`D/F/g` (day) patterns are not supported, use `d` instead");
312
- case "E":
313
- t.weekday = n === 4 ? "long" : n === 5 ? "narrow" : "short";
314
- break;
315
- case "e":
316
- if (n < 4)
317
- throw new RangeError("`e..eee` (weekday) patterns are not supported");
318
- t.weekday = ["short", "long", "narrow", "short"][n - 4];
319
- break;
320
- case "c":
321
- if (n < 4)
322
- throw new RangeError("`c..ccc` (weekday) patterns are not supported");
323
- t.weekday = ["short", "long", "narrow", "short"][n - 4];
324
- break;
325
- case "a":
326
- t.hour12 = !0;
327
- break;
328
- case "b":
329
- case "B":
330
- throw new RangeError("`b/B` (period) patterns are not supported, use `a` instead");
331
- case "h":
332
- t.hourCycle = "h12", t.hour = ["numeric", "2-digit"][n - 1];
333
- break;
334
- case "H":
335
- t.hourCycle = "h23", t.hour = ["numeric", "2-digit"][n - 1];
336
- break;
337
- case "K":
338
- t.hourCycle = "h11", t.hour = ["numeric", "2-digit"][n - 1];
339
- break;
340
- case "k":
341
- t.hourCycle = "h24", t.hour = ["numeric", "2-digit"][n - 1];
342
- break;
343
- case "j":
344
- case "J":
345
- case "C":
346
- throw new RangeError("`j/J/C` (hour) patterns are not supported, use `h/H/K/k` instead");
347
- case "m":
348
- t.minute = ["numeric", "2-digit"][n - 1];
349
- break;
350
- case "s":
351
- t.second = ["numeric", "2-digit"][n - 1];
352
- break;
353
- case "S":
354
- case "A":
355
- throw new RangeError("`S/A` (second) patterns are not supported, use `s` instead");
356
- case "z":
357
- t.timeZoneName = n < 4 ? "short" : "long";
358
- break;
359
- case "Z":
360
- case "O":
361
- case "v":
362
- case "V":
363
- case "X":
364
- case "x":
365
- throw new RangeError("`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead");
366
- }
367
- return "";
368
- }), t;
369
- }
370
- var yt = /[\t-\r \x85\u200E\u200F\u2028\u2029]/i;
371
- function gt(e) {
372
- if (e.length === 0)
373
- throw new Error("Number skeleton cannot be empty");
374
- for (var t = e.split(yt).filter(function(p) {
375
- return p.length > 0;
376
- }), r = [], n = 0, i = t; n < i.length; n++) {
377
- var a = i[n], o = a.split("/");
378
- if (o.length === 0)
379
- throw new Error("Invalid number skeleton");
380
- for (var s = o[0], h = o.slice(1), u = 0, f = h; u < f.length; u++) {
381
- var m = f[u];
382
- if (m.length === 0)
383
- throw new Error("Invalid number skeleton");
384
- }
385
- r.push({ stem: s, options: h });
386
- }
387
- return r;
388
- }
389
- function Tt(e) {
390
- return e.replace(/^(.*?)-/, "");
391
- }
392
- var ve = /^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g, Le = /^(@+)?(\+|#+)?[rs]?$/g, _t = /(\*)(0+)|(#+)(0+)|(0+)/g, Me = /^(0+)$/;
393
- function xe(e) {
394
- var t = {};
395
- return e[e.length - 1] === "r" ? t.roundingPriority = "morePrecision" : e[e.length - 1] === "s" && (t.roundingPriority = "lessPrecision"), e.replace(Le, function(r, n, i) {
396
- return typeof i != "string" ? (t.minimumSignificantDigits = n.length, t.maximumSignificantDigits = n.length) : i === "+" ? t.minimumSignificantDigits = n.length : n[0] === "#" ? t.maximumSignificantDigits = n.length : (t.minimumSignificantDigits = n.length, t.maximumSignificantDigits = n.length + (typeof i == "string" ? i.length : 0)), "";
397
- }), t;
398
- }
399
- function Oe(e) {
400
- switch (e) {
401
- case "sign-auto":
402
- return {
403
- signDisplay: "auto"
404
- };
405
- case "sign-accounting":
406
- case "()":
407
- return {
408
- currencySign: "accounting"
409
- };
410
- case "sign-always":
411
- case "+!":
412
- return {
413
- signDisplay: "always"
414
- };
415
- case "sign-accounting-always":
416
- case "()!":
417
- return {
418
- signDisplay: "always",
419
- currencySign: "accounting"
420
- };
421
- case "sign-except-zero":
422
- case "+?":
423
- return {
424
- signDisplay: "exceptZero"
425
- };
426
- case "sign-accounting-except-zero":
427
- case "()?":
428
- return {
429
- signDisplay: "exceptZero",
430
- currencySign: "accounting"
431
- };
432
- case "sign-never":
433
- case "+_":
434
- return {
435
- signDisplay: "never"
436
- };
437
- }
438
- }
439
- function St(e) {
440
- var t;
441
- if (e[0] === "E" && e[1] === "E" ? (t = {
442
- notation: "engineering"
443
- }, e = e.slice(2)) : e[0] === "E" && (t = {
444
- notation: "scientific"
445
- }, e = e.slice(1)), t) {
446
- var r = e.slice(0, 2);
447
- if (r === "+!" ? (t.signDisplay = "always", e = e.slice(2)) : r === "+?" && (t.signDisplay = "exceptZero", e = e.slice(2)), !Me.test(e))
448
- throw new Error("Malformed concise eng/scientific notation");
449
- t.minimumIntegerDigits = e.length;
450
- }
451
- return t;
452
- }
453
- function be(e) {
454
- var t = {}, r = Oe(e);
455
- return r || t;
456
- }
457
- function Ht(e) {
458
- for (var t = {}, r = 0, n = e; r < n.length; r++) {
459
- var i = n[r];
460
- switch (i.stem) {
461
- case "percent":
462
- case "%":
463
- t.style = "percent";
464
- continue;
465
- case "%x100":
466
- t.style = "percent", t.scale = 100;
467
- continue;
468
- case "currency":
469
- t.style = "currency", t.currency = i.options[0];
470
- continue;
471
- case "group-off":
472
- case ",_":
473
- t.useGrouping = !1;
474
- continue;
475
- case "precision-integer":
476
- case ".":
477
- t.maximumFractionDigits = 0;
478
- continue;
479
- case "measure-unit":
480
- case "unit":
481
- t.style = "unit", t.unit = Tt(i.options[0]);
482
- continue;
483
- case "compact-short":
484
- case "K":
485
- t.notation = "compact", t.compactDisplay = "short";
486
- continue;
487
- case "compact-long":
488
- case "KK":
489
- t.notation = "compact", t.compactDisplay = "long";
490
- continue;
491
- case "scientific":
492
- t = v(v(v({}, t), { notation: "scientific" }), i.options.reduce(function(h, u) {
493
- return v(v({}, h), be(u));
494
- }, {}));
495
- continue;
496
- case "engineering":
497
- t = v(v(v({}, t), { notation: "engineering" }), i.options.reduce(function(h, u) {
498
- return v(v({}, h), be(u));
499
- }, {}));
500
- continue;
501
- case "notation-simple":
502
- t.notation = "standard";
503
- continue;
504
- case "unit-width-narrow":
505
- t.currencyDisplay = "narrowSymbol", t.unitDisplay = "narrow";
506
- continue;
507
- case "unit-width-short":
508
- t.currencyDisplay = "code", t.unitDisplay = "short";
509
- continue;
510
- case "unit-width-full-name":
511
- t.currencyDisplay = "name", t.unitDisplay = "long";
512
- continue;
513
- case "unit-width-iso-code":
514
- t.currencyDisplay = "symbol";
515
- continue;
516
- case "scale":
517
- t.scale = parseFloat(i.options[0]);
518
- continue;
519
- case "integer-width":
520
- if (i.options.length > 1)
521
- throw new RangeError("integer-width stems only accept a single optional option");
522
- i.options[0].replace(_t, function(h, u, f, m, p, y) {
523
- if (u)
524
- t.minimumIntegerDigits = f.length;
525
- else {
526
- if (m && p)
527
- throw new Error("We currently do not support maximum integer digits");
528
- if (y)
529
- throw new Error("We currently do not support exact integer digits");
530
- }
531
- return "";
532
- });
533
- continue;
534
- }
535
- if (Me.test(i.stem)) {
536
- t.minimumIntegerDigits = i.stem.length;
537
- continue;
538
- }
539
- if (ve.test(i.stem)) {
540
- if (i.options.length > 1)
541
- throw new RangeError("Fraction-precision stems only accept a single optional option");
542
- i.stem.replace(ve, function(h, u, f, m, p, y) {
543
- return f === "*" ? t.minimumFractionDigits = u.length : m && m[0] === "#" ? t.maximumFractionDigits = m.length : p && y ? (t.minimumFractionDigits = p.length, t.maximumFractionDigits = p.length + y.length) : (t.minimumFractionDigits = u.length, t.maximumFractionDigits = u.length), "";
544
- });
545
- var a = i.options[0];
546
- a === "w" ? t = v(v({}, t), { trailingZeroDisplay: "stripIfInteger" }) : a && (t = v(v({}, t), xe(a)));
547
- continue;
548
- }
549
- if (Le.test(i.stem)) {
550
- t = v(v({}, t), xe(i.stem));
551
- continue;
552
- }
553
- var o = Oe(i.stem);
554
- o && (t = v(v({}, t), o));
555
- var s = St(i.stem);
556
- s && (t = v(v({}, t), s));
557
- }
558
- return t;
559
- }
560
- var $ = {
561
- "001": [
562
- "H",
563
- "h"
564
- ],
565
- AC: [
566
- "H",
567
- "h",
568
- "hb",
569
- "hB"
570
- ],
571
- AD: [
572
- "H",
573
- "hB"
574
- ],
575
- AE: [
576
- "h",
577
- "hB",
578
- "hb",
579
- "H"
580
- ],
581
- AF: [
582
- "H",
583
- "hb",
584
- "hB",
585
- "h"
586
- ],
587
- AG: [
588
- "h",
589
- "hb",
590
- "H",
591
- "hB"
592
- ],
593
- AI: [
594
- "H",
595
- "h",
596
- "hb",
597
- "hB"
598
- ],
599
- AL: [
600
- "h",
601
- "H",
602
- "hB"
603
- ],
604
- AM: [
605
- "H",
606
- "hB"
607
- ],
608
- AO: [
609
- "H",
610
- "hB"
611
- ],
612
- AR: [
613
- "H",
614
- "h",
615
- "hB",
616
- "hb"
617
- ],
618
- AS: [
619
- "h",
620
- "H"
621
- ],
622
- AT: [
623
- "H",
624
- "hB"
625
- ],
626
- AU: [
627
- "h",
628
- "hb",
629
- "H",
630
- "hB"
631
- ],
632
- AW: [
633
- "H",
634
- "hB"
635
- ],
636
- AX: [
637
- "H"
638
- ],
639
- AZ: [
640
- "H",
641
- "hB",
642
- "h"
643
- ],
644
- BA: [
645
- "H",
646
- "hB",
647
- "h"
648
- ],
649
- BB: [
650
- "h",
651
- "hb",
652
- "H",
653
- "hB"
654
- ],
655
- BD: [
656
- "h",
657
- "hB",
658
- "H"
659
- ],
660
- BE: [
661
- "H",
662
- "hB"
663
- ],
664
- BF: [
665
- "H",
666
- "hB"
667
- ],
668
- BG: [
669
- "H",
670
- "hB",
671
- "h"
672
- ],
673
- BH: [
674
- "h",
675
- "hB",
676
- "hb",
677
- "H"
678
- ],
679
- BI: [
680
- "H",
681
- "h"
682
- ],
683
- BJ: [
684
- "H",
685
- "hB"
686
- ],
687
- BL: [
688
- "H",
689
- "hB"
690
- ],
691
- BM: [
692
- "h",
693
- "hb",
694
- "H",
695
- "hB"
696
- ],
697
- BN: [
698
- "hb",
699
- "hB",
700
- "h",
701
- "H"
702
- ],
703
- BO: [
704
- "H",
705
- "hB",
706
- "h",
707
- "hb"
708
- ],
709
- BQ: [
710
- "H"
711
- ],
712
- BR: [
713
- "H",
714
- "hB"
715
- ],
716
- BS: [
717
- "h",
718
- "hb",
719
- "H",
720
- "hB"
721
- ],
722
- BT: [
723
- "h",
724
- "H"
725
- ],
726
- BW: [
727
- "H",
728
- "h",
729
- "hb",
730
- "hB"
731
- ],
732
- BY: [
733
- "H",
734
- "h"
735
- ],
736
- BZ: [
737
- "H",
738
- "h",
739
- "hb",
740
- "hB"
741
- ],
742
- CA: [
743
- "h",
744
- "hb",
745
- "H",
746
- "hB"
747
- ],
748
- CC: [
749
- "H",
750
- "h",
751
- "hb",
752
- "hB"
753
- ],
754
- CD: [
755
- "hB",
756
- "H"
757
- ],
758
- CF: [
759
- "H",
760
- "h",
761
- "hB"
762
- ],
763
- CG: [
764
- "H",
765
- "hB"
766
- ],
767
- CH: [
768
- "H",
769
- "hB",
770
- "h"
771
- ],
772
- CI: [
773
- "H",
774
- "hB"
775
- ],
776
- CK: [
777
- "H",
778
- "h",
779
- "hb",
780
- "hB"
781
- ],
782
- CL: [
783
- "H",
784
- "h",
785
- "hB",
786
- "hb"
787
- ],
788
- CM: [
789
- "H",
790
- "h",
791
- "hB"
792
- ],
793
- CN: [
794
- "H",
795
- "hB",
796
- "hb",
797
- "h"
798
- ],
799
- CO: [
800
- "h",
801
- "H",
802
- "hB",
803
- "hb"
804
- ],
805
- CP: [
806
- "H"
807
- ],
808
- CR: [
809
- "H",
810
- "h",
811
- "hB",
812
- "hb"
813
- ],
814
- CU: [
815
- "H",
816
- "h",
817
- "hB",
818
- "hb"
819
- ],
820
- CV: [
821
- "H",
822
- "hB"
823
- ],
824
- CW: [
825
- "H",
826
- "hB"
827
- ],
828
- CX: [
829
- "H",
830
- "h",
831
- "hb",
832
- "hB"
833
- ],
834
- CY: [
835
- "h",
836
- "H",
837
- "hb",
838
- "hB"
839
- ],
840
- CZ: [
841
- "H"
842
- ],
843
- DE: [
844
- "H",
845
- "hB"
846
- ],
847
- DG: [
848
- "H",
849
- "h",
850
- "hb",
851
- "hB"
852
- ],
853
- DJ: [
854
- "h",
855
- "H"
856
- ],
857
- DK: [
858
- "H"
859
- ],
860
- DM: [
861
- "h",
862
- "hb",
863
- "H",
864
- "hB"
865
- ],
866
- DO: [
867
- "h",
868
- "H",
869
- "hB",
870
- "hb"
871
- ],
872
- DZ: [
873
- "h",
874
- "hB",
875
- "hb",
876
- "H"
877
- ],
878
- EA: [
879
- "H",
880
- "h",
881
- "hB",
882
- "hb"
883
- ],
884
- EC: [
885
- "H",
886
- "hB",
887
- "h",
888
- "hb"
889
- ],
890
- EE: [
891
- "H",
892
- "hB"
893
- ],
894
- EG: [
895
- "h",
896
- "hB",
897
- "hb",
898
- "H"
899
- ],
900
- EH: [
901
- "h",
902
- "hB",
903
- "hb",
904
- "H"
905
- ],
906
- ER: [
907
- "h",
908
- "H"
909
- ],
910
- ES: [
911
- "H",
912
- "hB",
913
- "h",
914
- "hb"
915
- ],
916
- ET: [
917
- "hB",
918
- "hb",
919
- "h",
920
- "H"
921
- ],
922
- FI: [
923
- "H"
924
- ],
925
- FJ: [
926
- "h",
927
- "hb",
928
- "H",
929
- "hB"
930
- ],
931
- FK: [
932
- "H",
933
- "h",
934
- "hb",
935
- "hB"
936
- ],
937
- FM: [
938
- "h",
939
- "hb",
940
- "H",
941
- "hB"
942
- ],
943
- FO: [
944
- "H",
945
- "h"
946
- ],
947
- FR: [
948
- "H",
949
- "hB"
950
- ],
951
- GA: [
952
- "H",
953
- "hB"
954
- ],
955
- GB: [
956
- "H",
957
- "h",
958
- "hb",
959
- "hB"
960
- ],
961
- GD: [
962
- "h",
963
- "hb",
964
- "H",
965
- "hB"
966
- ],
967
- GE: [
968
- "H",
969
- "hB",
970
- "h"
971
- ],
972
- GF: [
973
- "H",
974
- "hB"
975
- ],
976
- GG: [
977
- "H",
978
- "h",
979
- "hb",
980
- "hB"
981
- ],
982
- GH: [
983
- "h",
984
- "H"
985
- ],
986
- GI: [
987
- "H",
988
- "h",
989
- "hb",
990
- "hB"
991
- ],
992
- GL: [
993
- "H",
994
- "h"
995
- ],
996
- GM: [
997
- "h",
998
- "hb",
999
- "H",
1000
- "hB"
1001
- ],
1002
- GN: [
1003
- "H",
1004
- "hB"
1005
- ],
1006
- GP: [
1007
- "H",
1008
- "hB"
1009
- ],
1010
- GQ: [
1011
- "H",
1012
- "hB",
1013
- "h",
1014
- "hb"
1015
- ],
1016
- GR: [
1017
- "h",
1018
- "H",
1019
- "hb",
1020
- "hB"
1021
- ],
1022
- GT: [
1023
- "H",
1024
- "h",
1025
- "hB",
1026
- "hb"
1027
- ],
1028
- GU: [
1029
- "h",
1030
- "hb",
1031
- "H",
1032
- "hB"
1033
- ],
1034
- GW: [
1035
- "H",
1036
- "hB"
1037
- ],
1038
- GY: [
1039
- "h",
1040
- "hb",
1041
- "H",
1042
- "hB"
1043
- ],
1044
- HK: [
1045
- "h",
1046
- "hB",
1047
- "hb",
1048
- "H"
1049
- ],
1050
- HN: [
1051
- "H",
1052
- "h",
1053
- "hB",
1054
- "hb"
1055
- ],
1056
- HR: [
1057
- "H",
1058
- "hB"
1059
- ],
1060
- HU: [
1061
- "H",
1062
- "h"
1063
- ],
1064
- IC: [
1065
- "H",
1066
- "h",
1067
- "hB",
1068
- "hb"
1069
- ],
1070
- ID: [
1071
- "H"
1072
- ],
1073
- IE: [
1074
- "H",
1075
- "h",
1076
- "hb",
1077
- "hB"
1078
- ],
1079
- IL: [
1080
- "H",
1081
- "hB"
1082
- ],
1083
- IM: [
1084
- "H",
1085
- "h",
1086
- "hb",
1087
- "hB"
1088
- ],
1089
- IN: [
1090
- "h",
1091
- "H"
1092
- ],
1093
- IO: [
1094
- "H",
1095
- "h",
1096
- "hb",
1097
- "hB"
1098
- ],
1099
- IQ: [
1100
- "h",
1101
- "hB",
1102
- "hb",
1103
- "H"
1104
- ],
1105
- IR: [
1106
- "hB",
1107
- "H"
1108
- ],
1109
- IS: [
1110
- "H"
1111
- ],
1112
- IT: [
1113
- "H",
1114
- "hB"
1115
- ],
1116
- JE: [
1117
- "H",
1118
- "h",
1119
- "hb",
1120
- "hB"
1121
- ],
1122
- JM: [
1123
- "h",
1124
- "hb",
1125
- "H",
1126
- "hB"
1127
- ],
1128
- JO: [
1129
- "h",
1130
- "hB",
1131
- "hb",
1132
- "H"
1133
- ],
1134
- JP: [
1135
- "H",
1136
- "K",
1137
- "h"
1138
- ],
1139
- KE: [
1140
- "hB",
1141
- "hb",
1142
- "H",
1143
- "h"
1144
- ],
1145
- KG: [
1146
- "H",
1147
- "h",
1148
- "hB",
1149
- "hb"
1150
- ],
1151
- KH: [
1152
- "hB",
1153
- "h",
1154
- "H",
1155
- "hb"
1156
- ],
1157
- KI: [
1158
- "h",
1159
- "hb",
1160
- "H",
1161
- "hB"
1162
- ],
1163
- KM: [
1164
- "H",
1165
- "h",
1166
- "hB",
1167
- "hb"
1168
- ],
1169
- KN: [
1170
- "h",
1171
- "hb",
1172
- "H",
1173
- "hB"
1174
- ],
1175
- KP: [
1176
- "h",
1177
- "H",
1178
- "hB",
1179
- "hb"
1180
- ],
1181
- KR: [
1182
- "h",
1183
- "H",
1184
- "hB",
1185
- "hb"
1186
- ],
1187
- KW: [
1188
- "h",
1189
- "hB",
1190
- "hb",
1191
- "H"
1192
- ],
1193
- KY: [
1194
- "h",
1195
- "hb",
1196
- "H",
1197
- "hB"
1198
- ],
1199
- KZ: [
1200
- "H",
1201
- "hB"
1202
- ],
1203
- LA: [
1204
- "H",
1205
- "hb",
1206
- "hB",
1207
- "h"
1208
- ],
1209
- LB: [
1210
- "h",
1211
- "hB",
1212
- "hb",
1213
- "H"
1214
- ],
1215
- LC: [
1216
- "h",
1217
- "hb",
1218
- "H",
1219
- "hB"
1220
- ],
1221
- LI: [
1222
- "H",
1223
- "hB",
1224
- "h"
1225
- ],
1226
- LK: [
1227
- "H",
1228
- "h",
1229
- "hB",
1230
- "hb"
1231
- ],
1232
- LR: [
1233
- "h",
1234
- "hb",
1235
- "H",
1236
- "hB"
1237
- ],
1238
- LS: [
1239
- "h",
1240
- "H"
1241
- ],
1242
- LT: [
1243
- "H",
1244
- "h",
1245
- "hb",
1246
- "hB"
1247
- ],
1248
- LU: [
1249
- "H",
1250
- "h",
1251
- "hB"
1252
- ],
1253
- LV: [
1254
- "H",
1255
- "hB",
1256
- "hb",
1257
- "h"
1258
- ],
1259
- LY: [
1260
- "h",
1261
- "hB",
1262
- "hb",
1263
- "H"
1264
- ],
1265
- MA: [
1266
- "H",
1267
- "h",
1268
- "hB",
1269
- "hb"
1270
- ],
1271
- MC: [
1272
- "H",
1273
- "hB"
1274
- ],
1275
- MD: [
1276
- "H",
1277
- "hB"
1278
- ],
1279
- ME: [
1280
- "H",
1281
- "hB",
1282
- "h"
1283
- ],
1284
- MF: [
1285
- "H",
1286
- "hB"
1287
- ],
1288
- MG: [
1289
- "H",
1290
- "h"
1291
- ],
1292
- MH: [
1293
- "h",
1294
- "hb",
1295
- "H",
1296
- "hB"
1297
- ],
1298
- MK: [
1299
- "H",
1300
- "h",
1301
- "hb",
1302
- "hB"
1303
- ],
1304
- ML: [
1305
- "H"
1306
- ],
1307
- MM: [
1308
- "hB",
1309
- "hb",
1310
- "H",
1311
- "h"
1312
- ],
1313
- MN: [
1314
- "H",
1315
- "h",
1316
- "hb",
1317
- "hB"
1318
- ],
1319
- MO: [
1320
- "h",
1321
- "hB",
1322
- "hb",
1323
- "H"
1324
- ],
1325
- MP: [
1326
- "h",
1327
- "hb",
1328
- "H",
1329
- "hB"
1330
- ],
1331
- MQ: [
1332
- "H",
1333
- "hB"
1334
- ],
1335
- MR: [
1336
- "h",
1337
- "hB",
1338
- "hb",
1339
- "H"
1340
- ],
1341
- MS: [
1342
- "H",
1343
- "h",
1344
- "hb",
1345
- "hB"
1346
- ],
1347
- MT: [
1348
- "H",
1349
- "h"
1350
- ],
1351
- MU: [
1352
- "H",
1353
- "h"
1354
- ],
1355
- MV: [
1356
- "H",
1357
- "h"
1358
- ],
1359
- MW: [
1360
- "h",
1361
- "hb",
1362
- "H",
1363
- "hB"
1364
- ],
1365
- MX: [
1366
- "H",
1367
- "h",
1368
- "hB",
1369
- "hb"
1370
- ],
1371
- MY: [
1372
- "hb",
1373
- "hB",
1374
- "h",
1375
- "H"
1376
- ],
1377
- MZ: [
1378
- "H",
1379
- "hB"
1380
- ],
1381
- NA: [
1382
- "h",
1383
- "H",
1384
- "hB",
1385
- "hb"
1386
- ],
1387
- NC: [
1388
- "H",
1389
- "hB"
1390
- ],
1391
- NE: [
1392
- "H"
1393
- ],
1394
- NF: [
1395
- "H",
1396
- "h",
1397
- "hb",
1398
- "hB"
1399
- ],
1400
- NG: [
1401
- "H",
1402
- "h",
1403
- "hb",
1404
- "hB"
1405
- ],
1406
- NI: [
1407
- "H",
1408
- "h",
1409
- "hB",
1410
- "hb"
1411
- ],
1412
- NL: [
1413
- "H",
1414
- "hB"
1415
- ],
1416
- NO: [
1417
- "H",
1418
- "h"
1419
- ],
1420
- NP: [
1421
- "H",
1422
- "h",
1423
- "hB"
1424
- ],
1425
- NR: [
1426
- "H",
1427
- "h",
1428
- "hb",
1429
- "hB"
1430
- ],
1431
- NU: [
1432
- "H",
1433
- "h",
1434
- "hb",
1435
- "hB"
1436
- ],
1437
- NZ: [
1438
- "h",
1439
- "hb",
1440
- "H",
1441
- "hB"
1442
- ],
1443
- OM: [
1444
- "h",
1445
- "hB",
1446
- "hb",
1447
- "H"
1448
- ],
1449
- PA: [
1450
- "h",
1451
- "H",
1452
- "hB",
1453
- "hb"
1454
- ],
1455
- PE: [
1456
- "H",
1457
- "hB",
1458
- "h",
1459
- "hb"
1460
- ],
1461
- PF: [
1462
- "H",
1463
- "h",
1464
- "hB"
1465
- ],
1466
- PG: [
1467
- "h",
1468
- "H"
1469
- ],
1470
- PH: [
1471
- "h",
1472
- "hB",
1473
- "hb",
1474
- "H"
1475
- ],
1476
- PK: [
1477
- "h",
1478
- "hB",
1479
- "H"
1480
- ],
1481
- PL: [
1482
- "H",
1483
- "h"
1484
- ],
1485
- PM: [
1486
- "H",
1487
- "hB"
1488
- ],
1489
- PN: [
1490
- "H",
1491
- "h",
1492
- "hb",
1493
- "hB"
1494
- ],
1495
- PR: [
1496
- "h",
1497
- "H",
1498
- "hB",
1499
- "hb"
1500
- ],
1501
- PS: [
1502
- "h",
1503
- "hB",
1504
- "hb",
1505
- "H"
1506
- ],
1507
- PT: [
1508
- "H",
1509
- "hB"
1510
- ],
1511
- PW: [
1512
- "h",
1513
- "H"
1514
- ],
1515
- PY: [
1516
- "H",
1517
- "h",
1518
- "hB",
1519
- "hb"
1520
- ],
1521
- QA: [
1522
- "h",
1523
- "hB",
1524
- "hb",
1525
- "H"
1526
- ],
1527
- RE: [
1528
- "H",
1529
- "hB"
1530
- ],
1531
- RO: [
1532
- "H",
1533
- "hB"
1534
- ],
1535
- RS: [
1536
- "H",
1537
- "hB",
1538
- "h"
1539
- ],
1540
- RU: [
1541
- "H"
1542
- ],
1543
- RW: [
1544
- "H",
1545
- "h"
1546
- ],
1547
- SA: [
1548
- "h",
1549
- "hB",
1550
- "hb",
1551
- "H"
1552
- ],
1553
- SB: [
1554
- "h",
1555
- "hb",
1556
- "H",
1557
- "hB"
1558
- ],
1559
- SC: [
1560
- "H",
1561
- "h",
1562
- "hB"
1563
- ],
1564
- SD: [
1565
- "h",
1566
- "hB",
1567
- "hb",
1568
- "H"
1569
- ],
1570
- SE: [
1571
- "H"
1572
- ],
1573
- SG: [
1574
- "h",
1575
- "hb",
1576
- "H",
1577
- "hB"
1578
- ],
1579
- SH: [
1580
- "H",
1581
- "h",
1582
- "hb",
1583
- "hB"
1584
- ],
1585
- SI: [
1586
- "H",
1587
- "hB"
1588
- ],
1589
- SJ: [
1590
- "H"
1591
- ],
1592
- SK: [
1593
- "H"
1594
- ],
1595
- SL: [
1596
- "h",
1597
- "hb",
1598
- "H",
1599
- "hB"
1600
- ],
1601
- SM: [
1602
- "H",
1603
- "h",
1604
- "hB"
1605
- ],
1606
- SN: [
1607
- "H",
1608
- "h",
1609
- "hB"
1610
- ],
1611
- SO: [
1612
- "h",
1613
- "H"
1614
- ],
1615
- SR: [
1616
- "H",
1617
- "hB"
1618
- ],
1619
- SS: [
1620
- "h",
1621
- "hb",
1622
- "H",
1623
- "hB"
1624
- ],
1625
- ST: [
1626
- "H",
1627
- "hB"
1628
- ],
1629
- SV: [
1630
- "H",
1631
- "h",
1632
- "hB",
1633
- "hb"
1634
- ],
1635
- SX: [
1636
- "H",
1637
- "h",
1638
- "hb",
1639
- "hB"
1640
- ],
1641
- SY: [
1642
- "h",
1643
- "hB",
1644
- "hb",
1645
- "H"
1646
- ],
1647
- SZ: [
1648
- "h",
1649
- "hb",
1650
- "H",
1651
- "hB"
1652
- ],
1653
- TA: [
1654
- "H",
1655
- "h",
1656
- "hb",
1657
- "hB"
1658
- ],
1659
- TC: [
1660
- "h",
1661
- "hb",
1662
- "H",
1663
- "hB"
1664
- ],
1665
- TD: [
1666
- "h",
1667
- "H",
1668
- "hB"
1669
- ],
1670
- TF: [
1671
- "H",
1672
- "h",
1673
- "hB"
1674
- ],
1675
- TG: [
1676
- "H",
1677
- "hB"
1678
- ],
1679
- TH: [
1680
- "H",
1681
- "h"
1682
- ],
1683
- TJ: [
1684
- "H",
1685
- "h"
1686
- ],
1687
- TL: [
1688
- "H",
1689
- "hB",
1690
- "hb",
1691
- "h"
1692
- ],
1693
- TM: [
1694
- "H",
1695
- "h"
1696
- ],
1697
- TN: [
1698
- "h",
1699
- "hB",
1700
- "hb",
1701
- "H"
1702
- ],
1703
- TO: [
1704
- "h",
1705
- "H"
1706
- ],
1707
- TR: [
1708
- "H",
1709
- "hB"
1710
- ],
1711
- TT: [
1712
- "h",
1713
- "hb",
1714
- "H",
1715
- "hB"
1716
- ],
1717
- TW: [
1718
- "hB",
1719
- "hb",
1720
- "h",
1721
- "H"
1722
- ],
1723
- TZ: [
1724
- "hB",
1725
- "hb",
1726
- "H",
1727
- "h"
1728
- ],
1729
- UA: [
1730
- "H",
1731
- "hB",
1732
- "h"
1733
- ],
1734
- UG: [
1735
- "hB",
1736
- "hb",
1737
- "H",
1738
- "h"
1739
- ],
1740
- UM: [
1741
- "h",
1742
- "hb",
1743
- "H",
1744
- "hB"
1745
- ],
1746
- US: [
1747
- "h",
1748
- "hb",
1749
- "H",
1750
- "hB"
1751
- ],
1752
- UY: [
1753
- "H",
1754
- "h",
1755
- "hB",
1756
- "hb"
1757
- ],
1758
- UZ: [
1759
- "H",
1760
- "hB",
1761
- "h"
1762
- ],
1763
- VA: [
1764
- "H",
1765
- "h",
1766
- "hB"
1767
- ],
1768
- VC: [
1769
- "h",
1770
- "hb",
1771
- "H",
1772
- "hB"
1773
- ],
1774
- VE: [
1775
- "h",
1776
- "H",
1777
- "hB",
1778
- "hb"
1779
- ],
1780
- VG: [
1781
- "h",
1782
- "hb",
1783
- "H",
1784
- "hB"
1785
- ],
1786
- VI: [
1787
- "h",
1788
- "hb",
1789
- "H",
1790
- "hB"
1791
- ],
1792
- VN: [
1793
- "H",
1794
- "h"
1795
- ],
1796
- VU: [
1797
- "h",
1798
- "H"
1799
- ],
1800
- WF: [
1801
- "H",
1802
- "hB"
1803
- ],
1804
- WS: [
1805
- "h",
1806
- "H"
1807
- ],
1808
- XK: [
1809
- "H",
1810
- "hB",
1811
- "h"
1812
- ],
1813
- YE: [
1814
- "h",
1815
- "hB",
1816
- "hb",
1817
- "H"
1818
- ],
1819
- YT: [
1820
- "H",
1821
- "hB"
1822
- ],
1823
- ZA: [
1824
- "H",
1825
- "h",
1826
- "hb",
1827
- "hB"
1828
- ],
1829
- ZM: [
1830
- "h",
1831
- "hb",
1832
- "H",
1833
- "hB"
1834
- ],
1835
- ZW: [
1836
- "H",
1837
- "h"
1838
- ],
1839
- "af-ZA": [
1840
- "H",
1841
- "h",
1842
- "hB",
1843
- "hb"
1844
- ],
1845
- "ar-001": [
1846
- "h",
1847
- "hB",
1848
- "hb",
1849
- "H"
1850
- ],
1851
- "ca-ES": [
1852
- "H",
1853
- "h",
1854
- "hB"
1855
- ],
1856
- "en-001": [
1857
- "h",
1858
- "hb",
1859
- "H",
1860
- "hB"
1861
- ],
1862
- "es-BO": [
1863
- "H",
1864
- "h",
1865
- "hB",
1866
- "hb"
1867
- ],
1868
- "es-BR": [
1869
- "H",
1870
- "h",
1871
- "hB",
1872
- "hb"
1873
- ],
1874
- "es-EC": [
1875
- "H",
1876
- "h",
1877
- "hB",
1878
- "hb"
1879
- ],
1880
- "es-ES": [
1881
- "H",
1882
- "h",
1883
- "hB",
1884
- "hb"
1885
- ],
1886
- "es-GQ": [
1887
- "H",
1888
- "h",
1889
- "hB",
1890
- "hb"
1891
- ],
1892
- "es-PE": [
1893
- "H",
1894
- "h",
1895
- "hB",
1896
- "hb"
1897
- ],
1898
- "fr-CA": [
1899
- "H",
1900
- "h",
1901
- "hB"
1902
- ],
1903
- "gl-ES": [
1904
- "H",
1905
- "h",
1906
- "hB"
1907
- ],
1908
- "gu-IN": [
1909
- "hB",
1910
- "hb",
1911
- "h",
1912
- "H"
1913
- ],
1914
- "hi-IN": [
1915
- "hB",
1916
- "h",
1917
- "H"
1918
- ],
1919
- "it-CH": [
1920
- "H",
1921
- "h",
1922
- "hB"
1923
- ],
1924
- "it-IT": [
1925
- "H",
1926
- "h",
1927
- "hB"
1928
- ],
1929
- "kn-IN": [
1930
- "hB",
1931
- "h",
1932
- "H"
1933
- ],
1934
- "ml-IN": [
1935
- "hB",
1936
- "h",
1937
- "H"
1938
- ],
1939
- "mr-IN": [
1940
- "hB",
1941
- "hb",
1942
- "h",
1943
- "H"
1944
- ],
1945
- "pa-IN": [
1946
- "hB",
1947
- "hb",
1948
- "h",
1949
- "H"
1950
- ],
1951
- "ta-IN": [
1952
- "hB",
1953
- "h",
1954
- "hb",
1955
- "H"
1956
- ],
1957
- "te-IN": [
1958
- "hB",
1959
- "h",
1960
- "H"
1961
- ],
1962
- "zu-ZA": [
1963
- "H",
1964
- "hB",
1965
- "hb",
1966
- "h"
1967
- ]
1968
- };
1969
- function At(e, t) {
1970
- for (var r = "", n = 0; n < e.length; n++) {
1971
- var i = e.charAt(n);
1972
- if (i === "j") {
1973
- for (var a = 0; n + 1 < e.length && e.charAt(n + 1) === i; )
1974
- a++, n++;
1975
- var o = 1 + (a & 1), s = a < 2 ? 1 : 3 + (a >> 1), h = "a", u = Pt(t);
1976
- for ((u == "H" || u == "k") && (s = 0); s-- > 0; )
1977
- r += h;
1978
- for (; o-- > 0; )
1979
- r = u + r;
1980
- } else
1981
- i === "J" ? r += "H" : r += i;
1982
- }
1983
- return r;
1984
- }
1985
- function Pt(e) {
1986
- var t = e.hourCycle;
1987
- if (t === void 0 && // @ts-ignore hourCycle(s) is not identified yet
1988
- e.hourCycles && // @ts-ignore
1989
- e.hourCycles.length && (t = e.hourCycles[0]), t)
1990
- switch (t) {
1991
- case "h24":
1992
- return "k";
1993
- case "h23":
1994
- return "H";
1995
- case "h12":
1996
- return "h";
1997
- case "h11":
1998
- return "K";
1999
- default:
2000
- throw new Error("Invalid hourCycle");
2001
- }
2002
- var r = e.language, n;
2003
- r !== "root" && (n = e.maximize().region);
2004
- var i = $[n || ""] || $[r || ""] || $["".concat(r, "-001")] || $["001"];
2005
- return i[0];
2006
- }
2007
- var Y, Nt = new RegExp("^".concat(Ce.source, "*")), It = new RegExp("".concat(Ce.source, "*$"));
2008
- function x(e, t) {
2009
- return { start: e, end: t };
2010
- }
2011
- var Bt = !!String.prototype.startsWith && "_a".startsWith("a", 1), Rt = !!String.fromCodePoint, Ct = !!Object.fromEntries, Lt = !!String.prototype.codePointAt, Mt = !!String.prototype.trimStart, Ot = !!String.prototype.trimEnd, Ft = !!Number.isSafeInteger, wt = Ft ? Number.isSafeInteger : function(e) {
2012
- return typeof e == "number" && isFinite(e) && Math.floor(e) === e && Math.abs(e) <= 9007199254740991;
2013
- }, K = !0;
2014
- try {
2015
- var Dt = we("([^\\p{White_Space}\\p{Pattern_Syntax}]*)", "yu");
2016
- K = ((Y = Dt.exec("a")) === null || Y === void 0 ? void 0 : Y[0]) === "a";
2017
- } catch {
2018
- K = !1;
2019
- }
2020
- var de = Bt ? (
2021
- // Native
2022
- function(t, r, n) {
2023
- return t.startsWith(r, n);
2024
- }
2025
- ) : (
2026
- // For IE11
2027
- function(t, r, n) {
2028
- return t.slice(n, n + r.length) === r;
2029
- }
2030
- ), ee = Rt ? String.fromCodePoint : (
2031
- // IE11
2032
- function() {
2033
- for (var t = [], r = 0; r < arguments.length; r++)
2034
- t[r] = arguments[r];
2035
- for (var n = "", i = t.length, a = 0, o; i > a; ) {
2036
- if (o = t[a++], o > 1114111)
2037
- throw RangeError(o + " is not a valid code point");
2038
- n += o < 65536 ? String.fromCharCode(o) : String.fromCharCode(((o -= 65536) >> 10) + 55296, o % 1024 + 56320);
2039
- }
2040
- return n;
2041
- }
2042
- ), ye = (
2043
- // native
2044
- Ct ? Object.fromEntries : (
2045
- // Ponyfill
2046
- function(t) {
2047
- for (var r = {}, n = 0, i = t; n < i.length; n++) {
2048
- var a = i[n], o = a[0], s = a[1];
2049
- r[o] = s;
2050
- }
2051
- return r;
2052
- }
2053
- )
2054
- ), Fe = Lt ? (
2055
- // Native
2056
- function(t, r) {
2057
- return t.codePointAt(r);
2058
- }
2059
- ) : (
2060
- // IE 11
2061
- function(t, r) {
2062
- var n = t.length;
2063
- if (!(r < 0 || r >= n)) {
2064
- var i = t.charCodeAt(r), a;
2065
- return i < 55296 || i > 56319 || r + 1 === n || (a = t.charCodeAt(r + 1)) < 56320 || a > 57343 ? i : (i - 55296 << 10) + (a - 56320) + 65536;
2066
- }
2067
- }
2068
- ), Ut = Mt ? (
2069
- // Native
2070
- function(t) {
2071
- return t.trimStart();
2072
- }
2073
- ) : (
2074
- // Ponyfill
2075
- function(t) {
2076
- return t.replace(Nt, "");
2077
- }
2078
- ), Gt = Ot ? (
2079
- // Native
2080
- function(t) {
2081
- return t.trimEnd();
2082
- }
2083
- ) : (
2084
- // Ponyfill
2085
- function(t) {
2086
- return t.replace(It, "");
2087
- }
2088
- );
2089
- function we(e, t) {
2090
- return new RegExp(e, t);
2091
- }
2092
- var te;
2093
- if (K) {
2094
- var ge = we("([^\\p{White_Space}\\p{Pattern_Syntax}]*)", "yu");
2095
- te = function(t, r) {
2096
- var n;
2097
- ge.lastIndex = r;
2098
- var i = ge.exec(t);
2099
- return (n = i[1]) !== null && n !== void 0 ? n : "";
2100
- };
2101
- } else
2102
- te = function(t, r) {
2103
- for (var n = []; ; ) {
2104
- var i = Fe(t, r);
2105
- if (i === void 0 || De(i) || kt(i))
2106
- break;
2107
- n.push(i), r += i >= 65536 ? 2 : 1;
2108
- }
2109
- return ee.apply(void 0, n);
2110
- };
2111
- var Vt = (
2112
- /** @class */
2113
- function() {
2114
- function e(t, r) {
2115
- r === void 0 && (r = {}), this.message = t, this.position = { offset: 0, line: 1, column: 1 }, this.ignoreTag = !!r.ignoreTag, this.locale = r.locale, this.requiresOtherClause = !!r.requiresOtherClause, this.shouldParseSkeletons = !!r.shouldParseSkeletons;
2116
- }
2117
- return e.prototype.parse = function() {
2118
- if (this.offset() !== 0)
2119
- throw Error("parser can only be used once");
2120
- return this.parseMessage(0, "", !1);
2121
- }, e.prototype.parseMessage = function(t, r, n) {
2122
- for (var i = []; !this.isEOF(); ) {
2123
- var a = this.char();
2124
- if (a === 123) {
2125
- var o = this.parseArgument(t, n);
2126
- if (o.err)
2127
- return o;
2128
- i.push(o.val);
2129
- } else {
2130
- if (a === 125 && t > 0)
2131
- break;
2132
- if (a === 35 && (r === "plural" || r === "selectordinal")) {
2133
- var s = this.clonePosition();
2134
- this.bump(), i.push({
2135
- type: T.pound,
2136
- location: x(s, this.clonePosition())
2137
- });
2138
- } else if (a === 60 && !this.ignoreTag && this.peek() === 47) {
2139
- if (n)
2140
- break;
2141
- return this.error(E.UNMATCHED_CLOSING_TAG, x(this.clonePosition(), this.clonePosition()));
2142
- } else if (a === 60 && !this.ignoreTag && re(this.peek() || 0)) {
2143
- var o = this.parseTag(t, r);
2144
- if (o.err)
2145
- return o;
2146
- i.push(o.val);
2147
- } else {
2148
- var o = this.parseLiteral(t, r);
2149
- if (o.err)
2150
- return o;
2151
- i.push(o.val);
2152
- }
2153
- }
2154
- }
2155
- return { val: i, err: null };
2156
- }, e.prototype.parseTag = function(t, r) {
2157
- var n = this.clonePosition();
2158
- this.bump();
2159
- var i = this.parseTagName();
2160
- if (this.bumpSpace(), this.bumpIf("/>"))
2161
- return {
2162
- val: {
2163
- type: T.literal,
2164
- value: "<".concat(i, "/>"),
2165
- location: x(n, this.clonePosition())
2166
- },
2167
- err: null
2168
- };
2169
- if (this.bumpIf(">")) {
2170
- var a = this.parseMessage(t + 1, r, !0);
2171
- if (a.err)
2172
- return a;
2173
- var o = a.val, s = this.clonePosition();
2174
- if (this.bumpIf("</")) {
2175
- if (this.isEOF() || !re(this.char()))
2176
- return this.error(E.INVALID_TAG, x(s, this.clonePosition()));
2177
- var h = this.clonePosition(), u = this.parseTagName();
2178
- return i !== u ? this.error(E.UNMATCHED_CLOSING_TAG, x(h, this.clonePosition())) : (this.bumpSpace(), this.bumpIf(">") ? {
2179
- val: {
2180
- type: T.tag,
2181
- value: i,
2182
- children: o,
2183
- location: x(n, this.clonePosition())
2184
- },
2185
- err: null
2186
- } : this.error(E.INVALID_TAG, x(s, this.clonePosition())));
2187
- } else
2188
- return this.error(E.UNCLOSED_TAG, x(n, this.clonePosition()));
2189
- } else
2190
- return this.error(E.INVALID_TAG, x(n, this.clonePosition()));
2191
- }, e.prototype.parseTagName = function() {
2192
- var t = this.offset();
2193
- for (this.bump(); !this.isEOF() && $t(this.char()); )
2194
- this.bump();
2195
- return this.message.slice(t, this.offset());
2196
- }, e.prototype.parseLiteral = function(t, r) {
2197
- for (var n = this.clonePosition(), i = ""; ; ) {
2198
- var a = this.tryParseQuote(r);
2199
- if (a) {
2200
- i += a;
2201
- continue;
2202
- }
2203
- var o = this.tryParseUnquoted(t, r);
2204
- if (o) {
2205
- i += o;
2206
- continue;
2207
- }
2208
- var s = this.tryParseLeftAngleBracket();
2209
- if (s) {
2210
- i += s;
2211
- continue;
2212
- }
2213
- break;
2214
- }
2215
- var h = x(n, this.clonePosition());
2216
- return {
2217
- val: { type: T.literal, value: i, location: h },
2218
- err: null
2219
- };
2220
- }, e.prototype.tryParseLeftAngleBracket = function() {
2221
- return !this.isEOF() && this.char() === 60 && (this.ignoreTag || // If at the opening tag or closing tag position, bail.
2222
- !Xt(this.peek() || 0)) ? (this.bump(), "<") : null;
2223
- }, e.prototype.tryParseQuote = function(t) {
2224
- if (this.isEOF() || this.char() !== 39)
2225
- return null;
2226
- switch (this.peek()) {
2227
- case 39:
2228
- return this.bump(), this.bump(), "'";
2229
- case 123:
2230
- case 60:
2231
- case 62:
2232
- case 125:
2233
- break;
2234
- case 35:
2235
- if (t === "plural" || t === "selectordinal")
2236
- break;
2237
- return null;
2238
- default:
2239
- return null;
2240
- }
2241
- this.bump();
2242
- var r = [this.char()];
2243
- for (this.bump(); !this.isEOF(); ) {
2244
- var n = this.char();
2245
- if (n === 39)
2246
- if (this.peek() === 39)
2247
- r.push(39), this.bump();
2248
- else {
2249
- this.bump();
2250
- break;
2251
- }
2252
- else
2253
- r.push(n);
2254
- this.bump();
2255
- }
2256
- return ee.apply(void 0, r);
2257
- }, e.prototype.tryParseUnquoted = function(t, r) {
2258
- if (this.isEOF())
2259
- return null;
2260
- var n = this.char();
2261
- return n === 60 || n === 123 || n === 35 && (r === "plural" || r === "selectordinal") || n === 125 && t > 0 ? null : (this.bump(), ee(n));
2262
- }, e.prototype.parseArgument = function(t, r) {
2263
- var n = this.clonePosition();
2264
- if (this.bump(), this.bumpSpace(), this.isEOF())
2265
- return this.error(E.EXPECT_ARGUMENT_CLOSING_BRACE, x(n, this.clonePosition()));
2266
- if (this.char() === 125)
2267
- return this.bump(), this.error(E.EMPTY_ARGUMENT, x(n, this.clonePosition()));
2268
- var i = this.parseIdentifierIfPossible().value;
2269
- if (!i)
2270
- return this.error(E.MALFORMED_ARGUMENT, x(n, this.clonePosition()));
2271
- if (this.bumpSpace(), this.isEOF())
2272
- return this.error(E.EXPECT_ARGUMENT_CLOSING_BRACE, x(n, this.clonePosition()));
2273
- switch (this.char()) {
2274
- case 125:
2275
- return this.bump(), {
2276
- val: {
2277
- type: T.argument,
2278
- // value does not include the opening and closing braces.
2279
- value: i,
2280
- location: x(n, this.clonePosition())
2281
- },
2282
- err: null
2283
- };
2284
- case 44:
2285
- return this.bump(), this.bumpSpace(), this.isEOF() ? this.error(E.EXPECT_ARGUMENT_CLOSING_BRACE, x(n, this.clonePosition())) : this.parseArgumentOptions(t, r, i, n);
2286
- default:
2287
- return this.error(E.MALFORMED_ARGUMENT, x(n, this.clonePosition()));
2288
- }
2289
- }, e.prototype.parseIdentifierIfPossible = function() {
2290
- var t = this.clonePosition(), r = this.offset(), n = te(this.message, r), i = r + n.length;
2291
- this.bumpTo(i);
2292
- var a = this.clonePosition(), o = x(t, a);
2293
- return { value: n, location: o };
2294
- }, e.prototype.parseArgumentOptions = function(t, r, n, i) {
2295
- var a, o = this.clonePosition(), s = this.parseIdentifierIfPossible().value, h = this.clonePosition();
2296
- switch (s) {
2297
- case "":
2298
- return this.error(E.EXPECT_ARGUMENT_TYPE, x(o, h));
2299
- case "number":
2300
- case "date":
2301
- case "time": {
2302
- this.bumpSpace();
2303
- var u = null;
2304
- if (this.bumpIf(",")) {
2305
- this.bumpSpace();
2306
- var f = this.clonePosition(), m = this.parseSimpleArgStyleIfPossible();
2307
- if (m.err)
2308
- return m;
2309
- var p = Gt(m.val);
2310
- if (p.length === 0)
2311
- return this.error(E.EXPECT_ARGUMENT_STYLE, x(this.clonePosition(), this.clonePosition()));
2312
- var y = x(f, this.clonePosition());
2313
- u = { style: p, styleLocation: y };
2314
- }
2315
- var S = this.tryParseArgumentClose(i);
2316
- if (S.err)
2317
- return S;
2318
- var A = x(i, this.clonePosition());
2319
- if (u && de(u == null ? void 0 : u.style, "::", 0)) {
2320
- var P = Ut(u.style.slice(2));
2321
- if (s === "number") {
2322
- var m = this.parseNumberSkeletonFromString(P, u.styleLocation);
2323
- return m.err ? m : {
2324
- val: { type: T.number, value: n, location: A, style: m.val },
2325
- err: null
2326
- };
2327
- } else {
2328
- if (P.length === 0)
2329
- return this.error(E.EXPECT_DATE_TIME_SKELETON, A);
2330
- var L = P;
2331
- this.locale && (L = At(P, this.locale));
2332
- var p = {
2333
- type: D.dateTime,
2334
- pattern: L,
2335
- location: u.styleLocation,
2336
- parsedOptions: this.shouldParseSkeletons ? dt(L) : {}
2337
- }, I = s === "date" ? T.date : T.time;
2338
- return {
2339
- val: { type: I, value: n, location: A, style: p },
2340
- err: null
2341
- };
2342
- }
2343
- }
2344
- return {
2345
- val: {
2346
- type: s === "number" ? T.number : s === "date" ? T.date : T.time,
2347
- value: n,
2348
- location: A,
2349
- style: (a = u == null ? void 0 : u.style) !== null && a !== void 0 ? a : null
2350
- },
2351
- err: null
2352
- };
2353
- }
2354
- case "plural":
2355
- case "selectordinal":
2356
- case "select": {
2357
- var g = this.clonePosition();
2358
- if (this.bumpSpace(), !this.bumpIf(","))
2359
- return this.error(E.EXPECT_SELECT_ARGUMENT_OPTIONS, x(g, v({}, g)));
2360
- this.bumpSpace();
2361
- var _ = this.parseIdentifierIfPossible(), l = 0;
2362
- if (s !== "select" && _.value === "offset") {
2363
- if (!this.bumpIf(":"))
2364
- return this.error(E.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE, x(this.clonePosition(), this.clonePosition()));
2365
- this.bumpSpace();
2366
- var m = this.tryParseDecimalInteger(E.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE, E.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE);
2367
- if (m.err)
2368
- return m;
2369
- this.bumpSpace(), _ = this.parseIdentifierIfPossible(), l = m.val;
2370
- }
2371
- var B = this.tryParsePluralOrSelectOptions(t, s, r, _);
2372
- if (B.err)
2373
- return B;
2374
- var S = this.tryParseArgumentClose(i);
2375
- if (S.err)
2376
- return S;
2377
- var V = x(i, this.clonePosition());
2378
- return s === "select" ? {
2379
- val: {
2380
- type: T.select,
2381
- value: n,
2382
- options: ye(B.val),
2383
- location: V
2384
- },
2385
- err: null
2386
- } : {
2387
- val: {
2388
- type: T.plural,
2389
- value: n,
2390
- options: ye(B.val),
2391
- offset: l,
2392
- pluralType: s === "plural" ? "cardinal" : "ordinal",
2393
- location: V
2394
- },
2395
- err: null
2396
- };
2397
- }
2398
- default:
2399
- return this.error(E.INVALID_ARGUMENT_TYPE, x(o, h));
2400
- }
2401
- }, e.prototype.tryParseArgumentClose = function(t) {
2402
- return this.isEOF() || this.char() !== 125 ? this.error(E.EXPECT_ARGUMENT_CLOSING_BRACE, x(t, this.clonePosition())) : (this.bump(), { val: !0, err: null });
2403
- }, e.prototype.parseSimpleArgStyleIfPossible = function() {
2404
- for (var t = 0, r = this.clonePosition(); !this.isEOF(); ) {
2405
- var n = this.char();
2406
- switch (n) {
2407
- case 39: {
2408
- this.bump();
2409
- var i = this.clonePosition();
2410
- if (!this.bumpUntil("'"))
2411
- return this.error(E.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE, x(i, this.clonePosition()));
2412
- this.bump();
2413
- break;
2414
- }
2415
- case 123: {
2416
- t += 1, this.bump();
2417
- break;
2418
- }
2419
- case 125: {
2420
- if (t > 0)
2421
- t -= 1;
2422
- else
2423
- return {
2424
- val: this.message.slice(r.offset, this.offset()),
2425
- err: null
2426
- };
2427
- break;
2428
- }
2429
- default:
2430
- this.bump();
2431
- break;
2432
- }
2433
- }
2434
- return {
2435
- val: this.message.slice(r.offset, this.offset()),
2436
- err: null
2437
- };
2438
- }, e.prototype.parseNumberSkeletonFromString = function(t, r) {
2439
- var n = [];
2440
- try {
2441
- n = gt(t);
2442
- } catch {
2443
- return this.error(E.INVALID_NUMBER_SKELETON, r);
2444
- }
2445
- return {
2446
- val: {
2447
- type: D.number,
2448
- tokens: n,
2449
- location: r,
2450
- parsedOptions: this.shouldParseSkeletons ? Ht(n) : {}
2451
- },
2452
- err: null
2453
- };
2454
- }, e.prototype.tryParsePluralOrSelectOptions = function(t, r, n, i) {
2455
- for (var a, o = !1, s = [], h = /* @__PURE__ */ new Set(), u = i.value, f = i.location; ; ) {
2456
- if (u.length === 0) {
2457
- var m = this.clonePosition();
2458
- if (r !== "select" && this.bumpIf("=")) {
2459
- var p = this.tryParseDecimalInteger(E.EXPECT_PLURAL_ARGUMENT_SELECTOR, E.INVALID_PLURAL_ARGUMENT_SELECTOR);
2460
- if (p.err)
2461
- return p;
2462
- f = x(m, this.clonePosition()), u = this.message.slice(m.offset, this.offset());
2463
- } else
2464
- break;
2465
- }
2466
- if (h.has(u))
2467
- return this.error(r === "select" ? E.DUPLICATE_SELECT_ARGUMENT_SELECTOR : E.DUPLICATE_PLURAL_ARGUMENT_SELECTOR, f);
2468
- u === "other" && (o = !0), this.bumpSpace();
2469
- var y = this.clonePosition();
2470
- if (!this.bumpIf("{"))
2471
- return this.error(r === "select" ? E.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT : E.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT, x(this.clonePosition(), this.clonePosition()));
2472
- var S = this.parseMessage(t + 1, r, n);
2473
- if (S.err)
2474
- return S;
2475
- var A = this.tryParseArgumentClose(y);
2476
- if (A.err)
2477
- return A;
2478
- s.push([
2479
- u,
2480
- {
2481
- value: S.val,
2482
- location: x(y, this.clonePosition())
2483
- }
2484
- ]), h.add(u), this.bumpSpace(), a = this.parseIdentifierIfPossible(), u = a.value, f = a.location;
2485
- }
2486
- return s.length === 0 ? this.error(r === "select" ? E.EXPECT_SELECT_ARGUMENT_SELECTOR : E.EXPECT_PLURAL_ARGUMENT_SELECTOR, x(this.clonePosition(), this.clonePosition())) : this.requiresOtherClause && !o ? this.error(E.MISSING_OTHER_CLAUSE, x(this.clonePosition(), this.clonePosition())) : { val: s, err: null };
2487
- }, e.prototype.tryParseDecimalInteger = function(t, r) {
2488
- var n = 1, i = this.clonePosition();
2489
- this.bumpIf("+") || this.bumpIf("-") && (n = -1);
2490
- for (var a = !1, o = 0; !this.isEOF(); ) {
2491
- var s = this.char();
2492
- if (s >= 48 && s <= 57)
2493
- a = !0, o = o * 10 + (s - 48), this.bump();
2494
- else
2495
- break;
2496
- }
2497
- var h = x(i, this.clonePosition());
2498
- return a ? (o *= n, wt(o) ? { val: o, err: null } : this.error(r, h)) : this.error(t, h);
2499
- }, e.prototype.offset = function() {
2500
- return this.position.offset;
2501
- }, e.prototype.isEOF = function() {
2502
- return this.offset() === this.message.length;
2503
- }, e.prototype.clonePosition = function() {
2504
- return {
2505
- offset: this.position.offset,
2506
- line: this.position.line,
2507
- column: this.position.column
2508
- };
2509
- }, e.prototype.char = function() {
2510
- var t = this.position.offset;
2511
- if (t >= this.message.length)
2512
- throw Error("out of bound");
2513
- var r = Fe(this.message, t);
2514
- if (r === void 0)
2515
- throw Error("Offset ".concat(t, " is at invalid UTF-16 code unit boundary"));
2516
- return r;
2517
- }, e.prototype.error = function(t, r) {
2518
- return {
2519
- val: null,
2520
- err: {
2521
- kind: t,
2522
- message: this.message,
2523
- location: r
2524
- }
2525
- };
2526
- }, e.prototype.bump = function() {
2527
- if (!this.isEOF()) {
2528
- var t = this.char();
2529
- t === 10 ? (this.position.line += 1, this.position.column = 1, this.position.offset += 1) : (this.position.column += 1, this.position.offset += t < 65536 ? 1 : 2);
2530
- }
2531
- }, e.prototype.bumpIf = function(t) {
2532
- if (de(this.message, t, this.offset())) {
2533
- for (var r = 0; r < t.length; r++)
2534
- this.bump();
2535
- return !0;
2536
- }
2537
- return !1;
2538
- }, e.prototype.bumpUntil = function(t) {
2539
- var r = this.offset(), n = this.message.indexOf(t, r);
2540
- return n >= 0 ? (this.bumpTo(n), !0) : (this.bumpTo(this.message.length), !1);
2541
- }, e.prototype.bumpTo = function(t) {
2542
- if (this.offset() > t)
2543
- throw Error("targetOffset ".concat(t, " must be greater than or equal to the current offset ").concat(this.offset()));
2544
- for (t = Math.min(t, this.message.length); ; ) {
2545
- var r = this.offset();
2546
- if (r === t)
2547
- break;
2548
- if (r > t)
2549
- throw Error("targetOffset ".concat(t, " is at invalid UTF-16 code unit boundary"));
2550
- if (this.bump(), this.isEOF())
2551
- break;
2552
- }
2553
- }, e.prototype.bumpSpace = function() {
2554
- for (; !this.isEOF() && De(this.char()); )
2555
- this.bump();
2556
- }, e.prototype.peek = function() {
2557
- if (this.isEOF())
2558
- return null;
2559
- var t = this.char(), r = this.offset(), n = this.message.charCodeAt(r + (t >= 65536 ? 2 : 1));
2560
- return n ?? null;
2561
- }, e;
2562
- }()
2563
- );
2564
- function re(e) {
2565
- return e >= 97 && e <= 122 || e >= 65 && e <= 90;
2566
- }
2567
- function Xt(e) {
2568
- return re(e) || e === 47;
2569
- }
2570
- function $t(e) {
2571
- return e === 45 || e === 46 || e >= 48 && e <= 57 || e === 95 || e >= 97 && e <= 122 || e >= 65 && e <= 90 || e == 183 || e >= 192 && e <= 214 || e >= 216 && e <= 246 || e >= 248 && e <= 893 || e >= 895 && e <= 8191 || e >= 8204 && e <= 8205 || e >= 8255 && e <= 8256 || e >= 8304 && e <= 8591 || e >= 11264 && e <= 12271 || e >= 12289 && e <= 55295 || e >= 63744 && e <= 64975 || e >= 65008 && e <= 65533 || e >= 65536 && e <= 983039;
2572
- }
2573
- function De(e) {
2574
- return e >= 9 && e <= 13 || e === 32 || e === 133 || e >= 8206 && e <= 8207 || e === 8232 || e === 8233;
2575
- }
2576
- function kt(e) {
2577
- return e >= 33 && e <= 35 || e === 36 || e >= 37 && e <= 39 || e === 40 || e === 41 || e === 42 || e === 43 || e === 44 || e === 45 || e >= 46 && e <= 47 || e >= 58 && e <= 59 || e >= 60 && e <= 62 || e >= 63 && e <= 64 || e === 91 || e === 92 || e === 93 || e === 94 || e === 96 || e === 123 || e === 124 || e === 125 || e === 126 || e === 161 || e >= 162 && e <= 165 || e === 166 || e === 167 || e === 169 || e === 171 || e === 172 || e === 174 || e === 176 || e === 177 || e === 182 || e === 187 || e === 191 || e === 215 || e === 247 || e >= 8208 && e <= 8213 || e >= 8214 && e <= 8215 || e === 8216 || e === 8217 || e === 8218 || e >= 8219 && e <= 8220 || e === 8221 || e === 8222 || e === 8223 || e >= 8224 && e <= 8231 || e >= 8240 && e <= 8248 || e === 8249 || e === 8250 || e >= 8251 && e <= 8254 || e >= 8257 && e <= 8259 || e === 8260 || e === 8261 || e === 8262 || e >= 8263 && e <= 8273 || e === 8274 || e === 8275 || e >= 8277 && e <= 8286 || e >= 8592 && e <= 8596 || e >= 8597 && e <= 8601 || e >= 8602 && e <= 8603 || e >= 8604 && e <= 8607 || e === 8608 || e >= 8609 && e <= 8610 || e === 8611 || e >= 8612 && e <= 8613 || e === 8614 || e >= 8615 && e <= 8621 || e === 8622 || e >= 8623 && e <= 8653 || e >= 8654 && e <= 8655 || e >= 8656 && e <= 8657 || e === 8658 || e === 8659 || e === 8660 || e >= 8661 && e <= 8691 || e >= 8692 && e <= 8959 || e >= 8960 && e <= 8967 || e === 8968 || e === 8969 || e === 8970 || e === 8971 || e >= 8972 && e <= 8991 || e >= 8992 && e <= 8993 || e >= 8994 && e <= 9e3 || e === 9001 || e === 9002 || e >= 9003 && e <= 9083 || e === 9084 || e >= 9085 && e <= 9114 || e >= 9115 && e <= 9139 || e >= 9140 && e <= 9179 || e >= 9180 && e <= 9185 || e >= 9186 && e <= 9254 || e >= 9255 && e <= 9279 || e >= 9280 && e <= 9290 || e >= 9291 && e <= 9311 || e >= 9472 && e <= 9654 || e === 9655 || e >= 9656 && e <= 9664 || e === 9665 || e >= 9666 && e <= 9719 || e >= 9720 && e <= 9727 || e >= 9728 && e <= 9838 || e === 9839 || e >= 9840 && e <= 10087 || e === 10088 || e === 10089 || e === 10090 || e === 10091 || e === 10092 || e === 10093 || e === 10094 || e === 10095 || e === 10096 || e === 10097 || e === 10098 || e === 10099 || e === 10100 || e === 10101 || e >= 10132 && e <= 10175 || e >= 10176 && e <= 10180 || e === 10181 || e === 10182 || e >= 10183 && e <= 10213 || e === 10214 || e === 10215 || e === 10216 || e === 10217 || e === 10218 || e === 10219 || e === 10220 || e === 10221 || e === 10222 || e === 10223 || e >= 10224 && e <= 10239 || e >= 10240 && e <= 10495 || e >= 10496 && e <= 10626 || e === 10627 || e === 10628 || e === 10629 || e === 10630 || e === 10631 || e === 10632 || e === 10633 || e === 10634 || e === 10635 || e === 10636 || e === 10637 || e === 10638 || e === 10639 || e === 10640 || e === 10641 || e === 10642 || e === 10643 || e === 10644 || e === 10645 || e === 10646 || e === 10647 || e === 10648 || e >= 10649 && e <= 10711 || e === 10712 || e === 10713 || e === 10714 || e === 10715 || e >= 10716 && e <= 10747 || e === 10748 || e === 10749 || e >= 10750 && e <= 11007 || e >= 11008 && e <= 11055 || e >= 11056 && e <= 11076 || e >= 11077 && e <= 11078 || e >= 11079 && e <= 11084 || e >= 11085 && e <= 11123 || e >= 11124 && e <= 11125 || e >= 11126 && e <= 11157 || e === 11158 || e >= 11159 && e <= 11263 || e >= 11776 && e <= 11777 || e === 11778 || e === 11779 || e === 11780 || e === 11781 || e >= 11782 && e <= 11784 || e === 11785 || e === 11786 || e === 11787 || e === 11788 || e === 11789 || e >= 11790 && e <= 11798 || e === 11799 || e >= 11800 && e <= 11801 || e === 11802 || e === 11803 || e === 11804 || e === 11805 || e >= 11806 && e <= 11807 || e === 11808 || e === 11809 || e === 11810 || e === 11811 || e === 11812 || e === 11813 || e === 11814 || e === 11815 || e === 11816 || e === 11817 || e >= 11818 && e <= 11822 || e === 11823 || e >= 11824 && e <= 11833 || e >= 11834 && e <= 11835 || e >= 11836 && e <= 11839 || e === 11840 || e === 11841 || e === 11842 || e >= 11843 && e <= 11855 || e >= 11856 && e <= 11857 || e === 11858 || e >= 11859 && e <= 11903 || e >= 12289 && e <= 12291 || e === 12296 || e === 12297 || e === 12298 || e === 12299 || e === 12300 || e === 12301 || e === 12302 || e === 12303 || e === 12304 || e === 12305 || e >= 12306 && e <= 12307 || e === 12308 || e === 12309 || e === 12310 || e === 12311 || e === 12312 || e === 12313 || e === 12314 || e === 12315 || e === 12316 || e === 12317 || e >= 12318 && e <= 12319 || e === 12320 || e === 12336 || e === 64830 || e === 64831 || e >= 65093 && e <= 65094;
2578
- }
2579
- function ne(e) {
2580
- e.forEach(function(t) {
2581
- if (delete t.location, Ne(t) || Ie(t))
2582
- for (var r in t.options)
2583
- delete t.options[r].location, ne(t.options[r].value);
2584
- else
2585
- He(t) && Re(t.style) || (Ae(t) || Pe(t)) && Q(t.style) ? delete t.style.location : Be(t) && ne(t.children);
2586
- });
2587
- }
2588
- function Wt(e, t) {
2589
- t === void 0 && (t = {}), t = v({ shouldParseSkeletons: !0, requiresOtherClause: !0 }, t);
2590
- var r = new Vt(e, t).parse();
2591
- if (r.err) {
2592
- var n = SyntaxError(E[r.err.kind]);
2593
- throw n.location = r.err.location, n.originalMessage = r.err.message, n;
2594
- }
2595
- return t != null && t.captureLocation || ne(r.val), r.val;
2596
- }
2597
- function R(e, t) {
2598
- var r = t && t.cache ? t.cache : Jt, n = t && t.serializer ? t.serializer : qt, i = t && t.strategy ? t.strategy : zt;
2599
- return i(e, {
2600
- cache: r,
2601
- serializer: n
2602
- });
2603
- }
2604
- function jt(e) {
2605
- return e == null || typeof e == "number" || typeof e == "boolean";
2606
- }
2607
- function Ue(e, t, r, n) {
2608
- var i = jt(n) ? n : r(n), a = t.get(i);
2609
- return typeof a > "u" && (a = e.call(this, n), t.set(i, a)), a;
2610
- }
2611
- function Ge(e, t, r) {
2612
- var n = Array.prototype.slice.call(arguments, 3), i = r(n), a = t.get(i);
2613
- return typeof a > "u" && (a = e.apply(this, n), t.set(i, a)), a;
2614
- }
2615
- function oe(e, t, r, n, i) {
2616
- return r.bind(t, e, n, i);
2617
- }
2618
- function zt(e, t) {
2619
- var r = e.length === 1 ? Ue : Ge;
2620
- return oe(e, this, r, t.cache.create(), t.serializer);
2621
- }
2622
- function Yt(e, t) {
2623
- return oe(e, this, Ge, t.cache.create(), t.serializer);
2624
- }
2625
- function Zt(e, t) {
2626
- return oe(e, this, Ue, t.cache.create(), t.serializer);
2627
- }
2628
- var qt = function() {
2629
- return JSON.stringify(arguments);
2630
- };
2631
- function se() {
2632
- this.cache = /* @__PURE__ */ Object.create(null);
2633
- }
2634
- se.prototype.get = function(e) {
2635
- return this.cache[e];
2636
- };
2637
- se.prototype.set = function(e, t) {
2638
- this.cache[e] = t;
2639
- };
2640
- var Jt = {
2641
- create: function() {
2642
- return new se();
2643
- }
2644
- }, C = {
2645
- variadic: Yt,
2646
- monadic: Zt
2647
- }, U;
2648
- (function(e) {
2649
- e.MISSING_VALUE = "MISSING_VALUE", e.INVALID_VALUE = "INVALID_VALUE", e.MISSING_INTL_API = "MISSING_INTL_API";
2650
- })(U || (U = {}));
2651
- var j = (
2652
- /** @class */
2653
- function(e) {
2654
- N(t, e);
2655
- function t(r, n, i) {
2656
- var a = e.call(this, r) || this;
2657
- return a.code = n, a.originalMessage = i, a;
2658
- }
2659
- return t.prototype.toString = function() {
2660
- return "[formatjs Error: ".concat(this.code, "] ").concat(this.message);
2661
- }, t;
2662
- }(Error)
2663
- ), Te = (
2664
- /** @class */
2665
- function(e) {
2666
- N(t, e);
2667
- function t(r, n, i, a) {
2668
- return e.call(this, 'Invalid values for "'.concat(r, '": "').concat(n, '". Options are "').concat(Object.keys(i).join('", "'), '"'), U.INVALID_VALUE, a) || this;
2669
- }
2670
- return t;
2671
- }(j)
2672
- ), Qt = (
2673
- /** @class */
2674
- function(e) {
2675
- N(t, e);
2676
- function t(r, n, i) {
2677
- return e.call(this, 'Value for "'.concat(r, '" must be of type ').concat(n), U.INVALID_VALUE, i) || this;
2678
- }
2679
- return t;
2680
- }(j)
2681
- ), Kt = (
2682
- /** @class */
2683
- function(e) {
2684
- N(t, e);
2685
- function t(r, n) {
2686
- return e.call(this, 'The intl string context variable "'.concat(r, '" was not provided to the string "').concat(n, '"'), U.MISSING_VALUE, n) || this;
2687
- }
2688
- return t;
2689
- }(j)
2690
- ), H;
2691
- (function(e) {
2692
- e[e.literal = 0] = "literal", e[e.object = 1] = "object";
2693
- })(H || (H = {}));
2694
- function er(e) {
2695
- return e.length < 2 ? e : e.reduce(function(t, r) {
2696
- var n = t[t.length - 1];
2697
- return !n || n.type !== H.literal || r.type !== H.literal ? t.push(r) : n.value += r.value, t;
2698
- }, []);
2699
- }
2700
- function tr(e) {
2701
- return typeof e == "function";
2702
- }
2703
- function k(e, t, r, n, i, a, o) {
2704
- if (e.length === 1 && Ee(e[0]))
2705
- return [
2706
- {
2707
- type: H.literal,
2708
- value: e[0].value
2709
- }
2710
- ];
2711
- for (var s = [], h = 0, u = e; h < u.length; h++) {
2712
- var f = u[h];
2713
- if (Ee(f)) {
2714
- s.push({
2715
- type: H.literal,
2716
- value: f.value
2717
- });
2718
- continue;
2719
- }
2720
- if (xt(f)) {
2721
- typeof a == "number" && s.push({
2722
- type: H.literal,
2723
- value: r.getNumberFormat(t).format(a)
2724
- });
2725
- continue;
2726
- }
2727
- var m = f.value;
2728
- if (!(i && m in i))
2729
- throw new Kt(m, o);
2730
- var p = i[m];
2731
- if (vt(f)) {
2732
- (!p || typeof p == "string" || typeof p == "number") && (p = typeof p == "string" || typeof p == "number" ? String(p) : ""), s.push({
2733
- type: typeof p == "string" ? H.literal : H.object,
2734
- value: p
2735
- });
2736
- continue;
2737
- }
2738
- if (Ae(f)) {
2739
- var y = typeof f.style == "string" ? n.date[f.style] : Q(f.style) ? f.style.parsedOptions : void 0;
2740
- s.push({
2741
- type: H.literal,
2742
- value: r.getDateTimeFormat(t, y).format(p)
2743
- });
2744
- continue;
2745
- }
2746
- if (Pe(f)) {
2747
- var y = typeof f.style == "string" ? n.time[f.style] : Q(f.style) ? f.style.parsedOptions : n.time.medium;
2748
- s.push({
2749
- type: H.literal,
2750
- value: r.getDateTimeFormat(t, y).format(p)
2751
- });
2752
- continue;
2753
- }
2754
- if (He(f)) {
2755
- var y = typeof f.style == "string" ? n.number[f.style] : Re(f.style) ? f.style.parsedOptions : void 0;
2756
- y && y.scale && (p = p * (y.scale || 1)), s.push({
2757
- type: H.literal,
2758
- value: r.getNumberFormat(t, y).format(p)
2759
- });
2760
- continue;
2761
- }
2762
- if (Be(f)) {
2763
- var S = f.children, A = f.value, P = i[A];
2764
- if (!tr(P))
2765
- throw new Qt(A, "function", o);
2766
- var L = k(S, t, r, n, i, a), I = P(L.map(function(l) {
2767
- return l.value;
2768
- }));
2769
- Array.isArray(I) || (I = [I]), s.push.apply(s, I.map(function(l) {
2770
- return {
2771
- type: typeof l == "string" ? H.literal : H.object,
2772
- value: l
2773
- };
2774
- }));
2775
- }
2776
- if (Ne(f)) {
2777
- var g = f.options[p] || f.options.other;
2778
- if (!g)
2779
- throw new Te(f.value, p, Object.keys(f.options), o);
2780
- s.push.apply(s, k(g.value, t, r, n, i));
2781
- continue;
2782
- }
2783
- if (Ie(f)) {
2784
- var g = f.options["=".concat(p)];
2785
- if (!g) {
2786
- if (!Intl.PluralRules)
2787
- throw new j(`Intl.PluralRules is not available in this environment.
2788
- Try polyfilling it using "@formatjs/intl-pluralrules"
2789
- `, U.MISSING_INTL_API, o);
2790
- var _ = r.getPluralRules(t, { type: f.pluralType }).select(p - (f.offset || 0));
2791
- g = f.options[_] || f.options.other;
2792
- }
2793
- if (!g)
2794
- throw new Te(f.value, p, Object.keys(f.options), o);
2795
- s.push.apply(s, k(g.value, t, r, n, i, p - (f.offset || 0)));
2796
- continue;
2797
- }
2798
- }
2799
- return er(s);
2800
- }
2801
- function rr(e, t) {
2802
- return t ? v(v(v({}, e || {}), t || {}), Object.keys(e).reduce(function(r, n) {
2803
- return r[n] = v(v({}, e[n]), t[n] || {}), r;
2804
- }, {})) : e;
2805
- }
2806
- function nr(e, t) {
2807
- return t ? Object.keys(e).reduce(function(r, n) {
2808
- return r[n] = rr(e[n], t[n]), r;
2809
- }, v({}, e)) : e;
2810
- }
2811
- function Z(e) {
2812
- return {
2813
- create: function() {
2814
- return {
2815
- get: function(t) {
2816
- return e[t];
2817
- },
2818
- set: function(t, r) {
2819
- e[t] = r;
2820
- }
2821
- };
2822
- }
2823
- };
2824
- }
2825
- function ir(e) {
2826
- return e === void 0 && (e = {
2827
- number: {},
2828
- dateTime: {},
2829
- pluralRules: {}
2830
- }), {
2831
- getNumberFormat: R(function() {
2832
- for (var t, r = [], n = 0; n < arguments.length; n++)
2833
- r[n] = arguments[n];
2834
- return new ((t = Intl.NumberFormat).bind.apply(t, M([void 0], r, !1)))();
2835
- }, {
2836
- cache: Z(e.number),
2837
- strategy: C.variadic
2838
- }),
2839
- getDateTimeFormat: R(function() {
2840
- for (var t, r = [], n = 0; n < arguments.length; n++)
2841
- r[n] = arguments[n];
2842
- return new ((t = Intl.DateTimeFormat).bind.apply(t, M([void 0], r, !1)))();
2843
- }, {
2844
- cache: Z(e.dateTime),
2845
- strategy: C.variadic
2846
- }),
2847
- getPluralRules: R(function() {
2848
- for (var t, r = [], n = 0; n < arguments.length; n++)
2849
- r[n] = arguments[n];
2850
- return new ((t = Intl.PluralRules).bind.apply(t, M([void 0], r, !1)))();
2851
- }, {
2852
- cache: Z(e.pluralRules),
2853
- strategy: C.variadic
2854
- })
2855
- };
2856
- }
2857
- var ar = (
2858
- /** @class */
2859
- function() {
2860
- function e(t, r, n, i) {
2861
- var a = this;
2862
- if (r === void 0 && (r = e.defaultLocale), this.formatterCache = {
2863
- number: {},
2864
- dateTime: {},
2865
- pluralRules: {}
2866
- }, this.format = function(h) {
2867
- var u = a.formatToParts(h);
2868
- if (u.length === 1)
2869
- return u[0].value;
2870
- var f = u.reduce(function(m, p) {
2871
- return !m.length || p.type !== H.literal || typeof m[m.length - 1] != "string" ? m.push(p.value) : m[m.length - 1] += p.value, m;
2872
- }, []);
2873
- return f.length <= 1 ? f[0] || "" : f;
2874
- }, this.formatToParts = function(h) {
2875
- return k(a.ast, a.locales, a.formatters, a.formats, h, void 0, a.message);
2876
- }, this.resolvedOptions = function() {
2877
- var h;
2878
- return {
2879
- locale: ((h = a.resolvedLocale) === null || h === void 0 ? void 0 : h.toString()) || Intl.NumberFormat.supportedLocalesOf(a.locales)[0]
2880
- };
2881
- }, this.getAst = function() {
2882
- return a.ast;
2883
- }, this.locales = r, this.resolvedLocale = e.resolveLocale(r), typeof t == "string") {
2884
- if (this.message = t, !e.__parse)
2885
- throw new TypeError("IntlMessageFormat.__parse must be set to process `message` of type `string`");
2886
- var o = i || {};
2887
- o.formatters;
2888
- var s = W(o, ["formatters"]);
2889
- this.ast = e.__parse(t, v(v({}, s), { locale: this.resolvedLocale }));
2890
- } else
2891
- this.ast = t;
2892
- if (!Array.isArray(this.ast))
2893
- throw new TypeError("A message must be provided as a String or AST.");
2894
- this.formats = nr(e.formats, n), this.formatters = i && i.formatters || ir(this.formatterCache);
2895
- }
2896
- return Object.defineProperty(e, "defaultLocale", {
2897
- get: function() {
2898
- return e.memoizedDefaultLocale || (e.memoizedDefaultLocale = new Intl.NumberFormat().resolvedOptions().locale), e.memoizedDefaultLocale;
2899
- },
2900
- enumerable: !1,
2901
- configurable: !0
2902
- }), e.memoizedDefaultLocale = null, e.resolveLocale = function(t) {
2903
- if (!(typeof Intl.Locale > "u")) {
2904
- var r = Intl.NumberFormat.supportedLocalesOf(t);
2905
- return r.length > 0 ? new Intl.Locale(r[0]) : new Intl.Locale(typeof t == "string" ? t : t[0]);
2906
- }
2907
- }, e.__parse = Wt, e.formats = {
2908
- number: {
2909
- integer: {
2910
- maximumFractionDigits: 0
2911
- },
2912
- currency: {
2913
- style: "currency"
2914
- },
2915
- percent: {
2916
- style: "percent"
2917
- }
2918
- },
2919
- date: {
2920
- short: {
2921
- month: "numeric",
2922
- day: "numeric",
2923
- year: "2-digit"
2924
- },
2925
- medium: {
2926
- month: "short",
2927
- day: "numeric",
2928
- year: "numeric"
2929
- },
2930
- long: {
2931
- month: "long",
2932
- day: "numeric",
2933
- year: "numeric"
2934
- },
2935
- full: {
2936
- weekday: "long",
2937
- month: "long",
2938
- day: "numeric",
2939
- year: "numeric"
2940
- }
2941
- },
2942
- time: {
2943
- short: {
2944
- hour: "numeric",
2945
- minute: "numeric"
2946
- },
2947
- medium: {
2948
- hour: "numeric",
2949
- minute: "numeric",
2950
- second: "numeric"
2951
- },
2952
- long: {
2953
- hour: "numeric",
2954
- minute: "numeric",
2955
- second: "numeric",
2956
- timeZoneName: "short"
2957
- },
2958
- full: {
2959
- hour: "numeric",
2960
- minute: "numeric",
2961
- second: "numeric",
2962
- timeZoneName: "short"
2963
- }
2964
- }
2965
- }, e;
2966
- }()
2967
- ), w;
2968
- (function(e) {
2969
- e.FORMAT_ERROR = "FORMAT_ERROR", e.UNSUPPORTED_FORMATTER = "UNSUPPORTED_FORMATTER", e.INVALID_CONFIG = "INVALID_CONFIG", e.MISSING_DATA = "MISSING_DATA", e.MISSING_TRANSLATION = "MISSING_TRANSLATION";
2970
- })(w || (w = {}));
2971
- var G = (
2972
- /** @class */
2973
- function(e) {
2974
- N(t, e);
2975
- function t(r, n, i) {
2976
- var a = this, o = i ? i instanceof Error ? i : new Error(String(i)) : void 0;
2977
- return a = e.call(this, "[@formatjs/intl Error ".concat(r, "] ").concat(n, `
2978
- `).concat(o ? `
2979
- `.concat(o.message, `
2980
- `).concat(o.stack) : "")) || this, a.code = r, typeof Error.captureStackTrace == "function" && Error.captureStackTrace(a, t), a;
2981
- }
2982
- return t;
2983
- }(Error)
2984
- ), or = (
2985
- /** @class */
2986
- function(e) {
2987
- N(t, e);
2988
- function t(r, n) {
2989
- return e.call(this, w.UNSUPPORTED_FORMATTER, r, n) || this;
2990
- }
2991
- return t;
2992
- }(G)
2993
- ), Er = (
2994
- /** @class */
2995
- function(e) {
2996
- N(t, e);
2997
- function t(r, n) {
2998
- return e.call(this, w.INVALID_CONFIG, r, n) || this;
2999
- }
3000
- return t;
3001
- }(G)
3002
- ), vr = (
3003
- /** @class */
3004
- function(e) {
3005
- N(t, e);
3006
- function t(r, n) {
3007
- return e.call(this, w.MISSING_DATA, r, n) || this;
3008
- }
3009
- return t;
3010
- }(G)
3011
- ), sr = (
3012
- /** @class */
3013
- function(e) {
3014
- N(t, e);
3015
- function t(r, n, i) {
3016
- var a = e.call(this, w.FORMAT_ERROR, "".concat(r, `
3017
- Locale: `).concat(n, `
3018
- `), i) || this;
3019
- return a.locale = n, a;
3020
- }
3021
- return t;
3022
- }(G)
3023
- ), xr = (
3024
- /** @class */
3025
- function(e) {
3026
- N(t, e);
3027
- function t(r, n, i, a) {
3028
- var o = e.call(this, "".concat(r, `
3029
- MessageID: `).concat(i == null ? void 0 : i.id, `
3030
- Default Message: `).concat(i == null ? void 0 : i.defaultMessage, `
3031
- Description: `).concat(i == null ? void 0 : i.description, `
3032
- `), n, a) || this;
3033
- return o.descriptor = i, o.locale = n, o;
3034
- }
3035
- return t;
3036
- }(sr)
3037
- ), br = (
3038
- /** @class */
3039
- function(e) {
3040
- N(t, e);
3041
- function t(r, n) {
3042
- var i = e.call(this, w.MISSING_TRANSLATION, 'Missing message: "'.concat(r.id, '" for locale "').concat(n, '", using ').concat(r.defaultMessage ? "default message (".concat(typeof r.defaultMessage == "string" ? r.defaultMessage : r.defaultMessage.map(function(a) {
3043
- var o;
3044
- return (o = a.value) !== null && o !== void 0 ? o : JSON.stringify(a);
3045
- }).join(), ")") : "id", " as fallback.")) || this;
3046
- return i.descriptor = r, i;
3047
- }
3048
- return t;
3049
- }(G)
3050
- );
3051
- function dr(e, t, r) {
3052
- return r === void 0 && (r = {}), t.reduce(function(n, i) {
3053
- return i in e ? n[i] = e[i] : i in r && (n[i] = r[i]), n;
3054
- }, {});
3055
- }
3056
- var hr = function(e) {
3057
- process.env.NODE_ENV !== "production" && console.error(e);
3058
- }, ur = function(e) {
3059
- process.env.NODE_ENV !== "production" && console.warn(e);
3060
- }, lr = {
3061
- formats: {},
3062
- messages: {},
3063
- timeZone: void 0,
3064
- defaultLocale: "en",
3065
- defaultFormats: {},
3066
- fallbackOnEmptyString: !0,
3067
- onError: hr,
3068
- onWarn: ur
3069
- };
3070
- function fr() {
3071
- return {
3072
- dateTime: {},
3073
- number: {},
3074
- message: {},
3075
- relativeTime: {},
3076
- pluralRules: {},
3077
- list: {},
3078
- displayNames: {}
3079
- };
3080
- }
3081
- function O(e) {
3082
- return {
3083
- create: function() {
3084
- return {
3085
- get: function(t) {
3086
- return e[t];
3087
- },
3088
- set: function(t, r) {
3089
- e[t] = r;
3090
- }
3091
- };
3092
- }
3093
- };
3094
- }
3095
- function yr(e) {
3096
- e === void 0 && (e = fr());
3097
- var t = Intl.RelativeTimeFormat, r = Intl.ListFormat, n = Intl.DisplayNames, i = R(function() {
3098
- for (var s, h = [], u = 0; u < arguments.length; u++)
3099
- h[u] = arguments[u];
3100
- return new ((s = Intl.DateTimeFormat).bind.apply(s, M([void 0], h, !1)))();
3101
- }, {
3102
- cache: O(e.dateTime),
3103
- strategy: C.variadic
3104
- }), a = R(function() {
3105
- for (var s, h = [], u = 0; u < arguments.length; u++)
3106
- h[u] = arguments[u];
3107
- return new ((s = Intl.NumberFormat).bind.apply(s, M([void 0], h, !1)))();
3108
- }, {
3109
- cache: O(e.number),
3110
- strategy: C.variadic
3111
- }), o = R(function() {
3112
- for (var s, h = [], u = 0; u < arguments.length; u++)
3113
- h[u] = arguments[u];
3114
- return new ((s = Intl.PluralRules).bind.apply(s, M([void 0], h, !1)))();
3115
- }, {
3116
- cache: O(e.pluralRules),
3117
- strategy: C.variadic
3118
- });
3119
- return {
3120
- getDateTimeFormat: i,
3121
- getNumberFormat: a,
3122
- getMessageFormat: R(function(s, h, u, f) {
3123
- return new ar(s, h, u, v({ formatters: {
3124
- getNumberFormat: a,
3125
- getDateTimeFormat: i,
3126
- getPluralRules: o
3127
- } }, f || {}));
3128
- }, {
3129
- cache: O(e.message),
3130
- strategy: C.variadic
3131
- }),
3132
- getRelativeTimeFormat: R(function() {
3133
- for (var s = [], h = 0; h < arguments.length; h++)
3134
- s[h] = arguments[h];
3135
- return new (t.bind.apply(t, M([void 0], s, !1)))();
3136
- }, {
3137
- cache: O(e.relativeTime),
3138
- strategy: C.variadic
3139
- }),
3140
- getPluralRules: o,
3141
- getListFormat: R(function() {
3142
- for (var s = [], h = 0; h < arguments.length; h++)
3143
- s[h] = arguments[h];
3144
- return new (r.bind.apply(r, M([void 0], s, !1)))();
3145
- }, {
3146
- cache: O(e.list),
3147
- strategy: C.variadic
3148
- }),
3149
- getDisplayNames: R(function() {
3150
- for (var s = [], h = 0; h < arguments.length; h++)
3151
- s[h] = arguments[h];
3152
- return new (n.bind.apply(n, M([void 0], s, !1)))();
3153
- }, {
3154
- cache: O(e.displayNames),
3155
- strategy: C.variadic
3156
- })
3157
- };
3158
- }
3159
- function gr(e, t, r, n) {
3160
- var i = e && e[t], a;
3161
- if (i && (a = i[r]), a)
3162
- return a;
3163
- n(new or("No ".concat(t, " format named: ").concat(r)));
3164
- }
3165
- function cr(e) {
3166
- Et(e, "[React Intl] Could not find required `intl` object. <IntlProvider> needs to exist in the component ancestry.");
3167
- }
3168
- var Tr = v(v({}, lr), { textComponent: F.Fragment });
3169
- function _r(e) {
3170
- return function(t) {
3171
- return e(F.Children.toArray(t));
3172
- };
3173
- }
3174
- function Sr(e, t) {
3175
- if (e === t)
3176
- return !0;
3177
- if (!e || !t)
3178
- return !1;
3179
- var r = Object.keys(e), n = Object.keys(t), i = r.length;
3180
- if (n.length !== i)
3181
- return !1;
3182
- for (var a = 0; a < i; a++) {
3183
- var o = r[a];
3184
- if (e[o] !== t[o] || !Object.prototype.hasOwnProperty.call(t, o))
3185
- return !1;
3186
- }
3187
- return !0;
3188
- }
3189
- var he = typeof window < "u" && !window.__REACT_INTL_BYPASS_GLOBAL_CONTEXT__ ? window.__REACT_INTL_CONTEXT__ || (window.__REACT_INTL_CONTEXT__ = F.createContext(null)) : F.createContext(null);
3190
- he.Consumer;
3191
- var mr = he.Provider, Hr = mr, pr = he;
3192
- function ue() {
3193
- var e = F.useContext(pr);
3194
- return cr(e), e;
3195
- }
3196
- var ie;
3197
- (function(e) {
3198
- e.formatDate = "FormattedDate", e.formatTime = "FormattedTime", e.formatNumber = "FormattedNumber", e.formatList = "FormattedList", e.formatDisplayName = "FormattedDisplayName";
3199
- })(ie || (ie = {}));
3200
- var ae;
3201
- (function(e) {
3202
- e.formatDate = "FormattedDateParts", e.formatTime = "FormattedTimeParts", e.formatNumber = "FormattedNumberParts", e.formatList = "FormattedListParts";
3203
- })(ae || (ae = {}));
3204
- var Ve = function(e) {
3205
- var t = ue(), r = e.value, n = e.children, i = W(e, ["value", "children"]);
3206
- return n(t.formatNumberToParts(r, i));
3207
- };
3208
- Ve.displayName = "FormattedNumberParts";
3209
- Ve.displayName = "FormattedNumberParts";
3210
- function Ar(e) {
3211
- var t = function(r) {
3212
- var n = ue(), i = r.value, a = r.children, o = W(r, ["value", "children"]), s = typeof i == "string" ? new Date(i || 0) : i, h = e === "formatDate" ? n.formatDateToParts(s, o) : n.formatTimeToParts(s, o);
3213
- return a(h);
3214
- };
3215
- return t.displayName = ae[e], t;
3216
- }
3217
- function Pr(e) {
3218
- var t = function(r) {
3219
- var n = ue(), i = r.value, a = r.children, o = W(
3220
- r,
3221
- ["value", "children"]
3222
- ), s = n[e](i, o);
3223
- if (typeof a == "function")
3224
- return a(s);
3225
- var h = n.textComponent || F.Fragment;
3226
- return F.createElement(h, null, s);
3227
- };
3228
- return t.displayName = ie[e], t;
3229
- }
3230
- export {
3231
- lr as D,
3232
- U as E,
3233
- Ve as F,
3234
- ar as I,
3235
- br as M,
3236
- Hr as P,
3237
- T,
3238
- W as _,
3239
- Ar as a,
3240
- v as b,
3241
- Pr as c,
3242
- xr as d,
3243
- sr as e,
3244
- dr as f,
3245
- gr as g,
3246
- j as h,
3247
- Et as i,
3248
- yr as j,
3249
- Er as k,
3250
- vr as l,
3251
- Tr as m,
3252
- tr as n,
3253
- _r as o,
3254
- M as p,
3255
- N as q,
3256
- cr as r,
3257
- Sr as s,
3258
- fr as t,
3259
- ue as u
3260
- };