intl-messageformat 10.1.2 → 10.1.3

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