@formatjs/intl-relativetimeformat 9.3.2 → 9.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. package/abstract/FormatRelativeTime.js +1 -1
  2. package/abstract/FormatRelativeTimeToParts.js +2 -2
  3. package/abstract/InitializeRelativeTimeFormat.js +9 -9
  4. package/abstract/MakePartsList.js +2 -2
  5. package/abstract/PartitionRelativeTimePattern.js +10 -10
  6. package/abstract/SingularRelativeTimeUnit.js +1 -1
  7. package/index.js +8 -8
  8. package/lib/abstract/InitializeRelativeTimeFormat.js +2 -2
  9. package/lib/abstract/MakePartsList.js +1 -1
  10. package/lib/abstract/PartitionRelativeTimePattern.js +5 -5
  11. package/lib/should-polyfill.d.ts +1 -1
  12. package/lib/should-polyfill.d.ts.map +1 -1
  13. package/lib/should-polyfill.js +7 -2
  14. package/lib/supported-locales.d.ts +2 -0
  15. package/lib/supported-locales.d.ts.map +1 -0
  16. package/lib/supported-locales.js +2 -0
  17. package/locale-data/ar-AE.js +1 -1
  18. package/locale-data/{ca-ES-VALENCIA.d.ts → be-tarask.d.ts} +0 -0
  19. package/locale-data/be-tarask.js +6 -0
  20. package/locale-data/bs-Latn.js +1 -1
  21. package/locale-data/bs.js +1 -1
  22. package/locale-data/{en-US-POSIX.d.ts → ca-ES-valencia.d.ts} +0 -0
  23. package/locale-data/{ca-ES-VALENCIA.js → ca-ES-valencia.js} +1 -1
  24. package/locale-data/doi.js +1 -1
  25. package/locale-data/dsb.js +1 -1
  26. package/locale-data/el-CY.js +1 -1
  27. package/locale-data/el.js +1 -1
  28. package/locale-data/en-CA.js +1 -1
  29. package/locale-data/en-PH.js +1 -1
  30. package/locale-data/es-EA.js +1 -1
  31. package/locale-data/es-GQ.js +1 -1
  32. package/locale-data/es-IC.js +1 -1
  33. package/locale-data/es-PH.js +1 -1
  34. package/locale-data/es-US.js +1 -1
  35. package/locale-data/es.js +1 -1
  36. package/locale-data/eu.js +1 -1
  37. package/locale-data/ff-Adlm-BF.js +1 -1
  38. package/locale-data/ff-Adlm-CM.js +1 -1
  39. package/locale-data/ff-Adlm-GH.js +1 -1
  40. package/locale-data/ff-Adlm-GM.js +1 -1
  41. package/locale-data/ff-Adlm-GW.js +1 -1
  42. package/locale-data/ff-Adlm-LR.js +1 -1
  43. package/locale-data/ff-Adlm-MR.js +1 -1
  44. package/locale-data/ff-Adlm-NE.js +1 -1
  45. package/locale-data/ff-Adlm-NG.js +1 -1
  46. package/locale-data/ff-Adlm-SL.js +1 -1
  47. package/locale-data/ff-Adlm-SN.js +1 -1
  48. package/locale-data/ff-Adlm.js +1 -1
  49. package/locale-data/fil.js +1 -1
  50. package/locale-data/he.js +1 -1
  51. package/locale-data/hsb.js +1 -1
  52. package/locale-data/ia.js +1 -1
  53. package/locale-data/id.js +1 -1
  54. package/locale-data/is.js +1 -1
  55. package/locale-data/jv.js +1 -1
  56. package/locale-data/kgp.d.ts +1 -0
  57. package/locale-data/kgp.js +6 -0
  58. package/locale-data/mai.js +1 -1
  59. package/locale-data/mni-Beng.js +1 -1
  60. package/locale-data/mni.js +1 -1
  61. package/locale-data/nb-SJ.js +1 -1
  62. package/locale-data/nb.js +1 -1
  63. package/locale-data/nn.js +1 -1
  64. package/locale-data/no.js +1 -1
  65. package/locale-data/sc.d.ts +1 -0
  66. package/locale-data/sc.js +6 -0
  67. package/locale-data/sr-Cyrl-BA.js +1 -1
  68. package/locale-data/sr-Cyrl-ME.js +1 -1
  69. package/locale-data/sr-Cyrl-XK.js +1 -1
  70. package/locale-data/sr-Cyrl.js +1 -1
  71. package/locale-data/sr-Latn-BA.js +1 -1
  72. package/locale-data/sr-Latn-ME.js +1 -1
  73. package/locale-data/sr-Latn-XK.js +1 -1
  74. package/locale-data/sr-Latn.js +1 -1
  75. package/locale-data/sr.js +1 -1
  76. package/locale-data/ti-ER.js +1 -1
  77. package/locale-data/ti.js +1 -1
  78. package/locale-data/und.d.ts +1 -0
  79. package/locale-data/und.js +6 -0
  80. package/locale-data/yrl-CO.d.ts +1 -0
  81. package/locale-data/yrl-CO.js +6 -0
  82. package/locale-data/yrl-VE.d.ts +1 -0
  83. package/locale-data/yrl-VE.js +6 -0
  84. package/locale-data/yrl.d.ts +1 -0
  85. package/locale-data/yrl.js +6 -0
  86. package/package.json +3 -3
  87. package/polyfill-force.js +1 -1
  88. package/polyfill.iife.js +62 -169
  89. package/polyfill.js +2 -2
  90. package/should-polyfill.d.ts +1 -1
  91. package/should-polyfill.d.ts.map +1 -1
  92. package/should-polyfill.js +7 -2
  93. package/supported-locales.d.ts +2 -0
  94. package/supported-locales.d.ts.map +1 -0
  95. package/supported-locales.js +5 -0
  96. package/locale-data/en-US-POSIX.js +0 -6
@@ -0,0 +1,6 @@
1
+ /* @generated */
2
+ // prettier-ignore
3
+ if (Intl.RelativeTimeFormat && typeof Intl.RelativeTimeFormat.__addLocaleData === 'function') {
4
+ Intl.RelativeTimeFormat.__addLocaleData({"data":{"nu":["latn"],"year":{"0":"kuá akayú","1":"amũ akayú","future":{"one":"{0} akayú resê","other":"{0} akayú itá resê"},"past":{"one":"aikué {0} akayú","other":"aikué {0} akayú itá"},"-1":"akayú kuera"},"year-short":{"0":"kuá akayú","1":"amũ akayú","future":{"one":"{0} akayú resê","other":"{0} akayú itá resê"},"past":{"one":"aikué {0} akayú","other":"aikué {0} akayú itá"},"-1":"akayú kuera"},"year-narrow":{"0":"kuá akayú","1":"amũ akayú","future":{"one":"{0} akayú resê","other":"{0} akayú itá resê"},"past":{"one":"aikué {0} akayú","other":"aikué {0} akayú itá"},"-1":"akayú kuera"},"quarter":{"0":"kuá musapíri-yasí","1":"amũ musapíri-yasí","future":{"one":"{0} musapíri-yasí resê","other":"{0} musapíri-yasí itá resê"},"past":{"one":"aikué {0} musapíri-yasí","other":"aikué {0} musapíri-yasí itá"},"-1":"kasakiriwara musapíri-yasí"},"quarter-short":{"0":"kuá musapíri-yasí","1":"amũ musapíri-yasí","future":{"one":"{0} mu-y. resê","other":"{0} mu-y. itá resê"},"past":{"one":"aikué {0} mu-y.","other":"aikué {0} mu-y. itá"},"-1":"kasakiriwara musapíri-yasí"},"quarter-narrow":{"0":"kuá musapíri-yasí","1":"amũ musapíri-yasí","future":{"one":"{0} mu-y. resê","other":"{0} mu-y. itá resê"},"past":{"one":"aikué {0} mu-y.","other":"aikué {0} mu-y. itá"},"-1":"kasakiriwara musapíri-yasí"},"month":{"0":"kuá yasí","1":"amũ yasí","future":{"one":"{0} yasí resê","other":"{0} yasí itá resê"},"past":{"one":"aikué {0} yasí","other":"aikué {0} yasí itá"},"-1":"yasí kuera"},"month-short":{"0":"kuá yasí","1":"amũ yasí","future":{"one":"{0} yasí resê","other":"{0} yasí itá resê"},"past":{"one":"aikué {0} yasí","other":"aikué {0} yasí itá"},"-1":"yasí kuera"},"month-narrow":{"0":"kuá yasí","1":"amũ yasí","future":{"one":"{0} yasí resê","other":"{0} yasí itá resê"},"past":{"one":"aikué {0} yasí","other":"aikué {0} yasí itá"},"-1":"yasí kuera"},"week":{"0":"kuá sẽmãna","1":"amũ sẽmãna","future":{"one":"{0} sẽmãna resê","other":"{0} sẽmãna itá resê"},"past":{"one":"aikué {0} sẽmãna","other":"aikué {0} sẽmãna itá"},"-1":"sẽmãna kuera"},"week-short":{"0":"kuá sẽmãna","1":"amũ sẽmãna","future":{"one":"{0} sẽm. resê","other":"{0} sẽm. itá resê"},"past":{"one":"aikué {0} sẽm.","other":"aikué {0} sẽm. itá"},"-1":"sẽmãna kuera"},"week-narrow":{"0":"kuá sẽmãna","1":"amũ sẽmãna","future":{"one":"{0} sẽm. resê","other":"{0} sẽm. itá resê"},"past":{"one":"aikué {0} sẽm.","other":"aikué {0} sẽm. itá"},"-1":"sẽmãna kuera"},"day":{"0":"wií","1":"wirãdé","2":"wirãdé ariré","future":{"one":"{0} ara resê","other":"{0} ara itá resê"},"past":{"one":"aikué {0} ara","other":"aikué {0} ara itá"},"-2":"amũ kuesê","-1":"kuesê"},"day-short":{"0":"wií","1":"wirãdé","2":"wirãdé ariré","future":{"one":"{0} ara resê","other":"{0} ara itá resê"},"past":{"one":"aikué {0} ara","other":"aikué {0} ara itá"},"-2":"amũ kuesê","-1":"kuesê"},"day-narrow":{"0":"wií","1":"wirãdé","2":"wirãdé ariré","future":{"one":"{0} ara resê","other":"{0} ara itá resê"},"past":{"one":"aikué {0} ara","other":"aikué {0} ara itá"},"-2":"amũ kuesê","-1":"kuesê"},"hour":{"0":"kuá hura","future":{"one":"{0} hura resê","other":"{0} hura resê itá"},"past":{"one":"aikué {0} hura","other":"aikué {0} hura itá"}},"hour-short":{"0":"kuá hura","future":{"one":"{0} h resê","other":"{0} h resê itá"},"past":{"one":"aikué {0} h","other":"aikué {0} h itá"}},"hour-narrow":{"0":"kuá hura","future":{"one":"{0} h resê","other":"{0} h resê itá"},"past":{"one":"aikué {0} h","other":"aikué {0} h itá"}},"minute":{"0":"kuá minutu","future":{"one":"{0} minutu resê","other":"{0} minutu resê itá"},"past":{"one":"aikué {0} minutu","other":"aikué {0} minutu itá"}},"minute-short":{"0":"kuá minutu","future":{"one":"{0} min. resê","other":"{0} min. resê itá"},"past":{"one":"aikué {0} min.","other":"aikué {0} min. itá"}},"minute-narrow":{"0":"kuá minutu","future":{"one":"{0} min. resê","other":"{0} min. resê itá"},"past":{"one":"aikué {0} min.","other":"aikué {0} min. itá"}},"second":{"0":"kuíri","future":{"one":"{0} segũdu resê","other":"{0} segũdu resê itá"},"past":{"one":"aikué {0} segũdu","other":"aikué {0} segũdu itá"}},"second-short":{"0":"kuíri","future":{"one":"{0} seg. resê","other":"{0} seg. resê itá"},"past":{"one":"aikué {0} seg.","other":"aikué {0} seg. itá"}},"second-narrow":{"0":"kuíri","future":{"one":"{0} seg. resê","other":"{0} seg. resê itá"},"past":{"one":"aikué {0} seg.","other":"aikué {0} seg. itá"}}},"locale":"yrl"}
5
+ )
6
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@formatjs/intl-relativetimeformat",
3
- "version": "9.3.2",
3
+ "version": "9.5.0",
4
4
  "description": "Formats JavaScript dates to relative time strings.",
5
5
  "keywords": [
6
6
  "intl",
@@ -20,8 +20,8 @@
20
20
  "url": "git@github.com:formatjs/formatjs.git"
21
21
  },
22
22
  "dependencies": {
23
- "@formatjs/ecma402-abstract": "1.10.0",
24
- "@formatjs/intl-localematcher": "0.2.21",
23
+ "@formatjs/ecma402-abstract": "1.11.1",
24
+ "@formatjs/intl-localematcher": "0.2.22",
25
25
  "tslib": "^2.1.0"
26
26
  },
27
27
  "main": "index.js",
package/polyfill-force.js CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  var tslib_1 = require("tslib");
4
- var _1 = tslib_1.__importDefault(require("./"));
4
+ var _1 = (0, tslib_1.__importDefault)(require("./"));
5
5
  Object.defineProperty(Intl, 'RelativeTimeFormat', {
6
6
  value: _1.default,
7
7
  writable: true,
package/polyfill.iife.js CHANGED
@@ -8,27 +8,24 @@
8
8
  var __markAsModule = function(target) {
9
9
  return __defProp(target, "__esModule", { value: true });
10
10
  };
11
- var __require = typeof require !== "undefined" ? require : function(x) {
12
- throw new Error('Dynamic require of "' + x + '" is not supported');
13
- };
14
11
  var __commonJS = function(cb, mod) {
15
- return function __require2() {
16
- return mod || (0, cb[Object.keys(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
12
+ return function __require() {
13
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
17
14
  };
18
15
  };
19
- var __reExport = function(target, module, desc) {
16
+ var __reExport = function(target, module, copyDefault, desc) {
20
17
  if (module && typeof module === "object" || typeof module === "function")
21
18
  for (var keys = __getOwnPropNames(module), i = 0, n = keys.length, key; i < n; i++) {
22
19
  key = keys[i];
23
- if (!__hasOwnProp.call(target, key) && key !== "default")
20
+ if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
24
21
  __defProp(target, key, { get: function(k) {
25
22
  return module[k];
26
23
  }.bind(null, key), enumerable: !(desc = __getOwnPropDesc(module, key)) || desc.enumerable });
27
24
  }
28
25
  return target;
29
26
  };
30
- var __toModule = function(module) {
31
- 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() {
32
29
  return module.default;
33
30
  }, enumerable: true } : { value: module, enumerable: true })), module);
34
31
  };
@@ -91,7 +88,7 @@
91
88
  for (var _i = 0, requestedLocales_1 = requestedLocales; _i < requestedLocales_1.length; _i++) {
92
89
  var locale = requestedLocales_1[_i];
93
90
  var noExtensionLocale = locale.replace(utils_1.UNICODE_EXTENSION_SEQUENCE_REGEX, "");
94
- var availableLocale = BestAvailableLocale_1.BestAvailableLocale(availableLocales, noExtensionLocale);
91
+ var availableLocale = (0, BestAvailableLocale_1.BestAvailableLocale)(availableLocales, noExtensionLocale);
95
92
  if (availableLocale) {
96
93
  result.locale = availableLocale;
97
94
  if (locale !== noExtensionLocale) {
@@ -116,11 +113,11 @@
116
113
  var BestAvailableLocale_1 = require_BestAvailableLocale();
117
114
  var utils_1 = require_utils();
118
115
  function BestFitMatcher(availableLocales, requestedLocales, getDefaultLocale) {
119
- var minimizedAvailableLocaleMap = Array.from(availableLocales).reduce(function(all, l2) {
120
- all[l2] = l2;
121
- return all;
122
- }, {});
123
- var minimizedAvailableLocales = new Set();
116
+ var minimizedAvailableLocaleMap = {};
117
+ availableLocales.forEach(function(l2) {
118
+ return minimizedAvailableLocaleMap[l2] = l2;
119
+ });
120
+ var minimizedAvailableLocales = /* @__PURE__ */ new Set();
124
121
  availableLocales.forEach(function(locale2) {
125
122
  var minimizedLocale = new Intl.Locale(locale2).minimize().toString();
126
123
  minimizedAvailableLocaleMap[minimizedLocale] = locale2;
@@ -148,7 +145,7 @@
148
145
  foundLocale = minimizedRequestedLocale;
149
146
  break;
150
147
  }
151
- foundLocale = BestAvailableLocale_1.BestAvailableLocale(minimizedAvailableLocales, maximizedRequestedLocale);
148
+ foundLocale = (0, BestAvailableLocale_1.BestAvailableLocale)(minimizedAvailableLocales, maximizedRequestedLocale);
152
149
  }
153
150
  return {
154
151
  locale: foundLocale && minimizedAvailableLocaleMap[foundLocale] || getDefaultLocale()
@@ -166,9 +163,9 @@
166
163
  exports.UnicodeExtensionValue = void 0;
167
164
  var utils_1 = require_utils();
168
165
  function UnicodeExtensionValue(extension, key) {
169
- utils_1.invariant(key.length === 2, "key must have 2 elements");
166
+ (0, utils_1.invariant)(key.length === 2, "key must have 2 elements");
170
167
  var size = extension.length;
171
- var searchValue = "-" + key + "-";
168
+ var searchValue = "-".concat(key, "-");
172
169
  var pos = extension.indexOf(searchValue);
173
170
  if (pos !== -1) {
174
171
  var start = pos + 4;
@@ -195,7 +192,7 @@
195
192
  }
196
193
  return extension.slice(start, end);
197
194
  }
198
- searchValue = "-" + key;
195
+ searchValue = "-".concat(key);
199
196
  pos = extension.indexOf(searchValue);
200
197
  if (pos !== -1 && pos + 3 === size) {
201
198
  return "";
@@ -216,44 +213,44 @@
216
213
  var BestFitMatcher_1 = require_BestFitMatcher();
217
214
  var utils_1 = require_utils();
218
215
  var UnicodeExtensionValue_1 = require_UnicodeExtensionValue();
219
- function ResolveLocale3(availableLocales, requestedLocales, options, relevantExtensionKeys, localeData, getDefaultLocale) {
216
+ function ResolveLocale2(availableLocales, requestedLocales, options, relevantExtensionKeys, localeData, getDefaultLocale) {
220
217
  var matcher = options.localeMatcher;
221
218
  var r;
222
219
  if (matcher === "lookup") {
223
- r = LookupMatcher_1.LookupMatcher(availableLocales, requestedLocales, getDefaultLocale);
220
+ r = (0, LookupMatcher_1.LookupMatcher)(availableLocales, requestedLocales, getDefaultLocale);
224
221
  } else {
225
- r = BestFitMatcher_1.BestFitMatcher(availableLocales, requestedLocales, getDefaultLocale);
222
+ r = (0, BestFitMatcher_1.BestFitMatcher)(availableLocales, requestedLocales, getDefaultLocale);
226
223
  }
227
224
  var foundLocale = r.locale;
228
225
  var result = { locale: "", dataLocale: foundLocale };
229
226
  var supportedExtension = "-u";
230
227
  for (var _i = 0, relevantExtensionKeys_1 = relevantExtensionKeys; _i < relevantExtensionKeys_1.length; _i++) {
231
228
  var key = relevantExtensionKeys_1[_i];
232
- utils_1.invariant(foundLocale in localeData, "Missing locale data for " + foundLocale);
229
+ (0, utils_1.invariant)(foundLocale in localeData, "Missing locale data for ".concat(foundLocale));
233
230
  var foundLocaleData = localeData[foundLocale];
234
- utils_1.invariant(typeof foundLocaleData === "object" && foundLocaleData !== null, "locale data " + key + " must be an object");
231
+ (0, utils_1.invariant)(typeof foundLocaleData === "object" && foundLocaleData !== null, "locale data ".concat(key, " must be an object"));
235
232
  var keyLocaleData = foundLocaleData[key];
236
- utils_1.invariant(Array.isArray(keyLocaleData), "keyLocaleData for " + key + " must be an array");
233
+ (0, utils_1.invariant)(Array.isArray(keyLocaleData), "keyLocaleData for ".concat(key, " must be an array"));
237
234
  var value = keyLocaleData[0];
238
- utils_1.invariant(typeof value === "string" || value === null, "value must be string or null but got " + typeof value + " in key " + key);
235
+ (0, utils_1.invariant)(typeof value === "string" || value === null, "value must be string or null but got ".concat(typeof value, " in key ").concat(key));
239
236
  var supportedExtensionAddition = "";
240
237
  if (r.extension) {
241
- var requestedValue = UnicodeExtensionValue_1.UnicodeExtensionValue(r.extension, key);
238
+ var requestedValue = (0, UnicodeExtensionValue_1.UnicodeExtensionValue)(r.extension, key);
242
239
  if (requestedValue !== void 0) {
243
240
  if (requestedValue !== "") {
244
241
  if (~keyLocaleData.indexOf(requestedValue)) {
245
242
  value = requestedValue;
246
- supportedExtensionAddition = "-" + key + "-" + value;
243
+ supportedExtensionAddition = "-".concat(key, "-").concat(value);
247
244
  }
248
245
  } else if (~requestedValue.indexOf("true")) {
249
246
  value = "true";
250
- supportedExtensionAddition = "-" + key;
247
+ supportedExtensionAddition = "-".concat(key);
251
248
  }
252
249
  }
253
250
  }
254
251
  if (key in options) {
255
252
  var optionsValue = options[key];
256
- utils_1.invariant(typeof optionsValue === "string" || typeof optionsValue === "undefined" || optionsValue === null, "optionsValue must be String, Undefined or Null");
253
+ (0, utils_1.invariant)(typeof optionsValue === "string" || typeof optionsValue === "undefined" || optionsValue === null, "optionsValue must be String, Undefined or Null");
257
254
  if (~keyLocaleData.indexOf(optionsValue)) {
258
255
  if (optionsValue !== value) {
259
256
  value = optionsValue;
@@ -278,7 +275,7 @@
278
275
  result.locale = foundLocale;
279
276
  return result;
280
277
  }
281
- exports.ResolveLocale = ResolveLocale3;
278
+ exports.ResolveLocale = ResolveLocale2;
282
279
  }
283
280
  });
284
281
 
@@ -295,7 +292,7 @@
295
292
  for (var _i = 0, requestedLocales_1 = requestedLocales; _i < requestedLocales_1.length; _i++) {
296
293
  var locale = requestedLocales_1[_i];
297
294
  var noExtensionLocale = locale.replace(utils_1.UNICODE_EXTENSION_SEQUENCE_REGEX, "");
298
- var availableLocale = BestAvailableLocale_1.BestAvailableLocale(availableLocales, noExtensionLocale);
295
+ var availableLocale = (0, BestAvailableLocale_1.BestAvailableLocale)(availableLocales, noExtensionLocale);
299
296
  if (availableLocale) {
300
297
  subset.push(availableLocale);
301
298
  }
@@ -313,18 +310,18 @@
313
310
  Object.defineProperty(exports, "__esModule", { value: true });
314
311
  exports.ResolveLocale = exports.LookupSupportedLocales = exports.match = void 0;
315
312
  var ResolveLocale_1 = require_ResolveLocale();
316
- function match(requestedLocales, availableLocales, defaultLocale, opts) {
313
+ function match2(requestedLocales, availableLocales, defaultLocale, opts) {
317
314
  var locales = availableLocales.reduce(function(all, l) {
318
315
  all.add(l);
319
316
  return all;
320
- }, new Set());
321
- return ResolveLocale_1.ResolveLocale(locales, requestedLocales, {
317
+ }, /* @__PURE__ */ new Set());
318
+ return (0, ResolveLocale_1.ResolveLocale)(locales, requestedLocales, {
322
319
  localeMatcher: (opts === null || opts === void 0 ? void 0 : opts.algorithm) || "best fit"
323
320
  }, [], {}, function() {
324
321
  return defaultLocale;
325
322
  }).locale;
326
323
  }
327
- exports.match = match;
324
+ exports.match = match2;
328
325
  var LookupSupportedLocales_1 = require_LookupSupportedLocales();
329
326
  Object.defineProperty(exports, "LookupSupportedLocales", { enumerable: true, get: function() {
330
327
  return LookupSupportedLocales_1.LookupSupportedLocales;
@@ -422,64 +419,13 @@
422
419
  if (values !== void 0 && !values.filter(function(val) {
423
420
  return val == value;
424
421
  }).length) {
425
- throw new RangeError(value + " is not within " + values.join(", "));
422
+ throw new RangeError("".concat(value, " is not within ").concat(values.join(", ")));
426
423
  }
427
424
  return value;
428
425
  }
429
426
  return fallback;
430
427
  }
431
428
 
432
- // bazel-out/darwin-fastbuild/bin/packages/ecma402-abstract/lib/IsSanctionedSimpleUnitIdentifier.js
433
- var SANCTIONED_UNITS = [
434
- "angle-degree",
435
- "area-acre",
436
- "area-hectare",
437
- "concentr-percent",
438
- "digital-bit",
439
- "digital-byte",
440
- "digital-gigabit",
441
- "digital-gigabyte",
442
- "digital-kilobit",
443
- "digital-kilobyte",
444
- "digital-megabit",
445
- "digital-megabyte",
446
- "digital-petabyte",
447
- "digital-terabit",
448
- "digital-terabyte",
449
- "duration-day",
450
- "duration-hour",
451
- "duration-millisecond",
452
- "duration-minute",
453
- "duration-month",
454
- "duration-second",
455
- "duration-week",
456
- "duration-year",
457
- "length-centimeter",
458
- "length-foot",
459
- "length-inch",
460
- "length-kilometer",
461
- "length-meter",
462
- "length-mile-scandinavian",
463
- "length-mile",
464
- "length-millimeter",
465
- "length-yard",
466
- "mass-gram",
467
- "mass-kilogram",
468
- "mass-ounce",
469
- "mass-pound",
470
- "mass-stone",
471
- "temperature-celsius",
472
- "temperature-fahrenheit",
473
- "volume-fluid-ounce",
474
- "volume-gallon",
475
- "volume-liter",
476
- "volume-milliliter"
477
- ];
478
- function removeUnitNamespace(unit) {
479
- return unit.slice(unit.indexOf("-") + 1);
480
- }
481
- var SIMPLE_UNITS = SANCTIONED_UNITS.map(removeUnitNamespace);
482
-
483
429
  // bazel-out/darwin-fastbuild/bin/packages/ecma402-abstract/lib/utils.js
484
430
  function invariant(condition, message, Err) {
485
431
  if (Err === void 0) {
@@ -490,16 +436,6 @@
490
436
  }
491
437
  }
492
438
 
493
- // bazel-out/darwin-fastbuild/bin/packages/ecma402-abstract/lib/regex.generated.js
494
- 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]/;
495
-
496
- // bazel-out/darwin-fastbuild/bin/packages/ecma402-abstract/lib/NumberFormat/format_to_parts.js
497
- var CARET_S_UNICODE_REGEX = new RegExp("^" + S_UNICODE_REGEX.source);
498
- var S_DOLLAR_UNICODE_REGEX = new RegExp(S_UNICODE_REGEX.source + "$");
499
-
500
- // bazel-out/darwin-fastbuild/bin/packages/ecma402-abstract/lib/NumberFormat/InitializeNumberFormat.js
501
- var import_intl_localematcher = __toModule(require_intl_localematcher());
502
-
503
439
  // bazel-out/darwin-fastbuild/bin/packages/ecma402-abstract/lib/PartitionPattern.js
504
440
  function PartitionPattern(pattern) {
505
441
  var result = [];
@@ -509,7 +445,7 @@
509
445
  var length = pattern.length;
510
446
  while (beginIndex < pattern.length && beginIndex > -1) {
511
447
  endIndex = pattern.indexOf("}", beginIndex);
512
- invariant(endIndex > beginIndex, "Invalid pattern " + pattern);
448
+ invariant(endIndex > beginIndex, "Invalid pattern ".concat(pattern));
513
449
  if (beginIndex > nextIndex) {
514
450
  result.push({
515
451
  type: "literal",
@@ -533,7 +469,7 @@
533
469
  }
534
470
 
535
471
  // bazel-out/darwin-fastbuild/bin/packages/ecma402-abstract/lib/SupportedLocales.js
536
- var import_intl_localematcher2 = __toModule(require_intl_localematcher());
472
+ var import_intl_localematcher = __toESM(require_intl_localematcher());
537
473
  function SupportedLocales(availableLocales, requestedLocales, options) {
538
474
  var matcher = "best fit";
539
475
  if (options !== void 0) {
@@ -541,53 +477,13 @@
541
477
  matcher = GetOption(options, "localeMatcher", "string", ["lookup", "best fit"], "best fit");
542
478
  }
543
479
  if (matcher === "best fit") {
544
- return (0, import_intl_localematcher2.LookupSupportedLocales)(availableLocales, requestedLocales);
480
+ return (0, import_intl_localematcher.LookupSupportedLocales)(availableLocales, requestedLocales);
545
481
  }
546
- return (0, import_intl_localematcher2.LookupSupportedLocales)(availableLocales, requestedLocales);
482
+ return (0, import_intl_localematcher.LookupSupportedLocales)(availableLocales, requestedLocales);
547
483
  }
548
484
 
549
- // node_modules/tslib/tslib.es6.js
550
- var extendStatics = function(d, b) {
551
- extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
552
- d2.__proto__ = b2;
553
- } || function(d2, b2) {
554
- for (var p in b2)
555
- if (Object.prototype.hasOwnProperty.call(b2, p))
556
- d2[p] = b2[p];
557
- };
558
- return extendStatics(d, b);
559
- };
560
- function __extends(d, b) {
561
- if (typeof b !== "function" && b !== null)
562
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
563
- extendStatics(d, b);
564
- function __() {
565
- this.constructor = d;
566
- }
567
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
568
- }
569
-
570
- // bazel-out/darwin-fastbuild/bin/packages/ecma402-abstract/lib/data.js
571
- var MissingLocaleDataError = function(_super) {
572
- __extends(MissingLocaleDataError2, _super);
573
- function MissingLocaleDataError2() {
574
- var _this = _super !== null && _super.apply(this, arguments) || this;
575
- _this.type = "MISSING_LOCALE_DATA";
576
- return _this;
577
- }
578
- return MissingLocaleDataError2;
579
- }(Error);
580
-
581
- // bazel-out/darwin-fastbuild/bin/packages/ecma402-abstract/lib/types/date-time.js
582
- var RangePatternType;
583
- (function(RangePatternType2) {
584
- RangePatternType2["startRange"] = "startRange";
585
- RangePatternType2["shared"] = "shared";
586
- RangePatternType2["endRange"] = "endRange";
587
- })(RangePatternType || (RangePatternType = {}));
588
-
589
485
  // bazel-out/darwin-fastbuild/bin/packages/intl-relativetimeformat/lib/abstract/InitializeRelativeTimeFormat.js
590
- var import_intl_localematcher3 = __toModule(require_intl_localematcher());
486
+ var import_intl_localematcher2 = __toESM(require_intl_localematcher());
591
487
  var NUMBERING_SYSTEM_REGEX = /^[a-z0-9]{3,8}(-[a-z0-9]{3,8})*$/i;
592
488
  function InitializeRelativeTimeFormat(rtf, locales, options, _a) {
593
489
  var getInternalSlots2 = _a.getInternalSlots, availableLocales = _a.availableLocales, relevantExtensionKeys = _a.relevantExtensionKeys, localeData = _a.localeData, getDefaultLocale = _a.getDefaultLocale;
@@ -601,17 +497,17 @@
601
497
  var numberingSystem = GetOption(opts, "numberingSystem", "string", void 0, void 0);
602
498
  if (numberingSystem !== void 0) {
603
499
  if (!NUMBERING_SYSTEM_REGEX.test(numberingSystem)) {
604
- throw new RangeError("Invalid numbering system " + numberingSystem);
500
+ throw new RangeError("Invalid numbering system ".concat(numberingSystem));
605
501
  }
606
502
  }
607
503
  opt.nu = numberingSystem;
608
- var r = (0, import_intl_localematcher3.ResolveLocale)(availableLocales, requestedLocales, opt, relevantExtensionKeys, localeData, getDefaultLocale);
504
+ var r = (0, import_intl_localematcher2.ResolveLocale)(availableLocales, requestedLocales, opt, relevantExtensionKeys, localeData, getDefaultLocale);
609
505
  var locale = r.locale, nu = r.nu;
610
506
  internalSlots.locale = locale;
611
507
  internalSlots.style = GetOption(opts, "style", "string", ["long", "narrow", "short"], "long");
612
508
  internalSlots.numeric = GetOption(opts, "numeric", "string", ["always", "auto"], "always");
613
509
  var fields = localeData[r.dataLocale];
614
- invariant(!!fields, "Missing locale data for " + r.dataLocale);
510
+ invariant(!!fields, "Missing locale data for ".concat(r.dataLocale));
615
511
  internalSlots.fields = fields;
616
512
  internalSlots.numberFormat = new Intl.NumberFormat(locales);
617
513
  internalSlots.pluralRules = new Intl.PluralRules(locales);
@@ -656,7 +552,7 @@
656
552
  value: patternPart.value
657
553
  });
658
554
  } else {
659
- invariant(patternPart.type === "0", "Malformed pattern " + pattern);
555
+ invariant(patternPart.type === "0", "Malformed pattern ".concat(pattern));
660
556
  for (var _a = 0, parts_1 = parts; _a < parts_1.length; _a++) {
661
557
  var part = parts_1[_a];
662
558
  result.push({
@@ -673,18 +569,18 @@
673
569
  // bazel-out/darwin-fastbuild/bin/packages/intl-relativetimeformat/lib/abstract/PartitionRelativeTimePattern.js
674
570
  function PartitionRelativeTimePattern(rtf, value, unit, _a) {
675
571
  var getInternalSlots2 = _a.getInternalSlots;
676
- invariant(Type(value) === "Number", "value must be number, instead got " + typeof value, TypeError);
677
- invariant(Type(unit) === "String", "unit must be number, instead got " + typeof value, TypeError);
572
+ invariant(Type(value) === "Number", "value must be number, instead got ".concat(typeof value), TypeError);
573
+ invariant(Type(unit) === "String", "unit must be number, instead got ".concat(typeof value), TypeError);
678
574
  if (isNaN(value) || !isFinite(value)) {
679
- throw new RangeError("Invalid value " + value);
575
+ throw new RangeError("Invalid value ".concat(value));
680
576
  }
681
577
  var resolvedUnit = SingularRelativeTimeUnit(unit);
682
578
  var _b = getInternalSlots2(rtf), fields = _b.fields, style = _b.style, numeric = _b.numeric, pluralRules = _b.pluralRules, numberFormat = _b.numberFormat;
683
579
  var entry = resolvedUnit;
684
580
  if (style === "short") {
685
- entry = resolvedUnit + "-short";
581
+ entry = "".concat(resolvedUnit, "-short");
686
582
  } else if (style === "narrow") {
687
- entry = resolvedUnit + "-narrow";
583
+ entry = "".concat(resolvedUnit, "-narrow");
688
584
  }
689
585
  if (!(entry in fields)) {
690
586
  entry = resolvedUnit;
@@ -718,7 +614,7 @@
718
614
  }
719
615
 
720
616
  // bazel-out/darwin-fastbuild/bin/packages/intl-relativetimeformat/lib/get_internal_slots.js
721
- var internalSlotMap = new WeakMap();
617
+ var internalSlotMap = /* @__PURE__ */ new WeakMap();
722
618
  function getInternalSlots(x) {
723
619
  var internalSlots = internalSlotMap.get(x);
724
620
  if (!internalSlots) {
@@ -805,7 +701,7 @@
805
701
  return RelativeTimeFormat2.__defaultLocale;
806
702
  };
807
703
  RelativeTimeFormat2.localeData = {};
808
- RelativeTimeFormat2.availableLocales = new Set();
704
+ RelativeTimeFormat2.availableLocales = /* @__PURE__ */ new Set();
809
705
  RelativeTimeFormat2.__defaultLocale = "";
810
706
  RelativeTimeFormat2.relevantExtensionKeys = ["nu"];
811
707
  RelativeTimeFormat2.polyfilled = true;
@@ -836,6 +732,12 @@
836
732
  } catch (e) {
837
733
  }
838
734
 
735
+ // bazel-out/darwin-fastbuild/bin/packages/intl-relativetimeformat/lib/should-polyfill.js
736
+ var import_intl_localematcher3 = __toESM(require_intl_localematcher());
737
+
738
+ // bazel-out/darwin-fastbuild/bin/packages/intl-relativetimeformat/lib/supported-locales.js
739
+ var supportedLocales = ["af-NA", "af", "agq", "ak", "am", "ar-AE", "ar-BH", "ar-DJ", "ar-DZ", "ar-EG", "ar-EH", "ar-ER", "ar-IL", "ar-IQ", "ar-JO", "ar-KM", "ar-KW", "ar-LB", "ar-LY", "ar-MA", "ar-MR", "ar-OM", "ar-PS", "ar-QA", "ar-SA", "ar-SD", "ar-SO", "ar-SS", "ar-SY", "ar-TD", "ar-TN", "ar-YE", "ar", "as", "asa", "ast", "az-Cyrl", "az-Latn", "az", "bas", "be-tarask", "be", "bem", "bez", "bg", "bm", "bn-IN", "bn", "bo-IN", "bo", "br", "brx", "bs-Cyrl", "bs-Latn", "bs", "ca-AD", "ca-ES-valencia", "ca-FR", "ca-IT", "ca", "ccp-IN", "ccp", "ce", "ceb", "cgg", "chr", "ckb-IR", "ckb", "cs", "cy", "da-GL", "da", "dav", "de-AT", "de-BE", "de-CH", "de-IT", "de-LI", "de-LU", "de", "dje", "doi", "dsb", "dua", "dyo", "dz", "ebu", "ee-TG", "ee", "el-CY", "el", "en-001", "en-150", "en-AE", "en-AG", "en-AI", "en-AS", "en-AT", "en-AU", "en-BB", "en-BE", "en-BI", "en-BM", "en-BS", "en-BW", "en-BZ", "en-CA", "en-CC", "en-CH", "en-CK", "en-CM", "en-CX", "en-CY", "en-DE", "en-DG", "en-DK", "en-DM", "en-ER", "en-FI", "en-FJ", "en-FK", "en-FM", "en-GB", "en-GD", "en-GG", "en-GH", "en-GI", "en-GM", "en-GU", "en-GY", "en-HK", "en-IE", "en-IL", "en-IM", "en-IN", "en-IO", "en-JE", "en-JM", "en-KE", "en-KI", "en-KN", "en-KY", "en-LC", "en-LR", "en-LS", "en-MG", "en-MH", "en-MO", "en-MP", "en-MS", "en-MT", "en-MU", "en-MW", "en-MY", "en-NA", "en-NF", "en-NG", "en-NL", "en-NR", "en-NU", "en-NZ", "en-PG", "en-PH", "en-PK", "en-PN", "en-PR", "en-PW", "en-RW", "en-SB", "en-SC", "en-SD", "en-SE", "en-SG", "en-SH", "en-SI", "en-SL", "en-SS", "en-SX", "en-SZ", "en-TC", "en-TK", "en-TO", "en-TT", "en-TV", "en-TZ", "en-UG", "en-UM", "en-VC", "en-VG", "en-VI", "en-VU", "en-WS", "en-ZA", "en-ZM", "en-ZW", "en", "eo", "es-419", "es-AR", "es-BO", "es-BR", "es-BZ", "es-CL", "es-CO", "es-CR", "es-CU", "es-DO", "es-EA", "es-EC", "es-GQ", "es-GT", "es-HN", "es-IC", "es-MX", "es-NI", "es-PA", "es-PE", "es-PH", "es-PR", "es-PY", "es-SV", "es-US", "es-UY", "es-VE", "es", "et", "eu", "ewo", "fa-AF", "fa", "ff-Adlm-BF", "ff-Adlm-CM", "ff-Adlm-GH", "ff-Adlm-GM", "ff-Adlm-GW", "ff-Adlm-LR", "ff-Adlm-MR", "ff-Adlm-NE", "ff-Adlm-NG", "ff-Adlm-SL", "ff-Adlm-SN", "ff-Adlm", "ff-Latn-BF", "ff-Latn-CM", "ff-Latn-GH", "ff-Latn-GM", "ff-Latn-GN", "ff-Latn-GW", "ff-Latn-LR", "ff-Latn-MR", "ff-Latn-NE", "ff-Latn-NG", "ff-Latn-SL", "ff-Latn", "ff", "fi", "fil", "fo-DK", "fo", "fr-BE", "fr-BF", "fr-BI", "fr-BJ", "fr-BL", "fr-CA", "fr-CD", "fr-CF", "fr-CG", "fr-CH", "fr-CI", "fr-CM", "fr-DJ", "fr-DZ", "fr-GA", "fr-GF", "fr-GN", "fr-GP", "fr-GQ", "fr-HT", "fr-KM", "fr-LU", "fr-MA", "fr-MC", "fr-MF", "fr-MG", "fr-ML", "fr-MQ", "fr-MR", "fr-MU", "fr-NC", "fr-NE", "fr-PF", "fr-PM", "fr-RE", "fr-RW", "fr-SC", "fr-SN", "fr-SY", "fr-TD", "fr-TG", "fr-TN", "fr-VU", "fr-WF", "fr-YT", "fr", "fur", "fy", "ga-GB", "ga", "gd", "gl", "gsw-FR", "gsw-LI", "gsw", "gu", "guz", "gv", "ha-GH", "ha-NE", "ha", "haw", "he", "hi", "hr-BA", "hr", "hsb", "hu", "hy", "ia", "id", "ig", "ii", "is", "it-CH", "it-SM", "it-VA", "it", "ja", "jgo", "jmc", "jv", "ka", "kab", "kam", "kde", "kea", "kgp", "khq", "ki", "kk", "kkj", "kl", "kln", "km", "kn", "ko-KP", "ko", "kok", "ks-Arab", "ks", "ksb", "ksf", "ksh", "ku", "kw", "ky", "lag", "lb", "lg", "lkt", "ln-AO", "ln-CF", "ln-CG", "ln", "lo", "lrc-IQ", "lrc", "lt", "lu", "luo", "luy", "lv", "mai", "mas-TZ", "mas", "mer", "mfe", "mg", "mgh", "mgo", "mi", "mk", "ml", "mn", "mni-Beng", "mni", "mr", "ms-BN", "ms-ID", "ms-SG", "ms", "mt", "mua", "my", "mzn", "naq", "nb-SJ", "nb", "nd", "nds-NL", "nds", "ne-IN", "ne", "nl-AW", "nl-BE", "nl-BQ", "nl-CW", "nl-SR", "nl-SX", "nl", "nmg", "nn", "nnh", "no", "nus", "nyn", "om-KE", "om", "or", "os-RU", "os", "pa-Arab", "pa-Guru", "pa", "pcm", "pl", "ps-PK", "ps", "pt-AO", "pt-CH", "pt-CV", "pt-GQ", "pt-GW", "pt-LU", "pt-MO", "pt-MZ", "pt-PT", "pt-ST", "pt-TL", "pt", "qu-BO", "qu-EC", "qu", "rm", "rn", "ro-MD", "ro", "rof", "ru-BY", "ru-KG", "ru-KZ", "ru-MD", "ru-UA", "ru", "rw", "rwk", "sa", "sah", "saq", "sat-Olck", "sat", "sbp", "sc", "sd-Arab", "sd-Deva", "sd", "se-FI", "se-SE", "se", "seh", "ses", "sg", "shi-Latn", "shi-Tfng", "shi", "si", "sk", "sl", "smn", "sn", "so-DJ", "so-ET", "so-KE", "so", "sq-MK", "sq-XK", "sq", "sr-Cyrl-BA", "sr-Cyrl-ME", "sr-Cyrl-XK", "sr-Cyrl", "sr-Latn-BA", "sr-Latn-ME", "sr-Latn-XK", "sr-Latn", "sr", "su-Latn", "su", "sv-AX", "sv-FI", "sv", "sw-CD", "sw-KE", "sw-UG", "sw", "ta-LK", "ta-MY", "ta-SG", "ta", "te", "teo-KE", "teo", "tg", "th", "ti-ER", "ti", "tk", "to", "tr-CY", "tr", "tt", "twq", "tzm", "ug", "uk", "und", "ur-IN", "ur", "uz-Arab", "uz-Cyrl", "uz-Latn", "uz", "vai-Latn", "vai-Vaii", "vai", "vi", "vun", "wae", "wo", "xh", "xog", "yav", "yi", "yo-BJ", "yo", "yrl-CO", "yrl-VE", "yrl", "yue-Hans", "yue-Hant", "yue", "zgh", "zh-Hans-HK", "zh-Hans-MO", "zh-Hans-SG", "zh-Hans", "zh-Hant-HK", "zh-Hant-MO", "zh-Hant", "zh", "zu"];
740
+
839
741
  // bazel-out/darwin-fastbuild/bin/packages/intl-relativetimeformat/lib/should-polyfill.js
840
742
  function supportedLocalesOf(locale) {
841
743
  if (!locale) {
@@ -854,7 +756,12 @@
854
756
  }
855
757
  }
856
758
  function shouldPolyfill(locale) {
857
- return !("RelativeTimeFormat" in Intl) || !supportedLocalesOf(locale) || !hasResolvedOptionsNumberingSystem(locale);
759
+ if (locale === void 0) {
760
+ locale = "en";
761
+ }
762
+ if (!("RelativeTimeFormat" in Intl) || !supportedLocalesOf(locale) || !hasResolvedOptionsNumberingSystem(locale)) {
763
+ return (0, import_intl_localematcher3.match)([locale], supportedLocales, "en");
764
+ }
858
765
  }
859
766
 
860
767
  // bazel-out/darwin-fastbuild/bin/packages/intl-relativetimeformat/lib/polyfill.js
@@ -867,18 +774,4 @@
867
774
  });
868
775
  }
869
776
  })();
870
- /*! *****************************************************************************
871
- Copyright (c) Microsoft Corporation.
872
-
873
- Permission to use, copy, modify, and/or distribute this software for any
874
- purpose with or without fee is hereby granted.
875
-
876
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
877
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
878
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
879
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
880
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
881
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
882
- PERFORMANCE OF THIS SOFTWARE.
883
- ***************************************************************************** */
884
777
  //# sourceMappingURL=polyfill.iife.js.map
package/polyfill.js CHANGED
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  var tslib_1 = require("tslib");
4
- var _1 = tslib_1.__importDefault(require("./"));
4
+ var _1 = (0, tslib_1.__importDefault)(require("./"));
5
5
  var should_polyfill_1 = require("./should-polyfill");
6
- if (should_polyfill_1.shouldPolyfill()) {
6
+ if ((0, should_polyfill_1.shouldPolyfill)()) {
7
7
  Object.defineProperty(Intl, 'RelativeTimeFormat', {
8
8
  value: _1.default,
9
9
  writable: true,
@@ -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-relativetimeformat/should-polyfill.ts"],"names":[],"mappings":"AAwBA,wBAAgB,cAAc,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,WAMxD"}
1
+ {"version":3,"file":"should-polyfill.d.ts","sourceRoot":"","sources":["../../../../../packages/intl-relativetimeformat/should-polyfill.ts"],"names":[],"mappings":"AA2BA,wBAAgB,cAAc,CAAC,MAAM,SAAO,sBAQ3C"}
@@ -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;
@@ -21,8 +23,11 @@ function hasResolvedOptionsNumberingSystem(locale) {
21
23
  }
22
24
  }
23
25
  function shouldPolyfill(locale) {
24
- return (!('RelativeTimeFormat' in Intl) ||
26
+ if (locale === void 0) { locale = 'en'; }
27
+ if (!('RelativeTimeFormat' in Intl) ||
25
28
  !supportedLocalesOf(locale) ||
26
- !hasResolvedOptionsNumberingSystem(locale));
29
+ !hasResolvedOptionsNumberingSystem(locale)) {
30
+ return (0, intl_localematcher_1.match)([locale], supported_locales_1.supportedLocales, 'en');
31
+ }
27
32
  }
28
33
  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-relativetimeformat/supported-locales.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,gBAAgB,EAAE,MAAM,EAAsqI,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-NA", "af", "agq", "ak", "am", "ar-AE", "ar-BH", "ar-DJ", "ar-DZ", "ar-EG", "ar-EH", "ar-ER", "ar-IL", "ar-IQ", "ar-JO", "ar-KM", "ar-KW", "ar-LB", "ar-LY", "ar-MA", "ar-MR", "ar-OM", "ar-PS", "ar-QA", "ar-SA", "ar-SD", "ar-SO", "ar-SS", "ar-SY", "ar-TD", "ar-TN", "ar-YE", "ar", "as", "asa", "ast", "az-Cyrl", "az-Latn", "az", "bas", "be-tarask", "be", "bem", "bez", "bg", "bm", "bn-IN", "bn", "bo-IN", "bo", "br", "brx", "bs-Cyrl", "bs-Latn", "bs", "ca-AD", "ca-ES-valencia", "ca-FR", "ca-IT", "ca", "ccp-IN", "ccp", "ce", "ceb", "cgg", "chr", "ckb-IR", "ckb", "cs", "cy", "da-GL", "da", "dav", "de-AT", "de-BE", "de-CH", "de-IT", "de-LI", "de-LU", "de", "dje", "doi", "dsb", "dua", "dyo", "dz", "ebu", "ee-TG", "ee", "el-CY", "el", "en-001", "en-150", "en-AE", "en-AG", "en-AI", "en-AS", "en-AT", "en-AU", "en-BB", "en-BE", "en-BI", "en-BM", "en-BS", "en-BW", "en-BZ", "en-CA", "en-CC", "en-CH", "en-CK", "en-CM", "en-CX", "en-CY", "en-DE", "en-DG", "en-DK", "en-DM", "en-ER", "en-FI", "en-FJ", "en-FK", "en-FM", "en-GB", "en-GD", "en-GG", "en-GH", "en-GI", "en-GM", "en-GU", "en-GY", "en-HK", "en-IE", "en-IL", "en-IM", "en-IN", "en-IO", "en-JE", "en-JM", "en-KE", "en-KI", "en-KN", "en-KY", "en-LC", "en-LR", "en-LS", "en-MG", "en-MH", "en-MO", "en-MP", "en-MS", "en-MT", "en-MU", "en-MW", "en-MY", "en-NA", "en-NF", "en-NG", "en-NL", "en-NR", "en-NU", "en-NZ", "en-PG", "en-PH", "en-PK", "en-PN", "en-PR", "en-PW", "en-RW", "en-SB", "en-SC", "en-SD", "en-SE", "en-SG", "en-SH", "en-SI", "en-SL", "en-SS", "en-SX", "en-SZ", "en-TC", "en-TK", "en-TO", "en-TT", "en-TV", "en-TZ", "en-UG", "en-UM", "en-VC", "en-VG", "en-VI", "en-VU", "en-WS", "en-ZA", "en-ZM", "en-ZW", "en", "eo", "es-419", "es-AR", "es-BO", "es-BR", "es-BZ", "es-CL", "es-CO", "es-CR", "es-CU", "es-DO", "es-EA", "es-EC", "es-GQ", "es-GT", "es-HN", "es-IC", "es-MX", "es-NI", "es-PA", "es-PE", "es-PH", "es-PR", "es-PY", "es-SV", "es-US", "es-UY", "es-VE", "es", "et", "eu", "ewo", "fa-AF", "fa", "ff-Adlm-BF", "ff-Adlm-CM", "ff-Adlm-GH", "ff-Adlm-GM", "ff-Adlm-GW", "ff-Adlm-LR", "ff-Adlm-MR", "ff-Adlm-NE", "ff-Adlm-NG", "ff-Adlm-SL", "ff-Adlm-SN", "ff-Adlm", "ff-Latn-BF", "ff-Latn-CM", "ff-Latn-GH", "ff-Latn-GM", "ff-Latn-GN", "ff-Latn-GW", "ff-Latn-LR", "ff-Latn-MR", "ff-Latn-NE", "ff-Latn-NG", "ff-Latn-SL", "ff-Latn", "ff", "fi", "fil", "fo-DK", "fo", "fr-BE", "fr-BF", "fr-BI", "fr-BJ", "fr-BL", "fr-CA", "fr-CD", "fr-CF", "fr-CG", "fr-CH", "fr-CI", "fr-CM", "fr-DJ", "fr-DZ", "fr-GA", "fr-GF", "fr-GN", "fr-GP", "fr-GQ", "fr-HT", "fr-KM", "fr-LU", "fr-MA", "fr-MC", "fr-MF", "fr-MG", "fr-ML", "fr-MQ", "fr-MR", "fr-MU", "fr-NC", "fr-NE", "fr-PF", "fr-PM", "fr-RE", "fr-RW", "fr-SC", "fr-SN", "fr-SY", "fr-TD", "fr-TG", "fr-TN", "fr-VU", "fr-WF", "fr-YT", "fr", "fur", "fy", "ga-GB", "ga", "gd", "gl", "gsw-FR", "gsw-LI", "gsw", "gu", "guz", "gv", "ha-GH", "ha-NE", "ha", "haw", "he", "hi", "hr-BA", "hr", "hsb", "hu", "hy", "ia", "id", "ig", "ii", "is", "it-CH", "it-SM", "it-VA", "it", "ja", "jgo", "jmc", "jv", "ka", "kab", "kam", "kde", "kea", "kgp", "khq", "ki", "kk", "kkj", "kl", "kln", "km", "kn", "ko-KP", "ko", "kok", "ks-Arab", "ks", "ksb", "ksf", "ksh", "ku", "kw", "ky", "lag", "lb", "lg", "lkt", "ln-AO", "ln-CF", "ln-CG", "ln", "lo", "lrc-IQ", "lrc", "lt", "lu", "luo", "luy", "lv", "mai", "mas-TZ", "mas", "mer", "mfe", "mg", "mgh", "mgo", "mi", "mk", "ml", "mn", "mni-Beng", "mni", "mr", "ms-BN", "ms-ID", "ms-SG", "ms", "mt", "mua", "my", "mzn", "naq", "nb-SJ", "nb", "nd", "nds-NL", "nds", "ne-IN", "ne", "nl-AW", "nl-BE", "nl-BQ", "nl-CW", "nl-SR", "nl-SX", "nl", "nmg", "nn", "nnh", "no", "nus", "nyn", "om-KE", "om", "or", "os-RU", "os", "pa-Arab", "pa-Guru", "pa", "pcm", "pl", "ps-PK", "ps", "pt-AO", "pt-CH", "pt-CV", "pt-GQ", "pt-GW", "pt-LU", "pt-MO", "pt-MZ", "pt-PT", "pt-ST", "pt-TL", "pt", "qu-BO", "qu-EC", "qu", "rm", "rn", "ro-MD", "ro", "rof", "ru-BY", "ru-KG", "ru-KZ", "ru-MD", "ru-UA", "ru", "rw", "rwk", "sa", "sah", "saq", "sat-Olck", "sat", "sbp", "sc", "sd-Arab", "sd-Deva", "sd", "se-FI", "se-SE", "se", "seh", "ses", "sg", "shi-Latn", "shi-Tfng", "shi", "si", "sk", "sl", "smn", "sn", "so-DJ", "so-ET", "so-KE", "so", "sq-MK", "sq-XK", "sq", "sr-Cyrl-BA", "sr-Cyrl-ME", "sr-Cyrl-XK", "sr-Cyrl", "sr-Latn-BA", "sr-Latn-ME", "sr-Latn-XK", "sr-Latn", "sr", "su-Latn", "su", "sv-AX", "sv-FI", "sv", "sw-CD", "sw-KE", "sw-UG", "sw", "ta-LK", "ta-MY", "ta-SG", "ta", "te", "teo-KE", "teo", "tg", "th", "ti-ER", "ti", "tk", "to", "tr-CY", "tr", "tt", "twq", "tzm", "ug", "uk", "und", "ur-IN", "ur", "uz-Arab", "uz-Cyrl", "uz-Latn", "uz", "vai-Latn", "vai-Vaii", "vai", "vi", "vun", "wae", "wo", "xh", "xog", "yav", "yi", "yo-BJ", "yo", "yrl-CO", "yrl-VE", "yrl", "yue-Hans", "yue-Hant", "yue", "zgh", "zh-Hans-HK", "zh-Hans-MO", "zh-Hans-SG", "zh-Hans", "zh-Hant-HK", "zh-Hant-MO", "zh-Hant", "zh", "zu"];