@formatjs/intl-pluralrules 4.1.6 → 4.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
- export declare function shouldPolyfill(locale?: string | string[]): boolean;
1
+ export declare function shouldPolyfill(locale?: string): string | undefined;
2
2
  //# sourceMappingURL=should-polyfill.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"should-polyfill.d.ts","sourceRoot":"","sources":["../../../../../../packages/intl-pluralrules/should-polyfill.ts"],"names":[],"mappings":"AAQA,wBAAgB,cAAc,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,WAOxD"}
1
+ {"version":3,"file":"should-polyfill.d.ts","sourceRoot":"","sources":["../../../../../../packages/intl-pluralrules/should-polyfill.ts"],"names":[],"mappings":"AAWA,wBAAgB,cAAc,CAAC,MAAM,SAAO,sBAS3C"}
@@ -1,3 +1,5 @@
1
+ import { match } from '@formatjs/intl-localematcher';
2
+ import { supportedLocales } from './supported-locales';
1
3
  function supportedLocalesOf(locale) {
2
4
  if (!locale) {
3
5
  return true;
@@ -6,8 +8,11 @@ function supportedLocalesOf(locale) {
6
8
  return Intl.PluralRules.supportedLocalesOf(locales).length === locales.length;
7
9
  }
8
10
  export function shouldPolyfill(locale) {
9
- return (!('PluralRules' in Intl) ||
11
+ if (locale === void 0) { locale = 'en'; }
12
+ if (!('PluralRules' in Intl) ||
10
13
  new Intl.PluralRules('en', { minimumFractionDigits: 2 }).select(1) ===
11
14
  'one' ||
12
- !supportedLocalesOf(locale));
15
+ !supportedLocalesOf(locale)) {
16
+ return locale ? match([locale], supportedLocales, 'en') : undefined;
17
+ }
13
18
  }
@@ -0,0 +1,2 @@
1
+ export declare const supportedLocales: string[];
2
+ //# sourceMappingURL=supported-locales.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"supported-locales.d.ts","sourceRoot":"","sources":["../../../../../../packages/intl-pluralrules/supported-locales.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,gBAAgB,EAAE,MAAM,EAAqoC,CAAA"}
@@ -0,0 +1,2 @@
1
+ // This file is generated from supported-locales-gen.ts
2
+ export var supportedLocales = ["af", "ak", "am", "an", "ar", "ars", "as", "asa", "ast", "az", "bal", "be", "bem", "bez", "bg", "bho", "bm", "bn", "bo", "br", "brx", "bs", "ca", "ce", "ceb", "cgg", "chr", "ckb", "cs", "cy", "da", "de", "doi", "dsb", "dv", "dz", "ee", "el", "en", "eo", "es", "et", "eu", "fa", "ff", "fi", "fil", "fo", "fr", "fur", "fy", "ga", "gd", "gl", "gsw", "gu", "guw", "gv", "ha", "haw", "he", "hi", "hnj", "hr", "hsb", "hu", "hy", "ia", "id", "ig", "ii", "io", "is", "it", "iu", "ja", "jbo", "jgo", "jmc", "jv", "jw", "ka", "kab", "kaj", "kcg", "kde", "kea", "kk", "kkj", "kl", "km", "kn", "ko", "ks", "ksb", "ksh", "ku", "kw", "ky", "lag", "lb", "lg", "lij", "lkt", "ln", "lo", "lt", "lv", "mas", "mg", "mgo", "mk", "ml", "mn", "mo", "mr", "ms", "mt", "my", "nah", "naq", "nb", "nd", "ne", "nl", "nn", "nnh", "no", "nqo", "nr", "nso", "ny", "nyn", "om", "or", "os", "osa", "pa", "pap", "pcm", "pl", "prg", "ps", "pt-PT", "pt", "rm", "ro", "rof", "ru", "rwk", "sah", "saq", "sat", "sc", "scn", "sd", "sdh", "se", "seh", "ses", "sg", "sh", "shi", "si", "sk", "sl", "sma", "smi", "smj", "smn", "sms", "sn", "so", "sq", "sr", "ss", "ssy", "st", "su", "sv", "sw", "syr", "ta", "te", "teo", "th", "ti", "tig", "tk", "tl", "tn", "to", "tpi", "tr", "ts", "tzm", "ug", "uk", "und", "ur", "uz", "ve", "vi", "vo", "vun", "wa", "wae", "wo", "xh", "xog", "yi", "yo", "yue", "zh", "zu"];
File without changes
@@ -0,0 +1,7 @@
1
+ /* @generated */
2
+ // prettier-ignore
3
+ if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function') {
4
+ Intl.PluralRules.__addLocaleData({"data":{"categories":{"cardinal":["one","other"],"ordinal":["one","other"]},"fn":function(n, ord) {
5
+ return n == 1 ? 'one' : 'other';
6
+ }},"locale":"bal"})
7
+ }
package/locale-data/es.js CHANGED
@@ -1,8 +1,11 @@
1
1
  /* @generated */
2
2
  // prettier-ignore
3
3
  if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function') {
4
- Intl.PluralRules.__addLocaleData({"data":{"categories":{"cardinal":["one","other"],"ordinal":["other"]},"fn":function(n, ord) {
4
+ Intl.PluralRules.__addLocaleData({"data":{"categories":{"cardinal":["one","many","other"],"ordinal":["other"]},"fn":function(n, ord) {
5
+ var _n = String(n), se = _n.split(/[ce]/), e = se[1] || 0, c = e, s = String(e ? Number(se[0]) * Math.pow(10, e) : _n).split("."), i = s[0], v0 = !s[1], i1000000 = i.slice(-6);
5
6
  if (ord) return 'other';
6
- return n == 1 ? 'one' : 'other';
7
+ return n == 1 ? 'one'
8
+ : e == 0 && i != 0 && i1000000 == 0 && v0 || (e < 0 || e > 5) ? 'many'
9
+ : 'other';
7
10
  }},"locale":"es"})
8
11
  }
File without changes
@@ -3,5 +3,5 @@
3
3
  if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function') {
4
4
  Intl.PluralRules.__addLocaleData({"data":{"categories":{"cardinal":["other"],"ordinal":["other"]},"fn":function(n, ord) {
5
5
  return 'other';
6
- }},"locale":"in"})
6
+ }},"locale":"hnj"})
7
7
  }
package/locale-data/it.js CHANGED
@@ -1,9 +1,11 @@
1
1
  /* @generated */
2
2
  // prettier-ignore
3
3
  if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function') {
4
- Intl.PluralRules.__addLocaleData({"data":{"categories":{"cardinal":["one","other"],"ordinal":["many","other"]},"fn":function(n, ord) {
5
- var s = String(n).split('.'), v0 = !s[1];
4
+ Intl.PluralRules.__addLocaleData({"data":{"categories":{"cardinal":["one","many","other"],"ordinal":["many","other"]},"fn":function(n, ord) {
5
+ var _n = String(n), se = _n.split(/[ce]/), e = se[1] || 0, c = e, s = String(e ? Number(se[0]) * Math.pow(10, e) : _n).split("."), i = s[0], v0 = !s[1], i1000000 = i.slice(-6);
6
6
  if (ord) return (n == 11 || n == 8 || n == 80 || n == 800) ? 'many' : 'other';
7
- return n == 1 && v0 ? 'one' : 'other';
7
+ return n == 1 && v0 ? 'one'
8
+ : e == 0 && i != 0 && i1000000 == 0 && v0 || (e < 0 || e > 5) ? 'many'
9
+ : 'other';
8
10
  }},"locale":"it"})
9
11
  }
@@ -1,9 +1,11 @@
1
1
  /* @generated */
2
2
  // prettier-ignore
3
3
  if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function') {
4
- Intl.PluralRules.__addLocaleData({"data":{"categories":{"cardinal":["one","other"],"ordinal":["other"]},"fn":function(n, ord) {
5
- var s = String(n).split('.'), v0 = !s[1];
4
+ Intl.PluralRules.__addLocaleData({"data":{"categories":{"cardinal":["one","many","other"],"ordinal":["other"]},"fn":function(n, ord) {
5
+ var _n = String(n), se = _n.split(/[ce]/), e = se[1] || 0, c = e, s = String(e ? Number(se[0]) * Math.pow(10, e) : _n).split("."), i = s[0], v0 = !s[1], i1000000 = i.slice(-6);
6
6
  if (ord) return 'other';
7
- return n == 1 && v0 ? 'one' : 'other';
7
+ return n == 1 && v0 ? 'one'
8
+ : e == 0 && i != 0 && i1000000 == 0 && v0 || (e < 0 || e > 5) ? 'many'
9
+ : 'other';
8
10
  }},"locale":"pt-PT"})
9
11
  }
package/locale-data/pt.js CHANGED
@@ -1,9 +1,11 @@
1
1
  /* @generated */
2
2
  // prettier-ignore
3
3
  if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function') {
4
- Intl.PluralRules.__addLocaleData({"data":{"categories":{"cardinal":["one","other"],"ordinal":["other"]},"fn":function(n, ord) {
5
- var s = String(n).split('.'), i = s[0];
4
+ Intl.PluralRules.__addLocaleData({"data":{"categories":{"cardinal":["one","many","other"],"ordinal":["other"]},"fn":function(n, ord) {
5
+ var _n = String(n), se = _n.split(/[ce]/), e = se[1] || 0, c = e, s = String(e ? Number(se[0]) * Math.pow(10, e) : _n).split("."), i = s[0], v0 = !s[1], i1000000 = i.slice(-6);
6
6
  if (ord) return 'other';
7
- return (i == 0 || i == 1) ? 'one' : 'other';
7
+ return (i == 0 || i == 1) ? 'one'
8
+ : e == 0 && i != 0 && i1000000 == 0 && v0 || (e < 0 || e > 5) ? 'many'
9
+ : 'other';
8
10
  }},"locale":"pt"})
9
11
  }
File without changes
@@ -0,0 +1,7 @@
1
+ /* @generated */
2
+ // prettier-ignore
3
+ if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function') {
4
+ Intl.PluralRules.__addLocaleData({"data":{"categories":{"cardinal":["other"],"ordinal":["other"]},"fn":function(n, ord) {
5
+ return 'other';
6
+ }},"locale":"tpi"})
7
+ }
@@ -0,0 +1 @@
1
+ export {}
@@ -0,0 +1,7 @@
1
+ /* @generated */
2
+ // prettier-ignore
3
+ if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function') {
4
+ Intl.PluralRules.__addLocaleData({"data":{"categories":{"cardinal":["other"],"ordinal":["other"]},"fn":function(n, ord) {
5
+ return 'other';
6
+ }},"locale":"und"})
7
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@formatjs/intl-pluralrules",
3
- "version": "4.1.6",
3
+ "version": "4.3.1",
4
4
  "description": "Polyfill for Intl.PluralRules",
5
5
  "keywords": [
6
6
  "polyfill",
@@ -20,8 +20,8 @@
20
20
  "url": "git+https://github.com/formatjs/formatjs.git"
21
21
  },
22
22
  "dependencies": {
23
- "@formatjs/ecma402-abstract": "1.11.0",
24
- "@formatjs/intl-localematcher": "0.2.21",
23
+ "@formatjs/ecma402-abstract": "1.11.2",
24
+ "@formatjs/intl-localematcher": "0.2.23",
25
25
  "tslib": "^2.1.0"
26
26
  },
27
27
  "bugs": {
package/polyfill.iife.js CHANGED
@@ -10,26 +10,39 @@
10
10
  };
11
11
  var __commonJS = function(cb, mod) {
12
12
  return function __require() {
13
- return mod || (0, cb[Object.keys(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
13
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
14
14
  };
15
15
  };
16
- var __reExport = function(target, module, desc) {
16
+ var __reExport = function(target, module, copyDefault, desc) {
17
17
  if (module && typeof module === "object" || typeof module === "function")
18
18
  for (var keys = __getOwnPropNames(module), i = 0, n = keys.length, key; i < n; i++) {
19
19
  key = keys[i];
20
- if (!__hasOwnProp.call(target, key) && key !== "default")
20
+ if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
21
21
  __defProp(target, key, { get: function(k) {
22
22
  return module[k];
23
23
  }.bind(null, key), enumerable: !(desc = __getOwnPropDesc(module, key)) || desc.enumerable });
24
24
  }
25
25
  return target;
26
26
  };
27
- var __toModule = function(module) {
28
- return __reExport(__markAsModule(__defProp(module != null ? __create(__getProtoOf(module)) : {}, "default", module && module.__esModule && "default" in module ? { get: function() {
27
+ var __toESM = function(module, isNodeMode) {
28
+ return __reExport(__markAsModule(__defProp(module != null ? __create(__getProtoOf(module)) : {}, "default", !isNodeMode && module && module.__esModule ? { get: function() {
29
29
  return module.default;
30
30
  }, enumerable: true } : { value: module, enumerable: true })), module);
31
31
  };
32
32
 
33
+ // bazel-out/darwin-fastbuild/bin/packages/intl-localematcher/abstract/CanonicalizeLocaleList.js
34
+ var require_CanonicalizeLocaleList = __commonJS({
35
+ "bazel-out/darwin-fastbuild/bin/packages/intl-localematcher/abstract/CanonicalizeLocaleList.js": function(exports) {
36
+ "use strict";
37
+ Object.defineProperty(exports, "__esModule", { value: true });
38
+ exports.CanonicalizeLocaleList = void 0;
39
+ function CanonicalizeLocaleList2(locales) {
40
+ return Intl.getCanonicalLocales(locales);
41
+ }
42
+ exports.CanonicalizeLocaleList = CanonicalizeLocaleList2;
43
+ }
44
+ });
45
+
33
46
  // bazel-out/darwin-fastbuild/bin/packages/intl-localematcher/abstract/utils.js
34
47
  var require_utils = __commonJS({
35
48
  "bazel-out/darwin-fastbuild/bin/packages/intl-localematcher/abstract/utils.js": function(exports) {
@@ -113,15 +126,17 @@
113
126
  var BestAvailableLocale_1 = require_BestAvailableLocale();
114
127
  var utils_1 = require_utils();
115
128
  function BestFitMatcher(availableLocales, requestedLocales, getDefaultLocale) {
116
- var minimizedAvailableLocaleMap = Array.from(availableLocales).reduce(function(all, l2) {
117
- all[l2] = l2;
118
- return all;
119
- }, {});
120
- var minimizedAvailableLocales = new Set();
129
+ var minimizedAvailableLocaleMap = {};
130
+ var minimizedAvailableLocales = /* @__PURE__ */ new Set();
121
131
  availableLocales.forEach(function(locale2) {
122
132
  var minimizedLocale = new Intl.Locale(locale2).minimize().toString();
133
+ var canonicalizedLocale = Intl.getCanonicalLocales(locale2)[0] || locale2;
123
134
  minimizedAvailableLocaleMap[minimizedLocale] = locale2;
135
+ minimizedAvailableLocaleMap[locale2] = locale2;
136
+ minimizedAvailableLocaleMap[canonicalizedLocale] = locale2;
124
137
  minimizedAvailableLocales.add(minimizedLocale);
138
+ minimizedAvailableLocales.add(locale2);
139
+ minimizedAvailableLocales.add(canonicalizedLocale);
125
140
  });
126
141
  var foundLocale;
127
142
  for (var _i = 0, requestedLocales_1 = requestedLocales; _i < requestedLocales_1.length; _i++) {
@@ -147,8 +162,11 @@
147
162
  }
148
163
  foundLocale = (0, BestAvailableLocale_1.BestAvailableLocale)(minimizedAvailableLocales, maximizedRequestedLocale);
149
164
  }
165
+ if (!foundLocale) {
166
+ return { locale: getDefaultLocale() };
167
+ }
150
168
  return {
151
- locale: foundLocale && minimizedAvailableLocaleMap[foundLocale] || getDefaultLocale()
169
+ locale: minimizedAvailableLocaleMap[foundLocale] || foundLocale
152
170
  };
153
171
  }
154
172
  exports.BestFitMatcher = BestFitMatcher;
@@ -213,7 +231,7 @@
213
231
  var BestFitMatcher_1 = require_BestFitMatcher();
214
232
  var utils_1 = require_utils();
215
233
  var UnicodeExtensionValue_1 = require_UnicodeExtensionValue();
216
- function ResolveLocale3(availableLocales, requestedLocales, options, relevantExtensionKeys, localeData, getDefaultLocale) {
234
+ function ResolveLocale2(availableLocales, requestedLocales, options, relevantExtensionKeys, localeData, getDefaultLocale) {
217
235
  var matcher = options.localeMatcher;
218
236
  var r;
219
237
  if (matcher === "lookup") {
@@ -275,7 +293,7 @@
275
293
  result.locale = foundLocale;
276
294
  return result;
277
295
  }
278
- exports.ResolveLocale = ResolveLocale3;
296
+ exports.ResolveLocale = ResolveLocale2;
279
297
  }
280
298
  });
281
299
 
@@ -309,19 +327,20 @@
309
327
  "use strict";
310
328
  Object.defineProperty(exports, "__esModule", { value: true });
311
329
  exports.ResolveLocale = exports.LookupSupportedLocales = exports.match = void 0;
330
+ var CanonicalizeLocaleList_1 = require_CanonicalizeLocaleList();
312
331
  var ResolveLocale_1 = require_ResolveLocale();
313
- function match(requestedLocales, availableLocales, defaultLocale, opts) {
332
+ function match2(requestedLocales, availableLocales, defaultLocale, opts) {
314
333
  var locales = availableLocales.reduce(function(all, l) {
315
334
  all.add(l);
316
335
  return all;
317
- }, new Set());
318
- return (0, ResolveLocale_1.ResolveLocale)(locales, requestedLocales, {
336
+ }, /* @__PURE__ */ new Set());
337
+ return (0, ResolveLocale_1.ResolveLocale)(locales, (0, CanonicalizeLocaleList_1.CanonicalizeLocaleList)(requestedLocales), {
319
338
  localeMatcher: (opts === null || opts === void 0 ? void 0 : opts.algorithm) || "best fit"
320
339
  }, [], {}, function() {
321
340
  return defaultLocale;
322
341
  }).locale;
323
342
  }
324
- exports.match = match;
343
+ exports.match = match2;
325
344
  var LookupSupportedLocales_1 = require_LookupSupportedLocales();
326
345
  Object.defineProperty(exports, "LookupSupportedLocales", { enumerable: true, get: function() {
327
346
  return LookupSupportedLocales_1.LookupSupportedLocales;
@@ -334,25 +353,6 @@
334
353
  });
335
354
 
336
355
  // node_modules/tslib/tslib.es6.js
337
- var extendStatics = function(d, b) {
338
- extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
339
- d2.__proto__ = b2;
340
- } || function(d2, b2) {
341
- for (var p in b2)
342
- if (Object.prototype.hasOwnProperty.call(b2, p))
343
- d2[p] = b2[p];
344
- };
345
- return extendStatics(d, b);
346
- };
347
- function __extends(d, b) {
348
- if (typeof b !== "function" && b !== null)
349
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
350
- extendStatics(d, b);
351
- function __() {
352
- this.constructor = d;
353
- }
354
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
355
- }
356
356
  function __spreadArray(to, from, pack) {
357
357
  if (pack || arguments.length === 2)
358
358
  for (var i = 0, l = from.length, ar; i < l; i++) {
@@ -362,7 +362,7 @@
362
362
  ar[i] = from[i];
363
363
  }
364
364
  }
365
- return to.concat(ar || from);
365
+ return to.concat(ar || Array.prototype.slice.call(from));
366
366
  }
367
367
 
368
368
  // bazel-out/darwin-fastbuild/bin/packages/ecma402-abstract/lib/CanonicalizeLocaleList.js
@@ -445,7 +445,7 @@
445
445
  // bazel-out/darwin-fastbuild/bin/packages/ecma402-abstract/lib/CoerceOptionsToObject.js
446
446
  function CoerceOptionsToObject(options) {
447
447
  if (typeof options === "undefined") {
448
- return Object.create(null);
448
+ return /* @__PURE__ */ Object.create(null);
449
449
  }
450
450
  return ToObject(options);
451
451
  }
@@ -494,57 +494,6 @@
494
494
  return fallback;
495
495
  }
496
496
 
497
- // bazel-out/darwin-fastbuild/bin/packages/ecma402-abstract/lib/IsSanctionedSimpleUnitIdentifier.js
498
- var SANCTIONED_UNITS = [
499
- "angle-degree",
500
- "area-acre",
501
- "area-hectare",
502
- "concentr-percent",
503
- "digital-bit",
504
- "digital-byte",
505
- "digital-gigabit",
506
- "digital-gigabyte",
507
- "digital-kilobit",
508
- "digital-kilobyte",
509
- "digital-megabit",
510
- "digital-megabyte",
511
- "digital-petabyte",
512
- "digital-terabit",
513
- "digital-terabyte",
514
- "duration-day",
515
- "duration-hour",
516
- "duration-millisecond",
517
- "duration-minute",
518
- "duration-month",
519
- "duration-second",
520
- "duration-week",
521
- "duration-year",
522
- "length-centimeter",
523
- "length-foot",
524
- "length-inch",
525
- "length-kilometer",
526
- "length-meter",
527
- "length-mile-scandinavian",
528
- "length-mile",
529
- "length-millimeter",
530
- "length-yard",
531
- "mass-gram",
532
- "mass-kilogram",
533
- "mass-ounce",
534
- "mass-pound",
535
- "mass-stone",
536
- "temperature-celsius",
537
- "temperature-fahrenheit",
538
- "volume-fluid-ounce",
539
- "volume-gallon",
540
- "volume-liter",
541
- "volume-milliliter"
542
- ];
543
- function removeUnitNamespace(unit) {
544
- return unit.slice(unit.indexOf("-") + 1);
545
- }
546
- var SIMPLE_UNITS = SANCTIONED_UNITS.map(removeUnitNamespace);
547
-
548
497
  // bazel-out/darwin-fastbuild/bin/packages/ecma402-abstract/lib/utils.js
549
498
  function getMagnitude(x) {
550
499
  return Math.floor(Math.log(x) * Math.LOG10E);
@@ -702,16 +651,6 @@
702
651
  return { roundedNumber: x, formattedString: string };
703
652
  }
704
653
 
705
- // bazel-out/darwin-fastbuild/bin/packages/ecma402-abstract/lib/regex.generated.js
706
- var S_UNICODE_REGEX = /[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20BF\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBC1\uFDFC\uFDFD\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDE8\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED7\uDEE0-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF73\uDF80-\uDFD8\uDFE0-\uDFEB]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDD78\uDD7A-\uDDCB\uDDCD-\uDE53\uDE60-\uDE6D\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6\uDF00-\uDF92\uDF94-\uDFCA]/;
707
-
708
- // bazel-out/darwin-fastbuild/bin/packages/ecma402-abstract/lib/NumberFormat/format_to_parts.js
709
- var CARET_S_UNICODE_REGEX = new RegExp("^".concat(S_UNICODE_REGEX.source));
710
- var S_DOLLAR_UNICODE_REGEX = new RegExp("".concat(S_UNICODE_REGEX.source, "$"));
711
-
712
- // bazel-out/darwin-fastbuild/bin/packages/ecma402-abstract/lib/NumberFormat/InitializeNumberFormat.js
713
- var import_intl_localematcher = __toModule(require_intl_localematcher());
714
-
715
654
  // bazel-out/darwin-fastbuild/bin/packages/ecma402-abstract/lib/NumberFormat/SetNumberFormatDigitOptions.js
716
655
  function SetNumberFormatDigitOptions(internalSlots, opts, mnfdDefault, mxfdDefault, notation) {
717
656
  var mnid = GetNumberOption(opts, "minimumIntegerDigits", 1, 21, 1);
@@ -743,7 +682,7 @@
743
682
  }
744
683
 
745
684
  // bazel-out/darwin-fastbuild/bin/packages/ecma402-abstract/lib/SupportedLocales.js
746
- var import_intl_localematcher2 = __toModule(require_intl_localematcher());
685
+ var import_intl_localematcher = __toESM(require_intl_localematcher());
747
686
  function SupportedLocales(availableLocales, requestedLocales, options) {
748
687
  var matcher = "best fit";
749
688
  if (options !== void 0) {
@@ -751,36 +690,17 @@
751
690
  matcher = GetOption(options, "localeMatcher", "string", ["lookup", "best fit"], "best fit");
752
691
  }
753
692
  if (matcher === "best fit") {
754
- return (0, import_intl_localematcher2.LookupSupportedLocales)(availableLocales, requestedLocales);
693
+ return (0, import_intl_localematcher.LookupSupportedLocales)(availableLocales, requestedLocales);
755
694
  }
756
- return (0, import_intl_localematcher2.LookupSupportedLocales)(availableLocales, requestedLocales);
695
+ return (0, import_intl_localematcher.LookupSupportedLocales)(availableLocales, requestedLocales);
757
696
  }
758
697
 
759
- // bazel-out/darwin-fastbuild/bin/packages/ecma402-abstract/lib/data.js
760
- var MissingLocaleDataError = function(_super) {
761
- __extends(MissingLocaleDataError2, _super);
762
- function MissingLocaleDataError2() {
763
- var _this = _super !== null && _super.apply(this, arguments) || this;
764
- _this.type = "MISSING_LOCALE_DATA";
765
- return _this;
766
- }
767
- return MissingLocaleDataError2;
768
- }(Error);
769
-
770
- // bazel-out/darwin-fastbuild/bin/packages/ecma402-abstract/lib/types/date-time.js
771
- var RangePatternType;
772
- (function(RangePatternType2) {
773
- RangePatternType2["startRange"] = "startRange";
774
- RangePatternType2["shared"] = "shared";
775
- RangePatternType2["endRange"] = "endRange";
776
- })(RangePatternType || (RangePatternType = {}));
777
-
778
698
  // bazel-out/darwin-fastbuild/bin/packages/intl-pluralrules/lib/abstract/InitializePluralRules.js
779
- var import_intl_localematcher3 = __toModule(require_intl_localematcher());
699
+ var import_intl_localematcher2 = __toESM(require_intl_localematcher());
780
700
  function InitializePluralRules(pl, locales, options, _a) {
781
701
  var availableLocales = _a.availableLocales, relevantExtensionKeys = _a.relevantExtensionKeys, localeData = _a.localeData, getDefaultLocale = _a.getDefaultLocale, getInternalSlots2 = _a.getInternalSlots;
782
702
  var requestedLocales = CanonicalizeLocaleList(locales);
783
- var opt = Object.create(null);
703
+ var opt = /* @__PURE__ */ Object.create(null);
784
704
  var opts = CoerceOptionsToObject(options);
785
705
  var internalSlots = getInternalSlots2(pl);
786
706
  internalSlots.initializedPluralRules = true;
@@ -788,7 +708,7 @@
788
708
  opt.localeMatcher = matcher;
789
709
  internalSlots.type = GetOption(opts, "type", "string", ["cardinal", "ordinal"], "cardinal");
790
710
  SetNumberFormatDigitOptions(internalSlots, opts, 0, 3, "standard");
791
- var r = (0, import_intl_localematcher3.ResolveLocale)(availableLocales, requestedLocales, opt, relevantExtensionKeys, localeData, getDefaultLocale);
711
+ var r = (0, import_intl_localematcher2.ResolveLocale)(availableLocales, requestedLocales, opt, relevantExtensionKeys, localeData, getDefaultLocale);
792
712
  internalSlots.locale = r.locale;
793
713
  return pl;
794
714
  }
@@ -852,11 +772,11 @@
852
772
  }
853
773
 
854
774
  // bazel-out/darwin-fastbuild/bin/packages/intl-pluralrules/lib/get_internal_slots.js
855
- var internalSlotMap = new WeakMap();
775
+ var internalSlotMap = /* @__PURE__ */ new WeakMap();
856
776
  function getInternalSlots(x) {
857
777
  var internalSlots = internalSlotMap.get(x);
858
778
  if (!internalSlots) {
859
- internalSlots = Object.create(null);
779
+ internalSlots = /* @__PURE__ */ Object.create(null);
860
780
  internalSlotMap.set(x, internalSlots);
861
781
  }
862
782
  return internalSlots;
@@ -888,7 +808,7 @@
888
808
  }
889
809
  PluralRules2.prototype.resolvedOptions = function() {
890
810
  validateInstance(this, "resolvedOptions");
891
- var opts = Object.create(null);
811
+ var opts = /* @__PURE__ */ Object.create(null);
892
812
  var internalSlots = getInternalSlots(this);
893
813
  opts.locale = internalSlots.locale;
894
814
  opts.type = internalSlots.type;
@@ -937,7 +857,7 @@
937
857
  return PluralRules2.__defaultLocale;
938
858
  };
939
859
  PluralRules2.localeData = {};
940
- PluralRules2.availableLocales = new Set();
860
+ PluralRules2.availableLocales = /* @__PURE__ */ new Set();
941
861
  PluralRules2.__defaultLocale = "";
942
862
  PluralRules2.relevantExtensionKeys = [];
943
863
  PluralRules2.polyfilled = true;
@@ -976,6 +896,12 @@
976
896
  } catch (ex) {
977
897
  }
978
898
 
899
+ // bazel-out/darwin-fastbuild/bin/packages/intl-pluralrules/lib/should-polyfill.js
900
+ var import_intl_localematcher3 = __toESM(require_intl_localematcher());
901
+
902
+ // bazel-out/darwin-fastbuild/bin/packages/intl-pluralrules/lib/supported-locales.js
903
+ var supportedLocales = ["af", "ak", "am", "an", "ar", "ars", "as", "asa", "ast", "az", "bal", "be", "bem", "bez", "bg", "bho", "bm", "bn", "bo", "br", "brx", "bs", "ca", "ce", "ceb", "cgg", "chr", "ckb", "cs", "cy", "da", "de", "doi", "dsb", "dv", "dz", "ee", "el", "en", "eo", "es", "et", "eu", "fa", "ff", "fi", "fil", "fo", "fr", "fur", "fy", "ga", "gd", "gl", "gsw", "gu", "guw", "gv", "ha", "haw", "he", "hi", "hnj", "hr", "hsb", "hu", "hy", "ia", "id", "ig", "ii", "io", "is", "it", "iu", "ja", "jbo", "jgo", "jmc", "jv", "jw", "ka", "kab", "kaj", "kcg", "kde", "kea", "kk", "kkj", "kl", "km", "kn", "ko", "ks", "ksb", "ksh", "ku", "kw", "ky", "lag", "lb", "lg", "lij", "lkt", "ln", "lo", "lt", "lv", "mas", "mg", "mgo", "mk", "ml", "mn", "mo", "mr", "ms", "mt", "my", "nah", "naq", "nb", "nd", "ne", "nl", "nn", "nnh", "no", "nqo", "nr", "nso", "ny", "nyn", "om", "or", "os", "osa", "pa", "pap", "pcm", "pl", "prg", "ps", "pt-PT", "pt", "rm", "ro", "rof", "ru", "rwk", "sah", "saq", "sat", "sc", "scn", "sd", "sdh", "se", "seh", "ses", "sg", "sh", "shi", "si", "sk", "sl", "sma", "smi", "smj", "smn", "sms", "sn", "so", "sq", "sr", "ss", "ssy", "st", "su", "sv", "sw", "syr", "ta", "te", "teo", "th", "ti", "tig", "tk", "tl", "tn", "to", "tpi", "tr", "ts", "tzm", "ug", "uk", "und", "ur", "uz", "ve", "vi", "vo", "vun", "wa", "wae", "wo", "xh", "xog", "yi", "yo", "yue", "zh", "zu"];
904
+
979
905
  // bazel-out/darwin-fastbuild/bin/packages/intl-pluralrules/lib/should-polyfill.js
980
906
  function supportedLocalesOf(locale) {
981
907
  if (!locale) {
@@ -985,7 +911,12 @@
985
911
  return Intl.PluralRules.supportedLocalesOf(locales).length === locales.length;
986
912
  }
987
913
  function shouldPolyfill(locale) {
988
- return !("PluralRules" in Intl) || new Intl.PluralRules("en", { minimumFractionDigits: 2 }).select(1) === "one" || !supportedLocalesOf(locale);
914
+ if (locale === void 0) {
915
+ locale = "en";
916
+ }
917
+ if (!("PluralRules" in Intl) || new Intl.PluralRules("en", { minimumFractionDigits: 2 }).select(1) === "one" || !supportedLocalesOf(locale)) {
918
+ return locale ? (0, import_intl_localematcher3.match)([locale], supportedLocales, "en") : void 0;
919
+ }
989
920
  }
990
921
 
991
922
  // bazel-out/darwin-fastbuild/bin/packages/intl-pluralrules/lib/polyfill.js
@@ -1,2 +1,2 @@
1
- export declare function shouldPolyfill(locale?: string | string[]): boolean;
1
+ export declare function shouldPolyfill(locale?: string): string | undefined;
2
2
  //# sourceMappingURL=should-polyfill.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"should-polyfill.d.ts","sourceRoot":"","sources":["../../../../../packages/intl-pluralrules/should-polyfill.ts"],"names":[],"mappings":"AAQA,wBAAgB,cAAc,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,WAOxD"}
1
+ {"version":3,"file":"should-polyfill.d.ts","sourceRoot":"","sources":["../../../../../packages/intl-pluralrules/should-polyfill.ts"],"names":[],"mappings":"AAWA,wBAAgB,cAAc,CAAC,MAAM,SAAO,sBAS3C"}
@@ -1,6 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.shouldPolyfill = void 0;
4
+ var intl_localematcher_1 = require("@formatjs/intl-localematcher");
5
+ var supported_locales_1 = require("./supported-locales");
4
6
  function supportedLocalesOf(locale) {
5
7
  if (!locale) {
6
8
  return true;
@@ -9,9 +11,12 @@ function supportedLocalesOf(locale) {
9
11
  return Intl.PluralRules.supportedLocalesOf(locales).length === locales.length;
10
12
  }
11
13
  function shouldPolyfill(locale) {
12
- return (!('PluralRules' in Intl) ||
14
+ if (locale === void 0) { locale = 'en'; }
15
+ if (!('PluralRules' in Intl) ||
13
16
  new Intl.PluralRules('en', { minimumFractionDigits: 2 }).select(1) ===
14
17
  'one' ||
15
- !supportedLocalesOf(locale));
18
+ !supportedLocalesOf(locale)) {
19
+ return locale ? (0, intl_localematcher_1.match)([locale], supported_locales_1.supportedLocales, 'en') : undefined;
20
+ }
16
21
  }
17
22
  exports.shouldPolyfill = shouldPolyfill;
@@ -0,0 +1,2 @@
1
+ export declare const supportedLocales: string[];
2
+ //# sourceMappingURL=supported-locales.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"supported-locales.d.ts","sourceRoot":"","sources":["../../../../../packages/intl-pluralrules/supported-locales.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,gBAAgB,EAAE,MAAM,EAAqoC,CAAA"}
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.supportedLocales = void 0;
4
+ // This file is generated from supported-locales-gen.ts
5
+ exports.supportedLocales = ["af", "ak", "am", "an", "ar", "ars", "as", "asa", "ast", "az", "bal", "be", "bem", "bez", "bg", "bho", "bm", "bn", "bo", "br", "brx", "bs", "ca", "ce", "ceb", "cgg", "chr", "ckb", "cs", "cy", "da", "de", "doi", "dsb", "dv", "dz", "ee", "el", "en", "eo", "es", "et", "eu", "fa", "ff", "fi", "fil", "fo", "fr", "fur", "fy", "ga", "gd", "gl", "gsw", "gu", "guw", "gv", "ha", "haw", "he", "hi", "hnj", "hr", "hsb", "hu", "hy", "ia", "id", "ig", "ii", "io", "is", "it", "iu", "ja", "jbo", "jgo", "jmc", "jv", "jw", "ka", "kab", "kaj", "kcg", "kde", "kea", "kk", "kkj", "kl", "km", "kn", "ko", "ks", "ksb", "ksh", "ku", "kw", "ky", "lag", "lb", "lg", "lij", "lkt", "ln", "lo", "lt", "lv", "mas", "mg", "mgo", "mk", "ml", "mn", "mo", "mr", "ms", "mt", "my", "nah", "naq", "nb", "nd", "ne", "nl", "nn", "nnh", "no", "nqo", "nr", "nso", "ny", "nyn", "om", "or", "os", "osa", "pa", "pap", "pcm", "pl", "prg", "ps", "pt-PT", "pt", "rm", "ro", "rof", "ru", "rwk", "sah", "saq", "sat", "sc", "scn", "sd", "sdh", "se", "seh", "ses", "sg", "sh", "shi", "si", "sk", "sl", "sma", "smi", "smj", "smn", "sms", "sn", "so", "sq", "sr", "ss", "ssy", "st", "su", "sv", "sw", "syr", "ta", "te", "teo", "th", "ti", "tig", "tk", "tl", "tn", "to", "tpi", "tr", "ts", "tzm", "ug", "uk", "und", "ur", "uz", "ve", "vi", "vo", "vun", "wa", "wae", "wo", "xh", "xog", "yi", "yo", "yue", "zh", "zu"];
package/locale-data/iw.js DELETED
@@ -1,12 +0,0 @@
1
- /* @generated */
2
- // prettier-ignore
3
- if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function') {
4
- Intl.PluralRules.__addLocaleData({"data":{"categories":{"cardinal":["one","two","many","other"],"ordinal":["other"]},"fn":function(n, ord) {
5
- var s = String(n).split('.'), i = s[0], v0 = !s[1], t0 = Number(s[0]) == n, n10 = t0 && s[0].slice(-1);
6
- if (ord) return 'other';
7
- return n == 1 && v0 ? 'one'
8
- : i == 2 && v0 ? 'two'
9
- : v0 && (n < 0 || n > 10) && t0 && n10 == 0 ? 'many'
10
- : 'other';
11
- }},"locale":"iw"})
12
- }
package/locale-data/ji.js DELETED
@@ -1,9 +0,0 @@
1
- /* @generated */
2
- // prettier-ignore
3
- if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function') {
4
- Intl.PluralRules.__addLocaleData({"data":{"categories":{"cardinal":["one","other"],"ordinal":["other"]},"fn":function(n, ord) {
5
- var s = String(n).split('.'), v0 = !s[1];
6
- if (ord) return 'other';
7
- return n == 1 && v0 ? 'one' : 'other';
8
- }},"locale":"ji"})
9
- }