{"version":3,"file":"intl-relativetimeformat.min.js","sources":["../../../intl-utils/lib/invariant.js","../../../intl-utils/lib/polyfill-utils.js","../../../intl-utils/lib/get-canonical-locales.js","../../../intl-utils/lib/resolve-locale.js","../../lib/core.js"],"sourcesContent":["export function invariant(condition, message, Err) {\n if (Err === void 0) { Err = Error; }\n if (!condition) {\n throw new Err(message);\n }\n}\n//# sourceMappingURL=invariant.js.map","import aliases from './aliases';\nimport parentLocales from './parentLocales';\nimport { invariant } from './invariant';\n/**\n * https://tc39.es/ecma262/#sec-toobject\n * @param arg\n */\nexport function toObject(arg) {\n if (arg == null) {\n throw new TypeError('undefined/null cannot be converted to object');\n }\n return Object(arg);\n}\n/**\n * https://tc39.es/ecma262/#sec-tostring\n */\nexport function toString(o) {\n // Only symbol is irregular...\n if (typeof o === 'symbol') {\n throw TypeError('Cannot convert a Symbol value to a string');\n }\n return String(o);\n}\n/**\n * https://tc39.es/ecma402/#sec-getoption\n * @param opts\n * @param prop\n * @param type\n * @param values\n * @param fallback\n */\nexport function getOption(opts, prop, type, values, fallback) {\n // const descriptor = Object.getOwnPropertyDescriptor(opts, prop);\n var value = opts[prop];\n if (value !== undefined) {\n if (type !== 'boolean' && type !== 'string') {\n throw new TypeError('invalid type');\n }\n if (type === 'boolean') {\n value = Boolean(value);\n }\n if (type === 'string') {\n value = toString(value);\n }\n if (values !== undefined && !values.filter(function (val) { return val == value; }).length) {\n throw new RangeError(value + \" is not within \" + values.join(', '));\n }\n return value;\n }\n return fallback;\n}\n/**\n * https://tc39.es/ecma402/#sec-defaultnumberoption\n * @param val\n * @param min\n * @param max\n * @param fallback\n */\nexport function defaultNumberOption(val, min, max, fallback) {\n if (val !== undefined) {\n val = Number(val);\n if (isNaN(val) || val < min || val > max) {\n throw new RangeError(val + \" is outside of range [\" + min + \", \" + max + \"]\");\n }\n return Math.floor(val);\n }\n return fallback;\n}\n/**\n * https://tc39.es/ecma402/#sec-getnumberoption\n * @param options\n * @param property\n * @param min\n * @param max\n * @param fallback\n */\nexport function getNumberOption(options, property, minimum, maximum, fallback) {\n var val = options[property];\n return defaultNumberOption(val, minimum, maximum, fallback);\n}\nexport function getAliasesByLang(lang) {\n return Object.keys(aliases).reduce(function (all, locale) {\n if (locale.split('-')[0] === lang) {\n all[locale] = aliases[locale];\n }\n return all;\n }, {});\n}\nexport function getParentLocalesByLang(lang) {\n return Object.keys(parentLocales).reduce(function (all, locale) {\n if (locale.split('-')[0] === lang) {\n all[locale] = parentLocales[locale];\n }\n return all;\n }, {});\n}\nexport function setInternalSlot(map, pl, field, value) {\n if (!map.get(pl)) {\n map.set(pl, Object.create(null));\n }\n var slots = map.get(pl);\n slots[field] = value;\n}\nexport function setMultiInternalSlots(map, pl, props) {\n for (var _i = 0, _a = Object.keys(props); _i < _a.length; _i++) {\n var k = _a[_i];\n setInternalSlot(map, pl, k, props[k]);\n }\n}\nexport function getInternalSlot(map, pl, field) {\n return getMultiInternalSlots(map, pl, field)[field];\n}\nexport function getMultiInternalSlots(map, pl) {\n var fields = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n fields[_i - 2] = arguments[_i];\n }\n var slots = map.get(pl);\n if (!slots) {\n throw new TypeError(pl + \" InternalSlot has not been initialized\");\n }\n return fields.reduce(function (all, f) {\n all[f] = slots[f];\n return all;\n }, Object.create(null));\n}\nexport function isLiteralPart(patternPart) {\n return patternPart.type === 'literal';\n}\nexport function partitionPattern(pattern) {\n var result = [];\n var beginIndex = pattern.indexOf('{');\n var endIndex = 0;\n var nextIndex = 0;\n var length = pattern.length;\n while (beginIndex < pattern.length && beginIndex > -1) {\n endIndex = pattern.indexOf('}', beginIndex);\n invariant(endIndex > beginIndex, \"Invalid pattern \" + pattern);\n if (beginIndex > nextIndex) {\n result.push({\n type: 'literal',\n value: pattern.substring(nextIndex, beginIndex),\n });\n }\n result.push({\n type: pattern.substring(beginIndex + 1, endIndex),\n value: undefined,\n });\n nextIndex = endIndex + 1;\n beginIndex = pattern.indexOf('{', nextIndex);\n }\n if (nextIndex < length) {\n result.push({\n type: 'literal',\n value: pattern.substring(nextIndex, length),\n });\n }\n return result;\n}\n/**\n * https://tc39.es/ecma402/#sec-setnfdigitoptions\n * https://tc39.es/proposal-unified-intl-numberformat/section11/numberformat_diff_out.html#sec-setnfdigitoptions\n * @param intlObj\n * @param opts\n * @param mnfdDefault\n * @param mxfdDefault\n */\nexport function setNumberFormatDigitOptions(internalSlotMap, intlObj, opts, mnfdDefault, mxfdDefault) {\n var mnid = getNumberOption(opts, 'minimumIntegerDigits', 1, 21, 1);\n var mnfd = opts.minimumFractionDigits;\n var mxfd = opts.maximumFractionDigits;\n var mnsd = opts.minimumSignificantDigits;\n var mxsd = opts.maximumSignificantDigits;\n setInternalSlot(internalSlotMap, intlObj, 'minimumIntegerDigits', mnid);\n if (mnsd !== undefined || mxsd !== undefined) {\n setInternalSlot(internalSlotMap, intlObj, 'roundingType', 'significantDigits');\n mnsd = defaultNumberOption(mnsd, 1, 21, 1);\n mxsd = defaultNumberOption(mxsd, mnsd, 21, 21);\n setInternalSlot(internalSlotMap, intlObj, 'minimumSignificantDigits', mnsd);\n setInternalSlot(internalSlotMap, intlObj, 'maximumSignificantDigits', mxsd);\n }\n else if (mnfd !== undefined || mxfd !== undefined) {\n setInternalSlot(internalSlotMap, intlObj, 'roundingType', 'fractionDigits');\n mnfd = defaultNumberOption(mnfd, 0, 20, mnfdDefault);\n var mxfdActualDefault = Math.max(mnfd, mxfdDefault);\n mxfd = defaultNumberOption(mxfd, mnfd, 20, mxfdActualDefault);\n setInternalSlot(internalSlotMap, intlObj, 'minimumFractionDigits', mnfd);\n setInternalSlot(internalSlotMap, intlObj, 'maximumFractionDigits', mxfd);\n }\n else if (getInternalSlot(internalSlotMap, intlObj, 'notation') === 'compact') {\n setInternalSlot(internalSlotMap, intlObj, 'roundingType', 'compactRounding');\n }\n else {\n setInternalSlot(internalSlotMap, intlObj, 'roundingType', 'fractionDigits');\n setInternalSlot(internalSlotMap, intlObj, 'minimumFractionDigits', mnfdDefault);\n setInternalSlot(internalSlotMap, intlObj, 'maximumFractionDigits', mxfdDefault);\n }\n}\nexport function objectIs(x, y) {\n if (Object.is) {\n return Object.is(x, y);\n }\n // SameValue algorithm\n if (x === y) {\n // Steps 1-5, 7-10\n // Steps 6.b-6.e: +0 != -0\n return x !== 0 || 1 / x === 1 / y;\n }\n // Step 6.a: NaN == NaN\n return x !== x && y !== y;\n}\nvar NOT_A_Z_REGEX = /[^A-Z]/;\n/**\n * This follows https://tc39.es/ecma402/#sec-case-sensitivity-and-case-mapping\n * @param str string to convert\n */\nfunction toUpperCase(str) {\n return str.replace(/([a-z])/g, function (_, c) { return c.toUpperCase(); });\n}\n/**\n * https://tc39.es/proposal-unified-intl-numberformat/section6/locales-currencies-tz_proposed_out.html#sec-iswellformedcurrencycode\n * @param currency\n */\nexport function isWellFormedCurrencyCode(currency) {\n currency = toUpperCase(currency);\n if (currency.length !== 3) {\n return false;\n }\n if (NOT_A_Z_REGEX.test(currency)) {\n return false;\n }\n return true;\n}\n//# sourceMappingURL=polyfill-utils.js.map","/**\n * IE11-safe version of getCanonicalLocales since it's ES2016\n * @param locales locales\n */\nexport function getCanonicalLocales(locales) {\n // IE11\n var getCanonicalLocales = Intl.getCanonicalLocales;\n if (typeof getCanonicalLocales === 'function') {\n return getCanonicalLocales(locales);\n }\n // NOTE: we must NOT call `supportedLocalesOf` of a formatjs polyfill, or their implementation\n // will even eventually call this method recursively. Here we use `Intl.DateTimeFormat` since it\n // is not polyfilled by `@formatjs`.\n // TODO: Fix TypeScript type def for this bc undefined is just fine\n return Intl.DateTimeFormat.supportedLocalesOf(locales);\n}\n//# sourceMappingURL=get-canonical-locales.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nimport { getCanonicalLocales } from './get-canonical-locales';\nimport { invariant } from './invariant';\nimport { toObject, getOption } from './polyfill-utils';\nexport function createResolveLocale(getDefaultLocale) {\n var lookupMatcher = createLookupMatcher(getDefaultLocale);\n var bestFitMatcher = createBestFitMatcher(getDefaultLocale);\n /**\n * https://tc39.es/ecma402/#sec-resolvelocale\n */\n return function resolveLocale(availableLocales, requestedLocales, options, relevantExtensionKeys, localeData) {\n var matcher = options.localeMatcher;\n var r;\n if (matcher === 'lookup') {\n r = lookupMatcher(availableLocales, requestedLocales);\n }\n else {\n r = bestFitMatcher(availableLocales, requestedLocales);\n }\n var foundLocale = r.locale;\n var result = { locale: '', dataLocale: foundLocale };\n var supportedExtension = '-u';\n for (var _i = 0, relevantExtensionKeys_1 = relevantExtensionKeys; _i < relevantExtensionKeys_1.length; _i++) {\n var key = relevantExtensionKeys_1[_i];\n var foundLocaleData = localeData[foundLocale];\n invariant(typeof foundLocaleData === 'object' && foundLocaleData !== null, \"locale data \" + key + \" must be an object\");\n var keyLocaleData = foundLocaleData[key];\n invariant(Array.isArray(keyLocaleData), \"keyLocaleData for \" + key + \" must be an array\");\n var value = keyLocaleData[0];\n invariant(typeof value === 'string' || value === null, 'value must be string or null');\n var supportedExtensionAddition = '';\n if (r.extension) {\n var requestedValue = unicodeExtensionValue(r.extension, key);\n if (requestedValue !== undefined) {\n if (requestedValue !== '') {\n if (~keyLocaleData.indexOf(requestedValue)) {\n value = requestedValue;\n supportedExtensionAddition = \"-\" + key + \"-\" + value;\n }\n }\n else if (~requestedValue.indexOf('true')) {\n value = 'true';\n supportedExtensionAddition = \"-\" + key;\n }\n }\n }\n if (key in options) {\n var optionsValue = options[key];\n invariant(typeof optionsValue === 'string' ||\n typeof optionsValue === 'undefined' ||\n optionsValue === null, 'optionsValue must be String, Undefined or Null');\n if (~keyLocaleData.indexOf(optionsValue)) {\n if (optionsValue !== value) {\n value = optionsValue;\n supportedExtensionAddition = '';\n }\n }\n }\n result[key] = value;\n supportedExtension += supportedExtensionAddition;\n }\n if (supportedExtension.length > 2) {\n var privateIndex = foundLocale.indexOf('-x-');\n if (privateIndex === -1) {\n foundLocale = foundLocale + supportedExtension;\n }\n else {\n var preExtension = foundLocale.slice(0, privateIndex);\n var postExtension = foundLocale.slice(privateIndex, foundLocale.length);\n foundLocale = preExtension + supportedExtension + postExtension;\n }\n foundLocale = getCanonicalLocales(foundLocale)[0];\n }\n result.locale = foundLocale;\n return result;\n };\n}\n/**\n * https://tc39.es/ecma402/#sec-unicodeextensionvalue\n * @param extension\n * @param key\n */\nfunction unicodeExtensionValue(extension, key) {\n invariant(key.length === 2, 'key must have 2 elements');\n var size = extension.length;\n var searchValue = \"-\" + key + \"-\";\n var pos = extension.indexOf(searchValue);\n if (pos !== -1) {\n var start = pos + 4;\n var end = start;\n var k = start;\n var done = false;\n while (!done) {\n var e = extension.indexOf('-', k);\n var len = void 0;\n if (e === -1) {\n len = size - k;\n }\n else {\n len = e - k;\n }\n if (len === 2) {\n done = true;\n }\n else if (e === -1) {\n end = size;\n done = true;\n }\n else {\n end = e;\n k = e + 1;\n }\n }\n return extension.slice(start, end);\n }\n searchValue = \"-\" + key;\n pos = extension.indexOf(searchValue);\n if (pos !== -1 && pos + 3 === size) {\n return '';\n }\n return undefined;\n}\nvar UNICODE_EXTENSION_SEQUENCE_REGEX = /-u(?:-[0-9a-z]{2,8})+/gi;\n/**\n * https://tc39.es/ecma402/#sec-bestavailablelocale\n * @param availableLocales\n * @param locale\n */\nfunction bestAvailableLocale(availableLocales, locale) {\n var candidate = locale;\n while (true) {\n if (~availableLocales.indexOf(candidate)) {\n return candidate;\n }\n var pos = candidate.lastIndexOf('-');\n if (!~pos) {\n return undefined;\n }\n if (pos >= 2 && candidate[pos - 2] === '-') {\n pos -= 2;\n }\n candidate = candidate.slice(0, pos);\n }\n}\nfunction createLookupMatcher(getDefaultLocale) {\n /**\n * https://tc39.es/ecma402/#sec-lookupmatcher\n */\n return function lookupMatcher(availableLocales, requestedLocales) {\n var result = { locale: '' };\n for (var _i = 0, requestedLocales_1 = requestedLocales; _i < requestedLocales_1.length; _i++) {\n var locale = requestedLocales_1[_i];\n var noExtensionLocale = locale.replace(UNICODE_EXTENSION_SEQUENCE_REGEX, '');\n var availableLocale = bestAvailableLocale(availableLocales, noExtensionLocale);\n if (availableLocale) {\n result.locale = availableLocale;\n if (locale !== noExtensionLocale) {\n result.extension = locale.slice(noExtensionLocale.length + 1, locale.length);\n }\n return result;\n }\n }\n result.locale = getDefaultLocale();\n return result;\n };\n}\nfunction createBestFitMatcher(getDefaultLocale) {\n return function bestFitMatcher(availableLocales, requestedLocales) {\n var result = { locale: '' };\n for (var _i = 0, requestedLocales_2 = requestedLocales; _i < requestedLocales_2.length; _i++) {\n var locale = requestedLocales_2[_i];\n var noExtensionLocale = locale.replace(UNICODE_EXTENSION_SEQUENCE_REGEX, '');\n var availableLocale = bestAvailableLocale(availableLocales, noExtensionLocale);\n if (availableLocale) {\n result.locale = availableLocale;\n if (locale !== noExtensionLocale) {\n result.extension = locale.slice(noExtensionLocale.length + 1, locale.length);\n }\n return result;\n }\n }\n result.locale = getDefaultLocale();\n return result;\n };\n}\nexport function getLocaleHierarchy(locale, aliases, parentLocales) {\n var results = [locale];\n if (aliases[locale]) {\n locale = aliases[locale];\n results.push(locale);\n }\n var parentLocale = parentLocales[locale];\n if (parentLocale) {\n results.push(parentLocale);\n }\n var localeParts = locale.split('-');\n for (var i = localeParts.length; i > 1; i--) {\n results.push(localeParts.slice(0, i - 1).join('-'));\n }\n return results;\n}\nfunction lookupSupportedLocales(availableLocales, requestedLocales) {\n var subset = [];\n for (var _i = 0, requestedLocales_3 = requestedLocales; _i < requestedLocales_3.length; _i++) {\n var locale = requestedLocales_3[_i];\n var noExtensionLocale = locale.replace(UNICODE_EXTENSION_SEQUENCE_REGEX, '');\n var availableLocale = bestAvailableLocale(availableLocales, noExtensionLocale);\n if (availableLocale) {\n subset.push(availableLocale);\n }\n }\n return subset;\n}\nexport function supportedLocales(availableLocales, requestedLocales, options) {\n var matcher = 'best fit';\n if (options !== undefined) {\n options = toObject(options);\n matcher = getOption(options, 'localeMatcher', 'string', ['lookup', 'best fit'], 'best fit');\n }\n if (matcher === 'best fit') {\n return lookupSupportedLocales(availableLocales, requestedLocales);\n }\n return lookupSupportedLocales(availableLocales, requestedLocales);\n}\nvar MissingLocaleDataError = /** @class */ (function (_super) {\n __extends(MissingLocaleDataError, _super);\n function MissingLocaleDataError() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = 'MISSING_LOCALE_DATA';\n return _this;\n }\n return MissingLocaleDataError;\n}(Error));\nexport function isMissingLocaleDataError(e) {\n return e.type === 'MISSING_LOCALE_DATA';\n}\nexport function unpackData(locale, localeData, \n/** By default shallow merge the dictionaries. */\nreducer) {\n if (reducer === void 0) { reducer = function (all, d) { return (__assign(__assign({}, all), d)); }; }\n var localeHierarchy = getLocaleHierarchy(locale, localeData.aliases, localeData.parentLocales);\n var dataToMerge = localeHierarchy\n .map(function (l) { return localeData.data[l]; })\n .filter(Boolean);\n if (!dataToMerge.length) {\n throw new MissingLocaleDataError(\"Missing locale data for \\\"\" + locale + \"\\\", lookup hierarchy: \" + localeHierarchy.join(', '));\n }\n dataToMerge.reverse();\n return dataToMerge.reduce(reducer, {});\n}\n//# sourceMappingURL=resolve-locale.js.map","var __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __values = (this && this.__values) || function(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n};\nvar __read = (this && this.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spread = (this && this.__spread) || function () {\n for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i]));\n return ar;\n};\nimport { toObject, getOption, getLocaleHierarchy, supportedLocales, getCanonicalLocales, createResolveLocale, setInternalSlot, getInternalSlot, invariant, partitionPattern, isLiteralPart, } from '@formatjs/intl-utils';\nfunction unpackData(locale, localeData) {\n var localeHierarchy = getLocaleHierarchy(locale, localeData.aliases, localeData.parentLocales);\n var dataToMerge = localeHierarchy\n .map(function (l) { return localeData.data[l]; })\n .filter(Boolean);\n if (!dataToMerge.length) {\n throw new Error(\"Missing locale data for \\\"\" + locale + \"\\\", lookup hierarchy: \" + localeHierarchy.join(', '));\n }\n dataToMerge.reverse();\n return dataToMerge.reduce(function (all, d) { return (__assign(__assign({}, all), d)); }, { nu: [] });\n}\n/**\n * https://tc39.es/proposal-intl-relative-time/#sec-singularrelativetimeunit\n * @param unit\n */\nfunction singularRelativeTimeUnit(unit) {\n invariant(typeof unit === 'string', \"unit must be a string, instead got \" + typeof unit, TypeError);\n if (unit === 'seconds')\n return 'second';\n if (unit === 'minutes')\n return 'minute';\n if (unit === 'hours')\n return 'hour';\n if (unit === 'days')\n return 'day';\n if (unit === 'weeks')\n return 'week';\n if (unit === 'months')\n return 'month';\n if (unit === 'quarters')\n return 'quarter';\n if (unit === 'years')\n return 'year';\n if (unit !== 'second' &&\n unit !== 'minute' &&\n unit !== 'hour' &&\n unit !== 'day' &&\n unit !== 'week' &&\n unit !== 'month' &&\n unit !== 'quarter' &&\n unit !== 'year') {\n throw new RangeError(\"Invalid unit \" + unit);\n }\n return unit;\n}\nvar NUMBERING_SYSTEM_REGEX = /^[a-z0-9]{3,8}(-[a-z0-9]{3,8})*$/i;\n/**\n * https://tc39.es/proposal-intl-relative-time/#sec-makepartslist\n * @param pattern\n * @param unit\n * @param parts\n */\nfunction makePartsList(pattern, unit, parts) {\n var e_1, _a, e_2, _b;\n var patternParts = partitionPattern(pattern);\n var result = [];\n try {\n for (var patternParts_1 = __values(patternParts), patternParts_1_1 = patternParts_1.next(); !patternParts_1_1.done; patternParts_1_1 = patternParts_1.next()) {\n var patternPart = patternParts_1_1.value;\n if (isLiteralPart(patternPart)) {\n result.push({\n type: 'literal',\n value: patternPart.value,\n });\n }\n else {\n invariant(patternPart.type === '0', \"Malformed pattern \" + pattern);\n try {\n for (var parts_1 = (e_2 = void 0, __values(parts)), parts_1_1 = parts_1.next(); !parts_1_1.done; parts_1_1 = parts_1.next()) {\n var part = parts_1_1.value;\n result.push({\n type: part.type,\n value: part.value,\n unit: unit,\n });\n }\n }\n catch (e_2_1) { e_2 = { error: e_2_1 }; }\n finally {\n try {\n if (parts_1_1 && !parts_1_1.done && (_b = parts_1.return)) _b.call(parts_1);\n }\n finally { if (e_2) throw e_2.error; }\n }\n }\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (patternParts_1_1 && !patternParts_1_1.done && (_a = patternParts_1.return)) _a.call(patternParts_1);\n }\n finally { if (e_1) throw e_1.error; }\n }\n return result;\n}\nfunction objectIs(x, y) {\n if (Object.is) {\n return Object.is(x, y);\n }\n // SameValue algorithm\n if (x === y) {\n // Steps 1-5, 7-10\n // Steps 6.b-6.e: +0 != -0\n return x !== 0 || 1 / x === 1 / y;\n }\n // Step 6.a: NaN == NaN\n return x !== x && y !== y;\n}\nfunction toString(arg) {\n return arg + '';\n}\n/**\n * PartitionRelativeTimePattern\n * @param rtf\n * @param value\n * @param unit\n */\nfunction partitionRelativeTimePattern(internalSlotMap, rtf, value, unit) {\n invariant(typeof value === 'number', \"value must be number, instead got \" + typeof value, TypeError);\n invariant(typeof unit === 'string', \"unit must be number, instead got \" + typeof value, TypeError);\n if (isNaN(value) || value === Infinity || value === -Infinity) {\n throw new RangeError(\"Invalid value \" + value);\n }\n var resolvedUnit = singularRelativeTimeUnit(unit);\n var fields = getInternalSlot(internalSlotMap, rtf, 'fields');\n var style = getInternalSlot(internalSlotMap, rtf, 'style');\n var entry = resolvedUnit;\n if (style === 'short') {\n entry = unit + \"-short\";\n }\n else if (style === 'narrow') {\n entry = unit + \"-narrow\";\n }\n if (!(entry in fields)) {\n entry = unit;\n }\n var patterns = fields[entry];\n var numeric = getInternalSlot(internalSlotMap, rtf, 'numeric');\n if (numeric === 'auto') {\n if (toString(value) in patterns) {\n return [\n {\n type: 'literal',\n value: patterns[toString(value)],\n },\n ];\n }\n }\n var tl = 'future';\n if (objectIs(value, -0) || value < 0) {\n tl = 'past';\n }\n var po = patterns[tl];\n var pluralRules = getInternalSlot(internalSlotMap, rtf, 'pluralRules');\n var numberFormat = getInternalSlot(internalSlotMap, rtf, 'numberFormat');\n var fv = typeof numberFormat.formatToParts === 'function'\n ? numberFormat.formatToParts(Math.abs(value))\n : // TODO: If formatToParts is not supported, we assume the whole formatted\n // number is a part\n [\n {\n type: 'literal',\n value: numberFormat.format(Math.abs(value)),\n unit: unit,\n },\n ];\n var pr = pluralRules.select(value);\n var pattern = po[pr];\n return makePartsList(pattern, resolvedUnit, fv);\n}\nvar RelativeTimeFormat = /** @class */ (function () {\n function RelativeTimeFormat(locales, options) {\n // test262/test/intl402/RelativeTimeFormat/constructor/constructor/newtarget-undefined.js\n // Cannot use `new.target` bc of IE11 & TS transpiles it to something else\n var newTarget = this && this instanceof RelativeTimeFormat ? this.constructor : void 0;\n if (!newTarget) {\n throw new TypeError(\"Intl.RelativeTimeFormat must be called with 'new'\");\n }\n setInternalSlot(RelativeTimeFormat.__INTERNAL_SLOT_MAP__, this, 'initializedRelativeTimeFormat', true);\n var requestedLocales = getCanonicalLocales(locales);\n var opt = Object.create(null);\n var opts = options === undefined ? Object.create(null) : toObject(options);\n var matcher = getOption(opts, 'localeMatcher', 'string', ['best fit', 'lookup'], 'best fit');\n opt.localeMatcher = matcher;\n var numberingSystem = getOption(opts, 'numberingSystem', 'string', undefined, undefined);\n if (numberingSystem !== undefined) {\n if (!NUMBERING_SYSTEM_REGEX.test(numberingSystem)) {\n throw new RangeError(\"Invalid numbering system \" + numberingSystem);\n }\n }\n opt.nu = numberingSystem;\n var r = createResolveLocale(RelativeTimeFormat.getDefaultLocale)(RelativeTimeFormat.availableLocales, requestedLocales, opt, RelativeTimeFormat.relevantExtensionKeys, RelativeTimeFormat.localeData);\n var locale = r.locale, nu = r.nu;\n setInternalSlot(RelativeTimeFormat.__INTERNAL_SLOT_MAP__, this, 'locale', locale);\n setInternalSlot(RelativeTimeFormat.__INTERNAL_SLOT_MAP__, this, 'style', getOption(opts, 'style', 'string', ['long', 'narrow', 'short'], 'long'));\n setInternalSlot(RelativeTimeFormat.__INTERNAL_SLOT_MAP__, this, 'numeric', getOption(opts, 'numeric', 'string', ['always', 'auto'], 'always'));\n setInternalSlot(RelativeTimeFormat.__INTERNAL_SLOT_MAP__, this, 'fields', RelativeTimeFormat.localeData[locale]);\n setInternalSlot(RelativeTimeFormat.__INTERNAL_SLOT_MAP__, this, 'numberFormat', new Intl.NumberFormat(locales));\n setInternalSlot(RelativeTimeFormat.__INTERNAL_SLOT_MAP__, this, 'pluralRules', new Intl.PluralRules(locales));\n setInternalSlot(RelativeTimeFormat.__INTERNAL_SLOT_MAP__, this, 'numberingSystem', nu);\n }\n RelativeTimeFormat.prototype.format = function (value, unit) {\n if (typeof this !== 'object') {\n throw new TypeError('format was called on a non-object');\n }\n if (!getInternalSlot(RelativeTimeFormat.__INTERNAL_SLOT_MAP__, this, 'initializedRelativeTimeFormat')) {\n throw new TypeError('format was called on a invalid context');\n }\n return partitionRelativeTimePattern(RelativeTimeFormat.__INTERNAL_SLOT_MAP__, this, Number(value), toString(unit))\n .map(function (el) { return el.value; })\n .join('');\n };\n RelativeTimeFormat.prototype.formatToParts = function (value, unit) {\n if (typeof this !== 'object') {\n throw new TypeError('formatToParts was called on a non-object');\n }\n if (!getInternalSlot(RelativeTimeFormat.__INTERNAL_SLOT_MAP__, this, 'initializedRelativeTimeFormat')) {\n throw new TypeError('formatToParts was called on a invalid context');\n }\n return partitionRelativeTimePattern(RelativeTimeFormat.__INTERNAL_SLOT_MAP__, this, Number(value), toString(unit));\n };\n RelativeTimeFormat.prototype.resolvedOptions = function () {\n if (typeof this !== 'object') {\n throw new TypeError('resolvedOptions was called on a non-object');\n }\n if (!getInternalSlot(RelativeTimeFormat.__INTERNAL_SLOT_MAP__, this, 'initializedRelativeTimeFormat')) {\n throw new TypeError('resolvedOptions was called on a invalid context');\n }\n // test262/test/intl402/RelativeTimeFormat/prototype/resolvedOptions/type.js\n return {\n locale: getInternalSlot(RelativeTimeFormat.__INTERNAL_SLOT_MAP__, this, 'locale'),\n style: getInternalSlot(RelativeTimeFormat.__INTERNAL_SLOT_MAP__, this, 'style'),\n numeric: getInternalSlot(RelativeTimeFormat.__INTERNAL_SLOT_MAP__, this, 'numeric'),\n numberingSystem: getInternalSlot(RelativeTimeFormat.__INTERNAL_SLOT_MAP__, this, 'numberingSystem'),\n };\n };\n RelativeTimeFormat.supportedLocalesOf = function (locales, options) {\n return supportedLocales(RelativeTimeFormat.availableLocales, getCanonicalLocales(locales), options);\n };\n RelativeTimeFormat.__addLocaleData = function () {\n var e_3, _a;\n var data = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n data[_i] = arguments[_i];\n }\n var _loop_1 = function (datum) {\n var availableLocales = Object.keys(__spread(datum.availableLocales, Object.keys(datum.aliases), Object.keys(datum.parentLocales)).reduce(function (all, k) {\n all[k] = true;\n return all;\n }, {}));\n availableLocales.forEach(function (locale) {\n try {\n RelativeTimeFormat.localeData[locale] = unpackData(locale, datum);\n }\n catch (e) {\n // If we can't unpack this data, ignore the locale\n }\n });\n };\n try {\n for (var data_1 = __values(data), data_1_1 = data_1.next(); !data_1_1.done; data_1_1 = data_1.next()) {\n var datum = data_1_1.value;\n _loop_1(datum);\n }\n }\n catch (e_3_1) { e_3 = { error: e_3_1 }; }\n finally {\n try {\n if (data_1_1 && !data_1_1.done && (_a = data_1.return)) _a.call(data_1);\n }\n finally { if (e_3) throw e_3.error; }\n }\n RelativeTimeFormat.availableLocales = Object.keys(RelativeTimeFormat.localeData);\n if (!RelativeTimeFormat.__defaultLocale) {\n RelativeTimeFormat.__defaultLocale =\n RelativeTimeFormat.availableLocales[0];\n }\n };\n RelativeTimeFormat.getDefaultLocale = function () {\n return RelativeTimeFormat.__defaultLocale;\n };\n RelativeTimeFormat.localeData = {};\n RelativeTimeFormat.availableLocales = [];\n RelativeTimeFormat.__defaultLocale = 'en';\n RelativeTimeFormat.relevantExtensionKeys = ['nu'];\n RelativeTimeFormat.polyfilled = true;\n RelativeTimeFormat.__INTERNAL_SLOT_MAP__ = new WeakMap();\n return RelativeTimeFormat;\n}());\nexport default RelativeTimeFormat;\ntry {\n // IE11 does not have Symbol\n if (typeof Symbol !== 'undefined') {\n Object.defineProperty(RelativeTimeFormat.prototype, Symbol.toStringTag, {\n value: 'Intl.RelativeTimeFormat',\n writable: false,\n enumerable: false,\n configurable: true,\n });\n }\n // https://github.com/tc39/test262/blob/master/test/intl402/RelativeTimeFormat/constructor/length.js\n Object.defineProperty(RelativeTimeFormat.prototype.constructor, 'length', {\n value: 0,\n writable: false,\n enumerable: false,\n configurable: true,\n });\n // https://github.com/tc39/test262/blob/master/test/intl402/RelativeTimeFormat/constructor/supportedLocalesOf/length.js\n Object.defineProperty(RelativeTimeFormat.supportedLocalesOf, 'length', {\n value: 1,\n writable: false,\n enumerable: false,\n configurable: true,\n });\n}\ncatch (e) {\n // Meta fix so we're test262-compliant, not important\n}\n//# sourceMappingURL=core.js.map"],"names":["invariant","condition","message","Err","Error","toObject","arg","TypeError","Object","getOption","opts","prop","type","values","fallback","value","undefined","Boolean","o","String","toString","filter","val","length","RangeError","join","setInternalSlot","map","pl","field","get","set","create","getInternalSlot","fields","_i","arguments","slots","reduce","all","f","getMultiInternalSlots","getCanonicalLocales","locales","Intl","DateTimeFormat","supportedLocalesOf","extendStatics","__extends","d","b","setPrototypeOf","__proto__","Array","p","hasOwnProperty","__","this","constructor","prototype","createResolveLocale","getDefaultLocale","lookupMatcher","availableLocales","requestedLocales","result","locale","requestedLocales_1","noExtensionLocale","replace","UNICODE_EXTENSION_SEQUENCE_REGEX","availableLocale","bestAvailableLocale","extension","slice","bestFitMatcher","requestedLocales_2","options","relevantExtensionKeys","localeData","privateIndex","r","localeMatcher","foundLocale","dataLocale","supportedExtension","relevantExtensionKeys_1","key","foundLocaleData","keyLocaleData","isArray","requestedValue","optionsValue","supportedExtensionAddition","unicodeExtensionValue","indexOf","size","searchValue","pos","start","end","k","done","e","candidate","lastIndexOf","lookupSupportedLocales","subset","requestedLocales_3","push","_super","MissingLocaleDataError","_this","apply","__assign","assign","t","s","i","n","call","__values","Symbol","iterator","m","next","__read","ar","error","__spread","concat","unpackData","localeHierarchy","aliases","parentLocales","results","parentLocale","localeParts","split","getLocaleHierarchy","dataToMerge","l","data","reverse","nu","NUMBERING_SYSTEM_REGEX","makePartsList","pattern","unit","parts","e_1","_a","e_2","_b","patternParts","beginIndex","endIndex","nextIndex","substring","partitionPattern","patternParts_1","patternParts_1_1","patternPart","parts_1","parts_1_1","part","e_2_1","return","e_1_1","partitionRelativeTimePattern","internalSlotMap","rtf","isNaN","Infinity","resolvedUnit","singularRelativeTimeUnit","style","entry","patterns","x","y","tl","is","po","pluralRules","numberFormat","fv","formatToParts","Math","abs","format","select","RelativeTimeFormat","__INTERNAL_SLOT_MAP__","Number","el","resolvedOptions","numeric","numberingSystem","__addLocaleData","e_3","_loop_1","datum","keys","forEach","data_1","data_1_1","e_3_1","__defaultLocale","polyfilled","WeakMap","opt","matcher","test","NumberFormat","PluralRules","defineProperty","toStringTag","writable","enumerable","configurable"],"mappings":"mNAAO,SAASA,EAAUC,EAAWC,EAASC,GAE1C,QADY,IAARA,IAAkBA,EAAMC,QACvBH,EACD,MAAM,IAAIE,EAAID,GCIf,SAASG,EAASC,GACrB,GAAW,MAAPA,EACA,MAAM,IAAIC,UAAU,gDAExB,OAAOC,OAAOF,GAoBX,SAASG,EAAUC,EAAMC,EAAMC,EAAMC,EAAQC,GAEhD,IAAIC,EAAQL,EAAKC,GACjB,QAAcK,IAAVD,EAeJ,OAAOD,EAdH,GAAa,YAATF,GAA+B,WAATA,EACtB,MAAM,IAAIL,UAAU,gBAQxB,GANa,YAATK,IACAG,EAAQE,QAAQF,IAEP,WAATH,IACAG,EA1BL,SAAkBG,GAErB,GAAiB,iBAANA,EACP,MAAMX,UAAU,6CAEpB,OAAOY,OAAOD,GAqBEE,CAASL,SAENC,IAAXH,IAAyBA,EAAOQ,OAAO,SAAUC,GAAO,OAAOA,GAAOP,IAAUQ,OAChF,MAAM,IAAIC,WAAWT,EAAQ,kBAAoBF,EAAOY,KAAK,OAEjE,OAAOV,EAiDR,SAASW,EAAgBC,EAAKC,EAAIC,EAAOd,GACvCY,EAAIG,IAAIF,IACTD,EAAII,IAAIH,EAAIpB,OAAOwB,OAAO,OAElBL,EAAIG,IAAIF,GACdC,GAASd,EAQZ,SAASkB,EAAgBN,EAAKC,EAAIC,GACrC,OAEG,SAA+BF,EAAKC,GAEvC,IADA,IAAIM,EAAS,GACJC,EAAK,EAAGA,EAAKC,UAAUb,OAAQY,IACpCD,EAAOC,EAAK,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